36 Commits

Author SHA1 Message Date
shadlaws
90528d9c83 #2065 - Fix problems with double-ajaxifying of dialogs.
Change all jQuery-ui widget _init() functions to _create() functions.
2013-05-07 18:46:43 +02:00
shadlaws
2e94edab53 #2053 - Change all .bind() to .on() for jQuery future-proofing.
- on/off are preferred to bind/unbind, live/die, and delegate/undelegate in jQuery 1.7+
- they're likely on the road toward deprecation, so let's replace them now.
2013-03-11 17:16:20 +01:00
Bharat Mediratta
3312009319 Revive server_add.js which I accidentally removed in 80af9f0f17
as part of #1686.
2011-04-23 08:07:58 -07:00
Bharat Mediratta
80af9f0f17 Inline admin JS into admin_server_add.html.php. Fixes #1686. 2011-04-23 07:05:15 -07:00
Chad Kieffer
e3f90a889d Adjust order of items on server_add admin page. Restore autocomplete to the add form. Created a server_add.css file. 2009-10-23 22:24:06 -06:00
Chad Kieffer
d581bbbd1e Renamed more CSS selectors from gName to g-name. 2009-10-04 15:53:00 -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
Tim Almdal
be84c7be25 * Changed the close functionality so the page is reloaded when the dialog is closed.
* Renamed the ServerAddCloseButton.
* Added Pause and Continue buttons. Now when add is clicked, A Pause button is shown,
  once the adding is complete, the add button is reshown andpause button is hidden.
  Clicking the pause button will hide it and show a continue button.
2009-09-18 12:17:58 -07:00
Tim Almdal
15c3f0b1aa Refactor the server add javascript into a ui.gallery_server_add widget. 2009-09-17 21:26:55 -07:00
Tim Almdal
be1d49d017 Change the timeout on resubmitting the next task iteration to 25ms instead of. This allows the jQuery.ajax method to complete its processing. Otherwise, the browser can spend time thrashing around trying to send the next request. 2009-09-17 10:55:50 -07:00
Bharat Mediratta
ac8c9d6670 Fix indentation. 2009-09-06 11:26:20 -07:00
Tim Almdal
afa8cade7f Fix for ticket #590. The gallery.dialog.js looks for an element "#dialog #gProgress" and if it finds it assumes that it is a progress dialog and removes the title. This pathc changes the name of the div containing the progress bar to gServerAddProgress and avoids the issue.
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-08-18 05:18:41 +08:00
Bharat Mediratta
f0b3d37d18 Chain some jQuery calls together to reduce lines of code. 2009-08-05 22:17:03 -07:00
Bharat Mediratta
954ab5a505 Further simplify server_add (and bump it to version 3).
Now we don't have checkboxes, but instead we restrict you to selecting
directories and albums from only one level in the hierarchy.  This
makes it easier for us to make sure that we properly create the
hierarchy that you want and avoid confusion about what's going to wind
up where.

Modify Server_Add_File_Model to have a parent_id and item_id and then
modify them as we go so that we can build up a tree structure there
*before* we create any items.  This makes it much easier to figure out
where a new item is going to go and get rid of a bunch of probably
buggy code in the main task.
2009-07-11 05:03:36 -07:00
Bharat Mediratta
fad6c4783e Add status output to make it clearer what's happening when you add files. 2009-07-09 10:46:27 -07:00
Bharat Mediratta
faabae5dae Rework server_add. It's smaller and leaner now, storing the list of
files out in a separate model for scalability.  Removed the "pause"
functionality.

- Server_Add_Controller extends Admin_Controller so that we don't have
  to check for admin every time.
- Task completion time now factors in the time it takes to walk the
  arbitrarily deep trees
- Moved checkbox management entirely into JS using jQuery
- Simplified the JS considerably
2009-07-07 21:20:24 -07:00
Bharat Mediratta
9eee3b07a8 @todo if we uncheck all the children for a parent, we should uncheck the
parent itself, otherwise in the code we'll add the entire parent since if
we find an album as a leaf, we assume that it's never been expanded in the UI.
2009-07-02 17:54:22 -07:00
Bharat Mediratta
1cd321901b Properly manage disabled state for the [add] button. 2009-07-02 13:02:26 -07:00
Bharat Mediratta
d4075a4657 Only enable the [add] button when boxes are checked. 2009-07-02 11:49:45 -07:00
Bharat Mediratta
a619bb8196 Add some jsDoc. 2009-07-02 11:30:21 -07:00
Bharat Mediratta
e5b6193b26 Partial pass of server_add cleanup. It's broken at this stage since
I've redone the browsing code but I have not implemented the adding
code.

