summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2008-07-14 20:54:58 +0000
committerMax Kremmel <xing@synapse.plus.com>2008-07-14 20:54:58 +0000
commit967a910151fdc61965731149e522bd4ea4b30e14 (patch)
tree6cf09d33c0aeada906e0bc40b0f748c9abadd1bf /scripts
parentc32cf8bd048948cabdb391e4e9fe9cf9e0d50f22 (diff)
downloadkernel-967a910151fdc61965731149e522bd4ea4b30e14.tar.gz
kernel-967a910151fdc61965731149e522bd4ea4b30e14.tar.bz2
kernel-967a910151fdc61965731149e522bd4ea4b30e14.zip
move ajax file browser to kernel and rename js file and class, make use of new js urls and add extensive usage instructions for ajax file browser.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/BitFileBrowser.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/BitFileBrowser.js b/scripts/BitFileBrowser.js
new file mode 100644
index 0000000..043e319
--- /dev/null
+++ b/scripts/BitFileBrowser.js
@@ -0,0 +1,37 @@
+// We use Mochikit library for AJAX
+BitFileBrowser = {
+ "url": BitSystem.urls.kernel+"ajax_file_browser_inc.php",
+
+ "load": function( configName ) {
+ if( configName ) {
+ BitAjax.showSpinner();
+ doSimpleXMLHttpRequest( this.url, merge( {ajax_path_conf:configName} )).addCallback( this.browseCallback, "ajax_load" );
+ $( "ajax_load_title" ).innerHTML = '';
+ BitAjax.hideSpinner();
+ }
+ },
+
+ "browse": function( relPath, state, configName ) {
+ if( relPath ) {
+ BitAjax.showSpinner();
+ if( state == 'close' ) {
+ $( relPath ).title = "open";
+ $( relPath+"-bitInsert" ).innerHTML = '';
+ if( $( "image-"+relPath )) {
+ $( "image-"+relPath ).src = BitSystem.urls.iconstyle+"small/folder.png";
+ }
+ } else {
+ $(relPath).title = "close";
+ if( $( "image-"+relPath )) {
+ $( "image-"+relPath ).src = BitSystem.urls.iconstyle+"small/folder-open.png";
+ }
+ doSimpleXMLHttpRequest( this.url, merge( {relpath:relPath,ajax_path_conf:configName} )).addCallback( this.browseCallback, relPath+"-bitInsert" );
+ }
+ BitAjax.hideSpinner();
+ }
+ },
+
+ "browseCallback": function( insertID, result ) {
+ $( insertID ).innerHTML = result.responseText;
+ }
+}