[Fusionforge-commits] r16827 - in trunk/src: vendor/jquery-simpletreemenu/css vendor/jquery-simpletreemenu/js www/include

Franck VILLAUME nerville at fusionforge.org
Sat Nov 24 12:03:32 CET 2012


Author: nerville
Date: 2012-11-24 12:03:31 +0100 (Sat, 24 Nov 2012)
New Revision: 16827

Added:
   trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.5.0.css
   trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.5.0.js
Removed:
   trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css
   trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.1.0.js
Modified:
   trunk/src/www/include/html.php
Log:
update to last simpleTreeMenu 1.5.0

Deleted: trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css
===================================================================
--- trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css	2012-11-23 17:25:17 UTC (rev 16826)
+++ trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css	2012-11-24 11:03:31 UTC (rev 16827)
@@ -1,47 +0,0 @@
-/* simpleTreeMenu */
-
-ul.simpleTreeMenu {
-	line-height: 1.75em;
-	margin-top: 0px;
-	margin-bottom: 0px;
-}
-
-ul.simpleTreeMenu, ul.simpleTreeMenu ul {
-	margin-left: 0px;
-	padding-left: 15px;
-}
-
-ul.simpleTreeMenu li.Node {
-	list-style-image: url("simpleTreeMenu/menu-arrow-right.png");
-	margin-left: 5px;
-	padding: 0px;	
-}
-
-ul.simpleTreeMenu li.Node span {
-	cursor: pointer;
-	display: block;
-}
-
-ul.simpleTreeMenu li.Node span:hover {
-	background-color: #e0e0e0;
-}
-
-ul.simpleTreeMenu li.expanded {
-	list-style-image: url("simpleTreeMenu/menu-arrow-down.png");
-}
-
-ul.simpleTreeMenu li.Leaf {
-	list-style-image: url("simpleTreeMenu/menu-dot.png");
-	margin-left: 5px;
-	padding: 0px;	
-}
-
-ul.simpleTreeMenu a, ul.simpleTreeMenu a:visited {
-	display: block;
-	text-decoration: none;
-	color: #3333AA;
-}
-
-ul.simpleTreeMenu a:hover {
-	background-color: #e0e0e0;
-}

Added: trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.5.0.css
===================================================================
--- trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.5.0.css	                        (rev 0)
+++ trunk/src/vendor/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.5.0.css	2012-11-24 11:03:31 UTC (rev 16827)
@@ -0,0 +1,57 @@
+/* simpleTreeMenu */
+
+ul.simpleTreeMenu {
+	line-height: 1.75em;
+	margin-top: 0px;
+	margin-bottom: 0px;
+}
+
+ul.simpleTreeMenu, ul.simpleTreeMenu ul {
+	margin-left: 0px;
+	padding-left: 15px;
+}
+
+ul.simpleTreeMenu li.Node {
+	list-style-image: url("simpleTreeMenu/menu-arrow-right.png");
+	margin-left: 5px;
+	padding: 0px;
+}
+
+ul.simpleTreeMenu li.Node span {
+	cursor: pointer;
+	display: block;
+}
+
+ul.simpleTreeMenu li.Node span:hover {
+	background-color: #d8d8d0;
+}
+
+ul.simpleTreeMenu li.expanded {
+	list-style-image: url("simpleTreeMenu/menu-arrow-down.png");
+}
+
+ul.simpleTreeMenu li.Leaf {
+	list-style-image: url("simpleTreeMenu/menu-dot.png");
+	margin-left: 5px;
+	padding: 0px;
+}
+
+ul.simpleTreeMenu a, ul.simpleTreeMenu a:visited {
+	display: block;
+	text-decoration: none;
+}
+
+ul.simpleTreeMenu li.selected {
+	background-color: #c0c0c0;
+}
+
+ul.simpleTreeMenu a:hover {
+	background-color: #d8d8d0;
+	text-decoration: none;
+}
+
+ul.simpleTreeMenu li.EmptyNode {
+	/* Override li.Node with your EmptyNode preferences here: */
+	color: #808080;
+}
+

