From 4e7b3ce86bc4aabd338a808e196a7706bf2d9fd0 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Tue, 21 Dec 2010 23:56:14 -0500 Subject: [PATCH] minor fixes --- application/controllers/LibraryController.php | 4 +++- application/controllers/SearchController.php | 2 ++ public/js/campcaster/library/advancedsearch.js | 14 +++----------- public/js/campcaster/library/library.js | 16 +++++++--------- public/js/campcaster/library/spl.js | 4 ++-- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/application/controllers/LibraryController.php b/application/controllers/LibraryController.php index fffba5873..9011dc1ae 100644 --- a/application/controllers/LibraryController.php +++ b/application/controllers/LibraryController.php @@ -24,7 +24,7 @@ class LibraryController extends Zend_Controller_Action public function indexAction() { - $this->view->headScript()->appendFile('/js/campcaster/library/library.js','text/javascript'); + $this->view->headScript()->appendFile('/js/campcaster/onready/library.js','text/javascript'); $this->_helper->layout->setLayout('library'); @@ -84,6 +84,8 @@ class LibraryController extends Zend_Controller_Action { $this->_helper->viewRenderer->setResponseSegment('library'); + $this->view->headScript()->appendFile('/js/campcaster/library/library.js','text/javascript'); + $query["category"] = $this->_getParam('ob', "dc:creator"); $query["order"] = $this->_getParam('order', "asc"); diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index 8eccc5598..5d8e21b3d 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -24,6 +24,8 @@ class SearchController extends Zend_Controller_Action { $this->_helper->layout->setLayout('search'); + $this->view->headScript()->appendFile('/js/campcaster/onready/search.js','text/javascript'); + $this->_helper->actionStack('context-menu', 'library'); $this->_helper->actionStack('display', 'search'); $this->_helper->actionStack('contents', 'library'); diff --git a/public/js/campcaster/library/advancedsearch.js b/public/js/campcaster/library/advancedsearch.js index 95fbddd61..2daf34390 100644 --- a/public/js/campcaster/library/advancedsearch.js +++ b/public/js/campcaster/library/advancedsearch.js @@ -57,20 +57,12 @@ function searchLibrary() { }); } -$(document).ready(function() { - +function setUpSearch() { + $("#search_add").click(ajaxAddField); $("#search_submit").click(searchLibrary); $('[id^="fieldset-row_"]').each(function(i, el){ addRemove(el); }); - - $("#library_display tr:not(:first-child)") - .contextMenu({menu: 'myMenu'}, contextMenu) - .draggable({ - helper: 'clone' - }); - - setUpSPL(); -}); +} diff --git a/public/js/campcaster/library/library.js b/public/js/campcaster/library/library.js index 08c6fd5b3..343b0f720 100644 --- a/public/js/campcaster/library/library.js +++ b/public/js/campcaster/library/library.js @@ -14,13 +14,14 @@ function setLibraryContents(data){ $("#library_display tr:not(:first-child)").remove(); $("#library_display").append(data); - $("#library_display tr:not(:first-child)").contextMenu( - {menu: 'myMenu'}, contextMenu - ); + $("#library_display tr:not(:first-child)") + .contextMenu({menu: 'myMenu'}, contextMenu) + .draggable({ + helper: 'clone' + }); } -$(document).ready(function() { - +function setUpLibrary() { $("#library_display tr:first-child span.title").data({'ob': 'dc:title', 'order' : 'asc'}); $("#library_display tr:first-child span.artist").data({'ob': 'dc:creator', 'order' : 'desc'}); $("#library_display tr:first-child span.album").data({'ob': 'dc:source', 'order' : 'asc'}); @@ -53,7 +54,4 @@ $(document).ready(function() { .draggable({ helper: 'clone' }); - - setUpSPL(); - -}); +} diff --git a/public/js/campcaster/library/spl.js b/public/js/campcaster/library/spl.js index 3fa1ed6c2..486b2fb0c 100644 --- a/public/js/campcaster/library/spl.js +++ b/public/js/campcaster/library/spl.js @@ -72,8 +72,8 @@ function setUpSPL() { $("#spl_sortable" ).bind( "sortstop", moveSPLItem); $("#spl_remove_selected").click(deleteSPLItem); - $("#side_playlist").droppable(); - $("#side_playlist" ).bind( "drop", addSPLItem); + $("#spl_sortable").droppable(); + $("#spl_sortable" ).bind( "drop", addSPLItem); $('input[name="all"]').click(function(){ $('form[name="SPL"]').find('input').attr("checked", $(this).attr("checked"));