|
|
@ -4,6 +4,7 @@ define([
|
|
|
|
'/bower_components/nthen/index.js',
|
|
|
|
'/bower_components/nthen/index.js',
|
|
|
|
'/common/sframe-common.js',
|
|
|
|
'/common/sframe-common.js',
|
|
|
|
'/common/sframe-app-framework.js',
|
|
|
|
'/common/sframe-app-framework.js',
|
|
|
|
|
|
|
|
'/common/sframe-common-codemirror.js',
|
|
|
|
'/common/common-util.js',
|
|
|
|
'/common/common-util.js',
|
|
|
|
'/common/common-hash.js',
|
|
|
|
'/common/common-hash.js',
|
|
|
|
'/common/modes.js',
|
|
|
|
'/common/modes.js',
|
|
|
@ -42,6 +43,7 @@ define([
|
|
|
|
nThen,
|
|
|
|
nThen,
|
|
|
|
SFCommon,
|
|
|
|
SFCommon,
|
|
|
|
Framework,
|
|
|
|
Framework,
|
|
|
|
|
|
|
|
SFCodeMirror,
|
|
|
|
Util,
|
|
|
|
Util,
|
|
|
|
Hash,
|
|
|
|
Hash,
|
|
|
|
Modes,
|
|
|
|
Modes,
|
|
|
@ -258,11 +260,11 @@ define([
|
|
|
|
mkFilePicker(framework, editor, evModeChange);
|
|
|
|
mkFilePicker(framework, editor, evModeChange);
|
|
|
|
|
|
|
|
|
|
|
|
if (!framework.isReadOnly()) {
|
|
|
|
if (!framework.isReadOnly()) {
|
|
|
|
CodeMirror.configureTheme(function () {
|
|
|
|
CodeMirror.configureTheme(common, function () {
|
|
|
|
CodeMirror.configureLanguage(null, evModeChange.fire);
|
|
|
|
CodeMirror.configureLanguage(common, null, evModeChange.fire);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
CodeMirror.configureTheme();
|
|
|
|
CodeMirror.configureTheme(common);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////
|
|
|
|
////
|
|
|
@ -345,7 +347,6 @@ define([
|
|
|
|
var main = function () {
|
|
|
|
var main = function () {
|
|
|
|
var CodeMirror;
|
|
|
|
var CodeMirror;
|
|
|
|
var editor;
|
|
|
|
var editor;
|
|
|
|
var common;
|
|
|
|
|
|
|
|
var framework;
|
|
|
|
var framework;
|
|
|
|
|
|
|
|
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
@ -370,20 +371,14 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
$(waitFor());
|
|
|
|
$(waitFor());
|
|
|
|
// TODO(cjd): This is crap but we cannot bring up codemirror until after
|
|
|
|
|
|
|
|
// the CryptPad Common is up and we can't bring up framework
|
|
|
|
|
|
|
|
// without codemirror.
|
|
|
|
|
|
|
|
SFCommon.create(waitFor(function (c) { common = c; }));
|
|
|
|
|
|
|
|
}).nThen(function () {
|
|
|
|
}).nThen(function () {
|
|
|
|
CodeMirror = common.initCodeMirrorApp(null, CMeditor);
|
|
|
|
CodeMirror = SFCodeMirror.create(null, CMeditor);
|
|
|
|
$('#cp-app-code-container').addClass('cp-app-code-fullpage');
|
|
|
|
$('#cp-app-code-container').addClass('cp-app-code-fullpage');
|
|
|
|
editor = CodeMirror.editor;
|
|
|
|
editor = CodeMirror.editor;
|
|
|
|
}).nThen(waitFor());
|
|
|
|
}).nThen(waitFor());
|
|
|
|
|
|
|
|
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
|
|
|
|
common.getSframeChannel().onReady(waitFor());
|
|
|
|
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|
common.isPresentUrl(function (err, val) {
|
|
|
|
framework._.sfCommon.isPresentUrl(function (err, val) {
|
|
|
|
andThen2(editor, CodeMirror, framework, val);
|
|
|
|
andThen2(editor, CodeMirror, framework, val);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|