diff options
Diffstat (limited to 'modules/organize/views/organize_dialog.html.php')
-rw-r--r-- | modules/organize/views/organize_dialog.html.php | 104 |
1 files changed, 54 insertions, 50 deletions
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(<?= t("Organize: ")->for_js() ?> + title); + $("#ui-dialog-title-g-dialog").text(<?= t("Organize :: ")->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": <?= t("Drag and drop photos to re-order or move between album")->for_js() ?>, - "remoteError": + return { + statusText: <?= t("Drag and drop photos to re-order or move between album")->for_js() ?>, + remoteError: <?= t("Remote server error, please contact your gallery administrator")->for_js() ?>, - "addAlbumError": <?= t("The above highlighted fields are invalid")->for_js() ?>, - "errorOccurred": <?= t("Remote error ocurred")->for_js() ?>, - "addAlbum": <?= t("Add album")->for_js() ?>, - "addImages": <?= t("Add photo")->for_js() ?>, - "deleteSelected": <?= t("Delete")->for_js() ?>, - "uploadedText": <?= t("Uploaded {0}")->for_js() ?>, - "removeFileText": <?= t("Remove")->for_js() ?>, - "bytes": <?= t("{0} bytes")->for_js() ?>, - "kilobytes": <?= t("{0} KB")->for_js() ?>, - "megabytes": <?= t("{0} MB")->for_js() ?>, - "gigabytes": <?= t("{0} GB")->for_js() ?>, - "progressLabel": <?= t("Completed image %1 of %2")->for_js() ?>, - "uploadLabel": <?= t("Loaded %1 of %2 bytes")->for_js() ?>, - "moveTitle": <?= t("Move images")->for_js() ?>, - "deleteTitle": <?= t("Delete image")->for_js() ?>, - "uploadTitle": <?= t("Upload image")->for_js() ?>, - "cancel": <?= t("Cancel")->for_js() ?>, - "close": <?= t("Close")->for_js() ?> + addAlbumError: <?= t("The above highlighted fields are invalid")->for_js() ?>, + errorOccurred: <?= t("Remote error ocurred")->for_js() ?>, + addAlbum: <?= t("Add album")->for_js() ?>, + addImages: <?= t("Add photo")->for_js() ?>, + deleteSelected: <?= t("Delete")->for_js() ?>, + uploadedText: <?= t("Uploaded {0}")->for_js() ?>, + removeFileText: <?= t("Remove")->for_js() ?>, + progressLabel: <?= t("Completed image %1 of %2")->for_js() ?>, + uploadLabel: <?= t("Loaded %1 of %2 bytes")->for_js() ?>, + moveTitle: <?= t("Move images")->for_js() ?>, + deleteTitle: <?= t("Delete image")->for_js() ?>, + uploadTitle: <?= t("Upload image")->for_js() ?>, + cancel: <?= t("Cancel")->for_js() ?>, + close: <?= t("Close")->for_js() ?> }; - return strings; } + function getGalleryParameters() { + return { + fileFilter: "<?= $file_filter ?>", + domain: "<?= $domain ?>", + sortOrder: "<?= $sort_order ?>", + sortFields: "<?= $sort_fields ?>", + baseUrl: "<?= $base_url ?>", + accessKey: "<?= $access_key ?>", + albumId: "<?= $album->id ?>", + controller: "<?= url::abs_site("organize") ?>/" + }; + }; /* 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: '<?= $file_filter ?>', - domains: '["<?= $domain ?>"]', - sortOrder: '<?= $sort_order ?>', - sortFields: '<?= $sort_fields ?>', - baseUrl: '<?= $base_url ?>', - apiKey: '<?= $api_key ?>', - albumId: "<?= $album->id ?>", - controller: '<?= url::abs_site("organize") ?>/' - }; + 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("<?= url::file("modules/organize/lib/Gallery3WebClient.swf") ?>", "flashContent", size.width() - 100, size.height() - 135, @@ -121,6 +125,6 @@ <div id="g-organize" class="g-dialog-panel"> <!-- The following spans are placeholders so we can load the hover and active styles for the flex component --> <span id="g-organize-hover" /><span id="g-organize-active" /> - <h1 style="display:none"><?= t("Organize: %name", array("name" => html::purify($album->title))) ?></h1> + <h1 style="display:none"><?= t("Organize :: %name", array("name" => html::purify($album->title))) ?></h1> <div id="flashContent"> </div> </div> |