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. */
|
/* License: MIT. */
|
||||||
.treeview, .treeview ul {
|
.treeview, .treeview ul {
|
||||||
padding: 0;
|
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. */
|
/* License: MIT. */
|
||||||
(function($) {
|
(function($) {
|
||||||
var CLASSES = $.treeview.classes;
|
var CLASSES = $.treeview.classes;
|
||||||
@ -35,5 +35,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery);
|
})(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://bassistance.de/jquery-plugins/jquery-plugin-treeview/
|
||||||
* http://docs.jquery.com/Plugins/Treeview
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007 Jörn Zaefferer
|
* Copyright Jörn Zaefferer
|
||||||
*
|
* Released under the MIT license:
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* 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($) {
|
;(function($) {
|
||||||
@ -50,7 +44,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.hide();
|
this.hide();
|
||||||
if (callback)
|
if (callback)
|
||||||
this.each(callback);
|
this.each(callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
prepareBranches: function(settings) {
|
prepareBranches: function(settings) {
|
||||||
@ -70,18 +64,18 @@
|
|||||||
if ( this == event.target )
|
if ( this == event.target )
|
||||||
toggler.apply($(this).next());
|
toggler.apply($(this).next());
|
||||||
}).add( $("a", this) ).hoverClass();
|
}).add( $("a", this) ).hoverClass();
|
||||||
|
|
||||||
if (!settings.prerendered) {
|
if (!settings.prerendered) {
|
||||||
// handle closed ones first
|
// handle closed ones first
|
||||||
this.filter(":has(>ul:hidden)")
|
this.filter(":has(>ul:hidden)")
|
||||||
.addClass(CLASSES.expandable)
|
.addClass(CLASSES.expandable)
|
||||||
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
|
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
|
||||||
|
|
||||||
// handle open ones
|
// handle open ones
|
||||||
this.not(":has(>ul:hidden)")
|
this.not(":has(>ul:hidden)")
|
||||||
.addClass(CLASSES.collapsable)
|
.addClass(CLASSES.collapsable)
|
||||||
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
|
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
|
||||||
|
|
||||||
// create hitarea if not present
|
// create hitarea if not present
|
||||||
var hitarea = this.find("div." + CLASSES.hitarea);
|
var hitarea = this.find("div." + CLASSES.hitarea);
|
||||||
if (!hitarea.length)
|
if (!hitarea.length)
|
||||||
@ -94,23 +88,23 @@
|
|||||||
$(this).addClass( classes );
|
$(this).addClass( classes );
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply event to hitarea
|
// apply event to hitarea
|
||||||
this.find("div." + CLASSES.hitarea).click( toggler );
|
this.find("div." + CLASSES.hitarea).click( toggler );
|
||||||
},
|
},
|
||||||
treeview: function(settings) {
|
treeview: function(settings) {
|
||||||
|
|
||||||
settings = $.extend({
|
settings = $.extend({
|
||||||
cookieId: "treeview"
|
cookieId: "treeview"
|
||||||
}, settings);
|
}, settings);
|
||||||
|
|
||||||
if ( settings.toggle ) {
|
if ( settings.toggle ) {
|
||||||
var callback = settings.toggle;
|
var callback = settings.toggle;
|
||||||
settings.toggle = function() {
|
settings.toggle = function() {
|
||||||
return callback.apply($(this).parent()[0], arguments);
|
return callback.apply($(this).parent()[0], arguments);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// factory for treecontroller
|
// factory for treecontroller
|
||||||
function treeController(tree, control) {
|
function treeController(tree, control) {
|
||||||
// factory for click handlers
|
// factory for click handlers
|
||||||
@ -130,9 +124,9 @@
|
|||||||
// click on second to expand tree
|
// click on second to expand tree
|
||||||
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
|
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
|
||||||
// click on third to toggle tree
|
// click on third to toggle tree
|
||||||
$("a:eq(2)", control).click( handler() );
|
$("a:eq(2)", control).click( handler() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle toggle event
|
// handle toggle event
|
||||||
function toggler() {
|
function toggler() {
|
||||||
$(this)
|
$(this)
|
||||||
@ -164,7 +158,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.data("toggler", toggler);
|
this.data("toggler", toggler);
|
||||||
|
|
||||||
function serialize() {
|
function serialize() {
|
||||||
function binary(arg) {
|
function binary(arg) {
|
||||||
return arg ? 1 : 0;
|
return arg ? 1 : 0;
|
||||||
@ -175,7 +169,7 @@
|
|||||||
});
|
});
|
||||||
$.cookie(settings.cookieId, data.join(""), settings.cookieOptions );
|
$.cookie(settings.cookieId, data.join(""), settings.cookieOptions );
|
||||||
}
|
}
|
||||||
|
|
||||||
function deserialize() {
|
function deserialize() {
|
||||||
var stored = $.cookie(settings.cookieId);
|
var stored = $.cookie(settings.cookieId);
|
||||||
if ( stored ) {
|
if ( stored ) {
|
||||||
@ -185,13 +179,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add treeview class to activate styles
|
// add treeview class to activate styles
|
||||||
this.addClass("treeview");
|
this.addClass("treeview");
|
||||||
|
|
||||||
// prepare branches and find all tree items with child lists
|
// prepare branches and find all tree items with child lists
|
||||||
var branches = this.find("li").prepareBranches(settings);
|
var branches = this.find("li").prepareBranches(settings);
|
||||||
|
|
||||||
switch(settings.persist) {
|
switch(settings.persist) {
|
||||||
case "cookie":
|
case "cookie":
|
||||||
var toggleCallback = settings.toggle;
|
var toggleCallback = settings.toggle;
|
||||||
@ -205,7 +199,7 @@
|
|||||||
break;
|
break;
|
||||||
case "location":
|
case "location":
|
||||||
var current = this.find("a").filter(function() {
|
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 ) {
|
if ( current.length ) {
|
||||||
// TODO update the open/closed classes
|
// TODO update the open/closed classes
|
||||||
@ -222,19 +216,19 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
branches.applyClasses(settings, toggler);
|
branches.applyClasses(settings, toggler);
|
||||||
|
|
||||||
// if control option is set, create the treecontroller and show it
|
// if control option is set, create the treecontroller and show it
|
||||||
if ( settings.control ) {
|
if ( settings.control ) {
|
||||||
treeController(this, settings.control);
|
treeController(this, settings.control);
|
||||||
$(settings.control).show();
|
$(settings.control).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// classes used by the plugin
|
// classes used by the plugin
|
||||||
// need to be styled via external stylesheet, see first example
|
// need to be styled via external stylesheet, see first example
|
||||||
$.treeview = {};
|
$.treeview = {};
|
||||||
@ -252,5 +246,5 @@
|
|||||||
last: "last",
|
last: "last",
|
||||||
hitarea: "hitarea"
|
hitarea: "hitarea"
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|