From 67a8ef427798d37a9629c2f3d9672c03520b9987 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 27 Mar 2010 11:16:41 -0700 Subject: Convert the old organize to the new flex based organize --- modules/organize/views/organize_dialog.html.php | 160 +++++++++++++++------ .../organize/views/organize_thumb_grid.html.php | 22 --- modules/organize/views/organize_tree.html.php | 29 ---- 3 files changed, 118 insertions(+), 93 deletions(-) delete mode 100644 modules/organize/views/organize_thumb_grid.html.php delete mode 100644 modules/organize/views/organize_tree.html.php (limited to 'modules/organize/views') diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 38d05b81..c7dc967e 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -1,48 +1,124 @@ + + +" /> + + +
+

html::purify($album->title))) ?>

-
-
-

-
    - -
-
-
-
    -
  • -
-
"> - -
-
- -
-
    -
  • -
  • - "g-organize-sort-column"), - album::get_sort_order_options(), $album->sort_column) ?> -
  • -
  • - "g-organize-sort-order"), - array("ASC" => t("Ascending"), "DESC" => t("Descending")), $album->sort_order) ?> -
  • -
-
-
-
-
+
 
- - diff --git a/modules/organize/views/organize_thumb_grid.html.php b/modules/organize/views/organize_thumb_grid.html.php deleted file mode 100644 index f5db53d4..00000000 --- a/modules/organize/views/organize_thumb_grid.html.php +++ /dev/null @@ -1,22 +0,0 @@ - -children(25, $offset) as $child): ?> -
" - ref="id ?>"> - thumb_img(array("class" => "g-thumbnail", "ref" => $child->id), 90, true) ?> - is_album() ? " class=\"ui-icon ui-icon-note\"" : "" ?>> -
- - -children_count() > $offset): ?> - - diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php deleted file mode 100644 index 044b6858..00000000 --- a/modules/organize/views/organize_tree.html.php +++ /dev/null @@ -1,29 +0,0 @@ - -
  • " - ref="id ?>"> - - - " - ref="id ?>"> - title) ?> - - viewable()->children(null, null, array(array("type", "=", "album"))); ?> - - - -
  • - -- cgit v1.2.3 From 0c1595d7e8c1b31e886ac712ce7e794cf3c33fdd Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 27 Mar 2010 15:55:42 -0700 Subject: Clean up the organize_dialog file of some cruft and add the organize.swf file to the organize module. --- modules/organize/lib/organize.swf | Bin 0 -> 766983 bytes modules/organize/views/organize_dialog.html.php | 17 ++--------------- 2 files changed, 2 insertions(+), 15 deletions(-) create mode 100644 modules/organize/lib/organize.swf (limited to 'modules/organize/views') diff --git a/modules/organize/lib/organize.swf b/modules/organize/lib/organize.swf new file mode 100644 index 00000000..f2389f22 Binary files /dev/null and b/modules/organize/lib/organize.swf differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index c7dc967e..f31cf161 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -1,7 +1,5 @@ - -" /> -
    +

    html::purify($album->title))) ?>

     
    -- cgit v1.2.3 From 7c84ee1b33a768fc4a44f3b6db2530f01cfcd081 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 30 Mar 2010 07:55:56 -0700 Subject: Organize now has the add album functionality. --- modules/organize/lib/organize.swf | Bin 766983 -> 778676 bytes modules/organize/views/organize_dialog.html.php | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/lib/organize.swf b/modules/organize/lib/organize.swf index f2389f22..3d2182ee 100644 Binary files a/modules/organize/lib/organize.swf and b/modules/organize/lib/organize.swf differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index f31cf161..8163c595 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -56,8 +56,9 @@ function getTextStrings() { var strings = { "statusText": for_js() ?>, - "addToolTip": for_js() ?>, - "deleteToolTip": for_js() ?>, + "addAlbum": for_js() ?>, + "addImages": for_js() ?>, + "deleteSelected": for_js() ?>, "uploadedText": for_js() ?>, "removeFileText": for_js() ?>, "totalFiles": for_js() ?>, @@ -66,6 +67,8 @@ "kilobytes": for_js() ?>, "megabytes": for_js() ?>, "gigabytes": for_js() ?>, + "cancel": for_js() ?>, + "close": for_js() ?> }; return strings; } @@ -84,7 +87,8 @@ sortOrder: '', sortFields: '', baseUrl: '', - apiKey: '' + apiKey: '', + controller: '/' }; var size = $.gallery_get_viewport_size(); -- cgit v1.2.3 From ffc3f9f41c3d8d6df08d9ad6138f4ad74749ccec Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 18 May 2010 10:00:48 -0700 Subject: checkpoint the new organize module. At this point rearrange and move work. Rearrange is moving items within the same album, move is moving to a different album. --- modules/organize/controllers/organize.php | 2 +- modules/organize/lib/Gallery3WebClient.swf | Bin 0 -> 139321 bytes modules/organize/lib/organize.swf | Bin 778677 -> 0 bytes modules/organize/source/Gallery3Organize_source.zip | Bin 0 -> 924325 bytes modules/organize/source/flex_organize_source.7z | Bin 343272 -> 0 bytes modules/organize/views/organize_dialog.html.php | 8 ++++---- 6 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 modules/organize/lib/Gallery3WebClient.swf delete mode 100644 modules/organize/lib/organize.swf create mode 100644 modules/organize/source/Gallery3Organize_source.zip delete mode 100644 modules/organize/source/flex_organize_source.7z (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index bfd4992d..e713fdd9 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -42,7 +42,7 @@ class Organize_Controller extends Controller { $v->sort_fields = json_encode($sort_fields); $user = identity::active_user(); - $v->api_key = rest::get_access_token($user->id)->access_key; + $v->api_key = rest::get_access_key($user->id)->access_key; print $v; } diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf new file mode 100644 index 00000000..a9e4c66b Binary files /dev/null and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/lib/organize.swf b/modules/organize/lib/organize.swf deleted file mode 100644 index 62e733ea..00000000 Binary files a/modules/organize/lib/organize.swf and /dev/null differ diff --git a/modules/organize/source/Gallery3Organize_source.zip b/modules/organize/source/Gallery3Organize_source.zip new file mode 100644 index 00000000..c6f7eebe Binary files /dev/null and b/modules/organize/source/Gallery3Organize_source.zip differ diff --git a/modules/organize/source/flex_organize_source.7z b/modules/organize/source/flex_organize_source.7z deleted file mode 100644 index ea5951b9..00000000 Binary files a/modules/organize/source/flex_organize_source.7z and /dev/null differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 8163c595..5da4aca4 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -22,10 +22,12 @@ -- cgit v1.2.3 From 56587febfff2955c09b5b82a63c31cf547066f32 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 28 May 2010 09:36:54 -0700 Subject: Add a progress dialog box when deleting, uploading or updating items. --- modules/organize/lib/Gallery3WebClient.swf | Bin 135882 -> 137214 bytes .../organize/source/Gallery3Organize_source.zip | Bin 936852 -> 938411 bytes modules/organize/views/organize_dialog.html.php | 7 +++++-- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index e4b40e4a..4f55c455 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/source/Gallery3Organize_source.zip b/modules/organize/source/Gallery3Organize_source.zip index 45fda930..6a0a8c7f 100644 Binary files a/modules/organize/source/Gallery3Organize_source.zip and b/modules/organize/source/Gallery3Organize_source.zip differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 5da4aca4..da135857 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -61,12 +61,15 @@ "deleteSelected": for_js() ?>, "uploadedText": for_js() ?>, "removeFileText": for_js() ?>, - "totalFiles": for_js() ?>, - "totalSize": for_js() ?>, "bytes": for_js() ?>, "kilobytes": for_js() ?>, "megabytes": for_js() ?>, "gigabytes": for_js() ?>, + "progressLabel": for_js() ?>, + "uploadLabel": for_js() ?>, + "moveTitle": for_js() ?>, + "deleteTitle": for_js() ?>, + "uploadTitle": for_js() ?>, "cancel": for_js() ?>, "close": for_js() ?> }; -- cgit v1.2.3 From 38e8ab3d718d31dee7c8c27064e45c018540f358 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 10 Jun 2010 09:14:13 -0700 Subject: Provide better handling and a progress dialog when loading or updating files. --- modules/organize/lib/Gallery3WebClient.swf | Bin 137234 -> 144465 bytes .../organize/source/Gallery3Organize_source.zip | Bin 933143 -> 945619 bytes modules/organize/views/organize_dialog.html.php | 4 ++++ 3 files changed, 4 insertions(+) (limited to 'modules/organize/views') diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index 54169a5b..d983760d 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/source/Gallery3Organize_source.zip b/modules/organize/source/Gallery3Organize_source.zip index 09a73acf..ce3bbdf3 100644 Binary files a/modules/organize/source/Gallery3Organize_source.zip and b/modules/organize/source/Gallery3Organize_source.zip differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index da135857..574117e5 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -56,6 +56,10 @@ function getTextStrings() { var strings = { "statusText": for_js() ?>, + "remoteError": + for_js() ?>, + "addAlbumError": for_js() ?>, + "errorOccurred": for_js() ?>, "addAlbum": for_js() ?>, "addImages": for_js() ?>, "deleteSelected": for_js() ?>, -- cgit v1.2.3 From 6aab0cbec6da442199ca13ecf6078f77b203dd00 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 10 Jun 2010 13:12:10 -0700 Subject: Review the code for xss exposures and provide the functionality to update the organize dialog bar when the selected album changes. --- modules/organize/lib/Gallery3WebClient.swf | Bin 144465 -> 145294 bytes .../organize/source/Gallery3Organize_source.zip | Bin 945619 -> 945080 bytes modules/organize/views/organize_dialog.html.php | 6 +++++- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/organize/views') diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index d983760d..271888c1 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/source/Gallery3Organize_source.zip b/modules/organize/source/Gallery3Organize_source.zip index ce3bbdf3..9a64222f 100644 Binary files a/modules/organize/source/Gallery3Organize_source.zip and b/modules/organize/source/Gallery3Organize_source.zip differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 574117e5..2d340f13 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -31,6 +31,10 @@ $("#g-dialog").dialog("close"); } + function setTitle(title) { + $("#ui-dialog-title-g-dialog").text(for_js() ?> + title); + } + function getOrganizeStyles() { var styles = { "color": colorToHex($("#g-organize").css("color")), @@ -117,6 +121,6 @@
    -

    html::purify($album->title))) ?>

    +

    html::purify($album->title))) ?>

     
    -- cgit v1.2.3 From 47aa65143060ff376d95ca182c55132d821917fb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 13 Jun 2010 17:58:50 -0700 Subject: Fix problems ith IE and flex initialization when one of the flashvars contains a json encoded string. Also address the problem that IE returns the color values differently that Firefox and Chrome --- modules/organize/controllers/organize.php | 11 +-- modules/organize/lib/Gallery3WebClient.swf | Bin 145339 -> 142627 bytes modules/organize/views/organize_dialog.html.php | 104 ++++++++++++------------ 3 files changed, 60 insertions(+), 55 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index d2c273b6..b5a25400 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -28,23 +28,24 @@ class Organize_Controller extends Controller { $v = new View("organize_dialog.html"); $v->album = $album; // @todo turn this into an api call. - $v->file_filter = json_encode( + $v->file_filter = addslashes(json_encode( array("photo" => array("label" => "Images", "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), - "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4")))); + "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4"))))); $v->domain = $input->server("SERVER_NAME"); // @todo figure out how to connect this w/o a dependency $v->base_url = url::abs_site("rest") . "/"; - $v->sort_order = json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending"))); + $v->sort_order = addslashes(json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")))); $sort_fields = array(); foreach (album::get_sort_order_options() as $field => $description) { $sort_fields[$field] = (string)$description; } - $v->sort_fields = json_encode($sort_fields); + $v->sort_fields = addslashes(json_encode($sort_fields)); $user = identity::active_user(); - $v->api_key = rest::get_access_key($user->id)->access_key; + $v->access_key = rest::get_access_key($user->id)->access_key; + Kohana_Log::add("error", $v->__toString()); print $v; } diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index 6ff0d5ba..879a4fec 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 2d340f13..8c5ba133 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -27,63 +27,76 @@ }); function closeOrganizeDialog() { - console.log("closeOrganizeDialog"); $("#g-dialog").dialog("close"); } function setTitle(title) { - $("#ui-dialog-title-g-dialog").text(for_js() ?> + title); + $("#ui-dialog-title-g-dialog").text(for_js() ?> + title); } function getOrganizeStyles() { - var styles = { - "color": colorToHex($("#g-organize").css("color")), - "backgroundColor": colorToHex($("#g-organize").css("backgroundColor")), - "borderColor": colorToHex($("#g-organize").css("borderLeftColor")), - "rollOverColor": colorToHex($("#g-organize-hover").css("backgroundColor")), - "selectionColor": colorToHex($("#g-organize-active").css("backgroundColor")) + return { + color: colorToHex($("#g-organize").css("color")), + backgroundColor: colorToHex($("#g-organize").css("backgroundColor")), + borderColor: colorToHex($("#g-organize").css("borderLeftColor")), + rollOverColor: colorToHex($("#g-organize-hover").css("backgroundColor")), + selectionColor: colorToHex($("#g-organize-active").css("backgroundColor")) }; - return styles; } function colorToHex(color) { - var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color); + // Surprising no one, the color extracted from the css is in a different format + // in IE than it is when extracted from FF or Chrome. FF and Chrome return + // the of "rgb(nn,nn,nn)". Where as IE returns it as #hhhhhh. - var red = parseInt(digits[2]); - var green = parseInt(digits[3]); - var blue = parseInt(digits[4]); + if (color.indexOf("#") === 0) { + return '0x' + color.substring(1); + } else { + var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color); - var rgb = blue | (green << 8) | (red << 16); - return digits[1] + '0x' + rgb.toString(16); + var red = parseInt(digits[2]); + var green = parseInt(digits[3]); + var blue = parseInt(digits[4]); + + var rgb = blue | (green << 8) | (red << 16); + return digits[1] + '0x' + rgb.toString(16); + } } function getTextStrings() { - var strings = { - "statusText": for_js() ?>, - "remoteError": + return { + statusText: for_js() ?>, + remoteError: for_js() ?>, - "addAlbumError": for_js() ?>, - "errorOccurred": for_js() ?>, - "addAlbum": for_js() ?>, - "addImages": for_js() ?>, - "deleteSelected": for_js() ?>, - "uploadedText": for_js() ?>, - "removeFileText": for_js() ?>, - "bytes": for_js() ?>, - "kilobytes": for_js() ?>, - "megabytes": for_js() ?>, - "gigabytes": for_js() ?>, - "progressLabel": for_js() ?>, - "uploadLabel": for_js() ?>, - "moveTitle": for_js() ?>, - "deleteTitle": for_js() ?>, - "uploadTitle": for_js() ?>, - "cancel": for_js() ?>, - "close": for_js() ?> + addAlbumError: for_js() ?>, + errorOccurred: for_js() ?>, + addAlbum: for_js() ?>, + addImages: for_js() ?>, + deleteSelected: for_js() ?>, + uploadedText: for_js() ?>, + removeFileText: for_js() ?>, + progressLabel: for_js() ?>, + uploadLabel: for_js() ?>, + moveTitle: for_js() ?>, + deleteTitle: for_js() ?>, + uploadTitle: for_js() ?>, + cancel: for_js() ?>, + close: for_js() ?> }; - return strings; } + function getGalleryParameters() { + return { + fileFilter: "", + domain: "", + sortOrder: "", + sortFields: "", + baseUrl: "", + accessKey: "", + albumId: "id ?>", + controller: "/" + }; + }; /* For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. @@ -91,16 +104,7 @@ var swfVersionStr = "0.0.0"; /* To use express install, set to playerProductInstall.swf, otherwise the empty string.*/ var xiSwfUrlStr = ""; - var flashvars = { - fileFilter: '', - domains: '[""]', - sortOrder: '', - sortFields: '', - baseUrl: '', - apiKey: '', - albumId: "id ?>", - controller: '/' - }; + var flashvars = {}; var size = $.gallery_get_viewport_size(); @@ -111,8 +115,8 @@ params.allowscriptaccess = "sameDomain"; params.allowfullscreen = "true"; var attributes = {}; - attributes.id = "g-organize-object"; - attributes.name = "organize"; + attributes.id = "Gallery3WebClient"; + attributes.name = "Gallery3WebClient"; attributes.align = "middle"; swfobject.embedSWF("", "flashContent", size.width() - 100, size.height() - 135, @@ -121,6 +125,6 @@
    -

    html::purify($album->title))) ?>

    +

    html::purify($album->title))) ?>

     
    -- cgit v1.2.3 From f10d641044fe31224af5b42b148a8ee77d9a34db Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 14 Jun 2010 13:07:58 -0700 Subject: Change the parameters for the organize dialog box. The baseUrl parameter was removed and replaced with the restUri, which contains the relative uri for the rest controller. The controller parameter is now the relative uri for the organize controller. The protocol parameter was added. In addition, there is not default size for the organize flex object. It attempts to fit within the gallery3 dialog box. --- modules/organize/controllers/organize.php | 2 ++ modules/organize/lib/Gallery3WebClient.swf | Bin 142627 -> 147590 bytes modules/organize/views/organize_dialog.html.php | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 199aeaf3..d688a76d 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -45,6 +45,8 @@ class Organize_Controller extends Controller { $user = identity::active_user(); $v->access_key = rest::get_access_key($user->id)->access_key; + + $v->protocol = (empty($_SERVER["HTTPS"]) OR $_SERVER["HTTPS"] === "off") ? "http" : "https"; print $v; } diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index 879a4fec..c51fa4e8 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 8c5ba133..8160a339 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -87,14 +87,17 @@ function getGalleryParameters() { return { - fileFilter: "", + dialogWidth: $("#g-dialog:parent").width(), + dialogHeight: $("#g-dialog").height(), domain: "", + accessKey: "", + protocol: "", + fileFilter: "", sortOrder: "", sortFields: "", - baseUrl: "", - accessKey: "", albumId: "id ?>", - controller: "/" + restUri: "/", + controller: "/" }; }; /* -- cgit v1.2.3 From 172c3fd209d81f9242d388ca0faf4f302bb08405 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 16 Jun 2010 17:31:31 -0700 Subject: Fix a typo... The controller parameter to the flex organize module should be controllerUri instead. --- modules/organize/views/organize_dialog.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/organize/views') diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 8160a339..8113a1af 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -97,7 +97,7 @@ sortFields: "", albumId: "id ?>", restUri: "/", - controller: "/" + controllerUri: "/" }; }; /* -- cgit v1.2.3 From 359235182ebb14c75b495a889a2298d1e0130d77 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 17 Jun 2010 09:57:38 -0700 Subject: Add a cache-buster to the SWF url so that it'll refresh in the browser every time the SWF file changes. --- modules/organize/controllers/organize.php | 2 ++ modules/organize/views/organize_dialog.html.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index d688a76d..488f1eb1 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -47,6 +47,8 @@ class Organize_Controller extends Controller { $v->access_key = rest::get_access_key($user->id)->access_key; $v->protocol = (empty($_SERVER["HTTPS"]) OR $_SERVER["HTTPS"] === "off") ? "http" : "https"; + $v->swf_url = url::file("modules/organize/lib/Gallery3WebClient.swf?") . + filemtime(MODPATH . "organize/lib/Gallery3WebClient.swf"); print $v; } diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 8113a1af..d68534cf 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -121,7 +121,7 @@ attributes.id = "Gallery3WebClient"; attributes.name = "Gallery3WebClient"; attributes.align = "middle"; - swfobject.embedSWF("", + swfobject.embedSWF("", "flashContent", size.width() - 100, size.height() - 135, swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); -- cgit v1.2.3 From 070db2a97ab3e508456780639faa643934081966 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Jun 2010 10:21:37 -0700 Subject: Rearrange the adding of fields to the template so that they match the order of appearance in the template. Also remove the @todo's --- modules/organize/controllers/organize.php | 21 +++++++++++++-------- modules/organize/views/organize_dialog.html.php | 4 ++-- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 488f1eb1..1d188ade 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -27,26 +27,31 @@ class Organize_Controller extends Controller { $v = new View("organize_dialog.html"); $v->album = $album; - // @todo turn this into an api call. + + $v->domain = $input->server("SERVER_NAME"); + + $user = identity::active_user(); + $v->access_key = rest::get_access_key($user->id)->access_key; + + $v->protocol = (empty($_SERVER["HTTPS"]) OR $_SERVER["HTTPS"] === "off") ? "http" : "https"; + $v->file_filter = addslashes(json_encode( array("photo" => array("label" => "Images", "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4"))))); - $v->domain = $input->server("SERVER_NAME"); - // @todo figure out how to connect this w/o a dependency - $v->base_url = url::abs_site("rest") . "/"; - $v->sort_order = addslashes(json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")))); + $v->sort_order = addslashes( + json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")))); $sort_fields = array(); foreach (album::get_sort_order_options() as $field => $description) { $sort_fields[$field] = (string)$description; } $v->sort_fields = addslashes(json_encode($sort_fields)); - $user = identity::active_user(); - $v->access_key = rest::get_access_key($user->id)->access_key; + $v->rest_uri = url::site("rest") . "/"; + + $v->controller_uri = url::site("organize") . "/"; - $v->protocol = (empty($_SERVER["HTTPS"]) OR $_SERVER["HTTPS"] === "off") ? "http" : "https"; $v->swf_url = url::file("modules/organize/lib/Gallery3WebClient.swf?") . filemtime(MODPATH . "organize/lib/Gallery3WebClient.swf"); print $v; diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index d68534cf..a4fdc071 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -96,8 +96,8 @@ sortOrder: "", sortFields: "", albumId: "id ?>", - restUri: "/", - controllerUri: "/" + restUri: "", + controllerUri: "/" }; }; /* -- cgit v1.2.3 From fce95785beabb499381d722160d000df2d693b2a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Jun 2010 17:41:35 -0700 Subject: Remove duplicate trailing slash on the controllerUri parameter --- modules/organize/views/organize_dialog.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/organize/views') diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index a4fdc071..4224c10b 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -97,7 +97,7 @@ sortFields: "", albumId: "id ?>", restUri: "", - controllerUri: "/" + controllerUri: "" }; }; /* -- cgit v1.2.3 From ec40e03a377a8a5cd74b448135307c77a2b9e0e9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 18 Jun 2010 15:20:32 -0700 Subject: Use request::protocol(). --- modules/organize/controllers/organize.php | 2 -- modules/organize/views/organize_dialog.html.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 1d188ade..e8db991b 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -33,8 +33,6 @@ class Organize_Controller extends Controller { $user = identity::active_user(); $v->access_key = rest::get_access_key($user->id)->access_key; - $v->protocol = (empty($_SERVER["HTTPS"]) OR $_SERVER["HTTPS"] === "off") ? "http" : "https"; - $v->file_filter = addslashes(json_encode( array("photo" => array("label" => "Images", "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 4224c10b..9e70d168 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -91,7 +91,7 @@ dialogHeight: $("#g-dialog").height(), domain: "", accessKey: "", - protocol: "", + protocol: "", fileFilter: "", sortOrder: "", sortFields: "", -- cgit v1.2.3 From 545a91270d22506362e67032a3c54fdb21f8823e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 18 Jun 2010 19:05:59 -0700 Subject: 1) Change how the size of the flexstage is calculated. (Basically remove the dialogWidth and dialogHeight and adjsut the internal controls when added to the stage. 2) Cleanup the controller code --- modules/organize/controllers/organize.php | 31 ++++++++++-------------- modules/organize/lib/Gallery3WebClient.swf | Bin 150760 -> 147793 bytes modules/organize/views/organize_dialog.html.php | 4 +-- 3 files changed, 14 insertions(+), 21 deletions(-) (limited to 'modules/organize/views') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index e8db991b..732ac3f6 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -25,32 +25,27 @@ class Organize_Controller extends Controller { access::required("view", $album); access::required("edit", $album); - $v = new View("organize_dialog.html"); - $v->album = $album; - - $v->domain = $input->server("SERVER_NAME"); - $user = identity::active_user(); - $v->access_key = rest::get_access_key($user->id)->access_key; - - $v->file_filter = addslashes(json_encode( - array("photo" => array("label" => "Images", - "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), - "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4"))))); - - $v->sort_order = addslashes( - json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")))); $sort_fields = array(); foreach (album::get_sort_order_options() as $field => $description) { $sort_fields[$field] = (string)$description; } - $v->sort_fields = addslashes(json_encode($sort_fields)); + $sort_order = array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")); + $file_filter = json_encode( + array("photo" => array("label" => "Images", + "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), + "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4")))); + $v = new View("organize_dialog.html"); + $v->album = $album; + $v->domain = $input->server("SERVER_NAME"); + $v->access_key = rest::get_access_key($user->id)->access_key; + $v->file_filter = addslashes($file_filter); + $v->sort_order = addslashes(json_encode($sort_order)); + $v->sort_fields = addslashes(json_encode($sort_fields)); $v->rest_uri = url::site("rest") . "/"; - $v->controller_uri = url::site("organize") . "/"; - - $v->swf_url = url::file("modules/organize/lib/Gallery3WebClient.swf?") . + $v->swf_uri = url::file("modules/organize/lib/Gallery3WebClient.swf?") . filemtime(MODPATH . "organize/lib/Gallery3WebClient.swf"); print $v; } diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf index 82735217..9f753076 100644 Binary files a/modules/organize/lib/Gallery3WebClient.swf and b/modules/organize/lib/Gallery3WebClient.swf differ diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 9e70d168..c41e5960 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -87,8 +87,6 @@ function getGalleryParameters() { return { - dialogWidth: $("#g-dialog:parent").width(), - dialogHeight: $("#g-dialog").height(), domain: "", accessKey: "", protocol: "", @@ -121,7 +119,7 @@ attributes.id = "Gallery3WebClient"; attributes.name = "Gallery3WebClient"; attributes.align = "middle"; - swfobject.embedSWF("", + swfobject.embedSWF("", "flashContent", size.width() - 100, size.height() - 135, swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); -- cgit v1.2.3