-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item15325: upgrade jQuery treeview to version 1.4.2
... and add a custom foswiki theme
- Loading branch information
1 parent
2848dbb
commit 5cdfdb3
Showing
10 changed files
with
270 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 12 additions & 6 deletions
18
JQueryPlugin/pub/System/JQueryPlugin/plugins/treeview/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
TARGET=\ | ||
jquery.treeview.js \ | ||
jquery.treeview.async.js \ | ||
jquery.treeview.init.js \ | ||
jquery.treeview.css \ | ||
$(JQUERYPLUGIN_LIB)/TREEVIEW.pm | ||
TARGET=treeview.js treeview.css jquery.treeview.async.js | ||
|
||
-include ../../Makefile.include | ||
|
||
clean: | ||
rm -f $(TARGET) *.gz | ||
|
||
treeview.css: jquery.treeview.uncompressed.css foswiki.uncompressed.css | ||
@echo "generating $@" | ||
@cat $^ | $(CSSMIN) $(CSSMIN_ARGS)> $@ | ||
|
||
treeview.js: jquery.treeview.js jquery.treeview.async.js jquery.treeview.init.js | ||
@echo "generating $@" | ||
@$(JSMIN) $^ > $@ |
53 changes: 53 additions & 0 deletions
53
JQueryPlugin/pub/System/JQueryPlugin/plugins/treeview/foswiki.uncompressed.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* foswiki customizations */ | ||
.jqTreeview { | ||
display:none; /* activated using js */ | ||
} | ||
.jqTreeview.red li { background-image: url(images/treeview-red-line.gif) !important; } | ||
.jqTreeview.red .hitarea, | ||
.jqTreeview.red li.lastCollapsable, | ||
.jqTreeview.red li.lastExpandable { background-image: url(images/treeview-red.gif) !important; } | ||
|
||
.jqTreeview.black li { background-image: url(images/treeview-black-line.gif) !important; } | ||
.jqTreeview.black .hitarea, | ||
.jqTreeview.black li.lastCollapsable, | ||
.jqTreeview.black li.lastExpandable { background-image: url(images/treeview-black.gif) !important; } | ||
|
||
.jqTreeview.gray li { background-image: url(images/treeview-gray-line.gif) !important; } | ||
.jqTreeview.gray .hitarea, | ||
.jqTreeview.gray li.lastCollapsable, | ||
.jqTreeview.gray li.lastExpandable { background-image: url(images/treeview-gray.gif) !important; } | ||
|
||
.jqTreeview.famfamfam li { background-image: url(images/treeview-famfamfam-line.gif) !important; } | ||
.jqTreeview.famfamfam .hitarea, | ||
.jqTreeview.famfamfam li.lastCollapsable, | ||
.jqTreeview.famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif) !important; } | ||
|
||
.jqTreeview.orangearrows li { background-image: url(images/treeview-famfamfam-line.gif) !important; } | ||
.jqTreeview.orangearrows .hitarea, | ||
.jqTreeview.orangearrows li.lastCollapsable, | ||
.jqTreeview.orangearrows li.lastExpandable { background-image: url(images/treeview-orangearrows.gif) !important; } | ||
|
||
.jqTreeview.grayarrows li { background-image: url(images/treeview-famfamfam-line.gif) !important; } | ||
.jqTreeview.grayarrows .hitarea, | ||
.jqTreeview.grayarrows li.lastCollapsable, | ||
.jqTreeview.grayarrows li.lastExpandable { background-image: url(images/treeview-orangearrows.gif) !important; } | ||
|
||
.jqAjaxLoader, | ||
.treeview .placeholder { | ||
background: url(../../images/spinner.gif) 0 0 no-repeat; | ||
height: 16px; | ||
width: 16px; | ||
display: block; | ||
} | ||
.treeview .open .placeholder { | ||
display:none; | ||
} | ||
.treeview .open .closed .placeholder { | ||
display:block; | ||
} | ||
@media print { | ||
.jqTreeview { | ||
display:block; | ||
} | ||
} | ||
|
198 changes: 108 additions & 90 deletions
198
JQueryPlugin/pub/System/JQueryPlugin/plugins/treeview/jquery.treeview.async.uncompressed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,108 @@ | ||
/* | ||
* 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) { | ||
function responseHandler(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"); | ||
} else { | ||
current.addClass("closed"); | ||
} | ||
if (this.hasChildren || this.children && this.children.length) { | ||
var branch = $("<ul/>").appendTo(current); | ||
if (this.hasChildren) { | ||
current.addClass("hasChildren"); | ||
createNode.call({ | ||
classes: "placeholder", | ||
text: " ", | ||
children:[] | ||
}, branch); | ||
} | ||
if (this.children && this.children.length) { | ||
$.each(this.children, createNode, [branch]) | ||
} | ||
} | ||
} | ||
child.empty(); | ||
$.each(response, createNode, [child]); | ||
$(container).treeview({add: child}); | ||
} | ||
|
||
if (settings.data === undefined) { | ||
$.getJSON(settings.url, {root: root}, responseHandler); | ||
} else { | ||
var postData = $.extend({ | ||
root: root | ||
}, settings.data); | ||
$.ajax({ | ||
url:settings.url, | ||
dataType: 'json', | ||
type: 'POST', | ||
data: postData, | ||
success: responseHandler | ||
}); | ||
} | ||
} | ||
|
||
var proxied = $.fn.treeview; | ||
$.fn.treeview = function(settings) { | ||
if (!settings.url) { | ||
return proxied.apply(this, arguments); | ||
} | ||
var container = this; | ||
if (!container.children().size()) | ||
load(settings, settings.root ||"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"); | ||
load(settings, this.id, childList, container); | ||
} | ||
if (userToggle) { | ||
userToggle.apply(this, arguments); | ||
} | ||
} | ||
})); | ||
}; | ||
|
||
})(jQuery); | ||
/* | ||
* Async Treeview 0.1 - Lazy-loading extension for Treeview | ||
* | ||
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ | ||
* | ||
* Copyright Jörn Zaefferer | ||
* Released under the MIT license: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
*/ | ||
|
||
;(function($) { | ||
|
||
function load(settings, root, child, container) { | ||
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({ | ||
classes: "placeholder", | ||
text: " ", | ||
children:[] | ||
}, branch); | ||
} | ||
if (this.children && this.children.length) { | ||
$.each(this.children, createNode, [branch]) | ||
} | ||
} | ||
} | ||
$.ajax($.extend(true, { | ||
url: settings.url, | ||
dataType: "json", | ||
data: { | ||
root: root | ||
}, | ||
success: function(response) { | ||
child.empty(); | ||
$.each(response, createNode, [child]); | ||
$(container).treeview({add: child}); | ||
} | ||
}, settings.ajax)); | ||
/* | ||
$.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({ | ||
classes: "placeholder", | ||
text: " ", | ||
children:[] | ||
}, branch); | ||
} | ||
if (this.children && this.children.length) { | ||
$.each(this.children, createNode, [branch]) | ||
} | ||
} | ||
} | ||
child.empty(); | ||
$.each(response, createNode, [child]); | ||
$(container).treeview({add: child}); | ||
}); | ||
*/ | ||
} | ||
|
||
var proxied = $.fn.treeview; | ||
$.fn.treeview = function(settings) { | ||
if (!settings.url) { | ||
return proxied.apply(this, arguments); | ||
} | ||
if (!settings.root) { | ||
settings.root = "source"; | ||
} | ||
var container = this; | ||
if (!container.children().size()) | ||
load(settings, settings.root, 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"); | ||
load(settings, this.id, childList, container); | ||
} | ||
if (userToggle) { | ||
userToggle.apply(this, arguments); | ||
} | ||
} | ||
})); | ||
}; | ||
|
||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.