godoc/static: update jquery.treeview to 1.4.2
This has the primary benefit of clarifying the license as MIT. Images have been "losslessly compressed" upstream; see https://github.com/jzaefferer/jquery-treeview/commit/ca711d9. Retrieved from https://github.com/jzaefferer/jquery-treeview/releases/tag/1.4.2. Change-Id: Ia111cbdf246d9adafa3d1c8cfbd7f0c5763cc935 Reviewed-on: https://go-review.googlesource.com/c/tools/+/223077 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 58 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 61 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1010 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 381 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 848 B |
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1010 B |
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 394 B |
@ -1,4 +1,4 @@
|
||||
/* https://github.com/jzaefferer/jquery-treeview/blob/master/jquery.treeview.css */
|
||||
/* https://github.com/jzaefferer/jquery-treeview/blob/1.4.2/jquery.treeview.css */
|
||||
/* License: MIT. */
|
||||
.treeview, .treeview ul {
|
||||
padding: 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* https://github.com/jzaefferer/jquery-treeview/blob/master/jquery.treeview.edit.js */
|
||||
/* https://github.com/jzaefferer/jquery-treeview/blob/1.4.2/jquery.treeview.edit.js */
|
||||
/* License: MIT. */
|
||||
(function($) {
|
||||
var CLASSES = $.treeview.classes;
|
||||
@ -35,5 +35,5 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
@ -1,17 +1,11 @@
|
||||
/*
|
||||
* Treeview 1.4.1 - jQuery plugin to hide and show branches of a tree
|
||||
*
|
||||
* Treeview 1.4.2 - jQuery plugin to hide and show branches of a tree
|
||||
*
|
||||
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
|
||||
* http://docs.jquery.com/Plugins/Treeview
|
||||
*
|
||||
* Copyright (c) 2007 Jörn Zaefferer
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* Copyright Jörn Zaefferer
|
||||
* Released under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id: jquery.treeview.js 5759 2008-07-01 07:50:28Z joern.zaefferer $
|
||||
*
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
@ -50,7 +44,7 @@
|
||||
} else {
|
||||
this.hide();
|
||||
if (callback)
|
||||
this.each(callback);
|
||||
this.each(callback);
|
||||
}
|
||||
},
|
||||
prepareBranches: function(settings) {
|
||||
@ -70,18 +64,18 @@
|
||||
if ( this == event.target )
|
||||
toggler.apply($(this).next());
|
||||
}).add( $("a", this) ).hoverClass();
|
||||
|
||||
|
||||
if (!settings.prerendered) {
|
||||
// handle closed ones first
|
||||
this.filter(":has(>ul:hidden)")
|
||||
.addClass(CLASSES.expandable)
|
||||
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
|
||||
|
||||
|
||||
// handle open ones
|
||||
this.not(":has(>ul:hidden)")
|
||||
.addClass(CLASSES.collapsable)
|
||||
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
|
||||
|
||||
|
||||
// create hitarea if not present
|
||||
var hitarea = this.find("div." + CLASSES.hitarea);
|
||||
if (!hitarea.length)
|
||||
@ -94,23 +88,23 @@
|
||||
$(this).addClass( classes );
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// apply event to hitarea
|
||||
this.find("div." + CLASSES.hitarea).click( toggler );
|
||||
},
|
||||
treeview: function(settings) {
|
||||
|
||||
|
||||
settings = $.extend({
|
||||
cookieId: "treeview"
|
||||
}, settings);
|
||||
|
||||
|
||||
if ( settings.toggle ) {
|
||||
var callback = settings.toggle;
|
||||
settings.toggle = function() {
|
||||
return callback.apply($(this).parent()[0], arguments);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// factory for treecontroller
|
||||
function treeController(tree, control) {
|
||||
// factory for click handlers
|
||||
@ -130,9 +124,9 @@
|
||||
// click on second to expand tree
|
||||
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
|
||||
// click on third to toggle tree
|
||||
$("a:eq(2)", control).click( handler() );
|
||||
$("a:eq(2)", control).click( handler() );
|
||||
}
|
||||
|
||||
|
||||
// handle toggle event
|
||||
function toggler() {
|
||||
$(this)
|
||||
@ -164,7 +158,7 @@
|
||||
}
|
||||
}
|
||||
this.data("toggler", toggler);
|
||||
|
||||
|
||||
function serialize() {
|
||||
function binary(arg) {
|
||||
return arg ? 1 : 0;
|
||||
@ -175,7 +169,7 @@
|
||||
});
|
||||
$.cookie(settings.cookieId, data.join(""), settings.cookieOptions );
|
||||
}
|
||||
|
||||
|
||||
function deserialize() {
|
||||
var stored = $.cookie(settings.cookieId);
|
||||
if ( stored ) {
|
||||
@ -185,13 +179,13 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add treeview class to activate styles
|
||||
this.addClass("treeview");
|
||||
|
||||
|
||||
// prepare branches and find all tree items with child lists
|
||||
var branches = this.find("li").prepareBranches(settings);
|
||||
|
||||
|
||||
switch(settings.persist) {
|
||||
case "cookie":
|
||||
var toggleCallback = settings.toggle;
|
||||
@ -205,7 +199,7 @@
|
||||
break;
|
||||
case "location":
|
||||
var current = this.find("a").filter(function() {
|
||||
return this.href.toLowerCase() == location.href.toLowerCase();
|
||||
return location.href.toLowerCase().indexOf(this.href.toLowerCase()) == 0;
|
||||
});
|
||||
if ( current.length ) {
|
||||
// TODO update the open/closed classes
|
||||
@ -222,19 +216,19 @@
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
branches.applyClasses(settings, toggler);
|
||||
|
||||
|
||||
// if control option is set, create the treecontroller and show it
|
||||
if ( settings.control ) {
|
||||
treeController(this, settings.control);
|
||||
$(settings.control).show();
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// classes used by the plugin
|
||||
// need to be styled via external stylesheet, see first example
|
||||
$.treeview = {};
|
||||
@ -252,5 +246,5 @@
|
||||
last: "last",
|
||||
hitarea: "hitarea"
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|