Edit File by line
/home/zeestwma/richards.../wp-inclu.../js/tinymce/plugins/fullscre...
File: plugin.js
(function () {
[0] Fix | Delete
var fullscreen = (function (domGlobals) {
[1] Fix | Delete
'use strict';
[2] Fix | Delete
[3] Fix | Delete
var Cell = function (initial) {
[4] Fix | Delete
var value = initial;
[5] Fix | Delete
var get = function () {
[6] Fix | Delete
return value;
[7] Fix | Delete
};
[8] Fix | Delete
var set = function (v) {
[9] Fix | Delete
value = v;
[10] Fix | Delete
};
[11] Fix | Delete
var clone = function () {
[12] Fix | Delete
return Cell(get());
[13] Fix | Delete
};
[14] Fix | Delete
return {
[15] Fix | Delete
get: get,
[16] Fix | Delete
set: set,
[17] Fix | Delete
clone: clone
[18] Fix | Delete
};
[19] Fix | Delete
};
[20] Fix | Delete
[21] Fix | Delete
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
[22] Fix | Delete
[23] Fix | Delete
var get = function (fullscreenState) {
[24] Fix | Delete
return {
[25] Fix | Delete
isFullscreen: function () {
[26] Fix | Delete
return fullscreenState.get() !== null;
[27] Fix | Delete
}
[28] Fix | Delete
};
[29] Fix | Delete
};
[30] Fix | Delete
var Api = { get: get };
[31] Fix | Delete
[32] Fix | Delete
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
[33] Fix | Delete
[34] Fix | Delete
var fireFullscreenStateChanged = function (editor, state) {
[35] Fix | Delete
editor.fire('FullscreenStateChanged', { state: state });
[36] Fix | Delete
};
[37] Fix | Delete
var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
[38] Fix | Delete
[39] Fix | Delete
var DOM = global$1.DOM;
[40] Fix | Delete
var getWindowSize = function () {
[41] Fix | Delete
var w;
[42] Fix | Delete
var h;
[43] Fix | Delete
var win = domGlobals.window;
[44] Fix | Delete
var doc = domGlobals.document;
[45] Fix | Delete
var body = doc.body;
[46] Fix | Delete
if (body.offsetWidth) {
[47] Fix | Delete
w = body.offsetWidth;
[48] Fix | Delete
h = body.offsetHeight;
[49] Fix | Delete
}
[50] Fix | Delete
if (win.innerWidth && win.innerHeight) {
[51] Fix | Delete
w = win.innerWidth;
[52] Fix | Delete
h = win.innerHeight;
[53] Fix | Delete
}
[54] Fix | Delete
return {
[55] Fix | Delete
w: w,
[56] Fix | Delete
h: h
[57] Fix | Delete
};
[58] Fix | Delete
};
[59] Fix | Delete
var getScrollPos = function () {
[60] Fix | Delete
var vp = DOM.getViewPort();
[61] Fix | Delete
return {
[62] Fix | Delete
x: vp.x,
[63] Fix | Delete
y: vp.y
[64] Fix | Delete
};
[65] Fix | Delete
};
[66] Fix | Delete
var setScrollPos = function (pos) {
[67] Fix | Delete
domGlobals.window.scrollTo(pos.x, pos.y);
[68] Fix | Delete
};
[69] Fix | Delete
var toggleFullscreen = function (editor, fullscreenState) {
[70] Fix | Delete
var body = domGlobals.document.body;
[71] Fix | Delete
var documentElement = domGlobals.document.documentElement;
[72] Fix | Delete
var editorContainerStyle;
[73] Fix | Delete
var editorContainer, iframe, iframeStyle;
[74] Fix | Delete
var fullscreenInfo = fullscreenState.get();
[75] Fix | Delete
var resize = function () {
[76] Fix | Delete
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
[77] Fix | Delete
};
[78] Fix | Delete
var removeResize = function () {
[79] Fix | Delete
DOM.unbind(domGlobals.window, 'resize', resize);
[80] Fix | Delete
};
[81] Fix | Delete
editorContainer = editor.getContainer();
[82] Fix | Delete
editorContainerStyle = editorContainer.style;
[83] Fix | Delete
iframe = editor.getContentAreaContainer().firstChild;
[84] Fix | Delete
iframeStyle = iframe.style;
[85] Fix | Delete
if (!fullscreenInfo) {
[86] Fix | Delete
var newFullScreenInfo = {
[87] Fix | Delete
scrollPos: getScrollPos(),
[88] Fix | Delete
containerWidth: editorContainerStyle.width,
[89] Fix | Delete
containerHeight: editorContainerStyle.height,
[90] Fix | Delete
iframeWidth: iframeStyle.width,
[91] Fix | Delete
iframeHeight: iframeStyle.height,
[92] Fix | Delete
resizeHandler: resize,
[93] Fix | Delete
removeHandler: removeResize
[94] Fix | Delete
};
[95] Fix | Delete
iframeStyle.width = iframeStyle.height = '100%';
[96] Fix | Delete
editorContainerStyle.width = editorContainerStyle.height = '';
[97] Fix | Delete
DOM.addClass(body, 'mce-fullscreen');
[98] Fix | Delete
DOM.addClass(documentElement, 'mce-fullscreen');
[99] Fix | Delete
DOM.addClass(editorContainer, 'mce-fullscreen');
[100] Fix | Delete
DOM.bind(domGlobals.window, 'resize', resize);
[101] Fix | Delete
editor.on('remove', removeResize);
[102] Fix | Delete
resize();
[103] Fix | Delete
fullscreenState.set(newFullScreenInfo);
[104] Fix | Delete
Events.fireFullscreenStateChanged(editor, true);
[105] Fix | Delete
} else {
[106] Fix | Delete
iframeStyle.width = fullscreenInfo.iframeWidth;
[107] Fix | Delete
iframeStyle.height = fullscreenInfo.iframeHeight;
[108] Fix | Delete
if (fullscreenInfo.containerWidth) {
[109] Fix | Delete
editorContainerStyle.width = fullscreenInfo.containerWidth;
[110] Fix | Delete
}
[111] Fix | Delete
if (fullscreenInfo.containerHeight) {
[112] Fix | Delete
editorContainerStyle.height = fullscreenInfo.containerHeight;
[113] Fix | Delete
}
[114] Fix | Delete
DOM.removeClass(body, 'mce-fullscreen');
[115] Fix | Delete
DOM.removeClass(documentElement, 'mce-fullscreen');
[116] Fix | Delete
DOM.removeClass(editorContainer, 'mce-fullscreen');
[117] Fix | Delete
setScrollPos(fullscreenInfo.scrollPos);
[118] Fix | Delete
DOM.unbind(domGlobals.window, 'resize', fullscreenInfo.resizeHandler);
[119] Fix | Delete
editor.off('remove', fullscreenInfo.removeHandler);
[120] Fix | Delete
fullscreenState.set(null);
[121] Fix | Delete
Events.fireFullscreenStateChanged(editor, false);
[122] Fix | Delete
}
[123] Fix | Delete
};
[124] Fix | Delete
var Actions = { toggleFullscreen: toggleFullscreen };
[125] Fix | Delete
[126] Fix | Delete
var register = function (editor, fullscreenState) {
[127] Fix | Delete
editor.addCommand('mceFullScreen', function () {
[128] Fix | Delete
Actions.toggleFullscreen(editor, fullscreenState);
[129] Fix | Delete
});
[130] Fix | Delete
};
[131] Fix | Delete
var Commands = { register: register };
[132] Fix | Delete
[133] Fix | Delete
var postRender = function (editor) {
[134] Fix | Delete
return function (e) {
[135] Fix | Delete
var ctrl = e.control;
[136] Fix | Delete
editor.on('FullscreenStateChanged', function (e) {
[137] Fix | Delete
ctrl.active(e.state);
[138] Fix | Delete
});
[139] Fix | Delete
};
[140] Fix | Delete
};
[141] Fix | Delete
var register$1 = function (editor) {
[142] Fix | Delete
editor.addMenuItem('fullscreen', {
[143] Fix | Delete
text: 'Fullscreen',
[144] Fix | Delete
shortcut: 'Ctrl+Shift+F',
[145] Fix | Delete
selectable: true,
[146] Fix | Delete
cmd: 'mceFullScreen',
[147] Fix | Delete
onPostRender: postRender(editor),
[148] Fix | Delete
context: 'view'
[149] Fix | Delete
});
[150] Fix | Delete
editor.addButton('fullscreen', {
[151] Fix | Delete
active: false,
[152] Fix | Delete
tooltip: 'Fullscreen',
[153] Fix | Delete
cmd: 'mceFullScreen',
[154] Fix | Delete
onPostRender: postRender(editor)
[155] Fix | Delete
});
[156] Fix | Delete
};
[157] Fix | Delete
var Buttons = { register: register$1 };
[158] Fix | Delete
[159] Fix | Delete
global.add('fullscreen', function (editor) {
[160] Fix | Delete
var fullscreenState = Cell(null);
[161] Fix | Delete
if (editor.settings.inline) {
[162] Fix | Delete
return Api.get(fullscreenState);
[163] Fix | Delete
}
[164] Fix | Delete
Commands.register(editor, fullscreenState);
[165] Fix | Delete
Buttons.register(editor);
[166] Fix | Delete
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
[167] Fix | Delete
return Api.get(fullscreenState);
[168] Fix | Delete
});
[169] Fix | Delete
function Plugin () {
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
return Plugin;
[173] Fix | Delete
[174] Fix | Delete
}(window));
[175] Fix | Delete
})();
[176] Fix | Delete
[177] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function