Incuriosito da una discussione di ieri ho provato questo editor di testo e mi sono subito innamorato.
Funziona tutto perfettamente e ho anche aggiunto nuovi bottoni, l'unica cosa è che il tasto inserisci video mi restituisce il seguente codice html [video:http://www.youtube.com/watch?v=test8OI-s] che non viene correttamente interpretato da drupal (ovviamente in full html), lo riconosce come semplice testo
Bueditor inserimento video
Sab, 08/01/2011 - 22:25
#1
Bueditor inserimento video
Inserisci questo codice :
js:
var S = E.getSelection();
var M = S.match(new RegExp('^\\[video:([^\\] ]*)([^\\]]*)]$')) || ['', '', ''];
var A = {};
M[2] && $.each(M[2].split(' '), function(i, val) {if (val) {
var p = val.split(':');
p[0] && p[1] && (A[p[0]] = p[1]);
}});
var form = [
{name: 'video', title: 'Video URL', value: M[1] || 'Inserisci qui stringa youtube', required: true, attributes: {size: 32}},
{name: 'width', title: 'Width x Height', suffix: ' x ', getnext: true, attributes: {size: 3}, value: A.width || '640'},
{name: 'height', attributes: {size: 3}, value: A.height || '385'}
];
E.tagDialog('video', form, {title: 'Inserisci video', submit: function(tag, form) {
for (var el, i = 0, arr = []; el = form.elements[i]; i++) {
if (el.name.substr(0, 5) == 'attr_' && el.value) {
arr.push(el.name.substr(5) +':'+ el.value);
}
}
E.replaceSelection('['+ arr.join(' ') +']');
}})
carica anche un bottone.
----------------------------------------
bI’Iqchugh’ yIvang !
Se sei triste, agisci!
Proverbio Klingon
è proprio questo il codice che avevo inserito, ma i video non li visualizza..
Togli "Correggi html" da full html
----------------------------------------
bI’Iqchugh’ yIvang !
Se sei triste, agisci!
Proverbio Klingon