From d9e4ad79bbebb3f439df4403c668271c86c19935 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 08:14:34 -0700 Subject: 1) Move the digibug css in the default and admin_default themes 2) Remove most of the marketing cruft on the admin pages 3) Change the name of the admin settings to just Digibug 4) Remove the "switch on mouseover" approach --- themes/default/css/screen.css | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c7918fc0..671b259d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -4,15 +4,16 @@ * @requires YUI reset, font, grids CSS * * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable classes - * 3) Reusable content blocks - * 4) Page layout containers - * 5) Content blocks in specific layout containers - * 6) Navigation and menus - * 7) Browser hacks - * 8) jQuery and jQuery UI - * 9) Right-to-left language styles + * 1) Basic HTML elements + * 2) Reusable classes + * 3) Reusable content blocks + * 4) Page layout containers + * 5) Content blocks in specific layout containers + * 6) Navigation and menus + * 7) Browser hacks + * 8) jQuery and jQuery UI + * 9) Right-to-left language styles + * 10) Digibug Print */ /** ******************************************************************* @@ -1049,4 +1050,8 @@ form .gError, .rtl .gButtonSet li, .rtl .ui-icon-left .ui-icon { float: right; -} \ No newline at end of file +} + +/** ******************************************************************* + * 10) Digibug Print + **********************************************************************/ -- cgit v1.2.3 From 627b5e144caefb7ff48224a4bdc8faae2debdbd7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 08:53:04 -0700 Subject: This change to the default/css/screen.css file was overlooked --- themes/default/css/screen.css | 3 +++ 1 file changed, 3 insertions(+) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 671b259d..7075494d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -1055,3 +1055,6 @@ form .gError, /** ******************************************************************* * 10) Digibug Print **********************************************************************/ +.gDigibugPrintButton { + float: left; +} -- cgit v1.2.3 From 6c828a0dd61984da84fa7957f4ea40098dd67ec5 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Jun 2009 16:30:16 -0700 Subject: We no longer need the digibug section now that we've got a menu for thumbnail actions. --- themes/default/css/screen.css | 7 ------- 1 file changed, 7 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 7075494d..d3c4de6f 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -1051,10 +1051,3 @@ form .gError, .rtl .ui-icon-left .ui-icon { float: right; } - -/** ******************************************************************* - * 10) Digibug Print - **********************************************************************/ -.gDigibugPrintButton { - float: left; -} -- cgit v1.2.3 From 2b804ebdcea2127ca481ae3fb25a33a3bc5a78c3 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 28 Jun 2009 17:53:20 -0600 Subject: Convert info module's block to use a list instead of a table. Addresses request in ticket #441. --- modules/info/views/info_block.html.php | 75 +++++++++++++++------------------- themes/default/css/screen.css | 4 ++ 2 files changed, 37 insertions(+), 42 deletions(-) (limited to 'themes/default/css') diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index 9f9ec5df..3a96937c 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -1,44 +1,35 @@ - - - - - - - description): ?> - - - - + - - - - - id != 1): ?> - parent(); ?> - - - - - - captured): ?> - - - - - - owner): ?> - - - - - - - + + + \ No newline at end of file diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index d3c4de6f..e37de70e 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -57,6 +57,10 @@ h2 { font-size: 1.2em; } +#gSidebar .gBlock li { + margin-bottom: .6em; +} + h3 { font-size: 1.2em; } -- cgit v1.2.3 From 0b34ec4e8b1f97db0dc6807bdb3a5ece8e1b83e4 Mon Sep 17 00:00:00 2001 From: jhilden Date: Tue, 30 Jun 2009 22:22:29 -0400 Subject: UI enhancement: made the 'back to the Gallery' links a little bit easier to discover --- themes/admin_default/css/screen.css | 20 ++++++++++++++++++-- themes/admin_default/views/admin.html.php | 4 ++-- themes/default/css/fix-ie.css | 2 +- themes/default/css/screen.css | 4 ++-- themes/default/views/header.html.php | 4 ++-- 5 files changed, 25 insertions(+), 9 deletions(-) (limited to 'themes/default/css') diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index f4173d4b..629d0451 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -98,12 +98,28 @@ * 4) Content blocks in specific layout containers *********************************************************************/ -#gHeader #gLogo { +#gHeader #gLogo img { float: left; margin: -22px 10px 0 0; } -.rtl #gHeader #gLogo { +#gHeader #gLogo { + position: relative; + display: block; + text-decoration: none; +} +#gHeader #gLogo span { + display: none; + position: absolute; + top: -20px; + left: 2px; + color: #FF6600; +} +#gHeader #gLogo:hover span { + display: inline; +} + +.rtl #gHeader #gLogo img { float: left; } diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 36deea9e..1be454c3 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -44,10 +44,10 @@
admin_header_top() ?> - ">" id="gLogo" alt="" /> + diff --git a/themes/default/css/fix-ie.css b/themes/default/css/fix-ie.css index 0b37acd2..3d9604e6 100644 --- a/themes/default/css/fix-ie.css +++ b/themes/default/css/fix-ie.css @@ -10,7 +10,7 @@ zoom: 1; } -#gHeader #gLogo { +#gHeader #gLogo img { margin-top: 5px; margin-bottom: 0; } diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index e37de70e..48ded542 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -422,7 +422,7 @@ form .gError, /* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gHeader #gLogo { +#gHeader #gLogo img { float: left; margin: -4px 10px 0 0; } @@ -1046,7 +1046,7 @@ form .gError, .rtl input[type="submit"], .rtl input[type="reset"], .rtl .gShortForm li, -.rtl #gHeader #gLogo, +.rtl #gHeader #gLogo img, .rtl #gContent #gAlbumGrid .gItem, .rtl #gSiteMenu, .rtl .gBreadcrumbs li, diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index b38cffed..51f55b41 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -3,8 +3,8 @@ -"> - " src="theme_url("images/logo.png") ?>" /> + -- cgit v1.2.3 From 0add4ced22662918b6e5c3f0d0447e6e8aad4962 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Wed, 1 Jul 2009 00:35:33 -0600 Subject: Add a bit more contrast to superfish sub-menus. --- themes/default/css/screen.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 48ded542..7a41e970 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -13,7 +13,6 @@ * 7) Browser hacks * 8) jQuery and jQuery UI * 9) Right-to-left language styles - * 10) Digibug Print */ /** ******************************************************************* @@ -755,6 +754,16 @@ form .gError, * 7) jQuery and jQuery UI *********************************************************************/ +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu li li, .sf-menu li li ul li { + background-color: #bdd2ff; +} + +.sf-menu li:hover { + background-color: #dfe9ff; +} + /* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ .gLoadingLarge { -- cgit v1.2.3 From 50462edd9c72156d841991245a4ef34624f9a3c7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 4 Jul 2009 17:14:21 -0700 Subject: Change the BBCode Transformation to use the where possible --- modules/g2_import/helpers/g2_import.php | 9 +++++---- themes/default/css/screen.css | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'themes/default/css') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 91fcbe8e..cba1d429 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -756,15 +756,16 @@ class g2_import_Core { } static $bbcode_mappings = array( - "#\\[b\\](.*?)\\[/b\\]#" => "$1", - "#\\[i\\](.*?)\\[/i\\]#" => "$1", - "#\\[u\\](.*?)\\[/u\\]#" => "$1", - "#\\[s\\](.*?)\\[/s\\]#" => "$1", + "#\\[b\\](.*?)\\[/b\\]#" => "$1", + "#\\[i\\](.*?)\\[/i\\]#" => "$1", + "#\\[u\\](.*?)\\[/u\\]#" => "$1", + "#\\[s\\](.*?)\\[/s\\]#" => "$1", "#\\[url\\](.*?)\[/url\\]#" => "$1", "#\\[url=(.*?)\\](.*?)\[/url\\]#" => "$2", "#\\[img\\](.*?)\\[/img\\]#" => "", "#\\[quote\\](.*?)\\[/quote\\]#" => "

