update text panel

This commit is contained in:
rolux 2013-02-21 18:44:33 +05:30
parent 00fee0f55d
commit 701caae2aa

View file

@ -22,9 +22,13 @@ pandora.ui.textPanel = function() {
pandora.api.getText({id: pandora.user.ui.text}, function(result) { pandora.api.getText({id: pandora.user.ui.text}, function(result) {
Ox.print('TEXT:', result.data);
var text = result.data, var text = result.data,
embedURLs = getEmbedURLs(text.text), embedURLs = text.type == 'html'
? getEmbedURLs(text.text)
: text.urls,
$toolbar = Ox.Bar({size: 24}), $toolbar = Ox.Bar({size: 24}),
@ -162,9 +166,11 @@ pandora.ui.textHTML = function(text, tags) {
.css({margin: '16px'}), .css({margin: '16px'}),
$title = Ox.Editable({ $title = Ox.Editable({
editable: text.editable,
height: 32, height: 32,
placeholder: text.editable ? 'Doubleclick to edit title' : 'Untitled', placeholder: text.editable ? 'Doubleclick to edit title' : 'Untitled',
tooltip: text.editable ? 'Doubleclick to edit title' : '', tooltip: text.editable ? 'Doubleclick to edit title' : '',
value: text.name,
width: width width: width
}) })
.css({ .css({
@ -216,7 +222,8 @@ pandora.ui.textHTML = function(text, tags) {
tags: tags, tags: tags,
tooltip: text.editable ? 'Doubleclick to edit text' : '', tooltip: text.editable ? 'Doubleclick to edit text' : '',
type: 'textarea', type: 'textarea',
width: width width: width,
value: text.text
}) })
.css({ .css({
//position: 'absolute', //position: 'absolute',
@ -272,6 +279,8 @@ pandora.ui.textPDF = function(text) {
pandora.ui.textEmbed = function(url) { pandora.ui.textEmbed = function(url) {
// url = 'http://0xdb.local/0084628/player/00:10:00,00:10:00,00:20:00#?embed=true&matchRatio=true&showAnnotations=true&showLayers=["subtitles"]&showTimeline=true&title=Hello World "Hello"';
var that = Ox.Element() var that = Ox.Element()
.bindEvent({ .bindEvent({
resizestart: function() { resizestart: function() {
@ -297,7 +306,10 @@ pandora.ui.textEmbed = function(url) {
height: '100%', height: '100%',
frameborder: 0, frameborder: 0,
src: '', src: '',
width: '100%' width: '100%',
allowFullScreen: true,
mozallowfullscreen: true,
webkitAllowFullScreen: true
}) })
.hide() .hide()
.appendTo(that), .appendTo(that),