cleanup, remove trailing whitespace

This commit is contained in:
rolux 2011-10-29 19:46:46 +02:00
parent c6f11433f9
commit 51e9e72f32
34 changed files with 63 additions and 72 deletions

View file

@ -144,7 +144,7 @@ function constructList() {
.appendTo(info)
var f = app.actions[id].code[0];
$('<span>').html(' View Source ('+f+')').appendTo(info)
$('<pre>').append($code).appendTo(info)
$('<pre>').append($code).appendTo(info)
hljs.highlightBlock($code[0], ' ');
hash += id + ','

View file

@ -58,7 +58,7 @@ Ox.load('UI', {
Ox.UI.hideLoadingScreen();
});
return that;
},
},
});
Ox.extend(pandora.user, {
videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats)

View file

@ -132,7 +132,7 @@ window.onerror = function(error, url, line) {
script.onload = callback;
script.src = '/static/oxjs/dev/Ox.js';
script.type = 'text/javascript';
document.head.appendChild(script);
document.head.appendChild(script);
}
function loadOxUI(callback) {
@ -226,13 +226,13 @@ window.onerror = function(error, url, line) {
edits: [
{id: 'personal', title: 'Personal Edits'},
{id: 'favorite', title: 'Favorite Edits', showBrowser: false},
{id: 'featured', title: 'Featured Edits', showBrowser: false}
{id: 'featured', title: 'Featured Edits', showBrowser: false}
],
texts: [
{id: 'personal', title: 'Personal Texts'},
{id: 'favorite', title: 'Favorite Texts', showBrowser: false},
{id: 'featured', title: 'Featured Texts', showBrowser: false}
]
{id: 'featured', title: 'Featured Texts', showBrowser: false}
]
},
sortKeys: Ox.map(pandora.site.itemKeys, function(key) {
return key.columnWidth ? Ox.extend(key, {
@ -270,7 +270,7 @@ window.onerror = function(error, url, line) {
Ox.Theme(pandora.user.ui.theme);
localStorage.theme = pandora.user.ui.theme;
pandora.$ui.appPanel = pandora.ui.appPanel().display();
pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
@ -278,7 +278,7 @@ window.onerror = function(error, url, line) {
pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8;
});
}
function loadBrowserMessage() {
@ -345,14 +345,13 @@ window.onerror = function(error, url, line) {
.css({width: '32px', height: '32px', margin: '4px'})
)
.appendTo($images);
});
});
$('<div>')
.css({
textAlign: 'center'
})
.html(html)
.appendTo($message);
});
function loadImages(images, callback) {

View file

@ -166,7 +166,7 @@ pandora.Query = (function() {
}).length;
// indices of non-advanced find queries
indices = Ox.map(pandora.site.findKeys, function(findKey) {
var key = findKey.id == 'all' ? '' : findKey.id,
var key = findKey.id == 'all' ? '' : findKey.id,
index = oneCondition(ret.query.conditions, key, '');
return index > -1 ? index : null;
});
@ -178,7 +178,7 @@ pandora.Query = (function() {
index: indices[0],
key: ret.query.conditions[indices[0]].key,
value: decodeURIComponent(ret.query.conditions[indices[0]].value)
} : {index: -1, key: 'advanced', value: ''}
} : {index: -1, key: 'advanced', value: ''}
}
}
}
@ -287,7 +287,6 @@ pandora.Query = (function() {
find: constructFind(pandora.user.ui.query),
sort: (operator == pandora.getSortOperator(key) ? '' : operator) + key
});
} else {
return pandora.user.ui.item + '/' + pandora.user.ui.itemView;
}

View file

@ -18,7 +18,7 @@ pandora.UI = (function() {
pandora.user.ui = pandora.site.user.ui;
pandora.user.ui._list = pandora.getListsState(pandora.user.ui.find);
pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find);
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
};
// sets pandora.user.ui.key to val

View file

@ -124,7 +124,6 @@ pandora.URL = (function() {
pandora.user.ui._list = pandora.getListsState(pandora.user.ui.find);
pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find);
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
} else {
/*
pandora.UI.set({
@ -166,7 +165,7 @@ pandora.URL = (function() {
callback && callback();
} else {
var set = {
section: state.type == pandora.site.itemsSection ? 'items' : state.type,
item: state.item,
@ -243,7 +242,7 @@ pandora.URL = (function() {
}
pandora.user.ui.showHome = false;
}
that.init = function() {
@ -417,7 +416,7 @@ pandora.URL = (function() {
} else {
action = 'push';
}
self.URL[action](getState(), pandora.getPageTitle(), getState(/*keys*/));
self.URL[action](getState(), pandora.getPageTitle(), getState(/*keys*/));
}
};

View file

