Commit Graph

413 Commits

Author SHA1 Message Date
Zach Copley
997d160002 Kill off all document._importNode() calls except the ones used with the JQuery Form plugin (fixes an IE7 issue) 2011-04-26 17:14:45 -07:00
Zach Copley
76ea9384a3 Remove billions of debugging statements and extra space 2011-04-18 16:49:32 -07:00
Zach Copley
583b903559 More work trying to understand util.js and get my ajax working right 2011-04-18 16:49:00 -07:00
Zach Copley
d1443a6bd9 Getting some traction here on better QnA Ajax 2011-04-18 16:47:33 -07:00
Zach Copley
6bf29ff684 QnA - Work on getting questions and answers to appear correctly inline 2011-04-18 16:46:11 -07:00
Samantha Doherty
e8e6d494d2 This util.min.js is pining for the fjords. 2011-04-18 12:42:00 -04:00
Samantha Doherty
027cdd4620 Need to be a little more specific about infield input labels. 2011-04-18 11:45:02 -04:00
Samantha Doherty
3b5966430c Apply infield labels to notice form inputs. 2011-04-18 00:38:26 -04:00
Samantha Doherty
572f1d582c Only auto-focus on textarea for main notice form. 2011-04-18 00:31:47 -04:00
Zach Copley
443b495a0b Fix inline replies (pretty sure I got it this time) 2011-04-17 20:34:17 -07:00
Zach Copley
eaca17be58 Allow sending in a function to be run on successful XHR 2011-04-17 18:36:59 -07:00
Evan Prodromou
82577a9dc2 don't try to pre-init the @-reply 2011-04-16 16:23:31 -04:00
Brion Vibber
79190c87b2 Fix regression in inline replies to newly added messages (regression from my fixes w/ the realtime stuff) 2011-04-15 15:03:20 -07:00
Zach Copley
03de85ed46 Make it so input forms that don't have navigation don't accidentally get hidden. Add a "nonav" class to them. 2011-04-12 14:20:19 -07:00
Evan Prodromou
09cffc1928 hide and disable ToSelector for replies 2011-04-11 12:55:49 -04:00
Shashi Gowda
c44a94e8f5 Port autocomplete from tagInput to jQuery UI, send Last-Modified header and look for it in JS. 2011-04-08 14:51:05 +05:30
Shashi Gowda
ad86eb78d3 Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	js/util.min.js
	lib/default.php
2011-04-07 23:13:45 +05:30
Evan Prodromou
ac24ed3dff add checkbox initialization 2011-04-05 11:48:53 -04:00
Shashi Gowda
5a2bab07b2 Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	actions/tagother.php
	classes/Profile.php
	classes/Profile_tag.php
	js/util.min.js
2011-03-30 15:47:42 +05:30
Brion Vibber
2707a481e4 Enhancement for 'ajax' form class: submit buttons behave more like normal submissions, submitting their name/values through a hidden field.
This should work well for simple cases, but could conceivably create false positives if there's a click handler on the specific buttons, depending on whether event processing passes it on. Double-check if you're doing such forms along with the 'ajax' class!
2011-03-23 15:21:31 -07:00
Shashi Gowda
31c1177970 Merge branch '1.0.x' into people_tags_rebase
Conflicts:
	EVENTS.txt
	actions/peopletag.php
	actions/tagother.php
	classes/Notice.php
	js/util.js
	js/util.min.js
	lib/accountprofileblock.php
	lib/action.php
	lib/activityobject.php
	lib/command.php
	lib/personalgroupnav.php
	plugins/OStatus/OStatusPlugin.php