Deleted: trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.1.0.js
===================================================================
--- trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.1.0.js	2012-11-23 17:25:17 UTC (rev 16826)
+++ trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.1.0.js	2012-11-24 11:03:31 UTC (rev 16827)
@@ -1,97 +0,0 @@
-/* SimpleTreeMenu */
-
-(function($) {
-
-	var methods = {
-		
-		init: function() {
-	    	return this.each(function() {
-	    		var $this = $(this);
-				if ($this.hasClass("simpleTreeMenu") === false) {
-					$this.hide();
-					$(this).addClass("simpleTreeMenu");
-					$this.children("li").each(function() {
-						methods.buildNode($(this));
-					});	
-					$(this).show();	
-				}
-	    	});		
-		},
-		
-		buildNode: function($li) {
-			if ($li.children("ul").length > 0) {
-				$li.children("ul").hide();
-				$li.addClass("Node").click(function(event) {
-					var $t = $(this);
-					if ($t.hasClass("expanded")) {
-						$t.removeClass("expanded");
-						$t.children("ul").hide();
-					} else {
-						$t.addClass("expanded");
-						$t.children("ul").show();
-					}
-					event.stopPropagation();
-				});    
-				$li.children("ul").children("li").each(function() {
-					methods.buildNode($(this));
-				});
-			} else {
-				$li.addClass("Leaf").click(function(event) {
-					event.stopPropagation();
-				});
-				return;
-			}		
-		},
-		
-		expandToNode: function($li) {
-			if ($li.parent().hasClass("simpleTreeMenu")) {
-				if (!$li.hasClass("expanded")) {
-					$li.addClass("expanded");
-					$li.children("ul").show();
-				}
-			}
-			$li.parents("li", "ul.simpleTreeMenu").each(function() {
-				var $t = jQuery(this);
-				if (!$t.hasClass("expanded")) {
-					$t.addClass("expanded");
-					$t.children("ul").show();
-				}
-			});
-		},
-		
-		expandAll: function() {
-			jQuery(this).find("li.Node").each(function() {
-				$t = jQuery(this);
-				if (!$t.hasClass("expanded")) {
-					$t.addClass("expanded");
-					$t.children("ul").show();
-				}
-			});	
-		},
-		
-		closeAll: function() {
-			jQuery("ul", jQuery(this)).hide();
-			var $li = jQuery("li.Node");
-			if ($li.hasClass("expanded")) {
-				$li.removeClass("expanded");
-			}
-		}		
-		
-	};
-	
-	$.fn.simpleTreeMenu = function(method) {
-	    if (methods[method]) {
-			return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
-	    } else if (typeof method === 'object' || !method) {
-			return methods.init.apply(this, arguments);
-	    } else {
-			$.error('Method ' +  method + ' does not exist on jQuery.simpleTreeMenu');
-	    }    	
-	};
-	
-})(jQuery);
-
-
-			
-			
-	
\ No newline at end of file