@ -271,7 +271,7 @@ pandora.ui.accountForm = function(action, value) {
labelWidth: 120,
validate: pandora.validateUser('username', true),
width: 320
});
});
} else if (type == 'usernameOrEmail') {
return Ox.FormElementGroup({
id: 'usernameOrEmail',
@ -310,7 +310,7 @@ pandora.ui.accountForm = function(action, value) {
});
}
}
return that;
return that;
};
pandora.ui.accountSignoutDialog = function() {

View file

@ -115,7 +115,7 @@ pandora.ui.browser = function() {
},
select: function(data) {
pandora.UI.set({
'item': data.ids[0]
'item': data.ids[0]
});
},
toggle: function(data) {

View file

@ -190,7 +190,7 @@ pandora.ui.clipList = function(videoRatio) {
}
},
pandora_itemsort: function(data) {
that.options({sort: data.value});
that.options({sort: data.value});
},
pandora_listsort: function(data) {
that.options({sort: data.value});

View file

@ -39,7 +39,7 @@ pandora.ui.clipPlayer = function() {
pandora.api.get({id: id, keys: ['durations']}, function(result) {
//Ox.print('API get item', id, 'result', result.data);
var points = [item['in'], item.out],
partsAndPoints = pandora.getVideoPartsAndPoints(result.data.durations, points);
partsAndPoints = pandora.getVideoPartsAndPoints(result.data.durations, points);
data[i] = {
parts: partsAndPoints.parts.map(function(i) {
var part = (i + 1),

View file

@ -59,7 +59,7 @@ pandora.ui.eventsDialog = function() {
$content;
pandora.api.findEvents({
query: {conditions: [], operator: '&'}
query: {conditions: [], operator: '&'}
}, function(result) {
pandora.api.findEvents({
query: {conditions: [], operator: '&'},

View file

@ -125,7 +125,7 @@ pandora.ui.filesView = function(options, self) {
{
align: 'right',
format: {type: 'value', args: ['B']},
id: 'size',
id: 'size',
operator: '-',
title: 'Size',
visible: true,

View file

@ -46,7 +46,6 @@ pandora.ui.filter = function(list) {
pandora.$ui.groups.forEach(function($group) {
$group.reloadList();
});
});
} else {
pandora.UI.set({find: data.query});

View file

@ -139,7 +139,7 @@ pandora.ui.findElement = function() {
callback(result.data.items);
});
} else {
callback([]);
callback([]);
}
} : null;
}

View file

@ -240,7 +240,7 @@ pandora.ui.folderList = function(id) {
min: 0,
pageLength: 1000,
//selected: pandora.getListData().folder == id ? [pandora.user.ui._list] : [],
sort: [{key: 'position', operator: '+'}],
sort: [{key: 'position', operator: '+'}],
sortable: id != 'featured' || pandora.user.level == 'admin'
})
.css({
@ -296,7 +296,6 @@ pandora.ui.folderList = function(id) {
//var $list = pandora.$ui.folderList[id];
if (data.key == 'user') {
pandora.$ui.listDialog = pandora.ui.listDialog('icon').open();
} else if (data.key == 'type') {
if (that.value(data.id, 'type') == 'smart') {
pandora.$ui.listDialog = pandora.ui.listDialog('query').open();

View file

@ -32,5 +32,4 @@ pandora.ui.helpDialog = function() {
content.html('Help is coming soon...')
});
return that;
};

View file

@ -157,7 +157,7 @@ pandora.ui.home = function() {
pandora.URL.push('/signup');
that.fadeOutScreen();
}
}),
}),
$signinButton = Ox.Button({
title: 'Sign In',
width: 74
@ -176,7 +176,7 @@ pandora.ui.home = function() {
pandora.URL.push('/signin');
that.fadeOutScreen();
}
}),
}),
$preferencesButton = Ox.Button({
title: 'Preferences',
width: 156
@ -195,7 +195,7 @@ pandora.ui.home = function() {
pandora.URL.push('/preferences');
that.fadeOutScreen();
}
}),
}),
$aboutButton = Ox.Button({
title: 'About ' + pandora.site.site.name,
width: 156
@ -228,7 +228,7 @@ pandora.ui.home = function() {
height: '16px',
margin: 'auto',
opacity: 0,
textAlign: 'center'
textAlign: 'center'
})
.appendTo(that);
@ -276,5 +276,5 @@ pandora.ui.home = function() {
};
return that;
};

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.info = function() {
var ui = pandora.user.ui,
view = getView(),
@ -63,7 +63,7 @@ pandora.ui.info = function() {
function updateInfo() {
var id = getId(),
previousView = view;
view = getView();
view = getView();
if (view == 'list') {
that.empty().append(pandora.$ui.listInfo = pandora.ui.listInfo());
previousView == 'video' && resizeInfo();

View file

@ -141,7 +141,7 @@ pandora.ui.infoView = function(data) {
format: function(value) {
return formatTitle(value);
},
tooltip: isEditable ? 'Doubleclick to edit' : '',
tooltip: isEditable ? 'Doubleclick to edit' : '',
value: data.title
})
.css({
@ -411,7 +411,7 @@ pandora.ui.infoView = function(data) {
)
.appendTo($text);
});
$('<div>').css({height: '16px'}).appendTo($text);
// Hue, Saturation, Lightness, Volume --------------------------------------
@ -469,7 +469,7 @@ pandora.ui.infoView = function(data) {
})
)
.appendTo($statistics);
}
$('<div>').css({height: '16px'}).appendTo($statistics);
@ -738,7 +738,6 @@ pandora.ui.infoView = function(data) {
})
.appendTo($info);
});
}
function renderRightsLevel() {
@ -794,7 +793,7 @@ pandora.ui.infoView = function(data) {
left: margin + iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
borderRadius: borderRadius + 'px'
borderRadius: borderRadius + 'px'
}, 250);
$reflection.animate({
top: margin + iconHeight + 'px',

View file

@ -98,7 +98,7 @@ pandora.ui.item = function() {
labelWidth: 100,
value: result.data[key.id],
type: 'text',
width: 500
width: 500
});
}),
separators: [
@ -126,7 +126,7 @@ pandora.ui.item = function() {
pandora.api.edit(Ox.extend(changed, {id: pandora.user.ui.item}), function(result) {
//fixme just reload parts that need reloading
window.location.reload();
});
});
}
}
}));
@ -280,7 +280,6 @@ pandora.ui.item = function() {
//fixme: check that edit was successfull
pandora.api.editAnnotation(data, function(result) {
Ox.print('done updateAnnotation', result);
});
},
pandora_showannotations: function(data) {

View file

@ -115,7 +115,7 @@ pandora.ui.list = function() {
pandora.UI.set({listColumns: data.ids});
/*
data.ids.forEach(function(id) {
columnWidth[id] =
columnWidth[id] =
pandora.user.ui.lists[pandora.user.ui.list].columnWidth[id]
|| Ox.getObjectById(pandora.site.sortKeys, id).width
});
@ -515,7 +515,7 @@ pandora.ui.list = function() {
pandora.$ui.mainMenu.enableItem('openmovie');
} else {
pandora.$ui.mainMenu.disableItem('copy');
pandora.$ui.mainMenu.disableItem('openmovie');
pandora.$ui.mainMenu.disableItem('openmovie');
}
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
pandora.api.find({
@ -540,7 +540,7 @@ pandora.ui.list = function() {
that.options({sort: data.value});
}
});
}
if (['grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) {

View file

@ -34,7 +34,7 @@ pandora.ui.mainPanel = function() {
}
if (!Ox.isEqual(data.find, previousUI._groupsState[i].find)) {
pandora.$ui.groups[i].reloadList();
}
}
});
} else {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());

View file

@ -98,7 +98,7 @@ pandora.ui.mediaView = function() {
function renderPreview() {
var previewWidth = pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 - listWidth,
previewHeight = pandora.$ui.contentPanel.size(1),
previewRatio = previewWidth / previewHeight,
previewRatio = previewWidth / previewHeight,
imageRatio = selectedImage.width / selectedImage.height,
imageWidth = imageRatio > previewRatio ? previewWidth : Math.round(previewHeight * imageRatio),
imageHeight = imageRatio < previewRatio ? previewHeight : Math.round(previewWidth / imageRatio),

View file

@ -190,7 +190,7 @@ pandora.ui.mainMenu = function() {
sort: [{key: key, operator: operator}]
});
groups[position].sort[0].key = key;
pandora.UI.set({groups: groups});
pandora.UI.set({groups: groups});
} else if (data.id == 'sortmovies') {
pandora.UI.set({listSort: [{key: value, operator: ''}]});
} else if (data.id == 'viewicons') {

View file

@ -29,7 +29,7 @@ pandora.ui.namesDialog = function() {
query: query
}), callback);
}
});
});
}
}),
@ -116,7 +116,7 @@ pandora.ui.namesDialog = function() {
})
}
}),
that = Ox.Dialog({
buttons: [
Ox.Button({

View file

@ -182,7 +182,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
);
// needed for resize handlers further up
pandora.$ui.map = $element;
} else {
pandora.api.findEvents({
@ -214,7 +214,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
);
// needed for resize handlers further up
pandora.$ui.calendar = $element;
});
});
}

View file

@ -140,5 +140,5 @@ pandora.ui.preferencesDialog = function() {
});
return $dialog;
};

View file

@ -90,5 +90,5 @@ pandora.ui.siteDialog = function(section) {
});
return $dialog;
};

View file

@ -6,7 +6,6 @@ pandora.ui.status = function(key, data) {
if (!pandora.user.ui.item && pandora.user.ui.listView == 'clip') {
itemName = data.items != 1 ? 'Clips' : 'Clip';
}
segments.push(Ox.formatNumber(data.items) + ' '+ itemName);
if (data.runtime)
segments.push(Ox.formatDuration(data.runtime, 'short'));

View file

@ -27,7 +27,7 @@ pandora.ui.titlesDialog = function() {
query: query
}), callback);
}
});
});
}
}),

View file

@ -11,7 +11,7 @@ pandora.ui.toolbar = function() {
pandora.$ui.backButton = pandora.ui.backButton()
);
that.append(
pandora.$ui.viewSelect = pandora.ui.viewSelect()
pandora.$ui.viewSelect = pandora.ui.viewSelect()
);
if (!ui.item || pandora.isClipView()) {
that.append(
@ -38,7 +38,7 @@ pandora.ui.toolbar = function() {
// fixme: maybe there's a better method name for this?
pandora.api.updateExternalData({
id: ui.item
}, function(result) {
}, function(result) {
Ox.Request.clearCache(item);
if (ui.item == item && ui.itemView == 'info') {
pandora.$ui.contentPanel.replaceElement(

View file

@ -210,7 +210,7 @@ pandora.ui.usersDialog = function() {
$status.html(
Ox.formatNumber(numberOfUsers)
+ ' user' + (numberOfUsers == 1 ? '' : 's')
+ ' (' + Ox.formatNumber(numberOfUsers) + ' registered, 0 guests)'
+ ' (' + Ox.formatNumber(numberOfUsers) + ' registered, 0 guests)'
);
},
select: function(data) {
@ -305,7 +305,7 @@ pandora.ui.usersDialog = function() {
}
],
orientation: 'vertical'
})
})
},
{
element: Ox.SplitPanel({
@ -432,7 +432,7 @@ pandora.ui.usersDialog = function() {
} else {
data[event.id] = event.data.value;
}
$list.value(userData.id, event.id, data[event.id]);
$list.value(userData.id, event.id, data[event.id]);
pandora.api.editUser(data, function(result) {
Ox.Request.clearCache('findUsers');
});
@ -454,7 +454,7 @@ pandora.ui.usersDialog = function() {
query: query
}), callback);
}
});
});
}
return that;

View file

@ -87,7 +87,7 @@ pandora.addList = function() {
var posterFrames = result.data.items.map(function(item) {
return {item: item.id, position: item.posterFrame};
});
posterFrames = posterFrames.length == 1
posterFrames = posterFrames.length == 1
? Ox.repeat([posterFrames[0]], 4)
: posterFrames.length == 2
? [posterFrames[0], posterFrames[1], posterFrames[1], posterFrames[0]]
@ -128,7 +128,7 @@ pandora.addList = function() {
conditions: [{key: 'list', value: newList, operator: '=='}],
operator: '&'
}
});
});
}
}).reloadList();
}
@ -340,7 +340,7 @@ pandora.enableDragAndDrop = function($list, canMove) {
drag.item == 1 ? 'singular' : 'plural'
].toLowerCase()
) + '</br> to ' + (
drag.target && !drag.target.selected
drag.target && !drag.target.selected
? 'the list "' + drag.target.name + '"'
: 'another list'
);
@ -489,7 +489,7 @@ pandora.getInfoHeight = function(includeHidden) {
);
return (pandora.user.ui.showInfo || includeHidden) * Math.min(
isVideoPreview
? Math.round(pandora.user.ui.sidebarSize / (16/9)) + 16
? Math.round(pandora.user.ui.sidebarSize / (16/9)) + 16
: pandora.user.ui.sidebarSize,
window.innerHeight - 109 // 20 menu + 24 bar + 64 (4 closed folders) + 1 resizebar
);
@ -616,7 +616,7 @@ pandora.getMetadataByIdOrName = function(item, view, str, callback) {
pandora.getPageTitle = function(itemTitle) {
Ox.print('ITEM TITLES', itemTitles)
if (itemTitle) {
itemTitles[pandora.user.ui.item] = itemTitle
itemTitles[pandora.user.ui.item] = itemTitle
}
var parts = [pandora.site.site.name];
if (!pandora.user.ui.item) {
@ -760,7 +760,7 @@ pandora.resizeFolders = function() {
.resizeColumn('name', columnWidth.name);
} else {
$list.resizeColumn(id == 'favorite' ? 'id' : 'name', width - 96);
}
}
}
if (!pandora.user.ui.showFolder[pandora.user.ui.section][id]) {
pandora.$ui.folder[pos].update();

View file

@ -47,7 +47,7 @@ pandora.ui.viewSelect = function() {
pandora_itemview: function(data) {
that.selectItem(data.value);
}
});
});
return that;
};