Commit Graph

60 Commits

Author SHA1 Message Date
Bharat Mediratta
7bee93390d Close any open dialogs before opening a new one. Fixes ticket #1295. 2010-08-25 21:46:23 -07:00
Tim Almdal
42617117c0 Replace overlooked 'form' parameter in json response with 'html'. 2010-08-03 11:10:13 -07: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
0cca2fdf9b Correct the name of the JSON member that contains the form data. 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
583950616e Improve the fix for #1176 to use request::is_ajax() instead of tacking
on a query param to urls that appear in dialogs.  This keeps things simpler.
2010-07-16 11:58:13 -07:00
Tim Almdal
155d2b809b Rename g-in-dialog to the naming standard for query parameters and give it something more representative... 'gallery_dialog_request' 2010-07-15 14:54:45 -07:00
Tim Almdal
f26d5dbbdf Reset the title in case the dialog contents changed the dialog title. 2010-07-09 11:10:02 -07:00
Tim Almdal
591c5a11a3 Reset the postion option to center when the form data is reloaded, to force the dialog to recenter in case the contents have changed. 2010-07-09 11:09:35 -07:00
Tim Almdal
9538b3888d Fix for ticket #1176. Have the gallery.dialog code add a g-in-dialog parameter to the url to let the controller know its in a dialog. The reauthenticate controller will format the password prompt as a page or a form content. If authentication is successful, then the original controller is called instead of being redirected to. 2010-07-07 08:58:38 -07:00
Tim Almdal
dbf3199e46 Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the dialog. Convert all the controllers
that create the data to go into a dialog to return the html as part of a json object.
2010-07-06 14:12:01 -07:00
Tim Almdal
226d1f7146 Revert "If the admin request originates as a dialog link, don't display the entire page when reauthenticating the administrator. Just put the form in the dialog."
This reverts commit 8493a3d36f.
2010-07-05 08:58:36 -07:00
Tim Almdal
8493a3d36f If the admin request originates as a dialog link, don't display the entire page when reauthenticating the administrator. Just put the form in the dialog. 2010-07-05 08:23:17 -07:00
Bharat Mediratta
c946ad1fcd If we promote the <H1> element to be the title, hide it so we're not showing it twice. 2010-06-25 09:56:29 -07:00
Tim Almdal
bb35aefffb Fix for ticket #797
When load a file is uploaded using a dialog box and the jquery plugin ajaxForm, the ajaxForm plugin uses an hidden iFrame element to send the multi-part
form and this is where the response goes.  The ajaxForm plugin then retrieves the document body and parses the result as a json string. If the file uploads
properly everything is fine, but if it fails Gallery3 return the input form with the the error fields highlighted as part of the json response. As this
response is returned to a hidden iframe, the browser attempts to manipulate it and all hell breaks loose. We lose the trailing brace, we start getting
escaping of form tags. When the ajaxForm plugin retrieves the iFrame body its no longer a valid json frame and the parsing fails and the user sees no
indication that it failed.
2010-06-11 12:36:23 -07:00
Tim Almdal
69ef76530d Re enable the submit button if the dialog processing resends the form because of an error. 2009-10-31 09:42:09 -07:00
Tim Almdal
6af697686a Put logic into gallery.dialog.js so that when the form is submitted, the submit button is disabled and the user is no longer able to submit multiple clicks. This should fix tickets: #623, #790, #799 2009-10-23 13:08:10 -07:00
Chad Kieffer
80bb78fa4e Fixed resized photo float issue, added g-clearfix to g-pager on the photo view. Tightened up g-pager styles. Removed a few unecessary !importants. 2009-10-09 12:07:27 -06: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
Chad Kieffer
e1e8904e4a Convert gDialog and gCancel over to g-dialog and g-cancel. Refactor CSS id's and classes in the login/reset password dialog. 2009-09-30 22:49:36 -06:00
Chad Kieffer
75ee962c9e Apply hover effect to dialog buttons. 2009-08-29 17:32:34 -06:00
Chad Kieffer
210ba966f8 Fixed issue where button classes and cancel link weren't being re-applied to forms when an open dialog is reloaded. 2009-08-28 18:20:56 -06:00
Chad Kieffer
fc1c4d5119 Button styles and event handlers weren't being applied in dialogs, fixes #669. 2009-08-28 16:37:14 -06:00
Tim Almdal
1c5b04a2c5 Fix the problem where the login page and edit permission pages were
supersized based on ly last commit.
2009-08-08 16:26:34 -07:00
Tim Almdal
aac06342b3 Merge branch 'master' of git://github.com/gallery/gallery3 2009-08-08 16:11:28 -07:00
Tim Almdal
ae428a7e21 remove a debug statement left over from previous commit 2009-08-08 15:52:04 -07:00
Tim Almdal
cb1ae141bb Create an new option 'immediate' and if set to true then don't try to set up click events, but just show the dialog. Also remove the destroy method and put all the cleanup into the dialog close handler 2009-08-08 15:46:53 -07:00
Tim Almdal
7b0ea229b8 Make the organize dialog open properly in IE8, Chrome and FF. For some reason (probably a timing thing) the height of the contents was not being set correctly in FF. So we just hard code an estimate of the size of the Draw handle, and message areas. 2009-08-07 17:07:04 -07:00
Bharat Mediratta
e4eec71efa Rename gallery.common.js functions to conform to our naming standards
and have some basic namespacing:
  showMessage --> gallery_show_message
  vAlign      --> gallery_valign
  showLoading --> gallery_show_loading