$1

", "#\\[code\\](.*?)\\[/code\\]#" => "
$1
", + "#\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]#" => "$2", "#\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]#" => "$2/span>", "#\\[ul\\](.*?)\\/ul\\]#" => "
    $1
", "#\\[li\\](.*?)\\[/li\\]#" => "
  • $1
  • ", diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 7a41e970..750639f1 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -13,6 +13,7 @@ * 7) Browser hacks * 8) jQuery and jQuery UI * 9) Right-to-left language styles + * 10) BBCode Styles */ /** ******************************************************************* @@ -1064,3 +1065,21 @@ form .gError, .rtl .ui-icon-left .ui-icon { float: right; } + +/* BBCode ~~~~~~~~~~~~~~~~~~~~ */ +.gBBCodeBold { + font-weight: bold; +} + +.gBBCodeItalic { + font-style: italic; +} + +.gBBCodeUnderline { + text-decoration: underline; +} + +.gBBCodeStrike { + font-decoration: line-through; +} + -- cgit v1.2.3 From 85de2088798e2b5eac7cb26bf48e17b8034f3fb7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 4 Jul 2009 20:30:13 -0700 Subject: Lets try the BBCode conversion again... go with basic tags even if some are deprecated. --- modules/g2_import/helpers/g2_import.php | 12 ++++++------ themes/default/css/screen.css | 18 ------------------ 2 files changed, 6 insertions(+), 24 deletions(-) (limited to 'themes/default/css') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index cba1d429..2e40eb7f 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -756,17 +756,17 @@ class g2_import_Core { } static $bbcode_mappings = array( - "#\\[b\\](.*?)\\[/b\\]#" => "$1", - "#\\[i\\](.*?)\\[/i\\]#" => "$1", - "#\\[u\\](.*?)\\[/u\\]#" => "$1", - "#\\[s\\](.*?)\\[/s\\]#" => "$1", + "#\\[b\\](.*?)\\[/b\\]#" => "$1", + "#\\[i\\](.*?)\\[/i\\]#" => "$1", + "#\\[u\\](.*?)\\[/u\\]#" => "$1", + "#\\[s\\](.*?)\\[/s\\]#" => "$1", "#\\[url\\](.*?)\[/url\\]#" => "$1", "#\\[url=(.*?)\\](.*?)\[/url\\]#" => "$2", "#\\[img\\](.*?)\\[/img\\]#" => "", "#\\[quote\\](.*?)\\[/quote\\]#" => "

    $1

    ", "#\\[code\\](.*?)\\[/code\\]#" => "
    $1
    ", - "#\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]#" => "$2", - "#\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]#" => "$2/span>", + "#\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]#" => "$2", + "#\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]#" => "$2/font>", "#\\[ul\\](.*?)\\/ul\\]#" => "
      $1
    ", "#\\[li\\](.*?)\\[/li\\]#" => "
  • $1
  • ", ); diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 750639f1..41e51623 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -13,7 +13,6 @@ * 7) Browser hacks * 8) jQuery and jQuery UI * 9) Right-to-left language styles - * 10) BBCode Styles */ /** ******************************************************************* @@ -1066,20 +1065,3 @@ form .gError, float: right; } -/* BBCode ~~~~~~~~~~~~~~~~~~~~ */ -.gBBCodeBold { - font-weight: bold; -} - -.gBBCodeItalic { - font-style: italic; -} - -.gBBCodeUnderline { - text-decoration: underline; -} - -.gBBCodeStrike { - font-decoration: line-through; -} - -- cgit v1.2.3 From e0e450d90fe67ac199d82d2b8e902cff5c8b6c7d Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sat, 11 Jul 2009 00:40:57 -0600 Subject: Position gItem and gPhoto relative, then position quick and thumb menus as absolute within them. Moved css from quick.js to quick.css. --- modules/gallery/css/quick.css | 12 ++++++++++++ modules/gallery/helpers/gallery_menu.php | 3 ++- modules/gallery/js/quick.js | 11 +---------- themes/default/css/screen.css | 18 +++++++++++++++++- themes/default/js/ui.init.js | 8 ++++++++ 5 files changed, 40 insertions(+), 12 deletions(-) (limited to 'themes/default/css') diff --git a/modules/gallery/css/quick.css b/modules/gallery/css/quick.css index 02f9953e..0e45eac2 100644 --- a/modules/gallery/css/quick.css +++ b/modules/gallery/css/quick.css @@ -1,3 +1,12 @@ +#gQuickPane { + position: absolute; + top: 0; + left: 0; + text-align: center; + width: 100%; + height: auto; +} + .gItem:hover { background-color: #cfdeff; } @@ -12,6 +21,9 @@ background: #000; border-bottom: 1px solid #ccc; opacity: 0.9; + position: absolute; + top: 0; + left: 0; } #gQuickPane a { diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index bffb7696..b6f763b8 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -97,7 +97,8 @@ class gallery_menu_Core { static function thumb($menu, $theme, $item) { $menu->append(Menu::factory("submenu") ->id("options_menu") - ->label(t("Options"))); + ->label(t("Options")) + ->css_class("gThumbMenu")); } static function photo($menu, $theme) { diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 4ebdac47..32e34ef3 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -13,16 +13,7 @@ var show_quick = function() { var quick = $(this).find(".gQuick"); $("#gQuickPane").remove(); cont.append("
    "); - var img = cont.find(".gThumbnail,.gResize"); - var pos = cont.position(); - $("#gQuickPane").css({ - "position": "absolute", - "top": pos.top, - "left": pos.left, - "text-align": "center", - "width": cont.innerWidth() + 1, - "height": "auto" - }).hide(); + $("#gQuickPane").hide(); cont.hover(function() {}, hide_quick); $.get( quick.attr("href"), diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 41e51623..d08ada17 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -460,6 +460,7 @@ form .gError, height: 240px; overflow: hidden; padding: 14px 8px; + position: relative; text-align: center; width: 213px; } @@ -487,7 +488,7 @@ form .gError, } #gContent #gPhoto { - + position: relative; } #gContent #gItem .gFullSizeLink img { @@ -581,6 +582,21 @@ form .gError, margin-bottom: 0; } +/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gItem .gMenu { + bottom: 0; + margin-bottom: -2px; + position: absolute; + right: 0; +} + +.gItem .gMenu li { + font-weight: normal !important; +} + +/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + #gViewMenu { margin-bottom: 1em; } diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 9d9d3079..29e04d5e 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -36,6 +36,14 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } + // gThumbMenu + if ($(".gItem .gMenu").length) { + $(".gItem .gMenu").removeClass("sf-menu"); + $(".gItem .gMenu span").removeClass("sf-sub-indicator"); + $(".gItem .gMenu span").addClass("ui-icon ui-icon-triangle-1-n"); + $(".gItem .gMenu li:first-child").addClass("ui-icon-right ui-corner-top ui-state-default"); + } + // Initialize view menu if ($("#gViewMenu").length) { $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); -- cgit v1.2.3 From 954ab5a5051edb67eca8ae74283a80a226e39672 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 05:03:36 -0700 Subject: Further simplify server_add (and bump it to version 3). Now we don't have checkboxes, but instead we restrict you to selecting directories and albums from only one level in the hierarchy. This makes it easier for us to make sure that we properly create the hierarchy that you want and avoid confusion about what's going to wind up where. Modify Server_Add_File_Model to have a parent_id and item_id and then modify them as we go so that we can build up a tree structure there *before* we create any items. This makes it much easier to figure out where a new item is going to go and get rid of a bunch of probably buggy code in the main task. --- modules/server_add/controllers/server_add.php | 199 +++++++++------------ .../server_add/helpers/server_add_installer.php | 8 +- modules/server_add/js/server_add.js | 67 ++----- modules/server_add/module.info | 2 +- modules/server_add/views/server_add_tree.html.php | 56 ++++-- themes/default/css/screen.css | 20 +-- 6 files changed, 158 insertions(+), 194 deletions(-) (limited to 'themes/default/css') diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 08e01858..6056d7cd 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -29,51 +29,58 @@ class Server_Add_Controller extends Admin_Controller { $view->item = $item; $view->tree = new View("server_add_tree.html"); $view->tree->files = $files; + $view->tree->parents = array(); print $view; } public function children() { $path = $this->input->get("path"); - if (!server_add::is_valid_path($path)) { - throw new Exception("@todo BAD_PATH"); - } $tree = new View("server_add_tree.html"); $tree->files = array(); - $tree->tree_id = substr(md5($path), 10); + $tree->parents = array(); - foreach (glob("$path/*") as $file) { - if (!is_readable($file)) { - continue; + // Make a tree with the parents back up to the authorized path, and all the children under the + // current path. + if (server_add::is_valid_path($path)) { + $tree->parents[] = $path; + while (server_add::is_valid_path(dirname($tree->parents[0]))) { + array_unshift($tree->parents, dirname($tree->parents[0])); } - if (!is_dir($file)) { - $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); - if (!in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4"))) { + foreach (glob("$path/*") as $file) { + if (!is_readable($file)) { continue; } - } + if (!is_dir($file)) { + $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); + if (!in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4"))) { + continue; + } + } - $tree->files[] = $file; + $tree->files[] = $file; + } + } else { + // Missing or invalid path; print out the list of authorized path + $paths = unserialize(module::get_var("server_add", "authorized_paths")); + foreach (array_keys($paths) as $path) { + $tree->files[] = $path; + } } print $tree; } + /** + * Begin the task of adding photos. + */ public function start() { access::verify_csrf(); - $item = ORM::factory("item", Input::instance()->get("item_id")); - // We're an admin so this isn't necessary, but we'll eventually open this up to non-admins and - // this also verifies that the item was loaded properly. - access::required("edit", $item); - // Gather up all the paths and associate them by directory, so that we can locate any empty - // directories for the next round. foreach (Input::instance()->post("paths") as $path) { - if (is_dir($path)) { - $selections[$path] = array(); - } else if (is_file($path)) { - $selections[dirname($path)][] = $path; + if (server_add::is_valid_path($path)) { + $paths[] = array($path, null); } } @@ -81,8 +88,7 @@ class Server_Add_Controller extends Admin_Controller { ->callback("Server_Add_Controller::add") ->description(t("Add photos or movies from the local server")) ->name(t("Add from server")); - $task = task::create( - $task_def, array("item_id" => $item->id, "selections" => $selections)); + $task = task::create($task_def, array("item_id" => $item->id, "queue" => $paths)); print json_encode( array("result" => "started", @@ -90,6 +96,9 @@ class Server_Add_Controller extends Admin_Controller { "url" => url::site("server_add/run/$task->id?csrf=" . access::csrf_token()))); } + /** + * Run the task of adding photos + */ function run($task_id) { access::verify_csrf(); @@ -110,49 +119,48 @@ class Server_Add_Controller extends Admin_Controller { * them one at a time. */ static function add($task) { - $selections = $task->get("selections"); $mode = $task->get("mode", "init"); $start = microtime(true); - $item_id = $task->get("item_id"); switch ($mode) { case "init": $task->set("mode", "build-file-list"); - $task->set("queue", array_keys($selections)); $task->percent_complete = 0; $task->status = t("Starting up"); batch::start(); break; - case "build-file-list": /* 0% to 10% */ + case "build-file-list": // 0% to 10% // We can't fit an arbitrary number of paths in a task, so store them in a separate table. // Don't use an iterator here because we can't get enough control over it when we're dealing - // with a deep hierarchy and we don't want to go over our time quota. + // with a deep hierarchy and we don't want to go over our time quota. The queue is in the + // form [path, parent_id] where the parent_id refers to another Server_Add_File_Model. We + // have this extra level of abstraction because we don't know its Item_Model id yet. $queue = $task->get("queue"); while ($queue && microtime(true) - $start < 0.5) { - $file = array_shift($queue); - if (is_dir($file)) { - $entry = ORM::factory("server_add_file"); - $entry->task_id = $task->id; - $entry->file = $file; - $entry->save(); - - $children = empty($selections[$file]) ? glob("$file/*") : $selections[$file]; - } else { - $children = array($file); - } - - foreach ($children as $child) { - $entry = ORM::factory("server_add_file"); - $entry->task_id = $task->id; - $entry->file = $child; - $entry->save(); + list($file, $parent_entry_id) = array_shift($queue); + $entry = ORM::factory("server_add_file"); + $entry->task_id = $task->id; + $entry->file = $file; + $entry->parent_id = $parent_entry_id; + $entry->save(); + foreach (glob("$file/*") as $child) { if (is_dir($child)) { - $queue[] = $child; + $queue[] = array($child, $entry->id); + } else { + $ext = strtolower(pathinfo($child, PATHINFO_EXTENSION)); + if (in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4"))) { + $child_entry = ORM::factory("server_add_file"); + $child_entry->task_id = $task->id; + $child_entry->file = $child; + $child_entry->parent_id = $entry->id; + $child_entry->save(); + } } } } + // We have no idea how long this can take because we have no idea how deep the tree // hierarchy rabbit hole goes. Leave ourselves room here for 100 iterations and don't go // over 10% in percent_complete. @@ -168,79 +176,67 @@ class Server_Add_Controller extends Admin_Controller { $task->set( "total_files", database::instance()->count_records( "server_add_files", array("task_id" => $task->id))); - $task->set("albums", array()); - $task->set("completed", 0); $task->percent_complete = 10; } break; - case "add-files": /* 10% to 100% */ - $completed_files = $task->get("completed_files"); + case "add-files": // 10% to 100% + $completed_files = $task->get("completed_files", 0); $total_files = $task->get("total_files"); - $albums = $task->get("albums"); // Ordering by id ensures that we add them in the order that we created the entries, which - // will create albums first. + // will create albums first. Ignore entries which already have an Item_Model attached, + // they're done. $entries = ORM::factory("server_add_file") ->where("task_id", $task->id) + ->where("item_id", null) ->orderby("id", "ASC") ->limit(10) ->find_all(); if ($entries->count() == 0) { + // Out of entries, we're done. $task->set("mode", "done"); } - $item = model_cache::get("item", $item_id); + $owner_id = user::active()->id; foreach ($entries as $entry) { if (microtime(true) - $start > 0.5) { break; } - $relative_path = self::_relative_path($entry->file); - $name = basename($relative_path); + // Look up the parent item for this entry. By now it should exist, but if none was + // specified, then this belongs as a child of the current item. + $parent_entry = ORM::factory("server_add_file", $entry->parent_id); + if (!$parent_entry->loaded) { + $parent = ORM::factory("item", $task->get("item_id")); + } else { + $parent = ORM::factory("item", $parent_entry->item_id); + } + + $name = basename($entry->file); $title = item::convert_filename_to_title($name); if (is_dir($entry->file)) { - $parent_path = dirname($relative_path); - if (isset($albums[$parent_path]) && $parent_id = $albums[$parent_path]) { - $parent = ORM::factory("item", $parent_id); - } else { - $parent = $item; - } - $album = album::create($parent, $name, $title, null, user::active()->id); - $albums[$relative_path] = $album->id; - $task->set("albums", $albums); + $album = album::create($parent, $name, $title, null, $owner_id); + $entry->item_id = $album->id; } else { - // Find the nearest selected parent. We check to see if any of the candidate parents - // were selected in the UI and if so, we use that. Otherwise, we fall back to making - // the parent the current item. - $parent_path = $relative_path; - $parent = null; - do { - if (strpos($parent_path, "/") !== false) { - if (array_key_exists($parent_path, $albums)) { - $parent = ORM::factory("item", $albums[$parent_path]); - } else { - $parent_path = dirname($parent_path); - } - } else { - $parent = $item; - } - } while (!$parent); - $extension = strtolower(pathinfo($name, PATHINFO_EXTENSION)); if (in_array($extension, array("gif", "png", "jpg", "jpeg"))) { - photo::create($parent, $entry->file, $name, $title, null, user::active()->id); + $photo = photo::create($parent, $entry->file, $name, $title, null, $owner_id); + $entry->item_id = $photo->id; } else if (in_array($extension, array("flv", "mp4"))) { - movie::create($parent, $entry->file, $name, $title, null, user::active()->id); + $movie = movie::create($parent, $entry->file, $name, $title, null, $owner_id); + $entry->item_id = $movie->id; } else { - $task->log("Skipping unknown file type: $relative_path"); - // Unsupported type - // @todo: $task->log this + // This should never happen, because we don't add stuff to the list that we can't + // process. But just in, case.. set this to a non-null value so that we skip this + // entry. + $entry->item_id = 0; + $task->log("Skipping unknown file type: $entry->file"); } } $completed_files++; - $entry->delete(); + $entry->save(); } $task->set("completed_files", $completed_files); $task->status = t("Adding photos and albums (%completed of %total)", @@ -254,33 +250,10 @@ class Server_Add_Controller extends Admin_Controller { $task->done = true; $task->state = "success"; $task->percent_complete = 100; + ORM::factory("server_add_file")->where("task_id", $task->id)->delete_all(); message::info(t2("Successfully added one photo", - "Successfully added %count photos", + "Successfully added %count photos and albums", $task->get("completed_files"))); } } - - /** - * Given a path that's somewhere in our authorized_paths list, return just the part that's - * relative to the nearest authorized path. - */ - static function _relative_path($path) { - static $authorized_paths; - // @todo this doesn't deal well with overlapping authorized paths, it'll just use the first one - // that matches. If we sort $authorized_paths by length in descending order, that should take - // care of the problem. - if (!$authorized_paths) { - $authorized_paths = - array_keys(unserialize(module::get_var("server_add", "authorized_paths"))); - } - - foreach ($authorized_paths as $candidate) { - $candidate = dirname($candidate); - if (strpos($path, $candidate) === 0) { - return substr($path, strlen($candidate) + 1); - } - } - - throw new Exception("@todo BAD_PATH"); - } } diff --git a/modules/server_add/helpers/server_add_installer.php b/modules/server_add/helpers/server_add_installer.php index 6956a72c..4cc34207 100644 --- a/modules/server_add/helpers/server_add_installer.php +++ b/modules/server_add/helpers/server_add_installer.php @@ -22,8 +22,10 @@ class server_add_installer { $db = Database::instance(); $db->query("CREATE TABLE {server_add_files} ( `id` int(9) NOT NULL auto_increment, - `task_id` int(9) NOT NULL, `file` varchar(255) NOT NULL, + `item_id` int(9), + `parent_id` int(9), + `task_id` int(9) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); module::set_version("server_add", 2); @@ -40,6 +42,10 @@ class server_add_installer { PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); module::set_version("server_add", $version = 2); + } else if ($version == 2) { + $db->query("ALTER TABLE {server_add_files} ADD COLUMN `item_id` int(9)"); + $db->query("ALTER TABLE {server_add_files} ADD COLUMN `parent_id` int(9)"); + module::set_version("server_add", $version = 3); } } diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index 1a78d733..989555cc 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -1,51 +1,9 @@ /** - * We've clicked the + icon next to a directory. Load up children of this - * directory from the server and display them. + * Manage file selection state. */ -function open_close_branch(path, id) { - var parent = $("#file_" + id); - var children = $("#tree_" + id); - var icon = parent.find(".ui-icon:first"); - - if (!children.html()) { - parent.addClass("gLoadingSmall"); - $.ajax({ - url: GET_CHILDREN_URL.replace("__PATH__", path), - success: function(data, textStatus) { - children.html(data); - parent.removeClass("gLoadingSmall"); - - // Propagate checkbox value - children.find("input[type=checkbox]").attr( - "checked", parent.find("input[type=checkbox]:first").attr("checked")); - } - }); - } - - children.slideToggle("fast", function() { - if (children.is(":hidden")) { - icon.addClass("ui-icon-plus"); - icon.removeClass("ui-icon-minus"); - } else { - icon.addClass("ui-icon-minus"); - icon.removeClass("ui-icon-plus"); - parent.removeClass("gCollapsed"); - } - }); -} - -/** - * We've clicked a checkbox. Propagate the value downwards as necessary. - */ -function click_node(checkbox) { - var parent = $(checkbox).parents("li").get(0); - var checked = $(checkbox).attr("checked"); - $(parent).find("input[type=checkbox]").attr("checked", checked); - - // @todo if we uncheck all the children for a parent, we should uncheck the - // parent itself, otherwise in the code we'll add the entire parent since if - // we find an album as a leaf, we assume that it's never been expanded in the UI. - if ($("#gServerAddTree").find("input[type=checkbox]").is(":checked")) { +function select_file(li) { + $(li).toggleClass("selected"); + if ($("#gServerAdd span.selected").length) { $("#gServerAddAddButton").enable(true); $("#gServerAddAddButton").removeClass("ui-state-disabled"); } else { @@ -54,11 +12,24 @@ function click_node(checkbox) { } } +/** + * Load a new directory + */ +function open_dir(path) { + $.ajax({ + url: GET_CHILDREN_URL.replace("__PATH__", path), + success: function(data, textStatus) { + $("#gServerAddTree").html(data); + } + }); +} + function start_add() { var paths = []; - $.each($("#gServerAdd :checkbox[checked]"), function () { - paths.push(this.value); + $.each($("#gServerAdd span.selected"), function () { + paths.push($(this).attr("file")); }); + $.ajax({ url: START_URL, type: "POST", diff --git a/modules/server_add/module.info b/modules/server_add/module.info index 1c99d280..295d3beb 100644 --- a/modules/server_add/module.info +++ b/modules/server_add/module.info @@ -1,3 +1,3 @@ name = Server Add description = Allows authorized users to load images directly from your web server -version = 2 +version = 3 diff --git a/modules/server_add/views/server_add_tree.html.php b/modules/server_add/views/server_add_tree.html.php index 74bc40e0..254a9da0 100644 --- a/modules/server_add/views/server_add_tree.html.php +++ b/modules/server_add/views/server_add_tree.html.php @@ -1,19 +1,41 @@ - - -
  • "> - - - - - - - +
  • + + + + +
      + + +
    • + + + + +
        + + + +
      • + "> + + ondblclick="open_dir($(this).attr('file'))" + + file="" + > + + +
      • + + +
      • + + + +
      +
    • + + +
  • - - -
  • - diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 41e51623..842a1491 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -879,24 +879,20 @@ form .gError, /* Server Add */ -.gCheckboxTree input { - display: inline; +#gServerAddTree { + cursor: pointer; } -.gCheckboxTree li { +#gServerAddTree li { padding: 0; float: none; } -.gCheckboxTree .ui-icon { - cursor: pointer; +#gServerAddTree span.selected { + background: #ddd; } -.gFile { - padding-left: 2.5em; -} - -#gServerAdd #gServerAddTree { +#gServerAddTree { border: 1px solid #ccc; height: 25em; overflow: auto; @@ -909,10 +905,6 @@ form .gError, padding-left: 1.2em; } -#gServerAdd ul li .gFile { - padding-left: 2.5em; -} - #gServerAdd .gBreadcrumbs { font-size: 1em; padding: 0; -- cgit v1.2.3 From 8bfcf09b4c9628f13fdee2b958b3d11c9abce474 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sat, 11 Jul 2009 23:14:26 -0600 Subject: Styled thumb menu, still needs script to set up interraction. --- themes/default/css/screen.css | 14 +++++++++----- themes/default/js/ui.init.js | 20 +++++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index d08ada17..66989ea4 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -584,17 +584,21 @@ form .gError, /* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.gItem .gMenu { +#gContent .gThumbMenu { bottom: 0; - margin-bottom: -2px; + left: 0; position: absolute; - right: 0; + width: 100%; } -.gItem .gMenu li { - font-weight: normal !important; +#gContent .gThumbMenu li { + border-left: none; + border-right: none; } +#gContent .gThumbMenu a:hover { + text-decoration: none; +} /* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #gViewMenu { diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 29e04d5e..b14127f6 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -13,6 +13,10 @@ var shortForms = new Array( $(document).ready(function() { + // Remove .gMenu from thumb menu's before initializing Superfish + $("#gContent .gItem .gMenu").removeClass("gMenu"); + $("#gContent .gQuick + ul").addClass("gThumbMenu") + // Initialize Superfish menus $("ul.gMenu").addClass("sf-menu"); $('ul.sf-menu').superfish({ @@ -37,11 +41,17 @@ $(document).ready(function() { } // gThumbMenu - if ($(".gItem .gMenu").length) { - $(".gItem .gMenu").removeClass("sf-menu"); - $(".gItem .gMenu span").removeClass("sf-sub-indicator"); - $(".gItem .gMenu span").addClass("ui-icon ui-icon-triangle-1-n"); - $(".gItem .gMenu li:first-child").addClass("ui-icon-right ui-corner-top ui-state-default"); + if ($("#gContent .gThumbMenu").length) { + $("#gContent .gThumbMenu li").addClass("ui-state-default"); + // ui-icon-triangle-1-n + $("#gContent .gThumbMenu li a") + .not('[class]') + .addClass("gButtonLink ui-icon") + .css({ + "height":"10px", + "margin":"0", + "padding":"0" + }); } // Initialize view menu -- cgit v1.2.3 From cbd80b5ff948e23a1fa8b0994291953d38f6a7bd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 07:37:49 -0700 Subject: Get rid of the form from server_add, we're not using it. Turn the cancel link into a themed close button which triggers a page reload. Add some padding to the left of the tree. --- .../server_add/views/server_add_tree_dialog.html.php | 17 +++++++++-------- themes/default/css/screen.css | 6 ++++++ 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'themes/default/css') diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php index 8e9c1c01..21952849 100644 --- a/modules/server_add/views/server_add_tree_dialog.html.php +++ b/modules/server_add/views/server_add_tree_dialog.html.php @@ -19,8 +19,6 @@ - id"), array("method" => "post")) ?> -
    @@ -31,10 +29,16 @@
    - "> + + + - + - diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c4670a4d..0c65cd96 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -899,8 +899,14 @@ form .gError, /* Server Add */ +#gServerAdd button { + float: left; + margin-bottom: .5em; +} + #gServerAddTree { cursor: pointer; + padding-left: 4px; } #gServerAddTree li { -- cgit v1.2.3 From 58d0a5013d4cda1be0cf528b8ff08d44b123d75f Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 11:43:41 -0600 Subject: First attempt at animating gThumbMenu. Doesn't work. --- themes/default/css/screen.css | 2 +- themes/default/js/ui.init.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 0c65cd96..1853a11d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -459,7 +459,7 @@ form .gError, font-size: .7em; height: 240px; overflow: hidden; - padding: 14px 8px; + padding: 15px 8px 30px 8px; position: relative; text-align: center; width: 213px; diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index b14127f6..d5755aed 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -50,8 +50,23 @@ $(document).ready(function() { .css({ "height":"10px", "margin":"0", - "padding":"0" + "padding":"0", + "width":"16px" }); + var menuHt = $("#gContent .gThumbMenu").height(); + var bottomPos = "-" + (menuHt - 15) + "px"; + $("#gContent .gThumbMenu").css("bottom",bottomPos); + console.log("Initilizing: Placing at " + bottomPos); + $("#gContent .gThumbMenu li").hover( + function(){ + $(this).css("bottom","0"); + console.log("Placing at 0px"); + }, + function(){ + $(this).css("bottom",bottomPos); + console.log("Placing at " + bottomPos); + } + ); } // Initialize view menu -- cgit v1.2.3 From 413174e89edb36b311237aea4ab8386d75d16760 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 16:07:16 -0600 Subject: Second attempt at showing and hiding the thumb menu. Renamed gThumbMenu to gPhotoMenu for use on both album and photo pages, eventually. --- themes/default/css/screen.css | 9 +++++---- themes/default/js/ui.init.js | 28 +++++++++++----------------- 2 files changed, 16 insertions(+), 21 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 1853a11d..93b68e68 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -582,23 +582,24 @@ form .gError, margin-bottom: 0; } -/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Photo Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gContent .gThumbMenu { +#gContent .gPhotoMenu { bottom: 0; left: 0; position: absolute; width: 100%; } -#gContent .gThumbMenu li { +#gContent .gPhotoMenu li { border-left: none; border-right: none; } -#gContent .gThumbMenu a:hover { +#gContent .gPhotoMenu a:hover { text-decoration: none; } + /* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #gViewMenu { diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index d5755aed..37261727 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -14,8 +14,9 @@ var shortForms = new Array( $(document).ready(function() { // Remove .gMenu from thumb menu's before initializing Superfish + // @todo gallery_menu should only apply gMenu to top-level menus, submenus should be gSubMenu-N $("#gContent .gItem .gMenu").removeClass("gMenu"); - $("#gContent .gQuick + ul").addClass("gThumbMenu") + $("#gContent .gQuick + ul").addClass("gPhotoMenu"); // Initialize Superfish menus $("ul.gMenu").addClass("sf-menu"); @@ -40,31 +41,24 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } - // gThumbMenu - if ($("#gContent .gThumbMenu").length) { - $("#gContent .gThumbMenu li").addClass("ui-state-default"); - // ui-icon-triangle-1-n - $("#gContent .gThumbMenu li a") + // Initialize photo menus + if ($("#gContent .gPhotoMenu").length) { + $("#gContent .gPhotoMenu li").addClass("ui-state-default"); + $("#gContent .gPhotoMenu li a") .not('[class]') .addClass("gButtonLink ui-icon") .css({ "height":"10px", "margin":"0", - "padding":"0", - "width":"16px" + "padding":"0" }); - var menuHt = $("#gContent .gThumbMenu").height(); - var bottomPos = "-" + (menuHt - 15) + "px"; - $("#gContent .gThumbMenu").css("bottom",bottomPos); - console.log("Initilizing: Placing at " + bottomPos); - $("#gContent .gThumbMenu li").hover( + //$(".gPhotoMenu ul").hide(); + $(".gPhotoMenu").hover( function(){ - $(this).css("bottom","0"); - console.log("Placing at 0px"); + $(this + " ul").show(); }, function(){ - $(this).css("bottom",bottomPos); - console.log("Placing at " + bottomPos); + $(this + " ul").hide(); } ); } -- cgit v1.2.3 From 895fbfd95b5e7a42dd865f4a18401fd2e1491bc2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 17:59:55 -0700 Subject: Get the thumbnail menu working. 1) Stop changing the menu classes in JS, instead allow us to specify it in the Menu class itself and then set it to be gThumbMenu in Theme_View 2) Move the gThumbMenu init code to the bottom of the $(document).ready() block; something in there was interfering with it. --- modules/gallery/libraries/Menu.php | 9 ++++-- modules/gallery/libraries/Theme_View.php | 11 ++++---- themes/default/css/screen.css | 8 +++--- themes/default/js/ui.init.js | 47 ++++++++++++++++---------------- 4 files changed, 38 insertions(+), 37 deletions(-) (limited to 'themes/default/css') diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 162cd3b0..a39b59a5 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -136,7 +136,9 @@ class Menu_Core extends Menu_Element { return new Menu_Element_Dialog($type); case "root": - return new Menu("root"); + $menu = new Menu("root"); + $menu->css_class("gMenu"); + return $menu; case "submenu": return new Menu("submenu"); @@ -156,6 +158,7 @@ class Menu_Core extends Menu_Element { } } } + return $this; } public function __construct($type) { @@ -206,8 +209,8 @@ class Menu_Core extends Menu_Element { } public function __toString() { - $html = $this->is_root ? "
      " : - "
    • label\">$this->label
        "; + $html = $this->is_root ? "
          css_class\">" : + "
        • label\">$this->label
            "; $html .= implode("\n", $this->elements); $html .= $this->is_root ? "
          " : "
        "; return $html; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 75138f25..fa45ec89 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -99,19 +99,19 @@ class Theme_View_Core extends Gallery_View { } public function album_menu() { - $this->_menu("album"); + print $this->_menu("album"); } public function tag_menu() { - $this->_menu("tag"); + print $this->_menu("tag"); } public function photo_menu() { - $this->_menu("photo"); + print $this->_menu("photo"); } public function thumb_menu($item) { - $this->_menu("thumb", $item); + print $this->_menu("thumb", $item)->css_class("gThumbMenu"); } private function _menu($type, $item=null) { @@ -127,8 +127,7 @@ class Theme_View_Core extends Gallery_View { } } - $menu->compact(); - print $menu; + return $menu->compact(); } public function pager() { diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 93b68e68..c0954690 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -582,21 +582,21 @@ form .gError, margin-bottom: 0; } -/* Photo Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gContent .gPhotoMenu { +#gContent .gThumbMenu { bottom: 0; left: 0; position: absolute; width: 100%; } -#gContent .gPhotoMenu li { +#gContent .gThumbMenu li { border-left: none; border-right: none; } -#gContent .gPhotoMenu a:hover { +#gContent .gThumbMenu a:hover { text-decoration: none; } diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 37261727..ac7ef8d2 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -15,8 +15,6 @@ $(document).ready(function() { // Remove .gMenu from thumb menu's before initializing Superfish // @todo gallery_menu should only apply gMenu to top-level menus, submenus should be gSubMenu-N - $("#gContent .gItem .gMenu").removeClass("gMenu"); - $("#gContent .gQuick + ul").addClass("gPhotoMenu"); // Initialize Superfish menus $("ul.gMenu").addClass("sf-menu"); @@ -41,28 +39,6 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } - // Initialize photo menus - if ($("#gContent .gPhotoMenu").length) { - $("#gContent .gPhotoMenu li").addClass("ui-state-default"); - $("#gContent .gPhotoMenu li a") - .not('[class]') - .addClass("gButtonLink ui-icon") - .css({ - "height":"10px", - "margin":"0", - "padding":"0" - }); - //$(".gPhotoMenu ul").hide(); - $(".gPhotoMenu").hover( - function(){ - $(this + " ul").show(); - }, - function(){ - $(this + " ul").hide(); - } - ); - } - // Initialize view menu if ($("#gViewMenu").length) { $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); @@ -118,6 +94,29 @@ $(document).ready(function() { } ); + // Initialize thumbnail menus + if ($("#gContent .gThumbMenu").length) { + $("#gContent .gThumbMenu li").addClass("ui-state-default"); + $("#gContent .gThumbMenu li a") + .not('[class]') + .addClass("gButtonLink ui-icon") + .css({ + height: "10px", + margin: "0", + padding: "0" + }); + + $(".gThumbMenu ul").hide(); + $(".gThumbMenu").hover( + function() { + $(this).find("ul").slideDown("fast"); + }, + function() { + $(this).find("ul").slideUp("slow"); + } + ); + } + }); /** -- cgit v1.2.3 From 50cd41655a5e083de3fee5b43fd72c21ffb3dd25 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 22:41:57 -0600 Subject: Minor style tweaks. --- themes/default/css/screen.css | 5 +++++ themes/default/js/ui.init.js | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'themes/default/css') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c0954690..88631e81 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -594,6 +594,11 @@ form .gError, #gContent .gThumbMenu li { border-left: none; border-right: none; + border-bottom: none; +} + +#gContent .gThumbMenu li li { + padding: .3em; } #gContent .gThumbMenu a:hover { diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index ac7ef8d2..92a42ded 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -95,24 +95,25 @@ $(document).ready(function() { ); // Initialize thumbnail menus + // @todo Toggle between north and south caret's on hover if ($("#gContent .gThumbMenu").length) { $("#gContent .gThumbMenu li").addClass("ui-state-default"); $("#gContent .gThumbMenu li a") .not('[class]') - .addClass("gButtonLink ui-icon") + .addClass("gButtonLink ui-icon ui-icon-caret-l-n") .css({ height: "10px", margin: "0", - padding: "0" + padding: "0 0 3px 0" }); $(".gThumbMenu ul").hide(); $(".gThumbMenu").hover( function() { - $(this).find("ul").slideDown("fast"); + $(this).find("ul").slideDown("fast"); }, function() { - $(this).find("ul").slideUp("slow"); + $(this).find("ul").slideUp("slow"); } ); } -- cgit v1.2.3