summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2018-07-13 15:20:36 (GMT)
committerTobias Markmann <tm@ayena.de>2018-09-26 14:05:36 (GMT)
commit1536284a15743f6ec41d3230177a24d245158a9d (patch)
tree21216d18d93ddfc620e6b36dc28428c5d5b71775 /3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js
parent091f6e520694360a0407ab0cf3bb036fb461e6e3 (diff)
downloadswift-1536284a15743f6ec41d3230177a24d245158a9d.zip
swift-1536284a15743f6ec41d3230177a24d245158a9d.tar.bz2
Update SCons in 3rdParty from 2.4.0 to 3.0.1
This also has our scons patch in 3rdParty/SCons applied. Test-Information: Builds with unit tests on macOS 10.13.6. Change-Id: I25d3662eeec27a76dab10d501ba46dc16f0bef4b
Diffstat (limited to '3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js')
-rw-r--r--3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js
new file mode 100644
index 0000000..2597dde
--- /dev/null
+++ b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.js
@@ -0,0 +1,72 @@
+/*
+ * Async Treeview 0.1 - Lazy-loading extension for Treeview
+ *
+ * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
+ *
+ * Copyright (c) 2007 Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ *
+ */
+
+;(function($) {
+
+function load(settings, root, child, container) {
+ $.getJSON(settings.url, {root: root}, function(response) {
+ function createNode(parent) {
+ var current = $("<li/>").attr("id", this.id || "").html("<span>" + this.text + "</span>").appendTo(parent);
+ if (this.classes) {
+ current.children("span").addClass(this.classes);
+ }
+ if (this.expanded) {
+ current.addClass("open");
+ }
+ if (this.hasChildren || this.children && this.children.length) {
+ var branch = $("<ul/>").appendTo(current);
+ if (this.hasChildren) {
+ current.addClass("hasChildren");
+ createNode.call({
+ text:"placeholder",
+ id:"placeholder",
+ children:[]
+ }, branch);
+ }
+ if (this.children && this.children.length) {
+ $.each(this.children, createNode, [branch])
+ }
+ }
+ }
+ $.each(response, createNode, [child]);
+ $(container).treeview({add: child});
+ });
+}
+
+var proxied = $.fn.treeview;
+$.fn.treeview = function(settings) {
+ if (!settings.url) {
+ return proxied.apply(this, arguments);
+ }
+ var container = this;
+ load(settings, "source", this, container);
+ var userToggle = settings.toggle;
+ return proxied.call(this, $.extend({}, settings, {
+ collapsed: true,
+ toggle: function() {
+ var $this = $(this);
+ if ($this.hasClass("hasChildren")) {
+ var childList = $this.removeClass("hasChildren").find("ul");
+ childList.empty();
+ load(settings, this.id, childList, container);
+ }
+ if (userToggle) {
+ userToggle.apply(this, arguments);
+ }
+ }
+ }));
+};
+
+})(jQuery); \ No newline at end of file