2011-03-22 07:56:25 +05:30
Brion Vibber
4afa3caae3 ajax load for additional inline replies; /replies variant of conversationview 2011-03-17 16:27:42 -07:00
Brion Vibber
057a831026 Fixes for race conditions between Realtime plugin and the AJAX display of inline replies.
* keep the notice-reply-placeholder around, but hidden
* insert things before the placeholder, rather than appending to the end of the list.
* append the active form after the hidden placeholder, so things inserted before the placeholder never come after it
* Realtime: check pre-existing notice visibility a second time after loading the HTML for a notice. Fixes bug where sometimes your own post would be shown twice because the Realtime notification arrived before the AJAX posting returned, but Realtime's AJAX fetch of the notice returned after.
2011-03-17 15:54:40 -07:00
Brion Vibber
7d202e9c61 Detect and show AJAX errors on FormXHR submission handling.
Previously we threw away errore reported by the actual AJAX submission and only used whatever error the browser reported to us; this didn't help if we reached the server ok but had a problem there.
We now extract the #error if given and use that in the alert().
Also should now show 'Unknown error' instead of a crappy generic 'something died in jQuery' when we get a 200 response but bogus return data.
2011-03-16 16:10:43 -07:00
Brion Vibber
2bccd18d9a JS optimization: move creation of inline reply placeholders to server-side so we don't have to create them client-side (which causes reflows and takes about 25-30ms on my test system)
Using live instead of bind for the event handling, we don't have to play any games on the ones that we do add at runtime. Yay!
2011-03-11 15:20:20 -08:00
Brion Vibber
10e5cb482e JS performance: speeding up initialization by consolidating event handlers for reply buttons
Saved about 60ms on my test system during page setup by using a single global 'live' click handler for reply links.
No longer need to seek out and attach event handlers on every notice, yay!
2011-03-11 15:03:15 -08:00
Brion Vibber
0f3af3e3b7 Keep 'Status' tab current while showing the placeholder -- pretend like it's a mini version of the status notice form :D 2011-03-10 18:01:40 -08:00
Brion Vibber
0ee5d79739 Return to placeholder entry after successful post 2011-03-10 17:54:07 -08:00
Brion Vibber
6066bce02c Clicking outside the active top posting form now returns to the placeholder if all textarea/input fields are empty 2011-03-10 17:52:03 -08:00
Brion Vibber
b89b89ce89 Focus in textarea when popping up the status tab 2011-03-10 17:44:17 -08:00
Brion Vibber
f88689cc87 Trigger status notice form when top placeholder form gets used. Delay initialization of notice ajax forms until they get shown. 2011-03-10 17:40:39 -08:00
Brion Vibber
874804a0c4 use a data attribute instead of 'title' for geo lookup api; fixes failure of cloned forms to work 2011-03-10 16:49:24 -08:00
Brion Vibber
e43ee373ae Fix disappearing reply forms when closing geo section
Missing default-cancel in the click handler allowed the event to bubble up to the body handler, where we think the click is outside of the form because the target is no longer in the form by the time we check
Now the event no longer bubbles up, as we cancel it when we're done.
2011-03-10 16:29:13 -08:00
Brion Vibber
eef9786e36 click -> focus for reply placeholder trigger; lets keyboarders use it though not super ideal :D 2011-03-10 16:23:18 -08:00
Brion Vibber
d107164aec Tweaks for closing 2011-03-10 16:15:44 -08:00
Brion Vibber
4e1ce4e5bb Remove inline reply forms on click-away if they have initial text as well as if empty (plus whitespace stripping) 2011-03-10 16:10:58 -08:00
Brion Vibber
acca8a24b4 Fix for inline reply placeholders: only remove the one we're clicking in, not all of them! 2011-03-10 16:08:28 -08:00
Brion Vibber
6b5b6d072b Make inline reply forms close when clicking outside them if there's no text again.
(That went away when we switched to reusing the main notice form)
2011-03-10 16:06:01 -08:00
Brion Vibber
ec828a094c Update LinkPreview plugin for multiple notice forms.
* main notice form setup now encapsulated into SN.Init.NoticeForm(form) -- this can be monkeypatched by plugins to append their own setup code, as LinkPreview does
* LinkPreview now supports debugging with non-minified JS source when $config['site']['minify'] is false
* tweaked core & neo styles so 'notice-status' class gets same styles as attach-status, so we can more easily add mroe statusy things. (needs more consolidation with geo-status, etc)
* tweaked LinkPreview's preview area to use that style
2011-03-09 17:43:31 -08:00
Brion Vibber
cecc2576a5 Fixes for direct message form for JS changes to the main form 2011-03-09 16:55:52 -08:00
Brion Vibber
040baf291d Fix for input tab selection 2011-03-09 13:05:12 -08:00
Brion Vibber
cbf16a4974 Bookmark and poll plugins' custom notice forms now do AJAX submit, with the resulting notice appearing in the timeline.
FormNoticeXHR now is triggered on any form labeled with class 'ajax-notice', so those other than the traditional notice form should work as long as they handle the AJAX submission and return a properly formatted notice.

