Commit Graph

352 Commits

Author SHA1 Message Date
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