From b0f717e4169526142d67627000268066fb0bfe62 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 20 Nov 2013 17:44:06 -0800 Subject: [PATCH] Expanding Page-Navigation support added. (still a few glitches) --- e107_plugins/page/css/page.navigation.css | 45 +++++++++++++++++ e107_plugins/page/img/collapsed.png | Bin 0 -> 1241 bytes e107_plugins/page/img/expanded.png | Bin 0 -> 207 bytes .../page/js/jquery.page.navigation.js | 47 ++++++++++++++++++ e107_plugins/page/page_navigation_menu.php | 16 ++++++ e107_themes/bootstrap/theme.php | 1 + 6 files changed, 109 insertions(+) create mode 100644 e107_plugins/page/css/page.navigation.css create mode 100644 e107_plugins/page/img/collapsed.png create mode 100644 e107_plugins/page/img/expanded.png create mode 100644 e107_plugins/page/js/jquery.page.navigation.js diff --git a/e107_plugins/page/css/page.navigation.css b/e107_plugins/page/css/page.navigation.css new file mode 100644 index 000000000..8063b5a6e --- /dev/null +++ b/e107_plugins/page/css/page.navigation.css @@ -0,0 +1,45 @@ + +/********************/ +/* EXPANDABLE LIST */ +/********************/ + +ul.page-nav { + margin-left:5px; +} + +ul.page-nav p { + + display:block; +} + +ul.page-nav li { + line-height:150%; + cursor: pointer; + background-position: 1px 6px; + background-repeat: no-repeat; +} + +/* Collapsed state for list element */ +ul.page-nav .collapsed { + list-style: none; + padding-left: 15px; + text-indent:0px; + margin:0; + margin-left:5px; + background-image: url(../img/collapsed.png); +} +/* Expanded state for list element +/* NOTE: This class must be located UNDER the collapsed one */ +ul.page-nav .expanded { + list-style: none; + padding-left: 15px; + text-indent:0px; + margin:0; + margin-left:5px; + background-image: url(../img/expanded.png); +} + +ul.page-nav { + clear: both; +} + diff --git a/e107_plugins/page/img/collapsed.png b/e107_plugins/page/img/collapsed.png new file mode 100644 index 0000000000000000000000000000000000000000..8f2d0efa4ffa7ce13ad3100720bd51107e5cc7ef GIT binary patch literal 1241 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O_~uBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZk1_ow^ z0G|+7pn}lQP#`%9Mnhl(hJfeYfA4^KilHRPFZln+1`NU9*;Ro_K(fR&q9iy!t)x7$ zD3u`~F*C13&(AePq0Cs%RL|@}^V%q&A}LQ7#}J9|{eo$)iboFyt=akR{0MN-gPyhe` literal 0 HcmV?d00001 diff --git a/e107_plugins/page/img/expanded.png b/e107_plugins/page/img/expanded.png new file mode 100644 index 0000000000000000000000000000000000000000..c5fb718e54b907369fa263086133255cd0c7f06b GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(rfA zHKHUqKdq!Zu_%=xATcwqM9FW|34 items visible. + $('#page-nav-collapse') + .unbind('click') + .click( function() { + $('.collapsed').removeClass('expanded'); + $('.collapsed').children().hide('medium'); + }); + +}; + + +/**************************************************************/ +/* Functions to execute on loading the document */ +/**************************************************************/ +$(document).ready( function() +{ + pageNavList(); +}); \ No newline at end of file diff --git a/e107_plugins/page/page_navigation_menu.php b/e107_plugins/page/page_navigation_menu.php index 0c81fedc5..29557c3f3 100644 --- a/e107_plugins/page/page_navigation_menu.php +++ b/e107_plugins/page/page_navigation_menu.php @@ -11,6 +11,8 @@ if (!defined('e107_INIT')) { exit; } + + //FIXME XXX - This menu should call the {PAGE_NAVIGATION} shortcode instead of duplicating its code and automatically display all links. $parm = eHelper::scParams($parm); @@ -40,6 +42,8 @@ if($request && is_array($request)) } } +$expandable = vartrue($parm['expandable']); + if($parm) $parm = http_build_query($parm, null, '&'); else $parm = ''; @@ -56,6 +60,18 @@ if(isset($data['title']) && !vartrue($template['noAutoTitle'])) if(empty($data)) return; $text = e107::getNav()->render($data, $template) ; +/** + * Expandable menu support. + * @see jquery.page.navigation.js . activate with expandable=1 in the page-navigation menu. + * For best results include: e107::css('page', 'css/page.navigation.css', 'jquery'); in theme.php + */ +if($expandable) +{ + e107::js('page','js/jquery.page.navigation.js','jquery'); + $template['caption'] .= "+-"; +} + + ### Render e107::getRender()->tablerender($template['caption'], $text, 'page-navigation-menu'); diff --git a/e107_themes/bootstrap/theme.php b/e107_themes/bootstrap/theme.php index a73e140fb..8c80de200 100644 --- a/e107_themes/bootstrap/theme.php +++ b/e107_themes/bootstrap/theme.php @@ -47,6 +47,7 @@ e107::css('url', "//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome. e107::css('theme', 'js/google-code-prettify/prettify.css'); e107::js('theme', "js/google-code-prettify/prettify.js"); +e107::css('page', 'css/page.navigation.css', 'jquery');