Commit Graph

94 Commits

Author SHA1 Message Date
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
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
Bharat Mediratta
f0b3d37d18 Chain some jQuery calls together to reduce lines of code. 2009-08-05 22:17:03 -07: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
2f63a5379f Merge branch 'master' of git@github.com:gallery/gallery3 2009-08-05 06:51:27 -07:00
Bharat Mediratta
b9a6cd45ba Skip empty files, since we know they're broken. Fixes ticket #610. 2009-08-04 20:35:13 -07:00
Tim Almdal
3461b4e8e6 Merge branch 'master' of git@github.com:gallery/gallery3 2009-07-28 20:49:50 -07:00
Bharat Mediratta
1e90e40d3a Use events to generate menus, instead of having xxx_menu helpers.
This is the first step towards having a simple, lightweight and
unified API for module interaction.
2009-07-28 13:47:22 -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
0bf69c63d8 Don't escape & in JS text; it triggers the "Disallowed key characters
in global data." check in the Input library.
2009-07-23 16:58:26 -07:00
Bharat Mediratta
dbeadc1407 Use the Kohana cascading filesystem to locate resources loaded by the
theme.  Because the theme comes first, this means that themes can
override any module resources, at the cost that we no longer have
namespacing for JS and CSS files.

The only file getting used outside of this model is
themes/default/screen.css which is used in the admin theme.  I fixed
that by copying screen.css into admin_default and renaming its
screen.css to admin_screen.css.  I also copied over all the images
that it was referencing.

Fixes tickets #48 and #539.

Theme API changes:
- theme_script(), theme_url() and theme_css() are no longer needed
- script(), url() and css() now refer to the first matching asset in
  the module load path, where gallery3/lib is at the end of the path
2009-07-22 14:27:57 -07:00
Bharat Mediratta
050c82cf80 Escape bare & symbols so that we use valid entities. Fixes ticket #577. 2009-07-21 11:09:23 -07:00
Shai Ben-Naphtali
5a0424f458 Fix some consistency in text.
This fixes ticket #546

Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-21 13:18:59 +08:00
Andy Staudacher
33d0b82d02 Fix l10n message inconsistency, ticket 546 2009-07-19 15:45:16 -07:00
Bharat Mediratta
4720e45641 Don't use "else" clauses in upgrade() -- it prevents multiple version bumps at once. 2009-07-14 12:55:03 -07:00
Bharat Mediratta
e2a9a1d284 Add quotes around all values that contain spaces in them, and add a
test to make sure that we continue to do so.

This makes sure that we don't have problems with 5.3 which treats the
literal "on" as a boolean.
2009-07-13 10:36:55 -07:00
Bharat Mediratta
cbd80b5ff9 Get rid of the form from server_add, we're not using it.
Turn the cancel link into a themed close button which triggers a page
reload.

Add some padding to the left of the tree.
2009-07-11 07:37:49 -07:00
Bharat Mediratta
171522bf23 Add a "close" button. 2009-07-11 07:23:31 -07:00
Bharat Mediratta
22fcb4c776 Forgot to bump the version up to 3 2009-07-11 05:14:02 -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
b3785e1761 Remove debug code. 2009-07-10 08:04:37 -07:00
Bharat Mediratta
5cf267cc4c Fix a bug where we were not properly locating the parent album when
adding a new album or photo.

Simplify the data structure that we pass down to
server_add_tree.html.php so that we just pass a file list and let it
do whatever it wants with it.
2009-07-10 08:01:32 -07:00
Bharat Mediratta
6fbb1e2daf Avoid blowing the task data column by only adding directories to the queue instead of directories and files. 2009-07-09 14:03:07 -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
b0429797fc Use p::purify instead of p::clean 2009-07-09 10:00:16 -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
eb5538d135 Merge branch 'master' of git@github.com:/gallery/gallery3
Conflicts:
	modules/server_add/controllers/admin_server_add.php
2009-07-02 18:00:22 -07:00
Bharat Mediratta
1a5fe42b55 Temporary version add() that just dumps out the values for now. 2009-07-02 17:54:48 -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
Bharat Mediratta
495c76f729 Eliminate temporary variables by passing the $item into the view and
making API calls on the item.
2009-07-02 05:11:03 -07:00
Bharat Mediratta
d4e976cc53 Remove empty <script> block. 2009-07-02 05:06:17 -07:00
Bharat Mediratta
14d7797cda In remove_path(), if the path is invalid don't echo it back in the UI. 2009-07-02 04:35:03 -07:00
Bharat Mediratta
8f9a943f55 Fix a bunch of XSS vulnerabilities turned up by manual inspection
using the checklist in ticket #385.
2009-07-01 17:57:39 -07:00
Tim Almdal
42c82ef7f0 Temporary checkin to allow merge with trunk... don't integrate 2009-06-29 06:08:50 -07:00
Tim Almdal
5e83ebd6d0 Use $theme->script() method to render module javascript files 2009-06-28 16:50:55 -07:00
Chad Kieffer
c37fc39152 Merge branch 'master' of git@github.com:gallery/gallery3 2009-06-23 23:56:05 -06:00
Chad Kieffer
200e17c884 Use gMessage for "no paths defined" status message. 2009-06-23 23:44:08 -06:00
Bharat Mediratta
bfca0c7903 Refactor the install/upgrade code to be more flexible.
Add xxx_installer::upgrade($version) method so that upgrade stanzas
are separate from install stanzas.  In the old code, to do an upgrade
meant that you had to re-evolve everything from the initial install
because we'd step through each version's changes.  But what we really
want is for the initial install to start off in the perfect initial
state, and the upgrades to do the work behind the scenes.  So now the
install() function gets things set up properly the first time, and the
upgrade() function does any work to catch you up to the latest code.
See gallery_installer.php for a good example.
2009-06-23 12:00:49 -07:00
Bharat Mediratta
67c8108713 Convert the filename to a sensible title to match the way that the simple uploader works. 2009-06-12 02:13:12 -07:00
Tim Almdal
b11ec14f24 Changed how directories are processed when the parent directory is selected and
the branch was never opened on the client.  This should fix some of the issues
with the server_add as I was able to select the staging directory and then add
over 400 images in a multi-tier structure.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-10 07:23:30 +08:00
Bharat Mediratta
7e5a363ffc Only request the server_add js if the user is an admin 2009-06-04 12:21:51 -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
Bharat Mediratta
05d18da390 Guard against pages with no items. 2009-06-03 17:01:33 -07:00
Bharat Mediratta
bec2fdf7c4 Minor tweaks to the way that we turn the add photos item into a menu
to make it a little more robust.
2009-06-03 16:39:08 -07:00
jhilden
dde5fb96ee made "Add photos" its own site menu item
* open for suggestions on the submenu item labels
* @bharat: not sure about the add photos menu item id in the dropdown case
2009-06-02 19:31:11 -04:00
Bharat Mediratta
e834c4ca24 Have server_add turn the "Add Photo" menu option into a dropdown and
make "Add from Server" a 2nd option there.

This requires adding the Menu::remove() API function.
2009-06-02 15:46:05 -07:00