Page MenuHomePhorge

No OneTemporary

Size
81 KB
Referenced Files
None
Subscribers
None
diff --git a/lib/client/file_ui_main.php b/lib/client/file_ui_main.php
index 42b27f8..6483914 100644
--- a/lib/client/file_ui_main.php
+++ b/lib/client/file_ui_main.php
@@ -1,165 +1,166 @@
<?php
/*
+--------------------------------------------------------------------------+
| This file is part of the Kolab File API |
| |
| Copyright (C) 2011-2013, Kolab Systems AG |
| |
| This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU Affero General Public License as published |
| by the Free Software Foundation, either version 3 of the License, or |
| (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public License |
| along with this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
class file_ui_main extends file_ui
{
public function action_default()
{
// assign default set of translations
$this->output->add_translation('saving', 'deleting', 'search', 'search.loading',
- 'collection.audio', 'collection.video', 'collection.image', 'collection.document'
+ 'collection.audio', 'collection.video', 'collection.image', 'collection.document',
+ 'moving', 'copying'
);
$this->output->set_env('search_threads', $this->config->get('files_search_threads'));
$this->ui_init();
}
public function folder_create_form()
{
$input_name = new html_inputfield(array(
'type' => 'text',
'name' => 'name',
'value' => '',
));
$input_parent = new html_checkbox(array(
'name' => 'parent',
'value' => '1',
'id' => 'folder-parent-checkbox',
));
$submit = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.folder_create_submit()',
'value' => $this->translate('form.submit'),
));
$cancel = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.folder_create_stop()',
'value' => $this->translate('form.cancel'),
));
$table = new html_table;
$table->add(null, $input_name->show() . $input_parent->show()
. html::label('folder-parent-checkbox', $this->translate('folder.under')));
$table->add('buttons', $submit->show() . $cancel->show());
$content = html::tag('fieldset', null,
html::tag('legend', null,
$this->translate('folder.createtitle')) . $table->show());
$form = html::tag('form', array(
'id' => 'folder-create-form',
'onsubmit' => 'ui.folder_create_submit(); return false'),
$content);
return $form;
}
public function folder_edit_form()
{
$input_name = new html_inputfield(array(
'type' => 'text',
'name' => 'name',
'value' => '',
));
$submit = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.folder_edit_submit()',
'value' => $this->translate('form.submit'),
));
$cancel = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.folder_edit_stop()',
'value' => $this->translate('form.cancel'),
));
$table = new html_table;
$table->add(null, $input_name->show());
$table->add('buttons', $submit->show() . $cancel->show());
$content = html::tag('fieldset', null,
html::tag('legend', null,
$this->translate('folder.edittitle')) . $table->show());
$form = html::tag('form', array(
'id' => 'folder-edit-form',
'onsubmit' => 'ui.folder_edit_submit(); return false'),
$content);
return $form;
}
public function file_search_form()
{
$input_name = new html_inputfield(array(
'type' => 'text',
'name' => 'name',
'value' => '',
));
$input_in1 = new html_inputfield(array(
'type' => 'radio',
'name' => 'all_folders',
'value' => '0',
'id' => 'all-folders-radio1',
));
$input_in2 = new html_inputfield(array(
'type' => 'radio',
'name' => 'all_folders',
'value' => '1',
'id' => 'all-folders-radio2',
));
$submit = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.file_search_submit()',
'value' => $this->translate('form.submit'),
));
$cancel = new html_inputfield(array(
'type' => 'button',
'onclick' => 'ui.file.search_stop()',
'value' => $this->translate('form.cancel'),
));
$table = new html_table;
$table->add(null, $input_name->show()
. $input_in1->show() . html::label('all-folders-radio1', $this->translate('search.in_current_folder'))
. $input_in2->show() . html::label('all-folders-radio2', $this->translate('search.in_all_folders'))
);
$table->add('buttons', $submit->show() . $cancel->show());
$content = html::tag('fieldset', null,
html::tag('legend', null,
$this->translate('file.search')) . $table->show());
$form = html::tag('form', array(
'id' => 'file-search-form',
'onsubmit' => 'ui.file_search_submit(); return false'),
$content);
return $form;
}
}
diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index 63fc7eb..02f6d71 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -1,58 +1,62 @@
<?php
$LANG['about.community'] = 'This is the Community Edition of the <b>Kolab Server</b>.';
$LANG['about.warranty'] = 'Professional support is available from <a href="http://kolabsys.com">Kolab Systems</a>.';
$LANG['about.support'] = 'It comes with absolutely <b>no warranties</b> and is typically run entirely self supported. You can find help &amp; information on the community <a href="http://kolab.org">web site</a> &amp; <a href="http://wiki.kolab.org">wiki</a>.';
$LANG['collection.audio'] = 'Audio';
$LANG['collection.video'] = 'Video';
$LANG['collection.image'] = 'Images';
$LANG['collection.document'] = 'Documents';
+$LANG['file.copy'] = 'Copy';
$LANG['file.create'] = 'Create File';
$LANG['file.download'] = 'Download';
$LANG['file.edit'] = 'Edit';
$LANG['file.upload'] = 'Upload File';
$LANG['file.name'] = 'Name';
+$LANG['file.move'] = 'Move';
$LANG['file.mtime'] = 'Modified';
$LANG['file.size'] = 'Size';
$LANG['file.open'] = 'Open';
$LANG['file.delete'] = 'Delete';
$LANG['file.rename'] = 'Rename';
$LANG['file.search'] = 'Search file';
$LANG['file.type'] = 'Type';
$LANG['folder.createtitle'] = 'Create Folder';
$LANG['folder.delete'] = 'Delete';
$LANG['folder.edit'] = 'Edit';
$LANG['folder.edittitle'] = 'Edit Folder';
$LANG['folder.under'] = 'under current folder';
$LANG['form.submit'] = 'Submit';
$LANG['form.cancel'] = 'Cancel';
$LANG['login.username'] = 'Username';
$LANG['login.password'] = 'Password';
$LANG['login.login'] = 'Log in';
$LANG['reqtime'] = 'Request time: $1 sec.';
$LANG['maxupload'] = 'Maximum file size: $1';
$LANG['internalerror'] = 'Internal system error!';
$LANG['loginerror'] = 'Incorrect username or password!';
$LANG['loading'] = 'Loading...';
$LANG['saving'] = 'Saving...';
$LANG['deleting'] = 'Deleting...';
+$LANG['copying'] = 'Copying...';
+$LANG['moving'] = 'Moving...';
$LANG['logout'] = 'Logout';
$LANG['close'] = 'Close';
$LANG['servererror'] = 'Server Error!';
$LANG['session.expired'] = 'Session has expired. Login again, please';
$LANG['search'] = 'Search';
$LANG['search.loading'] = 'Searching...';
$LANG['search.in_all_folders'] = 'in all folders';
$LANG['search.in_current_folder'] = 'in current folder';
$LANG['size.B'] = 'B';
$LANG['size.KB'] = 'KB';
$LANG['size.MB'] = 'MB';
$LANG['size.GB'] = 'GB';
diff --git a/public_html/js/files_ui.js b/public_html/js/files_ui.js
index 1597f8f..491db37 100644
--- a/public_html/js/files_ui.js
+++ b/public_html/js/files_ui.js
@@ -1,1251 +1,1489 @@
/*
+--------------------------------------------------------------------------+
| This file is part of the Kolab File API |
| |
| Copyright (C) 2012-2013, Kolab Systems AG |
| |
| This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU Affero General Public License as published |
| by the Free Software Foundation, either version 3 of the License, or |
| (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public License |
| along with this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
function files_ui()
{
var ref = this;
this.request_timeout = 300;
this.message_time = 3000;
this.events = {};
this.commands = {};
+ this.ie = document.all && !window.opera;
this.env = {
url: 'api/',
sort_col: 'name',
sort_reverse: 0,
search_threads: 1,
directory_separator: '/'
};
// set jQuery ajax options
$.ajaxSetup({
cache: false,
error: function(request, status, err) { ref.http_error(request, status, err); },
beforeSend: function(xmlhttp) { xmlhttp.setRequestHeader('X-Session-Token', ref.env.token); }
});
/*********************************************************/
/********* basic utilities *********/
/*********************************************************/
// initialize interface
this.init = function()
{
if (!this.env.token)
return;
if (this.env.task == 'main') {
this.enable_command('folder.list', 'folder.create', 'file.search', true);
this.command('folder.list');
}
else if (this.env.task == 'file') {
this.load_file('#file-content', this.env.filedata);
this.enable_command('file.delete', 'file.download', true);
}
this.browser_capabilities_check();
};
// set environment variable(s)
this.set_env = function(p, value)
{
if (p != null && typeof p === 'object' && !value)
for (var n in p)
this.env[n] = p[n];
else
this.env[p] = value;
};
// execute a specific command on the web client
this.command = function(command, props, obj)
{
if (obj && obj.blur)
obj.blur();
if (this.busy)
return false;
if (!this.commands[command])
return;
var ret = undefined,
func = command.replace(/[^a-z]/g, '_'),
task = command.replace(/\.[a-z-_]+$/g, '');
if (this[func] && typeof this[func] === 'function') {
ret = this[func](props);
}
return ret === false ? false : obj ? false : true;
};
this.set_busy = function(a, message)
{
if (a && this.busy)
return;
if (a && message) {
var msg = this.t(message);
if (msg == message)
msg = 'Loading...';
this.display_message(msg, 'loading');
}
else if (!a) {
this.hide_message('loading');
}
this.busy = a;
// if (this.gui_objects.editform)
// this.lock_form(this.gui_objects.editform, a);
// clear pending timer
if (this.request_timer)
clearTimeout(this.request_timer);
// set timer for requests
if (a && this.request_timeout)
this.request_timer = window.setTimeout(function() { ref.request_timed_out(); }, this.request_timeout * 1000);
};
// called when a request timed out
this.request_timed_out = function()
{
this.set_busy(false);
this.display_message('Request timed out!', 'error');
};
// Add variable to GET string, replace old value if exists
this.add_url = function(url, name, value)
{
value = urlencode(value);
if (/(\?.*)$/.test(url)) {
var urldata = RegExp.$1,
datax = RegExp('((\\?|&)'+RegExp.escape(name)+'=[^&]*)');
if (datax.test(urldata))
urldata = urldata.replace(datax, RegExp.$2 + name + '=' + value);
else
urldata += '&' + name + '=' + value
return url.replace(/(\?.*)$/, urldata);
}
return url + '?' + name + '=' + value;
};
this.trigger_event = function(event, data)
{
if (this.events[event])
for (var i in this.events[event])
this.events[event][i](data);
};
this.add_event_listener = function(event, func)
{
if (!this.events[event])
this.events[event] = [];
this.events[event].push(func);
};
this.buttons = function(p)
{
$.each(p, function(i, v) {
if (!ui.buttons[i])
ui.buttons[i] = [];
if (typeof v == 'object')
ui.buttons[i] = $.merge(ui.buttons[i], v);
else
ui.buttons[i].push(v);
});
};
this.enable_command = function()
{
var i, n, args = Array.prototype.slice.call(arguments),
enable = args.pop(), cmd;
for (n=0; n<args.length; n++) {
cmd = args[n];
// argument of type array
if (typeof cmd === 'string') {
this.commands[cmd] = enable;
if (this.buttons[cmd])
$.each(this.buttons[cmd], function (i, button) {
$('#'+button)[enable ? 'removeClass' : 'addClass']('disabled');
});
}
// push array elements into commands array
else {
for (i in cmd)
args.push(cmd[i]);
}
}
};
/*********************************************************/
/********* GUI functionality *********/
/*********************************************************/
// write to the document/window title
this.set_pagetitle = function(title)
{
if (title && document.title)
document.title = title;
};
// display a system message (types: loading, notice, error)
this.display_message = function(msg, type, timeout)
{
var obj, ref = this;
if (!type)
type = 'notice';
if (msg)
msg = this.t(msg);
if (type == 'loading') {
timeout = this.request_timeout * 1000;
if (!msg)
msg = this.t('loading');
}
else if (!timeout)
timeout = this.message_time * (type == 'error' || type == 'warning' ? 2 : 1);
obj = $('<div>');
if (type != 'loading') {
msg = '<div><span>' + msg + '</span></div>';
obj.addClass(type).click(function() { return ref.hide_message(); });
}
if (timeout > 0)
window.setTimeout(function() { ref.hide_message(type, type != 'loading'); }, timeout);
obj.attr('id', type == 'loading' ? 'loading' : 'message')
.appendTo('body').html(msg).show();
};
// make a message to disapear
this.hide_message = function(type, fade)
{
if (type == 'loading')
$('#loading').remove();
else
$('#message').fadeOut('normal', function() { $(this).remove(); });
};
this.set_watermark = function(id)
{
if (this.env.watermark)
$('#'+id).html(this.env.watermark);
};
/********************************************************/
/********* Remote request methods *********/
/********************************************************/
// send a http POST request to the server
this.http_post = function(action, postdata)
{
var url = this.url(action);
if (postdata && typeof postdata === 'object')
postdata.remote = 1;
else {
if (!postdata)
postdata = '';
postdata += '&remote=1';
}
this.set_request_time();
return $.ajax({
type: 'POST', url: url, data: postdata, dataType: 'json',
success: function(response) { ui.http_response(response); },
error: function(o, status, err) { ui.http_error(o, status, err); }
});
};
// handle HTTP response
this.http_response = function(response)
{
var i;
if (!response)
return;
// set env vars
if (response.env)
this.set_env(response.env);
// we have translation labels to add
if (typeof response.labels === 'object')
this.tdef(response.labels);
// HTML page elements
if (response.objects)
for (i in response.objects)
$('#'+i).html(response.objects[i]);
this.update_request_time();
this.set_busy(false);
// if we get javascript code from server -> execute it
if (response.exec)
eval(response.exec);
this.trigger_event('http-response', response);
};
// handle HTTP request errors
this.http_error = function(request, status, err)
{
var errmsg = request.statusText;
this.set_busy(false);
request.abort();
if (request.status && errmsg)
this.display_message(this.t('servererror') + ' (' + errmsg + ')', 'error');
};
/********************************************************/
/********* Helper methods *********/
/********************************************************/
// disable/enable all fields of a form
this.lock_form = function(form, lock)
{
if (!form || !form.elements)
return;
var n, len, elm;
if (lock)
this.disabled_form_elements = [];
for (n=0, len=form.elements.length; n<len; n++) {
elm = form.elements[n];
if (elm.type == 'hidden')
continue;
// remember which elem was disabled before lock
if (lock && elm.disabled)
this.disabled_form_elements.push(elm);
// check this.disabled_form_elements before inArray() as a workaround for FF5 bug
// http://bugs.jquery.com/ticket/9873
else if (lock || (this.disabled_form_elements && $.inArray(elm, this.disabled_form_elements)<0))
elm.disabled = lock;
}
};
this.set_request_time = function()
{
this.env.request_time = (new Date()).getTime();
};
// Update request time element
this.update_request_time = function()
{
if (this.env.request_time) {
var t = ((new Date()).getTime() - this.env.request_time)/1000,
el = $('#reqtime');
el.text(el.text().replace(/[0-9.,]+/, t));
}
};
// position and display popup
this.popup_show = function(e, popup)
{
var popup = $(popup),
pos = this.mouse_pos(e),
win = $(window),
w = popup.width(),
h = popup.height(),
- left = pos.left - w,
- top = pos.top;
+ left = pos.left - w + 20,
+ top = pos.top - 10;
if (top + h > win.height())
top -= h;
if (left + w > win.width())
left -= w;
popup.css({left: left + 'px', top: top + 'px'})
.click(function(e) { e.stopPropagation(); $(this).hide(); }).show();
e.stopPropagation();
};
// Return absolute mouse position of an event
this.mouse_pos = function(e)
{
if (!e) e = window.event;
- var mX = (e.pageX) ? e.pageX : e.clientX,
- mY = (e.pageY) ? e.pageY : e.clientY;
+ var mX = e.pageX ? e.pageX : e.clientX,
+ mY = e.pageY ? e.pageY : e.clientY;
if (document.body && document.all) {
mX += document.body.scrollLeft;
mY += document.body.scrollTop;
}
if (e._offset) {
mX += e._offset.left;
mY += e._offset.top;
}
- return { left:mX, top:mY };
+ return {left:mX, top:mY};
};
this.serialize_form = function(id)
{
var i, v, json = {},
form = $(id),
query = form.serializeArray();
for (i in query)
json[query[i].name] = query[i].value;
// serializeArray() doesn't work properly for multi-select
$('select[multiple="multiple"]', form).each(function() {
var name = this.name;
json[name] = [];
$(':selected', this).each(function() {
json[name].push(this.value);
});
});
return json;
};
/*********************************************************/
- /********* Commands *********/
+ /********* Commands and response handlers *********/
/*********************************************************/
this.logout = function()
{
this.main_logout();
};
this.main_logout = function(params)
{
location.href = '?task=main&action=logout' + (params ? '&' + $.param(params) : '');
return false;
};
// folder list request
this.folder_list = function()
{
this.set_busy(true, 'loading');
this.get('folder_list', {}, 'folder_list_response');
};
// folder list response handler
this.folder_list_response = function(response)
{
if (!this.response(response))
return;
var elem = $('#folderlist'), table = $('table', elem);
this.env.folders = this.folder_list_parse(response.result);
table.empty();
$.each(this.env.folders, function(i, f) {
- var row = $('<tr><td><span class="branch"></span><span class="name"></span></td></tr>'),
- span = $('span.name', row);
-
- span.text(f.name);
- row.attr('id', f.id);
-
- if (f.depth)
- $('span.branch', row).width(15 * f.depth);
-
- if (f.virtual)
- row.addClass('virtual');
- else
- span.click(function() { ui.folder_select(i); });
-
- if (i == ui.env.folder)
- row.addClass('selected');
-
+ var row = ui.folder_list_row(i, f);
table.append(row);
});
// add virtual collections
$.each(['audio', 'video', 'image', 'document'], function(i, n) {
var row = $('<tr><td><span class="name"></span></td></tr>'),
span = $('span.name', row);
row.attr('id', 'folder-collection-' + n);
span.text(ui.t('collection.' + n))
.click(function() { ui.folder_select(n, true); });
if (n == ui.env.collection)
row.addClass('selected');
table.append(row);
});
// add tree icons
this.folder_list_tree(this.env.folders);
};
this.folder_select = function(folder, is_collection)
{
this.env.search = null;
this.file_search_stop();
var list = $('#folderlist');
$('tr.selected', list).removeClass('selected');
if (is_collection) {
var found = $('#folder-collection-' + folder, list).addClass('selected');
this.env.folder = null;
this.enable_command('file.list', true);
this.enable_command('folder.delete', 'folder.edit', 'file.upload', false);
this.command('file.list', {collection: folder});
}
else {
var found = $('#' + this.env.folders[folder].id, list).addClass('selected');
this.env.collection = null;
this.enable_command('file.list', 'folder.delete', 'folder.edit', 'file.upload', found.length);
this.command('file.list', {folder: folder});
}
};
this.folder_unselect = function()
{
this.env.search = null;
this.env.folder = null;
this.env.collection = null;
this.file_search_stop();
var list = $('#folderlist');
$('tr.selected', list).removeClass('selected');
this.enable_command('file.list', 'folder.delete', 'folder.edit', 'file.upload', false);
};
// folder create request
this.folder_create = function(folder)
{
if (!folder) {
this.folder_create_start();
return;
}
this.set_busy(true, 'saving');
this.get('folder_create', {folder: folder}, 'folder_create_response');
};
// folder create response handler
this.folder_create_response = function(response)
{
if (!this.response(response))
return;
this.folder_list();
};
// folder edit (rename) request
this.folder_edit = function(folder)
{
if (!folder) {
this.folder_edit_start();
return;
}
this.set_busy(true, 'saving');
this.get('folder_rename', {folder: folder.folder, 'new': folder['new']}, 'folder_rename_response');
};
// folder rename response handler
this.folder_rename_response = function(response)
{
if (!this.response(response))
return;
this.env.folder = this.env.folder_rename;
this.folder_list();
};
// folder delete request
this.folder_delete = function(folder)
{
if (folder === undefined)
folder = this.env.folder;
if (!folder)
return;
// @todo: confirm
this.set_busy(true, 'saving');
this.get('folder_delete', {folder: folder}, 'folder_delete_response');
};
// folder delete response handler
this.folder_delete_response = function(response)
{
if (!this.response(response))
return;
this.env.folder = null;
$('#filelist tbody').empty();
this.enable_command('folder.delete', 'folder.edit', 'file.list', 'file.search', 'file.upload', false);
this.folder_list();
};
// file list request
this.file_list = function(params)
{
if (!params)
params = {};
if (params.all_folders) {
params.collection = null;
params.folder = null;
this.folder_unselect();
}
if (params.collection == undefined)
params.collection = this.env.collection;
if (params.folder == undefined)
params.folder = this.env.folder;
if (params.sort == undefined)
params.sort = this.env.sort_col;
if (params.reverse == undefined)
params.reverse = this.env.sort_reverse;
if (params.search == undefined)
params.search = this.env.search;
this.env.collection = params.collection;
this.env.folder = params.folder;
this.env.sort_col = params.sort;
this.env.sort_reverse = params.reverse;
// empty the list
$('#filelist tbody').empty();
this.env.file_list = [];
this.env.list_shift_start = null;
- this.enable_command('file.open', 'file.get', 'file.rename', 'file.delete', false);
+ this.enable_command('file.open', 'file.get', 'file.rename', 'file.delete', 'file.copy', 'file.move', false);
// request
if (params.collection || params.all_folders)
this.file_list_loop(params);
else {
this.set_busy(true, 'loading');
this.get('file_list', params, 'file_list_response');
}
};
// call file.list request for every folder (used for search and virt. collections)
this.file_list_loop = function(params)
{
var i, folders = [], limit = Math.max(this.env.search_threads || 1, 1);
if (params.collection) {
if (!params.search)
params.search = {};
params.search['class'] = params.collection;
delete params['collection'];
}
delete params['all_folders'];
$.each(this.env.folders, function(i, f) {
if (!f.virtual)
folders.push(i);
});
this.env.folders_loop = folders;
this.env.folders_loop_params = params;
this.env.folders_loop_lock = false;
for (i=0; i<folders.length && i<limit; i++) {
this.set_busy(true, 'loading');
params.folder = folders.shift();
this.get('file_list', params, 'file_list_loop_response');
}
};
// file list response handler
this.file_list_response = function(response)
{
if (!this.response(response))
return;
var table = $('#filelist'), list = [];
$.each(response.result, function(key, data) {
var row = ui.file_list_row(key, data);
table.append(row);
data.row = row;
list.push(data);
});
this.env.file_list = list;
};
// file list response handler for loop'ed request
this.file_list_loop_response = function(response)
{
var i, folders = this.env.folders_loop,
params = this.env.folders_loop_params,
limit = Math.max(this.env.search_threads || 1, 1),
valid = this.response(response);
for (i=0; i<folders.length && i<limit; i++) {
this.set_busy(true, 'loading');
params.folder = folders.shift();
this.get('file_list', params, 'file_list_loop_response');
}
if (!valid)
return;
this.file_list_loop_result_add(response.result);
};
// add files from list request to the table (with sorting)
this.file_list_loop_result_add = function(result)
{
// chack if result (hash-array) is empty
if (!object_is_empty(result))
return;
if (this.env.folders_loop_lock) {
setTimeout(function() { ui.file_list_loop_result_add(result); }, 100);
return;
}
// lock table, other list responses will wait
this.env.folders_loop_lock = true;
var n, i, len, elem, list = [],
table = $('#filelist'), rows = $('tbody tr', table);
for (n=0, len=this.env.file_list.length; n<len; n++) {
elem = this.env.file_list[n];
for (i in result) {
if (!this.sort_compare(elem, result[i]))
break;
var row = ui.file_list_row(i, result[i]);
elem.row.before(row);
result[i].row = row;
list.push(result[i]);
delete result[i];
}
list.push(elem);
}
// add the rest of rows
$.each(result, function(key, data) {
var row = ui.file_list_row(key, data);
table.append(row);
result[key].row = row;
list.push(result[key]);
});
this.env.file_list = list;
this.env.folders_loop_lock = false;
};
// sort files list (without API request)
this.file_list_sort = function(col, reverse)
{
var n, len, list = this.env.file_list,
table = $('#filelist'), tbody = $('<tbody>');
this.env.sort_col = col;
this.env.sort_reverse = reverse;
if (!list || !list.length)
return;
// sort the list
list.sort(function (a, b) {
return ui.sort_compare(a, b);
});
// add rows to the new body
for (n=0, len=list.length; n<len; n++) {
tbody.append(list[n].row);
}
// replace table bodies
$('tbody', table).replaceWith(tbody);
};
+ // file delete request
+ this.file_delete = function(file)
+ {
+ if (!file) {
+ file = [];
+
+ if (this.env.file)
+ file.push(this.env.file);
+ else
+ file = this.file_list_selected();
+ }
+
+ this.set_busy(true, 'deleting');
+ this.get('file_delete', {file: file}, 'file_delete_response');
+ };
+
+ // file delete response handler
+ this.file_delete_response = function(response)
+ {
+ if (!this.response(response))
+ return;
+
+ if (this.env.file) {
+ // @TODO: reload list if on the same folder only
+ if (window.opener && window.opener.ui)
+ window.opener.ui.file_list();
+ window.close();
+ }
+ else
+ this.file_list();
+ };
+
+ // file rename request
+ this.file_rename = function(file, newname)
+ {
+ if (file === newname)
+ return;
+
+ this.set_busy(true, 'saving');
+ this.get('file_move', {file: file, 'new': newname}, 'file_rename_response');
+ };
+
+ // file rename response handler
+ this.file_rename_response = function(response)
+ {
+ if (!this.response(response))
+ return;
+
+ // @TODO: we could update list/file metadata and just sort
+ this.file_list();
+ };
+
+ // file copy request
+ this.file_copy = function(folder)
+ {
+ var count = 0, list = {}, files = this.file_list_selected();
+
+ if (!files || !files.length || !folder)
+ return;
+
+ $.each(files, function(i, v) {
+ var name = folder + ui.env.directory_separator + ui.file_name(v);
+
+ if (name != v) {
+ list[v] = name;
+ count++;
+ }
+ });
+
+ if (!count)
+ return;
+
+ this.set_busy(true, 'copying');
+ this.get('file_copy', {file: list}, 'file_copy_response');
+ };
+
+ // file copy response handler
+ this.file_copy_response = function(response)
+ {
+ if (!this.response(response))
+ return;
+ };
+
+ // file move request
+ this.file_move = function(folder)
+ {
+ var count = 0, list = {}, files = this.file_list_selected();
+
+ if (!files || !files.length || !folder)
+ return;
+
+ $.each(files, function(i, v) {
+ var name = folder + ui.env.directory_separator + ui.file_name(v);
+
+ if (name != v) {
+ list[v] = name;
+ count++;
+ }
+ });
+
+ if (!count)
+ return;
+
+ this.set_busy(true, 'moving');
+ this.get('file_move', {file: list}, 'file_move_response');
+ };
+
+ // file move response handler
+ this.file_move_response = function(response)
+ {
+ if (!this.response(response))
+ return;
+
+ this.file_list();
+ };
+
+ this.file_download = function(file)
+ {
+ if (!file)
+ file = this.env.file;
+
+ location.href = this.env.url + this.url('file_get', {token: this.env.token, file: file, 'force-download': 1});
+ };
+
+ // file upload request
+ this.file_upload = function()
+ {
+ var form = $('#uploadform'),
+ field = $('input[type=file]', form).get(0),
+ files = field.files ? field.files.length : field.value ? 1 : 0;
+
+ if (files) {
+ // submit form and read server response
+ this.file_upload_form(form, 'file_create', function(e) {
+ var doc, response;
+
+ try {
+ doc = this.contentDocument ? this.contentDocument : this.contentWindow.document;
+ response = doc.body.innerHTML;
+
+ // in Opera onload is called twice, once with empty body
+ if (!response)
+ return;
+ // response may be wrapped in <pre> tag
+ if (response.match(/^<pre[^>]*>(.*)<\/pre>$/i)) {
+ response = RegExp.$1;
+ }
+
+ response = eval('(' + response + ')');
+ } catch (err) {
+ response = {status: 'ERROR'};
+ }
+
+ if (ui.response_parse(response))
+ ui.file_list();
+ });
+ }
+ };
+
+
+ /*********************************************************/
+ /********* Command helpers *********/
+ /*********************************************************/
+
+ // create folders table row
+ this.folder_list_row = function(folder, data)
+ {
+ var row = $('<tr><td><span class="branch"></span><span class="name"></span></td></tr>'),
+ span = $('span.name', row);
+
+ span.text(data.name);
+ row.attr('id', data.id).data('folder', folder);
+
+ if (data.depth)
+ $('span.branch', row).width(15 * data.depth);
+
+ if (data.virtual)
+ row.addClass('virtual');
+ else {
+ span.click(function() { ui.folder_select(folder); })
+ row.mouseenter(function() {
+ if (ui.drag_active && (!ui.env.folder || ui.env.folder != $(this).data('folder')))
+ $(this).addClass('droptarget');
+ })
+ .mouseleave(function() {
+ if (ui.drag_active)
+ $(this).removeClass('droptarget');
+ });
+
+ if (folder == this.env.folder)
+ row.addClass('selected');
+ }
+
+ return row;
+ };
+
+ // create files table row
this.file_list_row = function(filename, data)
{
var row = $('<tr><td class="filename"></td>'
+' <td class="filemtime"></td><td class="filesize"></td></tr>'),
link = $('<span></span>').text(data.name).click(function(e) { ui.file_menu(e, filename, data.type); });
$('td.filename', row).addClass(ui.file_type_class(data.type)).append(link);
$('td.filemtime', row).text(data.mtime);
$('td.filesize', row).text(ui.file_size(data.size));
row.attr('data-file', filename)
- .click(function(e) { ui.file_list_click(e, this); });
+ .click(function(e) { ui.file_list_click(e, this); })
+ .mousedown(function(e) { return ui.file_list_drag(e, this); });
// disables selection in IE
if (document.all)
row.on('selectstart', function() { return false; });
return row;
};
+ // file row click event handler
this.file_list_click = function(e, row)
{
var list = $('#filelist'), org = row, row = $(row),
found, selected, shift = this.env.list_shift_start;
if (e.shiftKey && shift && org != shift) {
$('tr', list).each(function(i, r) {
if (r == org) {
found = 1;
$(r).addClass('selected');
return;
}
else if (!selected && r == shift) {
selected = 1;
return;
}
if ((!found && selected) || (found && !selected))
$(r).addClass('selected');
else
$(r).removeClass('selected');
});
}
else if (e.ctrlKey)
row.toggleClass('selected');
else {
$('tr.selected', list).removeClass('selected');
$(row).addClass('selected');
this.env.list_shift_start = org;
}
selected = $('tr.selected', list).length;
if (!selected)
this.env.list_shift_start = null;
this.enable_command('file.delete', selected);
- this.enable_command('file.open', 'file.get', 'file.rename', selected == 1);
+ this.enable_command('file.open', 'file.get', 'file.rename', 'file.copy', 'file.move', selected == 1);
};
- // file delete request
- this.file_delete = function(file)
+ // file row drag start event handler
+ this.file_list_drag = function(e, row)
{
- if (!file) {
- file = [];
+ if (e.shiftKey || e.ctrlKey)
+ return true;
- if (this.env.file)
- file.push(this.env.file);
- else
- $('#filelist tr.selected').each(function() {
- file.push($(this).data('file'));
- });
- }
+ // selects currently unselected row
+ if (!$(row).hasClass('selected'))
+ this.file_list_click(e, row);
- this.set_busy(true, 'deleting');
- this.get('file_delete', {file: file}, 'file_delete_response');
+ this.drag_start = true;
+ this.drag_mouse_start = this.mouse_pos(e);
+
+ $(document)
+ .on('mousemove.draghandler', function(e) { ui.file_list_drag_mouse_move(e); })
+ .on('mouseup.draghandler', function(e) { ui.file_list_drag_mouse_up(e); });
+/*
+ if (bw.mobile) {
+ $(document)
+ .on('touchmove.draghandler', function(e) { ui.file_list_drag_mouse_move(e); })
+ .on('touchend.draghandler', function(e) { ui.file_list_drag_mouse_up(e); });
+ }
+*/
+ return false;
};
- // file delete response handler
- this.file_delete_response = function(response)
+ // file row mouse move event handler
+ this.file_list_drag_mouse_move = function(e)
{
- if (!this.response(response))
- return;
+/*
+ // convert touch event
+ if (e.type == 'touchmove') {
+ if (e.changedTouches.length == 1)
+ e = rcube_event.touchevent(e.changedTouches[0]);
+ else
+ return rcube_event.cancel(e);
+ }
+*/
+ var max_rows = 10, pos = this.mouse_pos(e);
+
+ if (this.drag_start) {
+ // check mouse movement, of less than 3 pixels, don't start dragging
+ if (!this.drag_mouse_start || (Math.abs(pos.left - this.drag_mouse_start.left) < 3 && Math.abs(pos.top - this.drag_mouse_start.top) < 3))
+ return false;
+
+ if (!this.draglayer)
+ this.draglayer = $('<div>').attr('id', 'draglayer')
+ .css({position:'absolute', display:'none', 'z-index':2000})
+ .appendTo(document.body);
+
+ // reset content
+ this.draglayer.html('');
+
+ // get subjects of selected messages
+ $('#filelist tr.selected').slice(0, max_rows+1).each(function(i) {
+ if (i == 0)
+ ui.drag_start_pos = $(this).offset();
+ else if (i == max_rows) {
+ ui.draglayer.append('...');
+ return;
+ }
- if (this.env.file) {
- // @TODO: reload list if on the same folder only
- if (window.opener && window.opener.ui)
- window.opener.ui.file_list();
- window.close();
+ var subject = $('td.filename', this).text();
+
+ // truncate filename to 50 characters
+ if (subject.length > 50)
+ subject = subject.substring(0, 50) + '...';
+
+ ui.draglayer.append($('<div>').text(subject));
+ });
+
+ this.draglayer.show();
+ this.drag_active = true;
}
- else
- this.file_list();
+
+ if (this.drag_active && this.draglayer)
+ this.draglayer.css({left:(pos.left+20)+'px', top:(pos.top-5 + (this.ie ? document.documentElement.scrollTop : 0))+'px'});
+
+ this.drag_start = false;
+
+ return false;
};
- // file rename request
- this.file_move = function(file, newname)
+ // file row mouse up event handler
+ this.file_list_drag_mouse_up = function(e)
{
- if (file === newname)
- return;
+ document.onmousemove = null;
+/*
+ if (e.type == 'touchend') {
+ if (e.changedTouches.length != 1)
+ return rcube_event.cancel(e);
+ }
+*/
- this.set_busy(true, 'saving');
- this.get('file_move', {file: file, 'new': newname}, 'file_move_response');
+ $(document).off('.draghandler');
+ this.drag_active = false;
+
+ var got_folder = this.file_list_drag_end(e);
+
+ if (this.draglayer && this.draglayer.is(':visible')) {
+ if (this.drag_start_pos && !got_folder)
+ this.draglayer.animate(this.drag_start_pos, 300, 'swing').hide(20);
+ else
+ this.draglayer.hide();
+ }
};
- // file delete response handler
- this.file_move_response = function(response)
+ // files drag end handler
+ this.file_list_drag_end = function(e)
{
- if (!this.response(response))
- return;
+ var folder = $('#folderlist tr.droptarget').removeClass('droptarget');
- this.file_list();
+ if (folder.length) {
+ folder = folder.data('folder');
+
+ if (e.shiftKey && this.commands['file.copy']) {
+ this.file_drag_menu(e, folder);
+ return true;
+ }
+
+ this.command('file.move', folder);
+
+ return true;
+ }
};
- this.file_download = function(file)
+ // display file drag menu
+ this.file_drag_menu = function(e, folder)
{
- if (!file)
- file = this.env.file;
+ var menu = $('#file-drag-menu');
- location.href = this.env.url + this.url('file_get', {token: this.env.token, file: file, 'force-download': 1});
+ $('li.file-copy > a', menu).off('click').click(function() { ui.command('file.copy', folder); });
+ $('li.file-move > a', menu).off('click').click(function() { ui.command('file.move', folder); });
+
+ this.popup_show(e, menu);
};
+ // display file menu
this.file_menu = function(e, file, type)
{
var menu = $('#file-menu'),
open_action = $('li.file-open > a', menu);
if (this.file_type_supported(type))
open_action.attr({target: '_blank', href: '?' + $.param({task: 'file', action: 'open', token: this.env.token, file: file})})
.removeClass('disabled').off('click');
else
open_action.click(function() { return false; }).addClass('disabled');
$('li.file-download > a', menu)
.attr({href: this.env.url + this.url('file_get', {token: this.env.token, file: file, 'force-download': 1})});
$('li.file-delete > a', menu).off('click').click(function() { ui.file_delete(file); });
$('li.file-rename > a', menu).off('click').click(function() { ui.file_rename_start(e); });
this.popup_show(e, menu);
};
+ // returns selected files (with paths)
+ this.file_list_selected = function()
+ {
+ var files = [];
+
+ $('#filelist tr.selected').each(function() {
+ files.push($(this).data('file'));
+ });
+
+ return files;
+ };
+
this.file_rename_start = function(e)
{
var list = $('#filelist'),
tr = $(e.target).parents('tr'),
td = $('td.filename', tr),
file = tr.data('file'),
name = this.file_name(file),
input = $('<input>').attr({type: 'text', name: 'filename', 'class': 'filerename'})
.val(name).data('file', file)
.click(function(e) { e.stopPropagation(); })
.keydown(function(e) {
switch (e.which) {
case 27: // ESC
ui.file_rename_stop();
break;
case 13: // Enter
var elem = $(this),
newname = elem.val(),
oldname = elem.data('file'),
path = ui.file_path(file);
- ui.file_move(oldname, path + ui.env.directory_separator + newname);
+ ui.file_rename(oldname, path + ui.env.directory_separator + newname);
elem.parent().text(newname);
break;
}
});
$('span', td).text('').append(input);
input.focus();
};
this.file_rename_stop = function()
{
$('input.filerename').each(function() {
var elem = $(this), name = ui.file_name(elem.data('file'));
elem.parent().text(name);
});
};
- // file upload request
- this.file_upload = function()
- {
- var form = $('#uploadform'),
- field = $('input[type=file]', form).get(0),
- files = field.files ? field.files.length : field.value ? 1 : 0;
-
- if (files) {
- // submit form and read server response
- this.file_upload_form(form, 'file_create', function(e) {
- var doc, response;
-
- try {
- doc = this.contentDocument ? this.contentDocument : this.contentWindow.document;
- response = doc.body.innerHTML;
-
- // in Opera onload is called twice, once with empty body
- if (!response)
- return;
- // response may be wrapped in <pre> tag
- if (response.match(/^<pre[^>]*>(.*)<\/pre>$/i)) {
- response = RegExp.$1;
- }
-
- response = eval('(' + response + ')');
- } catch (err) {
- response = {status: 'ERROR'};
- }
-
- if (ui.response_parse(response))
- ui.file_list();
- });
- }
- };
-
// post the given form to a hidden iframe
this.file_upload_form = function(form, action, onload)
{
var ts = new Date().getTime(),
frame_name = 'fileupload'+ts;
/*
// upload progress support
if (this.env.upload_progress_name) {
var fname = this.env.upload_progress_name,
field = $('input[name='+fname+']', form);
if (!field.length) {
field = $('<input>').attr({type: 'hidden', name: fname});
field.prependTo(form);
}
field.val(ts);
}
*/
// have to do it this way for IE
// otherwise the form will be posted to a new window
if (document.all) {
var html = '<iframe id="'+frame_name+'" name="'+frame_name+'"'
+ ' src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
document.body.insertAdjacentHTML('BeforeEnd', html);
}
// for standards-compliant browsers
else
$('<iframe>')
.attr({name: frame_name, id: frame_name})
.css({border: 'none', width: 0, height: 0, visibility: 'hidden'})
.appendTo(document.body);
// handle upload errors, parsing iframe content in onload
$('#'+frame_name).bind('load', {ts:ts}, onload);
$(form).attr({
target: frame_name,
action: this.env.url + this.url(action, {folder: this.env.folder, token: this.env.token, uploadid:ts}),
method: 'POST'
}).attr(form.encoding ? 'encoding' : 'enctype', 'multipart/form-data')
.submit();
};
// Display file search form
this.file_search = function()
{
var form = this.form_show('file-search'),
has_folder = this.env.folder || this.env.collection,
radio1 = $('input[name="all_folders"][value="0"]', form);
$('input[name="name"]', form).val('').focus();
if (has_folder)
radio1.prop('disabled', false).click();
else {
radio1.prop('disabled', true);
$('input[name="all_folders"][value="1"]', form).click();
}
};
// Hide file search form
this.file_search_stop = function()
{
if (this.env.search)
this.file_list(null, {search: null});
this.form_hide('file-search');
this.env.search = null;
};
// Execute file search
this.file_search_submit = function()
{
var form = this.form_show('file-search'),
value = $('input[name="name"]', form).val(),
all = $('input[name="all_folders"]:checked', form).val();
if (value) {
this.env.search = {name: value};
this.file_list({search: this.env.search, all_folders: all == 1});
}
else
this.file_search_stop();
};
// Display folder creation form
this.folder_create_start = function()
{
var form = this.form_show('folder-create');
$('input[name="name"]', form).val('').focus();
$('input[name="parent"]', form).prop('checked', this.env.folder)
.prop('disabled', !this.env.folder);
};
// Hide folder creation form
this.folder_create_stop = function()
{
this.form_hide('folder-create');
};
// Submit folder creation form
this.folder_create_submit = function()
{
var folder = '', data = this.serialize_form('#folder-create-form');
if (!data.name)
return;
if (data.parent && this.env.folder)
folder = this.env.folder + this.env.directory_separator;
folder += data.name;
this.folder_create_stop();
this.command('folder.create', folder);
};
// Display folder edit form
this.folder_edit_start = function()
{
var form = this.form_show('folder-edit'),
arr = this.env.folder.split(this.env.directory_separator),
name = arr.pop();
this.env.folder_edit_path = arr.join(this.env.directory_separator);
$('input[name="name"]', form).val(name).focus();
};
// Hide folder edit form
this.folder_edit_stop = function()
{
this.form_hide('folder-edit');
};
// Submit folder edit form
this.folder_edit_submit = function()
{
var folder = '', data = this.serialize_form('#folder-edit-form');
if (!data.name)
return;
if (this.env.folder_edit_path)
folder = this.env.folder_edit_path + this.env.directory_separator;
folder += data.name;
this.env.folder_rename = folder;
this.folder_edit_stop();
this.command('folder.edit', {folder: this.env.folder, 'new': folder});
};
/*********************************************************/
/********* Utilities *********/
/*********************************************************/
// Display folder creation form
this.form_show = function(name)
{
var form = $('#' + name + '-form');
$('#forms > form').hide();
form.show();
$('#taskcontent').css('top', form.height() + 20);
return form;
};
// Display folder creation form
this.form_hide = function(name)
{
var form = $('#' + name + '-form');
form.hide();
$('#taskcontent').css('top', 10);
};
// loads a file content into an iframe (with loading image)
this.load_file = function(content, filedata)
{
var href = filedata.href, iframe = $(content),
div = iframe.parent(),
loader = $('#loader'),
offset = div.offset(),
w = loader.width(), h = loader.height(),
width = div.width(), height = div.height();
loader.css({
top: offset.top + height/2 - h/2 - 20,
left: offset.left + width/2 - w/2
}).show();
iframe.css('opacity', 0.1)
.load(function() { ui.loader_hide(this); })
.attr('src', href);
// some content, e.g. movies or flash doesn't execute onload on iframe
// let's wait some time and check document ready state
if (!/^text/i.test(filedata.mimetype))
setTimeout(function() {
$(iframe.get(0).contentWindow.document).ready(function() {
parent.ui.loader_hide(content);
});
}, 1000);
};
// hide content loader element, show content element
this.loader_hide = function(content)
{
$('#loader').hide();
$(content).css('opacity', 1);
};
};
// Initialize application object (don't change var name!)
var ui = $.extend(new files_api(), new files_ui());
// general click handler
$(document).click(function() {
$('.popup').hide();
ui.file_rename_stop();
}).ready(function() {
ui.init();
});
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index affce3b..d929665 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -1,1242 +1,1266 @@
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333;
margin: 0;
color: #514949;
background: url(images/body.png) top repeat-x #f0f0f0;
}
a {
color: #1E90FF;
text-decoration: none;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 5px;
color: #ff9900;
}
input[type="text"],
input[type="password"],
select[multiple="multiple"],
textarea {
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
padding-left: 2px;
color: black;
}
select[multiple="multiple"] {
padding-left: 0;
}
table.list {
width: 100%;
border-spacing: 0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
table.list td {
padding: 2px 4px;
border: 1px solid white;
border-left: none;
border-top: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
table.list thead tr {
background-color: #e0e0e0;
font-weight: bold;
}
table.list tbody tr {
background-color: #f0f0f0;
}
table.list tfoot tr {
background-color: #e0e0e0;
}
table.list tfoot tr td {
padding: 3px 3px;
font-size: 10px;
text-shadow: white 1px 1px;
}
table.list tfoot tr td {
border-top: solid 1px white;
border-bottom: none;
}
table.list td:last-child {
border-right: none;
}
table.list tbody tr.selectable td {
cursor: default;
}
table.list tbody tr.selectable:hover {
background-color: #d6efff;
}
table.list tbody tr td.empty-body {
height: 150px;
color: #ff9900;
text-align: center;
}
fieldset {
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin-top: 10px;
}
legend {
padding-left: 0;
color: #909090;
}
table.form {
width: 100%;
}
table.form td {
padding: 1px 5px;
}
table.form tr.required input,
table.form tr.required select,
table.form tr.required textarea {
background-color: #f0f9ff;
}
table.form tr input.error,
table.form tr select.error,
table.form tr textarea.error {
background-color: #f5e3e3;
}
td.label {
width: 1%;
min-width: 120px;
text-align: right;
font-weight: bold;
white-space: nowrap;
}
table tbody tr.selected {
background-color: #d6efff;
}
/**** Common UI elements ****/
#topmenu {
text-align: right;
height: 20px;
padding: 0 10px;
margin: 0;
white-space: nowrap;
background: url(images/linen_header.jpg) 0 0 repeat-x;
}
#topmenu > span {
color: #aaa;
font-size: 11px;
padding-top: 2px;
display: inline-block;
height: 18px;
}
#navigation {
margin: 0 15px;
text-align: right;
height: 36px;
z-index: 2;
white-space: nowrap;
}
#task_navigation {
margin: 0 15px;
text-align: right;
height: 21px;
z-index: 2;
white-space: nowrap;
}
#message {
position: absolute;
top: 80px;
left: 20px;
width: 350px;
height: 60px;
z-index: 20;
}
#message div {
opacity: 0.97;
padding-left: 70px;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-moz-box-shadow: 1px 1px 3px #999;
-webkit-box-shadow: #999 1px 1px 3px;
width: 100%;
height: 100%;
display: table;
}
#message.notice div {
border-color: #aec1db;
color: #3465a4;
background: url(images/info.png) 10px center no-repeat #c0e0ff;
}
#message.error div {
border-color: #db9999;
color: #a40000;
background: url(images/error.png) 10px center no-repeat #edcccc;
}
#message div span {
vertical-align: middle;
display: table-cell;
line-height: 20px;
}
#logo {
position: absolute;
top: 0px;
left: 10px;
width: 198px;
height: 74px;
cursor: pointer;
background: url(images/logo.png) 0 0 no-repeat;
}
#content {
position: absolute;
left: 0;
right: 0;
top: 74px;
bottom: 55px;
margin: 0 15px;
padding: 10px;
background-color: #f5f5f5;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#footer {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 50px;
margin: 2px 15px;
color: #b0b0b0;
font-size: 9px;
}
#loading {
position: absolute;
display: none;
top: 2px;
left: 15px;
width: 150px;
height: 18px;
padding-left: 86px;
color: #aaa;
font-size: 11px;
z-index: 1;
background: url(images/loading.gif) 0 3px no-repeat;
white-space: nowrap;
}
#topmenu .logout {
background: url(images/buttons.png) -1px -100px no-repeat;
padding-left: 20px;
margin-right: 10px;
color: white;
}
#topmenu .login {
padding-left: 20px;
margin-right: 20px;
background: url(images/user_ico.png) 0 2px no-repeat;
}
#topmenu .domain {
padding-left: 20px;
margin-right: 10px;
background: url(images/domain_ico.png) 0 3px no-repeat;
}
#navigation ul {
list-style-type: none;
margin: 0;
padding: 8px 0;
}
#navigation ul li {
display: inline;
font-size: 13px;
font-weight: bold;
padding: 8px 0;
}
#navigation ul li a {
padding: 8px 10px;
text-decoration: none;
color: #514949;
}
#navigation ul li.active {
background: url(images/navbg.png) 0 0 repeat-x;
}
#navigation ul li.active a {
text-shadow: white 1px 1px;
color: #ff9900;
}
#task_navigation ul {
list-style-type: none;
margin: 0;
padding: 2px 0;
}
#task_navigation ul li {
padding: 1px 0;
display: inline;
font-size: 12px;
font-weight: bold;
text-shadow: white 1px 1px;
}
#task_navigation ul li a {
padding: 1px 10px;
text-decoration: none;
color: #808080;
}
#navigation ul li a:active,
#task_navigation ul li a:active {
outline: none;
}
#search {
padding: 7px;
margin-bottom: 10px;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #e0e0e0;
}
#searchinput {
border: none;
background-color: white;
margin-top: 2px;
}
#searchinput:focus {
outline: none;
}
.searchinput {
height: 20px;
margin: 0;
padding: 0;
background-color: white;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
overflow: hidden;
}
.searchactions {
float: left;
padding: 1px;
margin-left: -1px;
height: 18px;
width: 37px;
background-color: #f0f0f0;
cursor: pointer;
border-right: 1px solid #e0e0e0;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
-moz-border-radius-topleft: 3px;
-moz-border-radius-bottomleft: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-left-right-radius: 3px;
}
#search-reset,
#search-details {
display: block;
float: left;
width: 18px;
height: 18px;
background: url(images/buttons.png) -1px 0 no-repeat;
}
#search-reset:hover,
#search-details:hover {
background-color: white;
}
#search-reset {
border-left: 1px solid #e0e0e0;
}
#search-details {
background-position: -1px 20px;
}
.searchdetails {
display: none;
}
.searchfilter {
color: #909090;
font-weight: bold;
margin-top: 5px;
}
#search fieldset {
margin: 0;
color: #909090;
margin-top: 5px;
}
#search td.label {
min-width: 0;
}
div.vsplitter {
float: left;
width: 10px;
min-height: 400px;
}
/* fix cursor on upload button */
input[type="file"]::-webkit-file-upload-button {
cursor: pointer;
}
+#draglayer {
+ min-width: 300px;
+ width: auto !important;
+ width: 300px;
+ border: 1px solid #999999;
+ background-color: #fff;
+ padding-left: 8px;
+ padding-right: 8px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ white-space: nowrap;
+ opacity: 0.9;
+ border-radius: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ -moz-box-shadow: 1px 1px 12px #999;
+ -webkit-box-shadow: #999 1px 1px 12px;
+}
+
+
/**** Common classes ****/
a.disabled {
opacity: 0.5;
filter: alpha(opacity=50);
}
.nowrap {
white-space: nowrap;
}
.clear {
clear: both;
}
.watermark {
padding-top: 40px;
text-align: center;
width: 100%;
}
.link {
cursor: pointer;
}
.icon {
width: 16px;
height: 16px;
}
input.inactive {
color: #d0d0d0;
}
.formtitle {
color: #ff9900;
font-size: 18px;
font-weight: bold;
margin-left: 5px;
}
.formbuttons {
text-align: center;
white-space: nowrap;
}
.formbuttons input {
margin: 5px;
}
div.scroller {
left: 0;
top: 0;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
position: absolute;
bottom: 19px;
}
.listnav {
width: 100%;
text-align: right;
}
.listnav a {
float: left;
display: block;
width: 16px;
height: 16px;
background: url(images/arrow_left.png) center no-repeat;
}
.listnav a.next {
background: url(images/arrow_right.png) center no-repeat;
}
.listnav a.disabled {
opacity: .3;
cursor: default;
}
.listnav span span {
float: left;
display: block;
height: 14px;
padding: 1px 5px;
}
.disabled,
.readonly,
.select.readonly option {
color: #a0a0a0;
}
input.disabled,
input.readonly,
select.disabled,
select.readonly,
textarea.disabled,
textarea.readonly {
background-color: #f5f5f5;
color: #a0a0a0;
}
input.maxsize {
width: 368px; /* span.listarea width - 2px */
}
pre.debug {
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: white;
padding: 2px;
width: 500px;
height: 200px;
margin: 0;
overflow: auto;
}
.popup {
display: none;
position: absolute;
border: 1px solid #d0d0d0;
border-radius: 3px;
box-shadow: 0 2px 6px 0 #d0d0d0;
-moz-box-shadow: 0 2px 6px 0 #d0d0d0;
-webkit-box-shadow: 0 2px 6px 0 #d0d0d0;
-o-box-shadow: 0 2px 6px 0 #d0d0d0;
background-color: #f0f0f0;
}
a.button {
display: inline-block;
width: 18px;
height: 18px;
background: url(images/buttons.png) 0 0 no-repeat;
}
a.button.edit {
background-position: -1px -81px;
}
a.button.add {
background-position: -1px -41px;
}
a.button.delete {
background-position: -1px -1px;
}
.popup ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.popup ul li {
padding: 2px 4px;
min-width: 100px;
cursor: default;
}
.popup ul li a {
width: 100%;
cursor: default;
display: block;
}
.popup ul li:hover {
background-color: #d6efff;
}
div.boxfooter {
position: absolute;
height: 18px;
left: 0;
right: 0;
bottom: 0;
background-color: #e0e0e0;
border-top: 1px solid #d0d0d0;
}
div.boxfooter a.button {
width: auto;
white-space: nowrap;
color: #514949;
display: inline;
line-height: 18px;
padding: 0 5px 0 20px;
}
/********* Form smart inputs *********/
span.listarea {
display: block;
width: 370px;
max-height: 209px;
overflow-y: auto;
overflow-x: hidden;
margin: 0;
padding: 0;
background-color: white;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: left;
text-shadow: none;
color: black;
}
span.listelement {
display: block;
padding: 0;
margin: 0;
height: 18px;
overflow: hidden;
border-top: 1px solid #d0d0d0;
white-space: nowrap;
}
span.listelement:first-child {
border: none;
}
span.listelement input {
border: none;
background-color: transparent;
padding-left: 2px;
width: 328px;
height: 16px;
}
span.listarea.disabled span.listelement input,
span.listarea.readonly span.listelement input {
width: 370px;
}
span.listelement input:focus {
outline: none;
}
span.listelement span.actions {
float: left;
padding: 1px 0;
margin-left: -1px;
margin-top: -1px;
height: 18px;
width: 37px;
border: 1px solid #d0d0d0;
background-color: #f0f0f0;
cursor: pointer;
}
span.listelement span.actions span {
display: block;
float: left;
width: 18px;
height: 18px;
background: url(images/buttons.png) 0 0 no-repeat;
}
span.listelement span.actions span:hover {
background-color: white;
}
span.listelement span.actions span.reset {
background-position: -1px -1px;
border-left: 1px solid #e0e0e0;
}
span.listelement span.actions span.add {
background-position: -41px -2px;
}
span.listelement span.actions span.search {
background-position: -61px -1px;
cursor: default;
}
span.listarea.disabled,
span.listarea.readonly {
background-color: #f5f5f5;
}
input.disabled,
input.readonly,
span.listarea.disabled span.listelement input,
span.listarea.readonly span.listelement input {
color: #a0a0a0;
cursor: default;
}
span.listarea.autocomplete span.listelement input {
color: #514949;
}
span.listarea.autocomplete span.listelement input.autocomplete {
color: black;
}
.autocomplete > span.listelement input {
width: 346px;
}
.autocomplete > span.listelement span.actions {
width: 18px;
}
.autocomplete > span.listelement span.actions span.reset {
border-left: none;
}
.autocomplete > span.listelement span.actions span.search:hover {
background-color: #f0f0f0;
}
span.listarea.select {
width: 200px;
}
span.listarea.select > span.listelement input {
width: 180px;
}
span.listcontent {
display: block;
padding: 0;
margin: 0;
overflow: hidden;
max-height: 94px;
overflow-x: hidden;
overflow-y: auto;
border-top: 1px solid #d0d0d0;
background-color: #f5f5f5;
cursor: default;
}
span.listcontent span.listelement {
padding-left: 3px;
}
span.listcontent span.listelement:hover {
background-color: #d6efff;
}
span.listcontent span.listelement.selected {
background-color: #d6efff;
}
span.form_error {
color: #FF0000;
font-weight: bold;
font-size: 90%;
padding-left: 5px;
}
/***** autocomplete list *****/
#autocompletepane
{
background-color: white;
border: 1px solid #d0d0d0;
min-width: 351px;
}
#autocompletepane ul
{
margin: 0px;
padding: 2px;
list-style-image: none;
list-style-type: none;
}
#autocompletepane ul li
{
display: block;
height: 16px;
font-size: 11px;
padding-left: 6px;
padding-top: 2px;
padding-right: 6px;
white-space: nowrap;
cursor: pointer;
}
#autocompletepane ul li.selected
{
background-color: #d6efff;
}
/***** tabbed interface elements *****/
div.tabsbar
{
height: 22px;
border-bottom: 1px solid #d0d0d0;
white-space: nowrap;
margin: 10px 5px 0 5px;
}
span.tablink,
span.tablink-selected
{
float: left;
height: 23px !important;
height: 22px;
overflow: hidden;
background: url(images/tabs-left.gif) top left no-repeat;
font-weight: bold;
}
span.tablink
{
cursor: pointer;
text-shadow: white 1px 1px;
}
span.tablink-selected
{
cursor: default;
background-position: 0px -23px;
}
span.tablink a,
span.tablink-selected a
{
display: inline-block;
padding: 4px 10px 0 5px;
margin-left: 5px;
height: 23px;
color: #808080;
max-width: 185px;
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
background: url(images/tabs-right.gif) top right no-repeat;
outline: none;
}
span.tablink-selected a
{
cursor: inherit;
color: #514949;
background-position: right -23px;
}
fieldset.tabbed
{
margin-top: 0;
padding-top: 12px;
border-top: none;
}
/**** Login form elements ****/
#login_form {
margin: auto;
margin-top: 75px;
padding: 20px;
width: 330px;
background-color: #e0e0e0;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
}
#login_form span {
display: block;
line-height: 24px;
width: 330px;
text-align: left;
}
#login_form label {
display: block;
width: 80px;
text-align: right;
float: left;
margin-right: 10px;
}
#login_form select,
#login_form input[type="text"],
#login_form input[type="password"] {
width: 210px;
}
#login_submit {
margin-top: 5px;
}
/**** Main screen elements ****/
#main {
padding: 5px 30px;
}
#footer .foot {
white-space: nowrap;
vertical-align: top;
text-align: right;
}
/***** tree indicators *****/
td span.branch span
{
float: left;
height: 16px;
}
td span.branch span.tree
{
height: 17px;
width: 15px;
background: url(images/tree.gif) 0 0 no-repeat;
}
td span.branch span.l1
{
background-position: 0px 0px; /* L */
}
td span.branch span.l2
{
background-position: -30px 0px; /* | */
}
td span.branch span.l3
{
background-position: -15px 0px; /* |- */
}
/**** File manager elements ****/
#taskcontent {
position: absolute;
left: 310px;
right: 10px;
bottom: 10px;
top: 10px;
background-color: #f0f0f0;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
overflow-y: auto;
}
#actionbar {
position: absolute;
width: 82px;
top: 10px;
bottom: 10px;
overflow: hidden;
}
#forms {
position: absolute;
left: 310px;
right: 10px;
top: 10px;
}
#forms form {
display: none;
}
#forms fieldset {
margin: 0;
background-color: #f0f0f0;
}
#forms table {
border-spacing: 0;
margin: 0;
padding: 0;
}
#forms table td.buttons {
width: 1%;
white-space: nowrap;
}
#actionbar a {
display: block;
width: 80px;
height: 55px;
border: 1px solid #d0d0d0;
border-spacing: 0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #f0f0f0;
margin-bottom: 6px;
cursor: pointer;
color: #333;
}
#actionbar a span {
display: block;
position: absolute;
width: 100%;
text-align: center;
padding-top: 40px;
font-size: 9px;
}
#folder-create-button {
background: url(images/folder_new.png) center 6px no-repeat;
}
#file-create-button {
background: url(images/file_new.png) center 6px no-repeat;
}
#file-upload-button {
background: url(images/file_new.png) center 6px no-repeat;
}
#file-search-button {
background: url(images/search.png) center 6px no-repeat;
}
#folderlist,
#filedata {
position: absolute;
width: 200px;
top: 10px;
bottom: 10px;
left: 98px;
border: 1px solid #d0d0d0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #f0f0f0;
padding: 2px;
}
#folderlist table,
#filelist table {
width: 100%;
border-spacing: 0;
}
#filelist td {
white-space: nowrap;
cursor: default;
}
#filelist td.filename {
width: 98%;
height: 20px;
padding: 0 4px;
}
#filelist td.filesize {
text-align: right;
}
#filelist tbody td.filename span {
background: url(images/mimetypes/unknown.png) 0 0 no-repeat;
padding: 0 0 0 20px;
height: 16px;
cursor: pointer;
}
#filelist tbody td.filename span input {
padding: 0 2px;
height: 18px;
}
#filelist thead td {
cursor: pointer;
}
#filelist thead td.sorted {
padding-right: 16px;
text-decoration: underline;
background: url(images/buttons.png) right -140px no-repeat;
}
#filelist thead td.sorted.reverse {
background-position: right -120px;
}
#folderlist td span.name {
background: url(images/folder.png) 0 0 no-repeat;
height: 18px;
padding-left: 20px;
margin-left: 3px;
cursor: pointer;
}
#folderlist tr.selected td span.name {
background-image: url(images/folder_open.png);
}
#folderlist tr.selected {
background-color: inherit;
}
#folderlist tr.selected td span.name {
font-weight: bold;
}
#folderlist tr.virtual td span.name {
color: #bbb;
cursor: default;
}
+#folderlist tr.droptarget {
+ background-color: #e0e0e0;
+}
+
#folder-collection-audio td span.name,
#folderlist #folder-collection-audio.selected td span.name {
background: url(images/audio.png) 1px 0 no-repeat;
}
#folder-collection-video td span.name,
#folderlist #folder-collection-video.selected td span.name {
background: url(images/video.png) 0 0 no-repeat;
}
#folder-collection-image td span.name,
#folderlist #folder-collection-image.selected td span.name {
background: url(images/image.png) 0 0 no-repeat;
}
#folder-collection-document td span.name,
#folderlist #folder-collection-document.selected td span.name {
background: url(images/document.png) 0 0 no-repeat;
}
/****** File open interface elements ******/
#actionbar #file-edit-button {
background: url(images/edit.png) center 6px no-repeat #f0f0f0;
}
#actionbar #file-delete-button {
background: url(images/trash.png) center 6px no-repeat #f0f0f0;
}
#actionbar #file-download-button {
background: url(images/download.png) center 6px no-repeat #f0f0f0;
}
#taskcontent iframe {
border: none;
width: 100%;
height: 100%;
background-color: white;
overflow: auto;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
opacity: 0.1;
}
.fileopen #taskcontent {
overflow: hidden;
background-color: white;
}
#filedata table {
width: 200px;
}
#filedata table td.label {
min-width: 30px;
}
#filedata table td.data {
/*
text-overflow: ellipsis;
overflow: hidden;
*/
}
#filedata table td.data.filename {
font-weight: bold;
}
#loader {
display: none;
z-index: 10;
width: 100px;
background-color: #fafafa;
color: #a0a0a0;
position: absolute;
border: 1px solid #e0e0e0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
padding: 10px;
font-weight: bold;
}
diff --git a/public_html/skins/default/templates/main.html b/public_html/skins/default/templates/main.html
index 636d669..6d5968a 100644
--- a/public_html/skins/default/templates/main.html
+++ b/public_html/skins/default/templates/main.html
@@ -1,74 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{$pagetitle}</title>
<link rel="stylesheet" href="{$skin_path}style.css" />
<link rel="stylesheet" href="{$skin_path}images/mimetypes/style.css" />
<link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
<script src="js/jquery.min.js"></script>
<script src="js/files_api.js"></script>
<script src="js/files_ui.js"></script>
<script src="{$skin_path}ui.js"></script>
</head>
<body>
<div id="logo" onclick="document.location='.'"></div>
<div id="topmenu">
<span class="login">{$user.username}</span>
<span class="logout link" onclick="ui.main_logout()">{$engine->translate('logout')}</span>
</div>
<div id="navigation">{$main_menu}</div>
<div id="task_navigation">{$task_menu}</div>
<div id="content">
<div id="actionbar">
<a id="folder-create-button" onclick="ui.command('folder.create')" class="disabled"><span>{$engine->translate('folder.createtitle')}</span></a>
<form id="uploadform" name="uploadform" method="post" enctype="multipart/form-data">
<a id="file-upload-button" class="disabled"><span>{$engine->translate('file.upload')}</span></a>
</form>
<a id="file-search-button" onclick="ui.command('file.search')" class="disabled"><span>{$engine->translate('search')}</span></a>
</div>
<div id="folderlist">
<div class="scroller">
<table></table>
</div>
<div class="boxfooter">
<a href="#" onclick="ui.command('folder.edit')" alt="" id="folder-edit-button" class="button edit disabled">{$engine->translate('folder.edit')}</a>
<a href="#" onclick="ui.command('folder.delete')" alt="" id="folder-delete-button" class="button delete disabled">{$engine->translate('folder.delete')}</a>
</div>
</div>
<div id="forms">
{$engine->folder_create_form()}
{$engine->folder_edit_form()}
{$engine->file_search_form()}
</div>
<div id="taskcontent">
<div class="scroller">
<table id="filelist" class="list">
<thead>
<tr>
<td class="filename" onclick="file_list_sort('name', this)">{$engine->translate('file.name')}</td>
<td class="filemtime" onclick="file_list_sort('mtime', this)">{$engine->translate('file.mtime')}</td>
<td class="filesize" onclick="file_list_sort('size', this)">{$engine->translate('file.size')}</td>
</tr>
</thead>
</table>
</div>
<div class="boxfooter">
<a href="#" onclick="ui.command('file.delete')" alt="" id="file-delete-button" class="button delete disabled">{$engine->translate('file.delete')}</a>
</div>
</div>
</div>
<div id="footer">
{include file="footer.html"}
</div>
<div id="file-menu" class="popup">
<ul>
<li class="file-open"><a id="file-open-button" href="#">{$engine->translate('file.open')}</a></li>
<li class="file-download"><a id="file-download-button" href="#">{$engine->translate('file.download')}</a></li>
<li class="file-delete"><a id="file-delete-button" href="#">{$engine->translate('file.delete')}</a></li>
<li class="file-rename"><a id="file-rename-button" href="#">{$engine->translate('file.rename')}</a></li>
</ul>
</div>
+ <div id="file-drag-menu" class="popup">
+ <ul>
+ <li class="file-move"><a id="file-move-button" href="#">{$engine->translate('file.move')}</a></li>
+ <li class="file-copy"><a id="file-copy-button" href="#">{$engine->translate('file.copy')}</a></li>
+ </ul>
+ </div>
{$script}
</body>
</html>
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index b4fd016..0a8163a 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -1,64 +1,66 @@
function file_list_sort(name, elem)
{
var td = $(elem), reverse = ui.env.sort_reverse;
if (ui.env.sort_col == name)
reverse = !reverse;
else
reverse = 0;
$('td', td.parent()).removeClass('sorted reverse');
td.addClass('sorted').removeClass('reverse');
if (reverse)
td.addClass('reverse');
ui.file_list_sort(name, reverse);
};
function hack_file_input(id)
{
var link = $('#'+id),
file = $('<input>'),
offset = link.offset();
file.attr({name: 'file[]', type: 'file', multiple: 'multiple', size: 5})
.change(function() { ui.file_upload(); })
// opacity:0 does the trick, display/visibility doesn't work
.css({opacity: 0, cursor: 'pointer', position: 'relative', outline: 'none', top: '10000px', left: '10000px'});
// In FF and IE we need to move the browser file-input's button under the cursor
// Thanks to the size attribute above we know the length of the input field
if (navigator.userAgent.match(/Firefox|MSIE/))
file.css({marginLeft: '-80px'});
// Note: now, I observe problem with cursor style on FF < 4 only
link.css({overflow: 'hidden', cursor: 'pointer'})
// place button under the cursor
.mousemove(function(e) {
if (ui.commands['file.upload'])
file.css({top: (e.pageY - offset.top - 10) + 'px', left: (e.pageX - offset.left - 10) + 'px'});
// move the input away if button is disabled
else
$(this).mouseleave();
})
.mouseleave(function() { file.css({top: '10000px', left: '10000px'}); })
.append(file);
};
$(window).load(function() {
hack_file_input('file-upload-button');
$('#forms > form').hide();
});
// register buttons
ui.buttons({
'folder.create': 'folder-create-button',
'folder.edit': 'folder-edit-button',
'folder.delete': 'folder-delete-button',
'file.upload': 'file-upload-button',
'file.search': 'file-search-button',
'file.delete': 'file-delete-button',
'file.download': 'file-download-button',
-'file.edit': 'file-edit-button'
+'file.edit': 'file-edit-button',
+'file.copy': 'file-copy-button',
+'file.move': 'file-move-button'
});

File Metadata

Mime Type
text/x-diff
Expires
Thu, Jul 9, 9:31 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1057233
Default Alt Text
(81 KB)

Event Timeline