Things to watch out for:
* to determine whether the resulting notice should show on the current timeline, the JS code needs to be able to check the author and such. Keeping the existing vcard bits helps for this!
* the notice form submission stuff clears out inputs from your form -- test to make sure this behaves correctly
* error messages returned from the thingy _should_ come through, but this needs more testing for consistency
* while form components that aren't in a custom form should just be ignored, this should be tested more. (eg there's no location or attachment box for poll or bookmark plugins)
* NoticeListItem isn't currently reachable via autoloader -- touch NoticeList explicitly before calling into it for now.
2011-03-08 15:10:30 -08:00
Brion Vibber
28809035d0 Replace explicit FormXHR setup for a bunch of simple AJAX form submissions with adding the 'ajax' class on them.
This avoids having to add extra custom JS bits just to initialize forms using the common AJAX submission path.
2011-03-08 13:58:28 -08:00
Brion Vibber
90f1cfcfc0 Poll plugin: make the polling response form submit via AJAX and return the results.
Now, any form marked with 'ajax' class will get the simple FormXHR treatment. Should help cut down on code that just adds that into individual forms.
2011-03-08 13:45:51 -08:00
Brion Vibber
0c2289fb2f Avoid AJAX fetch delay for inline replies when possible; we clone a copy of the notice form skeleton at initialization, then insert it in place instead of fetching a new one. 2011-03-07 12:18:46 -08:00
Evan Prodromou
cf1a4d8292 Input form switcher works
This change adds the input form switcher, which adds a navigation menu
across the top of the input form, letting you switch between different kinds of input.

