From 0eaae8712e4e52e03ffc3165f86cff0b8dc92c39 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 22 Jul 2014 16:32:40 +0400 Subject: [PATCH 01/11] do not rename kr_theme to kr during the build --- Makefile.dryice.js | 2 +- lib/ace/config.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 2bc36f8b..bac090f7 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -359,7 +359,7 @@ function buildAce(options) { buildSubmodule(options, { projectType: "theme", require: ["ace/theme/" + name] - }, "theme-" + name.replace("_theme", "")); + }, "theme-" + name); }); // keybindings ["vim", "emacs"].forEach(function(name) { diff --git a/lib/ace/config.js b/lib/ace/config.js index f4e4c89a..94e9465f 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -80,11 +80,7 @@ exports.moduleUrl = function(name, component) { // todo make this configurable or get rid of '-' var sep = component == "snippets" ? "/" : "-"; - var base = parts[parts.length - 1]; - if (sep == "-") { - var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); - base = base.replace(re, ""); - } + var base = parts[parts.length - 1]; if ((!base || base == component) && parts.length > 1) base = parts[parts.length - 2]; From 23f678229aaad720b8f82d98743bece56114a2de Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 22 Jul 2014 16:57:14 +0400 Subject: [PATCH 02/11] update config_test.js --- lib/ace/config_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/config_test.js b/lib/ace/config_test.js index d09a2801..ac664fae 100644 --- a/lib/ace/config_test.js +++ b/lib/ace/config_test.js @@ -43,7 +43,7 @@ module.exports = { "test: path resolution" : function() { config.set("packaged", "true"); var url = config.moduleUrl("kr_theme", "theme"); - assert.equal(url, "theme-kr.js"); + assert.equal(url, "theme-kr_theme.js"); config.set("basePath", "a/b"); url = config.moduleUrl("m/theme", "theme"); From 80f42e13ffe424ea5ac1f4f68b7e2173a9c39778 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 28 Jul 2014 19:10:41 +0400 Subject: [PATCH 03/11] accept mode options object in static highlight extension --- lib/ace/ext/static_highlight.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ace/ext/static_highlight.js b/lib/ace/ext/static_highlight.js index 1d69a9bb..9116467b 100644 --- a/lib/ace/ext/static_highlight.js +++ b/lib/ace/ext/static_highlight.js @@ -98,7 +98,6 @@ var highlight = function(el, opts, callback) { * and `css`. * @returns {object} An object containing the properties `html` and `css`. */ - highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { var waiting = 1; var modeCache = EditSession.prototype.$modes; @@ -112,11 +111,17 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba --waiting || done(); }); } - + // allow setting mode options e.h {path: "ace/mode/php", inline:true} + var modeOptions; + if (mode && typeof mode === "object" && !mode.getTokenizer) { + modeOptions = mode; + mode = modeOptions.path; + } if (typeof mode == "string") { waiting++; config.loadModule(['mode', mode], function(m) { - if (!modeCache[mode]) modeCache[mode] = new m.Mode(); + if (!modeCache[mode] || modeOptions) + modeCache[mode] = new m.Mode(modeOptions); mode = modeCache[mode]; --waiting || done(); }); @@ -130,14 +135,13 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba return --waiting || done(); }; -/* +/** * Transforms a given input code snippet into HTML using the given mode * @param {string} input Code snippet * @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') * @param {string} r Code snippet * @returns {object} An object containing: html, css */ - highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { lineStart = parseInt(lineStart || 1, 10); From b990ad3f90f14f99cfbe8bcb2a807027cfee7228 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 2 Aug 2014 00:56:34 +0400 Subject: [PATCH 04/11] update csslint --- lib/ace/mode/css/csslint.js | 968 ++++++++++++++++++++++++------------ lib/ace/mode/css_worker.js | 7 +- 2 files changed, 647 insertions(+), 328 deletions(-) diff --git a/lib/ace/mode/css/csslint.js b/lib/ace/mode/css/csslint.js index a3a7a9bd..c3c79a80 100644 --- a/lib/ace/mode/css/csslint.js +++ b/lib/ace/mode/css/csslint.js @@ -4,7 +4,7 @@ CSSLint Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal +of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is @@ -13,7 +13,7 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Build: v0.10.0 31-March-2014 08:16:48 */ +/* Build: v0.10.0 22-July-2014 01:17:52 */ /*! Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -46,11 +46,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.4, Build time: 7-January-2014 07:32:49 */ +/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ var parserlib = {}; (function(){ - /** * A generic base to inherit from for any object * that needs event handling. @@ -506,7 +505,7 @@ SyntaxUnit.prototype = { * @method valueOf */ valueOf: function(){ - return this.toString(); + return this.text; }, /** @@ -921,8 +920,6 @@ TokenStreamBase.prototype = { }; - - parserlib.util = { StringReader: StringReader, SyntaxError : SyntaxError, @@ -931,8 +928,6 @@ EventTarget : EventTarget, TokenStreamBase : TokenStreamBase }; })(); - - /* Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -956,7 +951,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.4, Build time: 7-January-2014 07:32:49 */ +/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ (function(){ var EventTarget = parserlib.util.EventTarget, TokenStreamBase = parserlib.util.TokenStreamBase, @@ -964,7 +959,6 @@ StringReader = parserlib.util.StringReader, SyntaxError = parserlib.util.SyntaxError, SyntaxUnit = parserlib.util.SyntaxUnit; - var Colors = { aliceblue :"#f0f8ff", antiquewhite :"#faebd7", @@ -1182,7 +1176,6 @@ function Combinator(text, line, col){ Combinator.prototype = new SyntaxUnit(); Combinator.prototype.constructor = Combinator; - /*global SyntaxUnit, Parser*/ /** * Represents a media feature, such as max-width:500. @@ -1215,7 +1208,6 @@ function MediaFeature(name, value){ MediaFeature.prototype = new SyntaxUnit(); MediaFeature.prototype.constructor = MediaFeature; - /*global SyntaxUnit, Parser*/ /** * Represents an individual media query. @@ -1259,7 +1251,6 @@ function MediaQuery(modifier, mediaType, features, line, col){ MediaQuery.prototype = new SyntaxUnit(); MediaQuery.prototype.constructor = MediaQuery; - /*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit, PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector, PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */ @@ -1521,7 +1512,7 @@ Parser.prototype = function(){ tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); //grab the URI value - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); + uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1"); this._readWhitespace(); @@ -1626,8 +1617,10 @@ Parser.prototype = function(){ while(true) { if (tokenStream.peek() == Tokens.PAGE_SYM){ this._page(); - } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ + } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ this._font_face(); + } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ + this._viewport(); } else if (!this._ruleset()){ break; } @@ -2823,7 +2816,7 @@ Parser.prototype = function(){ value = null, operator = null; - value = this._term(); + value = this._term(inFunction); if (value !== null){ values.push(value); @@ -2840,7 +2833,7 @@ Parser.prototype = function(){ valueParts = []; }*/ - value = this._term(); + value = this._term(inFunction); if (value === null){ break; @@ -2858,7 +2851,7 @@ Parser.prototype = function(){ return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; }, - _term: function(){ + _term: function(inFunction){ /* * term @@ -2872,6 +2865,7 @@ Parser.prototype = function(){ var tokenStream = this._tokenStream, unary = null, value = null, + endChar = null, token, line, col; @@ -2892,6 +2886,20 @@ Parser.prototype = function(){ col = tokenStream.token().startCol; } + //see if it's a simple block + } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])){ + + token = tokenStream.token(); + endChar = token.endChar; + value = token.value + this._expr(inFunction).text; + if (unary === null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + tokenStream.mustMatch(Tokens.type(endChar)); + value += endChar; + this._readWhitespace(); + //see if there's a simple match } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, Tokens.ANGLE, Tokens.TIME, @@ -3536,7 +3544,6 @@ nth ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* ; */ - /*global Validation, ValidationTypes, ValidationError*/ var Properties = { @@ -3553,6 +3560,7 @@ var Properties = { "animation-delay" : { multi: "