Added: trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.5.0.js
===================================================================
--- trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.5.0.js	                        (rev 0)
+++ trunk/src/vendor/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.5.0.js	2012-11-24 11:03:31 UTC (rev 16827)
@@ -0,0 +1,157 @@
+(function($) {
+	
+	var methods = {
+		
+		init: function() {
+			return this.each(function() {
+				var $this = $(this);
+				if ($this.hasClass("simpleTreeMenu") === false) {
+					$this.hide();
+					$(this).addClass("simpleTreeMenu");
+					$this.children("li").each(function() {
+						methods.buildNode($(this));
+					});
+					if (private.hasLocalStorage() === true) {
+						state = localStorage.getItem(
+							private.localStorageKey.apply(this)
+						);
+						if (state != null) {
+							state = state.split(",");
+							if (state.length > 0) {
+								methods.deserialize.call(this, state);
+							}
+						}
+					}
+					$(this).show();
+				}
+			});
+		},
+		
+		buildNode: function($li) {
+			if ($li.children("ul").length > 0) {
+				$li.children("ul").hide();
+				$li.addClass("Node").click(function(event) {
+					var $t = $(this);
+					if ($t.hasClass("expanded")) {
+						$t.removeClass("expanded").children("ul").hide();
+					}
+					else {
+						$t.addClass("expanded").children("ul").show();
+					}
+					event.stopPropagation();
+				});
+				if ($li.children("ul").children("li").length == 0) {
+					$li.addClass("EmptyNode");
+				}
+				$li.children("ul").children("li").each(function() {
+					methods.buildNode($(this));
+				});
+			} else {
+				$li.addClass("Leaf").click(function(event) {
+					event.stopPropagation();
+				});
+				return;
+			}
+		},
+		
+		serialize: function() {
+			state = [];
+			$('.Node, .Leaf', $(this)).each(function() {
+				var s = $(this).hasClass("expanded") ? 
+					private.EXPANDED : private.COLLAPSED;
+				state.push(s);
+			});
+			if (private.hasLocalStorage() === true) {
+				localStorage.setItem(
+					private.localStorageKey.apply(this), state.join()
+				);
+			}
+		},
+		
+		deserialize: function(state) {
+			$('.Node, .Leaf', $(this)).each(function(index) {
+				if (state[index] == private.EXPANDED) {
+					$(this).addClass("expanded").children("ul").show();
+				}
+			});
+		},
+		
+		expandToNode: function($li) {
+			if ($li.parent().hasClass("simpleTreeMenu")) {
+				if (!$li.hasClass("expanded")) {
+					$li.addClass("expanded").children("ul").show();
+				}
+			}
+			$li.parents("li", "ul.simpleTreeMenu").each(function() {
+				var $t = $(this);
+				if (!$t.hasClass("expanded")) {
+					$t.addClass("expanded").children("ul").show();
+				}
+			});
+		},
+		
+		searchForUrl: function() {
+			$('.Leaf', $(this)).each(function() {
+				$leaf = $(this);
+				current_url = document.location.pathname.slice(1);
+				if ($leaf.find('a').attr('href').indexOf(current_url) >= 0) {
+					methods.expandToNode($leaf);
+					$leaf.addClass('selected');
+				}
+			});
+		},
+		
+		expandAll: function() {
+			$(this).find("li.Node").each(function() {
+				$t = $(this);
+				if (!$t.hasClass("expanded")) {
+					$t.addClass("expanded").children("ul").show();
+				}
+			});
+		},
+		
+		closeAll: function() {
+			$("ul", $(this)).hide();
+			var $li = $("li.Node");
+			if ($li.hasClass("expanded")) {
+				$li.removeClass("expanded");
+			}
+		},	
+	};
+	
+	var private = {
+		
+		EXPANDED: "expanded",
+		COLLAPSED: "collapsed",
+		localStorageKeyPrefix: "jQuery-simpleTreeMenu-treeState-",
+		
+		hasLocalStorage: function() {
+			return (
+				localStorage && localStorage.setItem && localStorage.getItem
+			);
+		},
+		
+		localStorageKey: function() {
+			return private.localStorageKeyPrefix + $(this).attr("id");
+		}
+		
+	};
+	
+	$.fn.simpleTreeMenu = function(method) {
+		if (methods[method]) {
+			return methods[method].apply(
+				this, Array.prototype.slice.call(arguments, 1)
+			);
+		}
+		else if (typeof method === 'object' || !method) {
+			return methods.init.apply(this, arguments);
+	}
+		else {
+			$.error(
+				'Method ' +  method + ' does not exist on jQuery.simpleTreeMenu'
+			);
+		}
+	};
+	
+})(jQuery);
+

Modified: trunk/src/www/include/html.php
===================================================================
--- trunk/src/www/include/html.php	2012-11-23 17:25:17 UTC (rev 16826)
+++ trunk/src/www/include/html.php	2012-11-24 11:03:31 UTC (rev 16827)
@@ -424,8 +424,8 @@
 
 function html_use_simplemenu() {
 	html_use_jquery();
-	use_javascript('/scripts/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.1.0.js');
-	use_stylesheet('/scripts/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.1.0.css');
+	use_javascript('/scripts/jquery-simpletreemenu/js/jquery-simpleTreeMenu-1.5.0.js');
+	use_stylesheet('/scripts/jquery-simpletreemenu/css/jquery-simpleTreeMenu-1.5.0.css');
 }
 
 function html_use_coolfieldset() {
@@ -444,23 +444,27 @@
 function html_use_jqueryjqplot() {
 	html_use_jquery();
 	use_javascript('/scripts/jquery-jqplot/jquery.jqplot.js');
+	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js');
 	use_stylesheet('/scripts/jquery-jqplot/jquery.jqplot.css');
 }
 
 function html_use_jqueryjqplotpluginCanvas() {
 	html_use_jqueryjqplot();
 	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.canvasTextRenderer.js');
-	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js');
 	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.categoryAxisRenderer.js');
 }
 
 function html_use_jqueryjqplotpluginBar() {
 	html_use_jqueryjqplot();
 	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.barRenderer.js');
-	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.categoryAxisRenderer.js');
 	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.pointLabels.js');
 }
 
+function html_use_jqueryjqplotpluginPie() {
+	html_use_jqueryjqplot();
+	use_javascript('/scripts/jquery-jqplot/plugins/jqplot.pieRenderer.js');
+}
+
 /**
  * html_build_select_box_from_arrays() - Takes two arrays, with the first array being the "id" or value and the other
  * array being the text you want displayed.




More information about the Fusionforge-commits mailing list