$(selector).finder([options])$(selector).finder('select',URL || DOM or jQuery object || Array of URLs)$(selector).finder('current')$(selector).finder('refresh')Just some methods to test the queue. Create finder before using testing methods
Calls 'select' method 6 times at an interval of 500msCalls 'select' method for an array of URLs. Useful if you want to select an Item or Folder which is multiple levels down.
$('#finder').finder({
title : 'jQuery Finder v0.6a',
onRootReady: function(rootList,finderObj){
debug('Root ready',arguments)
},
onInit : function(finderObj) {
debug('Finder initialised',arguments)
$('.ui-finder-action-refresh').click(function() {
$('[name="refresh"]').click();
});
$('.ui-finder-action-open').click(function(){
$('[name="select"]').click();
});
$('.ui-finder-action-current').click(function(){
$('[name="getCurrent"]').click();
});
$('.ui-finder-action-destroy').click(function(){
$('[name="createFinder"]').click();
});
},
onItemSelect : function(listItem,eventTarget,finderObject){
var anchor = $('a',listItem),
href = anchor.attr('rel');
// Debug is a function specified in Finder script for debugging purposes
// Remove it if unnecessary
debug('onItemSelect - URL: ',href)
// By returning false, the url specified is not fetched
// ie. Do not display new column if selected item is not an image
if(href.indexOf('.jpg') == -1) {return false;}
},
onFolderSelect : function(listItem,eventTarget,finderObject){
var anchor = $('a',listItem),
href = anchor.attr('rel');
debug('onFolderSelect - URL: ',href)
},
onItemOpen : function(listItem,newColumn,finderObject){
var anchor = $('a',listItem),
href = anchor.attr('href');
debug('onItemOpen - Column source: ',newColumn.attr('data-finder-list-source'))
},
onFolderOpen : function(listItem,newColumn,finderObject){
var anchor = $('a',listItem),
href = anchor.attr('href');
debug('onFolderOpen - Column source: ',newColumn.attr('data-finder-list-source'))
},
toolbarActions : function() {
return '\
<div class="ui-finder-button ui-state-default ui-corner-left ui-finder-action-refresh" title="Refresh">\
<span class="ui-icon ui-icon-refresh"/>\
</div>\
<div class="ui-finder-button ui-state-default ui-finder-action-open" title="Open ..">\
>span class="ui-icon ui-icon-folder-open"/>\
</div>\
<div class="ui-finder-button ui-state-default ui-finder-action-current ui-corner-right" title="Get current">\
>span class="ui-icon ui-icon-help"/>\
</div>\
<div class="ui-finder-button ui-state-default ui-finder-action-destroy ui-corner-all" title="Destroy">\
>span class="ui-icon ui-icon-closethick"/>\
</div>\
';
}
});
This is an Alpha release. It is tested but not thoroughly. There may be bugs, but I haven't found them yet. There are some issues with Internet Explorer (see browser support below). This release is (still) only for testing purposes and proof-of-concept.
Version 0.7.0.1 is the latest stable release ready for public use. Get it from Google Code. Zip file includes all necessary scripts and styles.
You are more than welcome to contribute with bug reports, code, and general ideas/comments. Please post at jQuery group or e-mail me at rudas dot n at gmail dot com.
There's a minor bug in most browsers: Each column's width is not calculated properly and so either a long item will collapse to two lines (or more) the column will be cut off. I need some help on this one. Possible cause: some browsers don't take into consideration the width of the scrollbars when calculating widths (?)
Unless otherwise noted, the script looks and behaves correctly for the following browsers:
(This section needs update, see source of ui.finder.js for options)
StringStringFunctionFunctionFunctiononItemSelect returns false, default behaviour is ignored, i.e. the URL is not fetched, and the new level is not shown. onItemOpen is also not called.Functionanchor element (as opposed to the li element).Functionclass "folder" to your list element. Function is called when the user clicks on the list (li) element.Note: If onFolderSelect returns false, default behaviour is ignored, i.e. the URL is not fetched, and the new level is not shown.
Functionanchor element (as opposed to the li element)BooleanDefault: true
BooleanDefault: false
New column expands to fit available space.[optional]
When lists & file info already in dom. Display items several levels down.
Make public methods available via toolbar and/or menubar. (nearly there)
Search for specific items (coming next)