The input menu doesn't yet look like a nice set of tabs; it could use some love.
2011-03-07 04:57:49 -05:00
Shashi Gowda
b372ed721d styling for people tag UI 2011-03-07 00:44:21 +05:30
Brion Vibber
2fa95144ed Cleanup & minification for migration to reusable notice form in inline replies. Yay! 2011-03-04 15:00:20 -08:00
Brion Vibber
a1002cc107 Work in progress: inline reply form reusing the main reply form now inserts the successful result more or less right 2011-03-04 14:58:30 -08:00
Brion Vibber
5358f78e82 Reusable notice form fixes for geolocation 2011-03-04 14:27:55 -08:00
Brion Vibber
9689bda21c Loading the original form instead of faking up our own. Sorta works but not pretty :D 2011-03-04 14:11:11 -08:00
Brion Vibber
b68f8643a2 Kill some more hardcoded ids... 2011-03-04 13:53:41 -08:00
Brion Vibber
56d5c4a4d1 More hardcoded id cleanup in notice form... 2011-03-04 13:40:33 -08:00
Brion Vibber
e7662bb1d9 Moving bit by bit more towards reusable forms... per-form-izing some of the location setup (not all yet) 2011-03-03 17:58:35 -08:00
Brion Vibber
cd20190ba5 Remove hardcoded #notice_action-submit from JS/CSS (prep for reusable notice forms) 2011-03-03 17:48:16 -08:00
Brion Vibber
9d40c8f835 Pulling out some more #-references to per-form items 2011-03-03 17:39:37 -08:00
Brion Vibber
b58aa29168 Notice form cleanup: removing hardcoded id from counter references; prep for reusable notice forms. 2011-03-03 17:15:17 -08:00
Brion Vibber
f94a5e1a6a Notice form cleanup: drop use of id for #notice_data-text (prep for reusable notice form) 2011-03-03 17:05:19 -08:00
Brion Vibber
1ff17f0ed9 Notice form cleanup: removing hardcoded IDs from attachment handling (prep for reusable notice forms) 2011-03-03 16:56:54 -08:00
Brion Vibber
488230c3e1 Drop auto-focusing of the notice form. 2011-03-03 16:15:28 -08:00
Brion Vibber
822f08e3ed Kill 'hit return to send'... 2011-03-03 16:14:36 -08:00
Brion Vibber
6f73b2870b Rework geolocation status display so you can actually tell what it's doing and whether a location will be posted.
Goes in along with the file attachment info, below the notice box. Still needs to be generalized to work with multiple forms.
2011-03-03 15:21:27 -08:00
Brion Vibber
5a404ee713 'Comment' -> 'Reply' in inline comment/reply messages 2011-03-03 12:26:07 -08:00
Brion Vibber
018b11a883 Fix for realtime vs threaded reply fix 2011-03-01 16:29:00 -08:00
Brion Vibber
764d069ccd Clean up threaded notices vs replies classes, and fixed realtime's threaded behavior to only run on threaded lists 2011-03-01 16:08:37 -08:00
Brion Vibber
9fd2ee86f3 Inline reply work for threaded lists in realtime 2011-03-01 16:04:11 -08:00
Brion Vibber
c6521db620 Fix for timeline insert on primary AJAX post: only insert on the first, primary timeline. Don't insert on sub-timelines for replies! 2011-03-01 15:24:44 -08:00
Brion Vibber
db4ab2cd92 When canceling out of inline reply field and there are no other replies, drop the section 2011-03-01 14:26:11 -08:00
Brion Vibber
e6c972ebcb Inline replies: drop the box if tabbing out and no text 2011-03-01 14:24:06 -08:00
Brion Vibber
c0dcd73379 Inline replies: fix replies on repeats, placeholder re-add when replying to a reply 2011-03-01 13:49:13 -08:00
Brion Vibber
d01648248e Inline replies now do ajaxy submit. Neat! Not 100% perfect though 2011-02-28 16:38:44 -08:00
Brion Vibber
f109d15c28 avoid hardcoding action & session token; pull them from the main posting form for now 2011-02-28 16:24:51 -08:00
Brion Vibber
59a0b2a82d Merge branch '1.0.x' of gitorious.org:statusnet/mainline into inline-comments
Conflicts:
	js/util.min.js
2011-02-28 16:18:38 -08:00
Brion Vibber
62712b794a More interactive magic for inline replies: placeholder at the end of list 2011-02-28 16:13:16 -08:00
Brion Vibber
e89bffc3f1 Work in progress: setting up inline reply mini-form in js 2011-02-28 15:38:54 -08:00
Brion Vibber
9fcad91d8d Ticket #3014: check upload size limits client-side in supporting browsers
Tested successfully in:
* Firefox 4.0b9
* Safari 5.0.5
* Chrome 8.0.522
2011-01-25 16:26:56 -08:00
Brion Vibber
e0606d3eca Break xbImportNode.js and geometa.js back out of util.js; the Makefile in js has been updated to combine them with util.js source when building util.min.js
Revert "combine our standard scripts into one big script"

This reverts parts of commit 0c5ca46ba3.
2010-12-22 15:22:02 -08:00
Brion Vibber
46d9496ee6 Tickets #2112, 2333, 1677, 2362, 2831: fix AJAX form posting on SSL page views with ssl=sometimes
These have been failing for ages due to our outputting full URLs all the time, usually with the default protocol instead of the current one.
Forms would get output with an http: URL in their contents even when destined for an HTTPS page; while a regular form submission would just warn you about the secure->insecure transition, the AJAX code was failing outright and then not bothering to fall back to the regular submission.

