diff options
| author | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-16 17:31:20 +0200 |
|---|---|---|
| committer | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-16 17:31:20 +0200 |
| commit | 7f5030ac208c30a7dc576a57cd9e665022ccbde5 (patch) | |
| tree | 6b23e78aa8cc2dd363def46e083217e3c9b52f1b /modules/gallery/views | |
| parent | 923732ca4dca6db218f6252a7133cd72f98fa086 (diff) | |
| parent | 85b0f580291e375a2c5ec21b8210e59023ee24c2 (diff) | |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/views')
| -rw-r--r-- | modules/gallery/views/admin_block_stats.html.php | 2 | ||||
| -rw-r--r-- | modules/gallery/views/admin_dashboard.html.php | 2 | ||||
| -rw-r--r-- | modules/gallery/views/admin_maintenance.html.php | 22 | ||||
| -rw-r--r-- | modules/gallery/views/admin_maintenance_show_log.html.php | 19 | ||||
| -rw-r--r-- | modules/gallery/views/admin_maintenance_task.html.php | 2 | ||||
| -rw-r--r-- | modules/gallery/views/kohana_error_page.php | 10 | ||||
| -rw-r--r-- | modules/gallery/views/l10n_client.html.php | 6 | ||||
| -rw-r--r-- | modules/gallery/views/movieplayer.html.php | 15 | ||||
| -rw-r--r-- | modules/gallery/views/permissions_browse.html.php | 2 | ||||
| -rw-r--r-- | modules/gallery/views/simple_uploader.html.php | 74 | ||||
| -rw-r--r-- | modules/gallery/views/upgrader.html.php | 9 |
11 files changed, 117 insertions, 46 deletions
diff --git a/modules/gallery/views/admin_block_stats.html.php b/modules/gallery/views/admin_block_stats.html.php index 395ed71d..1dec8ccd 100644 --- a/modules/gallery/views/admin_block_stats.html.php +++ b/modules/gallery/views/admin_block_stats.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <ul> <li> - <?= t("Version: %version", array("version" => module::get_var("gallery", "version"))) ?> + <?= t("Version: %version", array("version" => gallery::VERSION)) ?> </li> <li> <?= t("Albums: %count", array("count" => $album_count)) ?> diff --git a/modules/gallery/views/admin_dashboard.html.php b/modules/gallery/views/admin_dashboard.html.php index 5b8cae2e..a2d22ab6 100644 --- a/modules/gallery/views/admin_dashboard.html.php +++ b/modules/gallery/views/admin_dashboard.html.php @@ -13,7 +13,6 @@ $("#gAdminDashboard .gBlock .ui-widget-header").addClass("gDraggable"); $("#gAdminDashboard").sortable({ connectWith: ["#gAdminDashboardSidebar"], - containment: "document", cursor: "move", handle: $(".ui-widget-header"), opacity: 0.6, @@ -24,7 +23,6 @@ $("#gAdminDashboardSidebar .gBlock .ui-widget-header").addClass("gDraggable"); $("#gAdminDashboardSidebar").sortable({ connectWith: ["#gAdminDashboard"], - containment: "document", cursor: "move", handle: $(".ui-widget-header"), opacity: 0.6, diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index c47f77f8..450eb754 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -29,7 +29,7 @@ </td> <td> <a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>" - class="gDialogLink"> + class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> <?= t("run") ?> </a> </td> @@ -79,7 +79,7 @@ <? if ($task->state == "cancelled"): ?> <?= t("Cancelled") ?> <? endif ?> - <?= t("Done") ?> + <?= t("Close") ?> <? elseif ($task->state == "stalled"): ?> <?= t("Stalled") ?> <? else: ?> @@ -94,11 +94,13 @@ </td> <td> <? if ($task->state == "stalled"): ?> - <a class="gDialogLink" href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> + <a class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all" + href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> <?= t("resume") ?> </a> <? endif ?> - <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>"> + <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" + class="gButtonLink ui-icon-left ui-state-default ui-corner-all right"> <?= t("cancel") ?> </a> </td> @@ -161,17 +163,23 @@ </td> <td> <? if ($task->done): ?> - <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>"> + <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> <?= t("remove") ?> </a> + <? if ($task->get_log()): ?> + <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink ui-state-default ui-corner-all"> + <?= t("browse log") ?> + </a> + <? endif ?> <? else: ?> - <a class="gDialogLink" href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> + <a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink" ui-state-default ui-corner-all> <?= t("resume") ?> </a> - <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>"> + <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> <?= t("cancel") ?> </a> <? endif ?> + </ul> </td> </tr> <? endforeach ?> diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php new file mode 100644 index 00000000..9d850986 --- /dev/null +++ b/modules/gallery/views/admin_maintenance_show_log.html.php @@ -0,0 +1,19 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script type="text/javascript"> + dismiss = function() { + window.location.reload(); + } + download = function(){ + // send request + $('<form action="<?= url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") ?>" method="post"></form>'). +appendTo('body').submit().remove(); + }; +</script> +<div id="gTaskLogDialog"> + <h1> <?= $task->name ?> </h1> + <div class="gTaskLog"> + <pre><?= p::purify($task->get_log()) ?></pre> + </div> + <button id="gCloseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Close") ?></button> + <button id="gSaveButton" class="ui-state-default ui-corner-all" onclick="download()"><?= t("Save") ?></button> +</div> diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index d9aecc60..5c2c03a1 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -30,6 +30,6 @@ </div> <div> <button id="gPauseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Pause") ?></button> - <button id="gDoneButton" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Done") ?></button> + <button id="gDoneButton" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Close") ?></button> </div> </div> diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php index 6bf48549..9361514d 100644 --- a/modules/gallery/views/kohana_error_page.php +++ b/modules/gallery/views/kohana_error_page.php @@ -53,7 +53,6 @@ margin: 0px; } </style> - <script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?= t("Something went wrong!") ?></title> </head> @@ -78,8 +77,13 @@ <h2> <?= t("Hey wait, you're an admin! We can tell you stuff.") ?> </h2> - <a id="toggle" href="" - onclick="javascript:$('#stuff').slideDown('slow'); $('#toggle').slideUp(); return false"> + <script type="text/javascript"> + var show_details = function() { + document.getElementById("stuff").style.display = "block"; + document.getElementById("toggle").style.display = "none"; + } + </script> + <a id="toggle" href="#" onclick="javascript:show_details(); return false;"> <b><?= t("Ok.. tell me stuff!") ?></b> </a> <div id="stuff" style="display: none"> diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index c15f4b0e..c0cbbfa2 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <div id="l10n-client" class="hidden"> <div class="labels"> - <span class="toggle"><?= t("Translate Text") ?></span> + <span id="l10n-client-toggler">X</span> <div class="label strings"><h2><?= t("Page Text") ?> <? if (!Input::instance()->get('show_all_l10n_messages')): ?> <a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show All)") ?></a> @@ -63,10 +63,14 @@ <?= form::textarea("l10n-edit-plural-translation-other", "", ' rows="2"') ?> </div> <input type="submit" name="l10n-edit-save" value="<?= t("Save translation") ?>"/> + <a href="javascript: Gallery.l10nClient.copySourceText()" + class="gButtonLink ui-state-default ui-corner-all"><?= t("Copy source text") ?></a> </form> </div> </div> <script type="text/javascript"> + var MSG_TRANSLATE_TEXT = "<?= t("Translate Text") ?>"; + var MSG_CLOSE_X = "<?= t("X") ?>"; var l10n_client_data = <?= json_encode($string_list) ?>; var plural_forms = <?= json_encode($plural_forms) ?>; </script> diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php new file mode 100644 index 00000000..e8cabd31 --- /dev/null +++ b/modules/gallery/views/movieplayer.html.php @@ -0,0 +1,15 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= html::anchor($item->file_url(true), "", $attrs) ?> +<script> + flowplayer("<?= $attrs["id"] ?>", "<?= url::abs_file("lib/flowplayer.swf") ?>", { + plugins: { + h264streaming: { + url: "<?= url::abs_file("lib/flowplayer.h264streaming.swf") ?>" + }, + controls: { + autoHide: 'always', + hideDelay: 2000 + } + } + }) +</script> diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php index 36394877..888a27f7 100644 --- a/modules/gallery/views/permissions_browse.html.php +++ b/modules/gallery/views/permissions_browse.html.php @@ -42,7 +42,7 @@ <? endforeach ?> <li> <a href="javascript:show(<?= $item->id ?>)"> - <?= p::clean($item->title) ?> + <?= p::purify($item->title) ?> </a> <div class="form" id="edit-<?= $item->id ?>"> <?= $form ?> diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index f10d764c..38ac518c 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -1,11 +1,12 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.js") ?>"></script> <script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.queue.js") ?>"></script> +<script type="text/javascript" src="<?= url::file("lib/jquery.scrollTo.js") ?>"></script> <!-- hack to set the title for the dialog --> <form id="gAddPhotosForm" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>"> <fieldset> - <legend> <?= t("Add photos to %album_title", array("album_title" => p::clean($item->title))) ?> </legend> + <legend> <?= t("Add photos to %album_title", array("album_title" => p::purify($item->title))) ?> </legend> </fieldset> </form> @@ -27,24 +28,31 @@ <? foreach ($item->parents() as $parent): ?> <li> <?= p::clean($parent->title) ?> </li> <? endforeach ?> - <li class="active"> <?= p::clean($item->title) ?> </li> + <li class="active"> <?= p::purify($item->title) ?> </li> </ul> - <p><?= t("Upload Queue") ?></p> + <p> + <span id="gUploadQueueInfo"> + <?= t("Upload Queue") ?> + </span> + <a id="gUploadCancel" title="<?= t("Cancel all the pending uploads") ?>" onclick="swfu.cancelQueue();"><?= t("cancel") ?></a> + </p> <div id="gAddPhotosCanvas" style="text-align: center;"> <div id="gAddPhotosQueue"></div> <div id="gEditPhotosQueue"></div> <span id="gChooseFilesButtonPlaceholder"></span> </div> + <!-- <button id="gUploadCancel" class="ui-state-default ui-corner-all" type="button" onclick="swfu.cancelQueue();" disabled="disabled"> <?= t("Cancel all") ?> </button> + --> <!-- Proxy the done request back to our form, since its been ajaxified --> <button class="ui-state-default ui-corner-all" onclick="$('#gAddPhotosForm').submit()"> - <?= t("Done") ?> + <?= t("Close") ?> </button> </div> @@ -67,25 +75,26 @@ float: right; } #gAddPhotos #gUploadCancel { - float: left; + display: none; + cursor: pointer; } </style> <script type="text/javascript"> var swfu = new SWFUpload({ - flash_url : "<?= url::file("lib/swfupload/swfupload.swf") ?>", + flash_url: "<?= url::file("lib/swfupload/swfupload.swf") ?>", upload_url: "<?= url::site("simple_uploader/add_photo/$item->id") ?>", post_params: { "g3sid": "<?= Session::instance()->id() ?>", "user_agent": "<?= Input::instance()->server("HTTP_USER_AGENT") ?>", "csrf": "<?= $csrf ?>" }, - file_size_limit : "<?= ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB" ?>", - file_types : "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4", - file_types_description : "<?= t("Photos and Movies") ?>", - file_upload_limit : 1000, - file_queue_limit : 0, - custom_settings : { }, + file_size_limit: "<?= ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB" ?>", + file_types: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4", + file_types_description: "<?= t("Photos and Movies") ?>", + file_upload_limit: 1000, + file_queue_limit: 0, + custom_settings: { }, debug: false, // Button settings @@ -99,15 +108,15 @@ button_text_top_padding: 10, // The event handler functions are defined in handlers.js - file_queued_handler : file_queued, - file_queue_error_handler : file_queue_error, - file_dialog_complete_handler : file_dialog_complete, - upload_start_handler : upload_start, - upload_progress_handler : upload_progress, - upload_error_handler : upload_error, - upload_success_handler : upload_success, - upload_complete_handler : upload_complete, - queue_complete_handler : queue_complete + file_queued_handler: file_queued, + file_queue_error_handler: file_queue_error, + file_dialog_complete_handler: file_dialog_complete, + upload_start_handler: upload_start, + upload_progress_handler: upload_progress, + upload_error_handler: upload_error, + upload_success_handler: upload_success, + upload_complete_handler: upload_complete, + queue_complete_handler: queue_complete }); // @todo add support for cancelling individual uploads @@ -118,7 +127,8 @@ "<div class=\"box\" id=\"" + file.id + "\">" + "<div class=\"title\"></div>" + "<div class=\"status\"></div>" + - "<div class=\"progressbar\"></div></div>"); + "<div class=\"progressbar\"></div>" + + "</div>"); this.box = $("#" + file.id); } this.title = this.box.find(".title"); @@ -171,7 +181,8 @@ function file_dialog_complete(num_files_selected, num_files_queued) { if (num_files_selected > 0) { - $("#gUploadCancel").enable(true); + $("#gUploadCancel").show(); + $("#gUploadQueueInfo").text(get_completed_status_msg(this.getStats())); } // Auto start the upload @@ -184,6 +195,7 @@ var fp = new File_Progress(file); fp.title.html(file.name); fp.set_status("uploading", "<?= t("Uploading...") ?>"); + $("#gAddPhotosCanvas").scrollTo(fp.box, 1000); return true; // @todo add cancel button to call this.cancelUpload(file.id) } @@ -226,7 +238,7 @@ case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: // If there aren't any files left (they were all cancelled) disable the cancel button if (this.getStats().files_queued === 0) { - $("#gUploadCancel").enable(false); + $("#gUploadCancel").hide(); } fp.set_status("error", "<?= t("Cancelled") ?>"); break; @@ -240,11 +252,21 @@ } function upload_complete(file) { - if (this.getStats().files_queued === 0) { - $("#gUploadCancel").enable(false); + var stats = this.getStats(); + $("#gUploadQueueInfo").text(get_completed_status_msg(stats)); + if (stats.files_queued === 0) { + $("#gUploadCancel").hide(); } } + function get_completed_status_msg(stats) { + var msg = "<?= t("Upload Queue (completed %completed of %total)", array("completed" => "__COMPLETED__", "total" => "__TOTAL__")) ?>"; + msg = msg.replace("__COMPLETED__", stats.successful_uploads); + msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads + + stats.upload_errors + stats.upload_cancelled + stats.queue_errors); + return msg; + } + // This event comes from the Queue Plugin function queue_complete(num_files_uploaded) { var status_msg = "<?= t("Uploaded: __COUNT__") ?>"; diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 07792322..37578855 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <html> <head> - <title><?= t("Gallery3 Upgrader") ?></title> + <title><?= t("Gallery 3 Upgrader") ?></title> <link rel="stylesheet" type="text/css" href="<?= url::file("modules/gallery/css/upgrader.css") ?>" media="screen,print,projection" /> <script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script> @@ -13,6 +13,7 @@ <? if ($can_upgrade): ?> <? if ($done): ?> <div id="confirmation"> + <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a> <div> <h1> <?= t("That's it!") ?> </h1> <p> @@ -42,7 +43,7 @@ <? if ($module->active): ?> <tr class="<?= $module->version == $module->code_version ? "current" : "upgradeable" ?>" > <td class="name <?= $id ?>"> - <?= $module->name ?> + <?= t($module->name) ?> </td> <td> <?= $module->version ?> @@ -71,7 +72,7 @@ <? foreach ($available as $module): ?> <? if (!$module->active): ?> <li> - <?= $module->name ?> + <?= t($module->name) ?> </li> <? endif ?> <? endforeach ?> @@ -88,7 +89,7 @@ <div id="footer"> <p> <i> - <?= t("Did something go wrong? Try the <a href=\"%faq_url\">FAQ</a> or ask in the <a href=\"%forums_url\">Gallery forums</a>.</i>", + <?= t("Did something go wrong? Try the <a href=\"%faq_url\">FAQ</a> or ask in the <a href=\"%forums_url\">Gallery forums</a>.", array("faq_url" => "http://codex.gallery2.org/Gallery3:FAQ", "forums_url" => "http://gallery.menalto.com/forum")) ?> </i> |
