Commit Graph

18 Commits

Author SHA1 Message Date
shadlaws
b09a5fab94 #2013 - Clean up gallery.panel.js (formatting only)
- fixed whitespaces
2013-02-23 21:38:49 +01:00
shadlaws
fd012276cb #2013 - Clean up gallery.panel.js.
- prepend "data-" in front of non-standard attr to be more standards compliant.
2013-02-23 21:29:09 +01:00
shadlaws
ec0363fd36 Updated success callbacks for gallery.panel.js and gallery.dialog.js - no longer need to save xhr ahead of success.
Tested and seems to work well, even with watermarks on Chrome (previously an issue).
2013-02-12 17:19:28 +01:00
Bharat Mediratta
443e49b2ae Revert overeager escaping introduced in
bb35aefffb
in an attempt to resolve #797.

Fixes #1640.
2011-02-24 22:52:32 -08:00
Bharat Mediratta
7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Tim Almdal
a6ceb927e6 Sometimes in dialogs, the form is wrapped in a view to provide additional information. We need to replace the contents of the entire dialog, not just the form, otherwise, there could be text floating around that doesn't make sense. 2010-07-31 15:44:56 -07:00
Tim Almdal
5c0998c4ac Partial fix for #1225. Change the dialog and panel handling to look at the mime type returned to determine the content type. 2010-07-31 15:44:55 -07:00
Bharat Mediratta
189518849c Modify the panel code to expect a JSON data package to mirror what we did in gallery.dialog.js in 9538b3888d 2010-07-20 14:21:40 -07:00
Tim Almdal
45690fa897 Put logic into gallery.panel.js so that when the panel is submitted, the submit button is disabled and the user is no longer able to submit multiple clicks. 2009-10-23 13:24:51 -07:00
Chad Kieffer
3e6ba7acc3 Renamed most, if not all css selectors from gName to g-name. Moved a few shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features. 2009-10-04 00:27:22 -06:00
Bharat Mediratta
610c99cd04 Restore button text for any open panels when we open a new panel.
Fixes ticket #723.
2009-09-06 11:26:33 -07:00
Tim Almdal
445a8fb1b6 Change galleryPanel and galleryDialog widgets to gallery_panel and gallery_dialog respectively
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-08-08 02:08:42 +08:00
Tim Almdal
6abcc06e21 Refactor the gallery.panel.js as a jQuery widget.
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-08-07 21:22:14 +08:00
Tim Almdal
9f396178ce Revert "Allow a theme to override the page refresh mechanism. Create a new"
This reverts commit 1f014aae6c.
2009-08-05 09:24:27 -07:00
Tim Almdal
1f014aae6c Allow a theme to override the page refresh mechanism. Create a new
javascript lib (gallery.reload.js) which defines the functions
gallery_reload() and gallery_location(new_location).  They just
do a window.location.reload() and window.location = new_location.

This change breaks the assumption that all themes will handle page reloads
the same and allows the theme to customize the page refresh.
2009-07-27 12:39:12 -07:00
Bharat Mediratta
fe7779b595 Remove console.log() calls, they break some browsers 2009-06-04 12:12:35 -07:00
Chad Kieffer
c792221821 Fixed docblock reference 2009-05-26 04:56:43 +00:00
Chad Kieffer
88e1f02c1a Split out re-used JavaScript for common functions (messages, valign), panel toggle, and forms to external files. 2009-05-26 03:59:35 +00:00