summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/libraries/Gallery_View.php2
-rw-r--r--modules/gallery/views/admin_dashboard.html.php2
-rw-r--r--modules/gallery/views/simple_uploader.html.php62
3 files changed, 39 insertions, 27 deletions
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index b4cfde46..9d4fe5c0 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -26,7 +26,7 @@ class Gallery_View_Core extends View {
* Add a script to the combined scripts list.
* @param $file the relative path to a script from the gallery3 directory
*/
- public function script($file, $theme_relative=false) {
+ public function script($file) {
$this->scripts[$file] = 1;
}
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/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index 4c1e70f0..eee29679 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -31,17 +31,23 @@
<li class="active"> <?= p::clean($item->title) ?> </li>
</ul>
- <p><?= t("Upload Queue") ?></p>
+ <p>
+ <?= t("Upload Queue") ?>
+ <span id="gUploadQueueInfo"></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()">
@@ -68,25 +74,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
@@ -100,15 +107,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
@@ -119,7 +126,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");
@@ -172,9 +180,12 @@
function file_dialog_complete(num_files_selected, num_files_queued) {
if (num_files_selected > 0) {
- $("#gUploadCancel").enable(true);
+ $("#gUploadCancel").show();
+ var stats = this.getStats();
+ $("#gUploadQueueInfo").text("(completed " + stats.successful_uploads +
+ " of " + (stats.files_queued + stats.successful_uploads + stats.upload_errors + stats.upload_cancelled + stats.queue_errors) + ")");
}
-
+
// Auto start the upload
this.startUpload();
}
@@ -228,7 +239,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;
@@ -242,8 +253,11 @@
}
function upload_complete(file) {
- if (this.getStats().files_queued === 0) {
- $("#gUploadCancel").enable(false);
+ var stats = this.getStats();
+ $("#gUploadQueueInfo").text("(completed " + stats.successful_uploads +
+ " of " + (stats.files_queued + stats.successful_uploads + stats.upload_errors + stats.upload_cancelled + stats.queue_errors) + ")");
+ if (stats.files_queued === 0) {
+ $("#gUploadCancel").hide();
}
}