From da1493b95a2f0b5000a487ae373c9318c58d0b2d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 24 Oct 2010 21:08:27 +0000 Subject: partial implementation of flash uploader --- views/default/tidypics/css.php | 24 +++++++++++ views/default/tidypics/forms/ajax_upload.php | 64 ++++++++++++++++++++++++++++ views/default/tidypics/js/uploader.php | 4 ++ 3 files changed, 92 insertions(+) create mode 100644 views/default/tidypics/forms/ajax_upload.php create mode 100644 views/default/tidypics/js/uploader.php (limited to 'views/default') diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index 9d904a7ff..9e5a5c68d 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -298,4 +298,28 @@ display:inline; #tidypics_image_upload_list { list-style: none; +} + +/*----- uploadify ------*/ +.uploadifyQueueItem { +background-color:#F5F5F5; +border:2px solid #E5E5E5; +font:11px Verdana,Geneva,sans-serif; +margin-top:5px; +padding:10px; +width:350px; +} + +.uploadifyProgress { +background-color:#FFFFFF; +border-color:#808080 #C5C5C5 #C5C5C5 #808080; +border-style:solid; +border-width:1px; +margin-top:10px; +width:100%; +} +.uploadifyProgressBar { +background-color: #0099FF; +width: 1px; +height: 3px; } \ No newline at end of file diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/tidypics/forms/ajax_upload.php new file mode 100644 index 000000000..b71068a13 --- /dev/null +++ b/views/default/tidypics/forms/ajax_upload.php @@ -0,0 +1,64 @@ +access_id; + +$ts = time(); +$token = generate_action_token($ts); + + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> + +
+ +

Instructions here for uploading images using Ajax/Flash

+ +Upload Files | +Clear Queue + +
+ + + diff --git a/views/default/tidypics/js/uploader.php b/views/default/tidypics/js/uploader.php new file mode 100644 index 000000000..38666573c --- /dev/null +++ b/views/default/tidypics/js/uploader.php @@ -0,0 +1,4 @@ + + + + -- cgit v1.2.3