CGI-Application-Plugin-AJAXUpload
view release on metacpan or search on metacpan
example/httpdocs/js/editor.js view on Meta::CPAN
YAHOO.namespace("periapt");
YAHOO.periapt.Editor = function(elementId) {
YAHOO.widget.Editor.superclass.constructor.call(this, elementId, {
width: 450,
handleSubmit: true,
animate: true //Animates the opening, closing and moving of Editor windows
});
this._defaultToolbar.titlebar = false;
this._defaultToolbar.buttons = [
{ group: 'textstyle', label: 'Font Style',
buttons: [
{ type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
{ type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }
]
},
{ type: 'separator' },
{ group: 'parastyle', label: 'Paragraph Style',
buttons: [
{ type: 'select', label: 'Normal', value: 'heading', disabled: true,
menu: [
{ text: 'Normal', value: 'none', checked: true },
{ text: 'Subheading', value: 'h3' }
]
}
]
},
{ type: 'separator' },
{ group: 'indentlist', label: 'Lists',
buttons: [
{ type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
]
},
{ type: 'separator' },
{ group: 'insertitem', label: 'Insert Item',
buttons: [
{ type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
{ type: 'push', label: 'Insert Image', value: 'insertimage' }
]
}
];
this.on('toolbarLoaded', function() {
this.toolbar.on ('createlinkClick', function(o) {
try {
var Dom=YAHOO.util.Dom;
var labels = Dom.getElementsBy(
function(o) {
return true;
},
'label',
elementId + '-panel'
);
for(var l = 0; l < labels.length; l++) {
if (Dom.getElementsBy(
function(o) {
if (o.id == elementId+"_createlink_target") {
return true;
}
return false;
},
'input',
labels[l]
).length > 0) {
labels[l].className="hide";
}
}
}
catch(l) {
alert(l.message);
}
});
this.toolbar.on ('insertimageClick', function(o) {
( run in 1.621 second using v1.01-cache-2.11-cpan-39bf76dae61 )