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

Commit aff9feb

Browse files
committed
updates
1 parent 2be5ee2 commit aff9feb

File tree

307 files changed

+61397
-7741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+61397
-7741
lines changed

BuildPackages.bat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
2-
@SET FrameworkVersion=v4.0.30319
31
@SET FrameworkSDKDir=
42
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
53
@SET LANGDIR=EN
4+
@SET MSBUILDPATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe"
65

7-
"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
6+
%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

CKEditor/plugins/autosave/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
onOk: function() {
146146
if (localStorage.getItem(autoSaveKey)) {
147147
var jsonSavedContent = LoadData(autoSaveKey);
148-
editorInstance.loadSnapshot(jsonSavedContent.data);
148+
editorInstance.setData(jsonSavedContent.data);
149149

150150
RemoveStorage(autoSaveKey, editorInstance);
151151
}

CKEditor/plugins/codemirror/plugin.js

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
autoCloseTags: true,
1919
autoFormatOnStart: false,
2020
autoFormatOnUncomment: true,
21+
autoLoadCodeMirror: true,
2122
continueComments: true,
2223
enableCodeFolding: true,
2324
enableCodeFormatting: true,
@@ -188,34 +189,43 @@
188189
// Load the content
189190
this.setValueOf('main', 'data', oldData = editor.getData());
190191

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

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

199-
if (typeof (CodeMirror) == 'undefined') {
198+
if (config.theme.length &&
199+
config.theme != 'default' &&
200+
!IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
201+
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
202+
}
200203

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

203-
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
204-
loadCodeMirrorInline(editor, textArea);
205-
});
206-
});
206+
CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js',
207+
function() {
208+
209+
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
210+
function() {
211+
loadCodeMirrorInline(editor, textArea);
212+
});
213+
});
207214

208215

209-
} else {
210-
//loadCodeMirrorInline(editor, textArea);
211-
if (CodeMirror.prototype['autoFormatAll']) {
212-
loadCodeMirrorInline(editor, textArea);
213216
} else {
214-
// loading the add-on scripts.
215-
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
217+
//loadCodeMirrorInline(editor, textArea);
218+
if (CodeMirror.prototype['autoFormatAll']) {
216219
loadCodeMirrorInline(editor, textArea);
217-
});
220+
} else {
221+
// loading the add-on scripts.
222+
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
223+
function() {
224+
loadCodeMirrorInline(editor, textArea);
225+
});
226+
}
218227
}
228+
219229
}
220230
},
221231
onCancel: function (event) {
@@ -255,8 +265,11 @@
255265

256266
// Avoid unnecessary setData. Also preserve selection
257267
// when user changed his mind and goes back to wysiwyg editing.
258-
if (newData === oldData)
268+
if (newData === oldData) {
269+
editor.fire('blur', this);
270+
editor.fire('focus', this);
259271
return true;
272+
}
260273

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

531544
editor.addMode('source', function (callback) {
532-
if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
533-
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
545+
if (!config.autoLoadCodeMirror) {
546+
return;
534547
}
535548

536-
if (config.theme.length && config.theme != 'default' && !IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
537-
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
538-
}
549+
if (!IsStyleSheetAlreadyLoaded(rootPath + 'css/codemirror.min.css')) {
550+
CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
551+
}
552+
553+
if (config.theme.length &&
554+
config.theme != 'default' &&
555+
!IsStyleSheetAlreadyLoaded(rootPath + 'theme/' + config.theme + '.css')) {
556+
CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
557+
}
539558

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

542-
CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js', function() {
561+
CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js',
562+
function() {
543563

544-
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
545-
loadCodeMirror(editor);
546-
callback();
564+
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
565+
function() {
566+
loadCodeMirror(editor);
567+
callback();
568+
});
547569
});
548-
});
549570
} else {
550571
if (CodeMirror.prototype['autoFormatAll']) {
551572
loadCodeMirror(editor);
552573
callback();
553574
} else {
554575
// loading the add-on scripts.
555-
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
556-
loadCodeMirror(editor);
557-
callback();
558-
});
576+
CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
577+
function() {
578+
loadCodeMirror(editor);
579+
callback();
580+
});
559581
}
560582
}
561583
});
@@ -600,6 +622,12 @@
600622
}
601623

602624
break;
625+
case "twig":
626+
{
627+
scriptFiles.push(rootPath + 'js/codemirror.mode.twig.min.js');
628+
}
629+
630+
break;
603631
default:
604632
scriptFiles.push(rootPath + 'js/codemirror.mode.htmlmixed.min.js');
605633
}
@@ -920,8 +948,7 @@
920948

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

923-
// Fix native context menu
924-
editor.container.getPrivate().events.contextmenu.listeners.splice(0, 1);
951+
//editor.container.getPrivate().events.contextmenu.listeners.splice(0, 1);
925952

926953
var selectAllCommand = editor.commands.selectAll;
927954

0 commit comments

Comments
 (0)