1) Rename index() to browse() since index is too generic.
2) Simplify the data that we pass to _dialog and _tree
3) Change _tree to return list items only, so that the outer dialog
   can be a <ul> for consistency.
4) Simplify the data structures so that we're not tracking checked vs.
   unchecked status in the PHP code, it's all done in jquery where we
   can do it with just a line or two of JS
5) use glob() which pretty much entirely replaces _get_children
2009-07-02 11:23:40 -07:00
Tim Almdal
e1ce3196f4 Rewrite the server_add to have the server format the selection when a branch is opened. Sub trees re only retrieved when the branch is opened. Changed the
start task processing to fill in any subtrees that are selected, but were never expanded on the client.  Added the loading icon.

Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-06-05 03:13:14 +08:00
Tim Almdal
7bd44b22e2 1) Change the processing so the server_add start task can return done = 1
if there are no eligible files selected
2) Change the javascript to handle this condition and show a pop up
2009-04-23 21:42:34 +00:00
Tim Almdal
49042345f6 Provide a translation of the titleon the fatal error dialog pop-up 2009-04-09 19:32:12 +00:00
Tim Almdal
e692868e8a Create a pause method on the server_add controller and get rid of the
optional parameter/
2009-04-09 17:59:43 +00:00
Tim Almdal
523c467eed Fixes issues with Server Add:
1) Fixes Ticket #208
2) Fixes Ticket #190
3) Fixes an unticketed issue where two items could collide when
creating the thumbnail and/or resize. For example, loading a.flv and
a.jpg would have generated the same thumbnail image.  This change adds
a random value to the name to avoid conflicts.
4) Added item::__set() to clear the relative path if the name changes
2009-04-08 15:11:55 +00:00
Tim Almdal
a4323c79ee Fix for ticket #207, which should then generate a whole bunch of
errors that are described in ticket #208.
2009-04-06 00:15:45 +00:00
Tim Almdal
00ffb24eb0 Add a pause button to the server add dialog and if it is clicked then
the upload is paused.  If the dialog is closed and the task is not
complete then a warning message is displayed on the album.
2009-03-24 17:41:20 +00:00
Bharat Mediratta
0f5ccc9aa3 Switch from using SimpleUploader to using swfUpload as our flash based
uploader.  This is modeled on
http://codex.gallery2.org/Gallery3:Upload_UX but is not yet complete.

Notes:
* Changed #gProgressBar to .gProgressBar to support multiple progress
  bars on the same page
* Added a bunch of CSS to the "needs a home" section in
  themes/default/css/screen.css
2009-03-17 05:20:37 +00:00
Tim Almdal
5c82ce33a2 Refactor the server add module to make use of the task api (Ticket
#125).  Haven't quite figured out what to do with the errors in the
context. Maybe they should show on the mainenance screen?
2009-03-10 21:30:33 +00:00
Bharat Mediratta
64b02026ed Cleanups.
- Show the "Server Add needs configuration" message whenever
  there are no paths.

- Un-ajaxify the admin code to remove complexity and allow us to
  update the status message as appropriate.

- Rename server_add_admin.html.php to admin_server_add.html.php
  for consistency.

- Fix up form to properly display error messages

- Get rid of server_add_dir_list.html.php now that we're
  non-ajaxified.

- Change delete <span> to an <a> for non-ajax world.
2009-03-05 02:26:39 +00:00
Tim Almdal
46b752cbc7 Change how the urls are built in the java script 2009-03-05 01:22:27 +00:00
Tim Almdal
2b9795ebf5 Remove addition options to the autocomplete call. No point in sending
csrf if we are not verifying it.  Remove the must match flag so
non-existent paths don't cause the input box to empty
2009-03-04 20:59:16 +00:00
Tim Almdal
ef8c71417a Move the autocomplete js and css files to lib 2009-03-04 16:10:03 +00:00
Tim Almdal
f7d82ec52f Rename local_import module to server_add 2009-03-04 15:46:10 +00:00