Permalink
Browse files

Refs #314. Stabilized selection restoration after list operations.

Added the rangy selectionsaverestore library. It's awesome.
  • Loading branch information...
winhamwr committed Jan 11, 2012
1 parent 08025e7 commit cb2acf68b283b281fdaaf08e806e5192d42eca94
Showing with 453 additions and 177 deletions.
  1. +1 −0 Makefile
  2. +30 −26 src/test/load-src.dev.js
  3. +156 −102 src/test/unit/lists.js
  4. +71 −49 src/wymeditor/editor/base.js
  5. +195 −0 src/wymeditor/rangy/rangy-selectionsaverestore.js
View
@@ -4,6 +4,7 @@ BUILD_DIR = dist
JS_FILES = ${WYM_DIR}/core.js\
${WYM_DIR}/rangy/rangy-core.js\
+ ${WYM_DIR}/rangy/rangy-selectionsaverestore.js\
${WYM_DIR}/editor/base.js\
${WYM_DIR}/editor/ie.js\
${WYM_DIR}/editor/firefox.js\
View
@@ -8,40 +8,44 @@
function loadWymSrc(srcPath, extraRequirements, jqueryVersion) {
var requirements = [
- srcPath + 'wymeditor/rangy/rangy-core.js',
- srcPath + 'wymeditor/core.js',
- srcPath + 'wymeditor/editor/base.js',
- srcPath + 'wymeditor/editor/ie.js',
- srcPath + 'wymeditor/editor/firefox.js',
- srcPath + 'wymeditor/editor/opera.js',
- srcPath + 'wymeditor/editor/webkit.js',
- srcPath + 'wymeditor/parser/xml-helper.js',
- srcPath + 'wymeditor/parser/xhtml-validator.js',
- srcPath + 'wymeditor/parser/parallel-regex.js',
- srcPath + 'wymeditor/parser/state-stack.js',
- srcPath + 'wymeditor/parser/lexer.js',
- srcPath + 'wymeditor/parser/xhtml-lexer.js',
- srcPath + 'wymeditor/parser/xhtml-parser.js',
- srcPath + 'wymeditor/parser/xhtml-sax-listener.js',
- srcPath + 'wymeditor/parser/css-lexer.js',
- srcPath + 'wymeditor/parser/css-parser.js'
- ];
- var newJquery;
- if (typeof(jqueryVersion) == 'undefined') {
+ srcPath + 'wymeditor/rangy/rangy-core.js',
+ srcPath + 'wymeditor/rangy/rangy-selectionsaverestore.js',
+ srcPath + 'wymeditor/core.js',
+ srcPath + 'wymeditor/editor/base.js',
+ srcPath + 'wymeditor/editor/ie.js',
+ srcPath + 'wymeditor/editor/firefox.js',
+ srcPath + 'wymeditor/editor/opera.js',
+ srcPath + 'wymeditor/editor/webkit.js',
+ srcPath + 'wymeditor/parser/xml-helper.js',
+ srcPath + 'wymeditor/parser/xhtml-validator.js',
+ srcPath + 'wymeditor/parser/parallel-regex.js',
+ srcPath + 'wymeditor/parser/state-stack.js',
+ srcPath + 'wymeditor/parser/lexer.js',
+ srcPath + 'wymeditor/parser/xhtml-lexer.js',
+ srcPath + 'wymeditor/parser/xhtml-parser.js',
+ srcPath + 'wymeditor/parser/xhtml-sax-listener.js',
+ srcPath + 'wymeditor/parser/css-lexer.js',
+ srcPath + 'wymeditor/parser/css-parser.js'
+ ],
+ newJquery,
+ i,
+ allRequirements;
+
+ if (typeof jqueryVersion === 'undefined') {
newJquery = [srcPath + 'jquery/jquery.js'];
requirements = newJquery.concat(requirements);
} else {
newJquery = [
- 'https://ajax.googleapis.com/ajax/libs/jquery/' + jqueryVersion + '/jquery.min.js']
+ 'https://ajax.googleapis.com/ajax/libs/jquery/' + jqueryVersion + '/jquery.min.js'
+ ];
requirements = newJquery.concat(requirements);
}
- var allRequirements = requirements.concat(extraRequirements);
- for (var i=0; i < allRequirements.length; i++) {
+ allRequirements = requirements.concat(extraRequirements);
+ for (i = 0; i < allRequirements.length; i++) {
document.write(
- '<script type="text/javascript" src="' +
- allRequirements[i] +
- '"><\/script>'
+ '<script type="text/javascript" src="' + allRequirements[i] + '">' +
+ '<\/script>'
);
}
}
Oops, something went wrong.

0 comments on commit cb2acf6

Please sign in to comment.