git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5519 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
a2b336dfe7
commit
92d77c3bef
@ -0,0 +1,9 @@
|
|||||||
|
[
|
||||||
|
#{folders}#{
|
||||||
|
"text": "#[foldername]#",
|
||||||
|
"expanded": #[expanded]#,
|
||||||
|
"classes": "#[classes]#",
|
||||||
|
"id": "#[hash]#",
|
||||||
|
"hasChildren": #[hasChildren]#
|
||||||
|
}#[comma]##{/folders}#
|
||||||
|
]
|
@ -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);
|
@ -1,125 +0,0 @@
|
|||||||
<script type="text/javascript">
|
|
||||||
//<![CDATA[
|
|
||||||
$(document).ready(function() {
|
|
||||||
/* Init Sidebar_2 */
|
|
||||||
$("#side2").accordion({
|
|
||||||
autoHeight: false,
|
|
||||||
clearStyle: true,
|
|
||||||
header: "h3"
|
|
||||||
});
|
|
||||||
$("#side2").accordion("activate", 1);
|
|
||||||
/* Load Folders */
|
|
||||||
loadFolders();
|
|
||||||
/* experiemntal: only works with first folder level */
|
|
||||||
$("span.folder").click(function() {
|
|
||||||
qtag = "/"+$(this).text();
|
|
||||||
if (tabid == "#Bookmarks") {
|
|
||||||
$tabs.tabs("load", 3);
|
|
||||||
} else {
|
|
||||||
$tabs.tabs('select',3);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/* Load TagCloud */
|
|
||||||
loadTagCloud();
|
|
||||||
});
|
|
||||||
function loadFolders() {
|
|
||||||
$("#yfolder *").remove();
|
|
||||||
$("#yfolder").getTransform('xsl/xbel2folder-ul.xsl','/api/bookmarks/xbel/xbel.xml');
|
|
||||||
$("#yfolder").treeview({
|
|
||||||
collapsed: true,
|
|
||||||
unique: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function loadTagCloud() {
|
|
||||||
$("#tagcloud *").remove();
|
|
||||||
$("#sidebar-2-1").toggleClass("loading");
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: "/api/bookmarks/tags/getTag.xml?top=25&sort=alpha",
|
|
||||||
dataType: "xml",
|
|
||||||
cache: false,
|
|
||||||
success: function(xml) {
|
|
||||||
$(xml).find('tag').each(function(){
|
|
||||||
var count = $(this).attr('count');
|
|
||||||
var tag = $(this).attr('tag');
|
|
||||||
var size = ((count/20)+0.3);
|
|
||||||
if (size < 1) {size = 1;}
|
|
||||||
$('<a style="font-size:'+size+'em"></a>')
|
|
||||||
.html(HTMLenc(tag)+' ')
|
|
||||||
.appendTo('#tagcloud')
|
|
||||||
.bind('click', function() {
|
|
||||||
qtag = $(this).text();
|
|
||||||
$("select[@name='resource']").setValue('ymarks');
|
|
||||||
$("input[@name='search']").setValue(qtag);
|
|
||||||
if (tabid == "#Bookmarks") {
|
|
||||||
$tabs.tabs("load", 3);
|
|
||||||
} else {
|
|
||||||
$tabs.tabs('select',3);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}); //close each(
|
|
||||||
$("#sidebar-2-1").toggleClass("loading");
|
|
||||||
}
|
|
||||||
}); //close $.ajax(
|
|
||||||
}
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- 0 -->
|
|
||||||
<h3>Search Options</h3>
|
|
||||||
<div class="yform">
|
|
||||||
<form id="yoptions" class="small" method="get" action="" accept-charset="UTF-8">
|
|
||||||
<p>
|
|
||||||
<label for="itemsPerPage">Items per page: </label>
|
|
||||||
<br />
|
|
||||||
<select class="selector" name="itemsPerPage">
|
|
||||||
<option selected="selected" value="10">10</option>
|
|
||||||
<option value="15">15</option>
|
|
||||||
<option value="25">25</option>
|
|
||||||
<option value="50">50</option>
|
|
||||||
</select>
|
|
||||||
<br />
|
|
||||||
<label for="constraint">Constraint:</label>
|
|
||||||
<br />
|
|
||||||
<select class="selector" id="constraint" name="constraint">
|
|
||||||
<option value="" selected="selected">all pages</option>
|
|
||||||
<option value="AQAAAA" >index pages</option>
|
|
||||||
</select>
|
|
||||||
<br />
|
|
||||||
<label for="urlmaskfilter">URL mask:</label>
|
|
||||||
<br />
|
|
||||||
<input class="filter" name="urlmaskfilter" value=".*" type="text" size="12" maxlength="80" />
|
|
||||||
<img src="img-2/question_blue.png" class="help" alt="help" title="help" />
|
|
||||||
<br />
|
|
||||||
<label for="prefermaskfilter">Prefer mask:</label>
|
|
||||||
<br />
|
|
||||||
<input class="filter" name="prefermaskfilter" value="" type="text" size="12" maxlength="80" />
|
|
||||||
<img src="img-2/question_blue.png" class="help" alt="help" title="help" />
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 1 -->
|
|
||||||
<h3 id="tagcloud-h3">Bookmark TagCloud
|
|
||||||
<span id="sidebar-2-1"></span>
|
|
||||||
</h3>
|
|
||||||
<div class="menu">
|
|
||||||
<p id="tagcloud"></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 2 -->
|
|
||||||
<h3>Bookmark Folders
|
|
||||||
<span id="sidebar-2-2"></span>
|
|
||||||
</h3>
|
|
||||||
<div class="menu">
|
|
||||||
<ul class="filetree" id="yfolder"></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue