From 8152605e5a510feb525e7d0238acb1da530d7cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Thu, 27 Aug 2015 00:10:37 +0200 Subject: [PATCH 001/103] Fix Emmet expand by forcing syntax to html when editor is set to Twig. --- .../codeeditor/assets/js/codeeditor.js | 18 ++ .../codeeditor/assets/vendor/ace/ext-emmet.js | 59 ++-- .../codeeditor/assets/vendor/emmet/emmet.js | 259 +++++++++--------- 3 files changed, 176 insertions(+), 160 deletions(-) diff --git a/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js b/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js index 70299753f..d19228864 100644 --- a/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js +++ b/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js @@ -338,6 +338,24 @@ this.editor.focus() } + // FIX EMMET HTML WHEN SYNTAX IS TWIG + // ================================== + + +function (exports) { + if (exports.ace && typeof exports.ace.require == 'function') { + var emmetExt = exports.ace.require('ace/ext/emmet') + + if (emmetExt && emmetExt.AceEmmetEditor && emmetExt.AceEmmetEditor.prototype.getSyntax) { + var coreGetSyntax = emmetExt.AceEmmetEditor.prototype.getSyntax + + emmetExt.AceEmmetEditor.prototype.getSyntax = function () { + var $syntax = $.proxy(coreGetSyntax, this)() + return $syntax == 'twig' ? 'html' : $syntax + }; + } + } + }(window) + // CODEEDITOR PLUGIN DEFINITION // ============================ diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js index 5616386bf..1f463a7ac 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js @@ -16,7 +16,7 @@ var SnippetManager = function() { (function() { oop.implement(this, EventEmitter); - + this.getTokenizer = function() { function TabstopToken(str, _, stack) { str = str.substr(1); @@ -239,7 +239,7 @@ var SnippetManager = function() { var line = editor.session.getLine(cursor.row); var tabString = editor.session.getTabString(); var indentString = line.match(/^\s*/)[0]; - + if (cursor.column < indentString.length) indentString = indentString.slice(0, cursor.column); @@ -271,7 +271,7 @@ var SnippetManager = function() { return; var value = tokens.slice(i + 1, i1); - var isNested = value.some(function(t) {return typeof t === "object"}); + var isNested = value.some(function(t) {return typeof t === "object"}); if (isNested && !ts.value) { ts.value = value; } else if (value.length && (!ts.value || typeof ts.value !== "string")) { @@ -305,7 +305,7 @@ var SnippetManager = function() { expanding[id] = null; continue; } - + var ts = tabstops[id]; var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); arg.unshift(i + 1, Math.max(0, i1 - i)); @@ -340,16 +340,16 @@ var SnippetManager = function() { var selectionId = editor.inVirtualSelectionMode && editor.selection.index; tabstopManager.addTabstops(tabstops, range.start, end, selectionId); }; - + this.insertSnippet = function(editor, snippetText) { var self = this; if (editor.inVirtualSelectionMode) return self.insertSnippetForSelection(editor, snippetText); - + editor.forEachSelection(function() { self.insertSnippetForSelection(editor, snippetText); }, null, {keepOrder: true}); - + if (editor.tabstopManager) editor.tabstopManager.tabNext(); }; @@ -358,7 +358,7 @@ var SnippetManager = function() { var scope = editor.session.$mode.$id || ""; scope = scope.split("/").pop(); if (scope === "html" || scope === "php") { - if (scope === "php" && !editor.session.$mode.inlinePhp) + if (scope === "php" && !editor.session.$mode.inlinePhp) scope = "html"; var c = editor.getCursorPosition(); var state = editor.session.getState(c.row); @@ -374,7 +374,7 @@ var SnippetManager = function() { scope = "php"; } } - + return scope; }; @@ -398,7 +398,7 @@ var SnippetManager = function() { editor.tabstopManager.tabNext(); return result; }; - + this.expandSnippetForSelection = function(editor, options) { var cursor = editor.getCursorPosition(); var line = editor.session.getLine(cursor.row); @@ -454,10 +454,10 @@ var SnippetManager = function() { var snippetMap = this.snippetMap; var snippetNameMap = this.snippetNameMap; var self = this; - - if (!snippets) + + if (!snippets) snippets = []; - + function wrapRegexp(src) { if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) src = "(?:" + src + ")"; @@ -514,7 +514,7 @@ var SnippetManager = function() { addSnippet(snippets); else if (Array.isArray(snippets)) snippets.forEach(addSnippet); - + this._signal("registerSnippets", {scope: scope}); }; this.unregister = function(snippets, scope) { @@ -731,9 +731,9 @@ var TabstopManager = function(editor) { ts = this.tabstops[this.index]; if (!ts || !ts.length) return; - + this.selectedTabstop = ts; - if (!this.editor.inVirtualSelectionMode) { + if (!this.editor.inVirtualSelectionMode) { var sel = this.editor.multiSelect; sel.toSingleRange(ts.firstNonLinked.clone()); for (var i = ts.length; i--;) { @@ -746,7 +746,7 @@ var TabstopManager = function(editor) { } else { this.editor.selection.setRange(ts.firstNonLinked); } - + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); }; this.addTabstops = function(tabstops, start, end) { @@ -765,7 +765,7 @@ var TabstopManager = function(editor) { var ranges = this.ranges; tabstops.forEach(function(ts, index) { var dest = this.$openTabstops[index] || ts; - + for (var i = ts.length; i--;) { var p = ts[i]; var range = Range.fromPoints(p.start, p.end || p.start); @@ -792,7 +792,7 @@ var TabstopManager = function(editor) { } this.addTabstopMarkers(dest); }, this); - + if (arg.length > 2) { if (this.tabstops.length) arg.push(arg.splice(2, 1)[0]); @@ -860,7 +860,7 @@ changeTracker.setPosition = function(row, column) { }; changeTracker.update = function(pos, delta, $insertRight) { this.$insertRight = $insertRight; - this.pos = pos; + this.pos = pos; this.onChange(delta); }; @@ -961,15 +961,15 @@ AceEmmetEditor.prototype = { if (end == null) end = start == null ? this.getContent().length : start; if (start == null) - start = 0; - + start = 0; + var editor = this.ace; var doc = editor.session.doc; var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end)); editor.session.remove(range); - + range.end = range.start; - + value = this.$updateTabstops(value); snippetManager.insertSnippet(editor, value); }, @@ -1061,7 +1061,7 @@ AceEmmetEditor.prototype = { } else if (lastZero) { value = emmet.require('utils').replaceSubstring(value, '${0}', lastZero); } - + return value; } }; @@ -1101,23 +1101,23 @@ exports.runEmmetCommand = function(editor) { if (editorProxy.getSyntax() == "php") return false; var actions = emmet.require("actions"); - + if (this.action == "expand_abbreviation_with_tab") { if (!editor.selection.isEmpty()) return false; } - + if (this.action == "wrap_with_abbreviation") { return setTimeout(function() { actions.run("wrap_with_abbreviation", editorProxy); }, 0); } - + var pos = editor.selection.lead; var token = editor.session.getTokenAt(pos.row, pos.column); if (token && /\btag\b/.test(token.type)) return false; - + var result = actions.run(this.action, editorProxy); } catch(e) { editor._signal("changeStatus", typeof e == "string" ? e : e.message); @@ -1187,4 +1187,3 @@ exports.setCore = function(e) { (function() { ace.require(["ace/ext/emmet"], function() {}); })(); - \ No newline at end of file diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/emmet/emmet.js b/modules/backend/formwidgets/codeeditor/assets/vendor/emmet/emmet.js index e67ec59d7..89260e50c 100644 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/emmet/emmet.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/emmet/emmet.js @@ -614,11 +614,11 @@ var _ = (function() { // Retrieve the names of an object's properties. // Delegates to **ECMAScript 5**'s native `Object.keys` _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; + if (obj !== Object(obj)) throw new TypeError('Invalid object'); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + return keys; + }; // Retrieve the values of an object's properties. _.values = function(obj) { @@ -788,8 +788,8 @@ var _ = (function() { // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; + return toString.call(obj) == '[object Array]'; + }; // Is a given variable an object? _.isObject = function(obj) { @@ -975,8 +975,8 @@ var _ = (function() { if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __p='';" + - "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" + - source + "return __p;\n"; + "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" + + source + "return __p;\n"; var render = new Function(settings.variable || 'obj', '_', source); if (data) return render(data, _); @@ -987,7 +987,7 @@ var _ = (function() { // Provide the compiled function source as a convenience for build time // precompilation. template.source = 'function(' + (settings.variable || 'obj') + '){\n' + - source + '}'; + source + '}'; return template; }; @@ -1144,7 +1144,7 @@ var emmet = (function(global) { var moduleLoader = null; /** - * Generic Emmet module loader (actually, it doesn’t load anything, just + * Generic Emmet module loader (actually, it doesn’t load anything, just * returns module reference). Not using `require` name to avoid conflicts * with Node.js and RequireJS */ @@ -1395,7 +1395,7 @@ emmet.define('abbreviationParser', function(require, _) { }, /** - * Removes current node from parent‘s child list + * Removes current node from parent‘s child list * @returns {AbbreviationNode} Current node itself */ remove: function() { @@ -1407,7 +1407,7 @@ emmet.define('abbreviationParser', function(require, _) { }, /** - * Replaces current node in parent‘s children list with passed nodes + * Replaces current node in parent‘s children list with passed nodes * @param {AbbreviationNode} node Replacement node or array of nodes */ replace: function() { @@ -1572,7 +1572,7 @@ emmet.define('abbreviationParser', function(require, _) { }, /** - * Returns index of current node in parent‘s children list + * Returns index of current node in parent‘s children list * @returns {Number} */ index: function() { @@ -1739,7 +1739,7 @@ emmet.define('abbreviationParser', function(require, _) { /** * Returns stripped string: a string without first and last character. - * Used for “unquoting” strings + * Used for “unquoting” strings * @param {String} str * @returns {String} */ @@ -2027,7 +2027,7 @@ emmet.define('abbreviationParser', function(require, _) { } /** - * “Un-rolls“ contents of current node: recursively replaces all repeating + * “Un-rolls“ contents of current node: recursively replaces all repeating * children with their repeated clones * @param {AbbreviationNode} node * @returns {AbbreviationNode} @@ -2110,7 +2110,7 @@ emmet.define('abbreviationParser', function(require, _) { var tree = parseAbbreviation(abbr); if (options.contextNode) { - // add info about context node – + // add info about context node – // a parent XHTML node in editor inside which abbreviation is // expanded tree._name = options.contextNode.name; @@ -2244,7 +2244,7 @@ emmet.exec(function(require, _) { if (_.isString(r)) { child.data('resource', elements.create('snippet', r)); } else if (elements.is(r, 'reference')) { - // it’s a reference to another abbreviation: + // it’s a reference to another abbreviation: // parse it and insert instead of current child /** @type AbbreviationNode */ var subtree = parser.parse(r.data, { @@ -2264,7 +2264,7 @@ emmet.exec(function(require, _) { }); } - // move child‘s children into the deepest child of new subtree + // move child‘s children into the deepest child of new subtree var deepestChild = subtree.deepestChild(); if (deepestChild) { _.each(child.children, function(c) { @@ -2301,7 +2301,7 @@ emmet.exec(function(require, _) { });/** * Pasted content abbreviation processor. A pasted content is a content that * should be inserted into implicitly repeated abbreviation nodes. - * This processor powers “Wrap With Abbreviation” action + * This processor powers “Wrap With Abbreviation” action * @param {Function} require * @param {Underscore} _ */ @@ -2357,7 +2357,7 @@ emmet.exec(function(require, _) { } /** - * Check if parsed node contains output placeholder – a target where + * Check if parsed node contains output placeholder – a target where * pasted content should be inserted * @param {AbbreviationNode} node * @returns {Boolean} @@ -4226,7 +4226,7 @@ emmet.define('handlerList', function(require, _) { * Adds function handler * @param {Function} fn Handler * @param {Object} options Handler options. Possible values are:

