From 9546e19e34d08e0d55f066f04149794e566c3539 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 10 Nov 2009 12:49:13 -0800 Subject: Pass two of uploadify... remove the default.css file, removed the folder option and create a status area where succesful uploads are listed. --- modules/gallery/controllers/simple_uploader.php | 9 --- modules/gallery/css/gallery.css | 51 +++----------- modules/gallery/views/simple_uploader.html.php | 91 ++++++++++++------------- 3 files changed, 53 insertions(+), 98 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php index 36464e24..bc508319 100644 --- a/modules/gallery/controllers/simple_uploader.php +++ b/modules/gallery/controllers/simple_uploader.php @@ -66,15 +66,6 @@ class Simple_Uploader_Controller extends Controller { log::success("content", t("Added a photo"), html::anchor("photos/$item->id", t("view photo"))); } - $tags = $this->input->post("tags"); - if (!empty($tags)) { - foreach (split(",", $tags) as $tag_name) { - $tag_name = trim($tag_name); - if ($tag_name) { - $tag = tag::add($item, $tag_name); - } - } - } } catch (Exception $e) { Kohana::log("alert", $e->__toString()); if (file_exists($temp_filename)) { diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 077b21bc..066ab68a 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -56,15 +56,17 @@ /* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-add-photos #SWFUpload_0 { - left: 134px; - position: relative; - top: -200px; +#g-add-photos-canvas { + border: 1px solid #ccc; + height: 200px; + margin: .5em 0; + overflow: auto; + width: 469px; } -#g-add-photos-canvas { +#g-add-photos-status { border: 1px solid #ccc; - height: 325px; + height: 125px; margin: .5em 0; overflow: auto; width: 469px; @@ -76,30 +78,9 @@ margin-left: .5em; } -#g-uploadqueue-infobar { - clear: both; -} - -#g-uploadqueue-infobar #g-cancelupload { - cursor: pointer; - display: none; -} - -#g-add-photos-queue .progressbar { - height: 4px; -} - -#g-add-photos-queue .status { - font-size: .75em; -} - -#g-add-photos-queue .box { - padding: .2em; -} - -#g-add-photos-queue .pending { - background-color: #e8e8e8; - border: 1px solid #d7d7d7; +#g-add-photos-status td { + text-align: left; + padding-left: 2em; } #g-add-photos-queue .error { @@ -107,16 +88,6 @@ border: 1px solid #ebb; } -#g-add-photos-queue .uploading { - background-color: #ff9; - border: 1px solid #ee8; -} - -#g-add-photos-queue .complete { - background-color: #cfc; - border: 1px solid #beb; -} - #g-add-photos p { margin: 0 } diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 014919c3..a84a3b00 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -5,12 +5,10 @@ $("#g-add-photos-canvas").ready(function () { $("#g-uploadify").uploadify({ uploader: "", - folder: "", script: "id}") ?>", scriptData: Session::instance()->id(), "user_agent" => Input::instance()->server("HTTP_USER_AGENT"), - "tags" => "", "csrf" => $csrf)) ?>, fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4", fileDesc: for_js() ?>, @@ -31,6 +29,12 @@ .attr("disabled", "disabled"); return true; }, + onComplete: function(event, queueID, fileObj, response, data) { + $("#g-add-photos-status tbody").append( + "" + fileObj.name + "" + + Math.ceil(fileObj.size / 1000) + " KB" + "" + Math.floor(data.speed) + " KB/s "); + return true; + }, onSelect: function(event) { if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) { $("#g-upload-cancel-all") @@ -40,15 +44,6 @@ return true; } }); - - $('#g-add-photos-tags').autocomplete( - '', - {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1} - ); - $('#g-add-photos-tags').blur(function (event) { - $("#g-uploadify").uploadifySettings("scriptData", {"tags": $(this).val()}); - }); - }); @@ -57,47 +52,45 @@ html::purify($item->title))) ?> -
- - + -
-

- -

-
    - parents() as $i => $parent): ?> - > title) ?> - -
  • title) ?>
  • -
-
- - -
- - -
- +
+

+ +

+
    + parents() as $i => $parent): ?> + > title) ?> + +
  • title) ?>
  • +
+
-
-
+
+
+
+ + + +
+
- - - - - + + + + -- cgit v1.2.3