I found it was easy to detect the mismatch -- just check the target URL and the current page's protocol before submitting.

Since failing over to non-AJAX submission to the HTTP URL throws up a warning, I figured it'd be easier (and much nicer for users) to just let it rewrite the target URL to use the secure protocol & hostname before doing the final submit.
This check is now automatically done for anything that calls SN.U.FormXHR() -- making most of our buttons on notices and profile/group headers work naturally.
The notice form setup code also runs the rewrite, which gets posting working without an error dialog.

I'd prefer in the long run to simply use relative URLs in most of our output; it avoids this problem completely and lets users simply stay in the current protocol mode instead of being constantly switched back to HTTP when clicking around.
(Note that folks using the SSLAlways extension to Firefox, for instance, will have their browsers constantly sending them back to HTTP pages, mimicking the desired user experience even though we haven't fully implemented it. These folks are likely going to be a lot happier with forms that submit correctly to go along with it!)
2010-12-16 17:02:02 -08:00
Brion Vibber
532178e3ee Fix for ticket #2910: fix inconsistencies in notice posting response display that broke help command, could be generally wonky
Previous code was importing nodes from the XHR result into current document, then pulling text content of what might be the right element, then concat'ing that straight into HTML. Eww! Now pulling the text content straight from the XHR result -- same element that we check for existence of -- and using jQuery's own text() to do the getting and setting of text. Also note that some browsers might have been pulling HTML instead of text, or other funkiness.
2010-12-16 16:18:49 -08:00
Brion Vibber
f901c25012 Add lots of doc comments to util.js. Most stuff makes some kind of stuff, but some is kinda.... funky :D
These comments are all stripped during minification, so util.min.js remains unchanged.
2010-12-16 15:34:51 -08:00
Brion Vibber
364bc6e642 work in progress 2010-12-16 15:04:48 -08:00
Brion Vibber
2836c4e561 Fix for ticket #2942: character counter now updates on cut and paste operations made with mouse or menu
This uses the 'copy' and 'paste' DOM events to trigger a counter update. I haven't had a chance to 100% confirm that middle-button click on X11 triggers the event, but it ought to.
Cut and paste events from context menu and main edit menu known good in:
* Firefox 4.08b-pre
* IE 9 preview 7
* IE 8 current
* Chrome 8 beta current
* Safari 5.0.3

Opera is listed as not supporting these events, oh well.

Note that using a *delete* command from a menu doesn't trigger an event. Sigh, you can't win everything.
2010-12-15 14:57:09 -08:00
Brion Vibber
d075fac7b8 Preview thumbnails of uploaded image attachments before posting on supporting browsers.
Tested working so far:
* Firefox 3.6 and 4.0 (FileReader -> data URL)
* Chrome 8 (createObjectURL; FileReader also works)

Tested with limited support:
* Safari 5.0.3 (no preview, but we can show type and size)

Tested and known not to support FileAPI, keeps current behavior:
* Opera 11 beta
2010-11-24 12:20:25 -08:00
Brion Vibber
b73c162256 Partial fix for tickets #2194, #2393: Workaround for Meteor breaking AJAX error responses returned on posting new notices. Fixes things in Firefox 4, but Safari 5 and Chrome 8 still don't return data... either on success or failure! Sigh.
The Meteor realtime plugin sets document.domain to the common prefix between the main server and the Meteor server's hostnames, which overrides the same-origin controls on JavaScript DOM access so the two parts of the app can speak to each other.
This unfortunately causes "fun" side effects for XMLHTTPRequest access to the main domain... if the new domain doesn't match the actual host (eg 'status.net' instead of 'brion.status.net') then we can't access the XHR's responseXML attribute, which holds a DOM tree of the parsed XML return data.
As a workaround, if we can't get at the contents there, we'll parse a fresh DOM tree in the local context from the responseText property, which remains available.

In the longer term, recommend retooling the realtime stuff so it's not fiddling with document.domain. It could also be an issue as it could allow local JavaScript XSS attacks to migrate to subdomains in other open windows.
2010-11-17 16:08:41 -08:00
Brion Vibber
cda59dc177 drop a comma which isn't actually an error but keeps throwing annoying warnings in netbeans 2010-11-12 12:10:51 -08:00
Brion Vibber
62467f51e5 Drop commented-out code from old lightbox & thumbnail popup stuff 2010-11-12 12:10:29 -08:00
Brion Vibber
551b196a35 doomy doom doom 2010-11-08 15:32:41 -08:00
Brion Vibber
32321de5e0 Some initial testing w/ thumb gen 2010-11-08 14:20:23 -08:00
Brion Vibber
5a9bb0adc4 Tossing in a basic i18n message export to script code. Plugins can hook StartScriptMessage/EndScriptMessage, or directly add needed mappings in Action::getScriptMessages(). Exported entries are accessible as SN.msg(key) at runtime.
StatusNet core code now sets the tooltip text on .attachment.more links when they receive their attachment-expansion magic; this will override the hardcoded tooltip text saved from OStatus plugin when displaying timelines in the web UI.
2010-11-02 13:05:16 -07:00
Evan Prodromou
0c5ca46ba3 combine our standard scripts into one big script 2010-09-02 22:21:07 -04:00
Brion Vibber
34995df879 TinyMCE: counter support (may not be 100% exact match to server-side count, but there's already discrepencies due to URL shortening)
Fix for bad char conversions also, caused short text to not be saved in some cases.
2010-08-12 12:47:07 -07:00
Brion Vibber
54d723adc1 Initial fix for #2479: New post should be displayed on timeline only if it belongs there (AJAX post)
Previously we pushed out your latest post into the currently visible timeline regardless of whether it belonged there or not. This could be pretty confusing!

Currently we don't have clearly machine-readable info on the page and returned notice HTML to determine whether it belongs, but we can do a couple checks easily which I've added:
* public timeline (always show)
* 'and friends' timeline (show for your own page only)
* profile timeline (show for your own page only)

Other places that should be added in the future:
* group timelines if it's a group your posting to
* tag timelines if the post contains the tag
* reply & friends timelines for people you've mentioned

Currently those aren't easy since the mention/group target links in the notice HTML are using the canonical form with user or group ID, while the available navigation links we can use to identify the current page use the names.
2010-07-29 13:27:09 -07:00
Zach Copley
72e486a322 Fix for ticket http://status.net/open-source/issues/2380 "Autofocus
shouldn't override scroll" -- Thanks @michaeltwofish!
2010-06-23 11:29:13 -07:00
Sarven Capadisli
534c12e540 Revert "Multiple file upload handling."
This reverts commit 260f00d60b.

As mentioned in
260f00d60b (comment_8367)

Reverting this merge until the bugs are fixed and there is a general
agreement on the need for this enhancement.
2010-03-31 10:57:20 +02:00
Nick Holliday
260f00d60b Multiple file upload handling. 2010-03-26 18:28:54 -04:00
Sarven Capadisli
94f904bf66 Fix for XHR more text behaviour on conversation pages 2010-03-26 14:56:15 +01:00
Sarven Capadisli
7dd701fbb3 Added processing indicator for more anchor 2010-03-18 23:00:38 +01:00
Sarven Capadisli
d8a533274f Updated 'more' anchor for attachments to do an XHR GET 2010-03-18 00:19:32 +01:00
Sarven Capadisli
910108b9ae Removed unnecessary form_id. Using jQuery .find() instead of
constructing the selector.
2010-03-16 21:02:56 +01:00
Sarven Capadisli
e8c7873b79 Added extra condition to focusing on notice form on page load. If the
window location contains a fragument identifier, it will skip focus
and do what the UA does natively.
2010-03-16 20:53:49 +01:00