Commit Graph

366 Commits

Author SHA1 Message Date
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
b7f43c8127 Makefile to re-generate util.min.js (needs yui-compressor in path) 2010-12-15 15:00:44 -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
5d9d0d7349 Ticket #2912 further cleanup: use JS on emailsettings form to help connect the 'I want to post by email' checkbox with the controls for adding or removing a post-by-email alias.
Now, when you first come up the checkbox will most likely be off and the button to create an address is grayed out.
Checking the box enables use of the 'new' button to generate an email address -- it's left disabled until you check the box, so you can't accidentally trip it.
Actually adding the address now enables the post-by-mail option, as well, thus ensuring that it's saved. WARNING: OTHER CHANGES ON THE FORM WILL STILL BE LOST.
Removing the address now disables the post-by-mail option, so it's not sitting around confusingly enabled but useless.

You can still disable the checkbox manually without removing the address, in case you want to keep it for later.
It's also still possible to actually save it in the state where the option is enabled, but there's no configured address, but that shouldn't happen too often. Possibly that should be prevented outright though.
2010-12-01 14:23:56 -08:00
Brion Vibber
92880b41e4 Update util.min.js for attachment preview on Firefox, Chrome 2010-11-24 17:36:40 -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
Evan Prodromou
589aee587f include full updated source of JSON2 and use updated minified version 2010-11-17 12:34:04 -05:00
Evan Prodromou
d2ddda16e9 use minified version of jquery.cookie.js 2010-11-17 12:32:11 -05:00
Evan Prodromou
d3d91f0f6e use minified version of jquery.form.js 2010-11-17 12:31:35 -05:00
Evan Prodromou
8ee0471e9a upgrade jquery.form.js 2010-11-17 12:30:55 -05:00
Evan Prodromou
da4f8d465f Use minified version of util.js 2010-11-17 12:16:50 -05:00
Evan Prodromou
a81bc5c0fd upgrade to JQuery 1.4.4 2010-11-17 12:14:50 -05: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
Brion Vibber
79ffebb51b OStatus: save file records for enclosures
Also stripping id from foreign HTML messages (could interfere with UI) and disabled failing attachment popup for a.attachment links that don't have a proper id, so you can click through instead of getting an error.

Issues:
* any other links aren't marked and saved
* inconsistent behavior between local and remote attachments (local displays in lightbox, remote doesn't)
* if the enclosure'd object isn't referenced in the content, you won't be offered a link to it in our UI
2010-03-02 16:36:08 -08:00
Sarven Capadisli
9f94d6defa Changed the geo location cookie Expire to Session. 2010-03-02 19:15:24 -05:00
Sarven Capadisli
a0f6977baa Fixes replyto JS after the upgrade from jQuery 1.4.2 2010-02-25 14:51:23 +01:00
Sarven Capadisli
b54480247a Updated jQuery JavaScript Library from v1.4.1 to v1.4.2 2010-02-25 14:50:40 +01:00
Sarven Capadisli
b782225ade Revert "Updated jQuery Form Plugin from v2.17 to v2.36"
This reverts commit 72037d6143.

Until some of the XHR notice related bugs are sorted out in Opera and
Chromium, reverting back to the previous version. It throws slightly
less errors. XHR file attachments is still a bit problematic in
Opera 10.10/Ubuntu, Opera 10.10/Windows, and Chrome 4/Ubuntu. But this
revert will at least allow regular XHR notices to work okay in Opera
and Chromium.

Standards suck!
2010-02-25 00:10:36 +01:00
Sarven Capadisli
959171acac Added a cookie for the nickname cookie for the login page and prefill
the input field.
2010-02-24 16:39:16 +01:00
Sarven Capadisli
1f45273d53 Moved StatusNetInstance into SN in util.js 2010-02-24 16:35:20 +01:00
Sarven Capadisli
2e258454f3 Minor optimization to only bind an hover event to the notice at hand. 2010-02-16 17:36:45 +01:00
Sarven Capadisli
3b8d060c29 Fix to allow any notice item with an attachment to use the overlay view 2010-02-16 17:09:34 +01:00
Sarven Capadisli
dcd9b2a405 Refactored repeat confirmation dialog. Also fixes dialog skipping. 2010-02-10 11:16:27 +01:00
Sarven Capadisli
d73746641b Reusing fixed selector name for 'processing' in util.js 2010-02-01 15:13:54 +01:00
Sarven Capadisli
91b99863fa Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing 2010-01-31 22:42:50 +00:00
Sarven Capadisli
9f36c10001 Updated XHR binded events to work better in jQuery 1.4.1. Using
.live() for event delegation instead of jQuery.data() and checking to
see if an element was previously binded.
2010-01-31 22:37:22 +00:00
Sarven Capadisli
72037d6143 Updated jQuery Form Plugin from v2.17 to v2.36 2010-01-31 22:34:16 +00:00
Sarven Capadisli
99a7dd64f6 Updated jQuery JavaScript Library from v1.3.2 to v1.4.1 2010-01-31 22:33:11 +00:00
Sarven Capadisli
4d0ee6a41f Globalized form notice data geo values 2010-01-30 15:28:31 +01:00
Sarven Capadisli
aa3170cf34 Using jQuery chaining in FormNoticeXHR 2010-01-30 15:19:13 +01:00