From f3f6d5a47bbfbe4c122fb73761c149856a17743a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 30 Jan 2011 17:52:49 +0530 Subject: [PATCH] move files view --- static/js/pandora.js | 186 ++++++++++++++++++++++--------------------- 1 file changed, 94 insertions(+), 92 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index 761c4505..0b057a88 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -636,6 +636,99 @@ }) return that; }, + files: function() { + var that = new Ox.TextList({ + columns: [ + { + align: "left", + id: "name", + operator: "+", + title: "Name", + unique: true, + visible: true, + width: 400 + }, + { + align: "left", + id: "oshash", + operator: "+", + title: "oshash", + visible: true, + width: 120 + }, + { + align: "left", + id: "instances", + operator: "+", + title: "Instances", + visible: true, + width: 60 + }, + { + align: "left", + id: "width", + operator: "+", + title: "Width", + visible: true, + width: 60 + }, + { + align: "left", + id: "height", + operator: "+", + title: "Height", + visible: true, + width: 60 + }, + { + align: "left", + id: "duration", + operator: "+", + title: "Duration", + visible: true, + width: 80, + format: {type: "duration", args: [0, "medium"]} + }, + { + align: "left", + id: "size", + operator: "+", + title: "Size", + visible: true, + width: 80, + format: {type: "value", args: ["B"]} + }, + { + align: "left", + id: "is_main", + operator: "+", + title: "Main", + visible: true, + width: 140 + } + ], + columnsMovable: true, + columnsRemovable: true, + columnsResizable: true, + columnsVisible: true, + id: 'files', + request: function(data, callback) { + //Ox.print('data, Query.toObject', data, Query.toObject()) + pandora.api.findFiles($.extend(data, { + query: { + conditions: [{ + key: 'id', + value: app.user.ui.item, + operator: '=' + }] + } + }), callback); + }, + scrollbarVisible: true, + sort: [{key: 'name', operator:'+'}] + }); + return that; + }, filter: function() { var that = new Ox.Filter({ findKeys: $.map(app.config.itemKeys, function(key) { @@ -1800,98 +1893,7 @@ }); */ } else if (app.user.ui.itemView == 'files') { - app.$ui.contentPanel.replace(1, - app.$ui.item = new Ox.TextList({ - columns: [ - { - align: "left", - id: "name", - operator: "+", - title: "Name", - unique: true, - visible: true, - width: 400 - }, - { - align: "left", - id: "oshash", - operator: "+", - title: "oshash", - visible: true, - width: 120 - }, - { - align: "left", - id: "instances", - operator: "+", - title: "Instances", - visible: true, - width: 60 - }, - { - align: "left", - id: "width", - operator: "+", - title: "Width", - visible: true, - width: 60 - }, - { - align: "left", - id: "height", - operator: "+", - title: "Height", - visible: true, - width: 60 - }, - { - align: "left", - id: "duration", - operator: "+", - title: "Duration", - visible: true, - width: 80, - format: {type: "duration", args: [0, "medium"]} - }, - { - align: "left", - id: "size", - operator: "+", - title: "Size", - visible: true, - width: 80, - format: {type: "value", args: ["B"]} - }, - { - align: "left", - id: "is_main", - operator: "+", - title: "Main", - visible: true, - width: 140 - } - ], - columnsMovable: true, - columnsRemovable: true, - columnsResizable: true, - columnsVisible: true, - id: 'files', - request: function(data, callback) { - //Ox.print('data, Query.toObject', data, Query.toObject()) - pandora.api.findFiles($.extend(data, { - query: { - conditions: [{ - key: 'id', - value: result.data.item.id, - operator: '=' - }] - } - }), callback); - }, - scrollbarVisible: true, - sort: [{key: 'name', operator:'+'}] - }) - ); + app.$ui.contentPanel.replace(1, app.$ui.files = ui.files()); } app.$ui.total.html(result.data.item.title + ' (' + result.data.item.director.join(', ') + ')') });