From 3e6ba7acc3291f2268cbe9c9bef0a492b557babb Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 4 Oct 2009 00:27:22 -0600 Subject: Renamed most, if not all css selectors from gName to g-name. Moved a few shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features. --- modules/gallery/css/debug.css | 8 ++++---- modules/gallery/css/l10n_client.css | 28 +++++++++++++++------------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/debug.css b/modules/gallery/css/debug.css index fe5665ad..6808da09 100644 --- a/modules/gallery/css/debug.css +++ b/modules/gallery/css/debug.css @@ -1,4 +1,4 @@ -.gAnnotatedThemeBlock { +.g-annotated-theme-block { border: 1px solid #C00; clear: both; margin: 1em; @@ -6,15 +6,15 @@ position: relative; } -.gAnnotatedThemeBlock_album_top { +.g-annotated-theme-block_album_top { float: right; } -.gAnnotatedThemeBlock_header_bottom { +.g-annotated-theme-block_header_bottom { float: right; } -.gAnnotatedThemeBlock div.title { +.g-annotated-theme-block div.title { background: #C00; border: 1px solid black; color: white; diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css index 9c1b12d0..542da8e6 100644 --- a/modules/gallery/css/l10n_client.css +++ b/modules/gallery/css/l10n_client.css @@ -1,6 +1,8 @@ -// TODO(andy_st): Add original copyright notice from Drupal l10_client. -// TODO(andy_st): Add G3 copyright notice. -// TODO(andy_st): clean up formatting to match our other CSS files. +/** + * TODO(andy_st): Add original copyright notice from Drupal l10_client. + * TODO(andy_st): Add G3 copyright notice. + * TODO(andy_st): clean up formatting to match our other CSS files. + */ /* $Id: l10n_client.css,v 1.6 2008/09/09 10:48:20 goba Exp $ */ @@ -50,7 +52,7 @@ font-size: 1em; padding: .5em; } -#l10n-client-toggler #gMinimizeL10n { +#l10n-client-toggler #g-minimize-l10n { border-right: 1px solid #ffffff; } @@ -126,31 +128,31 @@ #l10n-client .string-list li.active { font-weight:bold;} -#l10n-client #gL10nSearchForm { +#l10n-client #g-l10n-search-form { background:#eee; text-align:center; height:2em; line-height:2em; margin:0em; padding:.5em .5em; } -#l10n-client #gL10nSearchForm .form-item, -#l10n-client #gL10nSearchForm input.form-text, -#l10n-client #gL10nSearchForm #search-filter-go, -#l10n-client #gL10nSearchForm #search-filter-clear { +#l10n-client #g-l10n-search-form .form-item, +#l10n-client #g-l10n-search-form input.form-text, +#l10n-client #g-l10n-search-form #search-filter-go, +#l10n-client #g-l10n-search-form #search-filter-clear { display:inline; vertical-align:middle; } -#l10n-client #gL10nSearchForm .form-item { +#l10n-client #g-l10n-search-form .form-item { margin:0em; padding:0em; } -#l10n-client #gL10nSearchForm input.form-text { +#l10n-client #g-l10n-search-form input.form-text { width:80%; } -#l10n-client #gL10nSearchForm #search-filter-clear { +#l10n-client #g-l10n-search-form #search-filter-clear { width:10%; margin:0em; } @@ -178,7 +180,7 @@ overflow:hidden; width:49%; float:right;} -#gL10nClientSaveForm { +#g-l10n-client-save-form { padding:0em;} #l10n-client form ul, -- cgit v1.2.3 From 9136090a23f47a42e459fc7e9f2b058df649e587 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 25 Oct 2009 16:33:58 -0600 Subject: Quote Trebuchet MS since it contains a space. --- modules/gallery/css/upgrader.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css index 7c377817..64e4ca07 100644 --- a/modules/gallery/css/upgrader.css +++ b/modules/gallery/css/upgrader.css @@ -1,6 +1,6 @@ body { background: #eee; - font-family: Trebuchet MS; + font-family: 'Trebuchet MS'; font-size: 1.1em; } -- cgit v1.2.3 From c5faa3560e53fa8547199f60545ba550c2c60345 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 25 Oct 2009 16:53:54 -0600 Subject: Created gallery.css file, moved simple uploader, move, and permissions CSS there. Removed relocated styles from theme css. --- modules/gallery/css/gallery.css | 118 ++++++++++++++++++++++ modules/gallery/helpers/gallery_theme.php | 1 + themes/wind/css/screen.css | 157 ++---------------------------- 3 files changed, 128 insertions(+), 148 deletions(-) create mode 100644 modules/gallery/css/gallery.css (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css new file mode 100644 index 00000000..a4a52155 --- /dev/null +++ b/modules/gallery/css/gallery.css @@ -0,0 +1,118 @@ +/** + * @todo Make #g-welcome-message p unecessary + * @todo Review permissions dialog, find home + */ + +/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-edit-permissions-form { + clear: both; +} + +#g-edit-permissions-form td { + background-image: none; +} + +#g-edit-permissions-form fieldset { + border: 1px solid #ccc; + padding: 0; +} + +#g-permissions .g-denied, +#g-permissions .g-allowed { + text-align: center; + vertical-align: middle; +} + +#g-permissions .g-denied { + background-color: #fcc; +} + +#g-permissions .g-allowed { + background-color: #cfc; +} + +/* Move items ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-move ul { + padding-left: 1em; +} + +#g-move .selected { + background: #999; +} + +/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-add-photos #SWFUpload_0 { + position: relative; + top: -200px; + left: 134px; +} + +#g-add-photos .g-breadcrumbs { + border: 0; + margin: 0; + padding-left:10px; +} + +#g-add-photos-canvas { + border: 1px solid #ccc; + margin: .5em 0 .5em 0; + width: 469px; + height: 325px; + overflow: auto; +} + +#g-add-photos button { + margin-bottom: .5em; + float: right; +} +#g-uploadqueue-infobar { + clear: both; +} + +#g-uploadqueue-infobar #g-cancelupload { + display: none; + cursor: pointer; +} + +#g-add-photos-canvas { +} + +#g-add-photos-queue .progressbar { + height: 4px; +} + +#g-add-photos-queue .title { + font-size: 1.25em; +} + +#g-add-photos-queue .status { + font-size: .75em; +} + +#g-add-photos-queue .box { + margin-bottom: 8px; + padding: 4px; +} + +#g-add-photos-queue .pending { + background-color: #e8e8e8; + border: 1px solid #d7d7d7; +} + +#g-add-photos-queue .error { + background-color: #fcc; + 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; +} diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index a342b4bd..05b8f59a 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -21,6 +21,7 @@ class gallery_theme_Core { static function head($theme) { $session = Session::instance(); $buf = ""; + $theme->css("gallery.css"); if ($session->get("debug")) { $theme->css("debug.css"); } diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index 84b8b090..873f0a47 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -9,11 +9,12 @@ * 3) Page layout containers * 4) Content blocks in specific layout containers * 5) Navigation and menus - * 6) Browser hacks - * 7) jQuery and jQuery UI - * 8) Right-to-left language styles + * 6) jQuery and jQuery UI + * 7) Right-to-left language styles * - * @todo Move #g-admin-g2-import stuff to g2import module + * @todo Move #g-comments to comment module, recapthca to recaptcha? + * @todo Make #g-welcome-message p unecessary + * @todo Review g-buttonset and it's usage */ /** ******************************************************************* @@ -371,7 +372,7 @@ td { margin-bottom: 0 !important; } -/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~ */ .g-context-menu { background-color: #fff; @@ -503,149 +504,9 @@ td { background-position: -208px -64px; } -/* STUFF THAT NEEDS A HOME */ - -#g-move ul { - padding-left: 1em; -} - -#g-move .selected { - background: #999; -} - -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-edit-permissions-form { - clear: both; -} - -#g-edit-permissions-form td { - background-image: none; -} - -#g-edit-permissions-form fieldset { - border: 1px solid #ccc; - padding: 0; -} - -#g-permissions .g-denied, -#g-permissions .g-allowed { - text-align: center; - vertical-align: middle; -} - -#g-permissions .g-denied { - background-color: #fcc; -} - -#g-permissions .g-allowed { - background-color: #cfc; -} - -/*************** STUFF THAT NEEDS A HOME ****************/ - -#g-add-photos #SWFUpload_0 { - position: relative; - top: -200px; - left: 134px; -} -#g-add-photos .g-breadcrumbs { - border: 0; - margin: 0; - padding-left:10px; -} -#g-add-photos-canvas { - border: 1px solid #ccc; - margin: .5em 0 .5em 0; - width: 469px; - height: 325px; - overflow: auto; -} -#g-add-photos button { - margin-bottom: .5em; - float: right; -} -#g-uploadqueue-infobar { - clear: both; -} -#g-uploadqueue-infobar #g-cancelupload { - display: none; - cursor: pointer; -} - -#g-add-photos-canvas { - -} - -#g-add-photos-queue .progressbar { - height: 4px; -} - -#g-add-photos-queue .title { - font-size: 1.25em; -} - -#g-add-photos-queue .status { - font-size: .75em; -} - -#g-add-photos-queue .box { - margin-bottom: 8px; - padding: 4px; -} - -#g-add-photos-queue .pending { - background-color: #e8e8e8; - border: 1px solid #d7d7d7; -} - -#g-add-photos-queue .error { - background-color: #fcc; - 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-admin-g2-import-notes { - padding-bottom: 20px; -} - -#g-admin-g2-import-details { - padding-top: 20px; -} - -#g-admin-g2-import-details .g-warning { - margin-top: 4px; -} - -#g-admin-g2-import-details .g-info { - padding: 2px; - border: 1px solid #999; - margin-bottom: 10px; -} - -#g-admin-g2-import-notes p, -#g-admin-g2-import-details .g-info p { - padding: 0; - margin: 0; -} - -#g-admin-g2-import-notes ul li, -#g-admin-g2-import .g-info ul li { - padding-left: 0; - margin-left: 20px; - list-style-type: disc; -} - -/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */ +/** ******************************************************************* + * 6) Right to left styles + *********************************************************************/ .rtl { direction: rtl; -- cgit v1.2.3 From 6984737a542d759cbde967341ff3eca9ce20a3ba Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 5 Nov 2009 21:35:40 -0800 Subject: Clean up problem with cancelling the inplace edit left a whole bunch of css artifacts. --- modules/gallery/css/gallery.css | 4 ++++ modules/gallery/helpers/gallery_theme.php | 1 + modules/gallery/views/in_place_edit.html.php | 8 -------- themes/admin_wind/css/screen.css | 5 +++++ themes/night_wind/css/screen.css | 5 +++++ themes/wind/css/screen.css | 5 +++++ 6 files changed, 20 insertions(+), 8 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index a4a52155..c766abbc 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -116,3 +116,7 @@ background-color: #cfc; border: 1px solid #beb; } + +#g-inplace-edit-form ul { + margin: 0; +} diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index 3fcaca67..0682d4ae 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -61,6 +61,7 @@ class gallery_theme_Core { } static function admin_head($theme) { + $theme->css("gallery.css"); $theme->script("gallery.panel.js"); $session = Session::instance(); if ($session->get("debug")) { diff --git a/modules/gallery/views/in_place_edit.html.php b/modules/gallery/views/in_place_edit.html.php index 5cc42cd6..64671d57 100644 --- a/modules/gallery/views/in_place_edit.html.php +++ b/modules/gallery/views/in_place_edit.html.php @@ -1,12 +1,4 @@ - "post", "id" => "g-inplace-edit-form", "class" => "g-short-form"), $hidden) ?>
  • class="g-error"> diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 87879ecb..cd83b110 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -368,6 +368,11 @@ th { padding: .3em .8em; } +/* In-line editting ~~~~~~~~~~~~~~~~~~~~~ */ +#g-inplace-edit-message { + background-color: #FFF; +} + /** ******************************************************************* * 5) Navigation and menus *********************************************************************/ diff --git a/themes/night_wind/css/screen.css b/themes/night_wind/css/screen.css index b95cfc72..2286b26e 100644 --- a/themes/night_wind/css/screen.css +++ b/themes/night_wind/css/screen.css @@ -455,6 +455,11 @@ li.g-error select { padding-top: 1em; } +/* In-line editting ~~~~~~~~~~~~~~~~~~~~~ */ +#g-inplace-edit-message { + background-color: #FFF; +} + /** ******************************************************************* * 5) Navigation and menus *********************************************************************/ diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index 1fc5fa65..8c466bd8 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -299,6 +299,11 @@ td { padding-top: 1em; } +/* In-line editting ~~~~~~~~~~~~~~~~~~~~~ */ +#g-inplace-edit-message { + background-color: #FFF; +} + /** ******************************************************************* * 5) Navigation and menus *********************************************************************/ -- cgit v1.2.3 From e0fcd8130e6fe732443a2791c8114340a230a335 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 5 Nov 2009 22:37:57 -0700 Subject: Removed todos, they're done. --- modules/gallery/css/gallery.css | 5 ----- 1 file changed, 5 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index c766abbc..491a1321 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -1,8 +1,3 @@ -/** - * @todo Make #g-welcome-message p unecessary - * @todo Review permissions dialog, find home - */ - /* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #g-edit-permissions-form { -- cgit v1.2.3 From 04c10a0720b57bc4b6273ea7127d9880c2c28354 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 5 Nov 2009 23:10:32 -0700 Subject: Minor css cleanup. Removed a few redundant and unused attributes, alphabetized attributes, white-space fixes. --- modules/gallery/css/gallery.css | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 491a1321..724c50d3 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -10,7 +10,6 @@ #g-edit-permissions-form fieldset { border: 1px solid #ccc; - padding: 0; } #g-permissions .g-denied, @@ -37,59 +36,52 @@ background: #999; } +/* In-place edit ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-inplace-edit-form ul { + margin: 0; +} + /* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ #g-add-photos #SWFUpload_0 { + left: 134px; position: relative; top: -200px; - left: 134px; -} - -#g-add-photos .g-breadcrumbs { - border: 0; - margin: 0; - padding-left:10px; } #g-add-photos-canvas { border: 1px solid #ccc; - margin: .5em 0 .5em 0; - width: 469px; height: 325px; + margin: .5em 0; overflow: auto; + width: 469px; } #g-add-photos button { - margin-bottom: .5em; float: right; + margin-bottom: .5em; } + #g-uploadqueue-infobar { clear: both; } #g-uploadqueue-infobar #g-cancelupload { - display: none; cursor: pointer; -} - -#g-add-photos-canvas { + display: none; } #g-add-photos-queue .progressbar { height: 4px; } -#g-add-photos-queue .title { - font-size: 1.25em; -} - #g-add-photos-queue .status { font-size: .75em; } #g-add-photos-queue .box { - margin-bottom: 8px; - padding: 4px; + padding: .2em; } #g-add-photos-queue .pending { @@ -111,7 +103,3 @@ background-color: #cfc; border: 1px solid #beb; } - -#g-inplace-edit-form ul { - margin: 0; -} -- cgit v1.2.3 From 3e0a81a39490f58840e3144b88d9c963e69f8f79 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Fri, 6 Nov 2009 21:35:32 -0700 Subject: Move log viewing and translation CSS from admin_wind to gallery.css. Explicitly set widths on all admin forms to 270px, all work better at a narrower width than the 500px default set by gallery.dialog.js. --- modules/gallery/css/gallery.css | 46 ++++++++++++++++++++++++++++++++++++++++ themes/admin_wind/css/screen.css | 39 ++++++---------------------------- 2 files changed, 52 insertions(+), 33 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 724c50d3..18d9a522 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -1,3 +1,15 @@ +/** + * Gallery 3 core module styles + * + * Sheet organization: + * 1) End-user + * 2) Admin + */ + +/** ******************************************************************* + * 1) End-user + **********************************************************************/ + /* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #g-edit-permissions-form { @@ -103,3 +115,37 @@ background-color: #cfc; border: 1px solid #beb; } + +/** ******************************************************************* + * 2) Admin + **********************************************************************/ + +.g-task-log { + border: 1px solid #000; + height: 400px; + margin: .6em 0; + overflow: auto; + padding: .4em +} + +#g-languages-form table { + width: 40%; + margin: 0 3em 1em 0; +} + +#g-languages-form input { + clear: both; +} + +#g-translations ol { + margin: 0 0 1em 2em; +} +#g-translations ol li { + list-style-type: decimal; + line-height: 150%; +} + +#g-translations .g-button { + padding: .5em; + margin-bottom: 1em; +} diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index cd83b110..8d49a389 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -86,6 +86,12 @@ a:hover, text-decoration: none; } +/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-dialog form { + width: 270px; +} + /* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ table { @@ -435,39 +441,6 @@ th { padding: .2em .4em; } -/*************** STUFF THAT NEEDS A HOME ****************/ - -.g-task-log { - border: 1pt solid; - font-size: .9em; - height: 400px; - margin: .5em 0; - overflow: auto; - padding: .5em -} - -#g-languages-form table { - width: 40%; - margin: 0 3em 1em 0; -} - -#g-languages-form input { - clear: both; -} - -#g-translations ol { - margin: 0 0 1em 2em; -} -#g-translations ol li { - list-style-type: decimal; - line-height: 150%; -} - -#g-translations .g-button { - padding: .5em; - margin-bottom: 1em; -} - /** ******************************************************************* * 7) Right to left styles *********************************************************************/ -- cgit v1.2.3 From e300ede3d8311bf236594480355f710b39aaa451 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 7 Nov 2009 00:05:49 -0800 Subject: 1) Change the name of the form and message to g-in-place-edit-form and g-in-place-edit-message. 2) Make sure the cancel button works and cleans up the dom appropriately. --- lib/gallery.in_place_edit.js | 27 ++++++++++++++++++--------- modules/gallery/css/gallery.css | 2 +- modules/gallery/views/in_place_edit.html.php | 4 ++-- themes/admin_wind/css/screen.css | 2 +- themes/night_wind/css/screen.css | 2 +- themes/wind/css/screen.css | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) (limited to 'modules/gallery/css') diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js index 4a90581b..681688e5 100644 --- a/lib/gallery.in_place_edit.js +++ b/lib/gallery.in_place_edit.js @@ -2,7 +2,6 @@ $.widget("ui.gallery_in_place_edit", { _init: function() { var self = this; - $(self).data("parent", self.element.parent()); this.element.click(function(event) { event.preventDefault(); self._show(event.currentTarget); @@ -15,11 +14,9 @@ var tag_width = $(target).width(); $(self).data("tag_width", tag_width); - var form = $("#g-inplace-edit-form"); + var form = $("#g-in-place-edit-form"); if (form.length > 0) { - var parent = form.parent(); - form.remove(); - parent.children().show(); + self._cancel(); } $.get(self.options.form_url.replace("__ID__", $(target).attr('rel')), function(data) { @@ -31,8 +28,7 @@ .focus(); $(".g-short-form").gallery_short_form(); parent.find("form .g-cancel").click(function(event) { - parent.find("form").remove(); - parent.children().show(); + self._cancel(); event.preventDefault(); return false; }); @@ -41,21 +37,34 @@ }, + _cancel: function() { + var parent = $("#g-in-place-edit-form").parent(); + $(parent).find("form").remove(); + $(parent).children().show(); + $("#g-in-place-edit-message").remove(); + }, + _ajaxify_edit: function() { var self = this; - var form = $($(self).data("parent")).find("form"); + var form = $("#g-in-place-edit-form"); $(form).ajaxForm({ dataType: "json", success: function(data) { if (data.result == "success") { window.location.reload(); } else { + var parent = $(form).parent(); $(form).replaceWith(data.form); var width = $(self).data("tag_width"); - $($(self).data("parent")).find("form :text") + $(parent).find("form :text") .width(width) .focus(); $(".g-short-form").gallery_short_form(); + $(parent).find("form .g-cancel").click(function(event) { + self._cancel(); + event.preventDefault(); + return false; + }); self._ajaxify_edit(); } } diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 18d9a522..3262dee2 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -50,7 +50,7 @@ /* In-place edit ~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-inplace-edit-form ul { +#g-in-place-edit-form ul { margin: 0; } diff --git a/modules/gallery/views/in_place_edit.html.php b/modules/gallery/views/in_place_edit.html.php index 64671d57..03cbdc69 100644 --- a/modules/gallery/views/in_place_edit.html.php +++ b/modules/gallery/views/in_place_edit.html.php @@ -1,5 +1,5 @@ - "post", "id" => "g-inplace-edit-form", "class" => "g-short-form"), $hidden) ?> + "post", "id" => "g-in-place-edit-form", "class" => "g-short-form"), $hidden) ?>
    • class="g-error"> @@ -11,6 +11,6 @@
    -
    +
    diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 5fe47d76..3342bd83 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -383,7 +383,7 @@ th { } /* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ -#g-inplace-edit-message { +#g-in-place-edit-message { background-color: #FFF; } diff --git a/themes/night_wind/css/screen.css b/themes/night_wind/css/screen.css index 1d5e5e2b..cd1824d1 100644 --- a/themes/night_wind/css/screen.css +++ b/themes/night_wind/css/screen.css @@ -456,7 +456,7 @@ li.g-error select { } /* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ -#g-inplace-edit-message { +#g-in-place-edit-message { background-color: #FFF; } diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index 2ac37fb6..74771e07 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -300,7 +300,7 @@ td { } /* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ -#g-inplace-edit-message { +#g-in-place-edit-message { background-color: #FFF; } -- cgit v1.2.3 From d8beb6f5301204cac3b74a827dbbc3082324de6f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 9 Nov 2009 13:54:55 -0800 Subject: First cut at replacing swfupload with uploadify. Probably need to review the css and remove extra swfupload selectors. Also changed the dialog so tags can be entered for all the files being uploaded. Probably need to add better start processing so the batch is started before the first image is loaded. Maybe add a module variable so the number of simultaneous uploads can be initiated (currently hard ocded to 10. --- lib/uploadify/cancel.png | Bin 0 -> 603 bytes lib/uploadify/default.css | 10 + lib/uploadify/expressInstall.swf | Bin 0 -> 727 bytes lib/uploadify/jquery.uploadify.min.js | 26 +++ lib/uploadify/uploadify.allglyphs.swf | Bin 0 -> 239838 bytes lib/uploadify/uploadify.css | 53 +++++ lib/uploadify/uploadify.fla | Bin 0 -> 125952 bytes lib/uploadify/uploadify.swf | Bin 0 -> 23118 bytes modules/gallery/controllers/simple_uploader.php | 9 + modules/gallery/css/gallery.css | 23 +- modules/gallery/helpers/gallery_theme.php | 1 + modules/gallery/views/simple_uploader.html.php | 287 ++++++------------------ themes/night_wind/css/screen.css | 70 ------ 13 files changed, 185 insertions(+), 294 deletions(-) create mode 100644 lib/uploadify/cancel.png create mode 100644 lib/uploadify/default.css create mode 100644 lib/uploadify/expressInstall.swf create mode 100644 lib/uploadify/jquery.uploadify.min.js create mode 100644 lib/uploadify/uploadify.allglyphs.swf create mode 100644 lib/uploadify/uploadify.css create mode 100644 lib/uploadify/uploadify.fla create mode 100644 lib/uploadify/uploadify.swf (limited to 'modules/gallery/css') diff --git a/lib/uploadify/cancel.png b/lib/uploadify/cancel.png new file mode 100644 index 00000000..1c062ae5 Binary files /dev/null and b/lib/uploadify/cancel.png differ diff --git a/lib/uploadify/default.css b/lib/uploadify/default.css new file mode 100644 index 00000000..2173d9ec --- /dev/null +++ b/lib/uploadify/default.css @@ -0,0 +1,10 @@ +body { + font: 12px/16px Arial, Helvetica, sans-serif; +} +#fileQueue { + width: 400px; + height: 300px; + overflow: auto; + border: 1px solid #E5E5E5; + margin-bottom: 10px; +} \ No newline at end of file diff --git a/lib/uploadify/expressInstall.swf b/lib/uploadify/expressInstall.swf new file mode 100644 index 00000000..0fbf8fca Binary files /dev/null and b/lib/uploadify/expressInstall.swf differ diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js new file mode 100644 index 00000000..43053119 --- /dev/null +++ b/lib/uploadify/jquery.uploadify.min.js @@ -0,0 +1,26 @@ +/* +Uploadify v2.1.0 +Release Date: August 24, 2009 + +Copyright (c) 2009 Ronnie Garcia, Travis Nickels + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('
    ');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('
    ')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('
    '+fileName+" ("+k+l+')
    ')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full. The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;did", 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 3262dee2..077b21bc 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -73,6 +73,7 @@ #g-add-photos button { float: right; margin-bottom: .5em; + margin-left: .5em; } #g-uploadqueue-infobar { @@ -116,6 +117,14 @@ border: 1px solid #beb; } +#g-add-photos p { + margin: 0 +} + +#g-add-photos .g-breadcrumbs li { + padding-top: .5em; +} + /** ******************************************************************* * 2) Admin **********************************************************************/ @@ -129,23 +138,23 @@ } #g-languages-form table { - width: 40%; - margin: 0 3em 1em 0; + width: 40%; + margin: 0 3em 1em 0; } #g-languages-form input { - clear: both; + clear: both; } #g-translations ol { - margin: 0 0 1em 2em; + margin: 0 0 1em 2em; } #g-translations ol li { list-style-type: decimal; - line-height: 150%; + line-height: 150%; } #g-translations .g-button { - padding: .5em; - margin-bottom: 1em; + padding: .5em; + margin-bottom: 1em; } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index ab3e7eb5..0018fd9a 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -49,6 +49,7 @@ class gallery_theme_Core { $theme->script("l10n_client.js"); } + $theme->css("uploadify/uploadify.css"); return $buf; } diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index b9c33d32..014919c3 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -1,15 +1,62 @@ - - - + + + -
    ">
    html::purify($item->title))) ?> -
    -
    +
      @@ -21,230 +68,36 @@
    +

      - - parents() as $parent): ?> + parents() as $i => $parent): ?> > title) ?> -
    • title) ?>
    +
    -
    - - - for_html_attr() ?>" onclick="swfu.cancelQueue();"> + +
    + +
    -
    -
    -
    + + +
    +
    - - -
    - - +
    + diff --git a/themes/night_wind/css/screen.css b/themes/night_wind/css/screen.css index cd1824d1..92c3041f 100644 --- a/themes/night_wind/css/screen.css +++ b/themes/night_wind/css/screen.css @@ -750,76 +750,6 @@ li.g-error select { /*************** STUFF THAT NEEDS A HOME ****************/ -#g-add-photos #SWFUpload_0 { - position: relative; - top: -200px; - left: 134px; -} -#g-add-photos .g-breadcrumbs { - border: 0; - margin: 0; - padding-left:10px; -} -#g-add-photos-canvas { - border: 1px solid #CCCCCC; - margin: .5em 0 .5em 0; - width: 469px; - height: 325px; - overflow: auto; -} -#g-add-photos button { - margin-bottom: .5em; - float: right; -} -#g-uploadqueue-infobar { - clear: both; -} -#g-uploadqueue-infobar #g-cancelupload { - display: none; - cursor: pointer; -} - -#g-add-photos-canvas { - -} - -#g-add-photos-queue .progressbar { - height: 4px; -} - -#g-add-photos-queue .title { - font-size: 1.25em; -} - -#g-add-photos-queue .status { - font-size: .75em; -} - -#g-add-photos-queue .box { - margin-bottom: 8px; - padding: 4px; -} - -#g-add-photos-queue .pending { - background-color: #e8e8e8; - border: 1px solid #d7d7d7; -} - -#g-add-photos-queue .error { - background-color: #fcc; - 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-admin-g2-import-notes { padding-bottom: 20px; } -- cgit v1.2.3 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. --- lib/uploadify/default.css | 10 --- lib/uploadify/expressInstall.swf | Bin 727 -> 0 bytes modules/gallery/controllers/simple_uploader.php | 9 --- modules/gallery/css/gallery.css | 51 +++---------- modules/gallery/views/simple_uploader.html.php | 91 +++++++++++------------- 5 files changed, 53 insertions(+), 108 deletions(-) delete mode 100644 lib/uploadify/default.css delete mode 100644 lib/uploadify/expressInstall.swf (limited to 'modules/gallery/css') diff --git a/lib/uploadify/default.css b/lib/uploadify/default.css deleted file mode 100644 index 2173d9ec..00000000 --- a/lib/uploadify/default.css +++ /dev/null @@ -1,10 +0,0 @@ -body { - font: 12px/16px Arial, Helvetica, sans-serif; -} -#fileQueue { - width: 400px; - height: 300px; - overflow: auto; - border: 1px solid #E5E5E5; - margin-bottom: 10px; -} \ No newline at end of file diff --git a/lib/uploadify/expressInstall.swf b/lib/uploadify/expressInstall.swf deleted file mode 100644 index 0fbf8fca..00000000 Binary files a/lib/uploadify/expressInstall.swf and /dev/null differ 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))) ?> -
    - -
      -
    • - suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.", +
      + +
        +
      • + suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.", array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", - "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> -
      • -
      - + "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> +
    • +
    + -
    -

    - -

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

    + +

    +
      + parents() as $i => $parent): ?> + > title) ?> + +
    • title) ?>
    • +
    +
    -
    -
    +
    +
    +
    + + + +
    +
    - - - - -
    + + + + -- cgit v1.2.3 From 421a975c0e042a56c12a9894afa38f5785d1fe6d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 11 Nov 2009 18:47:10 -0800 Subject: Improve error handling. --- lib/gallery.common.css | 46 +++++++++++++++++++++++++ modules/gallery/controllers/simple_uploader.php | 2 +- modules/gallery/css/gallery.css | 42 ---------------------- modules/gallery/views/simple_uploader.html.php | 44 +++++++++++++++++++---- 4 files changed, 84 insertions(+), 50 deletions(-) (limited to 'modules/gallery/css') diff --git a/lib/gallery.common.css b/lib/gallery.common.css index c80dc90f..7fbb9db0 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -593,6 +593,52 @@ div#g-action-status { margin-left: 0; } +/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-add-photos-canvas { + border: 1px solid #ccc; + height: 200px; + margin: .5em 0; + overflow: auto; + width: 469px; +} + +#g-add-photos-status { + border: 1px solid #ccc; + height: 125px; + margin: .5em 0; + overflow: auto; + width: 469px; +} + +#g-add-photos button { + float: right; + margin-bottom: .5em; + margin-left: .5em; +} + +#g-add-photos-status li { + text-align: left; + padding-left: 2em; +} + +#g-add-photos-status li.g-success { + background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%; +} + +#g-add-photos-status li.g-error { + background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%; +/* color: #f00;*/ +} + +#g-add-photos p { + margin: 0 +} + +#g-add-photos .g-breadcrumbs li { + padding-top: .5em; +} + /** ******************************************************************* * 7) Right to left language styles **********************************************************************/ diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php index bc508319..d43d2f9d 100644 --- a/modules/gallery/controllers/simple_uploader.php +++ b/modules/gallery/controllers/simple_uploader.php @@ -79,7 +79,7 @@ class Simple_Uploader_Controller extends Controller { print "FILEID: $item->id"; } else { header("HTTP/1.1 400 Bad Request"); - print "ERROR: Invalid Upload"; + print "ERROR: " . t("Invalid Upload"); } } diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 066ab68a..113f0e09 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -54,48 +54,6 @@ margin: 0; } -/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-add-photos-canvas { - border: 1px solid #ccc; - height: 200px; - margin: .5em 0; - overflow: auto; - width: 469px; -} - -#g-add-photos-status { - border: 1px solid #ccc; - height: 125px; - margin: .5em 0; - overflow: auto; - width: 469px; -} - -#g-add-photos button { - float: right; - margin-bottom: .5em; - margin-left: .5em; -} - -#g-add-photos-status td { - text-align: left; - padding-left: 2em; -} - -#g-add-photos-queue .error { - background-color: #fcc; - border: 1px solid #ebb; -} - -#g-add-photos p { - margin: 0 -} - -#g-add-photos .g-breadcrumbs li { - padding-top: .5em; -} - /** ******************************************************************* * 2) Admin **********************************************************************/ diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index a84a3b00..8133f6c2 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -30,11 +30,43 @@ 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 "); + // @todo handle a response of "Error: xxxx" as an error + var re = /^error: (.*)$/i; + var msg = re.exec(response); + if (msg) { + $("#g-add-photos-status ul").append( + "
  • " + fileObj.name + " - " + msg[1] + "
  • "); + } else { + $("#g-add-photos-status ul").append( + "
  • " + fileObj.name + "
  • "); + } return true; }, + + onError: function(event, queueID, fileObj, errorObj) { + var msg = " - "; + if (errorObj.type == "HTTP") { + if (errorObj.info == "500") { + msg += "Error occurred processing the file"; + // Server error - check server logs + } else if (errorObj.info == "404") { + msg += "The upload script was not found."; + // Server script not found + } else { + // Server Error: status: errorObj.info + msg += "Error occurred communication with the server, status: " + errorObj.info; + } + } else if (errorObj.type == "File Size") { + var sizelimit = $("#g-uploadify").uploadifySettings(sizeLimit); + msg += fileObj.name+' '+errorObj.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB'; + } else { + msg += "Error occurred communication with the server, error " + errorObj.type + ": " + errorObj.info; + } + $("#g-add-photos-status ul").append( + "
  • " + fileObj.name + msg + "
  • "); + $("#g-uploadify" + queueID).remove(); + //return false; + }, onSelect: function(event) { if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) { $("#g-upload-cancel-all") @@ -79,10 +111,8 @@
    - - - -
    +
      +
    -- cgit v1.2.3 From 6ec81006e7ac8ebc61d15af22e3bbda782c46b68 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Nov 2009 16:02:39 -0800 Subject: Fix a bug where we were using tags in css to figure out whether we should gray out an element. --- modules/gallery/css/upgrader.css | 4 ++-- modules/gallery/views/upgrader.html.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css index 64e4ca07..97d00941 100644 --- a/modules/gallery/css/upgrader.css +++ b/modules/gallery/css/upgrader.css @@ -112,8 +112,8 @@ div#confirmation div { background: #eee; } -.gray_on_done { - opacity: ; +.muted { + opacity: 0.5; } pre { diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 80acc2a4..44234ec0 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -29,11 +29,11 @@ }); -

    +

    ">

    - + "> @@ -58,17 +58,17 @@
    -
    + -

    +

    ">

    -
      +
        "> active): ?>
      • -- cgit v1.2.3 From 9e5714aee817637ee954e8529da33c1be6f7ef19 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Nov 2009 16:14:30 -0800 Subject: Tweak upgrader html and css so that we set opacity properly for rows that are done, and disable the upgrade link when there're no actions to take. --- modules/gallery/controllers/upgrader.php | 2 +- modules/gallery/css/upgrader.css | 4 ++-- modules/gallery/views/upgrader.html.php | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index a86e8af9..48769bce 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -43,7 +43,7 @@ class Upgrader_Controller extends Controller { $view->can_upgrade = identity::active_user()->admin || $session->get("can_upgrade"); $view->upgrade_token = $upgrade_token; $view->available = module::available(); - $view->done = ($available_upgrades == 0); + $view->done = $available_upgrades == 0; print $view; } diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css index 97d00941..01689a97 100644 --- a/modules/gallery/css/upgrader.css +++ b/modules/gallery/css/upgrader.css @@ -37,7 +37,7 @@ td { } tr.current td { - color: #999; + opacity: 0.5; font-style: italic; } @@ -87,7 +87,7 @@ div.button a { text-decoration: none; } -div.button:hover { +div.button-active:hover { background: #ccc; } diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 44234ec0..90e1c5b6 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -58,11 +58,17 @@ -
        + +
        + +
        + + +

        "> -- cgit v1.2.3 From 3481c8b58f87d6e1e653e165de4b40b98c00369d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Nov 2009 16:21:45 -0800 Subject: Change "confirmation" to "dialog" in preparation for putting up a "we're working, stay tuned" message. --- modules/gallery/css/upgrader.css | 6 +++--- modules/gallery/views/upgrader.html.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css index 01689a97..e1038ad1 100644 --- a/modules/gallery/css/upgrader.css +++ b/modules/gallery/css/upgrader.css @@ -91,7 +91,7 @@ div.button-active:hover { background: #ccc; } -div#confirmation { +div#dialog { position: absolute; background: blue; z-index: 1000; @@ -99,13 +99,13 @@ div#confirmation { text-align: center; } -div#confirmation a.close { +div#dialog a.close { float: right; padding: 10px; text-decoration: none; } -div#confirmation div { +div#dialog div { margin: 2px; padding: 20px; border: 2px solid #999; diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 90e1c5b6..0c985c6b 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -12,8 +12,8 @@

        -
        - [x] +
        + [x]

        @@ -24,8 +24,8 @@

        -- cgit v1.2.3 From d7b13ee167ec06f54374c96c9a057cf9d2864aa2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Nov 2009 17:12:26 -0800 Subject: Try to keep users from leaving the upgrade page, or running the upgrade twice. 1) Disable the "Upgrade all" link once clicked 2) Put up a "upgrade in progress" link to show that there's something happening. Fixes ticket #837. --- modules/gallery/css/upgrader.css | 4 ++++ modules/gallery/views/upgrader.html.php | 39 +++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 7 deletions(-) (limited to 'modules/gallery/css') diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css index e1038ad1..73da0ff4 100644 --- a/modules/gallery/css/upgrader.css +++ b/modules/gallery/css/upgrader.css @@ -92,6 +92,8 @@ div.button-active:hover { } div#dialog { + width: 340px; + height: 200px; position: absolute; background: blue; z-index: 1000; @@ -106,6 +108,8 @@ div#dialog a.close { } div#dialog div { + width: 292px; + height: 152px; margin: 2px; padding: 20px; border: 2px solid #999; diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 0c985c6b..5cd1cd77 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -11,14 +11,22 @@ " />
        - -
        - [x] -
        + @@ -26,9 +34,26 @@ $(document).ready(function() { $("#dialog").css("left", Math.round(($(window).width() - $("#dialog").width()) / 2)); $("#dialog").css("top", Math.round(($(window).height() - $("#dialog").height()) / 2)); + $("#upgrade_link").click(function(event) { show_busy() }); + + + show_done(); + }); + + var show_busy = function() { + $("#dialog").css("visibility", "visible"); + $("#busy").show(); + $("#upgrade_link").parent().removeClass("button-active"); + $("#upgrade_link").replaceWith($("#upgrade_link").html()) + } + + var show_done = function() { + $("#dialog").css("visibility", "visible"); + $("#done").show(); + $("#dialog_close_link").show(); + } -

        ">

        @@ -64,7 +89,7 @@
        -- cgit v1.2.3