- * order : (Number) – order in handler list. Handlers + * order : (Number) – order in handler list. Handlers * with higher order value will be executed earlier. */ add: function(fn, options) { @@ -4527,8 +4527,8 @@ emmet.define('stringStream', function(require, _) { }, /** - * Act like a multi-character eat—if consume is true or - * not given—or a look-ahead that doesn't update the stream position—if + * Act like a multi-character eat—if consume is true or + * not given—or a look-ahead that doesn't update the stream position—if * it is false. pattern can be either a string or a * regular expression starting with ^. When it is a string, * caseInsensitive can be set to true to make the match @@ -4883,7 +4883,6 @@ emmet.define('resources', function(require, _) { sectionKey = section['extends']; } while (sectionKey && !_.include(memo, sectionKey)); - cache[cacheKey] = _.extend.apply(_, stack.reverse()); } @@ -4900,15 +4899,15 @@ emmet.define('actions', function(require, _, zc) { var actions = {}; /** - * “Humanizes” action name, makes it more readable for people + * “Humanizes” action name, makes it more readable for people * @param {String} name Action name (like 'expand_abbreviation') * @return Humanized name (like 'Expand Abbreviation') */ function humanizeActionName(name) { return require('utils').trim(name.charAt(0).toUpperCase() - + name.substring(1).replace(/_[a-z]/g, function(str) { - return ' ' + str.charAt(1).toUpperCase(); - })); + + name.substring(1).replace(/_[a-z]/g, function(str) { + return ' ' + str.charAt(1).toUpperCase(); + })); } return { @@ -4917,9 +4916,9 @@ emmet.define('actions', function(require, _, zc) { * @param {String} name Action name * @param {Function} fn Action function * @param {Object} options Custom action options:
- * label : (String) – Human-readable action name. + * label : (String) – Human-readable action name. * May contain '/' symbols as submenu separators
- * hidden : (Boolean) – Indicates whether action + * hidden : (Boolean) – Indicates whether action * should be displayed in menu (getMenu() method) * * @memberOf actions @@ -5575,7 +5574,7 @@ emmet.define('actionUtils', function(require, _) { }, /** - * Common syntax detection method for editors that doesn’t provide any + * Common syntax detection method for editors that doesn’t provide any * info about current syntax scope. * @param {IEmmetEditor} editor Current editor * @param {String} hint Any syntax hint that editor can provide @@ -5882,7 +5881,7 @@ emmet.define('base64', function(require, _) { });/** * HTML matcher: takes string and searches for HTML tag pairs for given position * - * Unlike “classic” matchers, it parses content from the specified + * Unlike “classic” matchers, it parses content from the specified * position, not from the start, so it may work even outside HTML documents * (for example, inside strings of programming languages like JavaScript, Python * etc.) @@ -6234,23 +6233,23 @@ emmet.define('tabStops', function(require, _) { * @param {String} text Text to process * @param {Object} options List of processor options:
* - * replaceCarets : Boolean — replace all default + * replaceCarets : Boolean — replace all default * caret placeholders (like {%::emmet-caret::%}) with ${0:caret}
* - * escape : Function — function that handle escaped + * escape : Function — function that handle escaped * characters (mostly '$'). By default, it returns the character itself * to be displayed as is in output, but sometimes you will use * extract method as intermediate solution for further * processing and want to keep character escaped. Thus, you should override * escape method to return escaped symbol (e.g. '\\$')
* - * tabstop : Function – a tabstop handler. Receives - * a single argument – an object describing token: its position, number + * tabstop : Function – a tabstop handler. Receives + * a single argument – an object describing token: its position, number * group, placeholder and token itself. Should return a replacement * string that will appear in final output * - * variable : Function – variable handler. Receives - * a single argument – an object describing token: its position, name + * variable : Function – variable handler. Receives + * a single argument – an object describing token: its position, name * and original token itself. Should return a replacement * string that will appear in final output * @@ -6439,7 +6438,7 @@ emmet.define('tabStops', function(require, _) { var placeholderMemo = {}; var res = require('resources'); return function(str, varName) { - // do not mark `child` variable as placeholder – it‘s a reserved + // do not mark `child` variable as placeholder – it‘s a reserved // variable name if (varName == 'child') return str; @@ -6938,13 +6937,13 @@ emmet.define('elements', function(require, _) { return result; });/** * Abstract implementation of edit tree interface. - * Edit tree is a named container of editable “name-value” child elements, + * Edit tree is a named container of editable “name-value” child elements, * parsed from source. This container provides convenient methods * for editing/adding/removing child elements. All these update actions are * instantly reflected in the source code with respect of formatting. *

* For example, developer can create an edit tree from CSS rule and add or - * remove properties from it–all changes will be immediately reflected in the + * remove properties from it–all changes will be immediately reflected in the * original source. *

* All classes defined in this module should be extended the same way as in @@ -7114,7 +7113,7 @@ emmet.define('editTree', function(require, _, core) { return element.value(value); if (!_.isUndefined(value)) { - // no such element — create it + // no such element — create it return this.add(name, value, pos); } }, @@ -7479,7 +7478,7 @@ emmet.define('cssEditTree', function(require, _) { if (token.type == '}' || token.type == ';') { // found value end trimWhitespaceTokens(tokens, WHITESPACE_REMOVE_FROM_START - | (token.type == '}' ? WHITESPACE_REMOVE_FROM_END : 0)); + | (token.type == '}' ? WHITESPACE_REMOVE_FROM_END : 0)); if (tokens.length) { start = tokens[0].start; @@ -7634,7 +7633,7 @@ emmet.define('cssEditTree', function(require, _) { // characters between rules may lead to undesired behavior, // especially when current rule is duplicated or used as a donor // to create new rule. - // To solve this issue, we‘ll take only last newline indentation + // To solve this issue, we‘ll take only last newline indentation var lines = utils.splitByLines(p.styleBefore); if (lines.length > 1) { p.styleBefore = '\n' + _.last(lines); @@ -7982,7 +7981,7 @@ emmet.define('xmlEditTree', function(require, _) { var attribute = new XMLEditElement(this, editTree.createToken(start + styles.styleBefore.length, name), editTree.createToken(start + styles.styleBefore.length + name.length - + styles.styleSeparator.length, value) + + styles.styleSeparator.length, value) ); _.extend(attribute, styles); @@ -8350,7 +8349,7 @@ emmet.define('wrapWithAbbreviation', function(require, _) { });/** * Toggles HTML and CSS comments depending on current caret context. Unlike * the same action in most editors, this action toggles comment on currently - * matched item—HTML tag or CSS selector—when nothing is selected. + * matched item—HTML tag or CSS selector—when nothing is selected. * * @param {Function} require * @param {Underscore} _ @@ -8424,7 +8423,7 @@ emmet.exec(function(require, _) { return _.find(rule.list(), function(item) { if (item.range().end === relPos) { // at the end of property, but outside of it - // if there’s a space character at current position, + // if there’s a space character at current position, // use current property return reSafeChar.test(rule.source.charAt(relPos)); } @@ -8514,9 +8513,9 @@ emmet.exec(function(require, _) { // should add comment // make sure that there's no comment inside selection newContent = commentStart + ' ' + - range.substring(content) - .replace(new RegExp(utils.escapeForRegexp(commentStart) + '\\s*|\\s*' + utils.escapeForRegexp(commentEnd), 'g'), '') + - ' ' + commentEnd; + range.substring(content) + .replace(new RegExp(utils.escapeForRegexp(commentStart) + '\\s*|\\s*' + utils.escapeForRegexp(commentEnd), 'g'), '') + + ' ' + commentEnd; // adjust caret position caretPos += commentStart.length + 1; @@ -8569,7 +8568,7 @@ emmet.exec(function(require, _) { /** * Search for new caret insertion point * @param {IEmmetEditor} editor Editor instance - * @param {Number} inc Search increment: -1 — search left, 1 — search right + * @param {Number} inc Search increment: -1 — search left, 1 — search right * @param {Number} offset Initial offset relative to current caret position * @return {Number} Returns -1 if insertion point wasn't found */ @@ -8949,9 +8948,9 @@ emmet.exec(function(require, _) { // locate parts of complex values. // some examples: - // – 1px solid red: 3 parts - // – arial, sans-serif: enumeration, 2 parts - // – url(image.png): function value part + // – 1px solid red: 3 parts + // – arial, sans-serif: enumeration, 2 parts + // – url(image.png): function value part var value = property.value(); _.each(property.valueParts(), function(r) { // add absolute range @@ -9277,8 +9276,8 @@ emmet.exec(function(require, _) { }); /** * Splits or joins tag, e.g. transforms it into a short notation and vice versa:
- * <div></div> → <div /> : join
- * <div /> → <div></div> : split + * <div></div> → <div /> : join
+ * <div /> → <div></div> : split * @param {Function} require * @param {Underscore} _ * @memberOf __splitJoinTagAction @@ -9435,7 +9434,7 @@ emmet.define('reflectCSSValue', function(require, _) { * Returns value that should be reflected for refName CSS property * from curName property. This function is used for special cases, * when the same result must be achieved with different properties for different - * browsers. For example: opаcity:0.5; → filter:alpha(opacity=50);

+ * browsers. For example: opаcity:0.5; → filter:alpha(opacity=50);

* * This function does value conversion between different CSS properties * @@ -9629,10 +9628,10 @@ emmet.exec(function(require, _) { prefs.define('css.closeBraceIndentation', '\n', 'Indentation before closing brace of CSS rule. Some users prefere ' + 'indented closing brace of CSS rule for better readability. ' - + 'This preference’s value will be automatically inserted before ' + + 'This preference’s value will be automatically inserted before ' + 'closing brace when user adds newline in newly created CSS rule ' - + '(e.g. when “Insert formatted linebreak” action will be performed ' - + 'in CSS file). If you’re such user, you may want to write put a value ' + + '(e.g. when “Insert formatted linebreak” action will be performed ' + + 'in CSS file). If you’re such user, you may want to write put a value ' + 'like \\n\\t in this preference.'); /** @@ -9872,7 +9871,7 @@ emmet.exec(function(require, _) { } b64 = 'data:' + (actionUtils.mimeTypes[String(file.getExt(realImgPath))] || defaultMimeType) + - ';base64,' + b64; + ';base64,' + b64; editor.replaceContent('$0' + b64, pos, pos + imgPath.length); }); @@ -10002,7 +10001,7 @@ emmet.exec(function(require, _) { } require('actions').add('update_image_size', function(editor) { - // this action will definitely won’t work in SASS dialect, + // this action will definitely won’t work in SASS dialect, // but may work in SCSS or LESS if (_.include(['css', 'less', 'scss'], String(editor.getSyntax()))) { updateImageSizeCSS(editor); @@ -10134,23 +10133,23 @@ emmet.define('cssResolver', function(require, _) { 'Automatically generate vendor-prefixed copies of expanded CSS ' + 'property. By default, Emmet will generate vendor-prefixed ' + 'properties only when you put dash before abbreviation ' - + '(e.g. -bxsh). With this option enabled, you don’t ' + + '(e.g. -bxsh). With this option enabled, you don’t ' + 'need dashes before abbreviations: Emmet will produce ' + 'vendor-prefixed properties for you.'); var descTemplate = _.template('A comma-separated list of CSS properties that may have ' - + '<%= vendor %> vendor prefix. This list is used to generate ' - + 'a list of prefixed properties when expanding -property ' - + 'abbreviations. Empty list means that all possible CSS values may ' - + 'have <%= vendor %> prefix.'); + + '<%= vendor %> vendor prefix. This list is used to generate ' + + 'a list of prefixed properties when expanding -property ' + + 'abbreviations. Empty list means that all possible CSS values may ' + + 'have <%= vendor %> prefix.'); var descAddonTemplate = _.template('A comma-separated list of additional CSS properties ' - + 'for css.<%= vendor %>Preperties preference. ' - + 'You should use this list if you want to add or remove a few CSS ' - + 'properties to original set. To add a new property, simply write its name, ' - + 'to remove it, precede property with hyphen.
' - + 'For example, to add foo property and remove border-radius one, ' - + 'the preference value will look like this: foo, -border-radius.'); + + 'for css.<%= vendor %>Preperties preference. ' + + 'You should use this list if you want to add or remove a few CSS ' + + 'properties to original set. To add a new property, simply write its name, ' + + 'to remove it, precede property with hyphen.
' + + 'For example, to add foo property and remove border-radius one, ' + + 'the preference value will look like this: foo, -border-radius.'); // properties list is created from cssFeatures.html file var props = { @@ -10166,7 +10165,7 @@ emmet.define('cssResolver', function(require, _) { }); prefs.define('css.unitlessProperties', 'z-index, line-height, opacity, font-weight, zoom', - 'The list of properties whose values ​​must not contain units.'); + 'The list of properties whose values ​​must not contain units.'); prefs.define('css.intUnit', 'px', 'Default unit for integer values'); prefs.define('css.floatUnit', 'em', 'Default unit for float values'); @@ -10391,8 +10390,8 @@ emmet.define('cssResolver', function(require, _) { function formatProperty(property, syntax) { var ix = property.indexOf(':'); property = property.substring(0, ix).replace(/\s+$/, '') - + getSyntaxPreference('valueSeparator', syntax) - + require('utils').trim(property.substring(ix + 1)); + + getSyntaxPreference('valueSeparator', syntax) + + require('utils').trim(property.substring(ix + 1)); return property.replace(/\s*;\s*$/, getSyntaxPreference('propertyEnd', syntax)); } @@ -10776,7 +10775,7 @@ emmet.define('cssResolver', function(require, _) { } if (!snippet && prefs.get('css.fuzzySearch')) { - // let’s try fuzzy search + // let’s try fuzzy search snippet = resources.fuzzyFindSnippet(syntax, abbrData.property, parseFloat(prefs.get('css.fuzzySearchMinScore'))); } @@ -10794,8 +10793,8 @@ emmet.define('cssResolver', function(require, _) { var result = []; if (!value && abbrData.values) { value = _.map(abbrData.values, function(val) { - return this.normalizeValue(val, snippetObj.name); - }, this).join(' ') + ';'; + return this.normalizeValue(val, snippetObj.name); + }, this).join(' ') + ';'; } snippetObj.value = value || snippetObj.value; @@ -11085,7 +11084,7 @@ emmet.define('cssGradient', function(require, _) { direction = textualDirection(direction); if(reDeg.test(direction)) - throw "The direction is an angle that can’t be converted."; + throw "The direction is an angle that can’t be converted."; var v = function(pos) { return ~direction.indexOf(pos) ? '100%' : '0'; @@ -11330,7 +11329,7 @@ emmet.define('cssGradient', function(require, _) { cssProp = cssRule.itemFromPosition(pos, true); if (!cssProp) { // in case user just started writing CSS property - // and didn't include semicolon–try another approach + // and didn't include semicolon–try another approach cssProp = _.find(cssRule.list(), function(elem) { return elem.range(true).end == pos; }); @@ -11672,7 +11671,7 @@ emmet.define('tagName', function(require, _) { }, /** - * Adds new parent–child mapping + * Adds new parent–child mapping * @param {String} parent * @param {String} child */ @@ -11735,11 +11734,11 @@ emmet.define('tagName', function(require, _) { */ emmet.exec(function(require, _) { var prefs = require('preferences'); - prefs.define('bem.elementSeparator', '__', 'Class name’s element separator.'); - prefs.define('bem.modifierSeparator', '_', 'Class name’s modifier separator.'); + prefs.define('bem.elementSeparator', '__', 'Class name’s element separator.'); + prefs.define('bem.modifierSeparator', '_', 'Class name’s modifier separator.'); prefs.define('bem.shortElementPrefix', '-', - 'Symbol for describing short “block-element” notation. Class names ' - + 'prefixed with this symbol will be treated as element name for parent‘s ' + 'Symbol for describing short “block-element” notation. Class names ' + + 'prefixed with this symbol will be treated as element name for parent‘s ' + 'block name. Each symbol instance traverses one level up in parsed ' + 'tree for block name lookup. Empty value will disable short notation.'); @@ -11778,8 +11777,8 @@ emmet.exec(function(require, _) { if (!item.__bem.block) { reBlockName = /^[a-z]/i; item.__bem.block = _.find(classNames, function(name) { - return reBlockName.test(name); - }) || ''; + return reBlockName.test(name); + }) || ''; } classNames = _.chain(classNames) @@ -11937,16 +11936,16 @@ emmet.exec(function(require, _) { * It does several things:
* * @@ -12003,16 +12002,16 @@ emmet.exec(function(require, _) { + 'the following properties and functions are availabe:\n' + ''); @@ -12223,7 +12222,7 @@ emmet.exec(function(require, _){ function processSnippet(item, profile, level) { item.start = item.end = ''; if (!isVeryFirstChild(item) && profile.tag_nl !== false && shouldAddLineBreak(item, profile)) { - // check if we’re not inside inline element + // check if we’re not inside inline element if (isRoot(item.parent) || !require('abbreviationUtils').isInline(item.parent)) { item.start = require('utils').getNewline() + item.start; } @@ -12658,11 +12657,11 @@ emmet.exec(function(require, _) { * https://code.djangoproject.com/browser/django/trunk/django/contrib/webdesign/lorem_ipsum.py *

* Examples to test:
- * lipsum – generates 30 words text.
- * lipsum*6 – generates 6 paragraphs (autowrapped with <p> element) of text.
- * ol>lipsum10*5 — generates ordered list with 5 list items (autowrapped with <li> tag) + * lipsum – generates 30 words text.
+ * lipsum*6 – generates 6 paragraphs (autowrapped with <p> element) of text.
+ * ol>lipsum10*5 — generates ordered list with 5 list items (autowrapped with <li> tag) * with text of 10 words on each line
- * span*3>lipsum20 – generates 3 paragraphs of 20-words text, each wrapped with <span> element . + * span*3>lipsum20 – generates 3 paragraphs of 20-words text, each wrapped with <span> element . * Each paragraph phrase is unique * @param {Function} require * @param {Underscore} _ @@ -12704,33 +12703,33 @@ emmet.define('lorem', function(require, _) { 'maxime', 'corrupti'] }, ru: { - common: ['даНокО-даНокО', 'Са', 'словесными', 'горами', 'в стране', 'гласных', 'и согласных', 'живут', 'рыбные', 'тексты'], - words: ['вдаНи', 'от всех', 'Они', 'буквенных', 'домах', 'на берегу', 'семантика', - 'большого', 'языкового', 'Окоана', 'маленький', 'ручеек', 'даль', - 'журчит', 'пО всоК', 'обеспечивает', 'оо','всоПи', 'необходимыми', - 'правилами', 'эта', 'парадигматическая', 'страна', 'которой', 'жаренные', - 'предложения', 'залетают', 'прямо', 'рот', 'даМо', 'всемогущая', - 'пунктуация', 'но', 'имеет', 'власти', 'над', 'рыбными', 'текстами', - 'ведущими', 'безорфографичный', 'образ', 'МиСни', 'однажды', 'Одна', - 'маленькая', 'строчка','рыбного', 'текста', 'иПони', 'lorem', 'ipsum', - 'решила', 'выйти', 'большой', 'мир', 'грамматики', 'воНикиК', 'ОксПОкс', - 'предупреждал', 'Đž', 'злых', 'запятых', 'диких', 'знаках', 'вопроса', - 'коварных', 'точках', 'запятой', 'нО', 'текст', 'даН', 'сбить', - 'себя', 'толку', 'Он', 'собрал', 'семь', 'своих', 'заглавных', 'йукв', - 'подпоясал', 'инициал', 'Са', 'пояс', 'пустился', 'дорогу', - 'взобравшись', 'первую', 'вершину', 'курсивных', 'гор', 'бросил', - 'пОсНодниК', 'взгляд', 'наСад', 'силуэт', 'свОогО', 'родного', 'города', - 'буквоград', 'СагОНОвОк', 'деревни', 'алфавит', 'пОдСагОНОвОк', 'свОогО', - 'переулка', 'грустный', 'реторический', 'вопрос', 'скатился', 'огО', - 'щеке', 'продолжил', 'свОК', 'путь', 'дороге', 'встретил', 'рукопись', - 'Она', 'предупредила', 'ПОоК', 'всо', 'переписывается', 'несколько', - 'раз', 'единственное', 'что', 'меня', 'осталось', 'это', 'приставка', - 'возвращайся', 'ты', 'лучше', 'свою', 'безопасную', 'страну', 'послушавшись', - 'рукописи', 'наш', 'продолжил', 'свОК', 'путь', 'вскоре', 'оПу', - 'повстречался', 'коварный', 'составитель', 'рекламных', 'текстов', - 'напОившиК', 'языком', 'речью', 'СаПанившиК', 'свОо', 'агенство', - 'которое', 'использовало', 'снОва', 'снОва', 'своих', 'проектах', - 'осНи', 'переписали', 'то', 'живет', 'там', 'Đ´Đž', 'сих', 'пор'] + common: ['далеко-далеко', 'за', 'словесными', 'горами', 'в стране', 'гласных', 'и согласных', 'живут', 'рыбные', 'тексты'], + words: ['вдали', 'от всех', 'они', 'буквенных', 'домах', 'на берегу', 'семантика', + 'большого', 'языкового', 'океана', 'маленький', 'ручеек', 'даль', + 'журчит', 'по всей', 'обеспечивает', 'ее','всеми', 'необходимыми', + 'правилами', 'эта', 'парадигматическая', 'страна', 'которой', 'жаренные', + 'предложения', 'залетают', 'прямо', 'рот', 'даже', 'всемогущая', + 'пунктуация', 'не', 'имеет', 'власти', 'над', 'рыбными', 'текстами', + 'ведущими', 'безорфографичный', 'образ', 'жизни', 'однажды', 'одна', + 'маленькая', 'строчка','рыбного', 'текста', 'имени', 'lorem', 'ipsum', + 'решила', 'выйти', 'большой', 'мир', 'грамматики', 'великий', 'оксмокс', + 'предупреждал', 'о', 'злых', 'запятых', 'диких', 'знаках', 'вопроса', + 'коварных', 'точках', 'запятой', 'но', 'текст', 'дал', 'сбить', + 'себя', 'толку', 'он', 'собрал', 'семь', 'своих', 'заглавных', 'букв', + 'подпоясал', 'инициал', 'за', 'пояс', 'пустился', 'дорогу', + 'взобравшись', 'первую', 'вершину', 'курсивных', 'гор', 'бросил', + 'последний', 'взгляд', 'назад', 'силуэт', 'своего', 'родного', 'города', + 'буквоград', 'заголовок', 'деревни', 'алфавит', 'подзаголовок', 'своего', + 'переулка', 'грустный', 'реторический', 'вопрос', 'скатился', 'его', + 'щеке', 'продолжил', 'свой', 'путь', 'дороге', 'встретил', 'рукопись', + 'она', 'предупредила', 'моей', 'все', 'переписывается', 'несколько', + 'раз', 'единственное', 'что', 'меня', 'осталось', 'это', 'приставка', + 'возвращайся', 'ты', 'лучше', 'свою', 'безопасную', 'страну', 'послушавшись', + 'рукописи', 'наш', 'продолжил', 'свой', 'путь', 'вскоре', 'ему', + 'повстречался', 'коварный', 'составитель', 'рекламных', 'текстов', + 'напоивший', 'языком', 'речью', 'заманивший', 'свое', 'агенство', + 'которое', 'использовало', 'снова', 'снова', 'своих', 'проектах', + 'если', 'переписали', 'то', 'живет', 'там', 'до', 'сих', 'пор'] } }; From d6356ac73336a646d217cfd6c773d6097b343c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Wed, 26 Aug 2015 22:59:31 +0200 Subject: [PATCH 002/103] Fix Swedish language code reference 'se' to 'sv' to reflect ISO code like in folder structure. --- modules/backend/models/BackendPreferences.php | 2 +- modules/system/assets/js/lang/lang.hu.js | 2 +- modules/system/assets/js/lang/{lang.se.js => lang.sv.js} | 6 +++--- modules/system/lang/de/lang.php | 2 +- modules/system/lang/el/lang.php | 2 +- modules/system/lang/en/lang.php | 2 +- modules/system/lang/es-ar/lang.php | 2 +- modules/system/lang/es/lang.php | 2 +- modules/system/lang/fa/lang.php | 2 +- modules/system/lang/fr/lang.php | 2 +- modules/system/lang/hu/lang.php | 2 +- modules/system/lang/id/lang.php | 2 +- modules/system/lang/it/lang.php | 2 +- modules/system/lang/ja/lang.php | 2 +- modules/system/lang/lv/lang.php | 2 +- modules/system/lang/nb-no/lang.php | 2 +- modules/system/lang/nl/lang.php | 2 +- modules/system/lang/pl/lang.php | 2 +- modules/system/lang/pt-br/lang.php | 2 +- modules/system/lang/ru/lang.php | 2 +- modules/system/lang/sv/lang.php | 2 +- modules/system/lang/tr/lang.php | 2 +- modules/system/lang/zh-cn/lang.php | 2 +- modules/system/lang/zh-tw/lang.php | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) rename modules/system/assets/js/lang/{lang.se.js => lang.sv.js} (88%) diff --git a/modules/backend/models/BackendPreferences.php b/modules/backend/models/BackendPreferences.php index be0d078ad..ead2502ff 100644 --- a/modules/backend/models/BackendPreferences.php +++ b/modules/backend/models/BackendPreferences.php @@ -51,7 +51,7 @@ class BackendPreferences extends Model 'pt-br' => [Lang::get('system::lang.locale.pt-br'), 'flag-br'], 'ro' => [Lang::get('system::lang.locale.ro'), 'flag-ro'], 'ru' => [Lang::get('system::lang.locale.ru'), 'flag-ru'], - 'se' => [Lang::get('system::lang.locale.se'), 'flag-se'], + 'sv' => [Lang::get('system::lang.locale.sv'), 'flag-se'], 'tr' => [Lang::get('system::lang.locale.tr'), 'flag-tr'], 'pl' => [Lang::get('system::lang.locale.pl'), 'flag-pl'], 'sk' => [Lang::get('system::lang.locale.sk'), 'flag-sk'], diff --git a/modules/system/assets/js/lang/lang.hu.js b/modules/system/assets/js/lang/lang.hu.js index aafe3d0bd..6899a1ca5 100644 --- a/modules/system/assets/js/lang/lang.hu.js +++ b/modules/system/assets/js/lang/lang.hu.js @@ -5,5 +5,5 @@ if ($.oc === undefined) $.oc = {} if ($.oc.langMessages === undefined) $.oc.langMessages = {} $.oc.langMessages['hu'] = $.extend( $.oc.langMessages['hu'] || {}, - {"markdowneditor":{"formatting":"Formatting","quote":"Quote","code":"Code","header1":"Header 1","header2":"Header 2","header3":"Header 3","header4":"Header 4","header5":"Header 5","header6":"Header 6","bold":"Bold","italic":"Italic","unorderedlist":"Unordered List","orderedlist":"Ordered List","video":"Video","image":"Image","link":"Link","horizontalrule":"Insert Horizontal Rule","fullscreen":"Full screen","preview":"Preview"},"mediamanager":{"insert_link":"Insert Media Link","insert_image":"Insert Media Image","insert_video":"Insert Media Video","insert_audio":"Insert Media Audio","invalid_file_empty_insert":"Please select file to insert a links to.","invalid_file_single_insert":"Please select a single file.","invalid_image_empty_insert":"Please select image(s) to insert.","invalid_video_empty_insert":"Please select a video file to insert.","invalid_audio_empty_insert":"Please select an audio file to insert."},"alert":{"confirm_button_text":"OK","cancel_button_text":"Cancel"}} + {"markdowneditor":{"formatting":"Forr\u00e1sk\u00f3d","quote":"Id\u00e9zet","code":"K\u00f3d","header1":"F\u0151c\u00edm 1","header2":"F\u0151c\u00edm 2","header3":"F\u0151c\u00edm 3","header4":"F\u0151c\u00edm 4","header5":"F\u0151c\u00edm 5","header6":"F\u0151c\u00edm 6","bold":"F\u00e9lk\u00f6v\u00e9r","italic":"D\u00f6lt","unorderedlist":"Rendezett lista","orderedlist":"Sz\u00e1mozott lista","video":"Vide\u00f3","image":"K\u00e9p","link":"Hivatkoz\u00e1s","horizontalrule":"Vonal besz\u00far\u00e1sa","fullscreen":"Teljes k\u00e9perny\u0151","preview":"El\u0151n\u00e9zet"},"mediamanager":{"insert_link":"Hivatkoz\u00e1s besz\u00far\u00e1sa","insert_image":"K\u00e9p besz\u00far\u00e1sa","insert_video":"Vide\u00f3 besz\u00far\u00e1sa","insert_audio":"Audi\u00f3 besz\u00far\u00e1sa","invalid_file_empty_insert":"Hivatkoz\u00e1s k\u00e9sz\u00edt\u00e9s\u00e9hez jel\u00f6lj\u00f6n ki egy sz\u00f6vegr\u00e9szt.","invalid_file_single_insert":"K\u00e9rj\u00fck jel\u00f6lj\u00f6n ki egy f\u00e1jlt.","invalid_image_empty_insert":"V\u00e1lasszon ki legal\u00e1bb egy k\u00e9pet a besz\u00far\u00e1shoz.","invalid_video_empty_insert":"V\u00e1lasszon ki legal\u00e1bb egy vide\u00f3t a besz\u00far\u00e1shoz.","invalid_audio_empty_insert":"V\u00e1lasszon ki legal\u00e1bb egy audi\u00f3t a besz\u00far\u00e1shoz."},"alert":{"confirm_button_text":"OK","cancel_button_text":"M\u00e9gsem"}} ); \ No newline at end of file diff --git a/modules/system/assets/js/lang/lang.se.js b/modules/system/assets/js/lang/lang.sv.js similarity index 88% rename from modules/system/assets/js/lang/lang.se.js rename to modules/system/assets/js/lang/lang.sv.js index fee3911fd..6ebb84fa7 100644 --- a/modules/system/assets/js/lang/lang.se.js +++ b/modules/system/assets/js/lang/lang.sv.js @@ -1,9 +1,9 @@ /* - * This file has been compiled from: /modules/system/lang/se/client.php + * This file has been compiled from: /modules/system/lang/sv/client.php */ if ($.oc === undefined) $.oc = {} if ($.oc.langMessages === undefined) $.oc.langMessages = {} -$.oc.langMessages['se'] = $.extend( - $.oc.langMessages['se'] || {}, +$.oc.langMessages['sv'] = $.extend( + $.oc.langMessages['sv'] || {}, {"markdowneditor":{"formatting":"Formatting","quote":"Quote","code":"Code","header1":"Header 1","header2":"Header 2","header3":"Header 3","header4":"Header 4","header5":"Header 5","header6":"Header 6","bold":"Bold","italic":"Italic","unorderedlist":"Unordered List","orderedlist":"Ordered List","video":"Video","image":"Image","link":"Link","horizontalrule":"Insert Horizontal Rule","fullscreen":"Full screen","preview":"Preview"},"mediamanager":{"insert_link":"Insert Media Link","insert_image":"Insert Media Image","insert_video":"Insert Media Video","insert_audio":"Insert Media Audio","invalid_file_empty_insert":"Please select file to insert a links to.","invalid_file_single_insert":"Please select a single file.","invalid_image_empty_insert":"Please select image(s) to insert.","invalid_video_empty_insert":"Please select a video file to insert.","invalid_audio_empty_insert":"Please select an audio file to insert."},"alert":{"confirm_button_text":"OK","cancel_button_text":"Cancel"}} ); \ No newline at end of file diff --git a/modules/system/lang/de/lang.php b/modules/system/lang/de/lang.php index b695f051c..67e3c77ca 100644 --- a/modules/system/lang/de/lang.php +++ b/modules/system/lang/de/lang.php @@ -9,7 +9,7 @@ return [ 'en' => 'English', 'nl' => 'Dutch', 'ja' => 'Japanese', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'tr' => 'Turkish', 'de' => 'German', 'ru' => 'Russian', diff --git a/modules/system/lang/el/lang.php b/modules/system/lang/el/lang.php index 3fb01307b..562f81701 100644 --- a/modules/system/lang/el/lang.php +++ b/modules/system/lang/el/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Πορτογαλικά (Βραζιλία)', 'ro' => 'Ρουμανικά', 'ru' => 'Ρωσικά', - 'se' => 'Σουηδικά', + 'sv' => 'Σουηδικά', 'sk' => 'Σλοβάκικα (Σλοβακία)', 'tr' => 'Τουρκικά', 'zh-cn' => 'Κινέζικα (Κίνα)', diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 67db14089..aba954258 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -24,7 +24,7 @@ return [ 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'zh-cn' => 'Chinese (China)', diff --git a/modules/system/lang/es-ar/lang.php b/modules/system/lang/es-ar/lang.php index 159314188..fc5438f57 100644 --- a/modules/system/lang/es-ar/lang.php +++ b/modules/system/lang/es-ar/lang.php @@ -9,7 +9,7 @@ return [ 'en' => 'Inglés', 'nl' => 'Holandés', 'ja' => 'Japonés', - 'se' => 'Suizo', + 'sv' => 'Suizo', 'tr' => 'Turco', 'de' => 'Alemán', 'ru' => 'Ruso', diff --git a/modules/system/lang/es/lang.php b/modules/system/lang/es/lang.php index a7608316d..921405ac1 100644 --- a/modules/system/lang/es/lang.php +++ b/modules/system/lang/es/lang.php @@ -9,7 +9,7 @@ return [ 'en' => 'Inglés', 'nl' => 'Holandés', 'ja' => 'Japonés', - 'se' => 'Sueco', + 'sv' => 'Sueco', 'tr' => 'Turco', 'br' => 'Portugués Brasileño', 'de' => 'Alemán', diff --git a/modules/system/lang/fa/lang.php b/modules/system/lang/fa/lang.php index 5072aeafe..daa9b61ef 100644 --- a/modules/system/lang/fa/lang.php +++ b/modules/system/lang/fa/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'پرتغالی برزیل', 'ro' => 'رومانیایی', 'ru' => 'روسی', - 'se' => 'سوئدی', + 'sv' => 'سوئدی', 'sk' => 'اسلواکی', 'tr' => 'ترکی', 'zh-cn' => 'چینی', diff --git a/modules/system/lang/fr/lang.php b/modules/system/lang/fr/lang.php index a8970ebfe..b4d515eb4 100644 --- a/modules/system/lang/fr/lang.php +++ b/modules/system/lang/fr/lang.php @@ -24,7 +24,7 @@ return [ 'pt-br' => 'Portugais-Brésilien', 'ro' => 'Roumain', 'ru' => 'Russe', - 'se' => 'Suédois', + 'sv' => 'Suédois', 'sk' => 'Slovaque (Slovaquie)', 'tr' => 'Turque', 'zh-cn' => 'Chinois (Chine)', diff --git a/modules/system/lang/hu/lang.php b/modules/system/lang/hu/lang.php index 850c6f630..d4dd9656e 100644 --- a/modules/system/lang/hu/lang.php +++ b/modules/system/lang/hu/lang.php @@ -24,7 +24,7 @@ return [ 'pt-br' => 'Portugál (brazíl)', 'ro' => 'Román', 'ru' => 'Orosz', - 'se' => 'Svéd', + 'sv' => 'Svéd', 'sk' => 'Szlovák', 'tr' => 'Török', 'zh-cn' => 'Kínai', diff --git a/modules/system/lang/id/lang.php b/modules/system/lang/id/lang.php index 2f8ada28d..deec10fbe 100644 --- a/modules/system/lang/id/lang.php +++ b/modules/system/lang/id/lang.php @@ -21,7 +21,7 @@ return [ 'pt-br' => 'Portugis (Brazil)', 'ro' => 'Romania', 'ru' => 'Rusia', - 'se' => 'Swedia', + 'sv' => 'Swedia', 'sk' => 'Slowakia (Slovakia)', 'tr' => 'Turki', 'nb-no' => 'Norwegian (Bokmål)' diff --git a/modules/system/lang/it/lang.php b/modules/system/lang/it/lang.php index 659cd12b5..4d64bfa6f 100644 --- a/modules/system/lang/it/lang.php +++ b/modules/system/lang/it/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Portoghese (Brasile)', 'ro' => 'Romeno', 'ru' => 'Russo', - 'se' => 'Svedese', + 'sv' => 'Svedese', 'sk' => 'Slovacco (Slovacchia)', 'tr' => 'Turco', 'zh-cn' => 'Cinese (Cina)', diff --git a/modules/system/lang/ja/lang.php b/modules/system/lang/ja/lang.php index b7ee6ddd9..9e6117739 100644 --- a/modules/system/lang/ja/lang.php +++ b/modules/system/lang/ja/lang.php @@ -19,7 +19,7 @@ return [ 'pt-br' => 'Brazilian Portuguese', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'tr' => 'Turkish', 'nb-no' => 'Norwegian (Bokmål)' ], diff --git a/modules/system/lang/lv/lang.php b/modules/system/lang/lv/lang.php index 51b371eb5..35c856332 100644 --- a/modules/system/lang/lv/lang.php +++ b/modules/system/lang/lv/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'zh-cn' => 'Chinese (China)', diff --git a/modules/system/lang/nb-no/lang.php b/modules/system/lang/nb-no/lang.php index c5e5f9149..f8c36aca5 100644 --- a/modules/system/lang/nb-no/lang.php +++ b/modules/system/lang/nb-no/lang.php @@ -21,7 +21,7 @@ return [ 'pt-br' => 'Brasiliansk Portugisk', 'ro' => 'Rumensk', 'ru' => 'Russisk', - 'se' => 'Svensk', + 'sv' => 'Svensk', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Tyrkisk', 'nb-no' => 'Norsk (Bokmål)', diff --git a/modules/system/lang/nl/lang.php b/modules/system/lang/nl/lang.php index f042ad3f3..5cdb6b7dd 100644 --- a/modules/system/lang/nl/lang.php +++ b/modules/system/lang/nl/lang.php @@ -9,7 +9,7 @@ return [ 'en' => 'Engels', 'nl' => 'Nederlands', 'ja' => 'Japans', - 'se' => 'Zweeds', + 'sv' => 'Zweeds', 'tr' => 'Turks', 'de' => 'Duits', 'ru' => 'Russisch', diff --git a/modules/system/lang/pl/lang.php b/modules/system/lang/pl/lang.php index e6fe6e51a..28d387aa2 100644 --- a/modules/system/lang/pl/lang.php +++ b/modules/system/lang/pl/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Brazylisjki Portugalski', 'ro' => 'Rumuński', 'ru' => 'Rosyjski', - 'se' => 'Szwedzki', + 'sv' => 'Szwedzki', 'sk' => 'Słowacki (Słowacja)', 'tr' => 'Turecki', 'zh-cn' => 'Chiński (Chiny)' diff --git a/modules/system/lang/pt-br/lang.php b/modules/system/lang/pt-br/lang.php index 067e4024d..93b0a68f8 100644 --- a/modules/system/lang/pt-br/lang.php +++ b/modules/system/lang/pt-br/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Português (Brasil)', 'ro' => 'Romeno', 'ru' => 'Russo', - 'se' => 'Sueco', + 'sv' => 'Sueco', 'sk' => 'Eslovaco', 'tr' => 'Turco', 'zh-cn' => 'Chinês (China)', diff --git a/modules/system/lang/ru/lang.php b/modules/system/lang/ru/lang.php index b7eb24aa1..fd3e0ed8f 100644 --- a/modules/system/lang/ru/lang.php +++ b/modules/system/lang/ru/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'zh-cn' => 'Chinese (China)', diff --git a/modules/system/lang/sv/lang.php b/modules/system/lang/sv/lang.php index 24e5b8562..d92a6bbd8 100644 --- a/modules/system/lang/sv/lang.php +++ b/modules/system/lang/sv/lang.php @@ -21,7 +21,7 @@ return [ 'pt-br' => 'Brazilian Portuguese', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'nb-no' => 'Norska (Bokmål)' diff --git a/modules/system/lang/tr/lang.php b/modules/system/lang/tr/lang.php index ca8a09988..b511c0241 100644 --- a/modules/system/lang/tr/lang.php +++ b/modules/system/lang/tr/lang.php @@ -19,7 +19,7 @@ return [ 'pt-br' => 'Português (Brasil)', 'ro' => 'Română (România)', 'ru' => 'Русский (Россия - Russia)', - 'se' => 'Svenska (Sverige)', + 'sv' => 'Svenska (Sverige)', 'tr' => 'Türkçe (Türkiye)', 'nb-no' => 'Norwegian (Bokmål)' ], diff --git a/modules/system/lang/zh-cn/lang.php b/modules/system/lang/zh-cn/lang.php index 7ccc45fe0..7a2d24196 100644 --- a/modules/system/lang/zh-cn/lang.php +++ b/modules/system/lang/zh-cn/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'zh-cn' => '简体中文', diff --git a/modules/system/lang/zh-tw/lang.php b/modules/system/lang/zh-tw/lang.php index fd902ebb6..9f5648340 100644 --- a/modules/system/lang/zh-tw/lang.php +++ b/modules/system/lang/zh-tw/lang.php @@ -23,7 +23,7 @@ return [ 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', - 'se' => 'Swedish', + 'sv' => 'Swedish', 'sk' => 'Slovak (Slovakia)', 'tr' => 'Turkish', 'zh-cn' => 'Chinese (China)', From aa5e9c6034bca8fe6d1e5511eb5aea94169c7b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Thu, 27 Aug 2015 20:50:13 +0200 Subject: [PATCH 003/103] Fix encryption settings to reflect laravel encryption config. --- modules/system/lang/en/lang.php | 4 ++++ modules/system/lang/fr/lang.php | 2 ++ modules/system/models/MailSettings.php | 21 ++++++++++++++++++- .../system/models/mailsettings/fields.yaml | 7 ++++--- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 67db14089..f3d59a847 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -146,6 +146,10 @@ return [ 'smtp_password' => 'Password', 'smtp_port' => 'SMTP port', 'smtp_ssl' => 'SSL connection required', + 'smtp_encryption' => 'SMTP encryption protocol', + 'smtp_encryption_none' => 'No encryption', + 'smtp_encryption_tls' => 'TLS', + 'smtp_encryption_ssl' => 'SSL', 'sendmail' => 'Sendmail', 'sendmail_path' => 'Sendmail path', 'sendmail_path_comment' => 'Please specify the path of the sendmail program.', diff --git a/modules/system/lang/fr/lang.php b/modules/system/lang/fr/lang.php index a8970ebfe..a1ed2395a 100644 --- a/modules/system/lang/fr/lang.php +++ b/modules/system/lang/fr/lang.php @@ -146,6 +146,8 @@ return [ 'smtp_password' => 'Mot de passe', 'smtp_port' => 'Port SMTP', 'smtp_ssl' => 'Connexion SSL requise', + 'smtp_encryption' => 'Protocole de sécurisation des échanges SMTP', + 'smtp_encryption_none' => 'Aucun cryptage', 'sendmail' => 'Sendmail', 'sendmail_path' => 'Chemin vers Sendmail', 'sendmail_path_comment' => 'Saisir le chemin du programme Sendmail.', diff --git a/modules/system/models/MailSettings.php b/modules/system/models/MailSettings.php index 94803257a..56bd95acd 100644 --- a/modules/system/models/MailSettings.php +++ b/modules/system/models/MailSettings.php @@ -44,7 +44,8 @@ class MailSettings extends Model $this->smtp_port = $config->get('mail.port', 587); $this->smtp_user = $config->get('mail.username'); $this->smtp_password = $config->get('mail.password'); - $this->smtp_authorization = strlen($this->smtp_user); + $this->smtp_authorization = !!strlen($this->smtp_user); + $this->smtp_encryption = $config->get('mail.encryption'); } public function getSendModeOptions() @@ -80,6 +81,11 @@ class MailSettings extends Model $config->set('mail.username', null); $config->set('mail.password', null); } + if ($settings->smtp_encryption) { + $config->set('mail.encryption', $settings->smtp_encryption); + } else { + $config->set('mail.encryption', null); + } break; case self::MODE_SENDMAIL: @@ -97,4 +103,17 @@ class MailSettings extends Model } } + + + /** + * @return array smtp_encryption options values + */ + public function getSmtpEncryptionOptions() + { + return [ + '' => 'system::lang.mail.smtp_encryption_none', + 'tls' => 'system::lang.mail.smtp_encryption_tls', + 'ssl' => 'system::lang.mail.smtp_encryption_ssl', + ]; + } } diff --git a/modules/system/models/mailsettings/fields.yaml b/modules/system/models/mailsettings/fields.yaml index 0e37e30fc..38f24078e 100644 --- a/modules/system/models/mailsettings/fields.yaml +++ b/modules/system/models/mailsettings/fields.yaml @@ -73,10 +73,11 @@ tabs: field: send_mode condition: value[smtp] - smtp_ssl: - type: checkbox - label: system::lang.mail.smtp_ssl + smtp_encryption: + type: dropdown + label: system::lang.mail.smtp_encryption tab: system::lang.mail.general + span: left trigger: action: show field: send_mode From 6ec42da5841d73c28b18c670db0395cad8271b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Thu, 27 Aug 2015 21:44:48 +0200 Subject: [PATCH 004/103] Hide FormWidget tabs when they contain no fields or only hidden fields after a toggle event on a field has occurred --- .../widgets/form/assets/js/october.form.js | 40 +++++++++++++++---- .../system/assets/ui/docs/input-trigger.md | 1 + modules/system/assets/ui/js/input.trigger.js | 2 + 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/modules/backend/widgets/form/assets/js/october.form.js b/modules/backend/widgets/form/assets/js/october.form.js index a6dd4dc5a..28d4646a0 100644 --- a/modules/backend/widgets/form/assets/js/october.form.js +++ b/modules/backend/widgets/form/assets/js/october.form.js @@ -34,6 +34,7 @@ this.bindCheckboxlist() this.toggleEmptyTabs() this.bindCollapsibleSections() + this.bindEvents() this.$el.one('dispose-control', this.proxy(this.dispose)) } @@ -48,6 +49,15 @@ BaseProto.dispose.call(this) } + FormWidget.prototype.bindEvents = function() { + var self = this + + // Update tab visibility status after fields toggle (deferred) + this.$el.on('oc.triggerOn.afterUpdate', function() { + self.toggleEmptyTabs(true) + }) + } + /* * Logic for checkboxlist */ @@ -133,17 +143,31 @@ /* * Hides tabs that have no content + * - deferred - boolean to defer the action (only one effective call per execution cycle) */ - FormWidget.prototype.toggleEmptyTabs = function() { - var tabControl = $('[data-control=tab]', this.$el) + FormWidget.prototype.toggleEmptyTabs = function(deferred) { + if(deferred) { + var self = this - if (!tabControl.length) - return + if(this.$$toggleEmptyTabsTimeout) { + clearTimeout(this.$$toggleEmptyTabsTimeout) + } - $('.tab-pane', tabControl).each(function() { - $('[data-target="#' + $(this).attr('id') + '"]', tabControl) - .toggle(!!$('.form-group:not(:empty)', $(this)).length) - }) + this.$$toggleEmptyTabsTimeout = setTimeout(function() { + self.toggleEmptyTabs(false) + delete self.$$toggleEmptyTabsTimeout + }, 1); + } else { + var tabControl = $('[data-control=tab]', this.$el) + + if (!tabControl.length) + return + + $('.tab-pane', tabControl).each(function() { + $('[data-target="#' + $(this).attr('id') + '"]', tabControl) + .toggle(!!$('.form-group:not(:empty):not(.hide)', $(this)).length) + }) + } } /* diff --git a/modules/system/assets/ui/docs/input-trigger.md b/modules/system/assets/ui/docs/input-trigger.md index 1b66f9142..d3fe5a856 100644 --- a/modules/system/assets/ui/docs/input-trigger.md +++ b/modules/system/assets/ui/docs/input-trigger.md @@ -65,6 +65,7 @@ Multie value conditions are supported: ### Supported events: - oc.triggerOn.update - triggers the update. Trigger this event on the element the plugin is bound to to force it to check the condition and update itself. This is useful when the page content is updated with AJAX. +- oc.triggerOn.afterUpdate - triggered after the element is updated ### JavaScript API: diff --git a/modules/system/assets/ui/js/input.trigger.js b/modules/system/assets/ui/js/input.trigger.js index 7a5fd6653..1e63ea0d6 100644 --- a/modules/system/assets/ui/js/input.trigger.js +++ b/modules/system/assets/ui/js/input.trigger.js @@ -87,6 +87,8 @@ }) $(window).trigger('resize') + + this.$el.trigger('oc.triggerOn.afterUpdate', status) } TriggerOn.prototype.updateTargetAction = function(action, status) { From 917cfd437f00245e5b26837bca9b70fe853600ff Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 29 Aug 2015 16:45:01 +1000 Subject: [PATCH 005/103] Make sure a tab is defined always - Refs #1397 --- modules/backend/classes/AuthManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/backend/classes/AuthManager.php b/modules/backend/classes/AuthManager.php index d77a3d0c0..c6eefb701 100644 --- a/modules/backend/classes/AuthManager.php +++ b/modules/backend/classes/AuthManager.php @@ -144,7 +144,10 @@ class AuthManager extends RainAuthManager $tabs = []; foreach ($this->listPermissions() as $permission) { - $tab = isset($permission->tab) ? $permission->tab : null; + $tab = isset($permission->tab) + ? $permission->tab + : 'backend::lang.form.undefined_tab'; + if (!array_key_exists($tab, $tabs)) { $tabs[$tab] = []; } From 275463996ee6633af2135386a3884f67a61076c7 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 29 Aug 2015 18:42:29 +1000 Subject: [PATCH 006/103] When toggling empty tabs: if a hidden tab was selected, select the first visible tab Induce tab overlap using negative right margin instead (first-child tab can be hidden) Use a slightly cleaner approach than in #1401 --- .../codeeditor/assets/js/build-min.js | 30 ++++++----- .../widgets/form/assets/js/october.form.js | 51 ++++++++++--------- modules/system/assets/ui/less/tab.less | 9 ++-- modules/system/assets/ui/storm-min.js | 3 +- modules/system/assets/ui/storm.css | 5 +- modules/system/models/MailSettings.php | 3 +- 6 files changed, 56 insertions(+), 45 deletions(-) diff --git a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js index 7245d135c..9ca99cb1b 100644 --- a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js +++ b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js @@ -566,10 +566,10 @@ function intLength(num){num=num.replace(/^\-/,'');if(~num.indexOf('.')){return n return num.length;} var actions=require('actions');_.each([1,-1,10,-10,0.1,-0.1],function(num){var prefix=num>0?'increment':'decrement';actions.add(prefix+'_number_by_'+String(Math.abs(num)).replace('.','').substring(0,2),function(editor){return incrementNumber(editor,num);},{label:'Numbers/'+prefix.charAt(0).toUpperCase()+prefix.substring(1)+' number by '+Math.abs(num)});});});emmet.exec(function(require,_){var actions=require('actions');var prefs=require('preferences');prefs.define('css.closeBraceIndentation','\n','Indentation before closing brace of CSS rule. Some users prefere ' +'indented closing brace of CSS rule for better readability. ' -+'This preference’s value will be automatically inserted before ' ++'This preference’s value will be automatically inserted before ' +'closing brace when user adds newline in newly created CSS rule ' -+'(e.g. when “Insert formatted linebreak” action will be performed ' -+'in CSS file). If you’re such user, you may want to write put a value ' ++'(e.g. when “Insert formatted linebreak” action will be performed ' ++'in CSS file). If you’re such user, you may want to write put a value ' +'like \\n\\t in this preference.');actions.add('insert_formatted_line_break_only',function(editor){var utils=require('utils');var res=require('resources');var info=require('editorUtils').outputInfo(editor);var caretPos=editor.getCaretPos();var nl=utils.getNewline();if(_.include(['html','xml','xsl'],info.syntax)){var pad=res.getVariable('indentation');var tag=require('htmlMatcher').tag(info.content,caretPos);if(tag&&!tag.innerRange.length()){editor.replaceContent(nl+pad+utils.getCaretPlaceholder()+nl,caretPos);return true;}}else if(info.syntax=='css'){var content=info.content;if(caretPos&&content.charAt(caretPos-1)=='{'){var append=prefs.get('css.closeBraceIndentation');var pad=res.getVariable('indentation');var hasCloseBrace=content.charAt(caretPos)=='}';if(!hasCloseBrace){for(var i=caretPos,il=content.length,ch;i-bxsh). With this option enabled, you don’t ' ++'(e.g. -bxsh). With this option enabled, you don’t ' +'need dashes before abbreviations: Emmet will produce ' +'vendor-prefixed properties for you.');var descTemplate=_.template('A comma-separated list of CSS properties that may have ' +'<%= vendor %> vendor prefix. This list is used to generate ' @@ -624,7 +624,7 @@ return true;});});emmet.define('cssResolver',function(require,_){var module=null +'properties to original set. To add a new property, simply write its name, ' +'to remove it, precede property with hyphen.
' +'For example, to add foo property and remove border-radius one, ' -+'the preference value will look like this: foo, -border-radius.');var props={'webkit':'animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius','moz':'animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius','ms':'accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode','o':'dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style'};_.each(props,function(v,k){prefs.define('css.'+k+'Properties',v,descTemplate({vendor:k}));prefs.define('css.'+k+'PropertiesAddon','',descAddonTemplate({vendor:k}));});prefs.define('css.unitlessProperties','z-index, line-height, opacity, font-weight, zoom','The list of properties whose values ​​must not contain units.');prefs.define('css.intUnit','px','Default unit for integer values');prefs.define('css.floatUnit','em','Default unit for float values');prefs.define('css.keywords','auto, inherit','A comma-separated list of valid keywords that can be used in CSS abbreviations.');prefs.define('css.keywordAliases','a:auto, i:inherit, s:solid, da:dashed, do:dotted, t:transparent','A comma-separated list of keyword aliases, used in CSS abbreviation. ' ++'the preference value will look like this: foo, -border-radius.');var props={'webkit':'animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius','moz':'animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius','ms':'accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode','o':'dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style'};_.each(props,function(v,k){prefs.define('css.'+k+'Properties',v,descTemplate({vendor:k}));prefs.define('css.'+k+'PropertiesAddon','',descAddonTemplate({vendor:k}));});prefs.define('css.unitlessProperties','z-index, line-height, opacity, font-weight, zoom','The list of properties whose values ​​must not contain units.');prefs.define('css.intUnit','px','Default unit for integer values');prefs.define('css.floatUnit','em','Default unit for float values');prefs.define('css.keywords','auto, inherit','A comma-separated list of valid keywords that can be used in CSS abbreviations.');prefs.define('css.keywordAliases','a:auto, i:inherit, s:solid, da:dashed, do:dotted, t:transparent','A comma-separated list of keyword aliases, used in CSS abbreviation. ' +'Each alias should be defined as alias:keyword_name.');prefs.define('css.unitAliases','e:em, p:%, x:ex, r:rem','A comma-separated list of unit aliases, used in CSS abbreviation. ' +'Each alias should be defined as alias:unit_value.');prefs.define('css.color.short',true,'Should color values like #ffffff be shortened to ' +'#fff after abbreviation with color was expanded.');prefs.define('css.color.case','keep','Letter case of color values generated by abbreviations with color ' @@ -727,7 +727,7 @@ cs.position=1;if('position'in cs){var start=colorStops[from].position||0;var ste function textualDirection(direction){var angle=parseFloat(direction);if(!_.isNaN(angle)){switch(angle%360){case 0:return'left';case 90:return'bottom';case 180:return'right';case 240:return'top';}} return direction;} function oldWebkitDirection(direction){direction=textualDirection(direction);if(reDeg.test(direction)) -throw"The direction is an angle that can’t be converted.";var v=function(pos){return~direction.indexOf(pos)?'100%':'0';};return v('right')+' '+v('bottom')+', '+v('left')+' '+v('top');} +throw"The direction is an angle that can’t be converted.";var v=function(pos){return~direction.indexOf(pos)?'100%':'0';};return v('right')+' '+v('bottom')+', '+v('left')+' '+v('top');} function getPrefixedNames(name){var prefixes=prefs.getArray('css.gradient.prefixes');var names=prefixes?_.map(prefixes,function(p){return'-'+p+'-'+name;}):[];names.push(name);return names;} function getPropertiesForGradient(gradient,propertyName){var props=[];var css=require('cssResolver');if(prefs.get('css.gradient.fallback')&&~propertyName.toLowerCase().indexOf('background')){props.push({name:'background-color',value:'${1:'+gradient.colorStops[0].color+'}'});} _.each(prefs.getArray('css.gradient.prefixes'),function(prefix){var name=css.prefixed(propertyName,prefix);if(prefix=='webkit'&&prefs.get('css.gradient.oldWebkit')){try{props.push({name:name,value:module.oldWebkitLinearGradient(gradient)});}catch(e){}} @@ -771,8 +771,8 @@ return this.getMapping(name);if(this.isInlineLevel(name)) return'span';return'div';},getMapping:function(name){return elementMap[name.toLowerCase()];},isInlineLevel:function(name){return this.isTypeOf(name,'inlineLevel');},isBlockLevel:function(name){return this.isTypeOf(name,'blockLevel');},isEmptyElement:function(name){return this.isTypeOf(name,'empty');},isTypeOf:function(name,type){return _.include(elementTypes[type],name);},addMapping:function(parent,child){elementMap[parent]=child;},removeMapping:function(parent){if(parent in elementMap) delete elementMap[parent];},addElementToCollection:function(name,collection){if(!elementTypes[collection]) elementTypes[collection]=[];var col=this.getCollection(collection);if(!_.include(col,name)) -col.push(name);},removeElementFromCollection:function(name,collection){if(collection in elementTypes){elementTypes[collection]=_.without(this.getCollection(collection),name);}},getCollection:function(name){return elementTypes[name];}};});emmet.exec(function(require,_){var prefs=require('preferences');prefs.define('bem.elementSeparator','__','Class name’s element separator.');prefs.define('bem.modifierSeparator','_','Class name’s modifier separator.');prefs.define('bem.shortElementPrefix','-','Symbol for describing short “block-element” notation. Class names ' -+'prefixed with this symbol will be treated as element name for parent‘s ' +col.push(name);},removeElementFromCollection:function(name,collection){if(collection in elementTypes){elementTypes[collection]=_.without(this.getCollection(collection),name);}},getCollection:function(name){return elementTypes[name];}};});emmet.exec(function(require,_){var prefs=require('preferences');prefs.define('bem.elementSeparator','__','Class name’s element separator.');prefs.define('bem.modifierSeparator','_','Class name’s modifier separator.');prefs.define('bem.shortElementPrefix','-','Symbol for describing short “block-element” notation. Class names ' ++'prefixed with this symbol will be treated as element name for parent‘s ' +'block name. Each symbol instance traverses one level up in parsed ' +'tree for block name lookup. Empty value will disable short notation.');var shouldRunHtmlFilter=false;function getSeparators(){return{element:prefs.get('bem.elementSeparator'),modifier:prefs.get('bem.modifierSeparator')};} function bemParse(item){if(require('abbreviationUtils').isSnippet(item)) @@ -801,13 +801,13 @@ return tree;});});emmet.exec(function(require,_){var prefs=require('preferences' +'function (see Underscore.js docs for details). In template context, ' +'the following properties and functions are availabe:\n' +'
    ' -+'
  • attr(name, before, after) – a function that outputs' ++'
  • attr(name, before, after) – a function that outputs' +'specified attribute value concatenated with before ' +'and after strings. If attribute doesn\'t exists, the ' +'empty string will be returned.
  • ' -+'
  • node – current node (instance of AbbreviationNode)
  • ' -+'
  • name – name of current tag
  • ' -+'
  • padding – current string padding, can be used ' ++'
  • node – current node (instance of AbbreviationNode)
  • ' ++'
  • name – name of current tag
  • ' ++'
  • padding – current string padding, can be used ' +'for formatting
  • ' +'
');prefs.define('filter.commentBefore','','A definition of comment that should be placed before matched ' +'element when comment filter is applied. ' @@ -872,7 +872,7 @@ item.start=item.start.replace(reNl,'');item.end=item.end.replace(reNl,'');item.c item.content=item.content.replace(re,'');process(item,re);});return tree;} require('filters').add('t',function(tree){var re=new RegExp(require('preferences').get('filter.trimRegexp'));return process(tree,re);});});emmet.exec(function(require,_){var tags={'xsl:variable':1,'xsl:with-param':1};function trimAttribute(node){node.start=node.start.replace(/\s+select\s*=\s*(['"]).*?\1/,'');} require('filters').add('xsl',function process(tree){var abbrUtils=require('abbreviationUtils');_.each(tree.children,function(item){if(!abbrUtils.isSnippet(item)&&(item.name()||'').toLowerCase()in tags&&item.children.length) -trimAttribute(item);process(item);});return tree;});});emmet.define('lorem',function(require,_){var langs={en:{common:['lorem','ipsum','dolor','sit','amet','consectetur','adipisicing','elit'],words:['exercitationem','perferendis','perspiciatis','laborum','eveniet','sunt','iure','nam','nobis','eum','cum','officiis','excepturi','odio','consectetur','quasi','aut','quisquam','vel','eligendi','itaque','non','odit','tempore','quaerat','dignissimos','facilis','neque','nihil','expedita','vitae','vero','ipsum','nisi','animi','cumque','pariatur','velit','modi','natus','iusto','eaque','sequi','illo','sed','ex','et','voluptatibus','tempora','veritatis','ratione','assumenda','incidunt','nostrum','placeat','aliquid','fuga','provident','praesentium','rem','necessitatibus','suscipit','adipisci','quidem','possimus','voluptas','debitis','sint','accusantium','unde','sapiente','voluptate','qui','aspernatur','laudantium','soluta','amet','quo','aliquam','saepe','culpa','libero','ipsa','dicta','reiciendis','nesciunt','doloribus','autem','impedit','minima','maiores','repudiandae','ipsam','obcaecati','ullam','enim','totam','delectus','ducimus','quis','voluptates','dolores','molestiae','harum','dolorem','quia','voluptatem','molestias','magni','distinctio','omnis','illum','dolorum','voluptatum','ea','quas','quam','corporis','quae','blanditiis','atque','deserunt','laboriosam','earum','consequuntur','hic','cupiditate','quibusdam','accusamus','ut','rerum','error','minus','eius','ab','ad','nemo','fugit','officia','at','in','id','quos','reprehenderit','numquam','iste','fugiat','sit','inventore','beatae','repellendus','magnam','recusandae','quod','explicabo','doloremque','aperiam','consequatur','asperiores','commodi','optio','dolor','labore','temporibus','repellat','veniam','architecto','est','esse','mollitia','nulla','a','similique','eos','alias','dolore','tenetur','deleniti','porro','facere','maxime','corrupti']},ru:{common:['даНокО-даНокО','Са','словесными','горами','в стране','гласных','и согласных','живут','рыбные','тексты'],words:['вдаНи','от всех','Они','буквенных','домах','на берегу','семантика','большого','языкового','Окоана','маленький','ручеек','даль','журчит','пО всоК','обеспечивает','оо','всоПи','необходимыми','правилами','эта','парадигматическая','страна','которой','жаренные','предложения','залетают','прямо','рот','даМо','всемогущая','пунктуация','но','имеет','власти','над','рыбными','текстами','ведущими','безорфографичный','образ','МиСни','однажды','Одна','маленькая','строчка','рыбного','текста','иПони','lorem','ipsum','решила','выйти','большой','мир','грамматики','воНикиК','ОксПОкс','предупреждал','Đž','злых','запятых','диких','знаках','вопроса','коварных','точках','запятой','нО','текст','даН','сбить','себя','толку','Он','собрал','семь','своих','заглавных','йукв','подпоясал','инициал','Са','пояс','пустился','дорогу','взобравшись','первую','вершину','курсивных','гор','бросил','пОсНодниК','взгляд','наСад','силуэт','свОогО','родного','города','буквоград','СагОНОвОк','деревни','алфавит','пОдСагОНОвОк','свОогО','переулка','грустный','реторический','вопрос','скатился','огО','щеке','продолжил','свОК','путь','дороге','встретил','рукопись','Она','предупредила','ПОоК','всо','переписывается','несколько','раз','единственное','что','меня','осталось','это','приставка','возвращайся','ты','лучше','свою','безопасную','страну','послушавшись','рукописи','наш','продолжил','свОК','путь','вскоре','оПу','повстречался','коварный','составитель','рекламных','текстов','напОившиК','языком','речью','СаПанившиК','свОо','агенство','которое','использовало','снОва','снОва','своих','проектах','осНи','переписали','то','живет','там','Đ´Đž','сих','пор']}};var prefs=require('preferences');prefs.define('lorem.defaultLang','en');require('abbreviationParser').addPreprocessor(function(tree,options){var re=/^(?:lorem|lipsum)([a-z]{2})?(\d*)$/i,match;tree.findAll(function(node){if(node._name&&(match=node._name.match(re))){var wordCound=match[2]||30;var lang=match[1]||prefs.get('lorem.defaultLang')||'en';node._name='';node.data('forceNameResolving',node.isRepeating()||node.attributeList().length);node.data('pasteOverwrites',true);node.data('paste',function(i,content){return paragraph(lang,wordCound,!i);});}});});function randint(from,to){return Math.round(Math.random()*(to-from)+from);} +trimAttribute(item);process(item);});return tree;});});emmet.define('lorem',function(require,_){var langs={en:{common:['lorem','ipsum','dolor','sit','amet','consectetur','adipisicing','elit'],words:['exercitationem','perferendis','perspiciatis','laborum','eveniet','sunt','iure','nam','nobis','eum','cum','officiis','excepturi','odio','consectetur','quasi','aut','quisquam','vel','eligendi','itaque','non','odit','tempore','quaerat','dignissimos','facilis','neque','nihil','expedita','vitae','vero','ipsum','nisi','animi','cumque','pariatur','velit','modi','natus','iusto','eaque','sequi','illo','sed','ex','et','voluptatibus','tempora','veritatis','ratione','assumenda','incidunt','nostrum','placeat','aliquid','fuga','provident','praesentium','rem','necessitatibus','suscipit','adipisci','quidem','possimus','voluptas','debitis','sint','accusantium','unde','sapiente','voluptate','qui','aspernatur','laudantium','soluta','amet','quo','aliquam','saepe','culpa','libero','ipsa','dicta','reiciendis','nesciunt','doloribus','autem','impedit','minima','maiores','repudiandae','ipsam','obcaecati','ullam','enim','totam','delectus','ducimus','quis','voluptates','dolores','molestiae','harum','dolorem','quia','voluptatem','molestias','magni','distinctio','omnis','illum','dolorum','voluptatum','ea','quas','quam','corporis','quae','blanditiis','atque','deserunt','laboriosam','earum','consequuntur','hic','cupiditate','quibusdam','accusamus','ut','rerum','error','minus','eius','ab','ad','nemo','fugit','officia','at','in','id','quos','reprehenderit','numquam','iste','fugiat','sit','inventore','beatae','repellendus','magnam','recusandae','quod','explicabo','doloremque','aperiam','consequatur','asperiores','commodi','optio','dolor','labore','temporibus','repellat','veniam','architecto','est','esse','mollitia','nulla','a','similique','eos','alias','dolore','tenetur','deleniti','porro','facere','maxime','corrupti']},ru:{common:['далеко-далеко','за','словесными','горами','в стране','гласных','и согласных','живут','рыбные','тексты'],words:['вдали','от всех','они','буквенных','домах','на берегу','семантика','большого','языкового','океана','маленький','ручеек','даль','журчит','по всей','обеспечивает','ее','всеми','необходимыми','правилами','эта','парадигматическая','страна','которой','жаренные','предложения','залетают','прямо','рот','даже','всемогущая','пунктуация','не','имеет','власти','над','рыбными','текстами','ведущими','безорфографичный','образ','жизни','однажды','одна','маленькая','строчка','рыбного','текста','имени','lorem','ipsum','решила','выйти','большой','мир','грамматики','великий','оксмокс','предупреждал','о','злых','запятых','диких','знаках','вопроса','коварных','точках','запятой','но','текст','дал','сбить','себя','толку','он','собрал','семь','своих','заглавных','букв','подпоясал','инициал','за','пояс','пустился','дорогу','взобравшись','первую','вершину','курсивных','гор','бросил','последний','взгляд','назад','силуэт','своего','родного','города','буквоград','заголовок','деревни','алфавит','подзаголовок','своего','переулка','грустный','реторический','вопрос','скатился','его','щеке','продолжил','свой','путь','дороге','встретил','рукопись','она','предупредила','моей','все','переписывается','несколько','раз','единственное','что','меня','осталось','это','приставка','возвращайся','ты','лучше','свою','безопасную','страну','послушавшись','рукописи','наш','продолжил','свой','путь','вскоре','ему','повстречался','коварный','составитель','рекламных','текстов','напоивший','языком','речью','заманивший','свое','агенство','которое','использовало','снова','снова','своих','проектах','если','переписали','то','живет','там','до','сих','пор']}};var prefs=require('preferences');prefs.define('lorem.defaultLang','en');require('abbreviationParser').addPreprocessor(function(tree,options){var re=/^(?:lorem|lipsum)([a-z]{2})?(\d*)$/i,match;tree.findAll(function(node){if(node._name&&(match=node._name.match(re))){var wordCound=match[2]||30;var lang=match[1]||prefs.get('lorem.defaultLang')||'en';node._name='';node.data('forceNameResolving',node.isRepeating()||node.attributeList().length);node.data('pasteOverwrites',true);node.data('paste',function(i,content){return paragraph(lang,wordCound,!i);});}});});function randint(from,to){return Math.round(Math.random()*(to-from)+from);} function sample(arr,count){var len=arr.length;var iterations=Math.min(len,count);var result=[];while(result.length