Convert gallery.show_full_size.js to be a jQuery function and give it a namespace:
  show_full_size --> gallery_show_full_size
2009-08-07 11:53:40 -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
a302a9c3fa Refactor the gallery dialog into a jQuery widget
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-08-08 02:08:28 +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
214d977f4d Don't close the dialog window after we successfully complete an
action.  The expectation is that we're going to reload the page (or
redirect to a new url).  If we close the dialog, then we can trigger
the onhover for items we've just deleted causing errors.

Simplify the API while we're at it by getting rid of the no-longer-used
on_success argument to openDialog()

This fixes #528.
2009-07-11 06:51:21 -07:00
Andy Staudacher
21f228b1ae Ticket 86 (addendum) - Guard against themes that don't define MSG_CANCEL and add the message to admin_default as
well.
2009-06-29 21:03:40 -07:00
Andy Staudacher
0eb9a2aacd Fix for ticket 86 - Make Cancel button in doalogs localizable. 2009-06-29 20:55:23 -07:00
Tim Almdal
75d98701ae Guard the calling of the form closing event so its not called if there
is no form.
2009-03-26 04:09:03 +00:00
Tim Almdal
520a4b41b3 Add a "form_closing" custom event to the dialog processing. This
allows the form in the dialog todo custom processing when the form
closes.

For example, the server_add dialog (next commit) uses this callback to
determine if the upload task was cancelled and display a warning
message when the page reloads.

Usage:
$("#gServerAdd form").bind("form_closing", function(target){...});
2009-03-24 17:30:06 +00:00
Bharat Mediratta
2ef8e28198 Pass on_success through to ajaxify_dialog, resolving an bug created
in r20302.
2009-03-08 00:23:15 +00:00
Tim Almdal
e96e26a12f Fix for ticket #130
1) Shuffled code around to create a on_form_loaded function
2) Check for a data.reset string in the json return.  If it exists and
is a function then call. The idea being that if there is an error we
might have to reset some jquery widget initialization.
2009-03-06 22:35:05 +00:00
Chad Kieffer
ecaf6bda32 Added fix i18n todo item for cancel link 2009-02-23 00:44:50 +00:00
Chad Kieffer
9b73213693 Add Cancel link next to submit buttons in dialogs. Apply button style to buttons in dialogs. 2009-02-22 08:05:15 +00:00
Chad Kieffer
fc162362de Set one of 3 dialog widths keying off of form's CSS width value: 300px, 500px, or $(window).width() -100. Tested in IE 6, 7, 8 and looks good. Also, remove titlebar from progress bar dialogs. 2009-02-10 05:48:55 +00:00
Chad Kieffer
767bf41287 Dialogs don't need to be resizeable, at least not yet. 2009-02-09 01:19:54 +00:00
Bharat Mediratta
a68ac7d2ce Fix dialogs in IE7 so that they appear. The sizes are still wrong, though. 2009-02-08 23:39:25 +00:00
Chad Kieffer
aa1abbf82a Let the theme control overlay opacity for dialogs. 2009-02-08 19:35:10 +00:00
Chad Kieffer
ce826c3048 Updated jQuery UI in lib to 1.6rc6. Removed opacity settings in openDialog, refactored showLoading() a bit. 2009-02-07 21:01:52 +00:00
Jakob Hilden
5b17619ea8 added inplace edit to tag admin (form still needs to be set to rename using AJAX)
removed unnecessary {element: dialogLinks[i]} from dialog and panelLink handling.  now uses event.currentTarget
2009-02-04 07:14:22 +00:00
Chad Kieffer
573f787d63 Set dialog width to 200px for dialog's whose content is less than 400px wide, like the login form. 2009-01-25 20:58:15 +00:00