From: <tna...@us...> - 2008-11-29 20:02:34
|
Revision: 18963 http://gallery.svn.sourceforge.net/gallery/?rev=18963&view=rev Author: tnalmdal Date: 2008-11-29 20:02:30 +0000 (Sat, 29 Nov 2008) Log Message: ----------- The gui part of rearranging albums and photos on the welcome page. Haven't finished the ajax back end to actually do the move, but thought i'd put the gui up so people can play Modified Paths: -------------- gallery3/trunk/core/views/welcome.html.php gallery3/trunk/modules/rearrange/controllers/rearrange.php Added Paths: ----------- gallery3/trunk/modules/rearrange/css/ gallery3/trunk/modules/rearrange/css/jquery.simple.tree.css gallery3/trunk/modules/rearrange/helpers/rearrange.php gallery3/trunk/modules/rearrange/helpers/rearrange_block.php gallery3/trunk/modules/rearrange/js/rearrange_tree.js gallery3/trunk/modules/rearrange/views/ gallery3/trunk/modules/rearrange/views/rearrange.html.php Modified: gallery3/trunk/core/views/welcome.html.php =================================================================== --- gallery3/trunk/core/views/welcome.html.php 2008-11-29 17:08:42 UTC (rev 18962) +++ gallery3/trunk/core/views/welcome.html.php 2008-11-29 20:02:30 UTC (rev 18963) @@ -129,9 +129,10 @@ text-decoration: underline; } </style> - <script type="text/javascript" src="<?= url::file("lib/jquery.js") ?>"></script> - <script type="text/javascript" src="<?= url::file("lib/jquery.cookie.js") ?>"></script> - <script type="text/javascript" src="<?= url::file("lib/jquery.MultiFile.js") ?>"></script> + <?= html::script("lib/jquery.js") ?> + <?= html::script("lib/jquery.cookie.js") ?> + <?= html::script("lib/jquery.MultiFile.js") ?> + <?= rearrange_block::head(null) ?> </head> <body> <div class="outer"> @@ -248,6 +249,10 @@ <input type="hidden" name="type" value="album"/> </form> </fieldset> + <fieldset> + <legend>Rearrange</legend> + <?= rearrange::get_html()->render() ?> + </fieldset> </div> <div id="access" class="activity"> Modified: gallery3/trunk/modules/rearrange/controllers/rearrange.php =================================================================== --- gallery3/trunk/modules/rearrange/controllers/rearrange.php 2008-11-29 17:08:42 UTC (rev 18962) +++ gallery3/trunk/modules/rearrange/controllers/rearrange.php 2008-11-29 20:02:30 UTC (rev 18963) @@ -21,13 +21,11 @@ protected $resource_type = "item"; public function _show($item) { - throw new Exception("@todo Rearrange_Controller::_show NOT IMPLEMENTED"); + print rearrange::get_html($item)->render(); } public function _index() { - // @todo: represent this in different formats - $root = ORM::factory("item", 1); - $this->_show($root); + print rearrange::get_html()->render(); } public function _form_add($item_id) { Added: gallery3/trunk/modules/rearrange/css/jquery.simple.tree.css =================================================================== --- gallery3/trunk/modules/rearrange/css/jquery.simple.tree.css (rev 0) +++ gallery3/trunk/modules/rearrange/css/jquery.simple.tree.css 2008-11-29 20:02:30 UTC (rev 18963) @@ -0,0 +1,179 @@ +@CHARSET "UTF-8"; + +.simpleTree { + font: normal 12px arial, tahoma, helvetica, sans-serif; + margin:0; + padding:20px; + margin:0; + padding:0; + /* + overflow:auto; + width: 250px; + height:350px; + overflow:auto; + border: 1px solid #444444; + */ +} + +.simpleTree li { + list-style: none; + margin:0; + padding:0 0 0 34px; + line-height: 14px; +} +.simpleTree li span { + display:inline; + clear: left; + white-space: nowrap; +} + +.simpleTree ul { + margin:0; + padding:0; +} +.simpleTree .root { + margin-left:-16px; + background: url(../images/root.gif) no-repeat 16px 0 #ffffff; +} + +.simpleTree .line { + margin:0 0 0 -16px; + padding:0; + line-height: 3px; + height:3px; + font-size:3px; + background: url(../images/line_bg.gif) 0 0 no-repeat transparent; +} + +.simpleTree .line-last { + margin:0 0 0 -16px; + padding:0; + line-height: 3px; + height:3px; + font-size:3px; + background: url(../images/spacer.gif) 0 0 no-repeat transparent; +} + +.simpleTree .line-over { + margin:0 0 0 -16px; + padding:0; + line-height: 3px; + height:3px; + font-size:3px; + background: url(../images/line_bg_over.gif) 0 0 no-repeat transparent; +} + +.simpleTree .line-over-last { + margin:0 0 0 -16px; + padding:0; + line-height: 3px; + height:3px; + font-size:3px; + background: url(../images/line_bg_over_last.gif) 0 0 no-repeat transparent; +} + +.simpleTree .folder-open { + margin-left:-16px; + background: url(../images/collapsable.gif) 0 -2px no-repeat #fff; +} + +.simpleTree .folder-open-last { + margin-left:-16px; + background: url(../images/collapsable-last.gif) 0 -2px no-repeat #fff; +} + +.simpleTree .folder-close { + margin-left:-16px; + background: url(../images/expandable.gif) 0 -2px no-repeat #fff; +} + +.simpleTree .folder-close-last { + margin-left:-16px; + background: url(../images/expandable-last.gif) 0 -2px no-repeat #fff; +} + +.simpleTree .doc { + margin-left:-16px; + background: url(../images/leaf.gif) 0 -1px no-repeat #fff; +} + +.simpleTree .doc-last { + margin-left:-16px; + background: url(../images/leaf-last.gif) 0 -1px no-repeat #fff; +} + +.simpleTree .ajax { + background: url(../images/spinner.gif) no-repeat 0 0 #ffffff; + height: 16px; + display:none; +} + +.simpleTree .ajax li { + display:none; + margin:0; + padding:0; +} + +.simpleTree .trigger { + display:inline; + margin-left:-32px; + width: 28px; + height: 11px; + cursor:pointer; +} + +.simpleTree .text { + cursor: default; +} + +.simpleTree .active { + cursor: default; + background-color:#F7BE77; + padding:0px 2px; + border: 1px dashed #444; +} + +#drag_container { + background:#ffffff; + color:#000; + font: normal 11px arial, tahoma, helvetica, sans-serif; + border: 1px dashed #767676; +} + +#drag_container ul { + list-style: none; + padding:0; + margin:0; +} + + +#drag_container li { + list-style: none; + background-color:#ffffff; + line-height:18px; + white-space: nowrap; + padding:1px 1px 0px 16px; + margin:0; +} + +#drag_container li span { + padding:0; +} + + +#drag_container li.doc, #drag_container li.doc-last { + background: url(../images/leaf.gif) no-repeat -17px 0 #ffffff; +} + +#drag_container .folder-close, #drag_container .folder-close-last { + background: url(../images/expandable.gif) no-repeat -17px 0 #ffffff; +} + + +#drag_container .folder-open, #drag_container .folder-open-last { + background: url(../images/collapsable.gif) no-repeat -17px 0 #ffffff; +} + +.contextMenu { + display:none; +} Property changes on: gallery3/trunk/modules/rearrange/css/jquery.simple.tree.css ___________________________________________________________________ Added: svn:keywords + Author Id Revision Added: svn:eol-style + LF Added: gallery3/trunk/modules/rearrange/helpers/rearrange.php =================================================================== --- gallery3/trunk/modules/rearrange/helpers/rearrange.php (rev 0) +++ gallery3/trunk/modules/rearrange/helpers/rearrange.php 2008-11-29 20:02:30 UTC (rev 18963) @@ -0,0 +1,33 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2008 Bharat Mediratta + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ +class rearrange_Core { + public static function get_html($item=null) { + $view = new View("rearrange.html"); + + $view->root = null; + if (empty($item)) { + $item = ORM::factory("item", 1); + $view->root = $item; + } + + $view->children = $item->children(); + return $view; + } +} Property changes on: gallery3/trunk/modules/rearrange/helpers/rearrange.php ___________________________________________________________________ Added: svn:keywords + Author Id Revision Added: svn:eol-style + LF Added: gallery3/trunk/modules/rearrange/helpers/rearrange_block.php =================================================================== --- gallery3/trunk/modules/rearrange/helpers/rearrange_block.php (rev 0) +++ gallery3/trunk/modules/rearrange/helpers/rearrange_block.php 2008-11-29 20:02:30 UTC (rev 18963) @@ -0,0 +1,30 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2008 Bharat Mediratta + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ +class rearrange_block_Core { + public static function head($theme) { + $head[] = html::script("modules/rearrange/js/jquery.simple.tree.js"); + + $url = url::file("modules/rearrange/css/jquery.simple.tree.css"); + $head[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"$url\" " . + "media=\"screen,print,projection\" />"; + + return implode("\n", $head); + } +} Property changes on: gallery3/trunk/modules/rearrange/helpers/rearrange_block.php ___________________________________________________________________ Added: svn:keywords + Author Id Revision Added: svn:eol-style + LF Property changes on: gallery3/trunk/modules/rearrange/js/rearrange_tree.js ___________________________________________________________________ Added: svn:keywords + Author Id Revision Added: svn:eol-style + LF Added: gallery3/trunk/modules/rearrange/views/rearrange.html.php =================================================================== --- gallery3/trunk/modules/rearrange/views/rearrange.html.php (rev 0) +++ gallery3/trunk/modules/rearrange/views/rearrange.html.php 2008-11-29 20:02:30 UTC (rev 18963) @@ -0,0 +1,44 @@ +<?php defined("SYSPATH") or die("No direct script access."); ?> + +<? if ($root): ?> + <script> + var simpleTree_Rearrange; + $(document).ready(function() { + simpleTree_Rearrange = $(".simpleTree").simpleTree({ + autoclose: false, + animate: true, + afterClick:function(node) { + alert("text-"+$('span:first', node).text()); + }, + afterDblClick:function(node) { + alert("text-"+$('span:first', node).text()); + }, + afterMove:function(destination, source, pos) { + alert("destination: "+destination.attr('id') + "\n" + + "source: "+source.attr('id') + "\n" + + "pos: " + pos); + }, + afterAjax:function() { + } + }); + }); + </script> + <ul class="simpleTree"> + <li class="root" id="<?= $root->id?>"><span><?= $root->title?></span> +<? endif; ?> +<ul> + <? foreach ($children as $child): ?> + <li id="<?= $child->id?>"><span class="text"><?= $child->title?></span> + <? if ($child->type == "album"): ?> + <ul class="ajax"> + <li><?= url::site("rearrange/$child->id") ?></li> + </ul> + <? endif; ?> + </li> + <? endforeach;?> +</ul> +<? if ($root): ?> + </li> + </ul> +<? endif; ?> + Property changes on: gallery3/trunk/modules/rearrange/views/rearrange.html.php ___________________________________________________________________ Added: svn:keywords + Author Id Revision Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |