Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed May 1, 2017
1 parent 2be5ee2 commit aff9feb
Show file tree
Hide file tree
Showing 307 changed files with 61,397 additions and 7,741 deletions.
5 changes: 2 additions & 3 deletions BuildPackages.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
@SET FrameworkVersion=v4.0.30319
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
@SET LANGDIR=EN
@SET MSBUILDPATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe"

"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" WatchersNET.CKEditor.sln /p:Configuration=Deploy /t:Clean;Build /p:WarningLevel=0 /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9
%MSBUILDPATH% WatchersNET.CKEditor.sln /p:Configuration=Deploy /t:Clean;Build /p:WarningLevel=0 /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9
2 changes: 1 addition & 1 deletion CKEditor/plugins/autosave/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
onOk: function() {
if (localStorage.getItem(autoSaveKey)) {
var jsonSavedContent = LoadData(autoSaveKey);
editorInstance.loadSnapshot(jsonSavedContent.data);
editorInstance.setData(jsonSavedContent.data);

RemoveStorage(autoSaveKey, editorInstance);
}
Expand Down
99 changes: 63 additions & 36 deletions CKEditor/plugins/codemirror/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
autoCloseTags: true,
autoFormatOnStart: false,
autoFormatOnUncomment: true,
autoLoadCodeMirror: true,
continueComments: true,
enableCodeFolding: true,
enableCodeFormatting: true,
Expand Down Expand Up @@ -188,34 +189,43 @@
// Load the content
this.setValueOf('main', 'data', oldData = editor.getData());

if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
}
if (config.autoLoadCodeMirror) {

if (config.theme.length && config.theme != 'default' && !IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
}
if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
}

if (typeof (CodeMirror) == 'undefined') {
if (config.theme.length &&
config.theme != 'default' &&
!IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
}

CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js', function() {
if (typeof (CodeMirror) == 'undefined') {

CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
loadCodeMirrorInline(editor, textArea);
});
});
CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js',
function() {

CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
function() {
loadCodeMirrorInline(editor, textArea);
});
});


} else {
//loadCodeMirrorInline(editor, textArea);
if (CodeMirror.prototype['autoFormatAll']) {
loadCodeMirrorInline(editor, textArea);
} else {
// loading the add-on scripts.
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
//loadCodeMirrorInline(editor, textArea);
if (CodeMirror.prototype['autoFormatAll']) {
loadCodeMirrorInline(editor, textArea);
});
} else {
// loading the add-on scripts.
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
function() {
loadCodeMirrorInline(editor, textArea);
});
}
}

}
},
onCancel: function (event) {
Expand Down Expand Up @@ -255,8 +265,11 @@

// Avoid unnecessary setData. Also preserve selection
// when user changed his mind and goes back to wysiwyg editing.
if (newData === oldData)
if (newData === oldData) {
editor.fire('blur', this);
editor.fire('focus', this);
return true;
}

// Set data asynchronously to avoid errors in IE.
CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(setData, 0, this, newData) : setData.call(this, newData);
Expand Down Expand Up @@ -529,33 +542,42 @@
}

editor.addMode('source', function (callback) {
if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
if (!config.autoLoadCodeMirror) {
return;
}

if (config.theme.length && config.theme != 'default' && !IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
}
if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
}

if (config.theme.length &&
config.theme != 'default' &&
!IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
}

if (typeof (CodeMirror) == 'undefined') {

CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js', function() {
CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js',
function() {

CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
loadCodeMirror(editor);
callback();
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
function() {
loadCodeMirror(editor);
callback();
});
});
});
} else {
if (CodeMirror.prototype['autoFormatAll']) {
loadCodeMirror(editor);
callback();
} else {
// loading the add-on scripts.
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
loadCodeMirror(editor);
callback();
});
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
function() {
loadCodeMirror(editor);
callback();
});
}
}
});
Expand Down Expand Up @@ -600,6 +622,12 @@
}

break;
case "twig":
{
scriptFiles.push(rootPath + 'js/codemirror.mode.twig.min.js');
}

break;
default:
scriptFiles.push(rootPath + 'js/codemirror.mode.htmlmixed.min.js');
}
Expand Down Expand Up @@ -920,8 +948,7 @@

editor.on('instanceReady', function (evt) {

// Fix native context menu
editor.container.getPrivate().events.contextmenu.listeners.splice(0, 1);
//editor.container.getPrivate().events.contextmenu.listeners.splice(0, 1);

var selectAllCommand = editor.commands.selectAll;

Expand Down
Loading

0 comments on commit aff9feb

Please sign in to comment.