-
+/* global tinymce */
(function() {
+ var mouse = {};
+
tinymce.create('tinymce.plugins.wpEditImage', {
url: '',
editor: {},
init: function(ed, url) {
- var t = this, mouse = {};
+ var t = this;
t.url = url;
t.editor = ed;
// when pressing Return inside a caption move the caret to a new parapraph under it
ed.dom.events.add(ed.getBody(), 'keydown', function(e) {
- var n, DL, DIV, P, content;
+ var n, DL, DIV, P;
if ( e.keyCode == 13 ) {
n = ed.selection.getNode();
// When inserting content, if the caret is inside a caption create new paragraph under
// and move the caret there
- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
+ ed.onBeforeExecCommand.add( function( ed, cmd ) {
var node, p;
if ( cmd == 'mceInsertContent' ) {
title : ed.getLang('wpeditimage.edit_img')
});
- tinymce.dom.Event.add(editButton, 'mousedown', function(e) {
+ tinymce.dom.Event.add(editButton, 'mousedown', function() {
t._editImage();
ed.plugins.wordpress._hideButtons();
});
title : ed.getLang('wpeditimage.del_img')
});
- tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
+ tinymce.dom.Event.add(dellButton, 'mousedown', function() {
var ed = tinymce.activeEditor, el = ed.selection.getNode(), parent;
if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
author : 'WordPress',
authorurl : 'http://wordpress.org',
infourl : '',
- version : "1.0"
+ version : '1.0'
};
}
});