Beta release
This commit is contained in:
parent
dcbd1c6ad5
commit
3c384739ee
26
Gruntfile.js
26
Gruntfile.js
@ -25,7 +25,7 @@ module.exports = function(grunt) {
|
||||
'public/res-min/**/*.js'
|
||||
]
|
||||
},
|
||||
client: ['public/**/*.js'],
|
||||
client: ['public/**/*.js']
|
||||
},
|
||||
requirejs: {
|
||||
compile: {
|
||||
@ -40,7 +40,7 @@ module.exports = function(grunt) {
|
||||
'css/css-builder',
|
||||
'less/lessc-server',
|
||||
'less/lessc'
|
||||
],
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -50,14 +50,14 @@ module.exports = function(grunt) {
|
||||
js: {
|
||||
space_before_conditional: false,
|
||||
keep_array_indentation: true,
|
||||
indentWithTabs: true,
|
||||
indentWithTabs: true
|
||||
}
|
||||
}
|
||||
},
|
||||
less: {
|
||||
compile: {
|
||||
options: {
|
||||
compress: true,
|
||||
compress: true
|
||||
},
|
||||
files: [
|
||||
{
|
||||
@ -67,14 +67,14 @@ module.exports = function(grunt) {
|
||||
'*.less'
|
||||
],
|
||||
dest: 'public/res-min/themes',
|
||||
ext: '.css',
|
||||
ext: '.css'
|
||||
},
|
||||
{
|
||||
src: 'public/res/styles/base.less',
|
||||
dest: 'public/res-min/themes/base.css',
|
||||
dest: 'public/res-min/themes/base.css'
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
'string-replace': {
|
||||
'constants': {
|
||||
@ -86,7 +86,7 @@ module.exports = function(grunt) {
|
||||
{
|
||||
pattern: /constants\.VERSION = .*/,
|
||||
replacement: 'constants.VERSION = "<%= pkg.version %>";'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -103,10 +103,10 @@ module.exports = function(grunt) {
|
||||
{
|
||||
pattern: /(#DynamicResourcesBegin\n)[\s\S]*(\n#DynamicResourcesEnd)/,
|
||||
replacement: '$1<%= resources %>$2'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
resources: {
|
||||
@ -137,7 +137,7 @@ module.exports = function(grunt) {
|
||||
'require.js'
|
||||
],
|
||||
dest: 'public/res-min/'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -161,7 +161,7 @@ module.exports = function(grunt) {
|
||||
],
|
||||
pushTo: 'origin'
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -1,5 +1,5 @@
|
||||
CACHE MANIFEST
|
||||
#Date Sun Apr 27 2014 13:44:57
|
||||
#Date Sun Apr 27 2014 21:00:22
|
||||
|
||||
CACHE:
|
||||
libs/MathJax/MathJax.js?config=TeX-AMS_HTML
|
||||
|
10135
public/res-min/main.js
10135
public/res-min/main.js
File diff suppressed because one or more lines are too long
@ -25,6 +25,7 @@ define([
|
||||
"extensions/workingIndicator",
|
||||
"extensions/notifications",
|
||||
"extensions/markdownExtra",
|
||||
"extensions/umlDiagrams",
|
||||
"extensions/toc",
|
||||
"extensions/mathJax",
|
||||
"extensions/emailConverter",
|
||||
|
@ -9,11 +9,8 @@ define([
|
||||
'google-code-prettify',
|
||||
'highlightjs',
|
||||
'crel',
|
||||
'sequence-diagram',
|
||||
'flow-chart',
|
||||
'text!html/tooltipMarkdownExtraDiagrams.html',
|
||||
'pagedown-extra'
|
||||
], function($, _, utils, logger, Extension, markdownExtraSettingsBlockHTML, prettify, hljs, crel, sequenceDiagram, flowChart, tooltipMarkdownExtraDiagramsHTML) {
|
||||
], function($, _, utils, logger, Extension, markdownExtraSettingsBlockHTML, prettify, hljs) {
|
||||
|
||||
var markdownExtra = new Extension("markdownExtra", "Markdown Extra", true);
|
||||
markdownExtra.settingsBlock = markdownExtraSettingsBlockHTML;
|
||||
@ -78,83 +75,15 @@ define([
|
||||
var previewContentsElt;
|
||||
markdownExtra.onReady = function() {
|
||||
previewContentsElt = document.getElementById('preview-contents');
|
||||
utils.createTooltip(".tooltip-markdown-extra-diagrams", tooltipMarkdownExtraDiagramsHTML);
|
||||
};
|
||||
|
||||
var onAsyncPreview = function(cb) {
|
||||
cb();
|
||||
};
|
||||
markdownExtra.onAsyncPreview = function(cb) {
|
||||
onAsyncPreview(cb);
|
||||
};
|
||||
|
||||
var extraOptions;
|
||||
markdownExtra.onInit = function() {
|
||||
var sequenceDiagramEltList, flowChartEltList;
|
||||
extraOptions = {
|
||||
extensions: markdownExtra.config.extensions
|
||||
};
|
||||
|
||||
function doSequenceDiagram(cb) {
|
||||
if(sequenceDiagramEltList.length === 0) {
|
||||
return cb();
|
||||
}
|
||||
var sequenceDiagramElt = sequenceDiagramEltList.pop();
|
||||
try {
|
||||
var diagram = sequenceDiagram.parse(sequenceDiagramElt.textContent);
|
||||
var preElt = sequenceDiagramElt.parentNode;
|
||||
var containerElt = crel('div', {
|
||||
class: 'sequence-diagram'
|
||||
});
|
||||
preElt.parentNode.replaceChild(containerElt, preElt);
|
||||
diagram.drawSVG(containerElt, {
|
||||
theme: 'simple'
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
_.delay(doSequenceDiagram, 0, cb);
|
||||
}
|
||||
|
||||
function doFlowChart(cb) {
|
||||
if(flowChartEltList.length === 0) {
|
||||
return cb();
|
||||
}
|
||||
var flowChartElt = flowChartEltList.pop();
|
||||
try {
|
||||
var chart = flowChart.parse(flowChartElt.textContent);
|
||||
var preElt = flowChartElt.parentNode;
|
||||
var containerElt = crel('div', {
|
||||
class: 'flow-chart'
|
||||
});
|
||||
preElt.parentNode.replaceChild(containerElt, preElt);
|
||||
chart.drawSVG(containerElt, {
|
||||
'line-width': 2
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
_.delay(doFlowChart, 0, cb);
|
||||
}
|
||||
|
||||
if(markdownExtra.config.diagrams) {
|
||||
extraOptions.highlighter = "prettify";
|
||||
var afterDiagrams = onAsyncPreview;
|
||||
onAsyncPreview = function(cb) {
|
||||
sequenceDiagramEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-sequence'));
|
||||
flowChartEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-flow'));
|
||||
_.delay(doSequenceDiagram, 0, function() {
|
||||
_.delay(doFlowChart, 0, function() {
|
||||
afterDiagrams(cb);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
markdownExtra.onPagedownConfigure = function(editor) {
|
||||
var converter = editor.getConverter();
|
||||
var extraOptions = {
|
||||
extensions: markdownExtra.config.extensions,
|
||||
highlighter: "prettify"
|
||||
};
|
||||
|
||||
if(markdownExtra.config.intraword === true) {
|
||||
var converterOptions = {
|
||||
_DoItalicsAndBold: function(text) {
|
||||
@ -173,7 +102,6 @@ define([
|
||||
});
|
||||
}
|
||||
if(markdownExtra.config.highlighter == "highlight") {
|
||||
extraOptions.highlighter = "prettify";
|
||||
var previewContentsElt = document.getElementById('preview-contents');
|
||||
editor.hooks.chain("onPreviewRefresh", function() {
|
||||
_.each(previewContentsElt.querySelectorAll('.prettyprint > code'), function(elt) {
|
||||
@ -183,7 +111,6 @@ define([
|
||||
});
|
||||
}
|
||||
else if(markdownExtra.config.highlighter == "prettify") {
|
||||
extraOptions.highlighter = "prettify";
|
||||
editor.hooks.chain("onPreviewRefresh", prettify.prettyPrint);
|
||||
}
|
||||
Markdown.Extra.init(converter, extraOptions);
|
||||
|
@ -3,7 +3,7 @@ define([
|
||||
"utils",
|
||||
"classes/Extension",
|
||||
"text!html/mathJaxSettingsBlock.html",
|
||||
"mathjax",
|
||||
"mathjax"
|
||||
], function(utils, Extension, mathJaxSettingsBlockHTML) {
|
||||
|
||||
var mathJax = new Extension("mathJax", "MathJax", true);
|
||||
|
91
public/res/extensions/umlDiagrams.js
Normal file
91
public/res/extensions/umlDiagrams.js
Normal file
@ -0,0 +1,91 @@
|
||||
define([
|
||||
"jquery",
|
||||
"underscore",
|
||||
"utils",
|
||||
"logger",
|
||||
"classes/Extension",
|
||||
"text!html/umlDiagramsSettingsBlock.html",
|
||||
'crel',
|
||||
'sequence-diagram',
|
||||
'flow-chart'
|
||||
], function($, _, utils, logger, Extension, umlDiagramsSettingsBlockHTML, crel, sequenceDiagram, flowChart) {
|
||||
|
||||
var umlDiagrams = new Extension("umlDiagrams", "UML Diagrams", true);
|
||||
umlDiagrams.settingsBlock = umlDiagramsSettingsBlockHTML;
|
||||
|
||||
var eventMgr;
|
||||
umlDiagrams.onEventMgrCreated = function(eventMgrParameter) {
|
||||
eventMgr = eventMgrParameter;
|
||||
};
|
||||
|
||||
var previewContentsElt;
|
||||
umlDiagrams.onReady = function() {
|
||||
previewContentsElt = document.getElementById('preview-contents');
|
||||
};
|
||||
|
||||
var onAsyncPreview = function(cb) {
|
||||
cb();
|
||||
};
|
||||
umlDiagrams.onAsyncPreview = function(cb) {
|
||||
onAsyncPreview(cb);
|
||||
};
|
||||
|
||||
umlDiagrams.onInit = function() {
|
||||
var sequenceDiagramEltList, flowChartEltList;
|
||||
function doSequenceDiagram(cb) {
|
||||
if(sequenceDiagramEltList.length === 0) {
|
||||
return cb();
|
||||
}
|
||||
var sequenceDiagramElt = sequenceDiagramEltList.pop();
|
||||
try {
|
||||
var diagram = sequenceDiagram.parse(sequenceDiagramElt.textContent);
|
||||
var preElt = sequenceDiagramElt.parentNode;
|
||||
var containerElt = crel('div', {
|
||||
class: 'sequence-diagram'
|
||||
});
|
||||
preElt.parentNode.replaceChild(containerElt, preElt);
|
||||
diagram.drawSVG(containerElt, {
|
||||
theme: 'simple'
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
_.delay(doSequenceDiagram, 0, cb);
|
||||
}
|
||||
|
||||
function doFlowChart(cb) {
|
||||
if(flowChartEltList.length === 0) {
|
||||
return cb();
|
||||
}
|
||||
var flowChartElt = flowChartEltList.pop();
|
||||
try {
|
||||
var chart = flowChart.parse(flowChartElt.textContent);
|
||||
var preElt = flowChartElt.parentNode;
|
||||
var containerElt = crel('div', {
|
||||
class: 'flow-chart'
|
||||
});
|
||||
preElt.parentNode.replaceChild(containerElt, preElt);
|
||||
chart.drawSVG(containerElt, {
|
||||
'line-width': 2
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
_.delay(doFlowChart, 0, cb);
|
||||
}
|
||||
|
||||
var afterDiagrams = onAsyncPreview;
|
||||
onAsyncPreview = function(cb) {
|
||||
sequenceDiagramEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-sequence'));
|
||||
flowChartEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-flow'));
|
||||
_.delay(doSequenceDiagram, 0, function() {
|
||||
_.delay(doFlowChart, 0, function() {
|
||||
afterDiagrams(cb);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return umlDiagrams;
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
You can create sequence diagrams like this:
|
||||
<br />
|
||||
<br />
|
||||
```sequence<br />
|
||||
Alice->Bob: Hello Bob, how are you?
|
||||
Bob-->Alice: I am good thanks!
|
||||
```<br />
|
||||
<a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a>
|
||||
<br />
|
||||
<br />
|
||||
Or flow charts like this:
|
||||
<br />
|
||||
<br />
|
||||
```flow<br />
|
||||
st=>start: Start<br />
|
||||
e=>end<br />
|
||||
op=>operation: My Operation<br />
|
||||
cond=>condition: Yes or No?<br />
|
||||
st->op->cond<br />
|
||||
cond(yes)->e<br />
|
||||
cond(no)->op<br />
|
||||
```<br />
|
||||
<a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a>
|
24
public/res/html/umlDiagramsSettingsBlock.html
Normal file
24
public/res/html/umlDiagramsSettingsBlock.html
Normal file
@ -0,0 +1,24 @@
|
||||
<p>Creates UML diagrams from plain text description.</p>
|
||||
|
||||
<p>Sequence diagrams:</p>
|
||||
<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence
|
||||
Alice->Bob: Hello Bob, how are you?
|
||||
Bob-->Alice: I am good thanks!
|
||||
```</code>
|
||||
</pre>
|
||||
|
||||
<p>Flow charts:</p>
|
||||
<pre><div class="help-block pull-right"><a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a></div><code>```flow
|
||||
st=>start: Start
|
||||
e=>end
|
||||
op=>operation: My Operation
|
||||
cond=>condition: Yes or No?
|
||||
st->op->cond
|
||||
cond(yes)->e
|
||||
cond(no)->op
|
||||
```</code>
|
||||
</pre>
|
||||
<blockquote>
|
||||
<b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.
|
||||
</blockquote>
|
||||
|
@ -1,4 +1,5 @@
|
||||
MathJax.Hub.Config({
|
||||
skipStartupTypeset: true,
|
||||
"HTML-CSS": {
|
||||
preferredFont: "TeX",
|
||||
availableFonts: [
|
||||
|
11
public/res/libs/sequence-diagram.js
Normal file
11
public/res/libs/sequence-diagram.js
Normal file
@ -0,0 +1,11 @@
|
||||
// Hack to make js-sequence-diagram AMD friendly
|
||||
define([
|
||||
'text!bower-libs/js-sequence-diagrams/build/sequence-diagram-min.js',
|
||||
'raphael',
|
||||
'underscore'
|
||||
], function(sequenceDiagramMinJS) {
|
||||
/*jshint evil: true */
|
||||
eval(sequenceDiagramMinJS);
|
||||
return window.Diagram;
|
||||
});
|
||||
|
@ -1,181 +1,176 @@
|
||||
// RequireJS configuration
|
||||
/*global requirejs */
|
||||
requirejs.config({
|
||||
waitSeconds: 0,
|
||||
packages: [
|
||||
{
|
||||
name: 'css',
|
||||
location: 'bower-libs/require-css',
|
||||
main: 'css'
|
||||
},
|
||||
{
|
||||
name: 'less',
|
||||
location: 'bower-libs/require-less',
|
||||
main: 'less'
|
||||
}
|
||||
],
|
||||
paths: {
|
||||
jquery: 'bower-libs/jquery/jquery',
|
||||
underscore: 'bower-libs/underscore/underscore',
|
||||
crel: 'bower-libs/crel/crel',
|
||||
jgrowl: 'bower-libs/jgrowl/jquery.jgrowl',
|
||||
mousetrap: 'bower-libs/mousetrap/mousetrap',
|
||||
'mousetrap-record': 'bower-libs/mousetrap/plugins/record/mousetrap-record',
|
||||
toMarkdown: 'bower-libs/to-markdown/src/to-markdown',
|
||||
text: 'bower-libs/requirejs-text/text',
|
||||
mathjax: '../libs/MathJax/MathJax.js?config=TeX-AMS_HTML',
|
||||
bootstrap: 'bower-libs/bootstrap/dist/js/bootstrap',
|
||||
requirejs: 'bower-libs/requirejs/require',
|
||||
'google-code-prettify': 'bower-libs/google-code-prettify/src/prettify',
|
||||
highlightjs: 'libs/highlight/highlight.pack',
|
||||
'jquery-waitforimages': 'bower-libs/waitForImages/src/jquery.waitforimages',
|
||||
'jquery-ui': 'bower-libs/jquery-ui/ui/jquery-ui',
|
||||
'jquery-ui-core': 'bower-libs/jquery-ui/ui/jquery.ui.core',
|
||||
'jquery-ui-widget': 'bower-libs/jquery-ui/ui/jquery.ui.widget',
|
||||
'jquery-ui-mouse': 'bower-libs/jquery-ui/ui/jquery.ui.mouse',
|
||||
'jquery-ui-draggable': 'bower-libs/jquery-ui/ui/jquery.ui.draggable',
|
||||
'jquery-ui-effect': 'bower-libs/jquery-ui/ui/jquery.ui.effect',
|
||||
'jquery-ui-effect-slide': 'bower-libs/jquery-ui/ui/jquery.ui.effect-slide',
|
||||
FileSaver: 'bower-libs/FileSaver/FileSaver',
|
||||
stacktrace: 'bower-libs/stacktrace/stacktrace',
|
||||
'requirejs-text': 'bower-libs/requirejs-text/text',
|
||||
'bootstrap-tour': 'bower-libs/bootstrap-tour/build/js/bootstrap-tour',
|
||||
css_browser_selector: 'bower-libs/css_browser_selector/css_browser_selector',
|
||||
'pagedown-extra': 'bower-libs/pagedown-extra/Markdown.Extra',
|
||||
pagedown: 'libs/Markdown.Editor',
|
||||
'require-css': 'bower-libs/require-css/css',
|
||||
xregexp: 'bower-libs/xregexp/xregexp-all',
|
||||
yaml: 'bower-libs/yaml.js',
|
||||
'yaml.js': 'bower-libs/yaml.js',
|
||||
'yaml-js': 'bower-libs/yaml.js/bin/yaml',
|
||||
css: 'bower-libs/require-css/css',
|
||||
'css-builder': 'bower-libs/require-css/css-builder',
|
||||
normalize: 'bower-libs/require-css/normalize',
|
||||
prism: 'bower-libs/prism/prism',
|
||||
'prism-core': 'bower-libs/prism/components/prism-core',
|
||||
MutationObservers: 'bower-libs/MutationObservers/MutationObserver',
|
||||
WeakMap: 'bower-libs/WeakMap/weakmap',
|
||||
rangy: 'bower-libs/rangy/rangy-core',
|
||||
'rangy-cssclassapplier': 'bower-libs/rangy/rangy-cssclassapplier',
|
||||
diff_match_patch: 'bower-libs/google-diff-match-patch-js/diff_match_patch',
|
||||
diff_match_patch_uncompressed: 'bower-libs/google-diff-match-patch-js/diff_match_patch_uncompressed',
|
||||
jsondiffpatch: 'bower-libs/jsondiffpatch/build/bundle',
|
||||
hammerjs: 'bower-libs/hammerjs/hammer',
|
||||
'sequence-diagram': 'bower-libs/js-sequence-diagrams/build/sequence-diagram-min',
|
||||
raphael: 'bower-libs/raphael/raphael',
|
||||
'flow-chart': 'bower-libs/flowchart/release/flowchart.amd-1.2.10.min',
|
||||
flowchart: 'bower-libs/flowchart/release/flowchart-1.2.10.min'
|
||||
},
|
||||
shim: {
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
mathjax: [
|
||||
'libs/mathjax_init'
|
||||
],
|
||||
jgrowl: {
|
||||
deps: [
|
||||
'jquery'
|
||||
],
|
||||
exports: 'jQuery.jGrowl'
|
||||
},
|
||||
diff_match_patch_uncompressed: {
|
||||
exports: 'diff_match_patch'
|
||||
},
|
||||
jsondiffpatch: [
|
||||
'diff_match_patch_uncompressed'
|
||||
],
|
||||
rangy: {
|
||||
exports: 'rangy'
|
||||
},
|
||||
'rangy-cssclassapplier': [
|
||||
'rangy'
|
||||
],
|
||||
mousetrap: {
|
||||
exports: 'Mousetrap'
|
||||
},
|
||||
'yaml-js': {
|
||||
exports: 'YAML'
|
||||
},
|
||||
'prism-core': {
|
||||
exports: 'Prism'
|
||||
},
|
||||
'bower-libs/prism/components/prism-markup': [
|
||||
'prism-core'
|
||||
],
|
||||
'libs/prism-latex': [
|
||||
'prism-core'
|
||||
],
|
||||
'libs/prism-markdown': [
|
||||
'bower-libs/prism/components/prism-markup',
|
||||
'libs/prism-latex'
|
||||
],
|
||||
'bootstrap-record': [
|
||||
'mousetrap'
|
||||
],
|
||||
toMarkdown: {
|
||||
deps: [
|
||||
'jquery'
|
||||
],
|
||||
exports: 'toMarkdown'
|
||||
},
|
||||
stacktrace: {
|
||||
exports: 'printStackTrace'
|
||||
},
|
||||
FileSaver: {
|
||||
exports: 'saveAs'
|
||||
},
|
||||
MutationObservers: [
|
||||
'WeakMap'
|
||||
],
|
||||
highlightjs: {
|
||||
exports: 'hljs'
|
||||
},
|
||||
'bootstrap-tour': {
|
||||
deps: [
|
||||
'bootstrap'
|
||||
],
|
||||
exports: 'Tour'
|
||||
},
|
||||
bootstrap: [
|
||||
'jquery'
|
||||
],
|
||||
'jquery-waitforimages': [
|
||||
'jquery'
|
||||
],
|
||||
pagedown: [
|
||||
'libs/Markdown.Converter'
|
||||
],
|
||||
'pagedown-extra': [
|
||||
'libs/Markdown.Converter'
|
||||
],
|
||||
'sequence-diagram': {
|
||||
deps: [
|
||||
'underscore',
|
||||
'raphael'
|
||||
],
|
||||
exports: 'Diagram'
|
||||
},
|
||||
'flow-chart': [
|
||||
'raphael'
|
||||
],
|
||||
}
|
||||
waitSeconds: 0,
|
||||
packages: [
|
||||
{
|
||||
name: 'css',
|
||||
location: 'bower-libs/require-css',
|
||||
main: 'css'
|
||||
},
|
||||
{
|
||||
name: 'less',
|
||||
location: 'bower-libs/require-less',
|
||||
main: 'less'
|
||||
}
|
||||
],
|
||||
paths: {
|
||||
jquery: 'bower-libs/jquery/jquery',
|
||||
underscore: 'bower-libs/underscore/underscore',
|
||||
crel: 'bower-libs/crel/crel',
|
||||
jgrowl: 'bower-libs/jgrowl/jquery.jgrowl',
|
||||
mousetrap: 'bower-libs/mousetrap/mousetrap',
|
||||
'mousetrap-record': 'bower-libs/mousetrap/plugins/record/mousetrap-record',
|
||||
toMarkdown: 'bower-libs/to-markdown/src/to-markdown',
|
||||
text: 'bower-libs/requirejs-text/text',
|
||||
mathjax: '../libs/MathJax/MathJax.js?config=TeX-AMS_HTML',
|
||||
bootstrap: 'bower-libs/bootstrap/dist/js/bootstrap',
|
||||
requirejs: 'bower-libs/requirejs/require',
|
||||
'google-code-prettify': 'bower-libs/google-code-prettify/src/prettify',
|
||||
highlightjs: 'libs/highlight/highlight.pack',
|
||||
'jquery-waitforimages': 'bower-libs/waitForImages/src/jquery.waitforimages',
|
||||
'jquery-ui': 'bower-libs/jquery-ui/ui/jquery-ui',
|
||||
'jquery-ui-core': 'bower-libs/jquery-ui/ui/jquery.ui.core',
|
||||
'jquery-ui-widget': 'bower-libs/jquery-ui/ui/jquery.ui.widget',
|
||||
'jquery-ui-mouse': 'bower-libs/jquery-ui/ui/jquery.ui.mouse',
|
||||
'jquery-ui-draggable': 'bower-libs/jquery-ui/ui/jquery.ui.draggable',
|
||||
'jquery-ui-effect': 'bower-libs/jquery-ui/ui/jquery.ui.effect',
|
||||
'jquery-ui-effect-slide': 'bower-libs/jquery-ui/ui/jquery.ui.effect-slide',
|
||||
FileSaver: 'bower-libs/FileSaver/FileSaver',
|
||||
stacktrace: 'bower-libs/stacktrace/stacktrace',
|
||||
'requirejs-text': 'bower-libs/requirejs-text/text',
|
||||
'bootstrap-tour': 'bower-libs/bootstrap-tour/build/js/bootstrap-tour',
|
||||
css_browser_selector: 'bower-libs/css_browser_selector/css_browser_selector',
|
||||
'pagedown-extra': 'bower-libs/pagedown-extra/Markdown.Extra',
|
||||
pagedown: 'libs/Markdown.Editor',
|
||||
'require-css': 'bower-libs/require-css/css',
|
||||
xregexp: 'bower-libs/xregexp/xregexp-all',
|
||||
yaml: 'bower-libs/yaml.js',
|
||||
'yaml.js': 'bower-libs/yaml.js',
|
||||
'yaml-js': 'bower-libs/yaml.js/bin/yaml',
|
||||
css: 'bower-libs/require-css/css',
|
||||
'css-builder': 'bower-libs/require-css/css-builder',
|
||||
normalize: 'bower-libs/require-css/normalize',
|
||||
prism: 'bower-libs/prism/prism',
|
||||
'prism-core': 'bower-libs/prism/components/prism-core',
|
||||
MutationObservers: 'bower-libs/MutationObservers/MutationObserver',
|
||||
WeakMap: 'bower-libs/WeakMap/weakmap',
|
||||
rangy: 'bower-libs/rangy/rangy-core',
|
||||
'rangy-cssclassapplier': 'bower-libs/rangy/rangy-cssclassapplier',
|
||||
diff_match_patch: 'bower-libs/google-diff-match-patch-js/diff_match_patch',
|
||||
diff_match_patch_uncompressed: 'bower-libs/google-diff-match-patch-js/diff_match_patch_uncompressed',
|
||||
jsondiffpatch: 'bower-libs/jsondiffpatch/build/bundle',
|
||||
hammerjs: 'bower-libs/hammerjs/hammer',
|
||||
'sequence-diagram': 'libs/sequence-diagram',
|
||||
raphael: 'bower-libs/raphael/raphael',
|
||||
'flow-chart': 'bower-libs/flowchart/release/flowchart.amd-1.2.10.min',
|
||||
flowchart: 'bower-libs/flowchart/release/flowchart-1.2.10.min'
|
||||
},
|
||||
shim: {
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
mathjax: [
|
||||
'libs/mathjax_init'
|
||||
],
|
||||
jgrowl: {
|
||||
deps: [
|
||||
'jquery'
|
||||
],
|
||||
exports: 'jQuery.jGrowl'
|
||||
},
|
||||
diff_match_patch_uncompressed: {
|
||||
exports: 'diff_match_patch'
|
||||
},
|
||||
jsondiffpatch: [
|
||||
'diff_match_patch_uncompressed'
|
||||
],
|
||||
rangy: {
|
||||
exports: 'rangy'
|
||||
},
|
||||
'rangy-cssclassapplier': [
|
||||
'rangy'
|
||||
],
|
||||
mousetrap: {
|
||||
exports: 'Mousetrap'
|
||||
},
|
||||
'yaml-js': {
|
||||
exports: 'YAML'
|
||||
},
|
||||
'prism-core': {
|
||||
exports: 'Prism'
|
||||
},
|
||||
'bower-libs/prism/components/prism-markup': [
|
||||
'prism-core'
|
||||
],
|
||||
'libs/prism-latex': [
|
||||
'prism-core'
|
||||
],
|
||||
'libs/prism-markdown': [
|
||||
'bower-libs/prism/components/prism-markup',
|
||||
'libs/prism-latex'
|
||||
],
|
||||
'bootstrap-record': [
|
||||
'mousetrap'
|
||||
],
|
||||
toMarkdown: {
|
||||
deps: [
|
||||
'jquery'
|
||||
],
|
||||
exports: 'toMarkdown'
|
||||
},
|
||||
stacktrace: {
|
||||
exports: 'printStackTrace'
|
||||
},
|
||||
FileSaver: {
|
||||
exports: 'saveAs'
|
||||
},
|
||||
MutationObservers: [
|
||||
'WeakMap'
|
||||
],
|
||||
highlightjs: {
|
||||
exports: 'hljs'
|
||||
},
|
||||
'bootstrap-tour': {
|
||||
deps: [
|
||||
'bootstrap'
|
||||
],
|
||||
exports: 'Tour'
|
||||
},
|
||||
bootstrap: [
|
||||
'jquery'
|
||||
],
|
||||
'jquery-waitforimages': [
|
||||
'jquery'
|
||||
],
|
||||
pagedown: [
|
||||
'libs/Markdown.Converter'
|
||||
],
|
||||
'pagedown-extra': [
|
||||
'libs/Markdown.Converter'
|
||||
],
|
||||
'flow-chart': [
|
||||
'raphael'
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// Check browser compatibility
|
||||
try {
|
||||
var test = 'seLocalStorageCheck';
|
||||
localStorage.setItem(test, test);
|
||||
localStorage.removeItem(test);
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'prop', {
|
||||
get: function() {},
|
||||
set: function() {}
|
||||
});
|
||||
var test = 'seLocalStorageCheck';
|
||||
localStorage.setItem(test, test);
|
||||
localStorage.removeItem(test);
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'prop', {
|
||||
get: function() {
|
||||
},
|
||||
set: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
alert('Your browser is not supported, sorry!');
|
||||
throw e;
|
||||
catch(e) {
|
||||
alert('Your browser is not supported, sorry!');
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Viewer mode is deduced from the body class
|
||||
@ -184,34 +179,44 @@ window.viewerMode = /(^| )viewer($| )/.test(document.body.className);
|
||||
// Keep the theme in a global variable
|
||||
window.theme = localStorage.themeV3 || 'default';
|
||||
var themeModule = "less!themes/" + window.theme;
|
||||
if (window.baseDir.indexOf('-min') !== -1) {
|
||||
themeModule = "css!themes/" + window.theme;
|
||||
if(window.baseDir.indexOf('-min') !== -1) {
|
||||
themeModule = "css!themes/" + window.theme;
|
||||
}
|
||||
|
||||
// RequireJS entry point. By requiring synchronizer, publisher and
|
||||
// media-importer, we are actually loading all the modules
|
||||
require(["jquery", "rangy", "core", "eventMgr", "synchronizer", "publisher", "mediaImporter", "css", "rangy-cssclassapplier",
|
||||
themeModule, ], function($, rangy, core, eventMgr) {
|
||||
require([
|
||||
"jquery",
|
||||
"rangy",
|
||||
"core",
|
||||
"eventMgr",
|
||||
"synchronizer",
|
||||
"publisher",
|
||||
"mediaImporter",
|
||||
"css",
|
||||
"rangy-cssclassapplier",
|
||||
themeModule,
|
||||
], function($, rangy, core, eventMgr) {
|
||||
|
||||
if(window.noStart) {
|
||||
return;
|
||||
}
|
||||
if(window.noStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
rangy.init();
|
||||
$(function() {
|
||||
rangy.init();
|
||||
|
||||
// Here, all the modules are loaded and the DOM is ready
|
||||
core.onReady();
|
||||
// Here, all the modules are loaded and the DOM is ready
|
||||
core.onReady();
|
||||
|
||||
// If browser has detected a new application cache.
|
||||
if (window.applicationCache) {
|
||||
window.applicationCache.addEventListener('updateready', function() {
|
||||
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
||||
window.applicationCache.swapCache();
|
||||
eventMgr.onMessage('New version available!\nJust refresh the page to upgrade.');
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
// If browser has detected a new application cache.
|
||||
if(window.applicationCache) {
|
||||
window.applicationCache.addEventListener('updateready', function() {
|
||||
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
||||
window.applicationCache.swapCache();
|
||||
eventMgr.onMessage('New version available!\nJust refresh the page to upgrade.');
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user