remove unused code

This commit is contained in:
j 2013-02-23 11:38:54 +00:00
parent d2a922bec4
commit 1e17102e4b

View file

@ -1,81 +0,0 @@
'use strict';
// FIXME: REMOVE
pandora.ui.text = function() {
var ui = pandora.user.ui,
canEdit = pandora.site.capabilities.canEditSitePages[pandora.user.level],
that,
text,
$text;
getText(ui.text);
that = Ox.Element()
.bindEvent({
pandora_text: function(data) {
if (ui.text != text) {
text = ui.text;
getText(ui.text);
}
}
});
function getText(id) {
pandora.api.getText({id: id}, function(result) {
if (!result.data) {
pandora.UI.set({text: ''});
} else if (result.data.type == 'pdf') {
$text && $text.remove();
$text = Ox.Element().appendTo(that);
if(result.data.available) {
$text.append(
$('<iframe>').attr({
src: '/text/' + ui.text + '/text.pdf',
frameBorder: 0
}).css({
width: '100%',
height: '100%'
})
);
} else {
Ox.FileButton({
maxFiles: 1,
title: 'Select PDF'
}).bindEvent({
click: function(data) {
if(data.files.length) {
pandora.$ui.uploadPDFDialog = pandora.ui.uploadPDFDialog({
file: data.files[0],
id: ui.text
}).open();
}
}
}).appendTo($text);
}
} else {
var text = result.data ? result.data.text : '';
$text && $text.remove();
$text = Ox.Editable({
clickLink: pandora.clickLink,
editable: canEdit,
tooltip: canEdit ? 'Doubleclick to edit' : '',
type: 'textarea',
placeholder: 'No text',
value: text
})
.bindEvent({
submit: function(data) {
Ox.Request.clearCache('getText');
pandora.api.editText({
id: ui.text,
text: data.value
});
}
})
.appendTo(that);
}
});
}
return that;
}