From c172614b0af24347c47ecb47f6ac15dd935847d2 Mon Sep 17 00:00:00 2001 From: Bernhard Sirlinger Date: Fri, 7 Feb 2014 19:06:19 +0100 Subject: [PATCH 001/125] Update Less to 1.6.2 --- Gruntfile.js | 2 +- src/index.html | 2 +- src/thirdparty/less-1.6.2.min.js | 16 ++++++++++++++++ test/SpecRunner.html | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/thirdparty/less-1.6.2.min.js diff --git a/Gruntfile.js b/Gruntfile.js index 33d7991d8c2..b926133fcc5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -254,7 +254,7 @@ module.exports = function (grunt) { 'src/thirdparty/CodeMirror2/addon/selection/active-line.js', 'src/thirdparty/mustache/mustache.js', 'src/thirdparty/path-utils/path-utils.min', - 'src/thirdparty/less-1.4.2.min.js' + 'src/thirdparty/less-1.6.2.min.js' ], helpers : [ 'test/spec/PhantomHelper.js' diff --git a/src/index.html b/src/index.html index 17b5859c8c0..a8dd8eed7bc 100644 --- a/src/index.html +++ b/src/index.html @@ -46,7 +46,7 @@ - + diff --git a/src/thirdparty/less-1.6.2.min.js b/src/thirdparty/less-1.6.2.min.js new file mode 100644 index 00000000000..ff8cd55c99f --- /dev/null +++ b/src/thirdparty/less-1.6.2.min.js @@ -0,0 +1,16 @@ +/*! + * LESS - Leaner CSS v1.6.2 + * http://lesscss.org + * + * Copyright (c) 2009-2014, Alexis Sellier + * Licensed under the Apache v2 License. + * + */ + + /** * @license Apache v2 + */ + +!function(a,b){function c(b){return a.less[b.split("/")[1]]}function d(a,b){"development"==v.env&&"undefined"!=typeof console&&v.logLevel>=b&&console.log("less: "+a)}function e(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function f(a,c){var e="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,c,d){a.extract[c]!==b&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")):a.stack&&(h+=a.stack),d(h,y.errors)}function g(a,b,c){var f=b.href||"",g="less:"+(b.title||e(f)),h=document.getElementById(g),i=!1,j=document.createElement("style");if(j.setAttribute("type","text/css"),b.media&&j.setAttribute("media",b.media),j.id=g,j.styleSheet)try{j.styleSheet.cssText=a}catch(k){throw new Error("Couldn't reassign styleSheet.cssText.")}else j.appendChild(document.createTextNode(a)),i=null!==h&&h.childNodes.length>0&&j.childNodes.length>0&&h.firstChild.nodeValue===j.firstChild.nodeValue;var l=document.getElementsByTagName("head")[0];if(null===h||i===!1){var m=b&&b.nextSibling||null;m?m.parentNode.insertBefore(j,m):l.appendChild(j)}if(h&&i===!1&&h.parentNode.removeChild(h),c&&C){d("saving "+f+" to cache.",y.info);try{C.setItem(f,a),C.setItem(f+":timestamp",c)}catch(k){d("failed to save",y.errors)}}}function h(a,c){var d,f,h="less-error-message:"+e(c||""),i='
  • {content}
  • ',j=document.createElement("div"),k=[],l=a.filename||c,m=l.match(/([^\/]+(\?.*)?)$/)[1];j.id=h,j.className="less-error-message",f="

    "+(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+'

    in '+m+" ";var n=function(a,c,d){a.extract[c]!==b&&k.push(i.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(n(a,0,""),n(a,1,"line"),n(a,2,""),f+="on line "+a.line+", column "+(a.column+1)+":

    "):a.stack&&(f+="
    "+a.stack.split("\n").slice(1).join("
    ")),j.innerHTML=f,g([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),j.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"==v.env&&(d=setInterval(function(){document.body&&(document.getElementById(h)?document.body.replaceChild(j,document.getElementById(h)):document.body.insertBefore(j,document.body.firstChild),clearInterval(d))},10))}function i(a,b){v.errorReporting&&"html"!==v.errorReporting?"console"===v.errorReporting?f(a,b):"function"==typeof v.errorReporting&&v.errorReporting("add",a,b):h(a,b)}function j(a){var b=document.getElementById("less-error-message:"+e(a));b&&b.parentNode.removeChild(b)}function k(){}function l(a){v.errorReporting&&"html"!==v.errorReporting?"console"===v.errorReporting?k(a):"function"==typeof v.errorReporting&&v.errorReporting("remove",a):j(a)}function m(a){for(var b,c=document.getElementsByTagName("style"),d=0;d0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=f[1]+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g}function o(a,b){var c,d,e,f,g=n(a),h=n(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;c=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var g=p(),h=x?v.fileAsync:v.async;"function"==typeof g.overrideMimeType&&g.overrideMimeType("text/css"),d("XHR: Getting '"+a+"'",y.info),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),x&&!v.fileAsync?0===g.status||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){4==g.readyState&&f(g,c,e)}:f(g,c,e)}function r(b,c,d,e){c&&c.currentDirectory&&!/^([a-z-]+:)?\//.test(b)&&(b=c.currentDirectory+b);var f=n(b,a.location.href),g=f.url,h={currentDirectory:f.path,filename:g};if(c?(h.entryPath=c.entryPath,h.rootpath=c.rootpath,h.rootFilename=c.rootFilename,h.relativeUrls=c.relativeUrls):(h.entryPath=f.path,h.rootpath=v.rootpath||f.path,h.rootFilename=g,h.relativeUrls=e.relativeUrls),h.relativeUrls&&(h.rootpath=e.rootpath?n(e.rootpath+o(f.path,h.entryPath)).path:f.path),e.useFileCache&&D[g])try{var i=D[g];d(null,i,g,h,{lastModified:new Date})}catch(j){d(j,null,g)}else q(g,e.mime,function(a,b){D[g]=a;try{d(null,a,g,h,{lastModified:b})}catch(c){d(c,null,g)}},function(a,b){d({type:"File",message:"'"+b+"' wasn't found ("+a+")"},null,g)})}function s(a,b,c,d,e){var f=new v.tree.parseEnv(v);f.mime=a.type,(e||v.globalVars)&&(f.useFileCache=!0),r(a.href,null,function(h,i,j,k,m){if(m){m.remaining=d;var n=C&&C.getItem(j),o=C&&C.getItem(j+":timestamp");if(!c&&o&&m.lastModified&&new Date(m.lastModified).valueOf()===new Date(o).valueOf())return g(n,a),m.local=!0,b(null,null,i,a,m,j),void 0}l(j),i?(f.currentFileInfo=k,new v.Parser(f).parse(i,function(c,d){if(c)return b(c,null,null,a);try{b(c,d,i,a,m,j)}catch(c){b(c,null,null,a)}},{modifyVars:e,globalVars:v.globalVars})):b(h,null,null,a,m,j)},f,e)}function t(a,b,c){for(var d=0;dE&&(D=D.slice(x-E),E=x)}function g(a,b){var c=a.charCodeAt(0|b);return 32>=c&&(32===c||10===c||9===c)}function h(a){var b,c,d=typeof a;return"string"===d?u.charAt(x)!==a?null:(k(1),a):(f(),(b=a.exec(D))?(c=b[0].length,k(c),"string"==typeof b?b:1===b.length?b[0]:b):null)}function i(a){x>E&&(D=D.slice(x-E),E=x);var b=a.exec(D);return b?(k(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null}function j(a){return u.charAt(x)!==a?null:(k(1),a)}function k(a){for(var b,c=x,d=y,e=x-E,f=x+D.length-e,g=x+=a,h=u;f>x&&(b=h.charCodeAt(x),!(b>32))&&(32===b||10===b||9===b||13===b);x++);return D=D.slice(a+x-g+e),E=x,!D.length&&y=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}function s(a,b,d){var e=d.currentFileInfo.filename;return"browser"!==v.mode&&"rhino"!==v.mode&&(e=c("path").resolve(e)),{lineNumber:r(a,b).line+1,fileName:e}}function t(a,b){var c=q(a,b),d=r(a.index,c),e=d.line,f=d.column,g=a.call&&r(a.call,c).line,h=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.currentFileInfo.filename,this.index=a.index,this.line="number"==typeof e?e+1:null,this.callLine=g+1,this.callExtract=h[g],this.stack=a.stack,this.column=f,this.extract=[h[e-1],h[e],h[e+1]]}var u,x,y,z,A,B,C,D,E,F,G,H=a&&a.filename;a instanceof w.parseEnv||(a=new w.parseEnv(a));var I=this.imports={paths:a.paths||[],queue:[],files:a.files,contents:a.contents,contentsIgnoredChars:a.contentsIgnoredChars,mime:a.mime,error:null,push:function(b,c,d,e){var f=this;this.queue.push(b);var g=function(a,c,d){f.queue.splice(f.queue.indexOf(b),1);var g=d in f.files||d===H;f.files[d]=c,a&&!f.error&&(f.error=a),e(a,c,g,d)};v.Parser.importer?v.Parser.importer(b,c,g,a):v.Parser.fileLoader(b,c,function(b,e,f,h){if(b)return g(b),void 0;var i=new w.parseEnv(a);i.currentFileInfo=h,i.processImports=!1,i.contents[f]=e,(c.reference||d.reference)&&(h.reference=!0),d.inline?g(null,e,f):new v.Parser(i).parse(e,function(a,b){g(a,b,f)})},a)}},J=i;return t.prototype=new Error,t.prototype.constructor=t,this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,F={imports:I,parse:function(d,e,f){var g,h,i,j,k,l=null,m="";if(x=y=E=B=0,j=f&&f.globalVars?v.Parser.serializeVars(f.globalVars)+"\n":"",k=f&&f.modifyVars?"\n"+v.Parser.serializeVars(f.modifyVars):"",(j||f&&f.banner)&&(m=(f&&f.banner?f.banner:"")+j,F.imports.contentsIgnoredChars[a.currentFileInfo.filename]=m.length),d=d.replace(/\r\n/g,"\n"),u=d=m+d.replace(/^\uFEFF/,"")+k,F.imports.contents[a.currentFileInfo.filename]=d,C=function(b){function c(b,c){l=new t({index:c||i,type:"Parse",message:b,filename:a.currentFileInfo.filename},a)}function d(a){var c=i-s;512>c&&!a||!c||(r.push(b.slice(s,i+1)),s=i+1)}var e,f,g,h,i,j,k,m,n,o=b.length,p=0,q=0,r=[],s=0;for(i=0;o>i;i++)if(k=b.charCodeAt(i),!(k>=97&&122>=k||34>k))switch(k){case 40:q++,f=i;continue;case 41:if(--q<0)return c("missing opening `(`");continue;case 59:q||d();continue;case 123:p++,e=i;continue;case 125:if(--p<0)return c("missing opening `{`");p||d();continue;case 92:if(o-1>i){i++;continue}return c("unescaped `\\`");case 34:case 39:case 96:for(n=0,j=i,i+=1;o>i;i++)if(m=b.charCodeAt(i),!(m>96)){if(m==k){n=1;break}if(92==m){if(i==o-1)return c("unescaped `\\`");i++}}if(n)continue;return c("unmatched `"+String.fromCharCode(k)+"`",j);case 47:if(q||i==o-1)continue;if(m=b.charCodeAt(i+1),47==m)for(i+=2;o>i&&(m=b.charCodeAt(i),!(13>=m)||10!=m&&13!=m);i++);else if(42==m){for(g=j=i,i+=2;o-1>i&&(m=b.charCodeAt(i),125==m&&(h=i),42!=m||47!=b.charCodeAt(i+1));i++);if(i==o-1)return c("missing closing `*/`",j);i++}continue;case 42:if(o-1>i&&47==b.charCodeAt(i+1))return c("unmatched `/*`");continue}return 0!==p?g>e&&h>g?c("missing closing `}` or `*/`",e):c("missing closing `}`",e):0!==q?c("missing closing `)`",f):(d(!0),r)}(d),l)return e(new t(l,a));D=C[0];try{g=new w.Ruleset(null,this.parsers.primary()),g.root=!0,g.firstRoot=!0}catch(n){return e(new t(n,a))}if(g.toCSS=function(d){return function(e,f){e=e||{};var g,h,i=new w.evalEnv(e);"object"!=typeof f||Array.isArray(f)||(f=Object.keys(f).map(function(a){var b=f[a];return b instanceof w.Value||(b instanceof w.Expression||(b=new w.Expression([b])),b=new w.Value([b])),new w.Rule("@"+a,b,!1,null,0)}),i.frames=[new w.Ruleset(null,f)]);try{var j,k=[],l=[new w.joinSelectorVisitor,new w.processExtendsVisitor,new w.toCSSVisitor({compress:Boolean(e.compress)})],m=this;if(e.plugins)for(j=0;j57||43>b||47===b||44==b))return a=i(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/),a?new w.Dimension(a[1],a[2]):void 0},unicodeDescriptor:function(){var a;return a=i(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new w.UnicodeDescriptor(a[0]):void 0},javascript:function(){var c,d,e=x;return"~"===u.charAt(e)&&(e++,d=!0),"`"===u.charAt(e)?(a.javascriptEnabled===b||a.javascriptEnabled||n("You are using JavaScript, which has been disabled."),d&&j("~"),c=i(/^`([^`]*)`/),c?new w.JavaScript(c[1],x,d):void 0):void 0}},variable:function(){var a;return"@"===u.charAt(x)&&(a=i(/^(@[\w-]+)\s*:/))?a[1]:void 0},extend:function(a){var b,c,d,e,f,g=x;if(a?i(/^&:extend\(/):i(/^:extend\(/)){do{for(d=null,b=null;!(d=i(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];d=d&&d[1],f=new w.Extend(new w.Selector(b),d,g),e?e.push(f):e=[f]}while(j(","));return l(/^\)/),a&&l(/^;/),e}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var b,c,f,g,h,k,l=u.charAt(x),n=!1,o=x;if("."===l||"#"===l){for(d();;){if(b=x,g=i(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!g)break;f=new w.Element(h,g,b,a.currentFileInfo),c?c.push(f):c=[f],h=j(">")}return c&&(j("(")&&(k=this.args(!0).args,m(")")),G.important()&&(n=!0),G.end())?new w.mixin.Call(c,k,o,a.currentFileInfo,n):(e(),void 0)}},args:function(a){for(var b,c,d,e,f,g,h=F.parsers,k=h.entities,m={args:null,variadic:!1},o=[],p=[],q=[];;){if(a)g=h.expression();else{if(h.comments(),"."===u.charAt(x)&&i(/^\.{3}/)){m.variadic=!0,j(";")&&!b&&(b=!0),(b?p:q).push({variadic:!0});break}g=k.variable()||k.literal()||k.keyword()}if(!g)break;e=null,g.throwAwayComments&&g.throwAwayComments(),f=g;var r=null;if(a?1==g.value.length&&(r=g.value[0]):r=g,r&&r instanceof w.Variable)if(j(":"))o.length>0&&(b&&n("Cannot mix ; and , as delimiter types"),c=!0),f=l(h.expression),e=d=r.name;else{if(!a&&i(/^\.{3}/)){m.variadic=!0,j(";")&&!b&&(b=!0),(b?p:q).push({name:g.name,variadic:!0});break}a||(d=e=r.name,f=null)}f&&o.push(f),q.push({name:e,value:f}),j(",")||(j(";")||b)&&(c&&n("Cannot mix ; and , as delimiter types"),b=!0,o.length>1&&(f=new w.Value(o)),p.push({name:d,value:f}),d=null,o=[],c=!1)}return m.args=b?p:q,m},definition:function(){var a,b,c,f,g=[],h=!1;if(!("."!==u.charAt(x)&&"#"!==u.charAt(x)||o(/^[^{]*\}/))&&(d(),b=i(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/))){a=b[1];var k=this.args(!1);if(g=k.args,h=k.variadic,j(")")||(B=x,e()),G.comments(),i(/^when/)&&(f=l(G.conditions,"expected condition")),c=G.block())return new w.mixin.Definition(a,g,c,f,h);e()}}},entity:function(){var a=this.entities;return a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()||this.comment()},end:function(){return j(";")||p("}")},alpha:function(){var a;if(i(/^\(opacity=/i))return a=i(/^\d+/)||this.entities.variable(),a?(m(")"),new w.Alpha(a)):void 0},element:function(){var b,c,d,e=x;return c=this.combinator(),b=i(/^(?:\d+\.\d+|\d+)%/)||i(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||j("*")||j("&")||this.attribute()||i(/^\([^()@]+\)/)||i(/^[\.#](?=@)/)||this.entities.variableCurly(),b||j("(")&&(d=this.selector())&&j(")")&&(b=new w.Paren(d)),b?new w.Element(c,b,e,a.currentFileInfo):void 0},combinator:function(){var a=u.charAt(x);if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(x++,"^"===u.charAt(x)&&(a="^^",x++);g(u,x);)x++;return new w.Combinator(a)}return g(u,x-1)?new w.Combinator(" "):new w.Combinator(null)},lessSelector:function(){return this.selector(!0)},selector:function(b){for(var c,d,e,f,g,h,i,j=x,k=J;(b&&(g=this.extend())||b&&(h=k(/^when/))||(f=this.element()))&&(h?i=l(this.conditions,"expected condition"):i?n("CSS guard can only be used at the end of selector"):g?d?d.push(g):d=[g]:(d&&n("Extend can only be used at the end of selector"),e=u.charAt(x),c?c.push(f):c=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return c?new w.Selector(c,d,i,j,a.currentFileInfo):(d&&n("Extend must be used to extend a selector, it cannot be used on its own"),void 0)},attribute:function(){if(j("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=l(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=i(/^[|~*$^]?=/),c&&(b=d.quoted()||i(/^[0-9]+%/)||i(/^[\w-]+/)||d.variableCurly()),m("]"),new w.Attribute(a,c,b)}},block:function(){var a;return j("{")&&(a=this.primary())&&j("}")?a:void 0},ruleset:function(){var b,c,f,g;for(d(),a.dumpLineNumbers&&(g=s(x,u,a));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],this.comments(),c.condition&&b.length>1&&n("Guards are only currently allowed on a single selector."),!j(","))break;c.condition&&n("Guards are only currently allowed on a single selector."),this.comments()}if(b&&(f=this.block())){var h=new w.Ruleset(b,f,a.strictImports);return a.dumpLineNumbers&&(h.debugInfo=g),h}B=x,e()},rule:function(b){var c,f,g,h=u.charAt(x),i=!1;if(d(),"."!==h&&"#"!==h&&"&"!==h&&(c=this.variable()||this.ruleProperty())){if(f=!b&&(a.compress||c.charAt&&"@"===c.charAt(0))?this.value()||this.anonymousValue():this.anonymousValue()||this.value(),g=this.important(),i=c.pop&&"+"===c.pop().value,f&&this.end())return new w.Rule(c,f,g,i,A,a.currentFileInfo);if(B=x,e(),f&&!b)return this.rule(!0)}},anonymousValue:function(){var a;return a=/^([^@+\/'"*`(;{}-]*);/.exec(D),a?(x+=a[0].length-1,new w.Anonymous(a[1])):void 0},"import":function(){var b,c,f=x;d();var g=i(/^@import?\s+/),h=(g?this.importOptions():null)||{};return g&&(b=this.entities.quoted()||this.entities.url())&&(c=this.mediaFeatures(),j(";"))?(c=c&&new w.Value(c),new w.Import(b,c,h,f,a.currentFileInfo)):(e(),void 0)},importOptions:function(){var a,b,c,d={};if(!j("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!j(","))break}while(a);return m(")"),d},importOption:function(){var a=i(/^(less|css|multiple|once|inline|reference)/);return a?a[1]:void 0},mediaFeature:function(){var b,c,d=this.entities,e=[];do if(b=d.keyword()||d.variable())e.push(b);else if(j("(")){if(c=this.property(),b=this.value(),!j(")"))return null;if(c&&b)e.push(new w.Paren(new w.Rule(c,b,null,null,x,a.currentFileInfo,!0)));else{if(!b)return null;e.push(new w.Paren(b))}}while(b);return e.length>0?new w.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!j(","))break}else if(a=b.variable(),a&&(c.push(a),!j(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,d,e;return a.dumpLineNumbers&&(e=s(x,u,a)),i(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(d=new w.Media(c,b,x,a.currentFileInfo),a.dumpLineNumbers&&(d.debugInfo=e),d):void 0},directive:function(){var b,c,f,g,h,k,l,m,n=x;if("@"===u.charAt(x)){if(c=this["import"]()||this.media())return c;if(d(),b=i(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@font-face":h=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":h=!0;break;case"@host":case"@page":case"@document":case"@supports":case"@keyframes":h=!0,k=!0;break;case"@namespace":l=!0}if(k&&(m=(i(/^[^{]+/)||"").trim(),m&&(b+=" "+m)),h){if(f=this.block())return new w.Directive(b,f,n,a.currentFileInfo)}else if(c=l?this.expression():this.entity(),c&&j(";")){var o=new w.Directive(b,c,n,a.currentFileInfo);return a.dumpLineNumbers&&(o.debugInfo=s(x,u,a)),o}e()}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!j(",")))break;while(a);return b.length>0?new w.Value(b):void 0},important:function(){return"!"===u.charAt(x)?i(/^! *important/):void 0},sub:function(){var a,b;return j("(")&&(a=this.addition())?(b=new w.Expression([a]),m(")"),b.parens=!0,b):void 0},multiplication:function(){var a,b,c,d,e;if(a=this.operand()){for(e=g(u,x-1);;){if(o(/^\/[*\/]/))break;if(c=j("/")||j("*"),!c)break;if(b=this.operand(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new w.Operation(c,[d||a,b],e),e=g(u,x-1)}return d||a}},addition:function(){var a,b,c,d,e;if(a=this.multiplication()){for(e=g(u,x-1);;){if(c=i(/^[-+]\s+/)||!e&&(j("+")||j("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new w.Operation(c,[d||a,b],e),e=g(u,x-1)}return d||a}},conditions:function(){var a,b,c,d=x;if(a=this.condition()){for(;;){if(!o(/^,\s*(not\s*)?\(/)||!j(","))break;if(b=this.condition(),!b)break;c=new w.Condition("or",c||a,b,d)}return c||a}},condition:function(){var a,b,c,d,e=this.entities,f=x,g=!1;return i(/^not/)&&(g=!0),m("("),a=this.addition()||e.keyword()||e.quoted(),a?(d=i(/^(?:>=|<=|=<|[<=>])/),d?(b=this.addition()||e.keyword()||e.quoted(),b?c=new w.Condition(d,a,b,f,g):n("expected expression")):c=new w.Condition("=",a,new w.Keyword("true"),f,g),m(")"),i(/^and/)?new w.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities,c=u.charAt(x+1);"-"!==u.charAt(x)||"@"!==c&&"("!==c||(a=j("-"));var d=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(d.parensInOp=!0,d=new w.Negative(d)),d},expression:function(){var a,b,c=[];do a=this.addition()||this.entity(),a&&(c.push(a),o(/^\/[\/*]/)||(b=j("/"),b&&c.push(new w.Anonymous(b))));while(a);return c.length>0?new w.Expression(c):void 0},property:function(){var a=i(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function b(a){var b=a.exec(e);return b?(g.push(x+h),h+=b[0].length,e=e.slice(b[1].length),f.push(b[1])):void 0}var c,d,e=D,f=[],g=[],h=0;for(b(/^(\*?)/);b(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/););if(f.length>1&&b(/^\s*(\+?)\s*:/)){for(k(h),""===f[0]&&(f.shift(),g.shift()),d=0;dl;l++)e=b.rgb[l]/255,f=c.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new d.Color(k,g)}function g(){var a,b=d.functions;for(a in l)l.hasOwnProperty(a)&&(b[a]=e.bind(null,Math[a],l[a]));for(a in m)m.hasOwnProperty(a)&&(b[a]=f.bind(null,m[a]));a=d.defaultFunc,b["default"]=a.eval.bind(a)}function h(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function i(a,b){return a instanceof d.Dimension&&a.unit.is("%")?parseFloat(a.value*b/100):j(a)}function j(a){if(a instanceof d.Dimension)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function k(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(a,b,c,e){var f=[a,b,c].map(function(a){return i(a,255)});return e=j(e),new d.Color(f,e)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,c,d){function e(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?g+(f-g)*a*6:1>2*a?f:2>3*a?g+(f-g)*(2/3-a)*6:g}a=j(a)%360/360,b=k(j(b)),c=k(j(c)),d=k(j(d));var f=.5>=c?c*(b+1):c+b-c*b,g=2*c-f;return this.rgba(255*e(a+1/3),255*e(a),255*e(a-1/3),d)},hsv:function(a,b,c){return this.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=j(a)%360/360*360,b=j(b),c=j(c),d=j(d);var e,f;e=Math.floor(a/60%6),f=a/60-e;var g=[c,c*(1-b),c*(1-f*b),c*(1-(1-f)*b)],h=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(255*g[h[e][0]],255*g[h[e][1]],255*g[h[e][2]],d)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},saturation:function(a){return new d.Dimension(Math.round(100*a.toHSL().s),"%")},lightness:function(a){return new d.Dimension(Math.round(100*a.toHSL().l),"%")},hsvhue:function(a){return new d.Dimension(Math.round(a.toHSV().h))},hsvsaturation:function(a){return new d.Dimension(Math.round(100*a.toHSV().s),"%")},hsvvalue:function(a){return new d.Dimension(Math.round(100*a.toHSV().v),"%")},red:function(a){return new d.Dimension(a.rgb[0])},green:function(a){return new d.Dimension(a.rgb[1])},blue:function(a){return new d.Dimension(a.rgb[2])},alpha:function(a){return new d.Dimension(a.toHSL().a)},luma:function(a){return new d.Dimension(Math.round(a.luma()*a.alpha*100),"%")},saturate:function(a,b){if(!a.rgb)return null;var c=a.toHSL();return c.s+=b.value/100,c.s=k(c.s),h(c)},desaturate:function(a,b){var c=a.toHSL();return c.s-=b.value/100,c.s=k(c.s),h(c)},lighten:function(a,b){var c=a.toHSL();return c.l+=b.value/100,c.l=k(c.l),h(c)},darken:function(a,b){var c=a.toHSL();return c.l-=b.value/100,c.l=k(c.l),h(c)},fadein:function(a,b){var c=a.toHSL();return c.a+=b.value/100,c.a=k(c.a),h(c)},fadeout:function(a,b){var c=a.toHSL();return c.a-=b.value/100,c.a=k(c.a),h(c)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=k(c.a),h(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=0>d?360+d:d,h(c)},mix:function(a,b,c){c||(c=new d.Dimension(50));var e=c.value/100,f=2*e-1,g=a.toHSL().a-b.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[a.rgb[0]*h+b.rgb[0]*i,a.rgb[1]*h+b.rgb[1]*i,a.rgb[2]*h+b.rgb[2]*i],k=a.alpha*e+b.alpha*(1-e);return new d.Color(j,k)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=this.rgba(255,255,255,1)),"undefined"==typeof b&&(b=this.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:j(d),a.luma()i.value)&&(k[f]=g)):(l[j]=k.length,k.push(g))):k.push(g);return 1==k.length?k[0]:(c=k.map(function(a){return a.toCSS(this.env)}).join(this.env.compress?",":", "),new d.Anonymous((a?"min":"max")+"("+c+")"))},min:function(){return this._minmax(!0,arguments)},max:function(){return this._minmax(!1,arguments)},argb:function(a){return new d.Anonymous(a.toARGB())},percentage:function(a){return new d.Dimension(100*a.value,"%")},color:function(a){if(a instanceof d.Quoted){var b,c=a.value;if(b=d.Color.fromKeyword(c))return b;if(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(c))return new d.Color(c.slice(1));throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}}throw{type:"Argument",message:"argument must be a string"}},iscolor:function(a){return this._isa(a,d.Color)},isnumber:function(a){return this._isa(a,d.Dimension)},isstring:function(a){return this._isa(a,d.Quoted)},iskeyword:function(a){return this._isa(a,d.Keyword)},isurl:function(a){return this._isa(a,d.URL)},ispixel:function(a){return this.isunit(a,"px")},ispercentage:function(a){return this.isunit(a,"%")},isem:function(a){return this.isunit(a,"em")},isunit:function(a,b){return a instanceof d.Dimension&&a.unit.is(b.value||b)?d.True:d.False},_isa:function(a,b){return a instanceof b?d.True:d.False},tint:function(a,b){return this.mix(this.rgb(255,255,255),a,b)},shade:function(a,b){return this.mix(this.rgb(0,0,0),a,b)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new d.Dimension(b)},"data-uri":function(b,e){if("undefined"!=typeof a)return new d.URL(e||b,this.currentFileInfo).eval(this.env);var f=b.value,g=e&&e.value,h=c("fs"),i=c("path"),j=!1;if(arguments.length<2&&(g=f),this.env.isPathRelative(g)&&(g=this.currentFileInfo.relativeUrls?i.join(this.currentFileInfo.currentDirectory,g):i.join(this.currentFileInfo.entryPath,g)),arguments.length<2){var k;try{k=c("mime")}catch(l){k=d._mime}f=k.lookup(g);var m=k.charsets.lookup(f);j=["US-ASCII","UTF-8"].indexOf(m)<0,j&&(f+=";base64")}else j=/;base64$/.test(f);var n=h.readFileSync(g),o=32,p=parseInt(n.length/1024,10);if(p>=o&&this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",g,p,o),new d.URL(e||b,this.currentFileInfo).eval(this.env);n=j?n.toString("base64"):encodeURIComponent(n);var q='"data:'+f+","+n+'"';return new d.URL(new d.Anonymous(q))},"svg-gradient":function(a){function e(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}arguments.length<3&&e();var f,g,h,i,j,k,l,m=Array.prototype.slice.call(arguments,1),n="linear",o='x="0" y="0" width="1" height="1"',p=!0,q={compress:!1},r=a.toCSS(q);switch(r){case"to bottom":f='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":f='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":f='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":f='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":n="radial",f='cx="50%" cy="50%" r="75%"',o='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(g='<'+n+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+f+">",h=0;hl?' stop-opacity="'+l+'"':"")+"/>";if(g+="',p)try{g=c("./encoder").encodeBase64(g)}catch(s){p=!1}return g="'data:image/svg+xml"+(p?";base64":"")+","+g+"'",new d.URL(new d.Anonymous(g))}},d._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(a){var e=c("path").extname(a),f=d._mime._types[e];if(f===b)throw new Error('Optional dependency "mime" is required for '+e);return f},charsets:{lookup:function(a){return a&&/^text\//.test(a)?"UTF-8":""}}};var l={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"},m={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?m.multiply(a,b):m.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return m.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};d.defaultFunc={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?d.True:d.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}},g(),d.fround=function(a,b){var c;return a&&null!=a.numPrecision?(c=Math.pow(10,a.numPrecision),Math.round(b*c)/c):b},d.functionCall=function(a,b){this.env=a,this.currentFileInfo=b},d.functionCall.prototype=d.functions}(c("./tree")),function(a){a.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(c("./tree")),function(a){a.debugInfo=function(b,c,d){var e="";if(b.dumpLineNumbers&&!b.compress)switch(b.dumpLineNumbers){case"comments":e=a.debugInfo.asComment(c);break;case"mediaquery":e=a.debugInfo.asMediaQuery(c);break;case"all":e=a.debugInfo.asComment(c)+(d||"")+a.debugInfo.asMediaQuery(c)}return e},a.debugInfo.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},a.debugInfo.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},a.find=function(a,b){for(var c,d=0;d1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)},a.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},a.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),a.tabLevel--,void 0}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--}}(c("./tree")),function(a){a.Alpha=function(a){this.value=a},a.Alpha.prototype={type:"Alpha",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Alpha(this.value.eval(b)):this},genCSS:function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},toCSS:a.toCSS}}(c("../tree")),function(a){a.Anonymous=function(a,b,c,d){this.value=a.value||a,this.index=b,this.mapLines=d,this.currentFileInfo=c},a.Anonymous.prototype={type:"Anonymous",eval:function(){return new a.Anonymous(this.value,this.index,this.currentFileInfo,this.mapLines)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1},genCSS:function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Assignment=function(a,b){this.key=a,this.value=b},a.Assignment.prototype={type:"Assignment",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Assignment(this.key,this.value.eval(b)):this},genCSS:function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Call=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d},a.Call.prototype={type:"Call",accept:function(a){this.args&&(this.args=a.visitArray(this.args))},eval:function(b){var c,d,e=this.args.map(function(a){return a.eval(b)}),f=this.name.toLowerCase();if(f in a.functions)try{if(d=new a.functionCall(b,this.currentFileInfo),c=d[f].apply(d,e),null!=c)return c}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new a.Call(this.name,e,this.index,this.currentFileInfo)},genCSS:function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;ca?"0":"")+a.toString(16)}).join("")}function c(a,b){return Math.min(Math.max(a,0),b)}a.Color=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};var d="transparent";a.Color.prototype={type:"Color",eval:function(){return this},luma:function(){return.2126*this.rgb[0]/255+.7152*this.rgb[1]/255+.0722*this.rgb[2]/255},genCSS:function(a,b){b.add(this.toCSS(a))},toCSS:function(b,e){var f=b&&b.compress&&!e,g=a.fround(b,this.alpha);if(1>g)return 0===g&&this.isTransparentKeyword?d:"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(g,1)).join(","+(f?"":" "))+")";var h=this.toRGB();if(f){var i=h.split("");i[1]===i[2]&&i[3]===i[4]&&i[5]===i[6]&&(h="#"+i[1]+i[3]+i[5])}return h},operate:function(b,c,d){for(var e=[],f=this.alpha*(1-d.alpha)+d.alpha,g=0;3>g;g++)e[g]=a.operate(b,c,this.rgb[g],d.rgb[g]);return new a.Color(e,f)},toRGB:function(){return b(this.rgb)},toHSL:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},toHSV:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},toARGB:function(){return b([255*this.alpha].concat(this.rgb))},compare:function(a){return a.rgb?a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:-1:-1}},a.Color.fromKeyword=function(b){if(b=b.toLowerCase(),a.colors.hasOwnProperty(b))return new a.Color(a.colors[b].slice(1));if(b===d){var c=new a.Color([0,0,0],0);return c.isTransparentKeyword=!0,c}}}(c("../tree")),function(a){a.Comment=function(a,b,c,d){this.value=a,this.silent=!!b,this.currentFileInfo=d},a.Comment.prototype={type:"Comment",genCSS:function(b,c){this.debugInfo&&c.add(a.debugInfo(b,this),this.currentFileInfo,this.index),c.add(this.value.trim())},toCSS:a.toCSS,isSilent:function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&!this.value.match(/^\/\*!/);return this.silent||b||c},eval:function(){return this},markReferenced:function(){this.isReferenced=!0}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype={type:"Condition",accept:function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},eval:function(a){var b,c=this.lvalue.eval(a),d=this.rvalue.eval(a),e=this.index;return b=function(a){switch(a){case"and":return c&&d;case"or":return c||d;default:if(c.compare)b=c.compare(d);else{if(!d.compare)throw{type:"Type",message:"Unable to perform comparison",index:e};b=d.compare(c)}switch(b){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a}}}(this.op),this.negate?!b:b}}}(c("../tree")),function(a){a.Dimension=function(c,d){this.value=parseFloat(c),this.unit=d&&d instanceof a.Unit?d:new a.Unit(d?[d]:b)},a.Dimension.prototype={type:"Dimension",accept:function(a){this.unit=a.visit(this.unit)},eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},genCSS:function(b,c){if(b&&b.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var d=a.fround(b,this.value),e=String(d);if(0!==d&&1e-6>d&&d>-1e-6&&(e=d.toFixed(20).replace(/0+$/,"")),b&&b.compress){if(0===d&&this.unit.isLength())return c.add(e),void 0;d>0&&1>d&&(e=e.substr(1))}c.add(e),this.unit.genCSS(b,c)},toCSS:a.toCSS,operate:function(b,c,d){var e=a.operate(b,c,this.value,d.value),f=this.unit.clone();if("+"===c||"-"===c)if(0===f.numerator.length&&0===f.denominator.length)f.numerator=d.unit.numerator.slice(0),f.denominator=d.unit.denominator.slice(0);else if(0===d.unit.numerator.length&&0===f.denominator.length);else{if(d=d.convertTo(this.unit.usedUnits()),b.strictUnits&&d.unit.toString()!==f.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+f.toString()+"' and '"+d.unit.toString()+"'.");e=a.operate(b,c,this.value,d.value)}else"*"===c?(f.numerator=f.numerator.concat(d.unit.numerator).sort(),f.denominator=f.denominator.concat(d.unit.denominator).sort(),f.cancel()):"/"===c&&(f.numerator=f.numerator.concat(d.unit.denominator).sort(),f.denominator=f.denominator.concat(d.unit.numerator).sort(),f.cancel());return new a.Dimension(e,f)},compare:function(b){if(b instanceof a.Dimension){var c=this.unify(),d=b.unify(),e=c.value,f=d.value;return f>e?-1:e>f?1:d.unit.isEmpty()||0===c.unit.compare(d.unit)?0:-1}return-1},unify:function(){return this.convertTo({length:"m",duration:"s",angle:"rad"})},convertTo:function(b){var c,d,e,f,g,h=this.value,i=this.unit.clone(),j={};if("string"==typeof b){for(c in a.UnitConversions)a.UnitConversions[c].hasOwnProperty(b)&&(j={},j[c]=b);b=j}g=function(a,b){return e.hasOwnProperty(a)?(b?h/=e[a]/e[f]:h*=e[a]/e[f],f):a};for(d in b)b.hasOwnProperty(d)&&(f=b[d],e=a.UnitConversions[d],i.map(g));return i.cancel(),new a.Dimension(h,i)}},a.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}},a.Unit=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],this.backupUnit=c},a.Unit.prototype={type:"Unit",clone:function(){return new a.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},genCSS:function(a,b){this.numerator.length>=1?b.add(this.numerator[0]):this.denominator.length>=1?b.add(this.denominator[0]):a&&a.strictUnits||!this.backupUnit||b.add(this.backupUnit)},toCSS:a.toCSS,toString:function(){var a,b=this.numerator.join("*");for(a=0;a0)for(b=0;e>b;b++)this.numerator.push(a);else if(0>e)for(b=0;-e>b;b++)this.denominator.push(a)}0===this.numerator.length&&0===this.denominator.length&&c&&(this.backupUnit=c),this.numerator.sort(),this.denominator.sort()}}}(c("../tree")),function(a){a.Directive=function(b,c,d,e){this.name=b,Array.isArray(c)?(this.rules=[new a.Ruleset(null,c)],this.rules[0].allowImports=!0):this.value=c,this.index=d,this.currentFileInfo=e},a.Directive.prototype={type:"Directive",accept:function(a){this.rules&&(this.rules=a.visitArray(this.rules)),this.value&&(this.value=a.visit(this.value))},genCSS:function(b,c){c.add(this.name,this.currentFileInfo,this.index),this.rules?a.outputRuleset(b,c,this.rules):(c.add(" "),this.value.genCSS(b,c),c.add(";"))},toCSS:a.toCSS,eval:function(b){var c=this;return this.rules&&(b.frames.unshift(this),c=new a.Directive(this.name,null,this.index,this.currentFileInfo),c.rules=[this.rules[0].eval(b)],c.rules[0].root=!0,b.frames.shift()),c},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},markReferenced:function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules[0].rules,a=0;a":" > ","|":"|","^":" ^ ","^^":" ^^ "},_outputMapCompressed:{"":""," ":" ",":":" :","+":"+","~":"~",">":">","|":"|","^":"^","^^":"^^"},genCSS:function(a,b){b.add((a.compress?this._outputMapCompressed:this._outputMap)[this.value])},toCSS:a.toCSS}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={type:"Expression",accept:function(a){this.value&&(this.value=a.visitArray(this.value))},eval:function(b){var c,d=this.parens&&!this.parensInOp,e=!1;return d&&b.inParenthesis(),this.value.length>1?c=new a.Expression(this.value.map(function(a){return a.eval(b)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),c=this.value[0].eval(b)):c=this,d&&b.outOfParenthesis(),this.parens&&this.parensInOp&&!b.isMathOn()&&!e&&(c=new a.Paren(c)),c},genCSS:function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]}}}(c("../tree")),function(a){a.Import=function(a,c,d,e,f){if(this.options=d,this.index=e,this.path=a,this.features=c,this.currentFileInfo=f,this.options.less!==b||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/css([\?;].*)?$/.test(g)&&(this.css=!0)}},a.Import.prototype={type:"Import",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},genCSS:function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},toCSS:a.toCSS,getPath:function(){if(this.path instanceof a.Quoted){var c=this.path.value;return this.css!==b||/(\.[a-z]*$)|([\?;].*)$/.test(c)?c:c+".less"}return this.path instanceof a.URL?this.path.value.value:null},evalForImport:function(b){return new a.Import(this.path.eval(b),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(b){var c=this.path.eval(b),d=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(c instanceof a.URL)){if(d){var e=c.value;e&&b.isPathRelative(e)&&(c.value=d+e)}c.value=b.normalizePath(c.value)}return c},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.skip)return[];if(this.options.inline){var e=new a.Anonymous(this.root,0,{filename:this.importedFilename},!0);return this.features?new a.Media([e],this.features.value):[e]}if(this.css){var f=new a.Import(this.evalPath(b),d,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return c=new a.Ruleset(null,this.root.rules.slice(0)),c.evalImports(b),this.features?new a.Media(c.rules,this.features.value):c.rules}}}(c("../tree")),function(a){a.JavaScript=function(a,b,c){this.escaped=c,this.expression=a,this.index=b},a.JavaScript.prototype={type:"JavaScript",eval:function(b){var c,d=this,e={},f=this.expression.replace(/@\{([\w-]+)\}/g,function(c,e){return a.jsify(new a.Variable("@"+e,d.index).eval(b))});try{f=new Function("return ("+f+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+f+"`",index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(e[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=f.call(e)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",index:this.index}}return"number"==typeof c?new a.Dimension(c):"string"==typeof c?new a.Quoted('"'+c+'"',c,this.escaped,this.index):Array.isArray(c)?new a.Anonymous(c.join(", ")):new a.Anonymous(c)}}}(c("../tree")),function(a){a.Keyword=function(a){this.value=a},a.Keyword.prototype={type:"Keyword",eval:function(){return this},genCSS:function(a,b){b.add(this.value)},toCSS:a.toCSS,compare:function(b){return b instanceof a.Keyword?b.value===this.value?0:1:-1}},a.True=new a.Keyword("true"),a.False=new a.Keyword("false")}(c("../tree")),function(a){a.Media=function(b,c,d,e){this.index=d,this.currentFileInfo=e;var f=this.emptySelectors();this.features=new a.Value(c),this.rules=[new a.Ruleset(f,b)],this.rules[0].allowImports=!0},a.Media.prototype={type:"Media",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},genCSS:function(b,c){c.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(b,c),a.outputRuleset(b,c,this.rules)},toCSS:a.toCSS,eval:function(b){b.mediaBlocks||(b.mediaBlocks=[],b.mediaPath=[]);var c=new a.Media(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,c.debugInfo=this.debugInfo);var d=!1;b.strictMath||(d=!0,b.strictMath=!0);try{c.features=this.features.eval(b)}finally{d&&(b.strictMath=!1)}return b.mediaPath.push(c),b.mediaBlocks.push(c),b.frames.unshift(this.rules[0]),c.rules=[this.rules[0].eval(b)],b.frames.shift(),b.mediaPath.pop(),0===b.mediaPath.length?c.evalTop(b):c.evalNested(b)},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},emptySelectors:function(){var b=new a.Element("","&",this.index,this.currentFileInfo),c=[new a.Selector([b],null,null,this.index,this.currentFileInfo)];return c[0].mediaEmpty=!0,c},markReferenced:function(){var a,b=this.rules[0].rules;for(this.isReferenced=!0,a=0;a1){var d=this.emptySelectors();c=new a.Ruleset(d,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(j=!0,g=0;gh;h++)s.value(h),r[h]=d.matchCondition(e,b);(r[0]||r[1])&&(r[0]!=r[1]&&(l.group=r[1]?u:v),q.push(l))}else q.push(l);p=!0}}for(s.reset(),n=[0,0,0],g=0;g0)m=v;else if(m=u,n[u]+n[v]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(e)+"`",index:this.index,filename:this.currentFileInfo.filename};for(g=0;gthis.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0}}}(c("../tree")),function(a){a.Negative=function(a){this.value=a},a.Negative.prototype={type:"Negative",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("-"),this.value.genCSS(a,b)},toCSS:a.toCSS,eval:function(b){return b.isMathOn()?new a.Operation("*",[new a.Dimension(-1),this.value]).eval(b):new a.Negative(this.value.eval(b))}}}(c("../tree")),function(a){a.Operation=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c},a.Operation.prototype={type:"Operation",accept:function(a){this.operands=a.visit(this.operands)},eval:function(b){var c=this.operands[0].eval(b),d=this.operands[1].eval(b);if(b.isMathOn()){if(c instanceof a.Dimension&&d instanceof a.Color&&(c=c.toColor()),d instanceof a.Dimension&&c instanceof a.Color&&(d=d.toColor()),!c.operate)throw{type:"Operation",message:"Operation on an invalid type"};return c.operate(b,this.op,d)}return new a.Operation(this.op,[c,d],this.isSpaced)},genCSS:function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},toCSS:a.toCSS},a.operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}}}(c("../tree")),function(a){a.Paren=function(a){this.value=a},a.Paren.prototype={type:"Paren",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},toCSS:a.toCSS,eval:function(b){return new a.Paren(this.value.eval(b))}}}(c("../tree")),function(a){a.Quoted=function(a,b,c,d,e){this.escaped=c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e},a.Quoted.prototype={type:"Quoted",genCSS:function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},toCSS:a.toCSS,eval:function(b){var c=this,d=this.value.replace(/`([^`]+)`/g,function(d,e){return new a.JavaScript(e,c.index,!0).eval(b).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var f=new a.Variable("@"+e,c.index,c.currentFileInfo).eval(b,!0);return f instanceof a.Quoted?f.value:f.toCSS()});return new a.Quoted(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1}}}(c("../tree")),function(a){function b(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}a.Rule=function(b,c,d,e,f,g,h){this.name=b,this.value=c instanceof a.Value?c:new a.Value([c]),this.important=d?" "+d.trim():"",this.merge=e,this.index=f,this.currentFileInfo=g,this.inline=h||!1,this.variable=b.charAt&&"@"===b.charAt(0)},a.Rule.prototype={type:"Rule",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},toCSS:a.toCSS,eval:function(c){var d=!1,e=this.name;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof a.Keyword?e[0].value:b(c,e)),"font"!==e||c.strictMath||(d=!0,c.strictMath=!0);try{return new a.Rule(e,this.value.eval(c),this.important,this.merge,this.index,this.currentFileInfo,this.inline)}catch(f){throw f.index=f.index||this.index,f}finally{d&&(c.strictMath=!1)}},makeImportant:function(){return new a.Rule(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)}}}(c("../tree")),function(a){a.Ruleset=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c},a.Ruleset.prototype={type:"Ruleset",accept:function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},eval:function(b){var c,d,e,f=this.selectors,g=a.defaultFunc;if(f&&(d=f.length)){for(c=[],g.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),e=0;d>e;e++)c.push(f[e].eval(b));g.reset()}var h,i,j=this.rules?this.rules.slice(0):null,k=new a.Ruleset(c,j,this.strictImports);k.originalRuleset=this,k.root=this.root,k.firstRoot=this.firstRoot,k.allowImports=this.allowImports,this.debugInfo&&(k.debugInfo=this.debugInfo);var l=b.frames;l.unshift(k);var m=b.selectors;m||(b.selectors=m=[]),m.unshift(this.selectors),(k.root||k.allowImports||!k.strictImports)&&k.evalImports(b);var n=k.rules,o=n?n.length:0;for(e=0;o>e;e++)n[e]instanceof a.mixin.Definition&&(n[e].frames=l.slice(0));var p=b.mediaBlocks&&b.mediaBlocks.length||0;for(e=0;o>e;e++)n[e]instanceof a.mixin.Call&&(j=n[e].eval(b).filter(function(b){return b instanceof a.Rule&&b.variable?!k.variable(b.name):!0}),n.splice.apply(n,[e,1].concat(j)),o+=j.length-1,e+=j.length-1,k.resetCache());for(e=0;eb;b++)c=g[b],(c instanceof d||c instanceof e)&&f.push(c);return f},prependRule:function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},find:function(b,c){c=c||this;var d,e=[],f=b.toCSS();return f in this._lookups?this._lookups[f]:(this.rulesets().forEach(function(f){if(f!==c)for(var g=0;gd?Array.prototype.push.apply(e,f.find(new a.Selector(b.elements.slice(d)),c)):e.push(f);break}}),this._lookups[f]=e,e)},genCSS:function(b,c){var d,e,f,g,h,i,j=[],k=[];b.tabLevel=b.tabLevel||0,this.root||b.tabLevel++;var l,m=b.compress?"":Array(b.tabLevel+1).join(" "),n=b.compress?"":Array(b.tabLevel).join(" ");for(d=0;dd;d++)if(i=p[d],o=i.length)for(d>0&&c.add(l),b.firstSelector=!0,i[0].genCSS(b,c),b.firstSelector=!1,e=1;o>e;e++)i[e].genCSS(b,c);c.add((b.compress?"{":" {\n")+m)}for(d=0;dd;d++)l&&c.add(l),k[d].genCSS(b,c);c.isEmpty()||b.compress||!this.firstRoot||c.add("\n")},toCSS:a.toCSS,markReferenced:function(){for(var a=0;a0&&this.mergeElementsOnToSelectors(r,i),f=0;f0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new a.Element(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;g0?(m=k.slice(0),q=m.pop(),o=d.createDerived(q.elements.slice(0)),p=!1):o=d.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0&&(p=!1,o.elements.push(new a.Element(j.combinator,l[0].elements[0].value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))),p||m.push(o),m=m.concat(n),s.push(m);i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;e0&&b.push(i[e])}else if(c.length>0)for(e=0;e0?e[e.length-1]=e[e.length-1].createDerived(e[e.length-1].elements.concat(b)):e.push(new a.Selector(b))}}}(c("../tree")),function(a){a.Selector=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)},a.Selector.prototype={type:"Selector",accept:function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},createDerived:function(b,c,d){d=null!=d?d:this.evaldCondition;var e=new a.Selector(b,c||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=d,e.mediaEmpty=this.mediaEmpty,e},match:function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},CacheElements:function(){var a,b,c,d="";if(!this._elements){for(a=this.elements.length,c=0;a>c;c++)if(b=this.elements[c],d+=b.combinator.value,b.value.value){if("string"!=typeof b.value.value){d="";break}d+=b.value.value}else d+=b.value;this._elements=d.match(/[,&#\.\w-]([\w-]|(\\.))*/g),this._elements?"&"===this._elements[0]&&this._elements.shift():this._elements=[]}},isJustParentSelector:function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},eval:function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},genCSS:function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;cc;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);f.splice?f.length&&this.flatten(f,e):e.push(f)}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],h.splice?h.length&&this.flatten(h,b):b.push(h);else b.push(e);return b}}}(c("./tree")),function(a){a.importVisitor=function(b,c,d){this._visitor=new a.visitor(this),this._importer=b,this._finish=c,this.env=d||new a.evalEnv,this.importCount=0},a.importVisitor.prototype={isReplacing:!0,run:function(a){var b;try{this._visitor.visit(a)}catch(c){b=c}this.isFinished=!0,0===this.importCount&&this._finish(b)},visitImport:function(b,c){var d,e=this,f=b.options.inline;if(!b.css||f){try{d=b.evalForImport(this.env)}catch(g){g.filename||(g.index=b.index,g.filename=b.currentFileInfo.filename),b.css=!0,b.error=g}if(d&&(!d.css||f)){b=d,this.importCount++;var h=new a.evalEnv(this.env,this.env.frames.slice(0));b.options.multiple&&(h.importMultiple=!0),this._importer.push(b.getPath(),b.currentFileInfo,b.options,function(c,d,g,i){c&&!c.filename&&(c.index=b.index,c.filename=b.currentFileInfo.filename),g&&!h.importMultiple&&(b.skip=g);var j=function(a){e.importCount--,0===e.importCount&&e.isFinished&&e._finish(a)};return!d||(b.root=d,b.importedFilename=i,f||b.skip)?(j(),void 0):(new a.importVisitor(e._importer,j,h).run(d),void 0)})}}return c.visitDeeper=!1,b},visitRule:function(a,b){return b.visitDeeper=!1,a},visitDirective:function(a){return this.env.frames.unshift(a),a},visitDirectiveOut:function(){this.env.frames.shift()},visitMixinDefinition:function(a){return this.env.frames.unshift(a),a},visitMixinDefinitionOut:function(){this.env.frames.shift()},visitRuleset:function(a){return this.env.frames.unshift(a),a},visitRulesetOut:function(){this.env.frames.shift()},visitMedia:function(a){return this.env.frames.unshift(a.ruleset),a},visitMediaOut:function(){this.env.frames.shift()}}}(c("./tree")),function(a){a.joinSelectorVisitor=function(){this.contexts=[[]],this._visitor=new a.visitor(this)},a.joinSelectorVisitor.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}}}(c("./tree")),function(a){a.toCSSVisitor=function(b){this._visitor=new a.visitor(this),this._env=b},a.toCSSVisitor.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?[]:a},visitMixinDefinition:function(){return[]},visitExtend:function(){return[]},visitComment:function(a){return a.isSilent(this._env)?[]:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:[]},visitDirective:function(b){if(b.currentFileInfo.reference&&!b.isReferenced)return[];if("@charset"===b.name){if(this.charset){if(b.debugInfo){var c=new a.Comment("/* "+b.toCSS(this._env).replace(/\n/g,"")+" */\n");return c.debugInfo=b.debugInfo,this._visitor.visit(c)}return[]}this.charset=!0}return b},checkPropertiesInRoot:function(b){for(var c,d=0;d0)&&e.splice(0,0,b);else{b.paths&&(b.paths=b.paths.filter(function(b){var c;for(" "===b[0].elements[0].combinator.value&&(b[0].elements[0].combinator=new a.Combinator("")),c=0;ch;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?b.accept(this._visitor):b.rules=null,c.visitDeeper=!1,f=b.rules,f&&(this._mergeRules(f),f=b.rules),f&&(this._removeDuplicateRules(f),f=b.rules),f&&f.length>0&&b.paths.length>0&&e.splice(0,0,b)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(b){if(b){var c,d,e,f={};for(e=b.length-1;e>=0;e--)if(d=b[e],d instanceof a.Rule)if(f[d.name]){c=f[d.name],c instanceof a.Rule&&(c=f[d.name]=[f[d.name].toCSS(this._env)]);var g=d.toCSS(this._env);-1!==c.indexOf(g)?b.splice(e,1):c.push(g)}else f[d.name]=d}},_mergeRules:function(b){if(b){for(var c,d,e,f={},g=0;g1&&(d=c[0],d.value=new a.Value(c.map(function(a){return a.value})))})}}}}(c("./tree")),function(a){a.extendFinderVisitor=function(){this._visitor=new a.visitor(this),this.contexts=[],this.allExtendsStack=[[]]},a.extendFinderVisitor.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(b){if(!b.root){var c,d,e,f,g=[],h=b.rules,i=h?h.length:0;for(c=0;i>c;c++)b.rules[c]instanceof a.Extend&&(g.push(h[c]),b.extendOnEveryPath=!0);var j=b.paths;for(c=0;c=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&j.selfSelectors.forEach(function(b){h=n.extendSelector(g,i,b),l=new a.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))}));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,c,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;d0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(c.slice(j,h.pathIndex)),l.push(new a.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=c[j].elements.length&&(k=0,j++);return j0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),j++),l=l.concat(c.slice(j,c.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(c("./tree")),function(a){a.sourceMapOutput=function(a){this._css=[],this._rootNode=a.rootNode,this._writeSourceMap=a.writeSourceMap,this._contentsMap=a.contentsMap,this._contentsIgnoredCharsMap=a.contentsIgnoredCharsMap,this._sourceMapFilename=a.sourceMapFilename,this._outputFilename=a.outputFilename,this._sourceMapURL=a.sourceMapURL,a.sourceMapBasepath&&(this._sourceMapBasepath=a.sourceMapBasepath.replace(/\\/g,"/")),this._sourceMapRootpath=a.sourceMapRootpath,this._outputSourceFiles=a.outputSourceFiles,this._sourceMapGeneratorConstructor=a.sourceMapGenerator||c("source-map").SourceMapGenerator,this._sourceMapRootpath&&"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/"),this._lineNumber=0,this._column=0},a.sourceMapOutput.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},a.sourceMapOutput.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;i0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this._sourceMapURL?d=this._sourceMapURL:this._sourceMapFilename&&(d=this.normalizeFilename(this._sourceMapFilename)),this._writeSourceMap?this._writeSourceMap(e):d="data:application/json,"+encodeURIComponent(e),d&&this._css.push("/*# sourceMappingURL="+d+" */") +}return this._css.join("")}}(c("./tree"));var x=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);v.env=v.env||("127.0.0.1"==location.hostname||"0.0.0.0"==location.hostname||"localhost"==location.hostname||location.port&&location.port.length>0||x?"development":"production");var y={info:2,errors:1,none:0};if(v.logLevel="undefined"!=typeof v.logLevel?v.logLevel:y.info,v.async=v.async||!1,v.fileAsync=v.fileAsync||!1,v.poll=v.poll||(x?1e3:1500),v.functions)for(var z in v.functions)v.functions.hasOwnProperty(z)&&(v.tree.functions[z]=v.functions[z]);var A=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);A&&(v.dumpLineNumbers=A[1]);var B=/^text\/(x-)?less$/,C=null,D={};if(v.watch=function(){return v.watchMode||(v.env="development",u()),this.watchMode=!0,!0},v.unwatch=function(){return clearInterval(v.watchTimer),this.watchMode=!1,!1},/!watch/.test(location.hash)&&v.watch(),"development"!=v.env)try{C="undefined"==typeof a.localStorage?null:a.localStorage}catch(E){}var F=document.getElementsByTagName("link");v.sheets=[];for(var G=0;G - + From b3a77f8d824d4af2ac7b74b11bcf3b991770e099 Mon Sep 17 00:00:00 2001 From: Bernhard Sirlinger Date: Fri, 7 Feb 2014 19:31:13 +0100 Subject: [PATCH 002/125] Fix parsing error --- src/styles/brackets_patterns_override.less | 2 +- src/thirdparty/CodeMirror2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index b283b283f7f..b1e71dec43b 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -1120,7 +1120,7 @@ input[type="color"], border-top: 1px solid transparent; } tbody th { - border-top: 1px solid transparent); + border-top: 1px solid transparent; } .right { text-align: right; diff --git a/src/thirdparty/CodeMirror2 b/src/thirdparty/CodeMirror2 index 5ccfedfb0a2..5581979d2c6 160000 --- a/src/thirdparty/CodeMirror2 +++ b/src/thirdparty/CodeMirror2 @@ -1 +1 @@ -Subproject commit 5ccfedfb0a22a95ec6e28f7475d1bac9c349ce82 +Subproject commit 5581979d2c624d6c32342e50bb417749ad799ee7 From 0fcb3d0ae68e0919666ccc2a7c9ccbfd9cb4ba5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Malbr=C3=A1n?= Date: Sat, 8 Mar 2014 18:15:25 -0300 Subject: [PATCH 003/125] Simplifies the Blick Comment code and fixes the issues with line comments as prefix of bock comments and equal block comments delimiters --- src/editor/EditorCommandHandlers.js | 352 +++++++++++++----------- src/language/languages.json | 8 +- test/spec/EditorCommandHandlers-test.js | 188 ++++++++++++- test/spec/LanguageManager-test.js | 4 +- 4 files changed, 383 insertions(+), 169 deletions(-) diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index 1be80143d7b..afab03e73bd 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -46,16 +46,50 @@ define(function (require, exports, module) { var DIRECTION_DOWN = +1; + /** + * @private + * Creates special regular expressions that matches the line prefix but not the block prefix or suffix + * @param {!string} lineSyntax a line comment prefix + * @param {!string} blockSyntax a block comment prefix or suffix + * @return {RegExp} + */ + function _createSpecialLineExp(lineSyntax, blockSyntax) { + var i, character, + subExps = [], + prevChars = ""; + + for (i = lineSyntax.length; i < blockSyntax.length; i++) { + character = blockSyntax.charAt(i); + subExps.push(prevChars + "[^" + character + "]"); + if (prevChars) { + subExps.push(prevChars + "$"); + } + prevChars += character; + } + return new RegExp("^\\s*" + lineSyntax + "($|" + subExps.join("|") + ")"); + } + /** * @private * Creates regular expressions for multiple line comment prefixes - * @param {!Array.} prefixes - the line comment prefixes + * @param {!Array.} prefixes the line comment prefixes + * @param {string=} blockPrefix the block comment prefix + * @param {string=} blockSuffix the block comment suffix * @return {Array.} */ - function _createLineExpressions(prefixes) { - var lineExp = []; + function _createLineExpressions(prefixes, blockPrefix, blockSuffix) { + var lineExp = [], escapedPrefix, regExp; + prefixes.forEach(function (prefix) { - lineExp.push(new RegExp("^\\s*" + StringUtils.regexEscape(prefix))); + escapedPrefix = StringUtils.regexEscape(prefix); + if (blockPrefix && blockPrefix.indexOf(prefix) === 0) { + regExp = _createSpecialLineExp(prefix, blockPrefix); + } else if (blockSuffix && blockSuffix.indexOf(prefix) === 0) { + regExp = _createSpecialLineExp(prefix, blockSuffix); + } else { + regExp = new RegExp("^\\s*" + escapedPrefix); + } + lineExp.push(regExp); }); return lineExp; } @@ -76,11 +110,11 @@ define(function (require, exports, module) { /** * @private * Returns the line comment prefix that best matches the string. Since there might be line comment prefixes - * that are prefixes of other line comment prefixes, it searches throught all and returns the longest line + * that are prefixes of other line comment prefixes, it searches through all and returns the longest line * comment prefix that matches the string. - * @param {!string} string - where to look - * @param {!Array.} expressions - the line comment regular expressions - * @param {!Array.} prefixes - the line comment prefixes + * @param {!string} string where to look + * @param {!Array.} expressions the line comment regular expressions + * @param {!Array.} prefixes the line comment prefixes * @return {string} */ function _getLinePrefix(string, expressions, prefixes) { @@ -97,25 +131,24 @@ define(function (require, exports, module) { * @private * Searchs for an uncommented line between startLine and endLine * @param {!Editor} editor - * @param {!number} startLine - valid line inside the document - * @param {!number} endLine - valid line inside the document - * @param {!Array.} lineExp - an array of line comment prefixes regular expressions + * @param {!number} startLine valid line inside the document + * @param {!number} endLine valid line inside the document + * @param {!Array.} lineExp an array of line comment prefixes regular expressions * @return {boolean} true if there is at least one uncommented line */ - function _containsUncommented(editor, startLine, endLine, lineExp) { - var containsUncommented = false; - var i; - var line; + function _containsNotLineComment(editor, startLine, endLine, lineExp) { + var i, line, + containsNotLineComment = false; for (i = startLine; i <= endLine; i++) { line = editor.document.getLine(i); // A line is commented out if it starts with 0-N whitespace chars, then a line comment prefix if (line.match(/\S/) && !_matchExpressions(line, lineExp)) { - containsUncommented = true; + containsNotLineComment = true; break; } } - return containsUncommented; + return containsNotLineComment; } /** @@ -128,13 +161,15 @@ define(function (require, exports, module) { * * @param {!Editor} editor * @param {!Array.} prefixes, e.g. ["//"] + * @param {string=} blockPrefix, e.g. "" */ - function lineCommentPrefix(editor, prefixes) { + function lineCommentPrefix(editor, prefixes, blockPrefix, blockSuffix) { var doc = editor.document, sel = editor.getSelection(), startLine = sel.start.line, endLine = sel.end.line, - lineExp = _createLineExpressions(prefixes); + lineExp = _createLineExpressions(prefixes, blockPrefix, blockSuffix); // Is a range of text selected? (vs just an insertion pt) var hasSelection = (startLine !== endLine) || (sel.start.ch !== sel.end.ch); @@ -147,17 +182,13 @@ define(function (require, exports, module) { // Decide if we're commenting vs. un-commenting // Are there any non-blank lines that aren't commented out? (We ignore blank lines because // some editors like Sublime don't comment them out) - var containsUncommented = _containsUncommented(editor, startLine, endLine, lineExp); - var i; - var line; - var prefix; - var commentI; - var updateSelection = false; + var i, line, prefix, commentI, + containsNotLineComment = _containsNotLineComment(editor, startLine, endLine, lineExp), + updateSelection = false; // Make the edit doc.batchOperation(function () { - - if (containsUncommented) { + if (containsNotLineComment) { // Comment out - prepend the first prefix to each line for (i = startLine; i <= endLine; i++) { doc.replaceRange(prefixes[0], {line: i, ch: 0}); @@ -193,59 +224,46 @@ define(function (require, exports, module) { /** * @private - * Moves the token context to the token that starts the block-comment. Ctx starts in a block-comment. - * Returns the position of the prefix or null if gets to the start of the document and didn't found it. - * @param {!{editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}}} ctx - token context - * @param {!RegExp} prefixExp - a valid regular expression - * @return {?{line: number, ch: number}} + * Given a token context it will search backwards to determine if the given token is part of a block comment + * that doesn't start at the initial token. This is used to know if a line comment is part of a block comment + * or if a block delimiter is the prefix or suffix, by passing a token context at that position. Since the + * token context will be moved backwards a lot, it is better to pass a new context. + * + * @param {!{editor:{CodeMirror}, pos:{ch:{number}, line:{number}}, token:{object}}} ctx token context + * @param {!string} prefix the block comment prefix + * @param {!string} suffix the block comment suffix + * @param {!RegExp} prefixExp a block comment prefix regular expression + * @param {!RegExp} suffixExp a block comment suffix regular expression + * @param {!Array.} lineExp an array of line comment prefixes regular expressions + * @return {boolean} */ - function _findCommentStart(ctx, prefixExp) { - var result = true; + function _isPrevTokenABlockComment(ctx, prefix, suffix, prefixExp, suffixExp, lineExp) { + // Start searching from the previous token + var result = TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctx); - while (result && !ctx.token.string.match(prefixExp)) { + // Look backwards until we find a none line comment token + while (result && _matchExpressions(ctx.token.string, lineExp)) { result = TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctx); } - return result ? {line: ctx.pos.line, ch: ctx.token.start} : null; - } - - /** - * @private - * Moves the token context to the token that ends the block-comment. Ctx starts in a block-comment. - * Returns the position of the sufix or null if gets to the end of the document and didn't found it. - * @param {!{editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}}} ctx - token context - * @param {!RegExp} suffixExp - a valid regular expression - * @param {!number} suffixLen - length of the suffix - * @return {?{line: number, ch: number}} - */ - function _findCommentEnd(ctx, suffixExp, suffixLen) { - var result = true; - while (result && !ctx.token.string.match(suffixExp)) { - result = TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx); - } - return result ? {line: ctx.pos.line, ch: ctx.token.end - suffixLen} : null; - } - - /** - * @private - * Moves the token context to the next block-comment if there is one before end. - * @param {!{editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}}} ctx - token context - * @param {!{line: number, ch: number}} end - where to stop searching - * @param {!RegExp} prefixExp - a valid regular expression - * @return {boolean} - true if it found a block-comment - */ - function _findNextBlockComment(ctx, end, prefixExp) { - var index = ctx.editor.indexFromPos(end), - inside = ctx.editor.indexFromPos(ctx.pos) <= index, - result = true; - - while (result && inside && !ctx.token.string.match(prefixExp)) { - result = TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx); - inside = ctx.editor.indexFromPos(ctx.pos) <= index; + // If we are now in a block comment token + if (result && ctx.token.className === "comment") { + // If it doesnt matches either prefix or suffix, we know is a block comment + if (!ctx.token.string.match(prefixExp) && !ctx.token.string.match(suffixExp)) { + return true; + // We found a line with just a block comment delimiter, but we can't tell which one it is, so we will + // keep searching recursively and return the opposite value + } else if (prefix === suffix && ctx.token.string.length === prefix.length) { + return !_isPrevTokenABlockComment(ctx, prefix, suffix, prefixExp, suffixExp, lineExp); + // We can just now the result by checking if the string matches the prefix + } else { + return ctx.token.string.match(prefixExp); + } } - return result && inside && !!ctx.token.string.match(prefixExp); + return false; } + /** * Add or remove block-comment tokens to the selection, preserving selection * and cursor position. Applies to the currently focused Editor. @@ -255,9 +273,8 @@ define(function (require, exports, module) { * Commenting out adds the prefix before the selection and the suffix after. * Uncommenting removes them. * - * If slashComment is true and the start or end of the selection is inside a line-comment it - * will try to do a line uncomment if is not actually inside a bigger block comment and all - * the lines in the selection are line-commented. + * If a list of line comment prefixes is provided and all the lines inside the selection are line commented, + * it will try to do a line uncomment if is not actually inside a bigger block comment. * * @param {!Editor} editor * @param {!string} prefix, e.g. " - + + diff --git a/src/thirdparty/less-1.4.2.min.js b/src/thirdparty/less-1.4.2.min.js deleted file mode 100644 index e4a34ff2575..00000000000 --- a/src/thirdparty/less-1.4.2.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * LESS - Leaner CSS v1.4.2 - * http://lesscss.org - * - * Copyright (c) 2009-2013, Alexis Sellier - * Licensed under the Apache 2.0 License. - * - * @licence - */(function(e,t){function n(t){return e.less[t.split("/")[1]]}function f(){r.env==="development"?(r.optimization=0,r.watchTimer=setInterval(function(){r.watchMode&&g(function(e,t,n,i,s){e?k(e,i.href):t&&S(t.toCSS(r),i,s.lastModified)})},r.poll)):r.optimization=3}function m(){var e=document.getElementsByTagName("style");for(var t=0;t0&&(s.splice(o-1,2),o-=2)}return i.hostPart=r[1],i.directories=s,i.path=r[1]+s.join("/"),i.fileUrl=i.path+(r[4]||""),i.url=i.fileUrl+(r[5]||""),i}function w(t,n,i,s){var o=b(t.href,e.location.href),u=o.url,a=l&&l.getItem(u),f=l&&l.getItem(u+":timestamp"),c={css:a,timestamp:f},h,p={relativeUrls:r.relativeUrls,currentDirectory:o.path,filename:u};t instanceof r.tree.parseEnv?(h=new r.tree.parseEnv(t),p.entryPath=h.currentFileInfo.entryPath,p.rootpath=h.currentFileInfo.rootpath,p.rootFilename=h.currentFileInfo.rootFilename):(h=new r.tree.parseEnv(r),h.mime=t.type,p.entryPath=o.path,p.rootpath=r.rootpath||o.path,p.rootFilename=u),h.relativeUrls&&(r.rootpath?p.rootpath=b(r.rootpath+y(o.path,p.entryPath)).path:p.rootpath=o.path),x(u,t.type,function(e,a){v+=e.replace(/@import .+?;/ig,"");if(!i&&c&&a&&(new Date(a)).valueOf()===(new Date(c.timestamp)).valueOf())S(c.css,t),n(null,null,e,t,{local:!0,remaining:s},u);else try{h.contents[u]=e,h.paths=[o.path],h.currentFileInfo=p,(new r.Parser(h)).parse(e,function(r,i){if(r)return n(r,null,null,t);try{n(r,i,e,t,{local:!1,lastModified:a,remaining:s},u),h.currentFileInfo.rootFilename===u&&N(document.getElementById("less-error-message:"+E(u)))}catch(r){n(r,null,null,t)}})}catch(f){n(f,null,null,t)}},function(e,r){n({type:"File",message:"'"+r+"' wasn't found ("+e+")"},null,null,t)})}function E(e){return e.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function S(e,t,n){var r=t.href||"",i="less:"+(t.title||E(r)),s=document.getElementById(i),o=!1,u=document.createElement("style");u.setAttribute("type","text/css"),t.media&&u.setAttribute("media",t.media),u.id=i;if(u.styleSheet)try{u.styleSheet.cssText=e}catch(a){throw new Error("Couldn't reassign styleSheet.cssText.")}else u.appendChild(document.createTextNode(e)),o=s!==null&&s.childNodes.length>0&&u.childNodes.length>0&&s.firstChild.nodeValue===u.firstChild.nodeValue;var f=document.getElementsByTagName("head")[0];if(s==null||o===!1){var c=t&&t.nextSibling||null;(c||document.getElementsByTagName("head")[0]).parentNode.insertBefore(u,c)}s&&o===!1&&f.removeChild(s);if(n&&l){C("saving "+r+" to cache.");try{l.setItem(r,e),l.setItem(r+":timestamp",n)}catch(a){C("failed to save")}}}function x(e,t,n,i){function a(t,n,r){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):typeof r=="function"&&r(t.status,e)}var s=T(),u=o?r.fileAsync:r.async;typeof s.overrideMimeType=="function"&&s.overrideMimeType("text/css"),s.open("GET",e,u),s.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),s.send(null),o&&!r.fileAsync?s.status===0||s.status>=200&&s.status<300?n(s.responseText):i(s.status,e):u?s.onreadystatechange=function(){s.readyState==4&&a(s,n,i)}:a(s,n,i)}function T(){if(e.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return C("browser doesn't support AJAX."),null}}function N(e){return e&&e.parentNode.removeChild(e)}function C(e){r.env=="development"&&typeof console!="undefined"&&console.log("less: "+e)}function k(e,n){var i="less-error-message:"+E(n||""),s='
  • {content}
  • ',o=document.createElement("div"),u,a,f=[],l=e.filename||n,c=l.match(/([^\/]+(\?.*)?)$/)[1];o.id=i,o.className="less-error-message",a="

    "+(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+"

    "+'

    in '+c+" ";var h=function(e,n,r){e.extract[n]!=t&&f.push(s.replace(/\{line\}/,(parseInt(e.line)||0)+(n-1)).replace(/\{class\}/,r).replace(/\{content\}/,e.extract[n]))};e.extract?(h(e,0,""),h(e,1,"line"),h(e,2,""),a+="on line "+e.line+", column "+(e.column+1)+":

    "+"
      "+f.join("")+"
    "):e.stack&&(a+="
    "+e.stack.split("\n").slice(1).join("
    ")),o.innerHTML=a,S([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),o.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),r.env=="development"&&(u=setInterval(function(){document.body&&(document.getElementById(i)?document.body.replaceChild(o,document.getElementById(i)):document.body.insertBefore(o,document.body.firstChild),clearInterval(u))},10))}var r,i,s;typeof environment=="object"&&{}.toString.call(environment)==="[object Environment]"?(typeof e=="undefined"?r={}:r=e.less={},i=r.tree={},r.mode="rhino"):typeof e=="undefined"?(r=exports,i=n("./tree"),r.mode="node"):(typeof e.less=="undefined"&&(e.less={}),r=e.less,i=e.less.tree={},r.mode="browser"),r.Parser=function(t){function m(){a=c[u],f=o,h=o}function g(){c[u]=a,o=f,h=o}function y(){o>h&&(c[u]=c[u].slice(o-h),h=o)}function b(e){var t=e.charCodeAt(0);return t===32||t===10||t===9}function w(e){var t,n,r,i,a;if(e instanceof Function)return e.call(p.parsers);if(typeof e=="string")t=s.charAt(o)===e?e:null,r=1,y();else{y();if(!(t=e.exec(c[u])))return null;r=t[0].length}if(t)return E(r),typeof t=="string"?t:t.length===1?t[0]:t}function E(e){var t=o,n=u,r=o+c[u].length,i=o+=e;while(o=0&&t.charAt(n)!=="\n";n--)r++;return{line:typeof e=="number"?(t.slice(0,e).match(/\n/g)||"").length:null,column:r}}function k(e,t,i){var s=i.currentFileInfo.filename;return r.mode!=="browser"&&r.mode!=="rhino"&&(s=n("path").resolve(s)),{lineNumber:C(e,t).line+1,fileName:s}}function L(e,t){var n=N(e,t),r=C(e.index,n),i=r.line,s=r.column,o=n.split("\n");this.type=e.type||"Syntax",this.message=e.message,this.filename=e.filename||t.currentFileInfo.filename,this.index=e.index,this.line=typeof i=="number"?i+1:null,this.callLine=e.call&&C(e.call,n).line+1,this.callExtract=o[C(e.call,n).line],this.stack=e.stack,this.column=s,this.extract=[o[i-1],o[i],o[i+1]]}var s,o,u,a,f,l,c,h,p,d=this;t instanceof i.parseEnv||(t=new i.parseEnv(t));var v=this.imports={paths:t.paths||[],queue:[],files:t.files,contents:t.contents,mime:t.mime,error:null,push:function(e,n,i){var s=this;this.queue.push(e),r.Parser.importer(e,n,function(t,n,r){s.queue.splice(s.queue.indexOf(e),1);var o=r in s.files;s.files[r]=n,t&&!s.error&&(s.error=t),i(t,n,o)},t)}};return L.prototype=new Error,L.prototype.constructor=L,this.env=t=t||{},this.optimization="optimization"in this.env?this.env.optimization:1,p={imports:v,parse:function(e,a){var f,d,v,m,g,y,b=[],E,S=null;o=u=h=l=0,s=e.replace(/\r\n/g,"\n"),s=s.replace(/^\uFEFF/,""),c=function(e){var n=0,r=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,i=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,o=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,u=0,a,f=e[0],l;for(var c=0,h,p;c0?"missing closing `}`":"missing opening `{`",filename:t.currentFileInfo.filename},t)),e.map(function(e){return e.join("")})}([[]]);if(S)return a(new L(S,t));try{f=new i.Ruleset([],w(this.parsers.primary)),f.root=!0,f.firstRoot=!0}catch(x){return a(new L(x,t))}f.toCSS=function(e){var s,o,u;return function(s,o){s=s||{};var u,a=new i.evalEnv(s);typeof o=="object"&&!Array.isArray(o)&&(o=Object.keys(o).map(function(e){var t=o[e];return t instanceof i.Value||(t instanceof i.Expression||(t=new i.Expression([t])),t=new i.Value([t])),new i.Rule("@"+e,t,!1,0)}),a.frames=[new i.Ruleset(null,o)]);try{var f=e.call(this,a);(new i.joinSelectorVisitor).run(f),(new i.processExtendsVisitor).run(f);var l=f.toCSS({compress:Boolean(s.compress),dumpLineNumbers:t.dumpLineNumbers,strictUnits:Boolean(s.strictUnits)})}catch(c){throw new L(c,t)}return s.yuicompress&&r.mode==="node"?n("ycssmin").cssmin(l,s.maxLineLen):s.compress?l.replace(/(\s)+/g,"$1"):l}}(f.eval);if(o=0&&s.charAt(T)!=="\n";T--)N++;S={type:"Parse",message:"Unrecognised input",index:o,filename:t.currentFileInfo.filename,line:g,column:N,extract:[y[g-2],y[g-1],y[g]]}}var C=function(e){e=S||e||p.imports.error,e?(e instanceof L||(e=new L(e,t)),a(e)):a(null,f)};t.processImports!==!1?(new i.importVisitor(this.imports,C)).run(f):C()},parsers:{primary:function(){var e,t=[];while((e=w(this.extendRule)||w(this.mixin.definition)||w(this.rule)||w(this.ruleset)||w(this.mixin.call)||w(this.comment)||w(this.directive))||w(/^[\s\n]+/)||w(/^;+/))e&&t.push(e);return t},comment:function(){var e;if(s.charAt(o)!=="/")return;if(s.charAt(o+1)==="/")return new i.Comment(w(/^\/\/.*/),!0);if(e=w(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new i.Comment(e)},entities:{quoted:function(){var e,n=o,r,u=o;s.charAt(n)==="~"&&(n++,r=!0);if(s.charAt(n)!=='"'&&s.charAt(n)!=="'")return;r&&w("~");if(e=w(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new i.Quoted(e[0],e[1]||e[2],r,u,t.currentFileInfo)},keyword:function(){var e;if(e=w(/^[_A-Za-z-][_A-Za-z0-9-]*/))return i.colors.hasOwnProperty(e)?new i.Color(i.colors[e].slice(1)):new i.Keyword(e)},call:function(){var e,n,r,s,a=o;if(!(e=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(c[u])))return;e=e[1],n=e.toLowerCase();if(n==="url")return null;o+=e.length;if(n==="alpha"){s=w(this.alpha);if(typeof s!="undefined")return s}w("("),r=w(this.entities.arguments);if(!w(")"))return;if(e)return new i.Call(e,r,a,t.currentFileInfo)},arguments:function(){var e=[],t;while(t=w(this.entities.assignment)||w(this.expression)){e.push(t);if(!w(","))break}return e},literal:function(){return w(this.entities.dimension)||w(this.entities.color)||w(this.entities.quoted)||w(this.entities.unicodeDescriptor)},assignment:function(){var e,t;if((e=w(/^\w+(?=\s?=)/i))&&w("=")&&(t=w(this.entity)))return new i.Assignment(e,t)},url:function(){var e;if(s.charAt(o)!=="u"||!w(/^url\(/))return;return e=w(this.entities.quoted)||w(this.entities.variable)||w(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",S(")"),new i.URL(e.value!=null||e instanceof i.Variable?e:new i.Anonymous(e),t.currentFileInfo)},variable:function(){var e,n=o;if(s.charAt(o)==="@"&&(e=w(/^@@?[\w-]+/)))return new i.Variable(e,n,t.currentFileInfo)},variableCurly:function(){var e,n,r=o;if(s.charAt(o)==="@"&&(n=w(/^@\{([\w-]+)\}/)))return new i.Variable("@"+n[1],r,t.currentFileInfo)},color:function(){var e;if(s.charAt(o)==="#"&&(e=w(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)))return new i.Color(e[1])},dimension:function(){var e,t=s.charCodeAt(o);if(t>57||t<43||t===47||t==44)return;if(e=w(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/))return new i.Dimension(e[1],e[2])},unicodeDescriptor:function(){var e;if(e=w(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new i.UnicodeDescriptor(e[0])},javascript:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=="`")return;n&&w("~");if(e=w(/^`([^`]*)`/))return new i.JavaScript(e[1],o,n)}},variable:function(){var e;if(s.charAt(o)==="@"&&(e=w(/^(@[\w-]+)\s*:/)))return e[1]},extend:function(e){var t,n,r=o,s,u=[];if(!w(e?/^&:extend\(/:/^:extend\(/))return;do{s=null,t=[];for(;;){s=w(/^(all)(?=\s*(\)|,))/);if(s)break;n=w(this.element);if(!n)break;t.push(n)}s=s&&s[1],u.push(new i.Extend(new i.Selector(t),s,r))}while(w(","));return S(/^\)/),e&&S(/^;/),u},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var e=[],n,r,u,a,f,l=o,c=s.charAt(o),h=!1;if(c!=="."&&c!=="#")return;m();while(n=w(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))e.push(new i.Element(r,n,o)),r=w(">");w("(")&&(u=this.mixin.args.call(this,!0).args,S(")")),u=u||[],w(this.important)&&(h=!0);if(e.length>0&&(w(";")||T("}")))return new i.mixin.Call(e,u,l,t.currentFileInfo,h);g()},args:function(e){var t=[],n=[],r,u=[],a,f,l,c,h,p={args:null,variadic:!1};for(;;){if(e)h=w(this.expression);else{w(this.comment);if(s.charAt(o)==="."&&w(/^\.{3}/)){p.variadic=!0,w(";")&&!r&&(r=!0),(r?n:u).push({variadic:!0});break}h=w(this.entities.variable)||w(this.entities.literal)||w(this.entities.keyword)}if(!h)break;l=null,h.throwAwayComments&&h.throwAwayComments(),c=h;var d=null;if(e){if(h.value.length==1)var d=h.value[0]}else d=h;if(d&&d instanceof i.Variable)if(w(":"))t.length>0&&(r&&x("Cannot mix ; and , as delimiter types"),a=!0),c=S(this.expression),l=f=d.name;else{if(!e&&w(/^\.{3}/)){p.variadic=!0,w(";")&&!r&&(r=!0),(r?n:u).push({name:h.name,variadic:!0});break}e||(f=l=d.name,c=null)}c&&t.push(c),u.push({name:l,value:c});if(w(","))continue;if(w(";")||r)a&&x("Cannot mix ; and , as delimiter types"),r=!0,t.length>1&&(c=new i.Value(t)),n.push({name:f,value:c}),f=null,t=[],a=!1}return p.args=r?n:u,p},definition:function(){var e,t=[],n,r,u,a,f,c=!1;if(s.charAt(o)!=="."&&s.charAt(o)!=="#"||T(/^[^{]*\}/))return;m();if(n=w(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=n[1];var h=this.mixin.args.call(this,!1);t=h.args,c=h.variadic,w(")")||(l=o,g()),w(this.comment),w(/^when/)&&(f=S(this.conditions,"expected condition")),r=w(this.block);if(r)return new i.mixin.Definition(e,t,r,f,c);g()}}},entity:function(){return w(this.entities.literal)||w(this.entities.variable)||w(this.entities.url)||w(this.entities.call)||w(this.entities.keyword)||w(this.entities.javascript)||w(this.comment)},end:function(){return w(";")||T("}")},alpha:function(){var e;if(!w(/^\(opacity=/i))return;if(e=w(/^\d+/)||w(this.entities.variable))return S(")"),new i.Alpha(e)},element:function(){var e,t,n,r;n=w(this.combinator),e=w(/^(?:\d+\.\d+|\d+)%/)||w(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||w("*")||w("&")||w(this.attribute)||w(/^\([^()@]+\)/)||w(/^[\.#](?=@)/)||w(this.entities.variableCurly),e||w("(")&&(r=w(this.selector))&&w(")")&&(e=new i.Paren(r));if(e)return new i.Element(n,e,o)},combinator:function(){var e=s.charAt(o);if(e===">"||e==="+"||e==="~"||e==="|"){o++;while(s.charAt(o).match(/\s/))o++;return new i.Combinator(e)}return s.charAt(o-1).match(/\s/)?new i.Combinator(" "):new i.Combinator(null)},selector:function(){var e,t,n=[],r,u,a=[];while((u=w(this.extend))||(t=w(this.element))){u?a.push.apply(a,u):(a.length&&x("Extend can only be used at the end of selector"),r=s.charAt(o),n.push(t),t=null);if(r==="{"||r==="}"||r===";"||r===","||r===")")break}if(n.length>0)return new i.Selector(n,a);a.length&&x("Extend must be used to extend a selector, it cannot be used on its own")},attribute:function(){var e="",t,n,r;if(!w("["))return;(t=w(this.entities.variableCurly))||(t=S(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/));if(r=w(/^[|~*$^]?=/))n=w(this.entities.quoted)||w(/^[\w-]+/)||w(this.entities.variableCurly);return S("]"),new i.Attribute(t,r,n)},block:function(){var e;if(w("{")&&(e=w(this.primary))&&w("}"))return e},ruleset:function(){var e=[],n,r,u;m(),t.dumpLineNumbers&&(u=k(o,s,t));while(n=w(this.selector)){e.push(n),w(this.comment);if(!w(","))break;w(this.comment)}if(e.length>0&&(r=w(this.block))){var a=new i.Ruleset(e,r,t.strictImports);return t.dumpLineNumbers&&(a.debugInfo=u),a}l=o,g()},rule:function(e){var n,r,u=s.charAt(o),a;m();if(u==="."||u==="#"||u==="&")return;if(n=w(this.variable)||w(this.property)){r=!e&&(t.compress||n.charAt(0)==="@")?w(this.value)||w(this.anonymousValue):w(this.anonymousValue)||w(this.value),a=w(this.important);if(r&&w(this.end))return new i.Rule(n,r,a,f,t.currentFileInfo);l=o,g();if(r&&!e)return this.rule(!0)}},anonymousValue:function(){var e;if(e=/^([^@+\/'"*`(;{}-]*);/.exec(c[u]))return o+=e[0].length-1,new i.Anonymous(e[1])},"import":function(){var e,n,r=o;m();var s=w(/^@import?\s+/),u=(s?w(this.importOptions):null)||{};if(s&&(e=w(this.entities.quoted)||w(this.entities.url))){n=w(this.mediaFeatures);if(w(";"))return n=n&&new i.Value(n),new i.Import(e,n,u,r,t.currentFileInfo)}g()},importOptions:function(){var e,t={},n,r;if(!w("("))return null;do if(e=w(this.importOption)){n=e,r=!0;switch(n){case"css":n="less",r=!1;break;case"once":n="multiple",r=!1}t[n]=r;if(!w(","))break}while(e);return S(")"),t},importOption:function(){var e=w(/^(less|css|multiple|once)/);if(e)return e[1]},mediaFeature:function(){var e,n,r=[];do if(e=w(this.entities.keyword))r.push(e);else if(w("(")){n=w(this.property),e=w(this.value);if(!w(")"))return null;if(n&&e)r.push(new i.Paren(new i.Rule(n,e,null,o,t.currentFileInfo,!0)));else{if(!e)return null;r.push(new i.Paren(e))}}while(e);if(r.length>0)return new i.Expression(r)},mediaFeatures:function(){var e,t=[];do if(e=w(this.mediaFeature)){t.push(e);if(!w(","))break}else if(e=w(this.entities.variable)){t.push(e);if(!w(","))break}while(e);return t.length>0?t:null},media:function(){var e,n,r,u;t.dumpLineNumbers&&(u=k(o,s,t));if(w(/^@media/)){e=w(this.mediaFeatures);if(n=w(this.block))return r=new i.Media(n,e),t.dumpLineNumbers&&(r.debugInfo=u),r}},directive:function(){var e,n,r,u,a,f,l,c,h,p;if(s.charAt(o)!=="@")return;if(n=w(this["import"])||w(this.media))return n;m(),e=w(/^@[a-z-]+/);if(!e)return;l=e,e.charAt(1)=="-"&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1));switch(l){case"@font-face":c=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":c=!0;break;case"@page":case"@document":case"@supports":case"@keyframes":c=!0,h=!0;break;case"@namespace":p=!0}h&&(e+=" "+(w(/^[^{]+/)||"").trim());if(c){if(r=w(this.block))return new i.Directive(e,r)}else if((n=p?w(this.expression):w(this.entity))&&w(";")){var d=new i.Directive(e,n);return t.dumpLineNumbers&&(d.debugInfo=k(o,s,t)),d}g()},value:function(){var e,t=[],n;while(e=w(this.expression)){t.push(e);if(!w(","))break}if(t.length>0)return new i.Value(t)},important:function(){if(s.charAt(o)==="!")return w(/^! *important/)},sub:function(){var e,t;if(w("("))if(e=w(this.addition))return t=new i.Expression([e]),S(")"),t.parens=!0,t},multiplication:function(){var e,t,n,r,u,a=[];if(e=w(this.operand)){u=b(s.charAt(o-1));while(!T(/^\/[*\/]/)&&(n=w("/")||w("*"))){if(!(t=w(this.operand)))break;e.parensInOp=!0,t.parensInOp=!0,r=new i.Operation(n,[r||e,t],u),u=b(s.charAt(o-1))}return r||e}},addition:function(){var e,t,n,r,u;if(e=w(this.multiplication)){u=b(s.charAt(o-1));while((n=w(/^[-+]\s+/)||!u&&(w("+")||w("-")))&&(t=w(this.multiplication)))e.parensInOp=!0,t.parensInOp=!0,r=new i.Operation(n,[r||e,t],u),u=b(s.charAt(o-1));return r||e}},conditions:function(){var e,t,n=o,r;if(e=w(this.condition)){while(w(",")&&(t=w(this.condition)))r=new i.Condition("or",r||e,t,n);return r||e}},condition:function(){var e,t,n,r,s=o,u=!1;w(/^not/)&&(u=!0),S("(");if(e=w(this.addition)||w(this.entities.keyword)||w(this.entities.quoted))return(r=w(/^(?:>=|=<|[<=>])/))?(t=w(this.addition)||w(this.entities.keyword)||w(this.entities.quoted))?n=new i.Condition(r,e,t,s,u):x("expected expression"):n=new i.Condition("=",e,new i.Keyword("true"),s,u),S(")"),w(/^and/)?new i.Condition("and",n,w(this.condition)):n},operand:function(){var e,t=s.charAt(o+1);s.charAt(o)==="-"&&(t==="@"||t==="(")&&(e=w("-"));var n=w(this.sub)||w(this.entities.dimension)||w(this.entities.color)||w(this.entities.variable)||w(this.entities.call);return e&&(n.parensInOp=!0,n=new i.Negative(n)),n},expression:function(){var e,t,n=[],r;while(e=w(this.addition)||w(this.entity))n.push(e),!T(/^\/[\/*]/)&&(t=w("/"))&&n.push(new i.Anonymous(t));if(n.length>0)return new i.Expression(n)},property:function(){var e;if(e=w(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/))return e[1]}}}};if(r.mode==="browser"||r.mode==="rhino")r.Parser.importer=function(e,t,n,r){!/^([a-z-]+:)?\//.test(e)&&t.currentDirectory&&(e=t.currentDirectory+e);var i=r.toSheet(e);i.processImports=!1,i.currentFileInfo=t,w(i,function(e,t,r,i,s,o){n.call(null,e,t,o)},!0)};(function(r){function u(e){return r.functions.hsla(e.h,e.s,e.l,e.a)}function a(e,t){return e instanceof r.Dimension&&e.unit.is("%")?parseFloat(e.value*t/100):f(e)}function f(e){if(e instanceof r.Dimension)return parseFloat(e.unit.is("%")?e.value/100:e.value);if(typeof e=="number")return e;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function l(e){return Math.min(1,Math.max(0,e))}r.functions={rgb:function(e,t,n){return this.rgba(e,t,n,1)},rgba:function(e,t,n,i){var s=[e,t,n].map(function(e){return a(e,256)});return i=f(i),new r.Color(s,i)},hsl:function(e,t,n){return this.hsla(e,t,n,1)},hsla:function(e,t,n,r){function o(e){return e=e<0?e+1:e>1?e-1:e,e*6<1?s+(i-s)*e*6:e*2<1?i:e*3<2?s+(i-s)*(2/3-e)*6:s}e=f(e)%360/360,t=l(f(t)),n=l(f(n)),r=l(f(r));var i=n<=.5?n*(t+1):n+t-n*t,s=n*2-i;return this.rgba(o(e+1/3)*255,o(e)*255,o(e-1/3)*255,r)},hsv:function(e,t,n){return this.hsva(e,t,n,1)},hsva:function(e,t,n,r){e=f(e)%360/360*360,t=f(t),n=f(n),r=f(r);var i,s;i=Math.floor(e/60%6),s=e/60-i;var o=[n,n*(1-t),n*(1-s*t),n*(1-(1-s)*t)],u=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(o[u[i][0]]*255,o[u[i][1]]*255,o[u[i][2]]*255,r)},hue:function(e){return new r.Dimension(Math.round(e.toHSL().h))},saturation:function(e){return new r.Dimension(Math.round(e.toHSL().s*100),"%")},lightness:function(e){return new r.Dimension(Math.round(e.toHSL().l*100),"%")},hsvhue:function(e){return new r.Dimension(Math.round(e.toHSV().h))},hsvsaturation:function(e){return new r.Dimension(Math.round(e.toHSV().s*100),"%")},hsvvalue:function(e){return new r.Dimension(Math.round(e.toHSV().v*100),"%")},red:function(e){return new r.Dimension(e.rgb[0])},green:function(e){return new r.Dimension(e.rgb[1])},blue:function(e){return new r.Dimension(e.rgb[2])},alpha:function(e){return new r.Dimension(e.toHSL().a)},luma:function(e){return new r.Dimension(Math.round(e.luma()*e.alpha*100),"%")},saturate:function(e,t){var n=e.toHSL();return n.s+=t.value/100,n.s=l(n.s),u(n)},desaturate:function(e,t){var n=e.toHSL();return n.s-=t.value/100,n.s=l(n.s),u(n)},lighten:function(e,t){var n=e.toHSL();return n.l+=t.value/100,n.l=l(n.l),u(n)},darken:function(e,t){var n=e.toHSL();return n.l-=t.value/100,n.l=l(n.l),u(n)},fadein:function(e,t){var n=e.toHSL();return n.a+=t.value/100,n.a=l(n.a),u(n)},fadeout:function(e,t){var n=e.toHSL();return n.a-=t.value/100,n.a=l(n.a),u(n)},fade:function(e,t){var n=e.toHSL();return n.a=t.value/100,n.a=l(n.a),u(n)},spin:function(e,t){var n=e.toHSL(),r=(n.h+t.value)%360;return n.h=r<0?360+r:r,u(n)},mix:function(e,t,n){n||(n=new r.Dimension(50));var i=n.value/100,s=i*2-1,o=e.toHSL().a-t.toHSL().a,u=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,a=1-u,f=[e.rgb[0]*u+t.rgb[0]*a,e.rgb[1]*u+t.rgb[1]*a,e.rgb[2]*u+t.rgb[2]*a],l=e.alpha*i+t.alpha*(1-i);return new r.Color(f,l)},greyscale:function(e){return this.desaturate(e,new r.Dimension(100))},contrast:function(e,t,n,r){if(!e.rgb)return null;typeof n=="undefined"&&(n=this.rgba(255,255,255,1)),typeof t=="undefined"&&(t=this.rgba(0,0,0,1));if(t.luma()>n.luma()){var i=n;n=t,t=i}return typeof r=="undefined"?r=.43:r=f(r),e.luma()*e.alpha=d){if(this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",o,v,d),(new r.URL(i||t,this.currentFileInfo)).eval(this.env);this.env.silent||console.warn("WARNING: Embedding %s (%dKB) exceeds IE8's data-uri size limit of %dKB!",o,v,d)}p=f?p.toString("base64"):encodeURIComponent(p);var m="'data:"+s+","+p+"'";return new r.URL(new r.Anonymous(m))}},r._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(e){var i=n("path").extname(e),s=r._mime._types[i];if(s===t)throw new Error('Optional dependency "mime" is required for '+i);return s},charsets:{lookup:function(e){return e&&/^text\//.test(e)?"UTF-8":""}}};var i=[{name:"ceil"},{name:"floor"},{name:"sqrt"},{name:"abs"},{name:"tan",unit:""},{name:"sin",unit:""},{name:"cos",unit:""},{name:"atan",unit:"rad"},{name:"asin",unit:"rad"},{name:"acos",unit:"rad"}],s=function(e,t){return function(n){return t!=null&&(n=n.unify()),this._math(Math[e],t,n)}};for(var o=0;o255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("");return n&&(r=r.split(""),r[0]==r[1]&&r[2]==r[3]&&r[4]==r[5]?r=r[0]+r[2]+r[4]:r=r.join("")),"#"+r},operate:function(t,n,r){var i=[];r instanceof e.Color||(r=r.toColor());for(var s=0;s<3;s++)i[s]=e.operate(t,n,this.rgb[s],r.rgb[s]);return new e.Color(i,this.alpha+r.alpha)},toHSL:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255,r=this.alpha,i=Math.max(e,t,n),s=Math.min(e,t,n),o,u,a=(i+s)/2,f=i-s;if(i===s)o=u=0;else{u=a>.5?f/(2-i-s):f/(i+s);switch(i){case e:o=(t-n)/f+(t255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},compare:function(e){return e.rgb?e.rgb[0]===this.rgb[0]&&e.rgb[1]===this.rgb[1]&&e.rgb[2]===this.rgb[2]&&e.alpha===this.alpha?0:-1:-1}}}(n("../tree")),function(e){e.Comment=function(e,t){this.value=e,this.silent=!!t},e.Comment.prototype={type:"Comment",toCSS:function(e){return e.compress?"":this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Condition=function(e,t,n,r,i){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this.index=r,this.negate=i},e.Condition.prototype={type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=this.lvalue.eval(e),n=this.rvalue.eval(e),r=this.index,i,i=function(e){switch(e){case"and":return t&&n;case"or":return t||n;default:if(t.compare)i=t.compare(n);else{if(!n.compare)throw{type:"Type",message:"Unable to perform comparison",index:r};i=n.compare(t)}switch(i){case-1:return e==="<"||e==="=<";case 0:return e==="="||e===">="||e==="=<";case 1:return e===">"||e===">="}}}(this.op);return this.negate?!i:i}}}(n("../tree")),function(e){e.Dimension=function(n,r){this.value=parseFloat(n),this.unit=r&&r instanceof e.Unit?r:new e.Unit(r?[r]:t)},e.Dimension.prototype={type:"Dimension",accept:function(e){this.unit=e.visit(this.unit)},eval:function(e){return this},toColor:function(){return new e.Color([this.value,this.value,this.value])},toCSS:function(e){if(e&&e.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var t=this.value,n=String(t);t!==0&&t<1e-6&&t>-0.000001&&(n=t.toFixed(20).replace(/0+$/,""));if(e&&e.compress){if(t===0&&!this.unit.isAngle())return n;t>0&&t<1&&(n=n.substr(1))}return n+this.unit.toCSS(e)},operate:function(t,n,r){var i=e.operate(t,n,this.value,r.value),s=this.unit.clone();if(n==="+"||n==="-"){if(s.numerator.length===0&&s.denominator.length===0)s.numerator=r.unit.numerator.slice(0),s.denominator=r.unit.denominator.slice(0);else if(r.unit.numerator.length!=0||s.denominator.length!=0){r=r.convertTo(this.unit.usedUnits());if(t.strictUnits&&r.unit.toString()!==s.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+s.toString()+"' and '"+r.unit.toString()+"'.");i=e.operate(t,n,this.value,r.value)}}else n==="*"?(s.numerator=s.numerator.concat(r.unit.numerator).sort(),s.denominator=s.denominator.concat(r.unit.denominator).sort(),s.cancel()):n==="/"&&(s.numerator=s.numerator.concat(r.unit.denominator).sort(),s.denominator=s.denominator.concat(r.unit.numerator).sort(),s.cancel());return new e.Dimension(i,s)},compare:function(t){if(t instanceof e.Dimension){var n=this.unify(),r=t.unify(),i=n.value,s=r.value;return s>i?-1:s=1?this.numerator[0]:this.denominator.length>=1?this.denominator[0]:(!e||!e.strictUnits)&&this.backupUnit?this.backupUnit:""},toString:function(){var e,t=this.numerator.join("*");for(e=0;e0)for(n=0;n":e.compress?">":" > ","|":e.compress?"|":" | "}[this.value]}}}(n("../tree")),function(e){e.Expression=function(e){this.value=e},e.Expression.prototype={type:"Expression",accept:function(e){this.value=e.visit(this.value)},eval:function(t){var n,r=this.parens&&!this.parensInOp,i=!1;return r&&t.inParenthesis(),this.value.length>1?n=new e.Expression(this.value.map(function(e){return e.eval(t)})):this.value.length===1?(this.value[0].parens&&!this.value[0].parensInOp&&(i=!0),n=this.value[0].eval(t)):n=this,r&&t.outOfParenthesis(),this.parens&&this.parensInOp&&!t.isMathOn()&&!i&&(n=new e.Paren(n)),n},toCSS:function(e){return this.value.map(function(t){return t.toCSS?t.toCSS(e):""}).join(" ")},throwAwayComments:function(){this.value=this.value.filter(function(t){return!(t instanceof e.Comment)})}}}(n("../tree")),function(e){e.Extend=function(t,n,r){this.selector=t,this.option=n,this.index=r;switch(n){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}},e.Extend.prototype={type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(t){return new e.Extend(this.selector.eval(t),this.option,this.index)},clone:function(t){return new e.Extend(this.selector,this.option,this.index)},findSelfSelectors:function(e){var t=[],n;for(n=0;n1){var r=this.emptySelectors();n=new e.Ruleset(r,t.mediaBlocks),n.multiMedia=!0}return delete t.mediaBlocks,delete t.mediaPath,n},evalNested:function(t){var n,r,i=t.mediaPath.concat([this]);for(n=0;n0;n--)t.splice(n,0,new e.Anonymous("and"));return new e.Expression(t)})),new e.Ruleset([],[])},permute:function(e){if(e.length===0)return[];if(e.length===1)return e[0];var t=[],n=this.permute(e.slice(1));for(var r=0;r0){c=!0;for(a=0;athis.params.length)return!1;if(this.required>0&&n>this.params.length)return!1}r=Math.min(n,this.arity);for(var s=0;si.selectors[o].elements.length?Array.prototype.push.apply(r,i.find(new e.Selector(t.elements.slice(1)),n)):r.push(i);break}}),this._lookups[o]=r)},toCSS:function(t){var n=[],r=[],i=[],s=[],o,u,a;for(var f=0;f0){u=e.debugInfo(t,this),o=this.paths.map(function(e){return e.map(function(e){return e.toCSS(t)}).join("").trim()}).join(t.compress?",":",\n");for(var f=r.length-1;f>=0;f--)(r[f].slice(0,2)==="/*"||i.indexOf(r[f])===-1)&&i.unshift(r[f]);r=i,n.push(u+o+(t.compress?"{":" {\n ")+r.join(t.compress?"":"\n ")+(t.compress?"}":"\n}\n"))}return n.push(s),n.join("")+(t.compress?"\n":"")},joinSelectors:function(e,t,n){for(var r=0;r0)for(i=0;i0&&this.mergeElementsOnToSelectors(g,a);for(s=0;s0&&(l[0].elements=l[0].elements.slice(0),l[0].elements.push(new e.Element(f.combinator,"",0))),y.push(l);else for(o=0;o0?(h=l.slice(0),m=h.pop(),d=new e.Selector(m.elements.slice(0),r.extendList),v=!1):d=new e.Selector([],r.extendList),c.length>1&&(p=p.concat(c.slice(1))),c.length>0&&(v=!1,d.elements.push(new e.Element(f.combinator,c[0].elements[0].value,0)),d.elements=d.elements.concat(c[0].elements.slice(1))),v||h.push(d),h=h.concat(p),y.push(h)}a=y,g=[]}}g.length>0&&this.mergeElementsOnToSelectors(g,a);for(i=0;i0&&t.push(a[i])},mergeElementsOnToSelectors:function(t,n){var r,i,s;if(n.length==0){n.push([new e.Selector(t)]);return}for(r=0;r0?i[i.length-1]=new e.Selector(i[i.length-1].elements.concat(t),i[i.length-1].extendList):i.push(new e.Selector(t))}}}(n("../tree")),function(e){e.Selector=function(e,t){this.elements=e,this.extendList=t||[]},e.Selector.prototype={type:"Selector",accept:function(e){this.elements=e.visit(this.elements),this.extendList=e.visit(this.extendList)},match:function(e){var t=this.elements,n=t.length,r,i,s,o;r=e.elements.slice(e.elements.length&&e.elements[0].value==="&"?1:0),i=r.length,s=Math.min(n,i);if(i===0||n1?"["+e.value.map(function(e){return e.toCSS(!1)}).join(", ")+"]":e.toCSS(!1)}}(n("./tree")),function(e){var t=["paths","optimization","files","contents","relativeUrls","strictImports","dumpLineNumbers","compress","processImports","syncImport","mime","currentFileInfo"];e.parseEnv=function(e){r(e,this,t),this.contents||(this.contents={}),this.files||(this.files={});if(!this.currentFileInfo){var n=e&&e.filename||"input",i=n.replace(/[^\/\\]*$/,"");e&&(e.filename=null),this.currentFileInfo={filename:n,relativeUrls:this.relativeUrls,rootpath:e&&e.rootpath||"",currentDirectory:i,entryPath:i,rootFilename:n}}},e.parseEnv.prototype.toSheet=function(t){var n=new e.parseEnv(this);return n.href=t,n.type=this.mime,n};var n=["silent","verbose","compress","yuicompress","ieCompat","strictMath","strictUnits"];e.evalEnv=function(e,t){r(e,this,n),this.frames=t||[]},e.evalEnv.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},e.evalEnv.prototype.outOfParenthesis=function(){this.parensStack.pop()},e.evalEnv.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},e.evalEnv.prototype.isPathRelative=function(e){return!/^(?:[a-z-]+:|\/)/.test(e)};var r=function(e,t,n){if(!e)return;for(var r=0;r100){var d="{unable to calculate}",v="{unable to calculate}";try{d=u[0].selfSelectors[0].toCSS(),v=u[0].selector.toCSS()}catch(m){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+d+":extend("+v+")"}}return u.concat(f.doExtendChaining(u,n,r+1))}return u},inInheritanceChain:function(e,t){if(e===t)return!0;if(t.parents){if(this.inInheritanceChain(e,t.parents[0]))return!0;if(this.inInheritanceChain(e,t.parents[1]))return!0}return!1},visitRule:function(e,t){t.visitDeeper=!1},visitMixinDefinition:function(e,t){t.visitDeeper=!1},visitSelector:function(e,t){t.visitDeeper=!1},visitRuleset:function(e,t){if(e.root)return;var n,r,i,s=this.allExtendsStack[this.allExtendsStack.length-1],o=[],u=this,a;for(i=0;i0&&f[c.matched].combinator.value!==o?c=null:c.matched++,c&&(c.finished=c.matched===f.length,c.finished&&!e.allowAfter&&(i+1i&&s>0&&(o[o.length-1].elements=o[o.length-1].elements.concat(n[i].elements.slice(s)),s=0,i++),o=o.concat(n.slice(i,l.pathIndex)),o.push(new e.Selector(a.elements.slice(s,l.index).concat([f]).concat(r.elements.slice(1)))),i=l.endPathIndex,s=l.endPathElementIndex,s>=a.elements.length&&(s=0,i++);return i0&&(o[o.length-1].elements=o[o.length-1].elements.concat(n[i].elements.slice(s)),s=0,i++),o=o.concat(n.slice(i,n.length)),o},visitRulesetOut:function(e){},visitMedia:function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},visitMediaOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},visitDirectiveOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(n("./tree"));var o=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);r.env=r.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||o?"development":"production"),r.async=r.async||!1,r.fileAsync=r.fileAsync||!1,r.poll=r.poll||(o?1e3:1500);if(r.functions)for(var u in r.functions)r.tree.functions[u]=r.functions[u];var a=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);a&&(r.dumpLineNumbers=a[1]),r.watch=function(){return r.watchMode||(r.env="development",f()),this.watchMode=!0},r.unwatch=function(){return clearInterval(r.watchTimer),this.watchMode=!1},/!watch/.test(location.hash)&&r.watch();var l=null;if(r.env!="development")try{l=typeof e.localStorage=="undefined"?null:e.localStorage}catch(c){}var h=document.getElementsByTagName("link"),p=/^text\/(x-)?less$/;r.sheets=[];for(var d=0;d - * Licensed under the Apache v2 License. - * - */ - - /** * @license Apache v2 - */ - -!function(a,b){function c(b){return a.less[b.split("/")[1]]}function d(a,b){"development"==v.env&&"undefined"!=typeof console&&v.logLevel>=b&&console.log("less: "+a)}function e(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function f(a,c){var e="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,c,d){a.extract[c]!==b&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")):a.stack&&(h+=a.stack),d(h,y.errors)}function g(a,b,c){var f=b.href||"",g="less:"+(b.title||e(f)),h=document.getElementById(g),i=!1,j=document.createElement("style");if(j.setAttribute("type","text/css"),b.media&&j.setAttribute("media",b.media),j.id=g,j.styleSheet)try{j.styleSheet.cssText=a}catch(k){throw new Error("Couldn't reassign styleSheet.cssText.")}else j.appendChild(document.createTextNode(a)),i=null!==h&&h.childNodes.length>0&&j.childNodes.length>0&&h.firstChild.nodeValue===j.firstChild.nodeValue;var l=document.getElementsByTagName("head")[0];if(null===h||i===!1){var m=b&&b.nextSibling||null;m?m.parentNode.insertBefore(j,m):l.appendChild(j)}if(h&&i===!1&&h.parentNode.removeChild(h),c&&C){d("saving "+f+" to cache.",y.info);try{C.setItem(f,a),C.setItem(f+":timestamp",c)}catch(k){d("failed to save",y.errors)}}}function h(a,c){var d,f,h="less-error-message:"+e(c||""),i='
  • {content}
  • ',j=document.createElement("div"),k=[],l=a.filename||c,m=l.match(/([^\/]+(\?.*)?)$/)[1];j.id=h,j.className="less-error-message",f="

    "+(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+'

    in '+m+" ";var n=function(a,c,d){a.extract[c]!==b&&k.push(i.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(n(a,0,""),n(a,1,"line"),n(a,2,""),f+="on line "+a.line+", column "+(a.column+1)+":

      "+k.join("")+"
    "):a.stack&&(f+="
    "+a.stack.split("\n").slice(1).join("
    ")),j.innerHTML=f,g([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),j.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"==v.env&&(d=setInterval(function(){document.body&&(document.getElementById(h)?document.body.replaceChild(j,document.getElementById(h)):document.body.insertBefore(j,document.body.firstChild),clearInterval(d))},10))}function i(a,b){v.errorReporting&&"html"!==v.errorReporting?"console"===v.errorReporting?f(a,b):"function"==typeof v.errorReporting&&v.errorReporting("add",a,b):h(a,b)}function j(a){var b=document.getElementById("less-error-message:"+e(a));b&&b.parentNode.removeChild(b)}function k(){}function l(a){v.errorReporting&&"html"!==v.errorReporting?"console"===v.errorReporting?k(a):"function"==typeof v.errorReporting&&v.errorReporting("remove",a):j(a)}function m(a){for(var b,c=document.getElementsByTagName("style"),d=0;d0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=f[1]+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g}function o(a,b){var c,d,e,f,g=n(a),h=n(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;c=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var g=p(),h=x?v.fileAsync:v.async;"function"==typeof g.overrideMimeType&&g.overrideMimeType("text/css"),d("XHR: Getting '"+a+"'",y.info),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),x&&!v.fileAsync?0===g.status||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){4==g.readyState&&f(g,c,e)}:f(g,c,e)}function r(b,c,d,e){c&&c.currentDirectory&&!/^([a-z-]+:)?\//.test(b)&&(b=c.currentDirectory+b);var f=n(b,a.location.href),g=f.url,h={currentDirectory:f.path,filename:g};if(c?(h.entryPath=c.entryPath,h.rootpath=c.rootpath,h.rootFilename=c.rootFilename,h.relativeUrls=c.relativeUrls):(h.entryPath=f.path,h.rootpath=v.rootpath||f.path,h.rootFilename=g,h.relativeUrls=e.relativeUrls),h.relativeUrls&&(h.rootpath=e.rootpath?n(e.rootpath+o(f.path,h.entryPath)).path:f.path),e.useFileCache&&D[g])try{var i=D[g];d(null,i,g,h,{lastModified:new Date})}catch(j){d(j,null,g)}else q(g,e.mime,function(a,b){D[g]=a;try{d(null,a,g,h,{lastModified:b})}catch(c){d(c,null,g)}},function(a,b){d({type:"File",message:"'"+b+"' wasn't found ("+a+")"},null,g)})}function s(a,b,c,d,e){var f=new v.tree.parseEnv(v);f.mime=a.type,(e||v.globalVars)&&(f.useFileCache=!0),r(a.href,null,function(h,i,j,k,m){if(m){m.remaining=d;var n=C&&C.getItem(j),o=C&&C.getItem(j+":timestamp");if(!c&&o&&m.lastModified&&new Date(m.lastModified).valueOf()===new Date(o).valueOf())return g(n,a),m.local=!0,b(null,null,i,a,m,j),void 0}l(j),i?(f.currentFileInfo=k,new v.Parser(f).parse(i,function(c,d){if(c)return b(c,null,null,a);try{b(c,d,i,a,m,j)}catch(c){b(c,null,null,a)}},{modifyVars:e,globalVars:v.globalVars})):b(h,null,null,a,m,j)},f,e)}function t(a,b,c){for(var d=0;dE&&(D=D.slice(x-E),E=x)}function g(a,b){var c=a.charCodeAt(0|b);return 32>=c&&(32===c||10===c||9===c)}function h(a){var b,c,d=typeof a;return"string"===d?u.charAt(x)!==a?null:(k(1),a):(f(),(b=a.exec(D))?(c=b[0].length,k(c),"string"==typeof b?b:1===b.length?b[0]:b):null)}function i(a){x>E&&(D=D.slice(x-E),E=x);var b=a.exec(D);return b?(k(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null}function j(a){return u.charAt(x)!==a?null:(k(1),a)}function k(a){for(var b,c=x,d=y,e=x-E,f=x+D.length-e,g=x+=a,h=u;f>x&&(b=h.charCodeAt(x),!(b>32))&&(32===b||10===b||9===b||13===b);x++);return D=D.slice(a+x-g+e),E=x,!D.length&&y=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}function s(a,b,d){var e=d.currentFileInfo.filename;return"browser"!==v.mode&&"rhino"!==v.mode&&(e=c("path").resolve(e)),{lineNumber:r(a,b).line+1,fileName:e}}function t(a,b){var c=q(a,b),d=r(a.index,c),e=d.line,f=d.column,g=a.call&&r(a.call,c).line,h=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.currentFileInfo.filename,this.index=a.index,this.line="number"==typeof e?e+1:null,this.callLine=g+1,this.callExtract=h[g],this.stack=a.stack,this.column=f,this.extract=[h[e-1],h[e],h[e+1]]}var u,x,y,z,A,B,C,D,E,F,G,H=a&&a.filename;a instanceof w.parseEnv||(a=new w.parseEnv(a));var I=this.imports={paths:a.paths||[],queue:[],files:a.files,contents:a.contents,contentsIgnoredChars:a.contentsIgnoredChars,mime:a.mime,error:null,push:function(b,c,d,e){var f=this;this.queue.push(b);var g=function(a,c,d){f.queue.splice(f.queue.indexOf(b),1);var g=d in f.files||d===H;f.files[d]=c,a&&!f.error&&(f.error=a),e(a,c,g,d)};v.Parser.importer?v.Parser.importer(b,c,g,a):v.Parser.fileLoader(b,c,function(b,e,f,h){if(b)return g(b),void 0;var i=new w.parseEnv(a);i.currentFileInfo=h,i.processImports=!1,i.contents[f]=e,(c.reference||d.reference)&&(h.reference=!0),d.inline?g(null,e,f):new v.Parser(i).parse(e,function(a,b){g(a,b,f)})},a)}},J=i;return t.prototype=new Error,t.prototype.constructor=t,this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,F={imports:I,parse:function(d,e,f){var g,h,i,j,k,l=null,m="";if(x=y=E=B=0,j=f&&f.globalVars?v.Parser.serializeVars(f.globalVars)+"\n":"",k=f&&f.modifyVars?"\n"+v.Parser.serializeVars(f.modifyVars):"",(j||f&&f.banner)&&(m=(f&&f.banner?f.banner:"")+j,F.imports.contentsIgnoredChars[a.currentFileInfo.filename]=m.length),d=d.replace(/\r\n/g,"\n"),u=d=m+d.replace(/^\uFEFF/,"")+k,F.imports.contents[a.currentFileInfo.filename]=d,C=function(b){function c(b,c){l=new t({index:c||i,type:"Parse",message:b,filename:a.currentFileInfo.filename},a)}function d(a){var c=i-s;512>c&&!a||!c||(r.push(b.slice(s,i+1)),s=i+1)}var e,f,g,h,i,j,k,m,n,o=b.length,p=0,q=0,r=[],s=0;for(i=0;o>i;i++)if(k=b.charCodeAt(i),!(k>=97&&122>=k||34>k))switch(k){case 40:q++,f=i;continue;case 41:if(--q<0)return c("missing opening `(`");continue;case 59:q||d();continue;case 123:p++,e=i;continue;case 125:if(--p<0)return c("missing opening `{`");p||d();continue;case 92:if(o-1>i){i++;continue}return c("unescaped `\\`");case 34:case 39:case 96:for(n=0,j=i,i+=1;o>i;i++)if(m=b.charCodeAt(i),!(m>96)){if(m==k){n=1;break}if(92==m){if(i==o-1)return c("unescaped `\\`");i++}}if(n)continue;return c("unmatched `"+String.fromCharCode(k)+"`",j);case 47:if(q||i==o-1)continue;if(m=b.charCodeAt(i+1),47==m)for(i+=2;o>i&&(m=b.charCodeAt(i),!(13>=m)||10!=m&&13!=m);i++);else if(42==m){for(g=j=i,i+=2;o-1>i&&(m=b.charCodeAt(i),125==m&&(h=i),42!=m||47!=b.charCodeAt(i+1));i++);if(i==o-1)return c("missing closing `*/`",j);i++}continue;case 42:if(o-1>i&&47==b.charCodeAt(i+1))return c("unmatched `/*`");continue}return 0!==p?g>e&&h>g?c("missing closing `}` or `*/`",e):c("missing closing `}`",e):0!==q?c("missing closing `)`",f):(d(!0),r)}(d),l)return e(new t(l,a));D=C[0];try{g=new w.Ruleset(null,this.parsers.primary()),g.root=!0,g.firstRoot=!0}catch(n){return e(new t(n,a))}if(g.toCSS=function(d){return function(e,f){e=e||{};var g,h,i=new w.evalEnv(e);"object"!=typeof f||Array.isArray(f)||(f=Object.keys(f).map(function(a){var b=f[a];return b instanceof w.Value||(b instanceof w.Expression||(b=new w.Expression([b])),b=new w.Value([b])),new w.Rule("@"+a,b,!1,null,0)}),i.frames=[new w.Ruleset(null,f)]);try{var j,k=[],l=[new w.joinSelectorVisitor,new w.processExtendsVisitor,new w.toCSSVisitor({compress:Boolean(e.compress)})],m=this;if(e.plugins)for(j=0;j57||43>b||47===b||44==b))return a=i(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/),a?new w.Dimension(a[1],a[2]):void 0},unicodeDescriptor:function(){var a;return a=i(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new w.UnicodeDescriptor(a[0]):void 0},javascript:function(){var c,d,e=x;return"~"===u.charAt(e)&&(e++,d=!0),"`"===u.charAt(e)?(a.javascriptEnabled===b||a.javascriptEnabled||n("You are using JavaScript, which has been disabled."),d&&j("~"),c=i(/^`([^`]*)`/),c?new w.JavaScript(c[1],x,d):void 0):void 0}},variable:function(){var a;return"@"===u.charAt(x)&&(a=i(/^(@[\w-]+)\s*:/))?a[1]:void 0},extend:function(a){var b,c,d,e,f,g=x;if(a?i(/^&:extend\(/):i(/^:extend\(/)){do{for(d=null,b=null;!(d=i(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];d=d&&d[1],f=new w.Extend(new w.Selector(b),d,g),e?e.push(f):e=[f]}while(j(","));return l(/^\)/),a&&l(/^;/),e}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var b,c,f,g,h,k,l=u.charAt(x),n=!1,o=x;if("."===l||"#"===l){for(d();;){if(b=x,g=i(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!g)break;f=new w.Element(h,g,b,a.currentFileInfo),c?c.push(f):c=[f],h=j(">")}return c&&(j("(")&&(k=this.args(!0).args,m(")")),G.important()&&(n=!0),G.end())?new w.mixin.Call(c,k,o,a.currentFileInfo,n):(e(),void 0)}},args:function(a){for(var b,c,d,e,f,g,h=F.parsers,k=h.entities,m={args:null,variadic:!1},o=[],p=[],q=[];;){if(a)g=h.expression();else{if(h.comments(),"."===u.charAt(x)&&i(/^\.{3}/)){m.variadic=!0,j(";")&&!b&&(b=!0),(b?p:q).push({variadic:!0});break}g=k.variable()||k.literal()||k.keyword()}if(!g)break;e=null,g.throwAwayComments&&g.throwAwayComments(),f=g;var r=null;if(a?1==g.value.length&&(r=g.value[0]):r=g,r&&r instanceof w.Variable)if(j(":"))o.length>0&&(b&&n("Cannot mix ; and , as delimiter types"),c=!0),f=l(h.expression),e=d=r.name;else{if(!a&&i(/^\.{3}/)){m.variadic=!0,j(";")&&!b&&(b=!0),(b?p:q).push({name:g.name,variadic:!0});break}a||(d=e=r.name,f=null)}f&&o.push(f),q.push({name:e,value:f}),j(",")||(j(";")||b)&&(c&&n("Cannot mix ; and , as delimiter types"),b=!0,o.length>1&&(f=new w.Value(o)),p.push({name:d,value:f}),d=null,o=[],c=!1)}return m.args=b?p:q,m},definition:function(){var a,b,c,f,g=[],h=!1;if(!("."!==u.charAt(x)&&"#"!==u.charAt(x)||o(/^[^{]*\}/))&&(d(),b=i(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/))){a=b[1];var k=this.args(!1);if(g=k.args,h=k.variadic,j(")")||(B=x,e()),G.comments(),i(/^when/)&&(f=l(G.conditions,"expected condition")),c=G.block())return new w.mixin.Definition(a,g,c,f,h);e()}}},entity:function(){var a=this.entities;return a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()||this.comment()},end:function(){return j(";")||p("}")},alpha:function(){var a;if(i(/^\(opacity=/i))return a=i(/^\d+/)||this.entities.variable(),a?(m(")"),new w.Alpha(a)):void 0},element:function(){var b,c,d,e=x;return c=this.combinator(),b=i(/^(?:\d+\.\d+|\d+)%/)||i(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||j("*")||j("&")||this.attribute()||i(/^\([^()@]+\)/)||i(/^[\.#](?=@)/)||this.entities.variableCurly(),b||j("(")&&(d=this.selector())&&j(")")&&(b=new w.Paren(d)),b?new w.Element(c,b,e,a.currentFileInfo):void 0},combinator:function(){var a=u.charAt(x);if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(x++,"^"===u.charAt(x)&&(a="^^",x++);g(u,x);)x++;return new w.Combinator(a)}return g(u,x-1)?new w.Combinator(" "):new w.Combinator(null)},lessSelector:function(){return this.selector(!0)},selector:function(b){for(var c,d,e,f,g,h,i,j=x,k=J;(b&&(g=this.extend())||b&&(h=k(/^when/))||(f=this.element()))&&(h?i=l(this.conditions,"expected condition"):i?n("CSS guard can only be used at the end of selector"):g?d?d.push(g):d=[g]:(d&&n("Extend can only be used at the end of selector"),e=u.charAt(x),c?c.push(f):c=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return c?new w.Selector(c,d,i,j,a.currentFileInfo):(d&&n("Extend must be used to extend a selector, it cannot be used on its own"),void 0)},attribute:function(){if(j("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=l(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=i(/^[|~*$^]?=/),c&&(b=d.quoted()||i(/^[0-9]+%/)||i(/^[\w-]+/)||d.variableCurly()),m("]"),new w.Attribute(a,c,b)}},block:function(){var a;return j("{")&&(a=this.primary())&&j("}")?a:void 0},ruleset:function(){var b,c,f,g;for(d(),a.dumpLineNumbers&&(g=s(x,u,a));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],this.comments(),c.condition&&b.length>1&&n("Guards are only currently allowed on a single selector."),!j(","))break;c.condition&&n("Guards are only currently allowed on a single selector."),this.comments()}if(b&&(f=this.block())){var h=new w.Ruleset(b,f,a.strictImports);return a.dumpLineNumbers&&(h.debugInfo=g),h}B=x,e()},rule:function(b){var c,f,g,h=u.charAt(x),i=!1;if(d(),"."!==h&&"#"!==h&&"&"!==h&&(c=this.variable()||this.ruleProperty())){if(f=!b&&(a.compress||c.charAt&&"@"===c.charAt(0))?this.value()||this.anonymousValue():this.anonymousValue()||this.value(),g=this.important(),i=c.pop&&"+"===c.pop().value,f&&this.end())return new w.Rule(c,f,g,i,A,a.currentFileInfo);if(B=x,e(),f&&!b)return this.rule(!0)}},anonymousValue:function(){var a;return a=/^([^@+\/'"*`(;{}-]*);/.exec(D),a?(x+=a[0].length-1,new w.Anonymous(a[1])):void 0},"import":function(){var b,c,f=x;d();var g=i(/^@import?\s+/),h=(g?this.importOptions():null)||{};return g&&(b=this.entities.quoted()||this.entities.url())&&(c=this.mediaFeatures(),j(";"))?(c=c&&new w.Value(c),new w.Import(b,c,h,f,a.currentFileInfo)):(e(),void 0)},importOptions:function(){var a,b,c,d={};if(!j("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!j(","))break}while(a);return m(")"),d},importOption:function(){var a=i(/^(less|css|multiple|once|inline|reference)/);return a?a[1]:void 0},mediaFeature:function(){var b,c,d=this.entities,e=[];do if(b=d.keyword()||d.variable())e.push(b);else if(j("(")){if(c=this.property(),b=this.value(),!j(")"))return null;if(c&&b)e.push(new w.Paren(new w.Rule(c,b,null,null,x,a.currentFileInfo,!0)));else{if(!b)return null;e.push(new w.Paren(b))}}while(b);return e.length>0?new w.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!j(","))break}else if(a=b.variable(),a&&(c.push(a),!j(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,d,e;return a.dumpLineNumbers&&(e=s(x,u,a)),i(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(d=new w.Media(c,b,x,a.currentFileInfo),a.dumpLineNumbers&&(d.debugInfo=e),d):void 0},directive:function(){var b,c,f,g,h,k,l,m,n=x;if("@"===u.charAt(x)){if(c=this["import"]()||this.media())return c;if(d(),b=i(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@font-face":h=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":h=!0;break;case"@host":case"@page":case"@document":case"@supports":case"@keyframes":h=!0,k=!0;break;case"@namespace":l=!0}if(k&&(m=(i(/^[^{]+/)||"").trim(),m&&(b+=" "+m)),h){if(f=this.block())return new w.Directive(b,f,n,a.currentFileInfo)}else if(c=l?this.expression():this.entity(),c&&j(";")){var o=new w.Directive(b,c,n,a.currentFileInfo);return a.dumpLineNumbers&&(o.debugInfo=s(x,u,a)),o}e()}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!j(",")))break;while(a);return b.length>0?new w.Value(b):void 0},important:function(){return"!"===u.charAt(x)?i(/^! *important/):void 0},sub:function(){var a,b;return j("(")&&(a=this.addition())?(b=new w.Expression([a]),m(")"),b.parens=!0,b):void 0},multiplication:function(){var a,b,c,d,e;if(a=this.operand()){for(e=g(u,x-1);;){if(o(/^\/[*\/]/))break;if(c=j("/")||j("*"),!c)break;if(b=this.operand(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new w.Operation(c,[d||a,b],e),e=g(u,x-1)}return d||a}},addition:function(){var a,b,c,d,e;if(a=this.multiplication()){for(e=g(u,x-1);;){if(c=i(/^[-+]\s+/)||!e&&(j("+")||j("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new w.Operation(c,[d||a,b],e),e=g(u,x-1)}return d||a}},conditions:function(){var a,b,c,d=x;if(a=this.condition()){for(;;){if(!o(/^,\s*(not\s*)?\(/)||!j(","))break;if(b=this.condition(),!b)break;c=new w.Condition("or",c||a,b,d)}return c||a}},condition:function(){var a,b,c,d,e=this.entities,f=x,g=!1;return i(/^not/)&&(g=!0),m("("),a=this.addition()||e.keyword()||e.quoted(),a?(d=i(/^(?:>=|<=|=<|[<=>])/),d?(b=this.addition()||e.keyword()||e.quoted(),b?c=new w.Condition(d,a,b,f,g):n("expected expression")):c=new w.Condition("=",a,new w.Keyword("true"),f,g),m(")"),i(/^and/)?new w.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities,c=u.charAt(x+1);"-"!==u.charAt(x)||"@"!==c&&"("!==c||(a=j("-"));var d=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(d.parensInOp=!0,d=new w.Negative(d)),d},expression:function(){var a,b,c=[];do a=this.addition()||this.entity(),a&&(c.push(a),o(/^\/[\/*]/)||(b=j("/"),b&&c.push(new w.Anonymous(b))));while(a);return c.length>0?new w.Expression(c):void 0},property:function(){var a=i(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function b(a){var b=a.exec(e);return b?(g.push(x+h),h+=b[0].length,e=e.slice(b[1].length),f.push(b[1])):void 0}var c,d,e=D,f=[],g=[],h=0;for(b(/^(\*?)/);b(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/););if(f.length>1&&b(/^\s*(\+?)\s*:/)){for(k(h),""===f[0]&&(f.shift(),g.shift()),d=0;dl;l++)e=b.rgb[l]/255,f=c.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new d.Color(k,g)}function g(){var a,b=d.functions;for(a in l)l.hasOwnProperty(a)&&(b[a]=e.bind(null,Math[a],l[a]));for(a in m)m.hasOwnProperty(a)&&(b[a]=f.bind(null,m[a]));a=d.defaultFunc,b["default"]=a.eval.bind(a)}function h(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function i(a,b){return a instanceof d.Dimension&&a.unit.is("%")?parseFloat(a.value*b/100):j(a)}function j(a){if(a instanceof d.Dimension)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function k(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(a,b,c,e){var f=[a,b,c].map(function(a){return i(a,255)});return e=j(e),new d.Color(f,e)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,c,d){function e(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?g+(f-g)*a*6:1>2*a?f:2>3*a?g+(f-g)*(2/3-a)*6:g}a=j(a)%360/360,b=k(j(b)),c=k(j(c)),d=k(j(d));var f=.5>=c?c*(b+1):c+b-c*b,g=2*c-f;return this.rgba(255*e(a+1/3),255*e(a),255*e(a-1/3),d)},hsv:function(a,b,c){return this.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=j(a)%360/360*360,b=j(b),c=j(c),d=j(d);var e,f;e=Math.floor(a/60%6),f=a/60-e;var g=[c,c*(1-b),c*(1-f*b),c*(1-(1-f)*b)],h=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(255*g[h[e][0]],255*g[h[e][1]],255*g[h[e][2]],d)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},saturation:function(a){return new d.Dimension(Math.round(100*a.toHSL().s),"%")},lightness:function(a){return new d.Dimension(Math.round(100*a.toHSL().l),"%")},hsvhue:function(a){return new d.Dimension(Math.round(a.toHSV().h))},hsvsaturation:function(a){return new d.Dimension(Math.round(100*a.toHSV().s),"%")},hsvvalue:function(a){return new d.Dimension(Math.round(100*a.toHSV().v),"%")},red:function(a){return new d.Dimension(a.rgb[0])},green:function(a){return new d.Dimension(a.rgb[1])},blue:function(a){return new d.Dimension(a.rgb[2])},alpha:function(a){return new d.Dimension(a.toHSL().a)},luma:function(a){return new d.Dimension(Math.round(a.luma()*a.alpha*100),"%")},saturate:function(a,b){if(!a.rgb)return null;var c=a.toHSL();return c.s+=b.value/100,c.s=k(c.s),h(c)},desaturate:function(a,b){var c=a.toHSL();return c.s-=b.value/100,c.s=k(c.s),h(c)},lighten:function(a,b){var c=a.toHSL();return c.l+=b.value/100,c.l=k(c.l),h(c)},darken:function(a,b){var c=a.toHSL();return c.l-=b.value/100,c.l=k(c.l),h(c)},fadein:function(a,b){var c=a.toHSL();return c.a+=b.value/100,c.a=k(c.a),h(c)},fadeout:function(a,b){var c=a.toHSL();return c.a-=b.value/100,c.a=k(c.a),h(c)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=k(c.a),h(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=0>d?360+d:d,h(c)},mix:function(a,b,c){c||(c=new d.Dimension(50));var e=c.value/100,f=2*e-1,g=a.toHSL().a-b.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[a.rgb[0]*h+b.rgb[0]*i,a.rgb[1]*h+b.rgb[1]*i,a.rgb[2]*h+b.rgb[2]*i],k=a.alpha*e+b.alpha*(1-e);return new d.Color(j,k)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=this.rgba(255,255,255,1)),"undefined"==typeof b&&(b=this.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:j(d),a.luma()i.value)&&(k[f]=g)):(l[j]=k.length,k.push(g))):k.push(g);return 1==k.length?k[0]:(c=k.map(function(a){return a.toCSS(this.env)}).join(this.env.compress?",":", "),new d.Anonymous((a?"min":"max")+"("+c+")"))},min:function(){return this._minmax(!0,arguments)},max:function(){return this._minmax(!1,arguments)},argb:function(a){return new d.Anonymous(a.toARGB())},percentage:function(a){return new d.Dimension(100*a.value,"%")},color:function(a){if(a instanceof d.Quoted){var b,c=a.value;if(b=d.Color.fromKeyword(c))return b;if(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(c))return new d.Color(c.slice(1));throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}}throw{type:"Argument",message:"argument must be a string"}},iscolor:function(a){return this._isa(a,d.Color)},isnumber:function(a){return this._isa(a,d.Dimension)},isstring:function(a){return this._isa(a,d.Quoted)},iskeyword:function(a){return this._isa(a,d.Keyword)},isurl:function(a){return this._isa(a,d.URL)},ispixel:function(a){return this.isunit(a,"px")},ispercentage:function(a){return this.isunit(a,"%")},isem:function(a){return this.isunit(a,"em")},isunit:function(a,b){return a instanceof d.Dimension&&a.unit.is(b.value||b)?d.True:d.False},_isa:function(a,b){return a instanceof b?d.True:d.False},tint:function(a,b){return this.mix(this.rgb(255,255,255),a,b)},shade:function(a,b){return this.mix(this.rgb(0,0,0),a,b)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new d.Dimension(b)},"data-uri":function(b,e){if("undefined"!=typeof a)return new d.URL(e||b,this.currentFileInfo).eval(this.env);var f=b.value,g=e&&e.value,h=c("fs"),i=c("path"),j=!1;if(arguments.length<2&&(g=f),this.env.isPathRelative(g)&&(g=this.currentFileInfo.relativeUrls?i.join(this.currentFileInfo.currentDirectory,g):i.join(this.currentFileInfo.entryPath,g)),arguments.length<2){var k;try{k=c("mime")}catch(l){k=d._mime}f=k.lookup(g);var m=k.charsets.lookup(f);j=["US-ASCII","UTF-8"].indexOf(m)<0,j&&(f+=";base64")}else j=/;base64$/.test(f);var n=h.readFileSync(g),o=32,p=parseInt(n.length/1024,10);if(p>=o&&this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",g,p,o),new d.URL(e||b,this.currentFileInfo).eval(this.env);n=j?n.toString("base64"):encodeURIComponent(n);var q='"data:'+f+","+n+'"';return new d.URL(new d.Anonymous(q))},"svg-gradient":function(a){function e(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}arguments.length<3&&e();var f,g,h,i,j,k,l,m=Array.prototype.slice.call(arguments,1),n="linear",o='x="0" y="0" width="1" height="1"',p=!0,q={compress:!1},r=a.toCSS(q);switch(r){case"to bottom":f='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":f='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":f='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":f='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":n="radial",f='cx="50%" cy="50%" r="75%"',o='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(g='<'+n+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+f+">",h=0;hl?' stop-opacity="'+l+'"':"")+"/>";if(g+="',p)try{g=c("./encoder").encodeBase64(g)}catch(s){p=!1}return g="'data:image/svg+xml"+(p?";base64":"")+","+g+"'",new d.URL(new d.Anonymous(g))}},d._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(a){var e=c("path").extname(a),f=d._mime._types[e];if(f===b)throw new Error('Optional dependency "mime" is required for '+e);return f},charsets:{lookup:function(a){return a&&/^text\//.test(a)?"UTF-8":""}}};var l={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"},m={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?m.multiply(a,b):m.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return m.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};d.defaultFunc={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?d.True:d.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}},g(),d.fround=function(a,b){var c;return a&&null!=a.numPrecision?(c=Math.pow(10,a.numPrecision),Math.round(b*c)/c):b},d.functionCall=function(a,b){this.env=a,this.currentFileInfo=b},d.functionCall.prototype=d.functions}(c("./tree")),function(a){a.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(c("./tree")),function(a){a.debugInfo=function(b,c,d){var e="";if(b.dumpLineNumbers&&!b.compress)switch(b.dumpLineNumbers){case"comments":e=a.debugInfo.asComment(c);break;case"mediaquery":e=a.debugInfo.asMediaQuery(c);break;case"all":e=a.debugInfo.asComment(c)+(d||"")+a.debugInfo.asMediaQuery(c)}return e},a.debugInfo.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},a.debugInfo.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},a.find=function(a,b){for(var c,d=0;d1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)},a.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},a.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),a.tabLevel--,void 0}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--}}(c("./tree")),function(a){a.Alpha=function(a){this.value=a},a.Alpha.prototype={type:"Alpha",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Alpha(this.value.eval(b)):this},genCSS:function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},toCSS:a.toCSS}}(c("../tree")),function(a){a.Anonymous=function(a,b,c,d){this.value=a.value||a,this.index=b,this.mapLines=d,this.currentFileInfo=c},a.Anonymous.prototype={type:"Anonymous",eval:function(){return new a.Anonymous(this.value,this.index,this.currentFileInfo,this.mapLines)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1},genCSS:function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Assignment=function(a,b){this.key=a,this.value=b},a.Assignment.prototype={type:"Assignment",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Assignment(this.key,this.value.eval(b)):this},genCSS:function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Call=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d},a.Call.prototype={type:"Call",accept:function(a){this.args&&(this.args=a.visitArray(this.args))},eval:function(b){var c,d,e=this.args.map(function(a){return a.eval(b)}),f=this.name.toLowerCase();if(f in a.functions)try{if(d=new a.functionCall(b,this.currentFileInfo),c=d[f].apply(d,e),null!=c)return c}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new a.Call(this.name,e,this.index,this.currentFileInfo)},genCSS:function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;ca?"0":"")+a.toString(16)}).join("")}function c(a,b){return Math.min(Math.max(a,0),b)}a.Color=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};var d="transparent";a.Color.prototype={type:"Color",eval:function(){return this},luma:function(){return.2126*this.rgb[0]/255+.7152*this.rgb[1]/255+.0722*this.rgb[2]/255},genCSS:function(a,b){b.add(this.toCSS(a))},toCSS:function(b,e){var f=b&&b.compress&&!e,g=a.fround(b,this.alpha);if(1>g)return 0===g&&this.isTransparentKeyword?d:"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(g,1)).join(","+(f?"":" "))+")";var h=this.toRGB();if(f){var i=h.split("");i[1]===i[2]&&i[3]===i[4]&&i[5]===i[6]&&(h="#"+i[1]+i[3]+i[5])}return h},operate:function(b,c,d){for(var e=[],f=this.alpha*(1-d.alpha)+d.alpha,g=0;3>g;g++)e[g]=a.operate(b,c,this.rgb[g],d.rgb[g]);return new a.Color(e,f)},toRGB:function(){return b(this.rgb)},toHSL:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},toHSV:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},toARGB:function(){return b([255*this.alpha].concat(this.rgb))},compare:function(a){return a.rgb?a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:-1:-1}},a.Color.fromKeyword=function(b){if(b=b.toLowerCase(),a.colors.hasOwnProperty(b))return new a.Color(a.colors[b].slice(1));if(b===d){var c=new a.Color([0,0,0],0);return c.isTransparentKeyword=!0,c}}}(c("../tree")),function(a){a.Comment=function(a,b,c,d){this.value=a,this.silent=!!b,this.currentFileInfo=d},a.Comment.prototype={type:"Comment",genCSS:function(b,c){this.debugInfo&&c.add(a.debugInfo(b,this),this.currentFileInfo,this.index),c.add(this.value.trim())},toCSS:a.toCSS,isSilent:function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&!this.value.match(/^\/\*!/);return this.silent||b||c},eval:function(){return this},markReferenced:function(){this.isReferenced=!0}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype={type:"Condition",accept:function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},eval:function(a){var b,c=this.lvalue.eval(a),d=this.rvalue.eval(a),e=this.index;return b=function(a){switch(a){case"and":return c&&d;case"or":return c||d;default:if(c.compare)b=c.compare(d);else{if(!d.compare)throw{type:"Type",message:"Unable to perform comparison",index:e};b=d.compare(c)}switch(b){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a}}}(this.op),this.negate?!b:b}}}(c("../tree")),function(a){a.Dimension=function(c,d){this.value=parseFloat(c),this.unit=d&&d instanceof a.Unit?d:new a.Unit(d?[d]:b)},a.Dimension.prototype={type:"Dimension",accept:function(a){this.unit=a.visit(this.unit)},eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},genCSS:function(b,c){if(b&&b.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var d=a.fround(b,this.value),e=String(d);if(0!==d&&1e-6>d&&d>-1e-6&&(e=d.toFixed(20).replace(/0+$/,"")),b&&b.compress){if(0===d&&this.unit.isLength())return c.add(e),void 0;d>0&&1>d&&(e=e.substr(1))}c.add(e),this.unit.genCSS(b,c)},toCSS:a.toCSS,operate:function(b,c,d){var e=a.operate(b,c,this.value,d.value),f=this.unit.clone();if("+"===c||"-"===c)if(0===f.numerator.length&&0===f.denominator.length)f.numerator=d.unit.numerator.slice(0),f.denominator=d.unit.denominator.slice(0);else if(0===d.unit.numerator.length&&0===f.denominator.length);else{if(d=d.convertTo(this.unit.usedUnits()),b.strictUnits&&d.unit.toString()!==f.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+f.toString()+"' and '"+d.unit.toString()+"'.");e=a.operate(b,c,this.value,d.value)}else"*"===c?(f.numerator=f.numerator.concat(d.unit.numerator).sort(),f.denominator=f.denominator.concat(d.unit.denominator).sort(),f.cancel()):"/"===c&&(f.numerator=f.numerator.concat(d.unit.denominator).sort(),f.denominator=f.denominator.concat(d.unit.numerator).sort(),f.cancel());return new a.Dimension(e,f)},compare:function(b){if(b instanceof a.Dimension){var c=this.unify(),d=b.unify(),e=c.value,f=d.value;return f>e?-1:e>f?1:d.unit.isEmpty()||0===c.unit.compare(d.unit)?0:-1}return-1},unify:function(){return this.convertTo({length:"m",duration:"s",angle:"rad"})},convertTo:function(b){var c,d,e,f,g,h=this.value,i=this.unit.clone(),j={};if("string"==typeof b){for(c in a.UnitConversions)a.UnitConversions[c].hasOwnProperty(b)&&(j={},j[c]=b);b=j}g=function(a,b){return e.hasOwnProperty(a)?(b?h/=e[a]/e[f]:h*=e[a]/e[f],f):a};for(d in b)b.hasOwnProperty(d)&&(f=b[d],e=a.UnitConversions[d],i.map(g));return i.cancel(),new a.Dimension(h,i)}},a.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}},a.Unit=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],this.backupUnit=c},a.Unit.prototype={type:"Unit",clone:function(){return new a.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},genCSS:function(a,b){this.numerator.length>=1?b.add(this.numerator[0]):this.denominator.length>=1?b.add(this.denominator[0]):a&&a.strictUnits||!this.backupUnit||b.add(this.backupUnit)},toCSS:a.toCSS,toString:function(){var a,b=this.numerator.join("*");for(a=0;a0)for(b=0;e>b;b++)this.numerator.push(a);else if(0>e)for(b=0;-e>b;b++)this.denominator.push(a)}0===this.numerator.length&&0===this.denominator.length&&c&&(this.backupUnit=c),this.numerator.sort(),this.denominator.sort()}}}(c("../tree")),function(a){a.Directive=function(b,c,d,e){this.name=b,Array.isArray(c)?(this.rules=[new a.Ruleset(null,c)],this.rules[0].allowImports=!0):this.value=c,this.index=d,this.currentFileInfo=e},a.Directive.prototype={type:"Directive",accept:function(a){this.rules&&(this.rules=a.visitArray(this.rules)),this.value&&(this.value=a.visit(this.value))},genCSS:function(b,c){c.add(this.name,this.currentFileInfo,this.index),this.rules?a.outputRuleset(b,c,this.rules):(c.add(" "),this.value.genCSS(b,c),c.add(";"))},toCSS:a.toCSS,eval:function(b){var c=this;return this.rules&&(b.frames.unshift(this),c=new a.Directive(this.name,null,this.index,this.currentFileInfo),c.rules=[this.rules[0].eval(b)],c.rules[0].root=!0,b.frames.shift()),c},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},markReferenced:function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules[0].rules,a=0;a":" > ","|":"|","^":" ^ ","^^":" ^^ "},_outputMapCompressed:{"":""," ":" ",":":" :","+":"+","~":"~",">":">","|":"|","^":"^","^^":"^^"},genCSS:function(a,b){b.add((a.compress?this._outputMapCompressed:this._outputMap)[this.value])},toCSS:a.toCSS}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={type:"Expression",accept:function(a){this.value&&(this.value=a.visitArray(this.value))},eval:function(b){var c,d=this.parens&&!this.parensInOp,e=!1;return d&&b.inParenthesis(),this.value.length>1?c=new a.Expression(this.value.map(function(a){return a.eval(b)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),c=this.value[0].eval(b)):c=this,d&&b.outOfParenthesis(),this.parens&&this.parensInOp&&!b.isMathOn()&&!e&&(c=new a.Paren(c)),c},genCSS:function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]}}}(c("../tree")),function(a){a.Import=function(a,c,d,e,f){if(this.options=d,this.index=e,this.path=a,this.features=c,this.currentFileInfo=f,this.options.less!==b||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/css([\?;].*)?$/.test(g)&&(this.css=!0)}},a.Import.prototype={type:"Import",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},genCSS:function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},toCSS:a.toCSS,getPath:function(){if(this.path instanceof a.Quoted){var c=this.path.value;return this.css!==b||/(\.[a-z]*$)|([\?;].*)$/.test(c)?c:c+".less"}return this.path instanceof a.URL?this.path.value.value:null},evalForImport:function(b){return new a.Import(this.path.eval(b),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(b){var c=this.path.eval(b),d=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(c instanceof a.URL)){if(d){var e=c.value;e&&b.isPathRelative(e)&&(c.value=d+e)}c.value=b.normalizePath(c.value)}return c},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.skip)return[];if(this.options.inline){var e=new a.Anonymous(this.root,0,{filename:this.importedFilename},!0);return this.features?new a.Media([e],this.features.value):[e]}if(this.css){var f=new a.Import(this.evalPath(b),d,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return c=new a.Ruleset(null,this.root.rules.slice(0)),c.evalImports(b),this.features?new a.Media(c.rules,this.features.value):c.rules}}}(c("../tree")),function(a){a.JavaScript=function(a,b,c){this.escaped=c,this.expression=a,this.index=b},a.JavaScript.prototype={type:"JavaScript",eval:function(b){var c,d=this,e={},f=this.expression.replace(/@\{([\w-]+)\}/g,function(c,e){return a.jsify(new a.Variable("@"+e,d.index).eval(b))});try{f=new Function("return ("+f+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+f+"`",index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(e[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=f.call(e)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",index:this.index}}return"number"==typeof c?new a.Dimension(c):"string"==typeof c?new a.Quoted('"'+c+'"',c,this.escaped,this.index):Array.isArray(c)?new a.Anonymous(c.join(", ")):new a.Anonymous(c)}}}(c("../tree")),function(a){a.Keyword=function(a){this.value=a},a.Keyword.prototype={type:"Keyword",eval:function(){return this},genCSS:function(a,b){b.add(this.value)},toCSS:a.toCSS,compare:function(b){return b instanceof a.Keyword?b.value===this.value?0:1:-1}},a.True=new a.Keyword("true"),a.False=new a.Keyword("false")}(c("../tree")),function(a){a.Media=function(b,c,d,e){this.index=d,this.currentFileInfo=e;var f=this.emptySelectors();this.features=new a.Value(c),this.rules=[new a.Ruleset(f,b)],this.rules[0].allowImports=!0},a.Media.prototype={type:"Media",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},genCSS:function(b,c){c.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(b,c),a.outputRuleset(b,c,this.rules)},toCSS:a.toCSS,eval:function(b){b.mediaBlocks||(b.mediaBlocks=[],b.mediaPath=[]);var c=new a.Media(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,c.debugInfo=this.debugInfo);var d=!1;b.strictMath||(d=!0,b.strictMath=!0);try{c.features=this.features.eval(b)}finally{d&&(b.strictMath=!1)}return b.mediaPath.push(c),b.mediaBlocks.push(c),b.frames.unshift(this.rules[0]),c.rules=[this.rules[0].eval(b)],b.frames.shift(),b.mediaPath.pop(),0===b.mediaPath.length?c.evalTop(b):c.evalNested(b)},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},emptySelectors:function(){var b=new a.Element("","&",this.index,this.currentFileInfo),c=[new a.Selector([b],null,null,this.index,this.currentFileInfo)];return c[0].mediaEmpty=!0,c},markReferenced:function(){var a,b=this.rules[0].rules;for(this.isReferenced=!0,a=0;a1){var d=this.emptySelectors();c=new a.Ruleset(d,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(j=!0,g=0;gh;h++)s.value(h),r[h]=d.matchCondition(e,b);(r[0]||r[1])&&(r[0]!=r[1]&&(l.group=r[1]?u:v),q.push(l))}else q.push(l);p=!0}}for(s.reset(),n=[0,0,0],g=0;g0)m=v;else if(m=u,n[u]+n[v]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(e)+"`",index:this.index,filename:this.currentFileInfo.filename};for(g=0;gthis.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0}}}(c("../tree")),function(a){a.Negative=function(a){this.value=a},a.Negative.prototype={type:"Negative",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("-"),this.value.genCSS(a,b)},toCSS:a.toCSS,eval:function(b){return b.isMathOn()?new a.Operation("*",[new a.Dimension(-1),this.value]).eval(b):new a.Negative(this.value.eval(b))}}}(c("../tree")),function(a){a.Operation=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c},a.Operation.prototype={type:"Operation",accept:function(a){this.operands=a.visit(this.operands)},eval:function(b){var c=this.operands[0].eval(b),d=this.operands[1].eval(b);if(b.isMathOn()){if(c instanceof a.Dimension&&d instanceof a.Color&&(c=c.toColor()),d instanceof a.Dimension&&c instanceof a.Color&&(d=d.toColor()),!c.operate)throw{type:"Operation",message:"Operation on an invalid type"};return c.operate(b,this.op,d)}return new a.Operation(this.op,[c,d],this.isSpaced)},genCSS:function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},toCSS:a.toCSS},a.operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}}}(c("../tree")),function(a){a.Paren=function(a){this.value=a},a.Paren.prototype={type:"Paren",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},toCSS:a.toCSS,eval:function(b){return new a.Paren(this.value.eval(b))}}}(c("../tree")),function(a){a.Quoted=function(a,b,c,d,e){this.escaped=c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e},a.Quoted.prototype={type:"Quoted",genCSS:function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},toCSS:a.toCSS,eval:function(b){var c=this,d=this.value.replace(/`([^`]+)`/g,function(d,e){return new a.JavaScript(e,c.index,!0).eval(b).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var f=new a.Variable("@"+e,c.index,c.currentFileInfo).eval(b,!0);return f instanceof a.Quoted?f.value:f.toCSS()});return new a.Quoted(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1}}}(c("../tree")),function(a){function b(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}a.Rule=function(b,c,d,e,f,g,h){this.name=b,this.value=c instanceof a.Value?c:new a.Value([c]),this.important=d?" "+d.trim():"",this.merge=e,this.index=f,this.currentFileInfo=g,this.inline=h||!1,this.variable=b.charAt&&"@"===b.charAt(0)},a.Rule.prototype={type:"Rule",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},toCSS:a.toCSS,eval:function(c){var d=!1,e=this.name;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof a.Keyword?e[0].value:b(c,e)),"font"!==e||c.strictMath||(d=!0,c.strictMath=!0);try{return new a.Rule(e,this.value.eval(c),this.important,this.merge,this.index,this.currentFileInfo,this.inline)}catch(f){throw f.index=f.index||this.index,f}finally{d&&(c.strictMath=!1)}},makeImportant:function(){return new a.Rule(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)}}}(c("../tree")),function(a){a.Ruleset=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c},a.Ruleset.prototype={type:"Ruleset",accept:function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},eval:function(b){var c,d,e,f=this.selectors,g=a.defaultFunc;if(f&&(d=f.length)){for(c=[],g.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),e=0;d>e;e++)c.push(f[e].eval(b));g.reset()}var h,i,j=this.rules?this.rules.slice(0):null,k=new a.Ruleset(c,j,this.strictImports);k.originalRuleset=this,k.root=this.root,k.firstRoot=this.firstRoot,k.allowImports=this.allowImports,this.debugInfo&&(k.debugInfo=this.debugInfo);var l=b.frames;l.unshift(k);var m=b.selectors;m||(b.selectors=m=[]),m.unshift(this.selectors),(k.root||k.allowImports||!k.strictImports)&&k.evalImports(b);var n=k.rules,o=n?n.length:0;for(e=0;o>e;e++)n[e]instanceof a.mixin.Definition&&(n[e].frames=l.slice(0));var p=b.mediaBlocks&&b.mediaBlocks.length||0;for(e=0;o>e;e++)n[e]instanceof a.mixin.Call&&(j=n[e].eval(b).filter(function(b){return b instanceof a.Rule&&b.variable?!k.variable(b.name):!0}),n.splice.apply(n,[e,1].concat(j)),o+=j.length-1,e+=j.length-1,k.resetCache());for(e=0;eb;b++)c=g[b],(c instanceof d||c instanceof e)&&f.push(c);return f},prependRule:function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},find:function(b,c){c=c||this;var d,e=[],f=b.toCSS();return f in this._lookups?this._lookups[f]:(this.rulesets().forEach(function(f){if(f!==c)for(var g=0;gd?Array.prototype.push.apply(e,f.find(new a.Selector(b.elements.slice(d)),c)):e.push(f);break}}),this._lookups[f]=e,e)},genCSS:function(b,c){var d,e,f,g,h,i,j=[],k=[];b.tabLevel=b.tabLevel||0,this.root||b.tabLevel++;var l,m=b.compress?"":Array(b.tabLevel+1).join(" "),n=b.compress?"":Array(b.tabLevel).join(" ");for(d=0;dd;d++)if(i=p[d],o=i.length)for(d>0&&c.add(l),b.firstSelector=!0,i[0].genCSS(b,c),b.firstSelector=!1,e=1;o>e;e++)i[e].genCSS(b,c);c.add((b.compress?"{":" {\n")+m)}for(d=0;dd;d++)l&&c.add(l),k[d].genCSS(b,c);c.isEmpty()||b.compress||!this.firstRoot||c.add("\n")},toCSS:a.toCSS,markReferenced:function(){for(var a=0;a0&&this.mergeElementsOnToSelectors(r,i),f=0;f0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new a.Element(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;g0?(m=k.slice(0),q=m.pop(),o=d.createDerived(q.elements.slice(0)),p=!1):o=d.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0&&(p=!1,o.elements.push(new a.Element(j.combinator,l[0].elements[0].value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))),p||m.push(o),m=m.concat(n),s.push(m);i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;e0&&b.push(i[e])}else if(c.length>0)for(e=0;e0?e[e.length-1]=e[e.length-1].createDerived(e[e.length-1].elements.concat(b)):e.push(new a.Selector(b))}}}(c("../tree")),function(a){a.Selector=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)},a.Selector.prototype={type:"Selector",accept:function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},createDerived:function(b,c,d){d=null!=d?d:this.evaldCondition;var e=new a.Selector(b,c||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=d,e.mediaEmpty=this.mediaEmpty,e},match:function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},CacheElements:function(){var a,b,c,d="";if(!this._elements){for(a=this.elements.length,c=0;a>c;c++)if(b=this.elements[c],d+=b.combinator.value,b.value.value){if("string"!=typeof b.value.value){d="";break}d+=b.value.value}else d+=b.value;this._elements=d.match(/[,&#\.\w-]([\w-]|(\\.))*/g),this._elements?"&"===this._elements[0]&&this._elements.shift():this._elements=[]}},isJustParentSelector:function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},eval:function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},genCSS:function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;cc;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);f.splice?f.length&&this.flatten(f,e):e.push(f)}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],h.splice?h.length&&this.flatten(h,b):b.push(h);else b.push(e);return b}}}(c("./tree")),function(a){a.importVisitor=function(b,c,d){this._visitor=new a.visitor(this),this._importer=b,this._finish=c,this.env=d||new a.evalEnv,this.importCount=0},a.importVisitor.prototype={isReplacing:!0,run:function(a){var b;try{this._visitor.visit(a)}catch(c){b=c}this.isFinished=!0,0===this.importCount&&this._finish(b)},visitImport:function(b,c){var d,e=this,f=b.options.inline;if(!b.css||f){try{d=b.evalForImport(this.env)}catch(g){g.filename||(g.index=b.index,g.filename=b.currentFileInfo.filename),b.css=!0,b.error=g}if(d&&(!d.css||f)){b=d,this.importCount++;var h=new a.evalEnv(this.env,this.env.frames.slice(0));b.options.multiple&&(h.importMultiple=!0),this._importer.push(b.getPath(),b.currentFileInfo,b.options,function(c,d,g,i){c&&!c.filename&&(c.index=b.index,c.filename=b.currentFileInfo.filename),g&&!h.importMultiple&&(b.skip=g);var j=function(a){e.importCount--,0===e.importCount&&e.isFinished&&e._finish(a)};return!d||(b.root=d,b.importedFilename=i,f||b.skip)?(j(),void 0):(new a.importVisitor(e._importer,j,h).run(d),void 0)})}}return c.visitDeeper=!1,b},visitRule:function(a,b){return b.visitDeeper=!1,a},visitDirective:function(a){return this.env.frames.unshift(a),a},visitDirectiveOut:function(){this.env.frames.shift()},visitMixinDefinition:function(a){return this.env.frames.unshift(a),a},visitMixinDefinitionOut:function(){this.env.frames.shift()},visitRuleset:function(a){return this.env.frames.unshift(a),a},visitRulesetOut:function(){this.env.frames.shift()},visitMedia:function(a){return this.env.frames.unshift(a.ruleset),a},visitMediaOut:function(){this.env.frames.shift()}}}(c("./tree")),function(a){a.joinSelectorVisitor=function(){this.contexts=[[]],this._visitor=new a.visitor(this)},a.joinSelectorVisitor.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}}}(c("./tree")),function(a){a.toCSSVisitor=function(b){this._visitor=new a.visitor(this),this._env=b},a.toCSSVisitor.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?[]:a},visitMixinDefinition:function(){return[]},visitExtend:function(){return[]},visitComment:function(a){return a.isSilent(this._env)?[]:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:[]},visitDirective:function(b){if(b.currentFileInfo.reference&&!b.isReferenced)return[];if("@charset"===b.name){if(this.charset){if(b.debugInfo){var c=new a.Comment("/* "+b.toCSS(this._env).replace(/\n/g,"")+" */\n");return c.debugInfo=b.debugInfo,this._visitor.visit(c)}return[]}this.charset=!0}return b},checkPropertiesInRoot:function(b){for(var c,d=0;d0)&&e.splice(0,0,b);else{b.paths&&(b.paths=b.paths.filter(function(b){var c;for(" "===b[0].elements[0].combinator.value&&(b[0].elements[0].combinator=new a.Combinator("")),c=0;ch;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?b.accept(this._visitor):b.rules=null,c.visitDeeper=!1,f=b.rules,f&&(this._mergeRules(f),f=b.rules),f&&(this._removeDuplicateRules(f),f=b.rules),f&&f.length>0&&b.paths.length>0&&e.splice(0,0,b)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(b){if(b){var c,d,e,f={};for(e=b.length-1;e>=0;e--)if(d=b[e],d instanceof a.Rule)if(f[d.name]){c=f[d.name],c instanceof a.Rule&&(c=f[d.name]=[f[d.name].toCSS(this._env)]);var g=d.toCSS(this._env);-1!==c.indexOf(g)?b.splice(e,1):c.push(g)}else f[d.name]=d}},_mergeRules:function(b){if(b){for(var c,d,e,f={},g=0;g1&&(d=c[0],d.value=new a.Value(c.map(function(a){return a.value})))})}}}}(c("./tree")),function(a){a.extendFinderVisitor=function(){this._visitor=new a.visitor(this),this.contexts=[],this.allExtendsStack=[[]]},a.extendFinderVisitor.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(b){if(!b.root){var c,d,e,f,g=[],h=b.rules,i=h?h.length:0;for(c=0;i>c;c++)b.rules[c]instanceof a.Extend&&(g.push(h[c]),b.extendOnEveryPath=!0);var j=b.paths;for(c=0;c=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&j.selfSelectors.forEach(function(b){h=n.extendSelector(g,i,b),l=new a.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))}));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,c,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;d0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(c.slice(j,h.pathIndex)),l.push(new a.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=c[j].elements.length&&(k=0,j++);return j0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),j++),l=l.concat(c.slice(j,c.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(c("./tree")),function(a){a.sourceMapOutput=function(a){this._css=[],this._rootNode=a.rootNode,this._writeSourceMap=a.writeSourceMap,this._contentsMap=a.contentsMap,this._contentsIgnoredCharsMap=a.contentsIgnoredCharsMap,this._sourceMapFilename=a.sourceMapFilename,this._outputFilename=a.outputFilename,this._sourceMapURL=a.sourceMapURL,a.sourceMapBasepath&&(this._sourceMapBasepath=a.sourceMapBasepath.replace(/\\/g,"/")),this._sourceMapRootpath=a.sourceMapRootpath,this._outputSourceFiles=a.outputSourceFiles,this._sourceMapGeneratorConstructor=a.sourceMapGenerator||c("source-map").SourceMapGenerator,this._sourceMapRootpath&&"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/"),this._lineNumber=0,this._column=0},a.sourceMapOutput.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},a.sourceMapOutput.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;i0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this._sourceMapURL?d=this._sourceMapURL:this._sourceMapFilename&&(d=this.normalizeFilename(this._sourceMapFilename)),this._writeSourceMap?this._writeSourceMap(e):d="data:application/json,"+encodeURIComponent(e),d&&this._css.push("/*# sourceMappingURL="+d+" */") -}return this._css.join("")}}(c("./tree"));var x=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);v.env=v.env||("127.0.0.1"==location.hostname||"0.0.0.0"==location.hostname||"localhost"==location.hostname||location.port&&location.port.length>0||x?"development":"production");var y={info:2,errors:1,none:0};if(v.logLevel="undefined"!=typeof v.logLevel?v.logLevel:y.info,v.async=v.async||!1,v.fileAsync=v.fileAsync||!1,v.poll=v.poll||(x?1e3:1500),v.functions)for(var z in v.functions)v.functions.hasOwnProperty(z)&&(v.tree.functions[z]=v.functions[z]);var A=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);A&&(v.dumpLineNumbers=A[1]);var B=/^text\/(x-)?less$/,C=null,D={};if(v.watch=function(){return v.watchMode||(v.env="development",u()),this.watchMode=!0,!0},v.unwatch=function(){return clearInterval(v.watchTimer),this.watchMode=!1,!1},/!watch/.test(location.hash)&&v.watch(),"development"!=v.env)try{C="undefined"==typeof a.localStorage?null:a.localStorage}catch(E){}var F=document.getElementsByTagName("link");v.sheets=[];for(var G=0;G + * Licensed under the Apache v2 License. + * + */ + + /** * @license Apache v2 + */ + +!function(a,b){function c(b){return a.less[b.split("/")[1]]}function d(a,b){"undefined"!=typeof console&&w.logLevel>=b&&console.log("less: "+a)}function e(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function f(a,c){var e="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,c,d){a.extract[c]!==b&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")):a.stack&&(h+=a.stack),d(h,z.errors)}function g(a,b,c){var f=b.href||"",g="less:"+(b.title||e(f)),h=document.getElementById(g),i=!1,j=document.createElement("style");if(j.setAttribute("type","text/css"),b.media&&j.setAttribute("media",b.media),j.id=g,j.styleSheet)try{j.styleSheet.cssText=a}catch(k){throw new Error("Couldn't reassign styleSheet.cssText.")}else j.appendChild(document.createTextNode(a)),i=null!==h&&h.childNodes.length>0&&j.childNodes.length>0&&h.firstChild.nodeValue===j.firstChild.nodeValue;var l=document.getElementsByTagName("head")[0];if(null===h||i===!1){var m=b&&b.nextSibling||null;m?m.parentNode.insertBefore(j,m):l.appendChild(j)}if(h&&i===!1&&h.parentNode.removeChild(h),c&&D){d("saving "+f+" to cache.",z.info);try{D.setItem(f,a),D.setItem(f+":timestamp",c)}catch(k){d("failed to save",z.errors)}}}function h(a){return w.postProcessor&&"function"==typeof w.postProcessor&&(a=w.postProcessor.call(a,a)||a),a}function i(a,c){var d,f,h="less-error-message:"+e(c||""),i='
  • {content}
  • ',j=document.createElement("div"),k=[],l=a.filename||c,m=l.match(/([^\/]+(\?.*)?)$/)[1];j.id=h,j.className="less-error-message",f="

    "+(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+'

    in '+m+" ";var n=function(a,c,d){a.extract[c]!==b&&k.push(i.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(n(a,0,""),n(a,1,"line"),n(a,2,""),f+="on line "+a.line+", column "+(a.column+1)+":

      "+k.join("")+"
    "):a.stack&&(f+="
    "+a.stack.split("\n").slice(1).join("
    ")),j.innerHTML=f,g([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),j.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"==w.env&&(d=setInterval(function(){document.body&&(document.getElementById(h)?document.body.replaceChild(j,document.getElementById(h)):document.body.insertBefore(j,document.body.firstChild),clearInterval(d))},10))}function j(a,b){w.errorReporting&&"html"!==w.errorReporting?"console"===w.errorReporting?f(a,b):"function"==typeof w.errorReporting&&w.errorReporting("add",a,b):i(a,b)}function k(a){var b=document.getElementById("less-error-message:"+e(a));b&&b.parentNode.removeChild(b)}function l(){}function m(a){w.errorReporting&&"html"!==w.errorReporting?"console"===w.errorReporting?l(a):"function"==typeof w.errorReporting&&w.errorReporting("remove",a):k(a)}function n(a){for(var b,c=document.getElementsByTagName("style"),d=0;d0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=f[1]+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g}function p(a,b){var c,d,e,f,g=o(a),h=o(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;c=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var g=q(),h=y?w.fileAsync:w.async;"function"==typeof g.overrideMimeType&&g.overrideMimeType("text/css"),d("XHR: Getting '"+a+"'",z.debug),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),y&&!w.fileAsync?0===g.status||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){4==g.readyState&&f(g,c,e)}:f(g,c,e)}function s(b,c,d,e){c&&c.currentDirectory&&!/^([a-z-]+:)?\//.test(b)&&(b=c.currentDirectory+b);var f=o(b,a.location.href),g=f.url,h={currentDirectory:f.path,filename:g};if(c?(h.entryPath=c.entryPath,h.rootpath=c.rootpath,h.rootFilename=c.rootFilename,h.relativeUrls=c.relativeUrls):(h.entryPath=f.path,h.rootpath=w.rootpath||f.path,h.rootFilename=g,h.relativeUrls=e.relativeUrls),h.relativeUrls&&(h.rootpath=e.rootpath?o(e.rootpath+p(f.path,h.entryPath)).path:f.path),e.useFileCache&&E[g])try{var i=E[g];d(null,i,g,h,{lastModified:new Date})}catch(j){d(j,null,g)}else r(g,e.mime,function(a,b){E[g]=a;try{d(null,a,g,h,{lastModified:b})}catch(c){d(c,null,g)}},function(a,b){d({type:"File",message:"'"+b+"' wasn't found ("+a+")"},null,g)})}function t(a,b,c,d,e){var f=new w.tree.parseEnv(w);f.mime=a.type,(e||w.globalVars)&&(f.useFileCache=!0),s(a.href,null,function(h,i,j,k,l){if(l){l.remaining=d;var n=D&&D.getItem(j),o=D&&D.getItem(j+":timestamp");if(!c&&o&&l.lastModified&&new Date(l.lastModified).valueOf()===new Date(o).valueOf())return g(n,a),l.local=!0,void b(null,null,i,a,l,j)}m(j),i?(f.currentFileInfo=k,new w.Parser(f).parse(i,function(c,d){if(c)return b(c,null,null,a);try{b(c,d,i,a,l,j)}catch(c){b(c,null,null,a)}},{modifyVars:e,globalVars:w.globalVars})):b(h,null,null,a,l,j)},f,e)}function u(a,b,c){for(var d=0;dD&&(C=C.slice(y-D),D=y)}function h(a,b){var c=a.charCodeAt(0|b);return 32>=c&&(32===c||10===c||9===c)}function i(a){var b,c,d=typeof a;return"string"===d?v.charAt(y)!==a?null:(l(1),a):(g(),(b=a.exec(C))?(c=b[0].length,l(c),"string"==typeof b?b:1===b.length?b[0]:b):null)}function j(a){y>D&&(C=C.slice(y-D),D=y);var b=a.exec(C);return b?(l(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null}function k(a){return v.charAt(y)!==a?null:(l(1),a)}function l(a){for(var b,c=y,d=z,e=y-D,f=y+C.length-e,g=y+=a,h=v;f>y&&(b=h.charCodeAt(y),!(b>32))&&(32===b||10===b||9===b||13===b);y++);return C=C.slice(a+y-g+e),D=y,!C.length&&z=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}function t(a,b,d){var e=d.currentFileInfo.filename;return"browser"!==w.mode&&"rhino"!==w.mode&&(e=c("path").resolve(e)),{lineNumber:s(a,b).line+1,fileName:e}}function u(a,b){var c=r(a,b),d=s(a.index,c),e=d.line,f=d.column,g=a.call&&s(a.call,c).line,h=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.currentFileInfo.filename,this.index=a.index,this.line="number"==typeof e?e+1:null,this.callLine=g+1,this.callExtract=h[g],this.stack=a.stack,this.column=f,this.extract=[h[e-1],h[e],h[e+1]]}var v,y,z,A,B,C,D,E,F,G=[],H=a&&a.filename;a instanceof x.parseEnv||(a=new x.parseEnv(a));var I=this.imports={paths:a.paths||[],queue:[],files:a.files,contents:a.contents,contentsIgnoredChars:a.contentsIgnoredChars,mime:a.mime,error:null,push:function(b,c,d,e){var f=this;this.queue.push(b);var g=function(a,c,d){f.queue.splice(f.queue.indexOf(b),1);var g=d===H;f.files[d]=c,a&&!f.error&&(f.error=a),e(a,c,g,d)};w.Parser.importer?w.Parser.importer(b,c,g,a):w.Parser.fileLoader(b,c,function(b,e,f,h){if(b)return void g(b);var i=new x.parseEnv(a);i.currentFileInfo=h,i.processImports=!1,i.contents[f]=e,(c.reference||d.reference)&&(h.reference=!0),d.inline?g(null,e,f):new w.Parser(i).parse(e,function(a,b){g(a,b,f)})},a)}},J=j;return u.prototype=new Error,u.prototype.constructor=u,this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,E={imports:I,parse:function(d,e,f){var g,h,i,j,k,l=null,m="";if(y=z=D=A=0,j=f&&f.globalVars?w.Parser.serializeVars(f.globalVars)+"\n":"",k=f&&f.modifyVars?"\n"+w.Parser.serializeVars(f.modifyVars):"",(j||f&&f.banner)&&(m=(f&&f.banner?f.banner:"")+j,E.imports.contentsIgnoredChars[a.currentFileInfo.filename]=m.length),d=d.replace(/\r\n/g,"\n"),v=d=m+d.replace(/^\uFEFF/,"")+k,E.imports.contents[a.currentFileInfo.filename]=d,B=function(b){function c(b,c){l=new u({index:c||i,type:"Parse",message:b,filename:a.currentFileInfo.filename},a)}function d(a){var c=i-s;512>c&&!a||!c||(r.push(b.slice(s,i+1)),s=i+1)}var e,f,g,h,i,j,k,m,n,o=b.length,p=0,q=0,r=[],s=0;for(i=0;o>i;i++)if(k=b.charCodeAt(i),!(k>=97&&122>=k||34>k))switch(k){case 40:q++,f=i;continue;case 41:if(--q<0)return c("missing opening `(`");continue;case 59:q||d();continue;case 123:p++,e=i;continue;case 125:if(--p<0)return c("missing opening `{`");p||q||d();continue;case 92:if(o-1>i){i++;continue}return c("unescaped `\\`");case 34:case 39:case 96:for(n=0,j=i,i+=1;o>i;i++)if(m=b.charCodeAt(i),!(m>96)){if(m==k){n=1;break}if(92==m){if(i==o-1)return c("unescaped `\\`");i++}}if(n)continue;return c("unmatched `"+String.fromCharCode(k)+"`",j);case 47:if(q||i==o-1)continue;if(m=b.charCodeAt(i+1),47==m)for(i+=2;o>i&&(m=b.charCodeAt(i),!(13>=m)||10!=m&&13!=m);i++);else if(42==m){for(g=j=i,i+=2;o-1>i&&(m=b.charCodeAt(i),125==m&&(h=i),42!=m||47!=b.charCodeAt(i+1));i++);if(i==o-1)return c("missing closing `*/`",j);i++}continue;case 42:if(o-1>i&&47==b.charCodeAt(i+1))return c("unmatched `/*`");continue}return 0!==p?g>e&&h>g?c("missing closing `}` or `*/`",e):c("missing closing `}`",e):0!==q?c("missing closing `)`",f):(d(!0),r)}(d),l)return e(new u(l,a));C=B[0];try{g=new x.Ruleset(null,this.parsers.primary()),g.root=!0,g.firstRoot=!0}catch(n){return e(new u(n,a))}if(g.toCSS=function(d){return function(e,f){e=e||{};var g,h,i=new x.evalEnv(e);"object"!=typeof f||Array.isArray(f)||(f=Object.keys(f).map(function(a){var b=f[a];return b instanceof x.Value||(b instanceof x.Expression||(b=new x.Expression([b])),b=new x.Value([b])),new x.Rule("@"+a,b,!1,null,0)}),i.frames=[new x.Ruleset(null,f)]);try{var j,k=[],l=[new x.joinSelectorVisitor,new x.processExtendsVisitor,new x.toCSSVisitor({compress:Boolean(e.compress)})],m=this;if(e.plugins)for(j=0;j57||43>b||47===b||44==b))return a=j(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/),a?new x.Dimension(a[1],a[2]):void 0},unicodeDescriptor:function(){var a;return a=j(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new x.UnicodeDescriptor(a[0]):void 0},javascript:function(){var c,d,e=y;return"~"===v.charAt(e)&&(e++,d=!0),"`"===v.charAt(e)?(a.javascriptEnabled===b||a.javascriptEnabled||o("You are using JavaScript, which has been disabled."),d&&k("~"),c=j(/^`([^`]*)`/),c?new x.JavaScript(c[1],y,d):void 0):void 0}},variable:function(){var a;return"@"===v.charAt(y)&&(a=j(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===v.charAt(y)&&(a=j(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new x.RulesetCall(a[1]):void 0},extend:function(a){var b,c,d,e,f,g=y;if(j(a?/^&:extend\(/:/^:extend\(/)){do{for(d=null,b=null;!(d=j(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];d=d&&d[1],f=new x.Extend(new x.Selector(b),d,g),e?e.push(f):e=[f]}while(k(","));return m(/^\)/),a&&m(/^;/),e}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var b,c,g,h,i,l,m=v.charAt(y),o=!1,p=y;if("."===m||"#"===m){for(d();;){if(b=y,h=j(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!h)break;g=new x.Element(i,h,b,a.currentFileInfo),c?c.push(g):c=[g],i=k(">")}return c&&(k("(")&&(l=this.args(!0).args,n(")")),F.important()&&(o=!0),F.end())?(f(),new x.mixin.Call(c,l,p,a.currentFileInfo,o)):void e()}},args:function(a){var b,c,g,h,i,l,m=E.parsers,n=m.entities,p={args:null,variadic:!1},q=[],r=[],s=[];for(d();;){if(a)l=m.detachedRuleset()||m.expression();else{if(m.comments(),"."===v.charAt(y)&&j(/^\.{3}/)){p.variadic=!0,k(";")&&!b&&(b=!0),(b?r:s).push({variadic:!0});break}l=n.variable()||n.literal()||n.keyword()}if(!l)break;h=null,l.throwAwayComments&&l.throwAwayComments(),i=l;var t=null;if(a?l.value&&1==l.value.length&&(t=l.value[0]):t=l,t&&t instanceof x.Variable)if(k(":")){if(q.length>0&&(b&&o("Cannot mix ; and , as delimiter types"),c=!0),i=a&&m.detachedRuleset()||m.expression(),!i){if(!a)return e(),p.args=[],p;o("could not understand value for named argument")}h=g=t.name}else{if(!a&&j(/^\.{3}/)){p.variadic=!0,k(";")&&!b&&(b=!0),(b?r:s).push({name:l.name,variadic:!0});break}a||(g=h=t.name,i=null)}i&&q.push(i),s.push({name:h,value:i}),k(",")||(k(";")||b)&&(c&&o("Cannot mix ; and , as delimiter types"),b=!0,q.length>1&&(i=new x.Value(q)),r.push({name:g,value:i}),g=null,q=[],c=!1)}return f(),p.args=b?r:s,p},definition:function(){var a,b,c,g,h=[],i=!1;if(!("."!==v.charAt(y)&&"#"!==v.charAt(y)||p(/^[^{]*\}/)))if(d(),b=j(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var l=this.args(!1);if(h=l.args,i=l.variadic,!k(")"))return A=y,void e();if(F.comments(),j(/^when/)&&(g=m(F.conditions,"expected condition")),c=F.block())return f(),new x.mixin.Definition(a,h,c,g,i);e()}else f()}},entity:function(){var a=this.entities;return a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()||this.comment()},end:function(){return k(";")||q("}")},alpha:function(){var a;if(j(/^\(opacity=/i))return a=j(/^\d+/)||this.entities.variable(),a?(n(")"),new x.Alpha(a)):void 0},element:function(){var b,c,g,h=y;return c=this.combinator(),b=j(/^(?:\d+\.\d+|\d+)%/)||j(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||k("*")||k("&")||this.attribute()||j(/^\([^()@]+\)/)||j(/^[\.#](?=@)/)||this.entities.variableCurly(),b||(d(),k("(")?(g=this.selector())&&k(")")?(b=new x.Paren(g),f()):e():f()),b?new x.Element(c,b,h,a.currentFileInfo):void 0},combinator:function(){var a=v.charAt(y);if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(y++,"^"===v.charAt(y)&&(a="^^",y++);h(v,y);)y++;return new x.Combinator(a)}return new x.Combinator(h(v,y-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(b){for(var c,d,e,f,g,h,i,j=y,k=J;(b&&(g=this.extend())||b&&(h=k(/^when/))||(f=this.element()))&&(h?i=m(this.conditions,"expected condition"):i?o("CSS guard can only be used at the end of selector"):g?d?d.push(g):d=[g]:(d&&o("Extend can only be used at the end of selector"),e=v.charAt(y),c?c.push(f):c=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return c?new x.Selector(c,d,i,j,a.currentFileInfo):void(d&&o("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(k("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=m(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=j(/^[|~*$^]?=/),c&&(b=d.quoted()||j(/^[0-9]+%/)||j(/^[\w-]+/)||d.variableCurly()),n("]"),new x.Attribute(a,c,b)}},block:function(){var a;return k("{")&&(a=this.primary())&&k("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new x.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new x.DetachedRuleset(a):void 0},ruleset:function(){var b,c,g,h;for(d(),a.dumpLineNumbers&&(h=t(y,v,a));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],this.comments(),c.condition&&b.length>1&&o("Guards are only currently allowed on a single selector."),!k(","))break;c.condition&&o("Guards are only currently allowed on a single selector."),this.comments()}if(b&&(g=this.block())){f();var i=new x.Ruleset(b,g,a.strictImports);return a.dumpLineNumbers&&(i.debugInfo=h),i}A=y,e()},rule:function(b){var c,g,h,i,j,k=y,l=v.charAt(k);if("."!==l&&"#"!==l&&"&"!==l)if(d(),c=this.variable()||this.ruleProperty()){if(j="string"==typeof c,j&&(g=this.detachedRuleset()),g||(g=b||!a.compress&&!j?this.anonymousValue()||this.value():this.value()||this.anonymousValue(),h=this.important(),i=!j&&c.pop().value),g&&this.end())return f(),new x.Rule(c,g,h,i,k,a.currentFileInfo);if(A=y,e(),g&&!b)return this.rule(!0)}else f()},anonymousValue:function(){var a;return a=/^([^@+\/'"*`(;{}-]*);/.exec(C),a?(y+=a[0].length-1,new x.Anonymous(a[1])):void 0},"import":function(){var b,c,g=y;d();var h=j(/^@import?\s+/),i=(h?this.importOptions():null)||{};return h&&(b=this.entities.quoted()||this.entities.url())&&(c=this.mediaFeatures(),k(";"))?(f(),c=c&&new x.Value(c),new x.Import(b,c,i,g,a.currentFileInfo)):void e()},importOptions:function(){var a,b,c,d={};if(!k("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!k(","))break}while(a);return n(")"),d},importOption:function(){var a=j(/^(less|css|multiple|once|inline|reference)/);return a?a[1]:void 0},mediaFeature:function(){var b,c,d=this.entities,e=[];do if(b=d.keyword()||d.variable())e.push(b);else if(k("(")){if(c=this.property(),b=this.value(),!k(")"))return null;if(c&&b)e.push(new x.Paren(new x.Rule(c,b,null,null,y,a.currentFileInfo,!0)));else{if(!b)return null;e.push(new x.Paren(b))}}while(b);return e.length>0?new x.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!k(","))break}else if(a=b.variable(),a&&(c.push(a),!k(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,d,e;return a.dumpLineNumbers&&(e=t(y,v,a)),j(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(d=new x.Media(c,b,y,a.currentFileInfo),a.dumpLineNumbers&&(d.debugInfo=e),d):void 0},directive:function(){var b,c,g,h,i,l,m,n=y,p=!0;if("@"===v.charAt(y)){if(c=this["import"]()||this.media())return c;if(d(),b=j(/^@[a-z-]+/)){switch(h=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(h="@"+b.slice(b.indexOf("-",2)+1)),h){case"@charset":i=!0,p=!1;break;case"@namespace":l=!0,p=!1;break;case"@keyframes":i=!0;break;case"@host":case"@page":case"@document":case"@supports":m=!0}return i?(c=this.entity(),c||o("expected "+b+" identifier")):l?(c=this.expression(),c||o("expected "+b+" expression")):m&&(c=(j(/^[^{;]+/)||"").trim(),c&&(c=new x.Anonymous(c))),p&&(g=this.blockRuleset()),g||!p&&c&&k(";")?(f(),new x.Directive(b,c,g,n,a.currentFileInfo,a.dumpLineNumbers?t(n,v,a):null)):void e()}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!k(",")))break;while(a);return b.length>0?new x.Value(b):void 0},important:function(){return"!"===v.charAt(y)?j(/^! *important/):void 0},sub:function(){var a,b;return k("(")&&(a=this.addition())?(b=new x.Expression([a]),n(")"),b.parens=!0,b):void 0},multiplication:function(){var a,b,c,d,e;if(a=this.operand()){for(e=h(v,y-1);;){if(p(/^\/[*\/]/))break;if(c=k("/")||k("*"),!c)break;if(b=this.operand(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new x.Operation(c,[d||a,b],e),e=h(v,y-1)}return d||a}},addition:function(){var a,b,c,d,e;if(a=this.multiplication()){for(e=h(v,y-1);;){if(c=j(/^[-+]\s+/)||!e&&(k("+")||k("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new x.Operation(c,[d||a,b],e),e=h(v,y-1)}return d||a}},conditions:function(){var a,b,c,d=y;if(a=this.condition()){for(;;){if(!p(/^,\s*(not\s*)?\(/)||!k(","))break;if(b=this.condition(),!b)break;c=new x.Condition("or",c||a,b,d)}return c||a}},condition:function(){var a,b,c,d,e=this.entities,f=y,g=!1;return j(/^not/)&&(g=!0),n("("),a=this.addition()||e.keyword()||e.quoted(),a?(d=j(/^(?:>=|<=|=<|[<=>])/),d?(b=this.addition()||e.keyword()||e.quoted(),b?c=new x.Condition(d,a,b,f,g):o("expected expression")):c=new x.Condition("=",a,new x.Keyword("true"),f,g),n(")"),j(/^and/)?new x.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities,c=v.charAt(y+1);"-"!==v.charAt(y)||"@"!==c&&"("!==c||(a=k("-"));var d=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(d.parensInOp=!0,d=new x.Negative(d)),d},expression:function(){var a,b,c=[];do a=this.addition()||this.entity(),a&&(c.push(a),p(/^\/[\/*]/)||(b=k("/"),b&&c.push(new x.Anonymous(b))));while(a);return c.length>0?new x.Expression(c):void 0},property:function(){var a=j(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function b(a){var b=a.exec(e);return b?(g.push(y+h),h+=b[0].length,e=e.slice(b[1].length),f.push(b[1])):void 0}var c,d,e=C,f=[],g=[],h=0;for(b(/^(\*?)/);b(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/););if(f.length>1&&b(/^\s*((?:\+_|\+)?)\s*:/)){for(l(h),""===f[0]&&(f.shift(),g.shift()),d=0;dl;l++)e=b.rgb[l]/255,f=c.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new d.Color(k,g)}function g(){var a,b=d.functions;for(a in l)l.hasOwnProperty(a)&&(b[a]=e.bind(null,Math[a],l[a]));for(a in m)m.hasOwnProperty(a)&&(b[a]=f.bind(null,m[a]));a=d.defaultFunc,b["default"]=a.eval.bind(a)}function h(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function i(a,b){return a instanceof d.Dimension&&a.unit.is("%")?parseFloat(a.value*b/100):j(a)}function j(a){if(a instanceof d.Dimension)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function k(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(a,b,c,e){var f=[a,b,c].map(function(a){return i(a,255)});return e=j(e),new d.Color(f,e)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,c,d){function e(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?g+(f-g)*a*6:1>2*a?f:2>3*a?g+(f-g)*(2/3-a)*6:g}a=j(a)%360/360,b=k(j(b)),c=k(j(c)),d=k(j(d));var f=.5>=c?c*(b+1):c+b-c*b,g=2*c-f;return this.rgba(255*e(a+1/3),255*e(a),255*e(a-1/3),d)},hsv:function(a,b,c){return this.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=j(a)%360/360*360,b=j(b),c=j(c),d=j(d);var e,f;e=Math.floor(a/60%6),f=a/60-e;var g=[c,c*(1-b),c*(1-f*b),c*(1-(1-f)*b)],h=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(255*g[h[e][0]],255*g[h[e][1]],255*g[h[e][2]],d)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},saturation:function(a){return new d.Dimension(Math.round(100*a.toHSL().s),"%")},lightness:function(a){return new d.Dimension(Math.round(100*a.toHSL().l),"%")},hsvhue:function(a){return new d.Dimension(Math.round(a.toHSV().h))},hsvsaturation:function(a){return new d.Dimension(Math.round(100*a.toHSV().s),"%")},hsvvalue:function(a){return new d.Dimension(Math.round(100*a.toHSV().v),"%")},red:function(a){return new d.Dimension(a.rgb[0])},green:function(a){return new d.Dimension(a.rgb[1])},blue:function(a){return new d.Dimension(a.rgb[2])},alpha:function(a){return new d.Dimension(a.toHSL().a)},luma:function(a){return new d.Dimension(Math.round(a.luma()*a.alpha*100),"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new d.Dimension(Math.round(b*a.alpha*100),"%")},saturate:function(a,b){if(!a.rgb)return null;var c=a.toHSL();return c.s+=b.value/100,c.s=k(c.s),h(c)},desaturate:function(a,b){var c=a.toHSL();return c.s-=b.value/100,c.s=k(c.s),h(c)},lighten:function(a,b){var c=a.toHSL();return c.l+=b.value/100,c.l=k(c.l),h(c)},darken:function(a,b){var c=a.toHSL();return c.l-=b.value/100,c.l=k(c.l),h(c)},fadein:function(a,b){var c=a.toHSL();return c.a+=b.value/100,c.a=k(c.a),h(c)},fadeout:function(a,b){var c=a.toHSL();return c.a-=b.value/100,c.a=k(c.a),h(c)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=k(c.a),h(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=0>d?360+d:d,h(c)},mix:function(a,b,c){c||(c=new d.Dimension(50));var e=c.value/100,f=2*e-1,g=a.toHSL().a-b.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[a.rgb[0]*h+b.rgb[0]*i,a.rgb[1]*h+b.rgb[1]*i,a.rgb[2]*h+b.rgb[2]*i],k=a.alpha*e+b.alpha*(1-e);return new d.Color(j,k)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=this.rgba(255,255,255,1)),"undefined"==typeof b&&(b=this.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:j(d),a.luma()i.value)&&(m[f]=g);else{if(k!==b&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(c[e].value)&&Array.prototype.push.apply(c,Array.prototype.slice.call(c[e].value));return 1==m.length?m[0]:(c=m.map(function(a){return a.toCSS(this.env)}).join(this.env.compress?",":", "),new d.Anonymous((a?"min":"max")+"("+c+")"))},min:function(){return this._minmax(!0,arguments)},max:function(){return this._minmax(!1,arguments)},"get-unit":function(a){return new d.Anonymous(a.unit)},argb:function(a){return new d.Anonymous(a.toARGB())},percentage:function(a){return new d.Dimension(100*a.value,"%")},color:function(a){if(a instanceof d.Quoted){var b,c=a.value;if(b=d.Color.fromKeyword(c))return b;if(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(c))return new d.Color(c.slice(1));throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}}throw{type:"Argument",message:"argument must be a string"}},iscolor:function(a){return this._isa(a,d.Color)},isnumber:function(a){return this._isa(a,d.Dimension)},isstring:function(a){return this._isa(a,d.Quoted)},iskeyword:function(a){return this._isa(a,d.Keyword)},isurl:function(a){return this._isa(a,d.URL)},ispixel:function(a){return this.isunit(a,"px")},ispercentage:function(a){return this.isunit(a,"%")},isem:function(a){return this.isunit(a,"em")},isunit:function(a,b){return a instanceof d.Dimension&&a.unit.is(b.value||b)?d.True:d.False},_isa:function(a,b){return a instanceof b?d.True:d.False},tint:function(a,b){return this.mix(this.rgb(255,255,255),a,b)},shade:function(a,b){return this.mix(this.rgb(0,0,0),a,b)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new d.Dimension(b)},"data-uri":function(b,e){if("undefined"!=typeof a)return new d.URL(e||b,this.currentFileInfo).eval(this.env);var f=b.value,g=e&&e.value,h=c("fs"),i=c("path"),j=!1;if(arguments.length<2&&(g=f),this.env.isPathRelative(g)&&(g=this.currentFileInfo.relativeUrls?i.join(this.currentFileInfo.currentDirectory,g):i.join(this.currentFileInfo.entryPath,g)),arguments.length<2){var k;try{k=c("mime")}catch(l){k=d._mime}f=k.lookup(g);var m=k.charsets.lookup(f);j=["US-ASCII","UTF-8"].indexOf(m)<0,j&&(f+=";base64")}else j=/;base64$/.test(f);var n=h.readFileSync(g),o=32,p=parseInt(n.length/1024,10);if(p>=o&&this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",g,p,o),new d.URL(e||b,this.currentFileInfo).eval(this.env);n=j?n.toString("base64"):encodeURIComponent(n);var q='"data:'+f+","+n+'"';return new d.URL(new d.Anonymous(q))},"svg-gradient":function(a){function e(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}arguments.length<3&&e();var f,g,h,i,j,k,l,m=Array.prototype.slice.call(arguments,1),n="linear",o='x="0" y="0" width="1" height="1"',p=!0,q={compress:!1},r=a.toCSS(q);switch(r){case"to bottom":f='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":f='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":f='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":f='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":n="radial",f='cx="50%" cy="50%" r="75%"',o='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(g='<'+n+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+f+">",h=0;hl?' stop-opacity="'+l+'"':"")+"/>";if(g+="',p)try{g=c("./encoder").encodeBase64(g)}catch(s){p=!1}return g="'data:image/svg+xml"+(p?";base64":"")+","+g+"'",new d.URL(new d.Anonymous(g))}},d._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(a){var e=c("path").extname(a),f=d._mime._types[e];if(f===b)throw new Error('Optional dependency "mime" is required for '+e);return f},charsets:{lookup:function(a){return a&&/^text\//.test(a)?"UTF-8":""}}};var l={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"},m={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?m.multiply(a,b):m.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return m.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};d.defaultFunc={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?d.True:d.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}},g(),d.fround=function(a,b){var c;return a&&null!=a.numPrecision?(c=Math.pow(10,a.numPrecision),Math.round(b*c)/c):b},d.functionCall=function(a,b){this.env=a,this.currentFileInfo=b},d.functionCall.prototype=d.functions}(c("./tree")),function(a){a.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(c("./tree")),function(a){a.debugInfo=function(b,c,d){var e="";if(b.dumpLineNumbers&&!b.compress)switch(b.dumpLineNumbers){case"comments":e=a.debugInfo.asComment(c);break;case"mediaquery":e=a.debugInfo.asMediaQuery(c);break;case"all":e=a.debugInfo.asComment(c)+(d||"")+a.debugInfo.asMediaQuery(c)}return e},a.debugInfo.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},a.debugInfo.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},a.find=function(a,b){for(var c,d=0;d1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)},a.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},a.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--}}(c("./tree")),function(a){a.Alpha=function(a){this.value=a},a.Alpha.prototype={type:"Alpha",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Alpha(this.value.eval(b)):this},genCSS:function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},toCSS:a.toCSS}}(c("../tree")),function(a){a.Anonymous=function(a,b,c,d){this.value=a.value||a,this.index=b,this.mapLines=d,this.currentFileInfo=c},a.Anonymous.prototype={type:"Anonymous",eval:function(){return new a.Anonymous(this.value,this.index,this.currentFileInfo,this.mapLines)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1},genCSS:function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Assignment=function(a,b){this.key=a,this.value=b},a.Assignment.prototype={type:"Assignment",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Assignment(this.key,this.value.eval(b)):this},genCSS:function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Call=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d},a.Call.prototype={type:"Call",accept:function(a){this.args&&(this.args=a.visitArray(this.args))},eval:function(b){var c,d,e=this.args.map(function(a){return a.eval(b)}),f=this.name.toLowerCase();if(f in a.functions)try{if(d=new a.functionCall(b,this.currentFileInfo),c=d[f].apply(d,e),null!=c)return c}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new a.Call(this.name,e,this.index,this.currentFileInfo)},genCSS:function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;ca?"0":"")+a.toString(16)}).join("")}function c(a,b){return Math.min(Math.max(a,0),b)}a.Color=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};var d="transparent";a.Color.prototype={type:"Color",eval:function(){return this},luma:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},genCSS:function(a,b){b.add(this.toCSS(a))},toCSS:function(b,e){var f=b&&b.compress&&!e,g=a.fround(b,this.alpha);if(1>g)return 0===g&&this.isTransparentKeyword?d:"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(g,1)).join(","+(f?"":" "))+")";var h=this.toRGB();if(f){var i=h.split("");i[1]===i[2]&&i[3]===i[4]&&i[5]===i[6]&&(h="#"+i[1]+i[3]+i[5])}return h},operate:function(b,c,d){for(var e=[],f=this.alpha*(1-d.alpha)+d.alpha,g=0;3>g;g++)e[g]=a.operate(b,c,this.rgb[g],d.rgb[g]);return new a.Color(e,f)},toRGB:function(){return b(this.rgb)},toHSL:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},toHSV:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},toARGB:function(){return b([255*this.alpha].concat(this.rgb))},compare:function(a){return a.rgb?a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:-1:-1}},a.Color.fromKeyword=function(b){if(b=b.toLowerCase(),a.colors.hasOwnProperty(b))return new a.Color(a.colors[b].slice(1));if(b===d){var c=new a.Color([0,0,0],0);return c.isTransparentKeyword=!0,c}}}(c("../tree")),function(a){a.Comment=function(a,b,c,d){this.value=a,this.silent=!!b,this.currentFileInfo=d},a.Comment.prototype={type:"Comment",genCSS:function(b,c){this.debugInfo&&c.add(a.debugInfo(b,this),this.currentFileInfo,this.index),c.add(this.value.trim())},toCSS:a.toCSS,isSilent:function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&!this.value.match(/^\/\*!/);return this.silent||b||c},eval:function(){return this},markReferenced:function(){this.isReferenced=!0}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype={type:"Condition",accept:function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},eval:function(a){var b,c=this.lvalue.eval(a),d=this.rvalue.eval(a),e=this.index;return b=function(a){switch(a){case"and":return c&&d;case"or":return c||d;default:if(c.compare)b=c.compare(d);else{if(!d.compare)throw{type:"Type",message:"Unable to perform comparison",index:e};b=d.compare(c)}switch(b){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a}}}(this.op),this.negate?!b:b}}}(c("../tree")),function(a){a.DetachedRuleset=function(a,b){this.ruleset=a,this.frames=b},a.DetachedRuleset.prototype={type:"DetachedRuleset",accept:function(a){this.ruleset=a.visit(this.ruleset)},eval:function(b){var c=this.frames||b.frames.slice(0);return new a.DetachedRuleset(this.ruleset,c)},callEval:function(b){return this.ruleset.eval(this.frames?new a.evalEnv(b,this.frames.concat(b.frames)):b)}}}(c("../tree")),function(a){a.Dimension=function(c,d){this.value=parseFloat(c),this.unit=d&&d instanceof a.Unit?d:new a.Unit(d?[d]:b)},a.Dimension.prototype={type:"Dimension",accept:function(a){this.unit=a.visit(this.unit)},eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},genCSS:function(b,c){if(b&&b.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var d=a.fround(b,this.value),e=String(d);if(0!==d&&1e-6>d&&d>-1e-6&&(e=d.toFixed(20).replace(/0+$/,"")),b&&b.compress){if(0===d&&this.unit.isLength())return void c.add(e);d>0&&1>d&&(e=e.substr(1))}c.add(e),this.unit.genCSS(b,c)},toCSS:a.toCSS,operate:function(b,c,d){var e=a.operate(b,c,this.value,d.value),f=this.unit.clone();if("+"===c||"-"===c)if(0===f.numerator.length&&0===f.denominator.length)f.numerator=d.unit.numerator.slice(0),f.denominator=d.unit.denominator.slice(0);else if(0===d.unit.numerator.length&&0===f.denominator.length);else{if(d=d.convertTo(this.unit.usedUnits()),b.strictUnits&&d.unit.toString()!==f.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+f.toString()+"' and '"+d.unit.toString()+"'.");e=a.operate(b,c,this.value,d.value)}else"*"===c?(f.numerator=f.numerator.concat(d.unit.numerator).sort(),f.denominator=f.denominator.concat(d.unit.denominator).sort(),f.cancel()):"/"===c&&(f.numerator=f.numerator.concat(d.unit.denominator).sort(),f.denominator=f.denominator.concat(d.unit.numerator).sort(),f.cancel());return new a.Dimension(e,f)},compare:function(b){if(b instanceof a.Dimension){var c,d,e,f;if(this.unit.isEmpty()||b.unit.isEmpty())c=this,d=b;else if(c=this.unify(),d=b.unify(),0!==c.unit.compare(d.unit))return-1;return e=c.value,f=d.value,f>e?-1:e>f?1:0}return-1},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(b){var c,d,e,f,g,h=this.value,i=this.unit.clone(),j={};if("string"==typeof b){for(c in a.UnitConversions)a.UnitConversions[c].hasOwnProperty(b)&&(j={},j[c]=b);b=j}g=function(a,b){return e.hasOwnProperty(a)?(b?h/=e[a]/e[f]:h*=e[a]/e[f],f):a};for(d in b)b.hasOwnProperty(d)&&(f=b[d],e=a.UnitConversions[d],i.map(g));return i.cancel(),new a.Dimension(h,i)}},a.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}},a.Unit=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],this.backupUnit=c},a.Unit.prototype={type:"Unit",clone:function(){return new a.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},genCSS:function(a,b){this.numerator.length>=1?b.add(this.numerator[0]):this.denominator.length>=1?b.add(this.denominator[0]):a&&a.strictUnits||!this.backupUnit||b.add(this.backupUnit)},toCSS:a.toCSS,toString:function(){var a,b=this.numerator.join("*");for(a=0;a0)for(b=0;e>b;b++)this.numerator.push(a);else if(0>e)for(b=0;-e>b;b++)this.denominator.push(a)}0===this.numerator.length&&0===this.denominator.length&&c&&(this.backupUnit=c),this.numerator.sort(),this.denominator.sort()}}}(c("../tree")),function(a){a.Directive=function(a,b,c,d,e,f){this.name=a,this.value=b,c&&(this.rules=c,this.rules.allowImports=!0),this.index=d,this.currentFileInfo=e,this.debugInfo=f},a.Directive.prototype={type:"Directive",accept:function(a){var b=this.value,c=this.rules;c&&(c=a.visit(c)),b&&(b=a.visit(b))},genCSS:function(b,c){var d=this.value,e=this.rules;c.add(this.name,this.currentFileInfo,this.index),d&&(c.add(" "),d.genCSS(b,c)),e?a.outputRuleset(b,c,[e]):c.add(";")},toCSS:a.toCSS,eval:function(b){var c=this.value,d=this.rules;return c&&(c=c.eval(b)),d&&(d=d.eval(b),d.root=!0),new a.Directive(this.name,c,d,this.index,this.currentFileInfo,this.debugInfo)},variable:function(b){return this.rules?a.Ruleset.prototype.variable.call(this.rules,b):void 0},find:function(){return this.rules?a.Ruleset.prototype.find.apply(this.rules,arguments):void 0},rulesets:function(){return this.rules?a.Ruleset.prototype.rulesets.apply(this.rules):void 0},markReferenced:function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules.rules,a=0;a":" > ","|":"|","^":" ^ ","^^":" ^^ "},_outputMapCompressed:{"":""," ":" ",":":" :","+":"+","~":"~",">":">","|":"|","^":"^","^^":"^^"},genCSS:function(a,b){b.add((a.compress?this._outputMapCompressed:this._outputMap)[this.value])},toCSS:a.toCSS}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={type:"Expression",accept:function(a){this.value&&(this.value=a.visitArray(this.value))},eval:function(b){var c,d=this.parens&&!this.parensInOp,e=!1;return d&&b.inParenthesis(),this.value.length>1?c=new a.Expression(this.value.map(function(a){return a.eval(b)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),c=this.value[0].eval(b)):c=this,d&&b.outOfParenthesis(),this.parens&&this.parensInOp&&!b.isMathOn()&&!e&&(c=new a.Paren(c)),c},genCSS:function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]}}}(c("../tree")),function(a){a.Import=function(a,c,d,e,f){if(this.options=d,this.index=e,this.path=a,this.features=c,this.currentFileInfo=f,this.options.less!==b||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/css([\?;].*)?$/.test(g)&&(this.css=!0)}},a.Import.prototype={type:"Import",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},genCSS:function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},toCSS:a.toCSS,getPath:function(){if(this.path instanceof a.Quoted){var c=this.path.value;return this.css!==b||/(\.[a-z]*$)|([\?;].*)$/.test(c)?c:c+".less"}return this.path instanceof a.URL?this.path.value.value:null},evalForImport:function(b){return new a.Import(this.path.eval(b),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(b){var c=this.path.eval(b),d=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(c instanceof a.URL)){if(d){var e=c.value;e&&b.isPathRelative(e)&&(c.value=d+e)}c.value=b.normalizePath(c.value)}return c},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var e=new a.Anonymous(this.root,0,{filename:this.importedFilename},!0);return this.features?new a.Media([e],this.features.value):[e]}if(this.css){var f=new a.Import(this.evalPath(b),d,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return c=new a.Ruleset(null,this.root.rules.slice(0)),c.evalImports(b),this.features?new a.Media(c.rules,this.features.value):c.rules}}}(c("../tree")),function(a){a.JavaScript=function(a,b,c){this.escaped=c,this.expression=a,this.index=b},a.JavaScript.prototype={type:"JavaScript",eval:function(b){var c,d=this,e={},f=this.expression.replace(/@\{([\w-]+)\}/g,function(c,e){return a.jsify(new a.Variable("@"+e,d.index).eval(b))});try{f=new Function("return ("+f+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+f+"`",index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(e[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=f.call(e)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",index:this.index}}return"number"==typeof c?new a.Dimension(c):"string"==typeof c?new a.Quoted('"'+c+'"',c,this.escaped,this.index):new a.Anonymous(Array.isArray(c)?c.join(", "):c)}}}(c("../tree")),function(a){a.Keyword=function(a){this.value=a},a.Keyword.prototype={type:"Keyword",eval:function(){return this},genCSS:function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},toCSS:a.toCSS,compare:function(b){return b instanceof a.Keyword?b.value===this.value?0:1:-1}},a.True=new a.Keyword("true"),a.False=new a.Keyword("false")}(c("../tree")),function(a){a.Media=function(b,c,d,e){this.index=d,this.currentFileInfo=e;var f=this.emptySelectors();this.features=new a.Value(c),this.rules=[new a.Ruleset(f,b)],this.rules[0].allowImports=!0},a.Media.prototype={type:"Media",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},genCSS:function(b,c){c.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(b,c),a.outputRuleset(b,c,this.rules)},toCSS:a.toCSS,eval:function(b){b.mediaBlocks||(b.mediaBlocks=[],b.mediaPath=[]);var c=new a.Media(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,c.debugInfo=this.debugInfo);var d=!1;b.strictMath||(d=!0,b.strictMath=!0);try{c.features=this.features.eval(b)}finally{d&&(b.strictMath=!1)}return b.mediaPath.push(c),b.mediaBlocks.push(c),b.frames.unshift(this.rules[0]),c.rules=[this.rules[0].eval(b)],b.frames.shift(),b.mediaPath.pop(),0===b.mediaPath.length?c.evalTop(b):c.evalNested(b)},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},emptySelectors:function(){var b=new a.Element("","&",this.index,this.currentFileInfo),c=[new a.Selector([b],null,null,this.index,this.currentFileInfo)];return c[0].mediaEmpty=!0,c},markReferenced:function(){var a,b=this.rules[0].rules;for(this.rules[0].markReferenced(),this.isReferenced=!0,a=0;a1){var d=this.emptySelectors();c=new a.Ruleset(d,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(j=!0,g=0;gh;h++)s.value(h),r[h]=d.matchCondition(e,b);(r[0]||r[1])&&(r[0]!=r[1]&&(l.group=r[1]?u:v),q.push(l))}else q.push(l);p=!0}}for(s.reset(),n=[0,0,0],g=0;g0)m=v;else if(m=u,n[u]+n[v]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(e)+"`",index:this.index,filename:this.currentFileInfo.filename};for(g=0;gh;h++)if(g=d[h],k=g&&g.name){for(l=!1,i=0;ii;i++)f.push(d[i].value.eval(b));n.prependRule(new a.Rule(k,new a.Expression(f).eval(b)))}else{if(j=g&&g.value)j=j.eval(b);else{if(!o[h].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+p+" for "+this.arity+")"};j=o[h].value.eval(c),n.resetCache()}n.prependRule(new a.Rule(k,j)),e[h]=j}if(o[h].variadic&&d)for(i=m;p>i;i++)e[i]=d[i].value.eval(b);m++}return n},eval:function(b){return new a.mixin.Definition(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||b.frames.slice(0))},evalCall:function(b,c,d){var e,f,g=[],h=this.frames?this.frames.concat(b.frames):b.frames,i=this.evalParams(b,new a.evalEnv(b,h),c,g);return i.prependRule(new a.Rule("@arguments",new a.Expression(g).eval(b))),e=this.rules.slice(0),f=new a.Ruleset(null,e),f.originalRuleset=this,f=f.eval(new a.evalEnv(b,[this,i].concat(h))),d&&(f=this.parent.makeImportant.apply(f)),f},matchCondition:function(b,c){return this.condition&&!this.condition.eval(new a.evalEnv(c,[this.evalParams(c,new a.evalEnv(c,this.frames.concat(c.frames)),b,[])].concat(this.frames).concat(c.frames)))?!1:!0},matchArgs:function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(dthis.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0}}}(c("../tree")),function(a){a.Negative=function(a){this.value=a},a.Negative.prototype={type:"Negative",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("-"),this.value.genCSS(a,b)},toCSS:a.toCSS,eval:function(b){return b.isMathOn()?new a.Operation("*",[new a.Dimension(-1),this.value]).eval(b):new a.Negative(this.value.eval(b))}}}(c("../tree")),function(a){a.Operation=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c},a.Operation.prototype={type:"Operation",accept:function(a){this.operands=a.visit(this.operands)},eval:function(b){var c=this.operands[0].eval(b),d=this.operands[1].eval(b);if(b.isMathOn()){if(c instanceof a.Dimension&&d instanceof a.Color&&(c=c.toColor()),d instanceof a.Dimension&&c instanceof a.Color&&(d=d.toColor()),!c.operate)throw{type:"Operation",message:"Operation on an invalid type"};return c.operate(b,this.op,d)}return new a.Operation(this.op,[c,d],this.isSpaced)},genCSS:function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},toCSS:a.toCSS},a.operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}}}(c("../tree")),function(a){a.Paren=function(a){this.value=a},a.Paren.prototype={type:"Paren",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},toCSS:a.toCSS,eval:function(b){return new a.Paren(this.value.eval(b))}}}(c("../tree")),function(a){a.Quoted=function(a,b,c,d,e){this.escaped=c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e},a.Quoted.prototype={type:"Quoted",genCSS:function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},toCSS:a.toCSS,eval:function(b){var c=this,d=this.value.replace(/`([^`]+)`/g,function(d,e){return new a.JavaScript(e,c.index,!0).eval(b).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var f=new a.Variable("@"+e,c.index,c.currentFileInfo).eval(b,!0);return f instanceof a.Quoted?f.value:f.toCSS()});return new a.Quoted(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1}}}(c("../tree")),function(a){function b(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}a.Rule=function(b,c,d,e,f,g,h){this.name=b,this.value=c instanceof a.Value||c instanceof a.Ruleset?c:new a.Value([c]),this.important=d?" "+d.trim():"",this.merge=e,this.index=f,this.currentFileInfo=g,this.inline=h||!1,this.variable=b.charAt&&"@"===b.charAt(0)},a.Rule.prototype={type:"Rule",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},toCSS:a.toCSS,eval:function(c){var d,e=!1,f=this.name;"string"!=typeof f&&(f=1===f.length&&f[0]instanceof a.Keyword?f[0].value:b(c,f)),"font"!==f||c.strictMath||(e=!0,c.strictMath=!0);try{if(d=this.value.eval(c),!this.variable&&"DetachedRuleset"===d.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};return new a.Rule(f,d,this.important,this.merge,this.index,this.currentFileInfo,this.inline)}catch(g){throw"number"!=typeof g.index&&(g.index=this.index,g.filename=this.currentFileInfo.filename),g}finally{e&&(c.strictMath=!1)}},makeImportant:function(){return new a.Rule(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)}}}(c("../tree")),function(a){a.RulesetCall=function(a){this.variable=a},a.RulesetCall.prototype={type:"RulesetCall",accept:function(){},eval:function(b){var c=new a.Variable(this.variable).eval(b);return c.callEval(b)}}}(c("../tree")),function(a){a.Ruleset=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c},a.Ruleset.prototype={type:"Ruleset",accept:function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},eval:function(b){var c,d,e,f,g=this.selectors,h=a.defaultFunc,i=!1;if(g&&(d=g.length)){for(c=[],h.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;d>f;f++)e=g[f].eval(b),c.push(e),e.evaldCondition&&(i=!0);h.reset()}else i=!0;var j,k,l=this.rules?this.rules.slice(0):null,m=new a.Ruleset(c,l,this.strictImports);m.originalRuleset=this,m.root=this.root,m.firstRoot=this.firstRoot,m.allowImports=this.allowImports,this.debugInfo&&(m.debugInfo=this.debugInfo),i||(l.length=0);var n=b.frames;n.unshift(m);var o=b.selectors;o||(b.selectors=o=[]),o.unshift(this.selectors),(m.root||m.allowImports||!m.strictImports)&&m.evalImports(b);var p=m.rules,q=p?p.length:0;for(f=0;q>f;f++)(p[f]instanceof a.mixin.Definition||p[f]instanceof a.DetachedRuleset)&&(p[f]=p[f].eval(b));var r=b.mediaBlocks&&b.mediaBlocks.length||0;for(f=0;q>f;f++)p[f]instanceof a.mixin.Call?(l=p[f].eval(b).filter(function(b){return b instanceof a.Rule&&b.variable?!m.variable(b.name):!0}),p.splice.apply(p,[f,1].concat(l)),q+=l.length-1,f+=l.length-1,m.resetCache()):p[f]instanceof a.RulesetCall&&(l=p[f].eval(b).rules.filter(function(b){return b instanceof a.Rule&&b.variable?!1:!0}),p.splice.apply(p,[f,1].concat(l)),q+=l.length-1,f+=l.length-1,m.resetCache());for(f=0;fb;b++)c=g[b],(c instanceof d||c instanceof e)&&f.push(c);return f},prependRule:function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},find:function(b,c){c=c||this;var d,e=[],f=b.toCSS();return f in this._lookups?this._lookups[f]:(this.rulesets().forEach(function(f){if(f!==c)for(var g=0;gd?Array.prototype.push.apply(e,f.find(new a.Selector(b.elements.slice(d)),c)):e.push(f);break}}),this._lookups[f]=e,e)},genCSS:function(b,c){var d,e,f,g,h,i,j=[],k=[];b.tabLevel=b.tabLevel||0,this.root||b.tabLevel++;var l,m=b.compress?"":Array(b.tabLevel+1).join(" "),n=b.compress?"":Array(b.tabLevel).join(" ");for(d=0;dd;d++)if(i=p[d],o=i.length)for(d>0&&c.add(l),b.firstSelector=!0,i[0].genCSS(b,c),b.firstSelector=!1,e=1;o>e;e++)i[e].genCSS(b,c);c.add((b.compress?"{":" {\n")+m)}for(d=0;dd;d++)l&&c.add(l),k[d].genCSS(b,c);c.isEmpty()||b.compress||!this.firstRoot||c.add("\n")},toCSS:a.toCSS,markReferenced:function(){if(this.selectors)for(var a=0;a0&&this.mergeElementsOnToSelectors(r,i),f=0;f0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new a.Element(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;g0?(m=k.slice(0),q=m.pop(),o=d.createDerived(q.elements.slice(0)),p=!1):o=d.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0&&(p=!1,o.elements.push(new a.Element(j.combinator,l[0].elements[0].value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))),p||m.push(o),m=m.concat(n),s.push(m);i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;e0&&b.push(i[e])}else if(c.length>0)for(e=0;e0?e[e.length-1]=e[e.length-1].createDerived(e[e.length-1].elements.concat(b)):e.push(new a.Selector(b))}}}(c("../tree")),function(a){a.Selector=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)},a.Selector.prototype={type:"Selector",accept:function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},createDerived:function(b,c,d){d=null!=d?d:this.evaldCondition;var e=new a.Selector(b,c||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=d,e.mediaEmpty=this.mediaEmpty,e},match:function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},CacheElements:function(){var a,b,c,d="";if(!this._elements){for(a=this.elements.length,c=0;a>c;c++)if(b=this.elements[c],d+=b.combinator.value,b.value.value){if("string"!=typeof b.value.value){d="";break}d+=b.value.value}else d+=b.value;this._elements=d.match(/[,&#\.\w-]([\w-]|(\\.))*/g),this._elements?"&"===this._elements[0]&&this._elements.shift():this._elements=[]}},isJustParentSelector:function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},eval:function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},genCSS:function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;cc;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);f.splice?f.length&&this.flatten(f,e):e.push(f)}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],h.splice?h.length&&this.flatten(h,b):b.push(h);else b.push(e);return b}}}(c("./tree")),function(a){a.importVisitor=function(b,c,d,e,f){if(this._visitor=new a.visitor(this),this._importer=b,this._finish=c,this.env=d||new a.evalEnv,this.importCount=0,this.onceFileDetectionMap=e||{},this.recursionDetector={},f)for(var g in f)f.hasOwnProperty(g)&&(this.recursionDetector[g]=!0)},a.importVisitor.prototype={isReplacing:!0,run:function(a){var b;try{this._visitor.visit(a)}catch(c){b=c}this.isFinished=!0,0===this.importCount&&this._finish(b)},visitImport:function(b,c){var d,e=this,f=b.options.inline;if(!b.css||f){try{d=b.evalForImport(this.env)}catch(g){g.filename||(g.index=b.index,g.filename=b.currentFileInfo.filename),b.css=!0,b.error=g}if(d&&(!d.css||f)){b=d,this.importCount++;var h=new a.evalEnv(this.env,this.env.frames.slice(0));b.options.multiple&&(h.importMultiple=!0),this._importer.push(b.getPath(),b.currentFileInfo,b.options,function(c,d,g,i){c&&!c.filename&&(c.index=b.index,c.filename=b.currentFileInfo.filename),h.importMultiple||(b.skip=g?!0:function(){return i in e.onceFileDetectionMap?!0:(e.onceFileDetectionMap[i]=!0,!1)});var j=function(a){e.importCount--,0===e.importCount&&e.isFinished&&e._finish(a)};if(d){b.root=d,b.importedFilename=i;var k=g||i in e.recursionDetector;if(!f&&(h.importMultiple||!k))return e.recursionDetector[i]=!0,void new a.importVisitor(e._importer,j,h,e.onceFileDetectionMap,e.recursionDetector).run(d)}j()})}}return c.visitDeeper=!1,b},visitRule:function(a,b){return b.visitDeeper=!1,a},visitDirective:function(a){return this.env.frames.unshift(a),a},visitDirectiveOut:function(){this.env.frames.shift()},visitMixinDefinition:function(a){return this.env.frames.unshift(a),a},visitMixinDefinitionOut:function(){this.env.frames.shift()},visitRuleset:function(a){return this.env.frames.unshift(a),a},visitRulesetOut:function(){this.env.frames.shift()},visitMedia:function(a){return this.env.frames.unshift(a.ruleset),a},visitMediaOut:function(){this.env.frames.shift()}}}(c("./tree")),function(a){a.joinSelectorVisitor=function(){this.contexts=[[]],this._visitor=new a.visitor(this)},a.joinSelectorVisitor.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}}}(c("./tree")),function(a){a.toCSSVisitor=function(b){this._visitor=new a.visitor(this),this._env=b},a.toCSSVisitor.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?[]:a},visitMixinDefinition:function(a){return a.frames=[],[]},visitExtend:function(){return[]},visitComment:function(a){return a.isSilent(this._env)?[]:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:[]},visitDirective:function(b){if(b.currentFileInfo.reference&&!b.isReferenced)return[];if("@charset"===b.name){if(this.charset){if(b.debugInfo){var c=new a.Comment("/* "+b.toCSS(this._env).replace(/\n/g,"")+" */\n");return c.debugInfo=b.debugInfo,this._visitor.visit(c)}return[]}this.charset=!0}return b},checkPropertiesInRoot:function(b){for(var c,d=0;d0)&&e.splice(0,0,b);else{b.paths&&(b.paths=b.paths.filter(function(b){var c;for(" "===b[0].elements[0].combinator.value&&(b[0].elements[0].combinator=new a.Combinator("")),c=0;ch;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?b.accept(this._visitor):b.rules=null,c.visitDeeper=!1,f=b.rules,f&&(this._mergeRules(f),f=b.rules),f&&(this._removeDuplicateRules(f),f=b.rules),f&&f.length>0&&b.paths.length>0&&e.splice(0,0,b)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(b){if(b){var c,d,e,f={};for(e=b.length-1;e>=0;e--)if(d=b[e],d instanceof a.Rule)if(f[d.name]){c=f[d.name],c instanceof a.Rule&&(c=f[d.name]=[f[d.name].toCSS(this._env)]);var g=d.toCSS(this._env);-1!==c.indexOf(g)?b.splice(e,1):c.push(g)}else f[d.name]=d}},_mergeRules:function(b){if(b){for(var c,d,e,f={},g=0;g1){d=c[0];var h=[],i=[];c.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),d.value=g(h)}})}}}}(c("./tree")),function(a){a.extendFinderVisitor=function(){this._visitor=new a.visitor(this),this.contexts=[],this.allExtendsStack=[[]]},a.extendFinderVisitor.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(b){if(!b.root){var c,d,e,f,g=[],h=b.rules,i=h?h.length:0;for(c=0;i>c;c++)b.rules[c]instanceof a.Extend&&(g.push(h[c]),b.extendOnEveryPath=!0);var j=b.paths;for(c=0;c=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&j.selfSelectors.forEach(function(b){h=n.extendSelector(g,i,b),l=new a.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))}));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,c,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;d0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(c.slice(j,h.pathIndex)),l.push(new a.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=c[j].elements.length&&(k=0,j++); +return j0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),j++),l=l.concat(c.slice(j,c.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(c("./tree")),function(a){a.sourceMapOutput=function(a){this._css=[],this._rootNode=a.rootNode,this._writeSourceMap=a.writeSourceMap,this._contentsMap=a.contentsMap,this._contentsIgnoredCharsMap=a.contentsIgnoredCharsMap,this._sourceMapFilename=a.sourceMapFilename,this._outputFilename=a.outputFilename,this._sourceMapURL=a.sourceMapURL,a.sourceMapBasepath&&(this._sourceMapBasepath=a.sourceMapBasepath.replace(/\\/g,"/")),this._sourceMapRootpath=a.sourceMapRootpath,this._outputSourceFiles=a.outputSourceFiles,this._sourceMapGeneratorConstructor=a.sourceMapGenerator||c("source-map").SourceMapGenerator,this._sourceMapRootpath&&"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/"),this._lineNumber=0,this._column=0},a.sourceMapOutput.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},a.sourceMapOutput.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;i0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this._sourceMapURL?d=this._sourceMapURL:this._sourceMapFilename&&(d=this.normalizeFilename(this._sourceMapFilename)),this._writeSourceMap?this._writeSourceMap(e):d="data:application/json,"+encodeURIComponent(e),d&&this._css.push("/*# sourceMappingURL="+d+" */")}return this._css.join("")}}(c("./tree"));var y=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);w.env=w.env||("127.0.0.1"==location.hostname||"0.0.0.0"==location.hostname||"localhost"==location.hostname||location.port&&location.port.length>0||y?"development":"production");var z={debug:3,info:2,errors:1,none:0};if(w.logLevel="undefined"!=typeof w.logLevel?w.logLevel:"development"===w.env?z.debug:z.errors,w.async=w.async||!1,w.fileAsync=w.fileAsync||!1,w.poll=w.poll||(y?1e3:1500),w.functions)for(var A in w.functions)w.functions.hasOwnProperty(A)&&(w.tree.functions[A]=w.functions[A]);var B=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);B&&(w.dumpLineNumbers=B[1]);var C=/^text\/(x-)?less$/,D=null,E={};if(w.watch=function(){return w.watchMode||(w.env="development",v()),this.watchMode=!0,!0},w.unwatch=function(){return clearInterval(w.watchTimer),this.watchMode=!1,!1},/!watch/.test(location.hash)&&w.watch(),"development"!=w.env)try{D="undefined"==typeof a.localStorage?null:a.localStorage}catch(F){}var G=document.getElementsByTagName("link");w.sheets=[];for(var H=0;H - + From fb46548164f1074ad9879dcb7d10f66f2fbfc808 Mon Sep 17 00:00:00 2001 From: Bernhard Sirlinger Date: Mon, 10 Mar 2014 17:07:15 +0100 Subject: [PATCH 005/125] Add newline at end of file --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index da1f2b9745a..25c4c3e6c8f 100644 --- a/src/config.js +++ b/src/config.js @@ -1,3 +1,3 @@ var less = { logLevel: 2 -}; \ No newline at end of file +}; From a346df5ef0722ed865b3427e95991ca176599fc0 Mon Sep 17 00:00:00 2001 From: kvarel Date: Fri, 18 Apr 2014 20:10:58 +0200 Subject: [PATCH 006/125] Update strings.js --- src/nls/cs/strings.js | 57 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/src/nls/cs/strings.js b/src/nls/cs/strings.js index d6ce64ac60f..9cd2331358a 100644 --- a/src/nls/cs/strings.js +++ b/src/nls/cs/strings.js @@ -116,7 +116,15 @@ define({ "EXT_MODIFIED_MESSAGE" : "{0} byl změněn, ale neuložené změny se nachází také v {APP_NAME}.

    Kterou verzi chcete zachovat?", "EXT_DELETED_MESSAGE" : "{0} byl smazán z disku, ale změny nebyly uloženy v {APP_NAME}.

    Chcete uložit změny?", - // Najít, Nahradit, Nahradit v souborech + // Obecné označení - dialogy, tlačítka + "EXPERIMENTAL_BUILD" : "experimentální verze", + "DEVELOPMENT_BUILD" : "vývojová verze", + "OK" : "OK", + "DONT_SAVE" : "Neukládat", + "SAVE" : "Uložit", + "SAVE_AS" : "Uložit jako\u2026", + "SAVE_AND_OVERWRITE" : "Přepsat", + "FIND_RESULT_COUNT" : "{0} výsledků", "FIND_RESULT_COUNT_SINGLE" : "1 výsledek", "FIND_NO_RESULTS" : "Žádné výsledky", @@ -141,15 +149,18 @@ define({ "NO_UPDATE_TITLE" : "Vše je aktuální!", "NO_UPDATE_MESSAGE" : "Verze {APP_NAME} je aktuální.", + // Nahradit vše (v jednom souboru) "FIND_REPLACE_TITLE_PART1" : "Nahradit \"", "FIND_REPLACE_TITLE_PART2" : "\" s \"", "FIND_REPLACE_TITLE_PART3" : "\" — {2} {0} {1}", + // Najít v souborech "FIND_IN_FILES_TITLE_PART1" : "\"", "FIND_IN_FILES_TITLE_PART2" : "\" nalezen", "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} v {3} {4}", "FIND_IN_FILES_SCOPED" : "v {0}", "FIND_IN_FILES_NO_SCOPE" : "v projektu", + "FIND_IN_FILES_ZERO_FILES" : "Filtr vyloučil všechny soubory {0}", "FIND_IN_FILES_FILE" : "souboru", "FIND_IN_FILES_FILES" : "souborech", "FIND_IN_FILES_MATCH" : "výsledek", @@ -169,6 +180,22 @@ define({ "FILE_FILTER_LIST_PREFIX" : "mimo", "FILE_FILTER_CLIPPED_SUFFIX" : "a {0} více", + "FILTER_COUNTING_FILES" : "Počítání souborů\u2026", + "FILTER_FILE_COUNT" : "Povolit {0} z {1} souborů {2}", + "FILTER_FILE_COUNT_ALL" : "Povolit všechny {0} soubory {1}", + + // Rychlá úprava + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Rychlá úprava není dostupná pro aktuální pozici kurzoru", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "CSS Rychlá úprava: umístěte kurzor do jména třídy", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "CSS Rychlá úprava: nekompletní class atribut", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "CSS Rychlá úprava: nekompletní id atribut", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "CSS Rychlá úprava: umístěte kurzor do elementu, třídy nebo id", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "CSS Rychlá úprava časování: neplatná syntaxe", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "JS Rychlá úprava: umístěte kurzor do jména funkce", + + // Rychlá dokumentace + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Rychlá dokumentace není dostupná pro aktuální pozici kurzoru", + /** * Správce projektu */ @@ -190,6 +217,7 @@ define({ "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 Vybrány {0} sloupce", "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 Vybrán {0} řádek", "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 Vybrány {0} řádky", + "STATUSBAR_SELECTION_MULTIPLE" : " \u2014 {0} Vybráno", "STATUSBAR_CURSOR_POSITION" : "Řádek {0}, Sloupec {1}", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Přepnout odsazení na mezery", "STATUSBAR_INDENT_TOOLTIP_TABS" : "Přepnout odsazení na tabulátory", @@ -212,6 +240,8 @@ define({ "LINT_DISABLED" : "Lintování je vypnuto", "NO_LINT_AVAILABLE" : "Žádný linter není dostupný pro {0}", "NOTHING_TO_LINT" : "Nic k lintování", + "LINTER_TIMED_OUT" : "{0} - vypršel časový limit po uplynutí {1} ms", + "LINTER_FAILED" : "{0} byl(a) ukončen(a) s chybou: {1}", /** @@ -258,11 +288,17 @@ define({ "CMD_SELECT_ALL" : "Vybrat vše", "CMD_SELECT_LINE" : "Vybrat řádek", "CMD_FIND" : "Najít", + "CMD_SPLIT_SEL_INTO_LINES" : "Rozdělit výběr na řádky", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Přidat kurzor na další řádek", + "CMD_ADD_CUR_TO_PREV_LINE" : "Přidat kurzor na předcházející řádek", "CMD_FIND_FIELD_PLACEHOLDER" : "Najít\u2026", "CMD_FIND_IN_FILES" : "Najít v souborech", "CMD_FIND_IN_SUBTREE" : "Najít v\u2026", "CMD_FIND_NEXT" : "Najít další", "CMD_FIND_PREVIOUS" : "Najít předchozí", + "CMD_FIND_ALL_AND_SELECT" : "Najít vše a vybrat", + "CMD_ADD_NEXT_MATCH" : "Přidat další shodu do výběru", + "CMD_SKIP_CURRENT_MATCH" : "Přeskočit a přidat další shodu do výběru", "CMD_REPLACE" : "Nahradit", "CMD_INDENT" : "Odsadit", "CMD_UNINDENT" : "Vrátit odsazení", @@ -310,29 +346,23 @@ define({ "CMD_PREV_DOC" : "Předchozí dokument", "CMD_SHOW_IN_TREE" : "Zobrazit stromovou strukturu", "CMD_SHOW_IN_OS" : "Zobrazit v OS", - "CMD_SHOW_IN_EXPLORER" : "Zobrazit v Exploreru", + "CMD_SHOW_IN_EXPLORER" : "Zobrazit v průzkumníkovi", "CMD_SHOW_IN_FINDER" : "Zobrazit ve vyhledávači", // Příkazy menu nápověda "HELP_MENU" : "Nápověda", "CMD_CHECK_FOR_UPDATE" : "Zkontrolovat aktualizace", "CMD_HOW_TO_USE_BRACKETS" : "Jak používat {APP_NAME}", - "CMD_FORUM" : "{APP_NAME} fórum", + "CMD_SUPPORT" : "{APP_NAME} Podpora", + "CMD_SUGGEST" : "Navrhněte funkci", + "CMD_GET_INVOLVED" : "Zapojte se", "CMD_RELEASE_NOTES" : "Poznámky k verzi", - "CMD_REPORT_AN_ISSUE" : "Nahlásit problém", "CMD_SHOW_EXTENSIONS_FOLDER" : "Zobrazit složku s doplňky", "CMD_TWITTER" : "{TWITTER_NAME} - Twitter", "CMD_ABOUT" : "O aplikaci {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "Otevřít soubor s preferencemi", // Řetězce pro main-view.html - "EXPERIMENTAL_BUILD" : "experimentální verze", - "DEVELOPMENT_BUILD" : "vývojová verze", - "OK" : "OK", - "DONT_SAVE" : "Neukládat", - "SAVE" : "Uložit", - "SAVE_AS" : "Uložit jako\u2026", - "SAVE_AND_OVERWRITE" : "Přepsat", "CANCEL" : "Zrušit", "DELETE" : "Smazat", "RELOAD_FROM_DISK" : "Načíst z disku", @@ -448,6 +478,9 @@ define({ "CSS_QUICK_EDIT_NO_MATCHES" : "Neexistují žádná CSS pravidla odpovídající vašemu výběru.
    Pro vytvoření pravidla klikněte na \"Nové pravidlo\".", "CSS_QUICK_EDIT_NO_STYLESHEETS" : "Neexistují žádné soubory s kaskádovými styly ve vašem projektu.
    Vytvořte nový soubor pro přidání CSS pravidel.", + // Custom Viewers + "IMAGE_VIEWER_LARGEST_ICON" : "největší", + /** * Jména jednotek */ @@ -506,3 +539,5 @@ define({ // extensions/default/WebPlatformDocs "DOCS_MORE_LINK" : "Více" }); + +/* Last translated for c3411bb7f686f98381b18e729c097b6c5e270694 */ From 5cf5912cd99016076a7bd7b232bff6f48f116669 Mon Sep 17 00:00:00 2001 From: Olgierd Grzyb Date: Fri, 18 Apr 2014 23:43:49 +0200 Subject: [PATCH 007/125] Added untranslated messages to the Polish translation. --- src/nls/pl/strings.js | 67 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/src/nls/pl/strings.js b/src/nls/pl/strings.js index 497078c3a22..b0324d841d9 100644 --- a/src/nls/pl/strings.js +++ b/src/nls/pl/strings.js @@ -186,7 +186,7 @@ define({ "CMD_SELECT_LINE" : "Zaznacz linię", "CMD_FIND" : "Znajdź", "CMD_FIND_IN_FILES" : "Znajdź w plikach", - "CMD_FIND_IN_SUBTREE" : "Znajdź w\u2026", + "CMD_FIND_IN_SUBTREE" : "Znajdź\u2026", "CMD_FIND_NEXT" : "Znajdź następny", "CMD_FIND_PREVIOUS" : "Znajdź poprzedni", "CMD_REPLACE" : "Zamień", @@ -256,7 +256,7 @@ define({ "RELOAD_FROM_DISK" : "Załaduj ponownie z dysku", "KEEP_CHANGES_IN_EDITOR" : "Zachowaj zmiany w edytorze", "CLOSE_DONT_SAVE" : "Zamknij (Nie Zapisuj)", - "RELAUNCH_CHROME" : "Przeładuj Chrome", + "RELAUNCH_CHROME" : "Zrestartuj Chrome", "INSTALL" : "Zainstaluj", "ABOUT" : "O programie", "CLOSE" : "Zamknij", @@ -312,7 +312,7 @@ define({ // extensions/default/DebugCommands "DEBUG_MENU" : "Debuguj", "CMD_SHOW_DEV_TOOLS" : "Pokaż narzędzia dewelopera", - "CMD_REFRESH_WINDOW" : "Przeładuj {APP_NAME}", + "CMD_REFRESH_WINDOW" : "Uruchom ponownie {APP_NAME}", "CMD_NEW_BRACKETS_WINDOW" : "Nowe okno", "CMD_SWITCH_LANGUAGE" : "Zmień język", "CMD_RUN_UNIT_TESTS" : "Uruchom test", @@ -499,6 +499,65 @@ define({ "JSLINT_NAME" : "JSLint", "CMD_ENABLE_QUICK_VIEW" : "Podgląd po najechaniu", "CMD_TOGGLE_RECENT_PROJECTS" : "Ostatnie projekty", - "DOCS_MORE_LINK" : "Czytaj więcej" + "DOCS_MORE_LINK" : "Czytaj więcej", + + "CONTENTS_MODIFIED_ERR" : "Plik został zmodyfikowany z zewnątrz.", + "ERROR_PREFS_CORRUPT_TITLE" : "Błąd odczytu ustawień", + "ERROR_PREFS_CORRUPT" : "Twój plik ustawień nie jest poprawnym plikiem JSON. Zostanie on teraz otwarty w edytorze celem poprawienia błędów. Po poprawkach uruchom ponownie {APP_NAME}, aby zastosować zmiany.", + "EXT_MODIFIED_WARNING" : "{0} został zmodyfikowany na dysku.

    Czy chcesz nadpisać plik obecnie otwartą wersją?", + "SAVE_AS" : "Zapisz jako…", + "SAVE_AND_OVERWRITE" : "Nadpisz", + "FIND_IN_FILES_ZERO_FILES" : "Filtr wyklucza wszystkie pliki {0}", + "FIND_IN_FILES_EXPAND_COLLAPSE" : "Kliknij w Ctrl/Cmd aby (ro)zwinąć wszystkie", + "NO_FILE_FILTER" : "Filtruj…", + "EDIT_FILE_FILTER" : "Edytuj…", + "FILE_FILTER_DIALOG" : "Edytuj filtr", + "FILE_FILTER_INSTRUCTIONS" : "Możesz odrzucić pliki o nazwach pasujących do poniższych wzorów lub masek. Każdą regułę umieść w osobnej linii.", + "FILE_FILTER_LIST_PREFIX" : "oprócz", + "FILE_FILTER_CLIPPED_SUFFIX" : "i {0} więcej", + "FILTER_COUNTING_FILES" : "Kalkulowanie…", + "FILTER_FILE_COUNT" : "Przeszukane zostanie {0} z {1} plików {2}", + "FILTER_FILE_COUNT_ALL" : "Przeszukane zostanie wszystkie {0} plików {1}", + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Nie można użyć Szybkiej edycji w tym miejscu", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "Szybka edycja CSS: umieść kursor na nazwie klasy", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "Szybka edycja CSS: nieprawidłowa klasa", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "Szybka edycja CSS: nieprawidłowy identyfikator", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "Szybka edycja CSS: umieść kursor na nazwie znacznika, klasy lub identyfikatora", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "Szybka edycja CSS: nieprawidłowa składnia funkcji czasu", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "Szybka edycja JS: umieść kursor na nazwie funkcji", + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Nie znaleziono dokumentacji dla bieżącego miejsca.", + "STATUSBAR_SELECTION_MULTIPLE" : " — {0} zaznaczeń", + "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Rozszerzenia wyłączone", + "STATUSBAR_INSERT" : "WST", + "STATUSBAR_OVERWRITE" : "ZAS", + "ERRORS_PANEL_TITLE_MULTIPLE" : "{0} problemów", + "NO_ERRORS_MULTIPLE_PROVIDER" : "Brak problemów!", + "LINTER_TIMED_OUT" : "{0} kminił za długo: {1} ms", + "LINTER_FAILED" : "{0} rzucił błędem: {1}", + "CMD_SPLIT_SEL_INTO_LINES" : "Podziel zaznaczenie na linie", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Rozszerz kursor na linię niżej", + "CMD_ADD_CUR_TO_PREV_LINE" : "Rozszerz kursor na linię wyżej", + "CMD_FIND_FIELD_PLACEHOLDER" : "Znajdź…", + "CMD_FIND_ALL_AND_SELECT" : "Zaznacz wszystkie wystapienia", + "CMD_ADD_NEXT_MATCH" : "Dodaj nastepny do zaznaczenia", + "CMD_SKIP_CURRENT_MATCH" : "Pomiń i dodaj następny", + "CMD_SHOW_IN_EXPLORER" : "Pokaż w Eksploratorze", + "CMD_SHOW_IN_FINDER" : "Pokaż w Finderze", + "CMD_SUPPORT" : "Wsparcie {APP_NAME}", + "CMD_SUGGEST" : "Zarzuć pomysłem", + "CMD_GET_INVOLVED" : "Zaangażuj się…", + "CMD_OPEN_PREFERENCES" : "Otwórz plik ustawień", + "CANT_UPDATE_DEV" : "Rozszerzenia w folderze \"dev\" nie są automatycznie aktualizowane.", + "CHANGE_AND_RELOAD_TITLE" : "Rozszerzenia", + "CHANGE_AND_RELOAD_MESSAGE" : "Aby Słowo stało się ciałem, {APP_NAME} musi zostać ponownie uruchomiony. Czy chcesz tego dokonać teraz?", + "REMOVE_AND_RELOAD" : "Usuń i zrestartuj", + "CHANGE_AND_RELOAD" : "OK", + "UPDATE_AND_RELOAD" : "Zaktualizuj i zrestartuj", + "PROCESSING_EXTENSIONS" : "Przetwarzanie…", + "IMAGE_VIEWER_LARGEST_ICON" : "największy", + "CMD_RELOAD_WITHOUT_USER_EXTS" : "Uruchom ponownie (bez rozszerzeń) ", + "BEZIER_EDITOR_INFO" : " Przenieś zaznaczony punkt
    Shift Przenieś zaznaczony punkt o 10 jednostek
    Tab Zmień punkt", + "INLINE_TIMING_EDITOR_INVALID" : "Obecna wartość {0} jest niepoprawna, więc została zamieniona na {1}." + }); From 168b174de60adff232988c17dc2581481f8a9cdf Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Fri, 25 Apr 2014 12:40:09 -0700 Subject: [PATCH 008/125] Code Inspection: minor fixes & more unit tests: - Fix bug: if one linter returns errors and another returns errors:[], the no-errors linter is shown in the panel as an empty heading. (Bug doesn't happen if it returned null instead; but both are valid ways of indicating zero errors). - Improve docs on register() - more concise, more detail on how to indicate zero errors - Add unit tests for the bug fixed above plus several more async linting cases that were fixed late in PR #6530 - Fix mislabeled existing unit test for reject()ing async linters - Fix stray whitespace that snuck into merge c3411bb7 --- src/language/CodeInspection.js | 18 +-- src/nls/root/strings.js | 1 - test/spec/CodeInspection-test.js | 213 ++++++++++++++++++++++++++----- 3 files changed, 187 insertions(+), 45 deletions(-) diff --git a/src/language/CodeInspection.js b/src/language/CodeInspection.js index 5d6460d21ce..ffc035ba0ea 100644 --- a/src/language/CodeInspection.js +++ b/src/language/CodeInspection.js @@ -383,7 +383,7 @@ define(function (require, exports, module) { aborted = true; } - if (inspectionResult.result.errors) { + if (inspectionResult.result.errors.length) { allErrors.push({ providerName: provider.name, results: inspectionResult.result.errors @@ -436,18 +436,18 @@ define(function (require, exports, module) { * Brackets JSLint provider. This is a temporary convenience until UI exists for disabling * registered providers. * - * If provider implements both scanFileAsync and scanFile functions for asynchronous and synchronous - * code inspection, respectively, the asynchronous version will take precedence and will be used to - * perform code inspection. - * - * A code inspection provider's scanFileAsync must return a {$.Promise} object which should be - * resolved with ?{errors:!Array, aborted:boolean}}. - * + * Providers implement scanFile() if results are available synchronously, or scanFileAsync() if results + * may require an async wait (if both are implemented, scanFile() is ignored). scanFileAsync() returns + * a {$.Promise} object resolved with the same type of value as scanFile() is expected to return. + * Rejecting the promise is treated as an internal error in the provider. + * * @param {string} languageId - * @param {{name:string, scanFileAsync:?function(string, string):!{$.Promise}, scanFile:?function(string, string):?{errors:!Array, aborted:boolean}}} provider + * @param {{name:string, scanFileAsync:?function(string, string):!{$.Promise}, + * scanFile:?function(string, string):?{errors:!Array, aborted:boolean}}} provider * * Each error is: { pos:{line,ch}, endPos:?{line,ch}, message:string, type:?Type } * If type is unspecified, Type.WARNING is assumed. + * If no errors found, return either null or an object with a zero-length `errors` array. */ function register(languageId, provider) { if (!_providers[languageId]) { diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index f1b9bdab555..bd37e199dd4 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -179,7 +179,6 @@ define({ "FILE_FILTER_INSTRUCTIONS" : "Exclude files and folders matching any of the following strings / substrings or wildcards. Enter each string on a new line.", "FILE_FILTER_LIST_PREFIX" : "except", "FILE_FILTER_CLIPPED_SUFFIX" : "and {0} more", - "FILTER_COUNTING_FILES" : "Counting files\u2026", "FILTER_FILE_COUNT" : "Allows {0} of {1} files {2}", "FILTER_FILE_COUNT_ALL" : "Allows all {0} files {1}", diff --git a/test/spec/CodeInspection-test.js b/test/spec/CodeInspection-test.js index 05e9cf8bd18..be8652c48fd 100644 --- a/test/spec/CodeInspection-test.js +++ b/test/spec/CodeInspection-test.js @@ -42,6 +42,7 @@ define(function (require, exports, module) { CodeInspection, CommandManager, Commands = require("command/Commands"), + DocumentManager, EditorManager, prefs; @@ -111,6 +112,7 @@ define(function (require, exports, module) { brackets = testWindow.brackets; Strings = testWindow.require("strings"); CommandManager = brackets.test.CommandManager; + DocumentManager = brackets.test.DocumentManager; EditorManager = brackets.test.EditorManager; prefs = brackets.test.PreferencesManager.getExtensionPrefs("linting"); CodeInspection = brackets.test.CodeInspection; @@ -137,6 +139,7 @@ define(function (require, exports, module) { $ = null; brackets = null; CommandManager = null; + DocumentManager = null; EditorManager = null; SpecRunnerUtils.closeTestWindow(); }); @@ -413,8 +416,29 @@ define(function (require, exports, module) { describe("Code Inspection UI", function () { beforeEach(function () { CodeInspection._unregisterAll(); + CodeInspection.toggleEnabled(true); }); + // Utility to create an async provider where the testcase can control when each async result resolves + function makeAsyncLinter() { + return { + name: "Test Async Linter", + scanFileAsync: function (text, fullPath) { + if (!this.futures[fullPath]) { + this.futures[fullPath] = []; + this.filesCalledOn.push(fullPath); + } + + var result = new $.Deferred(); + this.futures[fullPath].push(result); + return result.promise(); + }, + futures: {}, // map from full path to array of Deferreds (in call order) + filesCalledOn: [] // in order of first call for each path + }; + } + + it("should run test linter when a JavaScript document opens and indicate errors in the panel", function () { var codeInspector = createCodeInspector("javascript linter", failLintResult()); CodeInspection.register("javascript", codeInspector); @@ -427,45 +451,124 @@ define(function (require, exports, module) { expect($statusBar.is(":visible")).toBe(true); }); }); - - it("should show only warnings for the current file", function () { + + it("should ignore async results from previous file", function () { CodeInspection.toggleEnabled(false); - var firstTime = true, - deferred1 = new $.Deferred(), - deferred2 = new $.Deferred(); - - var asyncProvider = { - name: "Test Async Linter", - scanFileAsync: function () { - if (firstTime) { - firstTime = false; - return deferred1.promise(); - } else { - return deferred2.promise(); - } - } - }; - + var asyncProvider = makeAsyncLinter(); CodeInspection.register("javascript", asyncProvider); - waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js", "errors.js"], "open test files")); + waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js", "errors.js"]), "open test files"); + + var errorsJS = SpecRunnerUtils.makeAbsolute("errors.js"), + noErrorsJS = SpecRunnerUtils.makeAbsolute("no-errors.js"); runs(function () { + // Start linting the first file CodeInspection.toggleEnabled(true); - CommandManager.execute(Commands.FILE_CLOSE); + expect(asyncProvider.filesCalledOn).toEqual([errorsJS]); + + // Close that file, switching to the 2nd one + waitsForDone(CommandManager.execute(Commands.FILE_CLOSE)); }); - // Close the file which was started to lint runs(function () { - // let the linter finish - deferred1.resolve(failLintResult()); + // Verify that we started linting the 2nd file + expect(DocumentManager.getCurrentDocument().file.fullPath).toBe(noErrorsJS); + expect(asyncProvider.filesCalledOn).toEqual([errorsJS, noErrorsJS]); + + // Finish old (stale) linting session - verify results not shown + asyncProvider.futures[errorsJS][0].resolve(failLintResult()); expect($("#problems-panel").is(":visible")).toBe(false); - deferred2.resolve(successfulLintResult()); + + // Finish new (current) linting session + asyncProvider.futures[noErrorsJS][0].resolve(successfulLintResult()); expect($("#problems-panel").is(":visible")).toBe(false); }); }); + + it("should ignore async results from previous run in same file - finishing in order", function () { + CodeInspection.toggleEnabled(false); + + var asyncProvider = makeAsyncLinter(); + CodeInspection.register("javascript", asyncProvider); + + waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js"]), "open test files"); + + var noErrorsJS = SpecRunnerUtils.makeAbsolute("no-errors.js"); + + runs(function () { + // Start linting the file + CodeInspection.toggleEnabled(true); + expect(asyncProvider.filesCalledOn).toEqual([noErrorsJS]); + + // "Modify" the file + $(DocumentManager).triggerHandler("documentSaved", DocumentManager.getCurrentDocument()); + expect(asyncProvider.futures[noErrorsJS].length).toBe(2); + + // Finish old (stale) linting session - verify results not shown + asyncProvider.futures[noErrorsJS][0].resolve(failLintResult()); + expect($("#problems-panel").is(":visible")).toBe(false); + + // Finish new (current) linting session - verify results are shown + asyncProvider.futures[noErrorsJS][1].resolve(failLintResult()); + expect($("#problems-panel").is(":visible")).toBe(true); + }); + }); + + it("should ignore async results from previous run in same file - finishing reverse order", function () { + CodeInspection.toggleEnabled(false); + + var asyncProvider = makeAsyncLinter(); + CodeInspection.register("javascript", asyncProvider); + + waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js"]), "open test files"); + + var noErrorsJS = SpecRunnerUtils.makeAbsolute("no-errors.js"); + + runs(function () { + // Start linting the file + CodeInspection.toggleEnabled(true); + expect(asyncProvider.filesCalledOn).toEqual([noErrorsJS]); + + // "Modify" the file + $(DocumentManager).triggerHandler("documentSaved", DocumentManager.getCurrentDocument()); + expect(asyncProvider.futures[noErrorsJS].length).toBe(2); + + // Finish new (current) linting session - verify results are shown + asyncProvider.futures[noErrorsJS][1].resolve(failLintResult()); + expect($("#problems-panel").is(":visible")).toBe(true); + + // Finish old (stale) linting session - verify results don't replace current results + asyncProvider.futures[noErrorsJS][0].resolve(successfulLintResult()); + expect($("#problems-panel").is(":visible")).toBe(true); + }); + }); + + it("should ignore async results after linting disabled", function () { + CodeInspection.toggleEnabled(false); + + var asyncProvider = makeAsyncLinter(); + CodeInspection.register("javascript", asyncProvider); + waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js"]), "open test files"); + + var noErrorsJS = SpecRunnerUtils.makeAbsolute("no-errors.js"); + + runs(function () { + // Start linting the file + CodeInspection.toggleEnabled(true); + expect(asyncProvider.filesCalledOn).toEqual([noErrorsJS]); + + // Disable linting + CodeInspection.toggleEnabled(false); + + // Finish old (stale) linting session - verify results not shown + asyncProvider.futures[noErrorsJS][0].resolve(failLintResult()); + expect($("#problems-panel").is(":visible")).toBe(false); + }); + }); + it("should show problems panel after too many errors", function () { var lintResult = { errors: [ @@ -517,8 +620,8 @@ define(function (require, exports, module) { }); }); - it("should not show the problems panel when there is no linting error", function () { - var codeInspector = createCodeInspector("javascript linter", successfulLintResult()); + it("should not show the problems panel when there is no linting error - empty errors array", function () { + var codeInspector = createCodeInspector("javascript linter", {errors: []}); CodeInspection.register("javascript", codeInspector); waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file", 5000); @@ -530,19 +633,20 @@ define(function (require, exports, module) { }); }); - it("status icon should toggle Errors panel when errors present", function () { - var codeInspector = createCodeInspector("javascript linter", failLintResult()); + it("should not show the problems panel when there is no linting error - null result", function () { + var codeInspector = createCodeInspector("javascript linter", null); CodeInspection.register("javascript", codeInspector); - waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file"); + waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file", 5000); runs(function () { - toggleJSLintResults(false); - toggleJSLintResults(true); + expect($("#problems-panel").is(":visible")).toBe(false); + var $statusBar = $("#status-inspection"); + expect($statusBar.is(":visible")).toBe(true); }); }); - it("should run two linters and display two expanded collapsible sections in the errors panel", function () { + it("should display two expanded, collapsible sections in the errors panel when two linters have errors", function () { var codeInspector1 = createCodeInspector("javascript linter 1", failLintResult()); var codeInspector2 = createCodeInspector("javascript linter 2", failLintResult()); CodeInspection.register("javascript", codeInspector1); @@ -561,17 +665,56 @@ define(function (require, exports, module) { }); }); - it("should run the linter and display no collapsible header section in the errors panel", function () { - var codeInspector1 = createCodeInspector("javascript linter 1", failLintResult()); + it("should display no header section when only one linter has errors", function () { + var codeInspector1 = createCodeInspector("javascript linter 1", failLintResult()), + codeInspector2 = createCodeInspector("javascript linter 2", {errors: []}), // 1st way of reporting 0 errors + codeInspector3 = createCodeInspector("javascript linter 3", null); // 2nd way of reporting 0 errors CodeInspection.register("javascript", codeInspector1); + CodeInspection.register("javascript", codeInspector2); + CodeInspection.register("javascript", codeInspector3); waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file", 5000); runs(function () { + expect($("#problems-panel").is(":visible")).toBe(true); expect($(".inspector-section").is(":visible")).toBeFalsy(); }); }); + it("should only display header sections for linters with errors", function () { + var codeInspector1 = createCodeInspector("javascript linter 1", failLintResult()), + codeInspector2 = createCodeInspector("javascript linter 2", {errors: []}), // 1st way of reporting 0 errors + codeInspector3 = createCodeInspector("javascript linter 3", null), // 2nd way of reporting 0 errors + codeInspector4 = createCodeInspector("javascript linter 4", failLintResult()); + CodeInspection.register("javascript", codeInspector1); + CodeInspection.register("javascript", codeInspector2); + CodeInspection.register("javascript", codeInspector3); + CodeInspection.register("javascript", codeInspector4); + + waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file", 5000); + + runs(function () { + expect($("#problems-panel").is(":visible")).toBe(true); + + var $inspectorSections = $(".inspector-section td"); + expect($inspectorSections.length).toEqual(2); + expect($inspectorSections[0].innerHTML.indexOf("javascript linter 1 (1)")).not.toBe(-1); + expect($inspectorSections[1].innerHTML.indexOf("javascript linter 4 (1)")).not.toBe(-1); + }); + }); + + it("status icon should toggle Errors panel when errors present", function () { + var codeInspector = createCodeInspector("javascript linter", failLintResult()); + CodeInspection.register("javascript", codeInspector); + + waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file"); + + runs(function () { + toggleJSLintResults(false); + toggleJSLintResults(true); + }); + }); + it("status icon should not toggle Errors panel when no errors present", function () { var codeInspector = createCodeInspector("javascript linter", successfulLintResult()); CodeInspection.register("javascript", codeInspector); @@ -810,7 +953,7 @@ define(function (require, exports, module) { }); }); - it("should report an async linter which throws an exception", function () { + it("should report an async linter which rejects", function () { var errorMessage = "I'm full of bugs on purpose", providerName = "Buggy Async Linter", buggyAsyncProvider = { From 248629a311a7a2cf282140af8a8a78b6d2dafe69 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sat, 3 May 2014 19:24:12 +0200 Subject: [PATCH 009/125] Show locale date in Extension Manager --- src/extensibility/registry_utils.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/extensibility/registry_utils.js b/src/extensibility/registry_utils.js index 8cea634fdd8..0d7d03b8a25 100644 --- a/src/extensibility/registry_utils.js +++ b/src/extensibility/registry_utils.js @@ -30,7 +30,7 @@ */ /*jslint vars: true, plusplus: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define*/ +/*global brackets, define*/ define(function (require, exports, module) { "use strict"; @@ -55,11 +55,12 @@ define(function (require, exports, module) { if (this.versions && this.versions.length) { result = this.versions[this.versions.length - 1].published; if (result) { - // Just return the ISO-formatted date, which is the portion up to the "T". - var dateEnd = result.indexOf("T"); - if (dateEnd !== -1) { - result = result.substr(0, dateEnd); - } + result = new Date(result); + result = result.toLocaleDateString(brackets.getLocale(), { + "year": "numeric", + "month": "2-digit", + "day": "2-digit" + }); } } return result || ""; @@ -144,4 +145,4 @@ define(function (require, exports, module) { return sortedEntries; }; -}); \ No newline at end of file +}); From e44f1449a2af6f7d3a6239e431495ddd56f48288 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 27 Apr 2014 18:26:55 +0200 Subject: [PATCH 010/125] Show all contributors in the AboutDialog --- src/brackets.config.json | 2 +- src/config.json | 2 +- src/help/HelpCommandHandlers.js | 57 ++++++++++++++++++---- src/styles/brackets_patterns_override.less | 15 +++--- 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/src/brackets.config.json b/src/brackets.config.json index e39c6bc14d5..cf0d700a753 100644 --- a/src/brackets.config.json +++ b/src/brackets.config.json @@ -14,7 +14,7 @@ "twitter_url" : "https://twitter.com/brackets", "troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", "twitter_name" : "@brackets", - "contributors_url" : "https://api.github.com/repos/adobe/brackets/contributors?per_page=300", + "contributors_url" : "https://api.github.com/repos/adobe/brackets/contributors", "extension_listing_url" : "", "extension_registry" : "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url" : "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", diff --git a/src/config.json b/src/config.json index 9f1fc2d7ebd..f88388902fc 100644 --- a/src/config.json +++ b/src/config.json @@ -13,7 +13,7 @@ "twitter_url": "https://twitter.com/brackets", "troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", "twitter_name": "@brackets", - "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors?per_page=300", + "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors", "extension_listing_url": "", "extension_registry": "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index bd5c8a3fd04..9b46ab74d77 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -78,18 +78,57 @@ define(function (require, exports, module) { // Get containers var $dlg = $(".about-dialog.instance"), $contributors = $dlg.find(".about-contributors"), - $spinner = $dlg.find(".spinner"); + $spinner = $dlg.find(".spinner"), + contributorsUrl = brackets.config.contributors_url, + page, + allContributors = [], + data; + + if (contributorsUrl.indexOf("api.github.com") !== -1) { + page = 1; + } $spinner.addClass("spin"); - // Get all the project contributors and add them to the dialog - $.getJSON(brackets.config.contributors_url).done(function (contributorsInfo) { - + function loadContributorsPage(url, page) { + var contributors; + + if (page) { + url += "?per_page=100&page=" + page; + } + $.ajax({ + url: url, + async: false, + dataType: "json", + cache: false, + complete: function (data) { + contributors = (data && data.responseJSON) || []; + } + }); + return contributors; + } + + // Get all the project contributors + do { + data = loadContributorsPage(contributorsUrl, page); + allContributors = allContributors.concat(data); + if (page) { + page++; + } + } while (page && data.length === 100); + + if (allContributors.length) { // Populate the contributors data - var totalContributors = contributorsInfo.length; - var contributorsCount = 0; + var totalContributors = allContributors.length, + contributorsCount = 0; - $contributors.html(Mustache.render(ContributorsTemplate, contributorsInfo)); + allContributors.forEach(function (contributor) { + if (contributor.avatar_url && contributor.avatar_url.indexOf("avatars.githubusercontent.com") !== -1) { + contributor.avatar_url += "size=30"; + } + }); + + $contributors.html(Mustache.render(ContributorsTemplate, allContributors)); // This is used to create an opacity transition when each image is loaded $contributors.find("img").one("load", function () { @@ -105,10 +144,10 @@ define(function (require, exports, module) { $(this).trigger("load"); } }); - }).fail(function () { + } else { $spinner.removeClass("spin"); $contributors.html(Mustache.render("

    {{ABOUT_TEXT_LINE6}}

    ", Strings)); - }); + } } // Read "build number" SHAs off disk immediately at APP_READY, instead diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 760f940c02c..502fe42b736 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -988,13 +988,14 @@ a[href^="http"] { a { text-decoration: none; } - } - .about-contributors img { - opacity: 0; - -webkit-transition: opacity 1s; - -moz-transition: opacity 1s; - -o-transition: opacity 1s; - transition: opacity 1s; + img { + opacity: 0; + -webkit-transition: opacity 1s; + transition: opacity 1s; + // fixed height and width: avoid increasing scrollbar while loading + height: 30px; + width: 30px; + } } } From 04ea7395aaa82b7a6afa17d4f403c4ecf17b8563 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 27 Apr 2014 21:53:54 +0200 Subject: [PATCH 011/125] Don't rely on GitHubs ? --- src/help/HelpCommandHandlers.js | 5 ++--- src/htmlContent/contributors-list.html | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index 9b46ab74d77..1687bc73a6a 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -123,9 +123,8 @@ define(function (require, exports, module) { contributorsCount = 0; allContributors.forEach(function (contributor) { - if (contributor.avatar_url && contributor.avatar_url.indexOf("avatars.githubusercontent.com") !== -1) { - contributor.avatar_url += "size=30"; - } + // remove any UrlParams delivered via the GitHub API + contributor.avatar_url = contributor.avatar_url.split("?")[0]; }); $contributors.html(Mustache.render(ContributorsTemplate, allContributors)); diff --git a/src/htmlContent/contributors-list.html b/src/htmlContent/contributors-list.html index 50559e72cfc..ee2b0efa948 100644 --- a/src/htmlContent/contributors-list.html +++ b/src/htmlContent/contributors-list.html @@ -1 +1 @@ -{{#.}}{{login}}{{/.}} +{{#.}}{{login}}{{/.}} From 51d78f0dda7fe25949807cc817c384328cff5b15 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 4 May 2014 01:18:29 +0200 Subject: [PATCH 012/125] Code review changes --- src/brackets.config.json | 2 +- src/config.json | 2 +- src/help/HelpCommandHandlers.js | 23 +++++++++++----------- src/styles/brackets_patterns_override.less | 4 ---- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/brackets.config.json b/src/brackets.config.json index cf0d700a753..72ea359d8d5 100644 --- a/src/brackets.config.json +++ b/src/brackets.config.json @@ -14,7 +14,7 @@ "twitter_url" : "https://twitter.com/brackets", "troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", "twitter_name" : "@brackets", - "contributors_url" : "https://api.github.com/repos/adobe/brackets/contributors", + "contributors_url" : "https://api.github.com/repos/adobe/brackets/contributors?per_page={0}&page={1}", "extension_listing_url" : "", "extension_registry" : "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url" : "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", diff --git a/src/config.json b/src/config.json index f88388902fc..3d625a6adeb 100644 --- a/src/config.json +++ b/src/config.json @@ -13,7 +13,7 @@ "twitter_url": "https://twitter.com/brackets", "troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", "twitter_name": "@brackets", - "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors", + "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors?per_page={0}&page={1}", "extension_listing_url": "", "extension_registry": "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index 1687bc73a6a..d0213e3dccf 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -29,16 +29,16 @@ define(function (require, exports, module) { "use strict"; var AppInit = require("utils/AppInit"), - Global = require("utils/Global"), BuildInfoUtils = require("utils/BuildInfoUtils"), - Commands = require("command/Commands"), CommandManager = require("command/CommandManager"), + Commands = require("command/Commands"), Dialogs = require("widgets/Dialogs"), - Strings = require("strings"), - UpdateNotification = require("utils/UpdateNotification"), FileUtils = require("file/FileUtils"), + Global = require("utils/Global"), NativeApp = require("utils/NativeApp"), + Strings = require("strings"), StringUtils = require("utils/StringUtils"), + UpdateNotification = require("utils/UpdateNotification"), AboutDialogTemplate = require("text!htmlContent/about-dialog.html"), ContributorsTemplate = require("text!htmlContent/contributors-list.html"); @@ -76,15 +76,16 @@ define(function (require, exports, module) { Dialogs.showModalDialogUsingTemplate(Mustache.render(AboutDialogTemplate, templateVars)); // Get containers - var $dlg = $(".about-dialog.instance"), - $contributors = $dlg.find(".about-contributors"), - $spinner = $dlg.find(".spinner"), + var $dlg = $(".about-dialog.instance"), + $contributors = $dlg.find(".about-contributors"), + $spinner = $dlg.find(".spinner"), + allContributors = [], contributorsUrl = brackets.config.contributors_url, + perPage = 100, page, - allContributors = [], data; - if (contributorsUrl.indexOf("api.github.com") !== -1) { + if (contributorsUrl.indexOf("{1}") !== -1) { // pagination enabled page = 1; } @@ -94,7 +95,7 @@ define(function (require, exports, module) { var contributors; if (page) { - url += "?per_page=100&page=" + page; + url = StringUtils.format(url, perPage, page); } $.ajax({ url: url, @@ -115,7 +116,7 @@ define(function (require, exports, module) { if (page) { page++; } - } while (page && data.length === 100); + } while (page && data.length === perPage); if (allContributors.length) { // Populate the contributors data diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 502fe42b736..2be5c0d1b22 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -990,11 +990,7 @@ a[href^="http"] { } img { opacity: 0; - -webkit-transition: opacity 1s; transition: opacity 1s; - // fixed height and width: avoid increasing scrollbar while loading - height: 30px; - width: 30px; } } } From 36114f38056377488c537a47bf1f500741b231a6 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 4 May 2014 01:51:40 +0200 Subject: [PATCH 013/125] Code review changes --- src/help/HelpCommandHandlers.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index d0213e3dccf..a6efdb0e98d 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -42,6 +42,9 @@ define(function (require, exports, module) { AboutDialogTemplate = require("text!htmlContent/about-dialog.html"), ContributorsTemplate = require("text!htmlContent/contributors-list.html"); + /** @const This is the thirdparty API's (GitHub) maximum contributors per page limit */ + var CONTRIBUTORS_PER_PAGE = 100; + var buildInfo; @@ -81,9 +84,8 @@ define(function (require, exports, module) { $spinner = $dlg.find(".spinner"), allContributors = [], contributorsUrl = brackets.config.contributors_url, - perPage = 100, - page, - data; + data, + page; if (contributorsUrl.indexOf("{1}") !== -1) { // pagination enabled page = 1; @@ -95,7 +97,7 @@ define(function (require, exports, module) { var contributors; if (page) { - url = StringUtils.format(url, perPage, page); + url = StringUtils.format(url, CONTRIBUTORS_PER_PAGE, page); } $.ajax({ url: url, @@ -116,7 +118,7 @@ define(function (require, exports, module) { if (page) { page++; } - } while (page && data.length === perPage); + } while (page && data.length === CONTRIBUTORS_PER_PAGE); if (allContributors.length) { // Populate the contributors data From 07194ca44bee43ab3c9c190d0cd24e84fca9e6d2 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 4 May 2014 02:53:34 +0200 Subject: [PATCH 014/125] Use deferreds --- src/help/HelpCommandHandlers.js | 97 +++++++++++++++++---------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index a6efdb0e98d..695211dacbf 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -93,63 +93,66 @@ define(function (require, exports, module) { $spinner.addClass("spin"); - function loadContributorsPage(url, page) { - var contributors; - + function loadContributors(rawUrl, page, contributors, deferred) { + deferred = deferred || $.Deferred(); + contributors = contributors || []; + var url = rawUrl; if (page) { - url = StringUtils.format(url, CONTRIBUTORS_PER_PAGE, page); + url = StringUtils.format(rawUrl, CONTRIBUTORS_PER_PAGE, page); } + $.ajax({ url: url, - async: false, dataType: "json", - cache: false, - complete: function (data) { - contributors = (data && data.responseJSON) || []; - } - }); - return contributors; + cache: false + }) + .done(function (response) { + var data = response || []; + contributors = contributors.concat(data); + if (page && data.length === CONTRIBUTORS_PER_PAGE) { + loadContributors(rawUrl, page + 1, contributors, deferred); + } else { + deferred.resolve(contributors); + } + }) + .fail(function () { + deferred.reject(contributors); + }); + return deferred; } - // Get all the project contributors - do { - data = loadContributorsPage(contributorsUrl, page); - allContributors = allContributors.concat(data); - if (page) { - page++; - } - } while (page && data.length === CONTRIBUTORS_PER_PAGE); + loadContributors(contributorsUrl, page) // Load the contributors + .done(function (allContributors) { + // Populate the contributors data + var totalContributors = allContributors.length, + contributorsCount = 0; - if (allContributors.length) { - // Populate the contributors data - var totalContributors = allContributors.length, - contributorsCount = 0; - - allContributors.forEach(function (contributor) { - // remove any UrlParams delivered via the GitHub API - contributor.avatar_url = contributor.avatar_url.split("?")[0]; - }); + allContributors.forEach(function (contributor) { + // remove any UrlParams delivered via the GitHub API + contributor.avatar_url = contributor.avatar_url.split("?")[0]; + }); + + $contributors.html(Mustache.render(ContributorsTemplate, allContributors)); - $contributors.html(Mustache.render(ContributorsTemplate, allContributors)); - - // This is used to create an opacity transition when each image is loaded - $contributors.find("img").one("load", function () { - $(this).css("opacity", 1); - - // Count the contributors loaded and hide the spinner once all are loaded - contributorsCount++; - if (contributorsCount >= totalContributors) { - $spinner.removeClass("spin"); - } - }).each(function () { - if (this.complete) { - $(this).trigger("load"); - } + // This is used to create an opacity transition when each image is loaded + $contributors.find("img").one("load", function () { + $(this).css("opacity", 1); + + // Count the contributors loaded and hide the spinner once all are loaded + contributorsCount++; + if (contributorsCount >= totalContributors) { + $spinner.removeClass("spin"); + } + }).each(function () { + if (this.complete) { + $(this).trigger("load"); + } + }); + }) + .fail(function () { + $spinner.removeClass("spin"); + $contributors.html(Mustache.render("

    {{ABOUT_TEXT_LINE6}}

    ", Strings)); }); - } else { - $spinner.removeClass("spin"); - $contributors.html(Mustache.render("

    {{ABOUT_TEXT_LINE6}}

    ", Strings)); - } } // Read "build number" SHAs off disk immediately at APP_READY, instead From 6eee20ee22aae0ce2439d0996e25b656a28b5f2a Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 4 May 2014 13:36:59 +0200 Subject: [PATCH 015/125] Code review changes again --- src/help/HelpCommandHandlers.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index 695211dacbf..9899df91041 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -82,9 +82,7 @@ define(function (require, exports, module) { var $dlg = $(".about-dialog.instance"), $contributors = $dlg.find(".about-contributors"), $spinner = $dlg.find(".spinner"), - allContributors = [], contributorsUrl = brackets.config.contributors_url, - data, page; if (contributorsUrl.indexOf("{1}") !== -1) { // pagination enabled @@ -94,12 +92,9 @@ define(function (require, exports, module) { $spinner.addClass("spin"); function loadContributors(rawUrl, page, contributors, deferred) { - deferred = deferred || $.Deferred(); + deferred = deferred || new $.Deferred(); contributors = contributors || []; - var url = rawUrl; - if (page) { - url = StringUtils.format(rawUrl, CONTRIBUTORS_PER_PAGE, page); - } + var url = StringUtils.format(rawUrl, CONTRIBUTORS_PER_PAGE, page); $.ajax({ url: url, @@ -107,18 +102,21 @@ define(function (require, exports, module) { cache: false }) .done(function (response) { - var data = response || []; - contributors = contributors.concat(data); - if (page && data.length === CONTRIBUTORS_PER_PAGE) { + contributors = contributors.concat(response || []); + if (page && response.length === CONTRIBUTORS_PER_PAGE) { loadContributors(rawUrl, page + 1, contributors, deferred); } else { deferred.resolve(contributors); } }) .fail(function () { - deferred.reject(contributors); + if (contributors.length) { // we weren't able to fetch this page, but previous fetches were successful + deferred.resolve(contributors); + } else { + deferred.reject(); + } }); - return deferred; + return deferred.promise(); } loadContributors(contributorsUrl, page) // Load the contributors From 32176e29c35a3d22924fdc446afc31a1f5ca4dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Malbr=C3=A1n?= Date: Sun, 4 May 2014 21:28:53 -0300 Subject: [PATCH 016/125] Fixes after review --- src/editor/EditorCommandHandlers.js | 56 +++++++++++++--------- test/spec/EditorCommandHandlers-test.js | 63 +++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 27 deletions(-) diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index 7360e6a52aa..0e25faf0c5c 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -61,13 +61,13 @@ define(function (require, exports, module) { for (i = lineSyntax.length; i < blockSyntax.length; i++) { character = blockSyntax.charAt(i); - subExps.push(prevChars + "[^" + character + "]"); + subExps.push(prevChars + "[^" + StringUtils.regexEscape(character) + "]"); if (prevChars) { subExps.push(prevChars + "$"); } prevChars += character; } - return new RegExp("^\\s*" + lineSyntax + "($|" + subExps.join("|") + ")"); + return new RegExp("^\\s*" + StringUtils.regexEscape(lineSyntax) + "($|" + subExps.join("|") + ")"); } /** @@ -79,18 +79,23 @@ define(function (require, exports, module) { * @return {Array.} */ function _createLineExpressions(prefixes, blockPrefix, blockSuffix) { - var lineExp = [], escapedPrefix, regExp; + var lineExp = [], escapedPrefix, nothingPushed; prefixes.forEach(function (prefix) { escapedPrefix = StringUtils.regexEscape(prefix); + nothingPushed = true; + if (blockPrefix && blockPrefix.indexOf(prefix) === 0) { - regExp = _createSpecialLineExp(prefix, blockPrefix); - } else if (blockSuffix && blockSuffix.indexOf(prefix) === 0) { - regExp = _createSpecialLineExp(prefix, blockSuffix); - } else { - regExp = new RegExp("^\\s*" + escapedPrefix); + lineExp.push(_createSpecialLineExp(prefix, blockPrefix)); + nothingPushed = false; + } + if (blockSuffix && blockPrefix !== blockSuffix && blockSuffix.indexOf(prefix) === 0) { + lineExp.push(_createSpecialLineExp(prefix, blockSuffix)); + nothingPushed = false; + } + if (nothingPushed) { + lineExp.push(new RegExp("^\\s*" + escapedPrefix)); } - lineExp.push(regExp); }); return lineExp; } @@ -98,8 +103,8 @@ define(function (require, exports, module) { /** * @private * Returns true if any regular expression matches the given string - * @param {!string} string - where to look - * @param {!Array.} expressions - what to look + * @param {!string} string where to look + * @param {!Array.} expressions what to look * @return {boolean} */ function _matchExpressions(string, expressions) { @@ -130,7 +135,8 @@ define(function (require, exports, module) { /** * @private - * Searchs for an uncommented line between startLine and endLine + * Searches between startLine and endLine to check if there is at least one line commented with a line comment, and + * skips all the block comments. * @param {!Editor} editor * @param {!number} startLine valid line inside the document * @param {!number} endLine valid line inside the document @@ -144,7 +150,7 @@ define(function (require, exports, module) { for (i = startLine; i <= endLine; i++) { line = editor.document.getLine(i); // A line is commented out if it starts with 0-N whitespace chars, then a line comment prefix - if (line.match(/\S/) && !_matchExpressions(line, lineExp)) { + if (!line.length || (line.match(/\S/) && !_matchExpressions(line, lineExp))) { containsNotLineComment = true; break; } @@ -277,15 +283,15 @@ define(function (require, exports, module) { * Generates an edit that adds or removes block-comment tokens to the selection, preserving selection * and cursor position. Applies to the currently focused Editor. * - * If the selection is inside a block-comment or one block-comment is inside or partially - * inside the selection we uncomment; otherwise we comment out. + * If the selection is inside a block-comment or one block-comment is inside or partially inside the selection + * it will uncomment, otherwise it will comment out, unless if there are multiple block comments inside the selection, + * where it does nothing. * Commenting out adds the prefix before the selection and the suffix after. * Uncommenting removes them. * - * As a special case, if slashComment is true and the start or end of the selection is inside a - * line-comment it needs to do a line uncomment if is not actually inside a bigger block comment and all - * the lines in the selection are line-commented. In this case, we return null to indicate to the caller - * that it needs to handle this selection as a line comment. + * If all the lines inside the selection are line-comment and if the selection is not inside a block-comment, it will + * line uncomment all the lines, otherwise it will block comment/uncomment. In the first case, we return null to + * indicate to the caller that it needs to handle this selection as a line comment. * * @param {!Editor} editor * @param {!string} prefix, e.g. " - + diff --git a/src/config.js b/src/thirdparty/less-config.js similarity index 100% rename from src/config.js rename to src/thirdparty/less-config.js From d3125233946a3c1c6b50c21ff9cb406a777d0699 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 11 May 2014 22:55:27 +0200 Subject: [PATCH 028/125] Fix UpdateNotification.Locale Fallback tests --- test/spec/UpdateNotification-test.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/spec/UpdateNotification-test.js b/test/spec/UpdateNotification-test.js index b6dae815aa4..15d5b28d3fd 100644 --- a/test/spec/UpdateNotification-test.js +++ b/test/spec/UpdateNotification-test.js @@ -218,13 +218,16 @@ define(function (require, exports, module) { function setupAjaxSpy(defaultUpdateUrl) { var jq = spyOn(testWindow.$, "ajax").andCallFake(function (req) { - var d = $.Deferred(); + var d = new $.Deferred(); - if (req.url === defaultUpdateUrl) { - d.resolve(expectedResult); - } else { - d.reject(); - } + testWindow.setTimeout(function () { + if (req.url === defaultUpdateUrl) { + d.resolve(expectedResult); + } else { + d.reject(); + } + }, 75); + // we need to set a timeout in order to emulate the async behavior of $.ajax return d.promise(); }); @@ -235,8 +238,8 @@ define(function (require, exports, module) { setupAjaxSpy(defaultUpdateUrl); - // pretend that we are using the italian locale and we don't have a translation for the update notification - spyOn(testWindow.brackets, "getLocale").andReturn("de-ch"); + // pretend that we are using the German (Switzerland) locale and we don't have a translation for the update notification + spyOn(testWindow.brackets, "getLocale").andReturn("de-CH"); runs(function () { var promise = UpdateNotification.checkForUpdate(true, updateInfo); @@ -254,7 +257,7 @@ define(function (require, exports, module) { setupAjaxSpy(defaultUpdateUrl); - // pretend that we are using the italian locale and we don't have a translation for the update notification + // pretend that we are using the Italian locale and we don't have a translation for the update notification spyOn(testWindow.brackets, "getLocale").andReturn("it"); runs(function () { From 240f3a9179be4aebf5f42e146f770633850a2f86 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Sun, 11 May 2014 23:08:49 -0700 Subject: [PATCH 029/125] Support multiple file filters with a dropdown menu. --- src/nls/root/strings.js | 8 +- src/search/FileFilters.js | 439 +++++++++++++++++++++++++++++++------- src/search/FindInFiles.js | 1 + src/styles/brackets.less | 117 +++++++++- 4 files changed, 477 insertions(+), 88 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 0e1774f2389..7ba2f672a9b 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -173,11 +173,13 @@ define({ "ERROR_FETCHING_UPDATE_INFO_MSG" : "There was a problem getting the latest update information from the server. Please make sure you are connected to the internet and try again.", // File exclusion filters - "NO_FILE_FILTER" : "Exclude files\u2026", + "NEW_FILE_FILTER" : "New Exclusion Set\u2026", + "CLEAR_FILE_FILTER" : "Don't Exclude Files", + "NO_FILE_FILTER" : "No Files Excluded", + "EXCLUDE_FILE_FILTER" : "Exclude {0}", "EDIT_FILE_FILTER" : "Edit\u2026", - "FILE_FILTER_DIALOG" : "Edit Filter", + "FILE_FILTER_DIALOG" : "Edit Exclusion Set", "FILE_FILTER_INSTRUCTIONS" : "Exclude files and folders matching any of the following strings / substrings or wildcards. Enter each string on a new line.", - "FILE_FILTER_LIST_PREFIX" : "except", "FILE_FILTER_CLIPPED_SUFFIX" : "and {0} more", "FILTER_COUNTING_FILES" : "Counting files\u2026", diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index b22de7441e9..bdb4184be19 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -22,7 +22,7 @@ */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ -/*global define, $, brackets, window */ +/*global define, $, brackets, window, Mustache */ /** * Utilities for managing file-set filters, as used in Find in Files. @@ -31,32 +31,122 @@ define(function (require, exports, module) { "use strict"; - var _ = require("thirdparty/lodash"), - ProjectManager = require("project/ProjectManager"), - DefaultDialogs = require("widgets/DefaultDialogs"), - Dialogs = require("widgets/Dialogs"), - DropdownButton = require("widgets/DropdownButton").DropdownButton, - StringUtils = require("utils/StringUtils"), - Strings = require("strings"), - PreferencesManager = require("preferences/PreferencesManager"); + var _ = require("thirdparty/lodash"), + ProjectManager = require("project/ProjectManager"), + DefaultDialogs = require("widgets/DefaultDialogs"), + Dialogs = require("widgets/Dialogs"), + DropdownButton = require("widgets/DropdownButton").DropdownButton, + Menus = require("command/Menus"), + PopUpManager = require("widgets/PopUpManager"), + StringUtils = require("utils/StringUtils"), + Strings = require("strings"), + PreferencesManager = require("preferences/PreferencesManager"), + ProjectsMenuTemplate = require("text!htmlContent/filters-menu.html"); + var _context = null, + _$pickerLabel = null; + + function _getFilterIndex(filterSets, filter) { + var index = -1, + found = false; + + if (!filter || !filterSets.length) { + return index; + } + + filterSets.forEach(function (curFilter, curIndex) { + if (!found && _.isEqual(curFilter, filter)) { + index = curIndex; + found = true; + } + }); + + return index; + } /** * A search filter is an array of one or more glob strings. The filter must be 'compiled' via compile() * before passing to filterPath()/filterFileList(). - * @return {!Array.} + * @return {?Array.} */ function getLastFilter() { - return PreferencesManager.getViewState("search.exclusions") || []; + var filterSets = PreferencesManager.get("fileFilters") || [], + activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), + oldFilter = PreferencesManager.getViewState("search.exclusions") || [], + activeFilter = null; + + if (activeFilterIndex === undefined && oldFilter.length) { + activeFilter = { name: "", patterns: oldFilter }; + activeFilterIndex = _getFilterIndex(filterSets, activeFilter); + + // Migrate the old filter into the new filter storage + if (activeFilterIndex === -1) { + activeFilterIndex = filterSets.length; + filterSets.push(activeFilter); + PreferencesManager.set("fileFilters", filterSets); + } + PreferencesManager.setViewState("activeFileFilter", activeFilterIndex); + } else if (activeFilterIndex > -1 && activeFilterIndex < filterSets.length) { + activeFilter = filterSets[activeFilterIndex]; + } + + return activeFilter; + } + + function _itemRenderer(filter) { + // Format filter in condensed form + if (filter.length > 2) { + return filter.slice(0, 2).join(", ") + " " + + StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.length - 2); + } else { + return filter.join(", "); + } + } + + function _updatePicker() { + var filter = getLastFilter(); + if (filter && filter.patterns.length) { + var label = filter.name || _itemRenderer(filter.patterns); + _$pickerLabel.text(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); + } else { + _$pickerLabel.text(Strings.NO_FILE_FILTER); + } } /** * Sets the value of getLastFilter(). Automatically set when editFilter() is completed. - * @param {!Array.} filter - * @return {!Array.} + * If no filter is passed in, then clear the last active filter index. + * + * @param {{name: string, patterns: Array.}=} filter + * @param {number=} index The index of the filter set in the MRU list or -1 if it is a new one */ - function setLastFilter(filter) { - PreferencesManager.setViewState("search.exclusions", filter); + function setLastFilter(filter, index) { + var filterSets = PreferencesManager.get("fileFilters") || []; + + if (filter) { + if (index === -1) { + // Add a new filter set + index = filterSets.length; + filterSets.push(filter); + } else if (index > -1 && index < filterSets.length) { + // Update an existing filter set only if the filter set has some changes + if (!_.isEqual(filterSets[index], filter)) { + filterSets[index] = filter; + } + } else { + // Should not have been called with an invalid index to the available filter sets. + console.log("setLastFilter is called with an invalid index: " + index); + return; + } + + PreferencesManager.set("fileFilters", filterSets); + PreferencesManager.setViewState("activeFileFilter", index); + } else { + // Explicitly set to -1 to remove the active file filter + PreferencesManager.setViewState("activeFileFilter", -1); + } + + _updatePicker(); } @@ -161,19 +251,21 @@ define(function (require, exports, module) { * editing UI will indicate how many files are excluded by the filter. Label should be of the form "in ..." * @return {!$.Promise} Dialog box promise */ - function editFilter(filter, context) { - var lastFocus = window.document.activeElement; - + function editFilter(filter, context, index) { var html = StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url) + - "
    " + Strings.FILTER_COUNTING_FILES + "
    "; + "" + + "
    " + + Strings.FILTER_COUNTING_FILES + "
    "; var buttons = [ { className : Dialogs.DIALOG_BTN_CLASS_NORMAL, id: Dialogs.DIALOG_BTN_CANCEL, text: Strings.CANCEL }, { className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, id: Dialogs.DIALOG_BTN_OK, text: Strings.OK } ]; - var dialog = Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, Strings.FILE_FILTER_DIALOG, html, buttons); + var dialog = Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, Strings.FILE_FILTER_DIALOG, html, buttons), + $nameField = dialog.getElement().find(".exclusions-name"), + $editField = dialog.getElement().find(".exclusions-editor"); - var $editField = dialog.getElement().find(".exclusions-editor"); - $editField.val(filter.join("\n")).focus(); + $nameField.val(filter.name).focus(); + $editField.val(filter.patterns.length ? filter.patterns.join("\n") : ""); function getValue() { var newFilter = $editField.val().split("\n"); @@ -187,12 +279,10 @@ define(function (require, exports, module) { dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setLastFilter(getValue()); + setLastFilter({ name: $nameField.val(), patterns: getValue() }, index); } - lastFocus.focus(); // restore focus to old pos }); - // Code to update the file count readout at bottom of dialog (if context provided) var $fileCount = dialog.getElement().find(".exclusions-filecount"); @@ -227,71 +317,262 @@ define(function (require, exports, module) { */ function commitPicker(picker) { var filter = getLastFilter(); - return compile(filter); + return (filter && filter.patterns.length) ? compile(filter.patterns) : ""; } + /** @type {$.Element} jQuery elements used for the dropdown menu */ + var $dropdown, + $dropdownItem; + + /** + * Close the dropdown. + */ + function closeDropdown() { + // Since we passed "true" for autoRemove to addPopUp(), this will + // automatically remove the dropdown from the DOM. Also, PopUpManager + // will call cleanupDropdown(). + if ($dropdown) { + PopUpManager.removePopUp($dropdown); + } + } + + /** + * Remove the various event handlers that close the dropdown. This is called by the + * PopUpManager when the dropdown is closed. + */ + function cleanupDropdown() { + $("html").off("click", closeDropdown); + $dropdown = null; + } + + /** + * Check the list of items to see if any of them are hovered, and if so trigger a mouseenter. + * Normally the mouseenter event handles this, but when a previous item is deleted and the next + * item moves up to be underneath the mouse, we don't get a mouseenter event for that item. + */ + function checkHovers(pageX, pageY) { + $dropdown.children().each(function () { + var offset = $(this).offset(), + width = $(this).outerWidth(), + height = $(this).outerHeight(); + + if (pageX >= offset.left && pageX <= offset.left + width && + pageY >= offset.top && pageY <= offset.top + height) { + $(".recent-filter-link", this).triggerHandler("mouseenter"); + } + }); + } + + /** + * Create the "delete" button that shows up when you hover over a filter set. + */ + function renderDelete() { + return $("
    ×
    ") + .mouseup(function (e) { + // Don't let the click bubble upward. + e.stopPropagation(); + + // Remove the filter set from the preferences and + // clear the active filter set index from view state. + var filterSets = PreferencesManager.get("fileFilters") || [], + activeFilter = getLastFilter(), + activeFilterIndex = _getFilterIndex(filterSets, activeFilter), + filterIndex = _getFilterIndex(filterSets, $(this).parent().data("filter")); + + filterSets.splice(filterIndex, 1); + PreferencesManager.set("fileFilters", filterSets); + + if (activeFilterIndex === filterIndex) { + setLastFilter(); + } else if (activeFilterIndex > filterIndex) { + // Adjust the active filter index after the removal of a filter set before it. + setLastFilter(filterSets[--activeFilterIndex], activeFilterIndex); + } + + $(this).closest("li").remove(); + checkHovers(e.pageX, e.pageY); + }); + } + + /** + * Create the "edit" button that shows up when you hover over a filter set. + */ + function renderEdit() { + return $("") + .mouseup(function (e) { + var filter = $(this).parent().data("filter"), + filterSets = PreferencesManager.get("fileFilters") || []; + + // Don't let the click bubble upward. + e.stopPropagation(); + editFilter(filter, _context, _getFilterIndex(filterSets, filter)); + }); + } + + /** + * Hide the delete and edit button. + */ + function removeDeleteAndEditButtons() { + $("#recent-filter-delete").remove(); + $("#recent-filter-edit").remove(); + } + + /** + * Show the delete and edit buttons over a given target. + * @param {!jQueryObject} $target the dropdown menu item for delete and edit buttons + */ + function addDeleteAndEditButtons($target) { + removeDeleteAndEditButtons(); + renderDelete() + .css("top", $target.position().top + 6) + .prependTo($target); + renderEdit() + .appendTo($target); + } + + /** + * Adds the click and mouse enter/leave events to the dropdown + */ + function _handleListEvents() { + $dropdown + .on("click", "a", function () { + var $link = $(this), + id = $link.attr("id"), + filter = $link.data("filter"), + filterSets = PreferencesManager.get("fileFilters") || []; + + if (filter) { + setLastFilter(filter, _getFilterIndex(filterSets, filter)); + closeDropdown(); + } else if (id === "new-filter-link") { + editFilter({ name: "", patterns: [] }, _context, -1); + } else if (id === "remove-filter-link") { + setLastFilter(); + } + }) + .on("mouseenter", "a", function () { + if ($dropdownItem) { + $dropdownItem.removeClass("selected"); + } + $dropdownItem = $(this).addClass("selected"); + + if ($dropdownItem.hasClass("recent-filter-link")) { + // Note: we can't depend on the event here because this can be triggered + // manually from checkHovers(). + addDeleteAndEditButtons($(this)); + } + }) + .on("mouseleave", "a", function () { + var $link = $(this).removeClass("selected"); + + if ($link.get(0) === $dropdownItem.get(0)) { + $dropdownItem = null; + } + if ($link.hasClass("recent-filter-link")) { + removeDeleteAndEditButtons(); + } + }); + } + /** - * Creates a UI element for selecting a filter, populated with a list of recently used filters and an option to - * edit the selected filter. The edit option is fully functional, but selecting any other item does nothing. The - * client should call commitDropdown() when the UI containing the filter picker is confirmed (which updates the MRU - * order) and then use the returned filter object as needed. + * Create the list of filter sets in the dropdown menu. + * @return {string} The html content + */ + function renderList() { + var templateVars = { + filterList : [], + Strings : Strings + }, + filterSets = PreferencesManager.get("fileFilters") || []; + + filterSets.forEach(function (filter) { + var condensedPatterns = _itemRenderer(filter.patterns), + menuItem = { + filter: JSON.stringify(filter), + name : filter.name || condensedPatterns, + rest : filter.name ? " - " + condensedPatterns : "" + }; + + templateVars.filterList.push(menuItem); + }); + + return Mustache.render(ProjectsMenuTemplate, templateVars); + } + + /** + * Show or hide the recent projects dropdown. + * + * @param {{pageX:number, pageY:number}} position - the absolute position where to open the dropdown + */ + function showDropdown(position) { + // If the dropdown is already visible, just return (so the root + // click handler on htmlwill close it). + if ($dropdown) { + return; + } + + Menus.closeAll(); + + $dropdown = $(renderList()) + .css({ + // Use the relatrive coordinate of the toggle button for "left" since + // the dropdown menu is appended to the Find Bar and not to the document. + left: $("#filter-dropdown-toggle").position().left + 10, + top: position.pageY + 1 + }) + .appendTo($("#find-group")); // Append to Find Bar + +// $dropdown.css("left", $dropdown.position().left - $dropdown.width() + $("#filter-dropdown-toggle").innerWidth()); + PopUpManager.addPopUp($dropdown, cleanupDropdown, true); + + // TODO: should use capture, otherwise clicking on the menus doesn't close it. More fallout + // from the fact that we can't use the Boostrap (1.4) dropdowns. + $("html").on("click", closeDropdown); + + _handleListEvents(); + } + + /** + * Creates a UI element for selecting a filter, populated with a list of recently used filters, an option to + * edit the selected filter and another option to create a new filter. The client should call commitDropdown() + * when the UI containing the filter picker is confirmed (which updates the MRU order) and then use the + * returned filter object as needed. * * @param {?{label:string, promise:$.Promise}} context Info on files filter will apply to - see editFilter() * @return {!jQueryObject} Picker UI. To retrieve the selected value, use commitPicker(). */ function createFilterPicker(context) { - var $picker = $("
    "), - $button = $picker.find("button"); - - function joinBolded(segments) { - return segments - .map(function (seg) { - return "" + _.escape(seg) + ""; - }) - .join(", "); - } - function itemRenderer(filter) { - // Format filter in condensed form - if (filter.length > 2) { - return Strings.FILE_FILTER_LIST_PREFIX + " " + joinBolded(filter.slice(0, 2)) + " " + - StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.length - 2); - } else { - return Strings.FILE_FILTER_LIST_PREFIX + " " + joinBolded(filter); - } - } - - function updatePicker() { - var filter = getLastFilter(); - if (filter.length) { - $button.text(Strings.EDIT_FILE_FILTER); - $picker.find(".filter-label").html(itemRenderer(filter)) - .attr("title", filter.join("\n")); - } else { - $button.text(Strings.NO_FILE_FILTER); - $picker.find(".filter-label").html("").attr("title", ""); - } - } - - updatePicker(); - - $button.click(function () { - editFilter(getLastFilter(), context) - .done(function (buttonId) { - if (buttonId === Dialogs.DIALOG_BTN_OK) { - updatePicker(); - } - }); - }); + var $picker = $("
    " + + "" + + "
    "); + + _context = context; + _$pickerLabel = $picker.find("#filter-title"); + _updatePicker(); return $picker; } + /** + * + */ + function attachPickerToDropdown() { + var cmenuAdapter = { + open: showDropdown, + close: closeDropdown, + isOpen: function () { + return !!$dropdown; + } + }; + Menus.ContextMenu.assignContextMenuToSelector("#filter-dropdown-toggle", cmenuAdapter); + } - exports.createFilterPicker = createFilterPicker; - exports.commitPicker = commitPicker; - exports.getLastFilter = getLastFilter; - exports.editFilter = editFilter; - exports.compile = compile; - exports.filterPath = filterPath; - exports.filterFileList = filterFileList; + exports.createFilterPicker = createFilterPicker; + exports.commitPicker = commitPicker; + exports.getLastFilter = getLastFilter; + exports.editFilter = editFilter; + exports.compile = compile; + exports.filterPath = filterPath; + exports.filterFileList = filterFileList; + exports.attachPickerToDropdown = attachPickerToDropdown; }); diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 456b1108e9a..9195e2ac60a 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -1019,6 +1019,7 @@ define(function (require, exports, module) { filterPicker = FileFilters.createFilterPicker(exclusionsContext); this.modalBar.getRoot().find("#find-group").append(filterPicker); + FileFilters.attachPickerToDropdown(); } // Initial UI state (including prepopulated initialString passed into template) diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 3b00a091abc..26e47384c14 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1199,19 +1199,124 @@ a, img { } // File exclusion filter (used only in Find in Files search bar, for now) -.filter-picker { +.filter-dropdown-arrow { display: inline-block; - margin-left: 8px; - button { - margin-left: 8px; - } + top: -2px; + width: 7px; + height: 5px; + margin-left: 4px; + background-image: url("images/down-arrow.svg"); + background-repeat: no-repeat; + position: relative; +} + +.filter-trash-icon { + position: absolute; + left: 7px; + width: 16px; + height: 16px; + font-size: 20px; + color: rgba(0, 0, 0, 0.5); + line-height: 15px; + text-align: center; +} + +.filter-trash-icon:hover { + color: rgba(0, 0, 0, 1); +} + +.filter-edit-icon { + /*display: inline-block;*/ + float: right; + width: 13px; + height: 13px; + background-image: url("images/edit-icon.svg"); + background-repeat: no-repeat; +} + +#filter-dropdown-toggle { + display: inline-block; + margin-left: 10px; + overflow: hidden; + padding: 2px 7px; + white-space: nowrap; + vertical-align: middle; +} + +#filter-title { + /* vertical align center text */ + height: 21px; + line-height: 21px; + padding-right: 30px; +} + +#filter-dropdown-toggle:hover .dropdown-arrow { + background-image: url("down-arrow.svg"); +} + +#filter-dropdown.dropdown-menu:focus { + outline: none; +} + +#filter-dropdown.dropdown-menu { + position: absolute; + + /* offset for better alignment with the button */ + margin-top: -1px; + margin-left: 1px; + + display: block; + max-width: none; + z-index: 100; +} + +#filter-dropdown.dropdown-menu .divider { + margin: 5px 1px; +} + +.recent-filter-link, .recent-filter-name, .recent-filter-patterns { + white-space: nowrap; +} + +#filter-dropdown.dropdown-menu .recent-filter-link, +#filter-dropdown.dropdown-menu #new-filter-link, +#filter-dropdown.dropdown-menu #remove-filter-link { + display: block; + width: 85%; + box-sizing: padding-box; + padding: 5px 50px 5px 26px; +} + +.recent-filter-name, #new-filter-link, #remove-filter-link { + color: #454545; +} + +.recent-filter-patterns { + color: #aaa; +} + +#filter-dropdown.dropdown-menu a.selected { + background: #E0F0FA; +} + +#filter-dropdown.dropdown-menu a:not(.selected):hover { + background: none; } // File exclusion filter editor dialog +input.exclusions-name { + display: block; + width: 100%; + height: 30px; + box-sizing: border-box; // needed for width: 100% since it has padding + margin-top: 12px; + margin-bottom: 0; + .code-font(); +} textarea.exclusions-editor { display: block; width: 100%; - height: 160px; + height: 120px; box-sizing: border-box; // needed for width: 100% since it has padding margin-top: 12px; margin-bottom: 0; From 0e73ef83dd60cd01b92d9438ec050141d32a68cb Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Mon, 12 May 2014 12:28:58 -0700 Subject: [PATCH 030/125] Adding the template for the filter dropdown menu. --- src/htmlContent/filters-menu.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/htmlContent/filters-menu.html diff --git a/src/htmlContent/filters-menu.html b/src/htmlContent/filters-menu.html new file mode 100644 index 00000000000..06276eb2522 --- /dev/null +++ b/src/htmlContent/filters-menu.html @@ -0,0 +1,17 @@ + From 4d540f7f58252f7774a8652b3e6b0c2fe9a257f0 Mon Sep 17 00:00:00 2001 From: Lance Campbell Date: Mon, 12 May 2014 13:27:56 -0700 Subject: [PATCH 031/125] Fix for issue #7458: View doesn't scroll down after Edit > Move Line Down --- src/editor/EditorCommandHandlers.js | 36 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index 5cb11d464c9..e03cf0bf9da 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -726,14 +726,17 @@ define(function (require, exports, module) { return; } - var doc = editor.document, - lineSelections = editor.convertToLineSelections(editor.getSelections()), - isInlineWidget = !!EditorManager.getFocusedInlineWidget(), - firstLine = editor.getFirstVisibleLine(), - lastLine = editor.getLastVisibleLine(), - totalLines = editor.lineCount(), - lineLength = 0, - edits = []; + var doc = editor.document, + lineSelections = editor.convertToLineSelections(editor.getSelections()), + isInlineWidget = !!EditorManager.getFocusedInlineWidget(), + firstLine = editor.getFirstVisibleLine(), + lastLine = editor.getLastVisibleLine(), + totalLines = editor.lineCount(), + lineLength = 0, + edits = [], + newSels = [], + sel = {}, + pos = {}; _.each(lineSelections, function (lineSel) { var sel = lineSel.selectionForEdit, @@ -799,11 +802,26 @@ define(function (require, exports, module) { break; } }); + + // Make sure correct selections are made and scrolled into view if (edits.length) { - var newSels = doc.doMultipleEdits(edits); + newSels = doc.doMultipleEdits(edits); + if (direction === DIRECTION_UP) { editor.setSelections(newSels); + sel = _.first(editor.getSelections()); + pos.ch = sel.start.ch; + pos.line = sel.start.line; + } else if (direction === DIRECTION_DOWN) { + sel = _.last(editor.getSelections()); + pos.ch = sel.end.ch; + pos.line = sel.end.line; + } else { + console.error("EditorCommandHandler.moveLine() called with invalid argument 'direction' = %d", direction); + pos = null; } + + editor._codeMirror.scrollIntoView(pos); } } From e6ef41a88c8ae45c66480bf84d51e0b2141bd106 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 13 May 2014 17:22:40 -0700 Subject: [PATCH 032/125] Switch to DropdownButton widget for filter picker. --- src/search/FileFilters.js | 342 ++++++++++++---------------------- src/search/FindInFiles.js | 1 - src/styles/brackets.less | 81 +------- src/widgets/DropdownButton.js | 12 +- 4 files changed, 134 insertions(+), 302 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index bdb4184be19..c08f4bc1a9b 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -36,16 +36,35 @@ define(function (require, exports, module) { DefaultDialogs = require("widgets/DefaultDialogs"), Dialogs = require("widgets/Dialogs"), DropdownButton = require("widgets/DropdownButton").DropdownButton, - Menus = require("command/Menus"), - PopUpManager = require("widgets/PopUpManager"), StringUtils = require("utils/StringUtils"), Strings = require("strings"), - PreferencesManager = require("preferences/PreferencesManager"), - ProjectsMenuTemplate = require("text!htmlContent/filters-menu.html"); + PreferencesManager = require("preferences/PreferencesManager"); - var _context = null, - _$pickerLabel = null; + var FIRST_FILTER_INDEX = 3; + var _context = null, + _picker = null; + + /** + * Populate the list of dropdown menu with two filter commands and + * the list of saved filter sets. + */ + function _doPopulate() { + var dropdownItems = [Strings.NEW_FILE_FILTER, Strings.CLEAR_FILE_FILTER], + filterSets = PreferencesManager.get("fileFilters") || []; + + if (filterSets.length) { + dropdownItems.push("---"); + dropdownItems = dropdownItems.concat(filterSets); + } + _picker.items = dropdownItems; + } + + /** + * Find the index of a filter set in the list of saved filter sets. + * @param {Array.<{name: string, patterns: Array.}>} filterSets + * @param {{name: string, patterns: Array.}} filter + */ function _getFilterIndex(filterSets, filter) { var index = -1, found = false; @@ -67,7 +86,7 @@ define(function (require, exports, module) { /** * A search filter is an array of one or more glob strings. The filter must be 'compiled' via compile() * before passing to filterPath()/filterFileList(). - * @return {?Array.} + * @return {?{name: string, patterns: Array.}} */ function getLastFilter() { var filterSets = PreferencesManager.get("fileFilters") || [], @@ -93,7 +112,11 @@ define(function (require, exports, module) { return activeFilter; } - function _itemRenderer(filter) { + /** + * Get the condensed form of the filter set by joining the first two in the set with + * a comma separator and appending a short message with the number of filters being clipped. + */ + function _getCondensedForm(filter) { // Format filter in condensed form if (filter.length > 2) { return filter.slice(0, 2).join(", ") + " " + @@ -103,22 +126,26 @@ define(function (require, exports, module) { } } + /** + * Update the picker button label with the name/patterns of the selected filter or + * No Files Excluded if no filter is selected. + */ function _updatePicker() { var filter = getLastFilter(); if (filter && filter.patterns.length) { - var label = filter.name || _itemRenderer(filter.patterns); - _$pickerLabel.text(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); + var label = filter.name || _getCondensedForm(filter.patterns); + _picker.$button.text(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); } else { - _$pickerLabel.text(Strings.NO_FILE_FILTER); + _picker.$button.text(Strings.NO_FILE_FILTER); } } /** - * Sets the value of getLastFilter(). Automatically set when editFilter() is completed. - * If no filter is passed in, then clear the last active filter index. + * Sets and save the index of the active filter. Automatically set when editFilter() is completed. + * If no filter is passed in, then clear the last active filter index by setting it to -1. * * @param {{name: string, patterns: Array.}=} filter - * @param {number=} index The index of the filter set in the MRU list or -1 if it is a new one + * @param {number=} index The index of the filter set in the list of saved filter sets or -1 if it is a new one */ function setLastFilter(filter, index) { var filterSets = PreferencesManager.get("fileFilters") || []; @@ -246,9 +273,11 @@ define(function (require, exports, module) { /** * Opens a dialog box to edit the given filter. When editing is finished, the value of getLastFilter() changes to * reflect the edits. If the dialog was canceled, the preference is left unchanged. - * @param {!Array.} filter + * @param {!{name: string, patterns: Array.}} filter * @param {?{label:string, promise:$.Promise}} context Info on which files the filter will be applied to. If specified, * editing UI will indicate how many files are excluded by the filter. Label should be of the form "in ..." + * @param {number} index The index of the filter set to be edited or created. The value is -1 if it is for a new one + * to be created, * @return {!$.Promise} Dialog box promise */ function editFilter(filter, context, index) { @@ -280,6 +309,7 @@ define(function (require, exports, module) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference setLastFilter({ name: $nameField.val(), patterns: getValue() }, index); + _doPopulate(); } }); @@ -320,218 +350,51 @@ define(function (require, exports, module) { return (filter && filter.patterns.length) ? compile(filter.patterns) : ""; } - /** @type {$.Element} jQuery elements used for the dropdown menu */ - var $dropdown, - $dropdownItem; - /** - * Close the dropdown. + * Set up mouse click events for 'Delete' and 'Edit' buttons + * when the dropdown is open. + * @param {!Event>} event openDropdown event triggered when the dropdown is open + * @param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list */ - function closeDropdown() { - // Since we passed "true" for autoRemove to addPopUp(), this will - // automatically remove the dropdown from the DOM. Also, PopUpManager - // will call cleanupDropdown(). - if ($dropdown) { - PopUpManager.removePopUp($dropdown); - } - } - - /** - * Remove the various event handlers that close the dropdown. This is called by the - * PopUpManager when the dropdown is closed. - */ - function cleanupDropdown() { - $("html").off("click", closeDropdown); - $dropdown = null; - } - - /** - * Check the list of items to see if any of them are hovered, and if so trigger a mouseenter. - * Normally the mouseenter event handles this, but when a previous item is deleted and the next - * item moves up to be underneath the mouse, we don't get a mouseenter event for that item. - */ - function checkHovers(pageX, pageY) { - $dropdown.children().each(function () { - var offset = $(this).offset(), - width = $(this).outerWidth(), - height = $(this).outerHeight(); - - if (pageX >= offset.left && pageX <= offset.left + width && - pageY >= offset.top && pageY <= offset.top + height) { - $(".recent-filter-link", this).triggerHandler("mouseenter"); - } - }); - } + function _handleListEvents(event, $dropdown) { + $dropdown.find(".filter-trash-icon") + .on("click", function (e) { + // Remove the filter set from the preferences and + // clear the active filter set index from view state. + var filterSets = PreferencesManager.get("fileFilters") || [], + activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), + filterIndex = $(this).parent().data("index") - FIRST_FILTER_INDEX; - /** - * Create the "delete" button that shows up when you hover over a filter set. - */ - function renderDelete() { - return $("
    ×
    ") - .mouseup(function (e) { // Don't let the click bubble upward. e.stopPropagation(); - // Remove the filter set from the preferences and - // clear the active filter set index from view state. - var filterSets = PreferencesManager.get("fileFilters") || [], - activeFilter = getLastFilter(), - activeFilterIndex = _getFilterIndex(filterSets, activeFilter), - filterIndex = _getFilterIndex(filterSets, $(this).parent().data("filter")); - filterSets.splice(filterIndex, 1); PreferencesManager.set("fileFilters", filterSets); - + if (activeFilterIndex === filterIndex) { + // Removing the active filter, so clear the active filter + // both in the view state and the picker button label. setLastFilter(); - } else if (activeFilterIndex > filterIndex) { - // Adjust the active filter index after the removal of a filter set before it. - setLastFilter(filterSets[--activeFilterIndex], activeFilterIndex); } - + + _doPopulate(); + + // Explicitly remove the list item to refresh the dropdown menu $(this).closest("li").remove(); - checkHovers(e.pageX, e.pageY); }); - } + + $dropdown.find(".filter-edit-icon") + .on("click", function (e) { + var filterSets = PreferencesManager.get("fileFilters") || [], + filterIndex = $(this).parent().data("index") - FIRST_FILTER_INDEX; - /** - * Create the "edit" button that shows up when you hover over a filter set. - */ - function renderEdit() { - return $("") - .mouseup(function (e) { - var filter = $(this).parent().data("filter"), - filterSets = PreferencesManager.get("fileFilters") || []; - // Don't let the click bubble upward. e.stopPropagation(); - editFilter(filter, _context, _getFilterIndex(filterSets, filter)); - }); - } - - /** - * Hide the delete and edit button. - */ - function removeDeleteAndEditButtons() { - $("#recent-filter-delete").remove(); - $("#recent-filter-edit").remove(); - } - - /** - * Show the delete and edit buttons over a given target. - * @param {!jQueryObject} $target the dropdown menu item for delete and edit buttons - */ - function addDeleteAndEditButtons($target) { - removeDeleteAndEditButtons(); - renderDelete() - .css("top", $target.position().top + 6) - .prependTo($target); - renderEdit() - .appendTo($target); - } - - /** - * Adds the click and mouse enter/leave events to the dropdown - */ - function _handleListEvents() { - $dropdown - .on("click", "a", function () { - var $link = $(this), - id = $link.attr("id"), - filter = $link.data("filter"), - filterSets = PreferencesManager.get("fileFilters") || []; - - if (filter) { - setLastFilter(filter, _getFilterIndex(filterSets, filter)); - closeDropdown(); - } else if (id === "new-filter-link") { - editFilter({ name: "", patterns: [] }, _context, -1); - } else if (id === "remove-filter-link") { - setLastFilter(); - } - }) - .on("mouseenter", "a", function () { - if ($dropdownItem) { - $dropdownItem.removeClass("selected"); - } - $dropdownItem = $(this).addClass("selected"); - - if ($dropdownItem.hasClass("recent-filter-link")) { - // Note: we can't depend on the event here because this can be triggered - // manually from checkHovers(). - addDeleteAndEditButtons($(this)); - } - }) - .on("mouseleave", "a", function () { - var $link = $(this).removeClass("selected"); - if ($link.get(0) === $dropdownItem.get(0)) { - $dropdownItem = null; - } - if ($link.hasClass("recent-filter-link")) { - removeDeleteAndEditButtons(); - } + editFilter(filterSets[filterIndex], _context, filterIndex); }); } - - /** - * Create the list of filter sets in the dropdown menu. - * @return {string} The html content - */ - function renderList() { - var templateVars = { - filterList : [], - Strings : Strings - }, - filterSets = PreferencesManager.get("fileFilters") || []; - - filterSets.forEach(function (filter) { - var condensedPatterns = _itemRenderer(filter.patterns), - menuItem = { - filter: JSON.stringify(filter), - name : filter.name || condensedPatterns, - rest : filter.name ? " - " + condensedPatterns : "" - }; - - templateVars.filterList.push(menuItem); - }); - - return Mustache.render(ProjectsMenuTemplate, templateVars); - } - - /** - * Show or hide the recent projects dropdown. - * - * @param {{pageX:number, pageY:number}} position - the absolute position where to open the dropdown - */ - function showDropdown(position) { - // If the dropdown is already visible, just return (so the root - // click handler on htmlwill close it). - if ($dropdown) { - return; - } - - Menus.closeAll(); - - $dropdown = $(renderList()) - .css({ - // Use the relatrive coordinate of the toggle button for "left" since - // the dropdown menu is appended to the Find Bar and not to the document. - left: $("#filter-dropdown-toggle").position().left + 10, - top: position.pageY + 1 - }) - .appendTo($("#find-group")); // Append to Find Bar - -// $dropdown.css("left", $dropdown.position().left - $dropdown.width() + $("#filter-dropdown-toggle").innerWidth()); - PopUpManager.addPopUp($dropdown, cleanupDropdown, true); - - // TODO: should use capture, otherwise clicking on the menus doesn't close it. More fallout - // from the fact that we can't use the Boostrap (1.4) dropdowns. - $("html").on("click", closeDropdown); - - _handleListEvents(); - } - + /** * Creates a UI element for selecting a filter, populated with a list of recently used filters, an option to * edit the selected filter and another option to create a new filter. The client should call commitDropdown() @@ -542,29 +405,55 @@ define(function (require, exports, module) { * @return {!jQueryObject} Picker UI. To retrieve the selected value, use commitPicker(). */ function createFilterPicker(context) { - var $picker = $("
    " + - "" + - "
    "); + + function itemRenderer(item, index) { + if (index < FIRST_FILTER_INDEX) { + if (index === FIRST_FILTER_INDEX - 1) { + // Return an empty string for the divider + return ""; + } + // Prefix the two filter commands with 'recent-filter-name' so that + // they also get the same padding-left as the actual filters. + return "" + _.escape(item); + } + var condensedPatterns = _getCondensedForm(item.patterns), + menuItem = "
    ×
    " + + ""; + + menuItem += _.escape(item.name || condensedPatterns); + menuItem += ""; + menuItem += (item.name ? _.escape(" - " + condensedPatterns) : ""); + menuItem += ""; + + return menuItem; + } + _context = context; - _$pickerLabel = $picker.find("#filter-title"); + _picker = new DropdownButton("", [], itemRenderer); + _doPopulate(); _updatePicker(); - return $picker; - } - - /** - * - */ - function attachPickerToDropdown() { - var cmenuAdapter = { - open: showDropdown, - close: closeDropdown, - isOpen: function () { - return !!$dropdown; + // Add 'file-filter-picker' to keep some margin space on the left of the button + _picker.$button.addClass("file-filter-picker"); + + // Set up mouse click events for 'Delete' and 'Edit' buttons + $(_picker).on("openDropdown", _handleListEvents); + + $(_picker).on("select", function (event, item, itemIndex) { + if (itemIndex === 0) { + // Create a new filter set + editFilter({ name: "", patterns: [] }, _context, -1); + } else if (itemIndex === 1) { + // Clear the active filter + setLastFilter(); + } else if (itemIndex >= FIRST_FILTER_INDEX && item) { + var filterSets = PreferencesManager.get("fileFilters") || []; + setLastFilter(item, itemIndex - FIRST_FILTER_INDEX); } - }; - Menus.ContextMenu.assignContextMenuToSelector("#filter-dropdown-toggle", cmenuAdapter); + }); + + return _picker.$button; } exports.createFilterPicker = createFilterPicker; @@ -574,5 +463,4 @@ define(function (require, exports, module) { exports.compile = compile; exports.filterPath = filterPath; exports.filterFileList = filterFileList; - exports.attachPickerToDropdown = attachPickerToDropdown; }); diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 9195e2ac60a..456b1108e9a 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -1019,7 +1019,6 @@ define(function (require, exports, module) { filterPicker = FileFilters.createFilterPicker(exclusionsContext); this.modalBar.getRoot().find("#find-group").append(filterPicker); - FileFilters.attachPickerToDropdown(); } // Initial UI state (including prepopulated initialString passed into template) diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 26e47384c14..375149c19a6 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1199,17 +1199,6 @@ a, img { } // File exclusion filter (used only in Find in Files search bar, for now) -.filter-dropdown-arrow { - display: inline-block; - top: -2px; - width: 7px; - height: 5px; - margin-left: 4px; - background-image: url("images/down-arrow.svg"); - background-repeat: no-repeat; - position: relative; -} - .filter-trash-icon { position: absolute; left: 7px; @@ -1219,6 +1208,7 @@ a, img { color: rgba(0, 0, 0, 0.5); line-height: 15px; text-align: center; + visibility: hidden; } .filter-trash-icon:hover { @@ -1232,75 +1222,24 @@ a, img { height: 13px; background-image: url("images/edit-icon.svg"); background-repeat: no-repeat; + visibility: hidden; } -#filter-dropdown-toggle { - display: inline-block; - margin-left: 10px; - overflow: hidden; - padding: 2px 7px; - white-space: nowrap; - vertical-align: middle; -} - -#filter-title { - /* vertical align center text */ - height: 21px; - line-height: 21px; - padding-right: 30px; -} - -#filter-dropdown-toggle:hover .dropdown-arrow { - background-image: url("down-arrow.svg"); -} - -#filter-dropdown.dropdown-menu:focus { - outline: none; -} - -#filter-dropdown.dropdown-menu { - position: absolute; - - /* offset for better alignment with the button */ - margin-top: -1px; - margin-left: 1px; - - display: block; - max-width: none; - z-index: 100; -} - -#filter-dropdown.dropdown-menu .divider { - margin: 5px 1px; -} - -.recent-filter-link, .recent-filter-name, .recent-filter-patterns { - white-space: nowrap; -} - -#filter-dropdown.dropdown-menu .recent-filter-link, -#filter-dropdown.dropdown-menu #new-filter-link, -#filter-dropdown.dropdown-menu #remove-filter-link { - display: block; - width: 85%; - box-sizing: padding-box; - padding: 5px 50px 5px 26px; +li:hover .filter-trash-icon, +li:hover .filter-edit-icon { + visibility: visible; } -.recent-filter-name, #new-filter-link, #remove-filter-link { - color: #454545; +.recent-filter-name { + padding-left: 12px; } .recent-filter-patterns { - color: #aaa; -} - -#filter-dropdown.dropdown-menu a.selected { - background: #E0F0FA; + padding-right: 52px; } -#filter-dropdown.dropdown-menu a:not(.selected):hover { - background: none; +button.file-filter-picker { + margin-left: 10px; } // File exclusion filter editor dialog diff --git a/src/widgets/DropdownButton.js b/src/widgets/DropdownButton.js index e098490e8ff..ff0bc94dcda 100644 --- a/src/widgets/DropdownButton.js +++ b/src/widgets/DropdownButton.js @@ -112,9 +112,13 @@ define(function (require, exports, module) { DropdownButton.prototype._renderList = function () { var html = ""; this.items.forEach(function (item, i) { - html += "
  • "; - html += this.itemRenderer(item, i); - html += "
  • "; + if (item === "---") { + html += "
  • "; + } else { + html += "
  • "; + html += this.itemRenderer(item, i); + html += "
  • "; + } }.bind(this)); return html; }; @@ -178,6 +182,8 @@ define(function (require, exports, module) { $dropdown.focus(); this.$dropdown = $dropdown; + + $(this).triggerHandler("openDropdown", [$dropdown]); }; /** From 0c0c44ddd695d9792935ceeae73285618abdb5f6 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 13 May 2014 19:17:08 -0700 Subject: [PATCH 033/125] Remove the unneeded template --- src/htmlContent/filters-menu.html | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/htmlContent/filters-menu.html diff --git a/src/htmlContent/filters-menu.html b/src/htmlContent/filters-menu.html deleted file mode 100644 index 06276eb2522..00000000000 --- a/src/htmlContent/filters-menu.html +++ /dev/null @@ -1,17 +0,0 @@ - From 47cacb6b16e8440409d46f9e23e7ba3b8b1b1ec5 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 13 May 2014 19:28:14 -0700 Subject: [PATCH 034/125] Remove unneeded whitespace. --- src/search/FileFilters.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index c08f4bc1a9b..daf8497bcae 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -31,15 +31,15 @@ define(function (require, exports, module) { "use strict"; - var _ = require("thirdparty/lodash"), - ProjectManager = require("project/ProjectManager"), - DefaultDialogs = require("widgets/DefaultDialogs"), - Dialogs = require("widgets/Dialogs"), - DropdownButton = require("widgets/DropdownButton").DropdownButton, - StringUtils = require("utils/StringUtils"), - Strings = require("strings"), - PreferencesManager = require("preferences/PreferencesManager"); - + var _ = require("thirdparty/lodash"), + ProjectManager = require("project/ProjectManager"), + DefaultDialogs = require("widgets/DefaultDialogs"), + Dialogs = require("widgets/Dialogs"), + DropdownButton = require("widgets/DropdownButton").DropdownButton, + StringUtils = require("utils/StringUtils"), + Strings = require("strings"), + PreferencesManager = require("preferences/PreferencesManager"); + var FIRST_FILTER_INDEX = 3; var _context = null, _picker = null; @@ -456,11 +456,11 @@ define(function (require, exports, module) { return _picker.$button; } - exports.createFilterPicker = createFilterPicker; - exports.commitPicker = commitPicker; - exports.getLastFilter = getLastFilter; - exports.editFilter = editFilter; - exports.compile = compile; - exports.filterPath = filterPath; - exports.filterFileList = filterFileList; + exports.createFilterPicker = createFilterPicker; + exports.commitPicker = commitPicker; + exports.getLastFilter = getLastFilter; + exports.editFilter = editFilter; + exports.compile = compile; + exports.filterPath = filterPath; + exports.filterFileList = filterFileList; }); From 72e2c2dc109a8f162570677b40594954139ad522 Mon Sep 17 00:00:00 2001 From: Lawrence Hsu Date: Tue, 13 May 2014 20:48:21 -0700 Subject: [PATCH 035/125] Visual tweaks. The styling that affects other dropdown menu is the top and bottom padding that makes the visual form better. --- src/styles/brackets.less | 14 +++++++++++--- src/styles/brackets_patterns_override.less | 6 +++++- src/styles/images/edit-icon.svg | 9 +++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/styles/images/edit-icon.svg diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 375149c19a6..86101f13fac 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1222,7 +1222,15 @@ a, img { height: 13px; background-image: url("images/edit-icon.svg"); background-repeat: no-repeat; + opacity: 0.5; visibility: hidden; + position: relative; + top: 2px; + right: -4px; +} + +.filter-edit-icon:hover { + opacity: 1; } li:hover .filter-trash-icon, @@ -1235,6 +1243,7 @@ li:hover .filter-edit-icon { } .recent-filter-patterns { + color: @tc-light-weight-quiet-text; padding-right: 52px; } @@ -1250,20 +1259,19 @@ input.exclusions-name { box-sizing: border-box; // needed for width: 100% since it has padding margin-top: 12px; margin-bottom: 0; - .code-font(); } textarea.exclusions-editor { display: block; width: 100%; height: 120px; box-sizing: border-box; // needed for width: 100% since it has padding - margin-top: 12px; + margin-top: 5px; margin-bottom: 0; .code-font(); } .exclusions-filecount { margin: 12px 0 -20px 0; - padding: 4px 6px; + padding: 4px 8px; background-color: @tc-highlight; border-radius: @tc-control-border-radius; } diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 760f940c02c..28bd7754cce 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -464,7 +464,7 @@ a:focus { &.dropdown-menu { border: none; border-radius: @tc-control-border-radius; - padding: 0; + padding: 5px 0; position: absolute; display: block; box-shadow: @tc-dropdown-shadow; @@ -491,6 +491,10 @@ a:focus { &.dropdown-menu a:not(.selected):hover { background: none; } + + .divider { + margin: 5px 1px; + } } /* Inline editor stylesheet-picker DropdownButton */ diff --git a/src/styles/images/edit-icon.svg b/src/styles/images/edit-icon.svg new file mode 100644 index 00000000000..2a6a468d0cf --- /dev/null +++ b/src/styles/images/edit-icon.svg @@ -0,0 +1,9 @@ + + + + + + From 02da96d38c6622032f865eb4ec5927eeb3cbb277 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Tue, 13 May 2014 17:48:16 -0300 Subject: [PATCH 036/125] Russian translation update for Sprint 39. --- src/nls/ru/strings.js | 77 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/src/nls/ru/strings.js b/src/nls/ru/strings.js index 99fba915226..4dead05e9c4 100644 --- a/src/nls/ru/strings.js +++ b/src/nls/ru/strings.js @@ -37,6 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "Целевая директория не может быть изменена.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Ограничение прав не позволяет сделать изменения.", "CONTENTS_MODIFIED_ERR" : "Файл был изменен другим приложением.", + "UNSUPPORTED_ENCODING_ERR" : "Файл не является текстовым файлом в кодировке UTF-8.", "FILE_EXISTS_ERR" : "Файл уже существует.", "FILE" : "файл", "DIRECTORY" : "директория", @@ -65,6 +66,10 @@ define({ "ERROR_CREATING_FILE_TITLE" : "Ошибка создания файла", "ERROR_CREATING_FILE" : "Произошла ошибка при попытке создать файл {0}. {1}", + // Application preferences corrupt error strings + "ERROR_PREFS_CORRUPT_TITLE" : "Ошибка чтения настроек", + "ERROR_PREFS_CORRUPT" : "Обнаружена ошибка формата JSON в файле настроек. Он будет открыт для того, чтобы исправить ошибку вручную. Вам будет необходимо перезагрузить {APP_NAME}, чтобы исправления вступили в силу.", + // Application error strings "ERROR_IN_BROWSER_TITLE" : "К сожалению, запуск {APP_NAME} в браузере пока что не поддерживается.", "ERROR_IN_BROWSER" : "{APP_NAME} разработан на HTML, но пока что может работать только как настольное приложение, чтобы вы могли редактировать локальные файлы. Пожалуйста, используйте специальную оболочку (проект github.com/adobe/brackets-shell) для запуска {APP_NAME}.", @@ -73,7 +78,7 @@ define({ "ERROR_MAX_FILES_TITLE" : "Ошибка индексирования файлов", "ERROR_MAX_FILES" : "Количество файлов превышает предельно допустимое. Команды использующие индекс файлов могут работать некорректно.", - // Live Development error strings + // Live Preview error strings "ERROR_LAUNCHING_BROWSER_TITLE" : "Ошибка запуска браузера.", "ERROR_CANT_FIND_CHROME" : "Браузер Google Chrome не найден. Пожалуйста, убедитесь, что он установлен.", "ERROR_LAUNCHING_BROWSER" : "Произошла ошибка при запуске браузера. (ошибка {0})", @@ -156,6 +161,7 @@ define({ "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} в {3} {4}", "FIND_IN_FILES_SCOPED" : "в {0}", "FIND_IN_FILES_NO_SCOPE" : "в проекте", + "FIND_IN_FILES_ZERO_FILES" : "Фильтр исключает все файлы {0}", "FIND_IN_FILES_FILE" : "файле", "FIND_IN_FILES_FILES" : "файлах", "FIND_IN_FILES_MATCH" : "совпадение", @@ -163,8 +169,33 @@ define({ "FIND_IN_FILES_MORE_THAN" : "Более ", "FIND_IN_FILES_PAGING" : "{0}—{1}", "FIND_IN_FILES_FILE_PATH" : "{0} {2} {1}", // We shoudl use normal dashes on Windows instead of em dash eventually + "FIND_IN_FILES_EXPAND_COLLAPSE" : "Ctrl/Cmd-клик чтобы развернуть/свернуть все", "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Ошибка при получении информации об обновлениях", "ERROR_FETCHING_UPDATE_INFO_MSG" : "Ошибка при получении информации о последних обновлениях с сервера. Пожалуйста, убедитесь, что вы подключены к интернету и попробуйте снова. ", + + // File exclusion filters + "NO_FILE_FILTER" : "Исключить файлы\u2026", + "EDIT_FILE_FILTER" : "Редактировать\u2026", + "FILE_FILTER_DIALOG" : "Редактировать фильтр", + "FILE_FILTER_INSTRUCTIONS" : "Исключить файлы и директории содержащие любую из перечисленных строк, возможно использование групповых символов. Указывайте по одной строке на линию.", + "FILE_FILTER_LIST_PREFIX" : "кроме", + "FILE_FILTER_CLIPPED_SUFFIX" : "и еще {0}", + + "FILTER_COUNTING_FILES" : "Подсчет количества файлов\u2026", + "FILTER_FILE_COUNT" : "Фильтр оставляет {0} из {1} файлов/а {2}", + "FILTER_FILE_COUNT_ALL" : "Фильтр оставляет все {0} файлов/а {1}", + + // Quick Edit + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Быстрое редактирование недоступно для данной позиции курсора", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "Быстрое редактирование CSS: установите курсор на одном из имен класса", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "Быстрое редактирование CSS: отсутствует имя класса", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "Быстрое редактирование CSS: отсутствует имя идентификатора", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "Быстрое редактирование CSS: установите курсор на теге, классе или идентификаторе", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "Быстрое редактирование временной функции CSS: некорректный синтаксис", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "Быстрое редактирование JS: установите курсор на имени функции", + + // Quick Docs + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Быстрая документация для текущей позиции курсора отсутствет", /** * ProjectManager @@ -188,6 +219,7 @@ define({ "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 Выделено {0} столбцов", "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 Выделена {0} строка", "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 Выделено {0} строк", + "STATUSBAR_SELECTION_MULTIPLE" : "\u2014 {0} выбранных элементов", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Нажмите чтобы использовать пробелы для отступа", "STATUSBAR_INDENT_TOOLTIP_TABS" : "Нажмите чтобы использовать табуляцию для отступа", "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "Нажмите чтобы изменить количества пробелов для отступа", @@ -197,6 +229,8 @@ define({ "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} строка", "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} строк", "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Расширения отключены", + "STATUSBAR_INSERT" : "ВСТ", + "STATUSBAR_OVERWRITE" : "ЗАМ", // CodeInspection: errors/warnings "ERRORS_PANEL_TITLE_MULTIPLE" : "{0} ошибок", @@ -207,6 +241,8 @@ define({ "LINT_DISABLED" : "Статический анализ отключен", "NO_LINT_AVAILABLE" : "Нет статического анализатора для {0}", "NOTHING_TO_LINT" : "Не подлежит статическому анализу", + "LINTER_TIMED_OUT" : "{0} превысил время ожидания {1} мс", + "LINTER_FAILED" : "{0} завершил исполнение с ошибкой: {1}", /** @@ -220,7 +256,7 @@ define({ "CMD_FILE_NEW_FOLDER" : "Новая директория", "CMD_FILE_OPEN" : "Открыть\u2026", "CMD_ADD_TO_WORKING_SET" : "Добавить в рабочий набор", - + "CMD_OPEN_DROPPED_FILES" : "Открыть перетащенные файлы", "CMD_OPEN_FOLDER" : "Открыть директорию\u2026", "CMD_FILE_CLOSE" : "Закрыть", "CMD_FILE_CLOSE_ALL" : "Закрыть все", @@ -251,13 +287,9 @@ define({ "CMD_PASTE" : "Вставить", "CMD_SELECT_ALL" : "Выделить все", "CMD_SELECT_LINE" : "Выделить строку", - "CMD_FIND" : "Найти", - "CMD_FIND_FIELD_PLACEHOLDER" : "Найти\u2026", - "CMD_FIND_IN_FILES" : "Найти в файлах", - "CMD_FIND_IN_SUBTREE" : "Найти в\u2026", - "CMD_FIND_NEXT" : "Найти след.", - "CMD_FIND_PREVIOUS" : "Найти пред.", - "CMD_REPLACE" : "Заменить", + "CMD_SPLIT_SEL_INTO_LINES" : "Разбить выделенное на линии", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Добавить курсор к следующей линии", + "CMD_ADD_CUR_TO_PREV_LINE" : "Добавить курсор к предыдущей линии", "CMD_INDENT" : "Сделать отступ", "CMD_UNINDENT" : "Убрать отступ", "CMD_DUPLICATE" : "Дублировать", @@ -270,6 +302,20 @@ define({ "CMD_OPEN_LINE_BELOW" : "Вставить строку снизу", "CMD_TOGGLE_CLOSE_BRACKETS" : "Автоматически закрывать скобки", "CMD_SHOW_CODE_HINTS" : "Показывать подсказки в коде", + + // Search menu commands + "FIND_MENU" : "Поиск", + "CMD_FIND" : "Найти", + "CMD_FIND_FIELD_PLACEHOLDER" : "Найти\u2026", + "CMD_FIND_NEXT" : "Найти след.", + "CMD_FIND_PREVIOUS" : "Найти пред.", + "CMD_FIND_ALL_AND_SELECT" : "Найти все и выделить", + "CMD_ADD_NEXT_MATCH" : "Добавить следущее найденное к выделению", + "CMD_SKIP_CURRENT_MATCH" : "Пропустить и добавить следующее найденное", + "CMD_FIND_IN_FILES" : "Найти в файлах", + "CMD_FIND_IN_SELECTED" : "Найти в выделенном файле/директории", + "CMD_FIND_IN_SUBTREE" : "Найти в\u2026", + "CMD_REPLACE" : "Заменить", // View menu commands "VIEW_MENU" : "Вид", @@ -304,15 +350,18 @@ define({ "CMD_NEXT_DOC" : "Следующий документ", "CMD_PREV_DOC" : "Предыдущий документ", "CMD_SHOW_IN_TREE" : "Показать в дереве проекта", + "CMD_SHOW_IN_EXPLORER" : "Показать в Проводнике", + "CMD_SHOW_IN_FINDER" : "Показать в Finder", "CMD_SHOW_IN_OS" : "Показать в операционной системе", // Help menu commands "HELP_MENU" : "Помощь", "CMD_CHECK_FOR_UPDATE" : "Проверить на обновления", "CMD_HOW_TO_USE_BRACKETS" : "Как использовать {APP_NAME}", - "CMD_FORUM" : "Форум {APP_NAME}", + "CMD_SUPPORT" : "Поддержка {APP_NAME}", + "CMD_SUGGEST" : "Предложить улучшение", "CMD_RELEASE_NOTES" : "Примечания к выпуску", - "CMD_REPORT_AN_ISSUE" : "Сообщить о проблеме", + "CMD_GET_INVOLVED" : "Примите участие в проекте", "CMD_SHOW_EXTENSIONS_FOLDER" : "Показать директорию расширений", "CMD_TWITTER" : "{TWITTER_NAME} в Twitter", "CMD_ABOUT" : "О {APP_TITLE}", @@ -433,6 +482,9 @@ define({ "INLINE_EDITOR_NO_MATCHES" : "Нет найдено совпадений.", "CSS_QUICK_EDIT_NO_MATCHES" : "Существующих правил CSS соответвующих выделенному тексту не определено.
    Выберите \"Новое правило\" чтобы создать новое.", "CSS_QUICK_EDIT_NO_STYLESHEETS" : "Ваш проект не содержит таблиц стилей (stylesheets).
    Создайте его чтобы добавить правило CSS.", + + // Custom Viewers + "IMAGE_VIEWER_LARGEST_ICON" : "наибольший размер", /** * Unit names @@ -442,6 +494,7 @@ define({ // extensions/default/DebugCommands "DEBUG_MENU" : "Отладка", + "ERRORS" : "Ощибки", "CMD_SHOW_DEV_TOOLS" : "Показать инструменты разработчика", "CMD_REFRESH_WINDOW" : "Перезагрузить {APP_NAME}", "CMD_RELOAD_WITHOUT_USER_EXTS" : "Перегрузить без расширений", @@ -452,6 +505,7 @@ define({ "CMD_ENABLE_NODE_DEBUGGER" : "Включить отладчик node", "CMD_LOG_NODE_STATE" : "Отображать состояние node в консоли", "CMD_RESTART_NODE" : "Перезапустить node", + "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "Показывать ошибки в строке состояния", "LANGUAGE_TITLE" : "Изменить язык", "LANGUAGE_MESSAGE" : "Пожалуйста, выберите желаемый язык из списка ниже:", @@ -464,6 +518,7 @@ define({ "INLINE_TIMING_EDITOR_PROGRESSION" : "Прогрессия", "BEZIER_EDITOR_INFO" : " Передвинуть выделенную точку
    Shift Передвигать на десять единиц", "STEPS_EDITOR_INFO" : " Увеличить или уменьшить шаги
    'Начало' or 'Конец'", + "INLINE_TIMING_EDITOR_INVALID" : "Старое значение {0} некорректно, отображаемая функция была заменена на {1}. Документ будет обновлен с первой правкой.", // extensions/default/InlineColorEditor "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Текущий цвет", From 491530195a8711278896bfa0ba24ee8860669c28 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 13 May 2014 22:22:10 -0700 Subject: [PATCH 037/125] Add no-focus class to the filter picker button and handle focus restoring after closing the Edit Filter dialog. --- src/search/FileFilters.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index daf8497bcae..8529639975e 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -44,7 +44,6 @@ define(function (require, exports, module) { var _context = null, _picker = null; - /** * Populate the list of dropdown menu with two filter commands and * the list of saved filter sets. @@ -281,6 +280,8 @@ define(function (require, exports, module) { * @return {!$.Promise} Dialog box promise */ function editFilter(filter, context, index) { + var lastFocus = window.document.activeElement; + var html = StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url) + "" + "
    " + @@ -311,6 +312,7 @@ define(function (require, exports, module) { setLastFilter({ name: $nameField.val(), patterns: getValue() }, index); _doPopulate(); } + lastFocus.focus(); // restore focus to old po }); // Code to update the file count readout at bottom of dialog (if context provided) @@ -390,7 +392,12 @@ define(function (require, exports, module) { // Don't let the click bubble upward. e.stopPropagation(); - + + // Close the dropdown first before opening the edit filter dialog + // so that it will restore focus to the DOM element that has focus + // prior to opening it. + _picker.closeDropdown(); + editFilter(filterSets[filterIndex], _context, filterIndex); }); } @@ -436,12 +443,18 @@ define(function (require, exports, module) { // Add 'file-filter-picker' to keep some margin space on the left of the button _picker.$button.addClass("file-filter-picker"); + _picker.$button.addClass("no-focus"); // Set up mouse click events for 'Delete' and 'Edit' buttons $(_picker).on("openDropdown", _handleListEvents); $(_picker).on("select", function (event, item, itemIndex) { if (itemIndex === 0) { + // Close the dropdown first before opening the edit filter dialog + // so that it will restore focus to the DOM element that has focus + // prior to opening it. + _picker.closeDropdown(); + // Create a new filter set editFilter({ name: "", patterns: [] }, _context, -1); } else if (itemIndex === 1) { From 79923f7e9678059a5a3c8726659b7ed2b8303188 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Wed, 14 May 2014 10:26:49 -0300 Subject: [PATCH 038/125] Fix typo as per review. --- src/nls/ru/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/ru/strings.js b/src/nls/ru/strings.js index 4dead05e9c4..ca7a2af1332 100644 --- a/src/nls/ru/strings.js +++ b/src/nls/ru/strings.js @@ -494,7 +494,7 @@ define({ // extensions/default/DebugCommands "DEBUG_MENU" : "Отладка", - "ERRORS" : "Ощибки", + "ERRORS" : "Ошибки", "CMD_SHOW_DEV_TOOLS" : "Показать инструменты разработчика", "CMD_REFRESH_WINDOW" : "Перезагрузить {APP_NAME}", "CMD_RELOAD_WITHOUT_USER_EXTS" : "Перегрузить без расширений", From 80e9067ce28aa1e77c3ac9055250304e4aa40aad Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 14 May 2014 13:52:22 -0700 Subject: [PATCH 039/125] contributing directly from github --- src/nls/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/nls/README.md b/src/nls/README.md index 9a9670ec118..c74ac63ebeb 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -89,6 +89,36 @@ point the process will switch to the one above. But until then, please _do not use_ http://translate.adobe.com for these languages. +# Contributing Translations directly from github.com + +You must be logged in to your github.com id (e.g. `user1`). + +### Adding a New Translation +New translations can be added by navigating to the +[nls folder on github](https://github.com/adobe/brackets/tree/master/src/nls) +and then clicking on the [+] button to add a new file. +Subfolders can be added in the path field. + +### Editing an Existing Translation +Existing files can be edited directly in +[brackets repo on github](https://github.com/adobe/brackets). + +Either case will create a pull request with a branch named something like +`patch-1` on your github fork of brackets of the brackets repository +(`https://github.com/user1/brackets`). +If you have not yet forked brackets "repo", it's done automatically. + +Someone on the Brackets team will review the pull request. If it's ok, it will +be merged. If changes need to be made, the reviewer will post comments in the +pull request which will send you an e-mail notification. + +You can make updates in the `patch-1` branch in your github fork of brackets. +Edits show up as a new commit, so they automatically show up in the original +pull request. After making an update, follow the link in the notification +e-mail to the pull request and add a comment such as "Changes made -- ready +for another review" to notify reviewer that it's time to review the changes again. + + # Translation limitations Some strings cannot be localized yet: From 1bd659993614e9dc2a2f21c537ee11fd603fd0bf Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 14 May 2014 14:02:28 -0700 Subject: [PATCH 040/125] update wording --- src/nls/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nls/README.md b/src/nls/README.md index c74ac63ebeb..642c3367077 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -103,7 +103,7 @@ Subfolders can be added in the path field. Existing files can be edited directly in [brackets repo on github](https://github.com/adobe/brackets). -Either case will create a pull request with a branch named something like +Either case will create and submit a pull request with a branch named something like `patch-1` on your github fork of brackets of the brackets repository (`https://github.com/user1/brackets`). If you have not yet forked brackets "repo", it's done automatically. @@ -113,10 +113,12 @@ be merged. If changes need to be made, the reviewer will post comments in the pull request which will send you an e-mail notification. You can make updates in the `patch-1` branch in your github fork of brackets. -Edits show up as a new commit, so they automatically show up in the original -pull request. After making an update, follow the link in the notification -e-mail to the pull request and add a comment such as "Changes made -- ready -for another review" to notify reviewer that it's time to review the changes again. +Follow the link in the notification e-mail to the pull request if you need +to determine which branch to edit. +Saved edits show up as a new commit, so they automatically show up in the original +pull request. After making an update, add a comment to the pull request such as +"Changes made -- ready for another review" to notify reviewer +that it's time to review the changes again. # Translation limitations From 209141ee94e410a1f4120c4dd5c8345fc7ee2cdb Mon Sep 17 00:00:00 2001 From: Olgierd Grzyb Date: Thu, 15 May 2014 01:36:48 +0200 Subject: [PATCH 041/125] Added last translated SHA at end of translation file. Reordered the file to match the original messages file. --- src/nls/pl/strings.js | 474 ++++++++++++++++++++---------------------- 1 file changed, 230 insertions(+), 244 deletions(-) diff --git a/src/nls/pl/strings.js b/src/nls/pl/strings.js index b0324d841d9..8b7051b018d 100644 --- a/src/nls/pl/strings.js +++ b/src/nls/pl/strings.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. + * Copyright (c) 2012 Adobe Systems Incorporated. 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"), @@ -25,6 +25,7 @@ /*global define */ define({ + /** * Errors */ @@ -35,7 +36,11 @@ define({ "NOT_READABLE_ERR" : "Nie można odczytać pliku.", "NO_MODIFICATION_ALLOWED_ERR" : "Nie można zmienić folderu docelowego.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Brak pozwolenia na modyfikację.", + "CONTENTS_MODIFIED_ERR" : "Plik został zmodyfikowany z zewnątrz.", + "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text.", "FILE_EXISTS_ERR" : "Plik już istnieje.", + "FILE" : "plik", + "DIRECTORY" : "folder", // Project error strings "ERROR_LOADING_PROJECT" : "Wystąpił błąd podczas ładowania projektu.", @@ -46,27 +51,34 @@ define({ // File open/save error string "ERROR_OPENING_FILE_TITLE" : "Błąd podczas otwierania pliku", "ERROR_OPENING_FILE" : "Wystąpił błąd podczas próby otwarcia pliku {0}. {1}", + "ERROR_OPENING_FILES" : "Podczas otwierania plików wystąpił błąd:", "ERROR_RELOADING_FILE_TITLE" : "Błąd przy próbie ponownego załadowania pliku z dysku", "ERROR_RELOADING_FILE" : "Wystąpił błąd podczas próby ponownego załadowania pliku. {0}. {1}", "ERROR_SAVING_FILE_TITLE" : "Nie można zapisać pliku", "ERROR_SAVING_FILE" : "Wystąpił błąd podczas próby zapisu pliku {0}. {1}", "ERROR_RENAMING_FILE_TITLE" : "Nie można zmienić nazwy", "ERROR_RENAMING_FILE" : "Wystąpił błąd podczas próby zmiany nazwy pliku {0}. {1}", + "ERROR_DELETING_FILE_TITLE" : "Błąd przy usuwaniu pliku", + "ERROR_DELETING_FILE" : "Podczas usuwania pliku {0} wystąpił błąd: {1}", "INVALID_FILENAME_TITLE" : "Niewłaściwa nazwa pliku", "INVALID_FILENAME_MESSAGE" : "Nazwa pliku nie może zawierać następujących znaków: {0}", "FILE_ALREADY_EXISTS" : "Plik {0} już istnieje.", "ERROR_CREATING_FILE_TITLE" : "Nie można utworzyć pliku", "ERROR_CREATING_FILE" : "Wystąpił błąd podczas próby utworzenia pliku {0}. {1}", + // Application preferences corrupt error strings + "ERROR_PREFS_CORRUPT_TITLE" : "Błąd odczytu ustawień", + "ERROR_PREFS_CORRUPT" : "Twój plik ustawień nie jest poprawnym plikiem JSON. Zostanie on teraz otwarty w edytorze celem poprawienia błędów. Po poprawkach uruchom ponownie {APP_NAME}, aby zastosować zmiany.", + // Application error strings "ERROR_IN_BROWSER_TITLE" : "Oops! {APP_NAME} jeszcze nie działa w przeglądarce", "ERROR_IN_BROWSER" : "{APP_NAME} został zbudowany przy pomocy HTML, jednak na razie działa jedynie jako samodzielna aplikacja. Możesz użyć jej do edycji plików na dysku. Aby uruchomić {APP_NAME} użyj aplikacji dostępnej w tym repozytorium github.com/adobe/brackets-shell.", - // FileIndexManager error string + // ProjectManager max files error string "ERROR_MAX_FILES_TITLE" : "Nie można zindeksować plików", "ERROR_MAX_FILES" : "Maksymalna liczba plików została zindeksowana. Aplikacja indeksująca może pracować nieprawidłowo.", - // Live Development error strings + // Live Preview error strings "ERROR_LAUNCHING_BROWSER_TITLE" : "Nie można otworzyć przeglądarki", "ERROR_CANT_FIND_CHROME" : "Nie znaleziono przeglądarki Chrome. Upewnij się, że jest zainstalowana.", "ERROR_LAUNCHING_BROWSER" : "Wystąpił błąd przy próbie otwarcia przeglądarki. (błąd {0})", @@ -87,54 +99,113 @@ define({ "LIVE_DEV_STATUS_TIP_PROGRESS2" : "Podgląd błyskawiczny: uruchamianie\u2026", "LIVE_DEV_STATUS_TIP_CONNECTED" : "Rozłącz podgląd błyskawiczny", "LIVE_DEV_STATUS_TIP_OUT_OF_SYNC" : "Podgląd błyskawiczny: Kliknij aby rozłączyć (Zapisz plik by zaktualizować)", + "LIVE_DEV_STATUS_TIP_SYNC_ERROR" : "Podgląd błyskawiczny (nieaktualizowany z powodu błędów składniowych)", + + "LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS" : "Błyskawiczny podgląd został anulowany, ponieważ narzędzia deweloperskie przeglądarki były uruchomione", + "LIVE_DEV_DETACHED_TARGET_CLOSED" : "Błyskawiczny podgląd został anulowany, ponieważ strona w przeglądarce została zamknięta", + "LIVE_DEV_NAVIGATED_AWAY" : "Błyskawiczny podgląd został anulowany, ponieważ przeglądarka odwiedziłą link, który nie należy do aktualnego projektu", + "LIVE_DEV_CLOSED_UNKNOWN_REASON" : "Błyskawiczny podgląd został anulowany ({0})", "SAVE_CLOSE_TITLE" : "Zapisz zmiany", "SAVE_CLOSE_MESSAGE" : "Czy chcesz zapisać zmiany w dokumencie {0}?", "SAVE_CLOSE_MULTI_MESSAGE" : "Czy chcesz zapisać zmiany w następujących plikach?", "EXT_MODIFIED_TITLE" : "Zmiany zewnętrzne", + "CONFIRM_FOLDER_DELETE_TITLE" : "Potwierdź usunięcie", + "CONFIRM_FOLDER_DELETE" : "Czy na pewno usunąć folder {0}?", + "FILE_DELETED_TITLE" : "Usunięto", + "EXT_MODIFIED_WARNING" : "{0} został zmodyfikowany na dysku.

    Czy chcesz nadpisać plik obecnie otwartą wersją?", "EXT_MODIFIED_MESSAGE" : "{0} został zmodyfikowany na dysku, jednak zawiera też niezapisane zmiany w {APP_NAME}.

    Którą wersję chcesz zachować?", "EXT_DELETED_MESSAGE" : "{0} został usunięty z dysku, jednak zawiera niezapisane zmiany w {APP_NAME}.

    Czy chcesz zachować zmiany?", - // Find, Replace, Find in Files - "SEARCH_REGEXP_INFO" : "Użyj składni /re/ dla wyszukiwania wyrażeniem regularnym", - "FIND_RESULT_COUNT" : "{0} wyników", - "WITH" : "Na", + // Generic dialog/button labels + "OK" : "OK", + "CANCEL" : "Anuluj", + "DONT_SAVE" : "Nie zapisuj", + "SAVE" : "Zapisz", + "SAVE_AS" : "Zapisz jako…", + "SAVE_AND_OVERWRITE" : "Nadpisz", + "DELETE" : "Usuń", "BUTTON_YES" : "Tak", "BUTTON_NO" : "Nie", - "BUTTON_STOP" : "Stop", + + // Find, Replace, Find in Files + "FIND_RESULT_COUNT" : "{0} wyników", + "FIND_RESULT_COUNT_SINGLE" : "1 wynik", + "FIND_NO_RESULTS" : "Brak wyników", + "REPLACE_PLACEHOLDER" : "Zamień na\u2026", + "BUTTON_REPLACE_ALL" : "Wszystko\u2026", + "BUTTON_REPLACE" : "Zamień", + "BUTTON_NEXT" : "\u25B6", + "BUTTON_PREV" : "\u25C0", + "BUTTON_NEXT_HINT" : "Następny", + "BUTTON_PREV_HINT" : "Poprzedni", + "BUTTON_CASESENSITIVE_HINT" : "Rozróżniaj wielkie i małe litery", + "BUTTON_REGEXP_HINT" : "Wyrażenie regularne", "OPEN_FILE" : "Otwórz plik", + "SAVE_FILE_AS" : "Zapisz plik", "CHOOSE_FOLDER" : "Wybierz folder", "RELEASE_NOTES" : "Informacje o wydaniu", "NO_UPDATE_TITLE" : "{APP_NAME} jest aktualny!", "NO_UPDATE_MESSAGE" : "Aktualnie używasz najnowszej wersji {APP_NAME}.", - "FIND_IN_FILES_TITLE" : "dla \"{4}\" {5} - {0} {1} w {2} {3}", + // Replace All (in single file) + "FIND_REPLACE_TITLE_PART1" : "Zamienianie „", + "FIND_REPLACE_TITLE_PART2" : "” na „", + "FIND_REPLACE_TITLE_PART3" : "” — {2} {0} {1}", + + // Find in Files + "FIND_IN_FILES_TITLE_PART1" : "Znaleziono „", + "FIND_IN_FILES_TITLE_PART2" : "” ", + "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} in {3} {4}", "FIND_IN_FILES_SCOPED" : "w {0}", "FIND_IN_FILES_NO_SCOPE" : "w projekcie", + "FIND_IN_FILES_ZERO_FILES" : "Filtr wyklucza wszystkie pliki {0}", "FIND_IN_FILES_FILE" : "plik", "FIND_IN_FILES_FILES" : "pliki", "FIND_IN_FILES_MATCH" : "dopasowanie", "FIND_IN_FILES_MATCHES" : "dopasowania", "FIND_IN_FILES_MORE_THAN" : "Więcej niż ", - "FIND_IN_FILES_MAX" : " (pokaż pierwsze {0} wyników)", - "FIND_IN_FILES_FILE_PATH" : "Plik: {0}", - "FIND_IN_FILES_LINE" : "linia: {0}", - + "FIND_IN_FILES_PAGING" : "{0}—{1}", + "FIND_IN_FILES_FILE_PATH" : "Plik: {0}", // We should use normal dashes on Windows instead of em dash eventually + "FIND_IN_FILES_EXPAND_COLLAPSE" : "Kliknij w Ctrl/Cmd aby (ro)zwinąć wszystkie", "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Błąd pobierania wersji.", "ERROR_FETCHING_UPDATE_INFO_MSG" : "Wystąpił problem podczas pobierania informacji o najnowszej wersji aplikacji. Upewnij się, że jesteś podłączony do Internetu i spróbuj ponownie.", + // File exclusion filters + "NO_FILE_FILTER" : "Filtruj…", + "EDIT_FILE_FILTER" : "Edytuj…", + "FILE_FILTER_DIALOG" : "Edytuj filtr", + "FILE_FILTER_INSTRUCTIONS" : "Możesz odrzucić pliki o nazwach pasujących do poniższych wzorów lub masek. Każdą regułę umieść w osobnej linii.", + "FILE_FILTER_LIST_PREFIX" : "oprócz", + "FILE_FILTER_CLIPPED_SUFFIX" : "i {0} więcej", + "FILTER_COUNTING_FILES" : "Kalkulowanie…", + "FILTER_FILE_COUNT" : "Przeszukane zostanie {0} z {1} plików {2}", + "FILTER_FILE_COUNT_ALL" : "Przeszukane zostanie wszystkie {0} plików {1}", + + // Quick Edit + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Nie można użyć Szybkiej edycji w tym miejscu", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "Szybka edycja CSS: umieść kursor na nazwie klasy", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "Szybka edycja CSS: nieprawidłowa klasa", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "Szybka edycja CSS: nieprawidłowy identyfikator", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "Szybka edycja CSS: umieść kursor na nazwie znacznika, klasy lub identyfikatora", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "Szybka edycja CSS: nieprawidłowa składnia funkcji czasu", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "Szybka edycja JS: umieść kursor na nazwie funkcji", + + // Quick Docs + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Nie znaleziono dokumentacji dla bieżącego miejsca.", + /** * ProjectManager */ - "PROJECT_LOADING" : "Ładowanie\u2026", - "UNTITLED" : "Bez_nazwy", + "PROJECT_LOADING" : "Ładowanie\u2026", + "UNTITLED" : "Bez_nazwy", + "WORKING_FILES" : "Otwarte pliki", /** * Keyboard modifier names */ - "KEYBOARD_CTRL" : "Ctrl", "KEYBOARD_SHIFT" : "Shift", "KEYBOARD_SPACE" : "Spacja", @@ -143,13 +214,35 @@ define({ * StatusBar strings */ "STATUSBAR_CURSOR_POSITION" : "linia {0}, kolumna {1}", + "STATUSBAR_SELECTION_CH_SINGULAR" : " \u2014 Zaznaczono {0} kolumnę", + "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 Zaznaczono {0} kolumn", + "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 Zaznaczono {0} linię", + "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 Zaznaczono {0} linii", + "STATUSBAR_SELECTION_MULTIPLE" : " — {0} zaznaczeń", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Kliknij, by zmienić wcięcia na spacje.", "STATUSBAR_INDENT_TOOLTIP_TABS" : "Kliknij, by zmienić wcięcia na tabulacje.", "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "Kliknij, by zmienić ilość spacji we wcięciach", "STATUSBAR_INDENT_SIZE_TOOLTIP_TABS" : "Kliknij, by zmienić szerokość tabulacji.", "STATUSBAR_SPACES" : "Spacje", "STATUSBAR_TAB_SIZE" : "Tabulacje", - "STATUSBAR_LINE_COUNT" : "{0} linii(e)", + "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} linia", + "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} linii", + "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Rozszerzenia wyłączone", + "STATUSBAR_INSERT" : "WST", + "STATUSBAR_OVERWRITE" : "ZAS", + + // CodeInspection: errors/warnings + "ERRORS_PANEL_TITLE_MULTIPLE" : "{0} problemów", + "SINGLE_ERROR" : "1 błąd {0}", + "MULTIPLE_ERRORS" : "{1} błędów {0} ", + "NO_ERRORS" : "Brak błędów – dobra robota!", + "NO_ERRORS_MULTIPLE_PROVIDER" : "Brak problemów!", + "LINT_DISABLED" : "Sprawdzanie poprawności jest wyłączone.", + "NO_LINT_AVAILABLE" : "Nie wiem czym sprawdzić poprawność {0}", + "NOTHING_TO_LINT" : "Brak plików do sprawdzenia.", + "LINTER_TIMED_OUT" : "{0} kminił za długo: {1} ms", + "LINTER_FAILED" : "{0} rzucił błędem: {1}", + /** * Command Name Constants @@ -157,20 +250,29 @@ define({ // File menu commands "FILE_MENU" : "Plik", + "CMD_FILE_NEW_UNTITLED" : "Nowy", "CMD_FILE_NEW" : "Nowy plik", "CMD_FILE_NEW_FOLDER" : "Nowy folder", "CMD_FILE_OPEN" : "Otwórz\u2026", "CMD_ADD_TO_WORKING_SET" : "Dodaj do folderu robocze", + "CMD_OPEN_DROPPED_FILES" : "Otwórz przeciągnięte pliki", "CMD_OPEN_FOLDER" : "Otwórz folder\u2026", "CMD_FILE_CLOSE" : "Zamknij", "CMD_FILE_CLOSE_ALL" : "Zamknij wszystko", + "CMD_FILE_CLOSE_LIST" : "Zamknij listę", + "CMD_FILE_CLOSE_OTHERS" : "Zamknij inne", + "CMD_FILE_CLOSE_ABOVE" : "Zamknij pliki powyżej", + "CMD_FILE_CLOSE_BELOW" : "Zamknij pliki poniżej", "CMD_FILE_SAVE" : "Zapisz", "CMD_FILE_SAVE_ALL" : "Zapisz wszystko", + "CMD_FILE_SAVE_AS" : "Zapisz jako\u2026", "CMD_LIVE_FILE_PREVIEW" : "Błyskawiczny podgląd", - "CMD_LIVE_HIGHLIGHT" : "Podświetlanie przy podglądzie błyskawicznym", "CMD_PROJECT_SETTINGS" : "Ustawienia projektu\u2026", "CMD_FILE_RENAME" : "Zmień nazwę", + "CMD_FILE_DELETE" : "Usuń", "CMD_INSTALL_EXTENSION" : "Zainstaluj rozszerzenie\u2026", + "CMD_EXTENSION_MANAGER" : "Menedżer rozszerzeń\u2026", + "CMD_FILE_REFRESH" : "Odśwież", "CMD_QUIT" : "Wyjdź", // Used in native File menu on Windows "CMD_EXIT" : "Wyjdź", @@ -184,12 +286,9 @@ define({ "CMD_PASTE" : "Wklej", "CMD_SELECT_ALL" : "Zaznacz wszystko", "CMD_SELECT_LINE" : "Zaznacz linię", - "CMD_FIND" : "Znajdź", - "CMD_FIND_IN_FILES" : "Znajdź w plikach", - "CMD_FIND_IN_SUBTREE" : "Znajdź\u2026", - "CMD_FIND_NEXT" : "Znajdź następny", - "CMD_FIND_PREVIOUS" : "Znajdź poprzedni", - "CMD_REPLACE" : "Zamień", + "CMD_SPLIT_SEL_INTO_LINES" : "Podziel zaznaczenie na linie", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Rozszerz kursor na linię niżej", + "CMD_ADD_CUR_TO_PREV_LINE" : "Rozszerz kursor na linię wyżej", "CMD_INDENT" : "Zwiększ wcięcie", "CMD_UNINDENT" : "Zmniejsz wcięcie", "CMD_DUPLICATE" : "Powiel", @@ -198,7 +297,24 @@ define({ "CMD_BLOCK_COMMENT" : "Utwórz komentarz blokowy", "CMD_LINE_UP" : "Przejdź linię wyżej", "CMD_LINE_DOWN" : "Przejdź linię niżej", + "CMD_OPEN_LINE_ABOVE" : "Otwórz linię wyżej", + "CMD_OPEN_LINE_BELOW" : "Otwórz linię niżej", "CMD_TOGGLE_CLOSE_BRACKETS" : "Automatycznie zamykaj nawiasy", + "CMD_SHOW_CODE_HINTS" : "Pokaż podpowiedzi", + + // Search menu commands + "FIND_MENU" : "Find", + "CMD_FIND" : "Znajdź", + "CMD_FIND_FIELD_PLACEHOLDER" : "Znajdź…", + "CMD_FIND_NEXT" : "Znajdź następny", + "CMD_FIND_PREVIOUS" : "Znajdź poprzedni", + "CMD_FIND_ALL_AND_SELECT" : "Zaznacz wszystkie wystapienia", + "CMD_ADD_NEXT_MATCH" : "Dodaj nastepny do zaznaczenia", + "CMD_SKIP_CURRENT_MATCH" : "Pomiń i dodaj następny", + "CMD_FIND_IN_FILES" : "Znajdź w plikach", + "CMD_FIND_IN_SELECTED" : "Find in Selected File/Folder", + "CMD_FIND_IN_SUBTREE" : "Znajdź\u2026", + "CMD_REPLACE" : "Zamień", // View menu commands "VIEW_MENU" : "Widok", @@ -212,6 +328,8 @@ define({ "CMD_TOGGLE_LINE_NUMBERS" : "Numery linii", "CMD_TOGGLE_ACTIVE_LINE" : "Podświetl bieżącą linię", "CMD_TOGGLE_WORD_WRAP" : "Zawijaj wiersze", + "CMD_LIVE_HIGHLIGHT" : "Podświetlanie przy podglądzie błyskawicznym", + "CMD_VIEW_TOGGLE_INSPECTION" : "Sprawdzaj poprawność przy zapisywaniu", "CMD_SORT_WORKINGSET_BY_ADDED" : "Sortuj według dodanych", "CMD_SORT_WORKINGSET_BY_NAME" : "Sortuj według nazwy", "CMD_SORT_WORKINGSET_BY_TYPE" : "Sortuj według typu", @@ -222,42 +340,39 @@ define({ "CMD_QUICK_OPEN" : "Szybkie otwarcie", "CMD_GOTO_LINE" : "Idź do linii", "CMD_GOTO_DEFINITION" : "Idź do definicji", + "CMD_GOTO_FIRST_PROBLEM" : "Idź do pierwszego błędu", "CMD_TOGGLE_QUICK_EDIT" : "Szybka edycja", + "CMD_TOGGLE_QUICK_DOCS" : "Szybka dokumentacja", "CMD_QUICK_EDIT_PREV_MATCH" : "Poprzedni wynik", "CMD_QUICK_EDIT_NEXT_MATCH" : "Następny wynik", + "CMD_CSS_QUICK_EDIT_NEW_RULE" : "Nowa reguła", "CMD_NEXT_DOC" : "Następny dokument", "CMD_PREV_DOC" : "Poprzedni dokument", "CMD_SHOW_IN_TREE" : "Pokaż w drzewie katalogów", + "CMD_SHOW_IN_EXPLORER" : "Pokaż w Eksploratorze", + "CMD_SHOW_IN_FINDER" : "Pokaż w Finderze", + "CMD_SHOW_IN_OS" : "Pokaż w systemie plików", // Help menu commands "HELP_MENU" : "Pomoc", "CMD_CHECK_FOR_UPDATE" : "Sprawdź aktualizacje", "CMD_HOW_TO_USE_BRACKETS" : "Jak używać {APP_NAME}", - "CMD_FORUM" : "Forum {APP_NAME}", + "CMD_SUPPORT" : "Wsparcie {APP_NAME}", + "CMD_SUGGEST" : "Zarzuć pomysłem", "CMD_RELEASE_NOTES" : "Informacje o wydaniu", - "CMD_REPORT_AN_ISSUE" : "Zgłoś problem", + "CMD_GET_INVOLVED" : "Zaangażuj się…", "CMD_SHOW_EXTENSIONS_FOLDER" : "Pokaż folder rozszerzeń", "CMD_TWITTER" : "{TWITTER_NAME} na Twitterze", "CMD_ABOUT" : "O programie {APP_TITLE}", - - - // Special commands invoked by the native shell - "CMD_CLOSE_WINDOW" : "Zamknij okno", - "CMD_ABORT_QUIT" : "Przerwij i wyjdź", + "CMD_OPEN_PREFERENCES" : "Otwórz plik ustawień", // Strings for main-view.html "EXPERIMENTAL_BUILD" : "build eksperymentalny", "DEVELOPMENT_BUILD" : "build rozwojowy", - "SEARCH_RESULTS" : "Wyniki wyszukiwania", - "OK" : "OK", - "DONT_SAVE" : "Nie zapisuj", - "SAVE" : "Zapisz", - "CANCEL" : "Anuluj", "RELOAD_FROM_DISK" : "Załaduj ponownie z dysku", "KEEP_CHANGES_IN_EDITOR" : "Zachowaj zmiany w edytorze", "CLOSE_DONT_SAVE" : "Zamknij (Nie Zapisuj)", "RELAUNCH_CHROME" : "Zrestartuj Chrome", - "INSTALL" : "Zainstaluj", "ABOUT" : "O programie", "CLOSE" : "Zamknij", "ABOUT_TEXT_LINE1" : "sprint {VERSION_MINOR} {BUILD_TYPE} {VERSION}", @@ -265,6 +380,7 @@ define({ "ABOUT_TEXT_LINE4" : "Dokumentacja i pliki żródłowe dostępne po adresem: https://github.com/adobe/brackets/", "ABOUT_TEXT_LINE5" : "Wykonali z \u2764 i JavaScript:", "ABOUT_TEXT_LINE6" : "Mnóstwo ludzi (niestety mamy problem z załadowaniem pełnej listy w tym momencie).", + "ABOUT_TEXT_WEB_PLATFORM_DOCS" : "Dokumentacja Web Platform oraz logo Web Platform są rozpowszechniane na zasadach licencji Creative Commons Attribution, CC-BY 3.0 Unported.", "UPDATE_NOTIFICATION_TOOLTIP" : "Dostępna jest nowa wersja aplikacji {APP_NAME}! Kliknij by dowiedzieć się więcej.", "UPDATE_AVAILABLE_TITLE" : "Dostępna jest nowa wersja programu", "UPDATE_MESSAGE" : "Dostępna jest nowa wersja aplikacji {APP_NAME}. Oto kilka nowości w tej wersji:", @@ -278,8 +394,19 @@ define({ "BASEURL_ERROR_INVALID_CHAR" : "Znaki specjalne takie jak '{0}' muszą zostać %-zakodowane.", "BASEURL_ERROR_UNKNOWN_ERROR" : "Nieznany błąd podczas parsowania adresu URL.", + // CSS Quick Edit + "BUTTON_NEW_RULE" : "Nowa reguła", + // Extension Management strings + "INSTALL" : "Zainstaluj", + "UPDATE" : "Aktualizuj", + "REMOVE" : "Usuń", + "OVERWRITE" : "Nadpisz", + "CANT_REMOVE_DEV" : "Rozszerzenia w folderze „dev” muszą być usunięte ręcznie.", + "CANT_UPDATE" : "Ta aktualizacja nie jest kompatybilna z tą wersją {APP_NAME}.", + "CANT_UPDATE_DEV" : "Rozszerzenia w folderze \"dev\" nie są automatycznie aktualizowane.", "INSTALL_EXTENSION_TITLE" : "Zainstaluj rozszerzenie", + "UPDATE_EXTENSION_TITLE" : "Aktualizuj rozszerzenie", "INSTALL_EXTENSION_LABEL" : "Adres URL rozszerzenia", "INSTALL_EXTENSION_HINT" : "Adres URL do pliku ZIP lub repozytorium na GitHub dla rozszerzenia", "INSTALLING_FROM" : "Zainstaluj rozszerzenie z {0}\u2026", @@ -295,9 +422,13 @@ define({ "BAD_PACKAGE_NAME" : "{0} jest niepoprawną nazwą pakietu.", "MISSING_PACKAGE_VERSION" : "Plik package.json nie zawiera numeru wersji pakietu.", "INVALID_VERSION_NUMBER" : "Numer wersji pakietu ({0}) jest niepoprawny.", + "INVALID_BRACKETS_VERSION" : "Ciąg kompatybilności z {APP_NAME} ({0}) jest nieprawidłowy.", + "DISALLOWED_WORDS" : "Słowo „{1}” jest niedozwolony w polu {0}.", "API_NOT_COMPATIBLE" : "Rozszerzenie nie jest kompatybilne z tą wersją {APP_NAME}. Rozszerzenie zostanie zainstalowane w folderze rozszerzeń nieaktywnych.", "MISSING_MAIN" : "Pakiet nie zawiera pliku main.js.", - "ALREADY_INSTALLED" : "Rozszerzenie z taką samą nazwą jest już zainstalowane. Nowe rozszerzenie zostanie zainstalowane w folderze rozszerzeń nieaktywnych.", + "EXTENSION_ALREADY_INSTALLED" : "Instalowanie tego rozszerzenia nadpisze poprzednio zainstalowany pakiet - kontynuować?", + "EXTENSION_SAME_VERSION" : "To rozszerzenie jest w tej samej wersji jak obecnie zainstalowane – nadpisać?", + "EXTENSION_OLDER_VERSION" : "To rozszerzenie jest w starszej wersji {0} – ({1}) - zaktualizować?", "DOWNLOAD_ID_IN_USE" : "Błąd wewnętrzny: taki plik już istnieje.", "NO_SERVER_RESPONSE" : "Nie można połączyć z serwerem.", "BAD_HTTP_STATUS" : "Nie znaleziono pliku na serwerze (HTTP {0}).", @@ -307,123 +438,6 @@ define({ "UNSUPPORTED_PROTOCOL" : "Adres URL musi zaczynać się od http lub https.", "UNKNOWN_ERROR" : "Nieznany błąd wewnętrzny.", // For NOT_FOUND_ERR, see generic strings above - - - // extensions/default/DebugCommands - "DEBUG_MENU" : "Debuguj", - "CMD_SHOW_DEV_TOOLS" : "Pokaż narzędzia dewelopera", - "CMD_REFRESH_WINDOW" : "Uruchom ponownie {APP_NAME}", - "CMD_NEW_BRACKETS_WINDOW" : "Nowe okno", - "CMD_SWITCH_LANGUAGE" : "Zmień język", - "CMD_RUN_UNIT_TESTS" : "Uruchom test", - "CMD_SHOW_PERF_DATA" : "Pokaż informacje o wydajności", - "CMD_ENABLE_NODE_DEBUGGER" : "Włącz debugger Node", - "CMD_LOG_NODE_STATE" : "Zapisz stan Node do Konsoli", - "CMD_RESTART_NODE" : "Zrestartuj Node", - - "LANGUAGE_TITLE" : "Zmień język", - "LANGUAGE_MESSAGE" : "Wybierz język z poniższej listy:", - "LANGUAGE_SUBMIT" : "Zrestartuj {APP_NAME}", - "LANGUAGE_CANCEL" : "Anuluj", - - // extensions/default/InlineColorEditor - "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Obecny kolor", - "COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Kolor oryginalny", - "COLOR_EDITOR_RGBA_BUTTON_TIP" : "Format RGBa", - "COLOR_EDITOR_HEX_BUTTON_TIP" : "Format Hex", - "COLOR_EDITOR_HSLA_BUTTON_TIP" : "Format HSLa", - "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR" : "{0} (Użyto {1} raz)", - "COLOR_EDITOR_USED_COLOR_TIP_PLURAL" : "{0} (Użyto {1} razy)", - - // extensions/default/JSLint - "CMD_JSLINT" : "Włącz JSLint", - "CMD_JSLINT_FIRST_ERROR" : "Skocz do pierwszego błędu JSLint", - "JSLINT_ERRORS" : "Błędy JSLint", - "JSLINT_ERROR_INFORMATION" : "1 Błąd JSLint", - "JSLINT_ERRORS_INFORMATION" : "{0} Błędy(ów) JSLint", - "JSLINT_NO_ERRORS" : "Dobra robota! Brak błędów JSLint", - "JSLINT_DISABLED" : "JSLint wyłączony lub nie działa dla aktualnego pliku", - - "FILE" : "plik", - "DIRECTORY" : "folder", - "ERROR_OPENING_FILES" : "Podczas otwierania plików wystąpił błąd:", - "ERROR_DELETING_FILE_TITLE" : "Błąd przy usuwaniu pliku", - "ERROR_DELETING_FILE" : "Podczas usuwania pliku {0} wystąpił błąd: {1}", - "LIVE_DEV_STATUS_TIP_SYNC_ERROR" : "Podgląd błyskawiczny (nieaktualizowany z powodu błędów składniowych)", - "LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS" : "Błyskawiczny podgląd został anulowany, ponieważ narzędzia deweloperskie przeglądarki były uruchomione", - "LIVE_DEV_DETACHED_TARGET_CLOSED" : "Błyskawiczny podgląd został anulowany, ponieważ strona w przeglądarce została zamknięta", - "LIVE_DEV_NAVIGATED_AWAY" : "Błyskawiczny podgląd został anulowany, ponieważ przeglądarka odwiedziłą link, który nie należy do aktualnego projektu", - "LIVE_DEV_CLOSED_UNKNOWN_REASON" : "Błyskawiczny podgląd został anulowany ({0})", - "CONFIRM_FOLDER_DELETE_TITLE" : "Potwierdź usunięcie", - "CONFIRM_FOLDER_DELETE" : "Czy na pewno usunąć folder {0}?", - "FILE_DELETED_TITLE" : "Usunięto", - "DELETE" : "Usuń", - "FIND_RESULT_COUNT_SINGLE" : "1 wynik", - "FIND_NO_RESULTS" : "Brak wyników", - "REPLACE_PLACEHOLDER" : "Zamień na\u2026", - "BUTTON_REPLACE_ALL" : "Wszystko\u2026", - "BUTTON_REPLACE" : "Zamień", - "BUTTON_NEXT" : "\u25B6", - "BUTTON_PREV" : "\u25C0", - "BUTTON_NEXT_HINT" : "Następny", - "BUTTON_PREV_HINT" : "Poprzedni", - "BUTTON_CASESENSITIVE_HINT" : "Rozróżniaj wielkie i małe litery", - "BUTTON_REGEXP_HINT" : "Wyrażenie regularne", - "SAVE_FILE_AS" : "Zapisz plik", - "FIND_REPLACE_TITLE_PART1" : "Zamienianie „", - "FIND_REPLACE_TITLE_PART2" : "” na „", - "FIND_REPLACE_TITLE_PART3" : "” — {2} {0} {1}", - "FIND_IN_FILES_TITLE_PART1" : "Znaleziono „", - "FIND_IN_FILES_TITLE_PART2" : "” ", - "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} in {3} {4}", - "FIND_IN_FILES_PAGING" : "{0}—{1}", - "WORKING_FILES" : "Otwarte pliki", - "STATUSBAR_SELECTION_CH_SINGULAR" : " \u2014 Zaznaczono {0} kolumnę", - "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 Zaznaczono {0} kolumn", - "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 Zaznaczono {0} linię", - "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 Zaznaczono {0} linii", - "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} linia", - "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} linii", - "ERRORS_PANEL_TITLE" : "{0} błędów", - "ERRORS_PANEL_TITLE_SINGLE" : "{0} problemów", - "ERRORS_PANEL_TITLE_MULTI" : "Problemy", - "SINGLE_ERROR" : "1 błąd {0}", - "MULTIPLE_ERRORS" : "{1} błędów {0} ", - "NO_ERRORS" : "Brak błędów – dobra robota!", - "LINT_DISABLED" : "Sprawdzanie poprawności jest wyłączone.", - "NO_LINT_AVAILABLE" : "Nie wiem czym sprawdzić poprawność {0}", - "NOTHING_TO_LINT" : "Brak plików do sprawdzenia.", - "CMD_FILE_NEW_UNTITLED" : "Nowy", - "CMD_OPEN_DROPPED_FILES" : "Otwórz przeciągnięte pliki", - "CMD_FILE_CLOSE_LIST" : "Zamknij listę", - "CMD_FILE_CLOSE_OTHERS" : "Zamknij inne", - "CMD_FILE_CLOSE_ABOVE" : "Zamknij pliki powyżej", - "CMD_FILE_CLOSE_BELOW" : "Zamknij pliki poniżej", - "CMD_FILE_SAVE_AS" : "Zapisz jako\u2026", - "CMD_FILE_DELETE" : "Usuń", - "CMD_EXTENSION_MANAGER" : "Menedżer rozszerzeń\u2026", - "CMD_FILE_REFRESH" : "Odśwież", - "CMD_OPEN_LINE_ABOVE" : "Otwórz linię wyżej", - "CMD_OPEN_LINE_BELOW" : "Otwórz linię niżej", - "CMD_SHOW_CODE_HINTS" : "Pokaż podpowiedzi", - "CMD_VIEW_TOGGLE_INSPECTION" : "Sprawdzaj poprawność przy zapisywaniu", - "CMD_GOTO_FIRST_PROBLEM" : "Idź do pierwszego błędu", - "CMD_TOGGLE_QUICK_DOCS" : "Szybka dokumentacja", - "CMD_CSS_QUICK_EDIT_NEW_RULE" : "Nowa reguła", - "CMD_SHOW_IN_OS" : "Pokaż w systemie plików", - "ABOUT_TEXT_WEB_PLATFORM_DOCS" : "Dokumentacja Web Platform oraz logo Web Platform są rozpowszechniane na zasadach licencji Creative Commons Attribution, CC-BY 3.0 Unported.", - "BUTTON_NEW_RULE" : "Nowa reguła", - "UPDATE" : "Aktualizuj", - "REMOVE" : "Usuń", - "OVERWRITE" : "Nadpisz", - "CANT_REMOVE_DEV" : "Rozszerzenia w folderze „dev” muszą być usunięte ręcznie.", - "CANT_UPDATE" : "Ta aktualizacja nie jest kompatybilna z tą wersją {APP_NAME}.", - "UPDATE_EXTENSION_TITLE" : "Aktualizuj rozszerzenie", - "INVALID_BRACKETS_VERSION" : "Ciąg kompatybilności z {APP_NAME} ({0}) jest nieprawidłowy.", - "DISALLOWED_WORDS" : "Słowo „{1}” jest niedozwolony w polu {0}.", - "EXTENSION_ALREADY_INSTALLED" : "Instalowanie tego rozszerzenia nadpisze poprzednio zainstalowany pakiet - kontynuować?", - "EXTENSION_SAME_VERSION" : "To rozszerzenie jest w tej samej wersji jak obecnie zainstalowane – nadpisać?", - "EXTENSION_OLDER_VERSION" : "To rozszerzenie jest w starszej wersji {0} – ({1}) - zaktualizować?", "EXTENSION_MANAGER_TITLE" : "Menedżer rozszerzeń", "EXTENSION_MANAGER_ERROR_LOAD" : "Nie udało się dostać do rejestru wtyczek.", "INSTALL_FROM_URL" : "Zainstaluj z adresu\u2026", @@ -450,11 +464,12 @@ define({ "UNDO_REMOVE" : "Cofnij", "MARKED_FOR_UPDATE" : "Zaznaczono do aktualizacji", "UNDO_UPDATE" : "Cofnij", - "CHANGE_AND_QUIT_TITLE" : "Zmień rozszerzenia", - "CHANGE_AND_QUIT_MESSAGE" : "Aby zaktualizować rozszerzenie(a), musisz zamknąć i ponownie uruchomić {APP_NAME}.", - "REMOVE_AND_QUIT" : "Usuń i zamknij", - "CHANGE_AND_QUIT" : "Zmień i zamknij", - "UPDATE_AND_QUIT" : "Zaktualizuj i zamknij", + "CHANGE_AND_RELOAD_TITLE" : "Rozszerzenia", + "CHANGE_AND_RELOAD_MESSAGE" : "Aby Słowo stało się ciałem, {APP_NAME} musi zostać ponownie uruchomiony. Czy chcesz tego dokonać teraz?", + "REMOVE_AND_RELOAD" : "Usuń i zrestartuj", + "CHANGE_AND_RELOAD" : "OK", + "UPDATE_AND_RELOAD" : "Zaktualizuj i zrestartuj", + "PROCESSING_EXTENSIONS" : "Przetwarzanie…", "EXTENSION_NOT_INSTALLED" : "Nie można było usunąć rozszerzenia {0}, ponieważ nie było zainstalowane.", "NO_EXTENSIONS" : "Żadne rozszerzenia nie są jeszcze zainstalowane.
    Przejdź na kartę „Dostępne”, aby zobaczyć listę dostępnych rozszerzeń.", "NO_EXTENSION_MATCHES" : "Nie znaleziono żadnych wyników.", @@ -462,102 +477,73 @@ define({ "EXTENSIONS_INSTALLED_TITLE" : "Zainstalowane", "EXTENSIONS_AVAILABLE_TITLE" : "Dostępne", "EXTENSIONS_UPDATES_TITLE" : "Aktualizacja", - "INLINE_EDITOR_NO_MATCHES" : "Brak wyników.", + "INLINE_EDITOR_NO_MATCHES" : "Brak wyników.", "CSS_QUICK_EDIT_NO_MATCHES" : "Brak reguł.
    Kliknij „New Rule”, aby utworzyć regułę.", "CSS_QUICK_EDIT_NO_STYLESHEETS" : "Nie ma w tym projekcie arkuszy stylów.", + + // Custom Viewers + "IMAGE_VIEWER_LARGEST_ICON" : "największy", + + /** + * Unit names + */ + "UNIT_PIXELS" : "pikseli", - "LANGUAGE_SYSTEM_DEFAULT" : "domyślny", - "LOCALE_CS" : "czeski", - "LOCALE_DE" : "niemiecki", - "LOCALE_EN" : "angielski", - "LOCALE_ES" : "hiszpański", - "LOCALE_FI" : "fiński", - "LOCALE_FR" : "francuski", - "LOCALE_IT" : "włoski", - "LOCALE_JA" : "japoński", - "LOCALE_NB" : "norweski", - "LOCALE_NL" : "holenderski", - "LOCALE_FA_IR" : "perski", - "LOCALE_PL" : "polski", - "LOCALE_PT_BR" : "brazylijski portugalski", - "LOCALE_PT_PT" : "portugalski", - "LOCALE_RO" : "rumuński", - "LOCALE_RU" : "rosyjski", - "LOCALE_SK" : "słowacki", - "LOCALE_SR" : "serbski", - "LOCALE_SV" : "szwedzki", - "LOCALE_TR" : "turecki", - "LOCALE_ZH_CN" : "chiński uproszczony", - "LOCALE_HU" : "węgierski", + // extensions/default/DebugCommands + "DEBUG_MENU" : "Debuguj", + "ERRORS" : "Errors", + "CMD_SHOW_DEV_TOOLS" : "Pokaż narzędzia dewelopera", + "CMD_REFRESH_WINDOW" : "Uruchom ponownie {APP_NAME}", + "CMD_RELOAD_WITHOUT_USER_EXTS" : "Uruchom ponownie (bez rozszerzeń) ", + "CMD_NEW_BRACKETS_WINDOW" : "Nowe okno", + "CMD_SWITCH_LANGUAGE" : "Zmień język", + "CMD_RUN_UNIT_TESTS" : "Uruchom test", + "CMD_SHOW_PERF_DATA" : "Pokaż informacje o wydajności", + "CMD_ENABLE_NODE_DEBUGGER" : "Włącz debugger Node", + "CMD_LOG_NODE_STATE" : "Zapisz stan Node do Konsoli", + "CMD_RESTART_NODE" : "Zrestartuj Node", + "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "Show Errors in Status Bar", + + "LANGUAGE_TITLE" : "Zmień język", + "LANGUAGE_MESSAGE" : "Wybierz język z poniższej listy:", + "LANGUAGE_SUBMIT" : "Zrestartuj {APP_NAME}", + "LANGUAGE_CANCEL" : "Anuluj", + "LANGUAGE_SYSTEM_DEFAULT" : "domyślny", + + // extensions/default/InlineTimingFunctionEditor "INLINE_TIMING_EDITOR_TIME" : "Czas", "INLINE_TIMING_EDITOR_PROGRESSION" : "Postęp", + "BEZIER_EDITOR_INFO" : " Przenieś zaznaczony punkt
    Shift Przenieś zaznaczony punkt o 10 jednostek
    Tab Zmień punkt", + "STEPS_EDITOR_INFO" : " Increase or decrease steps
    'Start' or 'End'", + "INLINE_TIMING_EDITOR_INVALID" : "Obecna wartość {0} jest niepoprawna, więc została zamieniona na {1}.", + + // extensions/default/InlineColorEditor + "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Obecny kolor", + "COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Kolor oryginalny", + "COLOR_EDITOR_RGBA_BUTTON_TIP" : "Format RGBa", + "COLOR_EDITOR_HEX_BUTTON_TIP" : "Format Hex", + "COLOR_EDITOR_HSLA_BUTTON_TIP" : "Format HSLa", + "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR" : "{0} (Użyto {1} raz)", + "COLOR_EDITOR_USED_COLOR_TIP_PLURAL" : "{0} (Użyto {1} razy)", + + // extensions/default/JavaScriptCodeHints "CMD_JUMPTO_DEFINITION" : "Idź do definicji", "CMD_SHOW_PARAMETER_HINT" : "Podpowiedz paramety", "NO_ARGUMENTS" : "", + + // extensions/default/JSLint "JSLINT_NAME" : "JSLint", + + // extensions/default/QuickView "CMD_ENABLE_QUICK_VIEW" : "Podgląd po najechaniu", - "CMD_TOGGLE_RECENT_PROJECTS" : "Ostatnie projekty", - "DOCS_MORE_LINK" : "Czytaj więcej", - - "CONTENTS_MODIFIED_ERR" : "Plik został zmodyfikowany z zewnątrz.", - "ERROR_PREFS_CORRUPT_TITLE" : "Błąd odczytu ustawień", - "ERROR_PREFS_CORRUPT" : "Twój plik ustawień nie jest poprawnym plikiem JSON. Zostanie on teraz otwarty w edytorze celem poprawienia błędów. Po poprawkach uruchom ponownie {APP_NAME}, aby zastosować zmiany.", - "EXT_MODIFIED_WARNING" : "{0} został zmodyfikowany na dysku.

    Czy chcesz nadpisać plik obecnie otwartą wersją?", - "SAVE_AS" : "Zapisz jako…", - "SAVE_AND_OVERWRITE" : "Nadpisz", - "FIND_IN_FILES_ZERO_FILES" : "Filtr wyklucza wszystkie pliki {0}", - "FIND_IN_FILES_EXPAND_COLLAPSE" : "Kliknij w Ctrl/Cmd aby (ro)zwinąć wszystkie", - "NO_FILE_FILTER" : "Filtruj…", - "EDIT_FILE_FILTER" : "Edytuj…", - "FILE_FILTER_DIALOG" : "Edytuj filtr", - "FILE_FILTER_INSTRUCTIONS" : "Możesz odrzucić pliki o nazwach pasujących do poniższych wzorów lub masek. Każdą regułę umieść w osobnej linii.", - "FILE_FILTER_LIST_PREFIX" : "oprócz", - "FILE_FILTER_CLIPPED_SUFFIX" : "i {0} więcej", - "FILTER_COUNTING_FILES" : "Kalkulowanie…", - "FILTER_FILE_COUNT" : "Przeszukane zostanie {0} z {1} plików {2}", - "FILTER_FILE_COUNT_ALL" : "Przeszukane zostanie wszystkie {0} plików {1}", - "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Nie można użyć Szybkiej edycji w tym miejscu", - "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "Szybka edycja CSS: umieść kursor na nazwie klasy", - "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "Szybka edycja CSS: nieprawidłowa klasa", - "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "Szybka edycja CSS: nieprawidłowy identyfikator", - "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "Szybka edycja CSS: umieść kursor na nazwie znacznika, klasy lub identyfikatora", - "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "Szybka edycja CSS: nieprawidłowa składnia funkcji czasu", - "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "Szybka edycja JS: umieść kursor na nazwie funkcji", - "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Nie znaleziono dokumentacji dla bieżącego miejsca.", - "STATUSBAR_SELECTION_MULTIPLE" : " — {0} zaznaczeń", - "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Rozszerzenia wyłączone", - "STATUSBAR_INSERT" : "WST", - "STATUSBAR_OVERWRITE" : "ZAS", - "ERRORS_PANEL_TITLE_MULTIPLE" : "{0} problemów", - "NO_ERRORS_MULTIPLE_PROVIDER" : "Brak problemów!", - "LINTER_TIMED_OUT" : "{0} kminił za długo: {1} ms", - "LINTER_FAILED" : "{0} rzucił błędem: {1}", - "CMD_SPLIT_SEL_INTO_LINES" : "Podziel zaznaczenie na linie", - "CMD_ADD_CUR_TO_NEXT_LINE" : "Rozszerz kursor na linię niżej", - "CMD_ADD_CUR_TO_PREV_LINE" : "Rozszerz kursor na linię wyżej", - "CMD_FIND_FIELD_PLACEHOLDER" : "Znajdź…", - "CMD_FIND_ALL_AND_SELECT" : "Zaznacz wszystkie wystapienia", - "CMD_ADD_NEXT_MATCH" : "Dodaj nastepny do zaznaczenia", - "CMD_SKIP_CURRENT_MATCH" : "Pomiń i dodaj następny", - "CMD_SHOW_IN_EXPLORER" : "Pokaż w Eksploratorze", - "CMD_SHOW_IN_FINDER" : "Pokaż w Finderze", - "CMD_SUPPORT" : "Wsparcie {APP_NAME}", - "CMD_SUGGEST" : "Zarzuć pomysłem", - "CMD_GET_INVOLVED" : "Zaangażuj się…", - "CMD_OPEN_PREFERENCES" : "Otwórz plik ustawień", - "CANT_UPDATE_DEV" : "Rozszerzenia w folderze \"dev\" nie są automatycznie aktualizowane.", - "CHANGE_AND_RELOAD_TITLE" : "Rozszerzenia", - "CHANGE_AND_RELOAD_MESSAGE" : "Aby Słowo stało się ciałem, {APP_NAME} musi zostać ponownie uruchomiony. Czy chcesz tego dokonać teraz?", - "REMOVE_AND_RELOAD" : "Usuń i zrestartuj", - "CHANGE_AND_RELOAD" : "OK", - "UPDATE_AND_RELOAD" : "Zaktualizuj i zrestartuj", - "PROCESSING_EXTENSIONS" : "Przetwarzanie…", - "IMAGE_VIEWER_LARGEST_ICON" : "największy", - "CMD_RELOAD_WITHOUT_USER_EXTS" : "Uruchom ponownie (bez rozszerzeń) ", - "BEZIER_EDITOR_INFO" : " Przenieś zaznaczony punkt
    Shift Przenieś zaznaczony punkt o 10 jednostek
    Tab Zmień punkt", - "INLINE_TIMING_EDITOR_INVALID" : "Obecna wartość {0} jest niepoprawna, więc została zamieniona na {1}." + // extensions/default/RecentProjects + "CMD_TOGGLE_RECENT_PROJECTS" : "Ostatnie projekty", + // extensions/default/WebPlatformDocs + "DOCS_MORE_LINK" : "Czytaj więcej" }); + +/* Last translated 143aac5dc44a3e285bb708870b41d1cd0e2b1a64 */ From 684f846ec499be986a7823d55c7892bd1abab2d6 Mon Sep 17 00:00:00 2001 From: Olgierd Grzyb Date: Thu, 15 May 2014 01:42:41 +0200 Subject: [PATCH 042/125] Forgot to translate one message, oops --- src/nls/pl/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/pl/strings.js b/src/nls/pl/strings.js index 8b7051b018d..ac9604cf39a 100644 --- a/src/nls/pl/strings.js +++ b/src/nls/pl/strings.js @@ -37,7 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "Nie można zmienić folderu docelowego.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Brak pozwolenia na modyfikację.", "CONTENTS_MODIFIED_ERR" : "Plik został zmodyfikowany z zewnątrz.", - "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text.", + "UNSUPPORTED_ENCODING_ERR" : "Ten plik nie jest w stronie kodowej UTF-8.", "FILE_EXISTS_ERR" : "Plik już istnieje.", "FILE" : "plik", "DIRECTORY" : "folder", From 680485e596a09c017135d2625069633737a4f39f Mon Sep 17 00:00:00 2001 From: Rodrigo Tavares Date: Wed, 14 May 2014 21:43:12 -0400 Subject: [PATCH 043/125] Updating Portuguese BR translation --- src/nls/pt-br/strings.js | 176 ++++++++++++++++++++++++++++----------- 1 file changed, 129 insertions(+), 47 deletions(-) diff --git a/src/nls/pt-br/strings.js b/src/nls/pt-br/strings.js index 56811d406d3..7a0eca0152a 100644 --- a/src/nls/pt-br/strings.js +++ b/src/nls/pt-br/strings.js @@ -36,6 +36,8 @@ define({ "NOT_READABLE_ERR" : "O arquivo não pôde ser lido.", "NO_MODIFICATION_ALLOWED_ERR" : "O diretório de destino não pode ser modificado.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "As permissões não permitem que você faça modificações.", + "CONTENTS_MODIFIED_ERR" : "O arquivo foi modificado fora do {APP_NAME}.", + "UNSUPPORTED_ENCODING_ERR" : "O arquivo não contém texto codificado em UTF-8.", "FILE_EXISTS_ERR" : "Arquivo ou pasta já existe.", "FILE" : "arquivo", "DIRECTORY" : "diretório", @@ -64,15 +66,19 @@ define({ "ERROR_CREATING_FILE_TITLE" : "Erro ao criar {0}", "ERROR_CREATING_FILE" : "Ocorreu um erro ao tentar criar o {0} {1}. {2}", + // Application preferences corrupt error strings + "ERROR_PREFS_CORRUPT_TITLE" : "Erro ao ler preferências", + "ERROR_PREFS_CORRUPT" : "Seu arquivo de preferências não é um JSON válido. O arquivo será aberto para que você possa corrigir o formato. Você deverá reiniciar o {APP_NAME} para as alterações terem efeito.", + // Application error strings "ERROR_IN_BROWSER_TITLE" : "Opa! O {APP_NAME} não funciona em navegadores ainda.", "ERROR_IN_BROWSER" : "O {APP_NAME} é criado em HTML, mas no momento ele é executado como um aplicativo de desktop para que você possa usá-lo para editar arquivos locais. Por favor, use o shell da aplicação do repositório github.com/adobe/brackets-shell para executar {APP_NAME}.", - // FileIndexManager error string + // ProjectManager max files error string "ERROR_MAX_FILES_TITLE" : "Erro ao indexar arquivos", "ERROR_MAX_FILES" : "O número máximo de arquivos foi indexado. Ações que procuram no índice de arquivos podem funcionar incorretamente.", - // Live Development error strings + // Live Preview error strings "ERROR_LAUNCHING_BROWSER_TITLE" : "Erro ao abrir o navegador", "ERROR_CANT_FIND_CHROME" : "O navegador Google Chrome não pôde ser encontrado. Por favor, verifique se ele está instalado.", "ERROR_LAUNCHING_BROWSER" : "Ocorreu um erro ao iniciar o navegador. (erro {0})", @@ -92,7 +98,8 @@ define({ "LIVE_DEV_STATUS_TIP_PROGRESS1" : "Live Preview: Connectando\u2026", "LIVE_DEV_STATUS_TIP_PROGRESS2" : "Live Preview: Inicializando\u2026", "LIVE_DEV_STATUS_TIP_CONNECTED" : "Desconectar Live Preview", - "LIVE_DEV_STATUS_TIP_OUT_OF_SYNC" : "Live Preview: Clique para desconectar (Salve o arquivo para atualizar)", + "LIVE_DEV_STATUS_TIP_OUT_OF_SYNC" : "Live Preview (salve o arquivo para recarregar)", + "LIVE_DEV_STATUS_TIP_SYNC_ERROR" : "Live Preview (atualização interrompida devido a erro de sintaxe)", "LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS" : "O Live Preview foi cancelado pois as ferramentas de desenvolvedor do navegador foram abertas", "LIVE_DEV_DETACHED_TARGET_CLOSED" : "O Live Preview foi cancelado pois a página foi fechada no navegador", @@ -106,25 +113,34 @@ define({ "CONFIRM_FOLDER_DELETE_TITLE" : "Confirmar exclusão", "CONFIRM_FOLDER_DELETE" : "Tem certeza que deseja excluir a pasta {0}?", "FILE_DELETED_TITLE" : "Arquivo excluído", + "EXT_MODIFIED_WARNING" : "{0} foi modificado no disco.

    Deseja salvar o arquivo e sobrescrever essas alterações?", "EXT_MODIFIED_MESSAGE" : "{0} foi modificado no disco, mas também tem alterações não salvas em {APP_NAME}.

    Qual versão você quer manter?", "EXT_DELETED_MESSAGE" : "{0} foi excluído no disco, mas tem alterações não salvas em {APP_NAME}.

    Deseja manter suas alterações?", + // Generic dialog/button labels + "OK" : "OK", + "CANCEL" : "Cancelar", + "DONT_SAVE" : "Não salvar", + "SAVE" : "Salvar", + "SAVE_AS" : "Salvar como\u2026", + "SAVE_AND_OVERWRITE" : "Sobrescrever", + "DELETE" : "Excluir", + "BUTTON_YES" : "Sim", + "BUTTON_NO" : "Não", + // Find, Replace, Find in Files - "SEARCH_REGEXP_INFO" : "Use a sintaxe /re/ para pesquisas com regexp", "FIND_RESULT_COUNT" : "{0} resultados", "FIND_RESULT_COUNT_SINGLE" : "1 resultado", "FIND_NO_RESULTS" : "Nenhum resultado", - "WITH" : "Com", - "BUTTON_YES" : "Sim", - "BUTTON_NO" : "Não", - "BUTTON_REPLACE_ALL" : "Todos\u2026", - "BUTTON_STOP" : "Pare", + "REPLACE_PLACEHOLDER" : "Substituir por\u2026", + "BUTTON_REPLACE_ALL" : "Tudo\u2026", "BUTTON_REPLACE" : "Substituir", - "BUTTON_NEXT" : "\u25B6", "BUTTON_PREV" : "\u25C0", "BUTTON_NEXT_HINT" : "Resultado seguinte", - "BUTTON_PREV_HINT" : "Resultado ", + "BUTTON_PREV_HINT" : "Resultado anterior", + "BUTTON_CASESENSITIVE_HINT" : "Diferenciar maiúsculas/minúsculas", + "BUTTON_REGEXP_HINT" : "Expressão regular", "OPEN_FILE" : "Abrir arquivo", "SAVE_FILE_AS" : "Salvar arquivo", @@ -134,27 +150,52 @@ define({ "NO_UPDATE_TITLE" : "Você está atualizado!", "NO_UPDATE_MESSAGE" : "Você está executando a versão mais recente do {APP_NAME}.", + // Replace All (in single file) "FIND_REPLACE_TITLE_PART1" : "Substituir \"", "FIND_REPLACE_TITLE_PART2" : "\" por \"", "FIND_REPLACE_TITLE_PART3" : "\" — {2} {0} {1}", + // Find in Files "FIND_IN_FILES_TITLE_PART1" : "\"", "FIND_IN_FILES_TITLE_PART2" : "\" encontrado(s)", - "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} em {2} {3}", + "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} em {3} {4}", "FIND_IN_FILES_SCOPED" : "em {0}", "FIND_IN_FILES_NO_SCOPE" : "no projeto", + "FIND_IN_FILES_ZERO_FILES" : "Filtro exclui todos os arquivos {0}", "FIND_IN_FILES_FILE" : "arquivo", "FIND_IN_FILES_FILES" : "arquivos", "FIND_IN_FILES_MATCH" : "resultado", "FIND_IN_FILES_MATCHES" : "resultados", "FIND_IN_FILES_MORE_THAN" : "Mais de ", "FIND_IN_FILES_PAGING" : "{0}—{1}", - "FIND_IN_FILES_FILE_PATH" : "{0} {2} {1}", // We shoudl use normal dashes on Windows instead of em dash eventually - "FIND_IN_FILES_LINE" : "linha: {0}", - + "FIND_IN_FILES_FILE_PATH" : "{0} {2} {1}", // We should use normal dashes on Windows instead of em dash eventually + "FIND_IN_FILES_EXPAND_COLLAPSE" : "Ctrl/Cmd + clique para expandir/comprimir tudo", "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Erro ao receber informações de atualização", "ERROR_FETCHING_UPDATE_INFO_MSG" : "Houve um problema ao obter informações sobre a última atualização do servidor. Por favor, certifique-se de estar conectado à Internet e tente novamente.", + // File exclusion filters + "NO_FILE_FILTER" : "Filtrar arquivos\u2026", + "EDIT_FILE_FILTER" : "Editar\u2026", + "FILE_FILTER_DIALOG" : "Editar filtro", + "FILE_FILTER_INSTRUCTIONS" : "Exclui dos resultados os arquivos e pastas que correspondam a qualquer das strings, substrings ou wildcards abaixo. Insira cada string em uma linha separada.", + "FILE_FILTER_LIST_PREFIX" : "exceto", + "FILE_FILTER_CLIPPED_SUFFIX" : "e outros {0}", + "FILTER_COUNTING_FILES" : "Contando arquivos\u2026", + "FILTER_FILE_COUNT" : "Permite {0} de {1} arquivos {2}", + "FILTER_FILE_COUNT_ALL" : "Permite todos os {0} arquivos {1}", + + // Quick Edit + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Quick Edit não disponível para posição atual do cursor", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "Quick Edit CSS: posicione o cursor no nome de uma única classe", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "Quick Edit CSS: atributo class incompleto", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "Quick Edit CSS: atributo id incompleto", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "Quick Edit CSS: posicione cursor em tag, class ou id", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "Quick Edit Função Timing de CSS: sintaxe inválida", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "Quick Edit JS: posicione cursor no nome de uma função", + + // Quick Docs + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Quick Docs não disponível para a posição atual do cursor", + /** * ProjectManager */ @@ -177,6 +218,7 @@ define({ "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 {0} colunas selecionadas", "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 {0} linha selecionada", "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 {0} linhas selecionadas", + "STATUSBAR_SELECTION_MULTIPLE" : " \u2014 {0} seleções", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Clique para alterar a indentação para espaços", "STATUSBAR_INDENT_TOOLTIP_TABS" : "Clique para alterar a indentação para tabulação", "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "Clique para alterar o número de espaços usados ao indentar", @@ -185,15 +227,21 @@ define({ "STATUSBAR_TAB_SIZE" : "Tamanho da tabulação:", "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} linha", "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} linhas", + "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Extensões desativadas", + "STATUSBAR_INSERT" : "INS", + "STATUSBAR_OVERWRITE" : "OVR", // CodeInspection: errors/warnings - "ERRORS_PANEL_TITLE" : "Erros {0}", - "SINGLE_ERROR" : "1 erro {0}", - "MULTIPLE_ERRORS" : "{1} erros {0}", - "NO_ERRORS" : "Nenhum erro {0} - bom trabalho!", + "ERRORS_PANEL_TITLE_MULTIPLE" : "Problemas de {0}", + "SINGLE_ERROR" : "Um problema de {0}", + "MULTIPLE_ERRORS" : "{1} problemas de {0}", + "NO_ERRORS" : "Nenhum problema de {0} encontrado - bom trabalho!", + "NO_ERRORS_MULTIPLE_PROVIDER" : "Nenhum problema encontrado - bom trabalho!", "LINT_DISABLED" : "A análise de código está desativada", "NO_LINT_AVAILABLE" : "Nenhum analisador de código disponível para {0}", "NOTHING_TO_LINT" : "Nada para analisar", + "LINTER_TIMED_OUT" : "{0} expirou após esperar durante {1} ms", + "LINTER_FAILED" : "{0} terminou com o erro: {1}", /** @@ -207,9 +255,14 @@ define({ "CMD_FILE_NEW_FOLDER" : "Nova pasta", "CMD_FILE_OPEN" : "Abrir\u2026", "CMD_ADD_TO_WORKING_SET" : "Adicionar ao Conjunto de Trabalho", + "CMD_OPEN_DROPPED_FILES" : "Abrir arquivos largados", "CMD_OPEN_FOLDER" : "Abrir pasta\u2026", "CMD_FILE_CLOSE" : "Fechar", "CMD_FILE_CLOSE_ALL" : "Fechar todos", + "CMD_FILE_CLOSE_LIST" : "Fechar lista", + "CMD_FILE_CLOSE_OTHERS" : "Fechar outros", + "CMD_FILE_CLOSE_ABOVE" : "Fechar outros acima", + "CMD_FILE_CLOSE_BELOW" : "Fechar outros abaixo", "CMD_FILE_SAVE" : "Salvar", "CMD_FILE_SAVE_ALL" : "Salvar todos", "CMD_FILE_SAVE_AS" : "Salvar como\u2026", @@ -233,12 +286,9 @@ define({ "CMD_PASTE" : "Colar", "CMD_SELECT_ALL" : "Selecionar tudo", "CMD_SELECT_LINE" : "Selecionar linha", - "CMD_FIND" : "Localizar", - "CMD_FIND_IN_FILES" : "Localizar em arquivos", - "CMD_FIND_IN_SUBTREE" : "Localizar em \u2026", - "CMD_FIND_NEXT" : "Localizar Próximo", - "CMD_FIND_PREVIOUS" : "Localizar Anterior", - "CMD_REPLACE" : "Substituir", + "CMD_SPLIT_SEL_INTO_LINES" : "Dividir seleção em linhas", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Adicionar cursor à linha seguinte", + "CMD_ADD_CUR_TO_PREV_LINE" : "Adicionar cursor à linha anterior", "CMD_INDENT" : "Indentar", "CMD_UNINDENT" : "Diminuir indentação", "CMD_DUPLICATE" : "Duplicar", @@ -252,6 +302,20 @@ define({ "CMD_TOGGLE_CLOSE_BRACKETS" : "Fechar chaves automaticamente", "CMD_SHOW_CODE_HINTS" : "Mostrar dicas de código", + // Search menu commands + "FIND_MENU" : "Localizar", + "CMD_FIND" : "Localizar", + "CMD_FIND_FIELD_PLACEHOLDER" : "Localizar\u2026", + "CMD_FIND_NEXT" : "Localizar próximo", + "CMD_FIND_PREVIOUS" : "Localizar anterior", + "CMD_FIND_ALL_AND_SELECT" : "Localizar tudo e selecionar", + "CMD_ADD_NEXT_MATCH" : "Adicionar próximo resultado à seleção", + "CMD_SKIP_CURRENT_MATCH" : "Pular e adicionar próximo resultado", + "CMD_FIND_IN_FILES" : "Localizar em arquivos", + "CMD_FIND_IN_SELECTED" : "Localizar no arquivo/diretório selecionado", + "CMD_FIND_IN_SUBTREE" : "Localizar em\u2026", + "CMD_REPLACE" : "Substituir", + // View menu commands "VIEW_MENU" : "Ver", "CMD_HIDE_SIDEBAR" : "Esconder Barra Lateral", @@ -281,37 +345,30 @@ define({ "CMD_TOGGLE_QUICK_DOCS" : "Documentação rápida", "CMD_QUICK_EDIT_PREV_MATCH" : "Resultado anterior", "CMD_QUICK_EDIT_NEXT_MATCH" : "Resultado seguinte", + "CMD_CSS_QUICK_EDIT_NEW_RULE" : "Nova regra", "CMD_NEXT_DOC" : "Documento seguinte", "CMD_PREV_DOC" : "Documento anterior", "CMD_SHOW_IN_TREE" : "Mostrar na árvore de arquivos", + "CMD_SHOW_IN_EXPLORER" : "Mostrar no Explorer", + "CMD_SHOW_IN_FINDER" : "Mostrar no Finder", "CMD_SHOW_IN_OS" : "Mostrar no sistema operacional", // Help menu commands "HELP_MENU" : "Ajuda", "CMD_CHECK_FOR_UPDATE" : "Verificar atualizações", "CMD_HOW_TO_USE_BRACKETS" : "Como usar o {APP_NAME}", - "CMD_FORUM" : "Fórum do {APP_NAME}", + "CMD_SUPPORT" : "Ajuda do {APP_NAME}", + "CMD_SUGGEST" : "Sugira um recurso", "CMD_RELEASE_NOTES" : "Notas da versão", - "CMD_REPORT_AN_ISSUE" : "Relatar um problema", + "CMD_GET_INVOLVED" : "Envolva-se", "CMD_SHOW_EXTENSIONS_FOLDER" : "Mostrar pasta de extensões", "CMD_TWITTER" : "{TWITTER_NAME} no Twitter", "CMD_ABOUT" : "Sobre o {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "Abrir arquivo de configurações", - - // Special commands invoked by the native shell - "CMD_CLOSE_WINDOW" : "Fechar janela", - "CMD_ABORT_QUIT" : "Abortar saída", - "CMD_BEFORE_MENUPOPUP" : "Antes do popup do menu", - // Strings for main-view.html "EXPERIMENTAL_BUILD" : "versão experimental", "DEVELOPMENT_BUILD" : "versão de desenvolvimento", - "OK" : "OK", - "DONT_SAVE" : "Não salvar", - "SAVE" : "Salvar", - "CANCEL" : "Cancelar", - "DELETE" : "Excluir", "RELOAD_FROM_DISK" : "Recarregar do disco", "KEEP_CHANGES_IN_EDITOR" : "Manter alterações no editor", "CLOSE_DONT_SAVE" : "Fechar (não salvar)", @@ -336,6 +393,9 @@ define({ "BASEURL_ERROR_HASH_DISALLOWED" : "A URL base não pode conter hashes como \"{0}\".", "BASEURL_ERROR_INVALID_CHAR" : "Caracteres especiais como '{0}' devem ser codificados para URL encoding.", "BASEURL_ERROR_UNKNOWN_ERROR" : "Erro desconhecido ao parsear URL base", + + // CSS Quick Edit + "BUTTON_NEW_RULE" : "Nova regra", // Extension Management strings "INSTALL" : "Instalar", @@ -344,6 +404,7 @@ define({ "OVERWRITE" : "Sobrescrever", "CANT_REMOVE_DEV" : "Extensões na pasta \"dev\" devem ser excluídas manualmente.", "CANT_UPDATE" : "A atualização não é compatível com esta versão do {APP_NAME}.", + "CANT_UPDATE_DEV" : "Extensões na pasta \"dev\" não podem ser atualizadas automaticamente.", "INSTALL_EXTENSION_TITLE" : "Instalar extensão", "UPDATE_EXTENSION_TITLE" : "Atualizar extensão", "INSTALL_EXTENSION_LABEL" : "URL da extensão", @@ -383,7 +444,9 @@ define({ "EXTENSION_AUTHOR" : "Autor", "EXTENSION_DATE" : "Data", "EXTENSION_INCOMPATIBLE_NEWER" : "Esta extensão requer uma versão mais recente do {APP_NAME}.", - "EXTENSION_INCOMPATIBLE_OLDER" : "Esta extensão atualmente só funciona com versões antigas do {APP_NAME}.", + "EXTENSION_INCOMPATIBLE_OLDER" : "Esta extensão atualmente só funciona com versões mais antigas do {APP_NAME}.", + "EXTENSION_LATEST_INCOMPATIBLE_NEWER" : "A versão {0} desta extensão exige uma versão mais recente do {APP_NAME}. Mas você pode instalar a versão {1} mais antiga.", + "EXTENSION_LATEST_INCOMPATIBLE_OLDER" : "A versão {0} desta extensão funciona apenas com versões mais antigas do {APP_NAME}. Mas você pode instalar a versão {1} mais recente.", "EXTENSION_NO_DESCRIPTION" : "Sem descrição", "EXTENSION_MORE_INFO" : "Mais informações...", "EXTENSION_ERROR" : "Erro na extensão", @@ -401,11 +464,12 @@ define({ "UNDO_REMOVE" : "Desfazer", "MARKED_FOR_UPDATE" : "Marcada para atualização", "UNDO_UPDATE" : "Desfazer", - "CHANGE_AND_QUIT_TITLE" : "Alterar extensões", - "CHANGE_AND_QUIT_MESSAGE" : "Para atualizar ou remover as extensões marcadas, você deve sair e reiniciar o {APP_NAME}. Você será solicitado a salvar alterações.", - "REMOVE_AND_QUIT" : "Remover extensões e sair", - "CHANGE_AND_QUIT" : "Alterar extensões e sair", - "UPDATE_AND_QUIT" : "Atualizar extensões e sair", + "CHANGE_AND_RELOAD_TITLE" : "Alterar extensões", + "CHANGE_AND_RELOAD_MESSAGE" : "Para atualizar ou remover as extensões marcadas, o {APP_NAME} precisa ser recarregado. Você será solicitado a salvar suas alterações.", + "REMOVE_AND_RELOAD" : "Remover extensões e recarregar", + "CHANGE_AND_RELOAD" : "Alterar extensões e recarregar", + "UPDATE_AND_RELOAD" : "Atualizar extensões e recarregar", + "PROCESSING_EXTENSIONS" : "Processing extension changes\u2026", "EXTENSION_NOT_INSTALLED" : "Não foi possível remover a extensão {0} porque não estava instalada.", "NO_EXTENSIONS" : "Nenhuma extensão instalada ainda.
    Clique na aba Disponíveis acima para começar.", "NO_EXTENSION_MATCHES" : "Nenhuma extensão corresponde à sua pesquisa.", @@ -414,17 +478,25 @@ define({ "EXTENSIONS_AVAILABLE_TITLE" : "Disponíveis", "EXTENSIONS_UPDATES_TITLE" : "Atualizações", + "INLINE_EDITOR_NO_MATCHES" : "Nenhuma correspondência.", + "CSS_QUICK_EDIT_NO_MATCHES" : "Nenhuma regra CSS corresponde à sua seleção.
    Clique em \"Nova regra\" para criar uma.", + "CSS_QUICK_EDIT_NO_STYLESHEETS" : "Seu projeto não tem uma folha de estilos.
    Crie uma para adicionar regras CSS.", + + // Custom Viewers + "IMAGE_VIEWER_LARGEST_ICON" : "largest", + /** * Unit names */ "UNIT_PIXELS" : "pixels", - - + // extensions/default/DebugCommands "DEBUG_MENU" : "Depurar", + "ERRORS" : "Erros", "CMD_SHOW_DEV_TOOLS" : "Mostrar Ferramentas do Desenvolvedor", - "CMD_REFRESH_WINDOW" : "Recarregar {APP_NAME}", + "CMD_REFRESH_WINDOW" : "Recarregar com Extensões", + "CMD_RELOAD_WITHOUT_USER_EXTS" : "Recarregar sem Extensões", "CMD_NEW_BRACKETS_WINDOW" : "Nova janela do {APP_NAME}", "CMD_SWITCH_LANGUAGE" : "Trocar idioma", "CMD_RUN_UNIT_TESTS" : "Executar testes", @@ -432,6 +504,7 @@ define({ "CMD_ENABLE_NODE_DEBUGGER" : "Habilitar Depurador Node", "CMD_LOG_NODE_STATE" : "Registrar estado do Node no Console", "CMD_RESTART_NODE" : "Reiniciar Node", + "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "Mostrar erros na barra de status", "LANGUAGE_TITLE" : "Trocar idioma", "LANGUAGE_MESSAGE" : "Idioma:", @@ -439,6 +512,13 @@ define({ "LANGUAGE_CANCEL" : "Cancelar", "LANGUAGE_SYSTEM_DEFAULT" : "Padrão do sistema", + // extensions/default/InlineTimingFunctionEditor + "INLINE_TIMING_EDITOR_TIME" : "Tempo", + "INLINE_TIMING_EDITOR_PROGRESSION" : "Progresso", + "BEZIER_EDITOR_INFO" : " Move o ponto selecionado
    Shift Move dez unidades
    Tab Troca pontos", + "STEPS_EDITOR_INFO" : " Aumenta ou diminui passos
    'Start' ou 'End'", + "INLINE_TIMING_EDITOR_INVALID" : "O valor antigo {0} não é válido, então a função exibida foi alterada para {1}. O documento será atualizado com a primeira edição.", + // extensions/default/InlineColorEditor "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Cor atual", "COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Cor original", @@ -465,3 +545,5 @@ define({ // extensions/default/WebPlatformDocs "DOCS_MORE_LINK" : "Leia mais" }); + +/* Last translated for 143aac5dc44a3e285bb708870b41d1cd0e2b1a64 */ From 631c7ca519c2eebf613e760f98b4e0fc866113ca Mon Sep 17 00:00:00 2001 From: Jeff Booher Date: Wed, 14 May 2014 19:00:56 -0700 Subject: [PATCH 044/125] fix lint error, rearrange error message and emphasize invalid characters --- src/nls/root/strings.js | 2 +- src/project/ProjectManager.js | 2 +- src/styles/brackets.less | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 774ad58f031..34b72157007 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -65,7 +65,7 @@ define({ "ERROR_DELETING_FILE_TITLE" : "Error deleting file", "ERROR_DELETING_FILE" : "An error occurred when trying to delete the file {0}. {1}", "INVALID_FILENAME_TITLE" : "Invalid {0}", - "INVALID_FILENAME_MESSAGE" : "{0} cannot contain the following characters: {1}, use any system reserved words or end with dots (.).", + "INVALID_FILENAME_MESSAGE" : "{0} cannot use any system reserved words, end with dots (.) or use any of the following characters: {1}", "ENTRY_WITH_SAME_NAME_EXISTS" : "A file or directory with the name {0} already exists.", "ERROR_CREATING_FILE_TITLE" : "Error creating {0}", "ERROR_CREATING_FILE" : "An error occurred when trying to create the {0} {1}. {2}", diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index ebfcc88ffa5..8d18075fdeb 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -1664,7 +1664,7 @@ define(function (require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, StringUtils.format(Strings.INVALID_FILENAME_TITLE, titleType), - StringUtils.format(Strings.ENTRY_WITH_SAME_NAME_EXISTS, + StringUtils.format(Strings.ENTRY_WITH_SAME_NAME_EXISTS, StringUtils.breakableUrl(data.rslt.name)) ); } else { diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 3093d4a62a2..3adf0196985 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1551,3 +1551,8 @@ label input { transform: scale(1); } } + +.emphasized { + font-weight: 900; + font-size: 1.01em; +} \ No newline at end of file From 99f3ede7baa7c308c23ae5dc048d2e0dada23bf2 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Thu, 15 May 2014 10:28:25 -0700 Subject: [PATCH 045/125] Fix the vertical scroll bar showing up in CEF 1750 build by reducing the negative margin of the bottom of File Count message. --- src/styles/brackets.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 86101f13fac..fd0e52f530e 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1270,7 +1270,7 @@ textarea.exclusions-editor { .code-font(); } .exclusions-filecount { - margin: 12px 0 -20px 0; + margin: 12px 0 -14px 0; padding: 4px 8px; background-color: @tc-highlight; border-radius: @tc-control-border-radius; From a3940fe90fb5c046c2b51064d09179ad87c4013a Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Thu, 15 May 2014 22:07:16 -0300 Subject: [PATCH 046/125] Added ClojureScript and cljx extensions to clojure fileExtensions [ClojureScript](https://github.com/clojure/clojurescript/) is a Clojure implementation targeting JavaScript. [cljx](https://github.com/lynaghk/cljx) helps write Clojure/ClojureScript portable projects. Both are very common and should probably be recognized out-of-the-box by Brackets. --- src/language/languages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/languages.json b/src/language/languages.json index 136781fa8bb..5207414a4c0 100644 --- a/src/language/languages.json +++ b/src/language/languages.json @@ -148,7 +148,7 @@ "clojure": { "name": "Clojure", "mode": "clojure", - "fileExtensions": ["clj"], + "fileExtensions": ["clj", "cljs", "cljx"], "lineComment": [";", ";;"] }, From 60309e53a8aa76cbc43fdb07612e0de159286067 Mon Sep 17 00:00:00 2001 From: wALF Utility Date: Thu, 15 May 2014 21:51:51 -0700 Subject: [PATCH 047/125] Updated by ALF automation. --- src/nls/fr/strings.js | 1 + src/nls/ja/strings.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index f63a56f909d..5f17acc22bd 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -362,6 +362,7 @@ define({ "CMD_RELEASE_NOTES": "Notes de mise à jour", "CMD_GET_INVOLVED": "Participer", "CMD_SHOW_EXTENSIONS_FOLDER": "Afficher le dossier d’extensions", + "CMD_HOMEPAGE": "[7540036] !é=Brackets Homepage=!", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", "CMD_ABOUT": "A propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index eb62b15202a..2a1689f2d17 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -362,6 +362,7 @@ define({ "CMD_RELEASE_NOTES": "リリースノート", "CMD_GET_INVOLVED": "コミュニティに参加", "CMD_SHOW_EXTENSIONS_FOLDER": "拡張機能のフォルダーを開く", + "CMD_HOMEPAGE": "!能=[7540036] Brackets Homepage_=!", "CMD_TWITTER": "Twitter で {TWITTER_NAME} をフォロー", "CMD_ABOUT": "{APP_TITLE} について", "CMD_OPEN_PREFERENCES": "環境設定ファイルを開く", From a090f7885a99224f2a2918af9504ec3bdea9770d Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Fri, 16 May 2014 07:38:47 -0700 Subject: [PATCH 048/125] add walfgithub --- tasks/cla-exceptions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/cla-exceptions.json b/tasks/cla-exceptions.json index d0736eeb6c0..82a350b0e7e 100644 --- a/tasks/cla-exceptions.json +++ b/tasks/cla-exceptions.json @@ -2,5 +2,6 @@ "busykai": true, "mjherna1": true, "shahabl": true, - "sebaslv": true + "sebaslv": true, + "walfgithub": true } From a4e50e608fe9104aca2472fcfd299fea9a6ccc28 Mon Sep 17 00:00:00 2001 From: wALF Utility Date: Fri, 16 May 2014 09:49:04 -0700 Subject: [PATCH 049/125] Updated by ALF automation. --- src/nls/fr/strings.js | 2 +- src/nls/ja/strings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 5f17acc22bd..5ee5760f87e 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -362,7 +362,7 @@ define({ "CMD_RELEASE_NOTES": "Notes de mise à jour", "CMD_GET_INVOLVED": "Participer", "CMD_SHOW_EXTENSIONS_FOLDER": "Afficher le dossier d’extensions", - "CMD_HOMEPAGE": "[7540036] !é=Brackets Homepage=!", + "CMD_HOMEPAGE": "Page d’accueil de Brackets", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", "CMD_ABOUT": "A propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 2a1689f2d17..45face01f5c 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -362,7 +362,7 @@ define({ "CMD_RELEASE_NOTES": "リリースノート", "CMD_GET_INVOLVED": "コミュニティに参加", "CMD_SHOW_EXTENSIONS_FOLDER": "拡張機能のフォルダーを開く", - "CMD_HOMEPAGE": "!能=[7540036] Brackets Homepage_=!", + "CMD_HOMEPAGE": "Brackets のホームページ", "CMD_TWITTER": "Twitter で {TWITTER_NAME} をフォロー", "CMD_ABOUT": "{APP_TITLE} について", "CMD_OPEN_PREFERENCES": "環境設定ファイルを開く", From 0cb7c1128e1e85c7dd8a290fbd2bc145a0401cf6 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Fri, 16 May 2014 22:01:13 +0200 Subject: [PATCH 050/125] Decrease the green update count when an extension was marked for update --- src/extensibility/ExtensionManagerViewModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensibility/ExtensionManagerViewModel.js b/src/extensibility/ExtensionManagerViewModel.js index 8f88ddaf6fb..53bb6294aec 100644 --- a/src/extensibility/ExtensionManagerViewModel.js +++ b/src/extensibility/ExtensionManagerViewModel.js @@ -439,7 +439,7 @@ define(function (require, exports, module) { var self = this; this.notifyCount = 0; this.sortedFullSet.forEach(function (key) { - if (self.extensions[key].installInfo.updateCompatible) { + if (self.extensions[key].installInfo.updateCompatible && !ExtensionManager.isMarkedForUpdate(key)) { self.notifyCount++; } }); From f347c7fed92ea9d97361cf19136625803d7d967d Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 16 May 2014 13:02:40 -0700 Subject: [PATCH 051/125] Fixed some issues related to the index of the selected item or items after the removed item in the dropdown list. --- src/search/FileFilters.js | 50 ++++++++++++++++------ src/styles/brackets.less | 3 +- src/styles/brackets_patterns_override.less | 1 + src/utils/DropdownEventHandler.js | 7 ++- src/widgets/DropdownButton.js | 2 +- 5 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 8529639975e..f32c4cb51b9 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -171,8 +171,6 @@ define(function (require, exports, module) { // Explicitly set to -1 to remove the active file filter PreferencesManager.setViewState("activeFileFilter", -1); } - - _updatePicker(); } @@ -310,6 +308,7 @@ define(function (require, exports, module) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference setLastFilter({ name: $nameField.val(), patterns: getValue() }, index); + _updatePicker(); _doPopulate(); } lastFocus.focus(); // restore focus to old po @@ -359,6 +358,19 @@ define(function (require, exports, module) { * @param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list */ function _handleListEvents(event, $dropdown) { + + function adjustSuccedingFilters(removedFilterIndex) { + $dropdown.children().each(function () { + var index = $(".stylesheet-link", this).data("index"); + if (index > removedFilterIndex) { + if (index === removedFilterIndex + 1) { + $(this).find("a").addClass("selected"); + } + $(".stylesheet-link", this).data("index", index - 1); + } + }); + } + $dropdown.find(".filter-trash-icon") .on("click", function (e) { // Remove the filter set from the preferences and @@ -373,16 +385,28 @@ define(function (require, exports, module) { filterSets.splice(filterIndex, 1); PreferencesManager.set("fileFilters", filterSets); + _doPopulate(); + + // Explicitly remove the list item to refresh the dropdown menu + $(this).closest("li").remove(); + + if (filterSets.length === 0) { + $dropdown.find(".divider").remove(); + } + if (activeFilterIndex === filterIndex) { // Removing the active filter, so clear the active filter // both in the view state and the picker button label. setLastFilter(); + } else if (activeFilterIndex > filterIndex) { + // Adjust the active filter index after the removal of a filter set before it. + setLastFilter(filterSets[--activeFilterIndex], activeFilterIndex); } + + // Also adjust the data-index of all filter sets in the dropdown that are after the deleted one + adjustSuccedingFilters(filterIndex + FIRST_FILTER_INDEX); - _doPopulate(); - - // Explicitly remove the list item to refresh the dropdown menu - $(this).closest("li").remove(); + _updatePicker(); }); $dropdown.find(".filter-edit-icon") @@ -415,12 +439,8 @@ define(function (require, exports, module) { function itemRenderer(item, index) { if (index < FIRST_FILTER_INDEX) { - if (index === FIRST_FILTER_INDEX - 1) { - // Return an empty string for the divider - return ""; - } // Prefix the two filter commands with 'recent-filter-name' so that - // they also get the same padding-left as the actual filters. + // they also get the same margin-left as the actual filters. return "" + _.escape(item); } @@ -442,8 +462,7 @@ define(function (require, exports, module) { _updatePicker(); // Add 'file-filter-picker' to keep some margin space on the left of the button - _picker.$button.addClass("file-filter-picker"); - _picker.$button.addClass("no-focus"); + _picker.$button.addClass("file-filter-picker no-focus"); // Set up mouse click events for 'Delete' and 'Edit' buttons $(_picker).on("openDropdown", _handleListEvents); @@ -460,15 +479,20 @@ define(function (require, exports, module) { } else if (itemIndex === 1) { // Clear the active filter setLastFilter(); + _updatePicker(); } else if (itemIndex >= FIRST_FILTER_INDEX && item) { var filterSets = PreferencesManager.get("fileFilters") || []; setLastFilter(item, itemIndex - FIRST_FILTER_INDEX); + _updatePicker(); } }); return _picker.$button; } + // For unit tests only + exports.setLastFilter = setLastFilter; + exports.createFilterPicker = createFilterPicker; exports.commitPicker = commitPicker; exports.getLastFilter = getLastFilter; diff --git a/src/styles/brackets.less b/src/styles/brackets.less index fd0e52f530e..67db14a6dc6 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1216,7 +1216,6 @@ a, img { } .filter-edit-icon { - /*display: inline-block;*/ float: right; width: 13px; height: 13px; @@ -1239,7 +1238,7 @@ li:hover .filter-edit-icon { } .recent-filter-name { - padding-left: 12px; + margin-left: 12px; } .recent-filter-patterns { diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index d45dd197c3d..f02c19080d9 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -477,6 +477,7 @@ a:focus { &.dropdown-menu li a { padding: 1px 15px 1px 15px; + color: @bc-black; } &.dropdown-menu .stylesheet-link { diff --git a/src/utils/DropdownEventHandler.js b/src/utils/DropdownEventHandler.js index 5578c7b074b..0218a071376 100644 --- a/src/utils/DropdownEventHandler.js +++ b/src/utils/DropdownEventHandler.js @@ -184,7 +184,12 @@ define(function (require, exports, module) { } } - this._setSelectedIndex(pos, true); + // If the item to be selected is a divider, then rotate one more. + if ($(this.$items[pos]).hasClass("divider")) { + this._rotateSelection((distance > 0) ? ++distance : --distance); + } else { + this._setSelectedIndex(pos, true); + } }; /** diff --git a/src/widgets/DropdownButton.js b/src/widgets/DropdownButton.js index ff0bc94dcda..5e102c29a2c 100644 --- a/src/widgets/DropdownButton.js +++ b/src/widgets/DropdownButton.js @@ -113,7 +113,7 @@ define(function (require, exports, module) { var html = ""; this.items.forEach(function (item, i) { if (item === "---") { - html += "
  • "; + html += "
  • "; } else { html += "
  • "; html += this.itemRenderer(item, i); From b5a97371e341c1529748aae62cff7485e430475f Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 16 May 2014 16:08:38 -0700 Subject: [PATCH 052/125] Allow nested parens in the property value context --- src/language/CSSUtils.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index 863968429ec..d05fd994d2d 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -84,6 +84,19 @@ define(function (require, exports, module) { * @return {boolean} true if the context is in property value */ function _isInPropValue(ctx) { + + function isInsideParens(context) { + if (context.type !== "parens" || !context.prev) { + return false; + } + + if (context.prev.type === "prop") { + return true; + } + + return isInsideParen(context.prev); + } + var state; if (!ctx || !ctx.token || !ctx.token.state || ctx.token.type === "comment") { return false; @@ -96,7 +109,7 @@ define(function (require, exports, module) { } return ((state.context.type === "prop" && (state.context.prev.type === "rule" || state.context.prev.type === "block")) || - (state.context.type === "parens" && state.context.prev.type === "prop")); + isInsideParens(state.context)); } /** From 9fac93d23cae374360d4f0296053da7b61c45cf2 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 16 May 2014 16:14:44 -0700 Subject: [PATCH 053/125] Fix a type in recursive function call. --- src/language/CSSUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index d05fd994d2d..094752b0bb6 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -94,7 +94,7 @@ define(function (require, exports, module) { return true; } - return isInsideParen(context.prev); + return isInsideParens(context.prev); } var state; From 89065448414a4967c3c7c61c73433fe837b2e6b7 Mon Sep 17 00:00:00 2001 From: Ingo Richter Date: Fri, 16 May 2014 17:22:11 -0700 Subject: [PATCH 054/125] - update CodeMirror to latest upstream --- src/thirdparty/CodeMirror2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thirdparty/CodeMirror2 b/src/thirdparty/CodeMirror2 index 0558dfe76ce..c6e7cd1bd76 160000 --- a/src/thirdparty/CodeMirror2 +++ b/src/thirdparty/CodeMirror2 @@ -1 +1 @@ -Subproject commit 0558dfe76ceae8764011c982d13a766087c9dd20 +Subproject commit c6e7cd1bd76cb42fe67199cd643d2b17cc3d0372 From a046c5fcc295842d957eae45fade3575b7ea5c60 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 16 May 2014 21:35:52 -0700 Subject: [PATCH 055/125] Fix update notification issue by moving two module level variables, _lastNotifiedBuildNumber and _lastInfoURLFetchTime, into their respective functions. --- src/utils/UpdateNotification.js | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index 6bdc210a900..c7d4ba3886a 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -64,14 +64,6 @@ define(function (require, exports, module) { "updateInfo": "user" }, true); - // This is the last version we notified the user about. If checkForUpdate() - // is called with "false", only show the update notification dialog if there - // is an update newer than this one. This value is saved in preferences. - var _lastNotifiedBuildNumber = PreferencesManager.getViewState("lastNotifiedBuildNumber"); - - // Last time the versionInfoURL was fetched - var _lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime"); - // URL to load version info from. By default this is loaded no more than once a day. If // you force an update check it is always loaded. @@ -125,6 +117,9 @@ define(function (require, exports, module) { * _versionInfoUrl is used for unit testing. */ function _getUpdateInformation(force, dontCache, _versionInfoUrl) { + // Last time the versionInfoURL was fetched + var lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime"); + var result = new $.Deferred(); var fetchData = false; var data; @@ -141,7 +136,7 @@ define(function (require, exports, module) { } // If more than 24 hours have passed since our last fetch, fetch again - if ((new Date()).getTime() > _lastInfoURLFetchTime + ONE_DAY) { + if ((new Date()).getTime() > lastInfoURLFetchTime + ONE_DAY) { fetchData = true; } @@ -195,8 +190,8 @@ define(function (require, exports, module) { cache: false }).done(function (updateInfo, textStatus, jqXHR) { if (!dontCache) { - _lastInfoURLFetchTime = (new Date()).getTime(); - PreferencesManager.setViewState("lastInfoURLFetchTime", _lastInfoURLFetchTime); + lastInfoURLFetchTime = (new Date()).getTime(); + PreferencesManager.setViewState("lastInfoURLFetchTime", lastInfoURLFetchTime); PreferencesManager.setViewState("updateInfo", updateInfo); } result.resolve(updateInfo); @@ -324,6 +319,11 @@ define(function (require, exports, module) { * @return {$.Promise} jQuery Promise object that is resolved or rejected after the update check is complete. */ function checkForUpdate(force, _testValues) { + // This is the last version we notified the user about. If checkForUpdate() + // is called with "false", only show the update notification dialog if there + // is an update newer than this one. This value is saved in preferences. + var lastNotifiedBuildNumber = PreferencesManager.getViewState("lastNotifiedBuildNumber"); + // The second param, if non-null, is an Object containing value overrides. Values // in the object temporarily override the local values. This should *only* be used for testing. // If any overrides are set, permanent changes are not made (including showing @@ -343,8 +343,8 @@ define(function (require, exports, module) { } if (_testValues.hasOwnProperty("_lastNotifiedBuildNumber")) { - oldValues._lastNotifiedBuildNumber = _lastNotifiedBuildNumber; - _lastNotifiedBuildNumber = _testValues._lastNotifiedBuildNumber; + oldValues._lastNotifiedBuildNumber = lastNotifiedBuildNumber; + lastNotifiedBuildNumber = _testValues._lastNotifiedBuildNumber; usingOverrides = true; } @@ -382,14 +382,14 @@ define(function (require, exports, module) { // Only show the update dialog if force = true, or if the user hasn't been // alerted of this update - if (force || allUpdates[0].buildNumber > _lastNotifiedBuildNumber) { + if (force || allUpdates[0].buildNumber > lastNotifiedBuildNumber) { _showUpdateNotificationDialog(allUpdates); // Update prefs with the last notified build number - _lastNotifiedBuildNumber = allUpdates[0].buildNumber; + lastNotifiedBuildNumber = allUpdates[0].buildNumber; // Don't save prefs is we have overridden values if (!usingOverrides) { - PreferencesManager.setViewState("lastNotifiedBuildNumber", _lastNotifiedBuildNumber); + PreferencesManager.setViewState("lastNotifiedBuildNumber", lastNotifiedBuildNumber); } } } else if (force) { @@ -406,7 +406,7 @@ define(function (require, exports, module) { _buildNumber = oldValues._buildNumber; } if (oldValues.hasOwnProperty("_lastNotifiedBuildNumber")) { - _lastNotifiedBuildNumber = oldValues._lastNotifiedBuildNumber; + lastNotifiedBuildNumber = oldValues._lastNotifiedBuildNumber; } } result.resolve(); From 171b52eaf6711751f25120b7e07673f54fdc0606 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 16 May 2014 21:51:24 -0700 Subject: [PATCH 056/125] Also set default info URL fetch time to zero. --- src/utils/UpdateNotification.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index c7d4ba3886a..cefad109514 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -53,6 +53,10 @@ define(function (require, exports, module) { // Init default last build number PreferencesManager.stateManager.definePreference("lastNotifiedBuildNumber", "number", 0); + + // Init default last info URL fetch time + PreferencesManager.stateManager.definePreference("lastInfoURLFetchTime", "number", 0); + // Time of last registry check for update PreferencesManager.stateManager.definePreference("lastExtensionRegistryCheckTime", "number", 0); // Data about available updates in the registry From 81c7ed5033ac35c957ef81a3c3bc21d1864ae2d7 Mon Sep 17 00:00:00 2001 From: Bernd Schwarzenbacher Date: Sat, 17 May 2014 09:38:24 +0200 Subject: [PATCH 057/125] Change to "{APP_TITLE} Homepage" in strings.js as requested. --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index efe144b6a64..c95ae4e1973 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -362,7 +362,7 @@ define({ "CMD_RELEASE_NOTES" : "Release Notes", "CMD_GET_INVOLVED" : "Get Involved", "CMD_SHOW_EXTENSIONS_FOLDER" : "Show Extensions Folder", - "CMD_HOMEPAGE" : "Brackets Homepage", + "CMD_HOMEPAGE" : "{APP_TITLE} Homepage", "CMD_TWITTER" : "{TWITTER_NAME} on Twitter", "CMD_ABOUT" : "About {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "Open Preferences File", From 42a23954da50f2b625c7531f84ce12c99a00b0e8 Mon Sep 17 00:00:00 2001 From: Kruno H Date: Sat, 17 May 2014 10:16:31 +0200 Subject: [PATCH 058/125] Update strings.js --- src/nls/hr/strings.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nls/hr/strings.js b/src/nls/hr/strings.js index 34a0ef8d214..387f235ab94 100644 --- a/src/nls/hr/strings.js +++ b/src/nls/hr/strings.js @@ -282,9 +282,11 @@ define({ "CMD_SPLIT_SEL_INTO_LINES" : "Razdvoji odabrano u redove", "CMD_ADD_CUR_TO_NEXT_LINE" : "Dodaj kursor u sljedeći red", "CMD_ADD_CUR_TO_PREV_LINE" : "Dodaj kursor u prošli red", + "FIND_MENU" : "Nađi", "CMD_FIND" : "Nađi", "CMD_FIND_FIELD_PLACEHOLDER" : "Nađi\u2026", "CMD_FIND_IN_FILES" : "Nađi u datotekama", + "CMD_FIND_IN_SELECTED" : "Nađi u odabranoj Datoteci/Mapi", "CMD_FIND_IN_SUBTREE" : "Nađi u\u2026", "CMD_FIND_NEXT" : "Nađi sljedeće", "CMD_FIND_PREVIOUS" : "Nađi prethodno", From 3c44e37c49727f2807c02cf02a39340861468ff5 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Sat, 17 May 2014 13:55:16 -0700 Subject: [PATCH 059/125] Move the code that performs "update notification check" from appReady to _beforeHTMLReady. --- src/brackets.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/brackets.js b/src/brackets.js index dfd95b53b4e..ea81ba6eb18 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -294,20 +294,19 @@ define(function (require, exports, module) { }); }); }); - - // Check for updates - if (!params.get("skipUpdateCheck") && !brackets.inBrowser) { - AppInit.appReady(function () { - // launches periodic checks for updates cca every 24 hours - UpdateNotification.launchAutomaticUpdate(); - }); - } } /** * Setup event handlers prior to dispatching AppInit.HTML_READY */ function _beforeHTMLReady() { + + // Check for updates + if (!params.get("skipUpdateCheck") && !brackets.inBrowser) { + // launches periodic checks for updates cca every 24 hours + UpdateNotification.launchAutomaticUpdate(); + } + // Add the platform (mac or win) to the body tag so we can have platform-specific CSS rules $("body").addClass("platform-" + brackets.platform); From c38d1163a3e0b12af86875433957ee4b784bac84 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Sat, 17 May 2014 20:13:05 -0700 Subject: [PATCH 060/125] Remove underscore from all remaining _lastNotifiedBuildNumber instances. --- src/utils/UpdateNotification.js | 10 +++++----- test/spec/UpdateNotification-test.js | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index cefad109514..8a3d0b8bcf1 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -346,9 +346,9 @@ define(function (require, exports, module) { usingOverrides = true; } - if (_testValues.hasOwnProperty("_lastNotifiedBuildNumber")) { - oldValues._lastNotifiedBuildNumber = lastNotifiedBuildNumber; - lastNotifiedBuildNumber = _testValues._lastNotifiedBuildNumber; + if (_testValues.hasOwnProperty("lastNotifiedBuildNumber")) { + oldValues.lastNotifiedBuildNumber = lastNotifiedBuildNumber; + lastNotifiedBuildNumber = _testValues.lastNotifiedBuildNumber; usingOverrides = true; } @@ -409,8 +409,8 @@ define(function (require, exports, module) { if (oldValues.hasOwnProperty("_buildNumber")) { _buildNumber = oldValues._buildNumber; } - if (oldValues.hasOwnProperty("_lastNotifiedBuildNumber")) { - lastNotifiedBuildNumber = oldValues._lastNotifiedBuildNumber; + if (oldValues.hasOwnProperty("lastNotifiedBuildNumber")) { + lastNotifiedBuildNumber = oldValues.lastNotifiedBuildNumber; } } result.resolve(); diff --git a/test/spec/UpdateNotification-test.js b/test/spec/UpdateNotification-test.js index 15d5b28d3fd..4db5f1f7a48 100644 --- a/test/spec/UpdateNotification-test.js +++ b/test/spec/UpdateNotification-test.js @@ -64,7 +64,7 @@ define(function (require, exports, module) { it("should show a notification if an update is available", function () { var updateInfo = { _buildNumber: 72, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: updateInfoURL }; @@ -81,7 +81,7 @@ define(function (require, exports, module) { it("should show update information for all available updates", function () { var updateInfo = { _buildNumber: 10, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: updateInfoURL }; @@ -100,7 +100,7 @@ define(function (require, exports, module) { it("should not show dialog if user has already been notified", function () { var updateInfo = { _buildNumber: 10, - _lastNotifiedBuildNumber: 93, + lastNotifiedBuildNumber: 93, _versionInfoURL: updateInfoURL }; @@ -118,7 +118,7 @@ define(function (require, exports, module) { it("should not show dialog if app is up to date", function () { var updateInfo = { _buildNumber: 93, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: updateInfoURL }; @@ -136,7 +136,7 @@ define(function (require, exports, module) { it("should show an 'up to date' alert if no updates are available and the user manually checks for updates", function () { var updateInfo = { _buildNumber: 93, - _lastNotifiedBuildNumber: 93, + lastNotifiedBuildNumber: 93, _versionInfoURL: updateInfoURL }; @@ -155,7 +155,7 @@ define(function (require, exports, module) { it("should sanitize text returned from server", function () { var updateInfo = { _buildNumber: 72, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: maliciousInfoURL }; @@ -177,7 +177,7 @@ define(function (require, exports, module) { it("should error dialog if json is broken and can not be parsed", function () { var updateInfo = { _buildNumber: 72, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: brokenInfoURL }; @@ -196,7 +196,7 @@ define(function (require, exports, module) { describe("Locale Fallback", function () { var updateInfo = { _buildNumber: 72, - _lastNotifiedBuildNumber: 0, + lastNotifiedBuildNumber: 0, _versionInfoURL: doesNotExistURL }; From 2874684d49b8af1aa00edffbb4b899d9e75b7b41 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Sat, 17 May 2014 23:20:36 -0400 Subject: [PATCH 061/125] Revert "Move the code that performs "update notification check" from appReady to _beforeHTMLReady." This reverts commit 3c44e37c49727f2807c02cf02a39340861468ff5. --- src/brackets.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/brackets.js b/src/brackets.js index ea81ba6eb18..dfd95b53b4e 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -294,19 +294,20 @@ define(function (require, exports, module) { }); }); }); + + // Check for updates + if (!params.get("skipUpdateCheck") && !brackets.inBrowser) { + AppInit.appReady(function () { + // launches periodic checks for updates cca every 24 hours + UpdateNotification.launchAutomaticUpdate(); + }); + } } /** * Setup event handlers prior to dispatching AppInit.HTML_READY */ function _beforeHTMLReady() { - - // Check for updates - if (!params.get("skipUpdateCheck") && !brackets.inBrowser) { - // launches periodic checks for updates cca every 24 hours - UpdateNotification.launchAutomaticUpdate(); - } - // Add the platform (mac or win) to the body tag so we can have platform-specific CSS rules $("body").addClass("platform-" + brackets.platform); From 8d2daf08e0aafbe6e6ee0f9ba35948c707356e69 Mon Sep 17 00:00:00 2001 From: Zach Date: Sun, 18 May 2014 14:36:31 -0400 Subject: [PATCH 062/125] I've corrected a minor typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c1e264f5c75..80103201b81 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ see the [extensions wiki page](https://github.com/adobe/brackets/wiki/Brackets-E #### Need help? -Having problems starting Brackets the first time, or not sure how to use brackets? Please +Having problems starting Brackets the first time, or not sure how to use Brackets? Please review [Troubleshooting](https://github.com/adobe/brackets/wiki/Troubleshooting), which helps you to fix common problems and find extra help if needed. From 171d73a40ce4e6d74191a5188077f96384a0e79d Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Sun, 18 May 2014 13:29:02 -0700 Subject: [PATCH 063/125] Fix broken integration tests caused by switching to the new filter UI. Add a new set of unit tests for testing preferences and view states used for multiple file filter sets. --- src/search/FileFilters.js | 32 ++++++++------ test/spec/FileFilters-test.js | 80 +++++++++++++++++++++++++++++++---- test/spec/FindReplace-test.js | 4 +- 3 files changed, 93 insertions(+), 23 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index f32c4cb51b9..78fe91a57ee 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -40,9 +40,17 @@ define(function (require, exports, module) { Strings = require("strings"), PreferencesManager = require("preferences/PreferencesManager"); + /** @type {number} Constant: first filter index in the filter dropdown list */ var FIRST_FILTER_INDEX = 3; - var _context = null, - _picker = null; + + /** @type {?{label:string, promise:$.Promise}} context Info on which files the filter will be applied to. + * It will be initialized when createFilterPicker is called and if specified, editing UI will + * indicate how many files are excluded by the filter. Label should be of the form "in ..." + */ + var _context = null; + + /** @type {DropdownButton} */ + var _picker = null; /** * Populate the list of dropdown menu with two filter commands and @@ -271,13 +279,11 @@ define(function (require, exports, module) { * Opens a dialog box to edit the given filter. When editing is finished, the value of getLastFilter() changes to * reflect the edits. If the dialog was canceled, the preference is left unchanged. * @param {!{name: string, patterns: Array.}} filter - * @param {?{label:string, promise:$.Promise}} context Info on which files the filter will be applied to. If specified, - * editing UI will indicate how many files are excluded by the filter. Label should be of the form "in ..." * @param {number} index The index of the filter set to be edited or created. The value is -1 if it is for a new one * to be created, * @return {!$.Promise} Dialog box promise */ - function editFilter(filter, context, index) { + function editFilter(filter, index) { var lastFocus = window.document.activeElement; var html = StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url) + @@ -318,18 +324,18 @@ define(function (require, exports, module) { var $fileCount = dialog.getElement().find(".exclusions-filecount"); function updateFileCount() { - context.promise.done(function (files) { + _context.promise.done(function (files) { var filter = getValue(); if (filter.length) { var filtered = filterFileList(compile(filter), files); - $fileCount.html(StringUtils.format(Strings.FILTER_FILE_COUNT, filtered.length, files.length, context.label)); + $fileCount.html(StringUtils.format(Strings.FILTER_FILE_COUNT, filtered.length, files.length, _context.label)); } else { - $fileCount.html(StringUtils.format(Strings.FILTER_FILE_COUNT_ALL, files.length, context.label)); + $fileCount.html(StringUtils.format(Strings.FILTER_FILE_COUNT_ALL, files.length, _context.label)); } }); } - if (context) { + if (_context) { $editField.on("input", _.debounce(updateFileCount, 400)); updateFileCount(); } else { @@ -422,7 +428,7 @@ define(function (require, exports, module) { // prior to opening it. _picker.closeDropdown(); - editFilter(filterSets[filterIndex], _context, filterIndex); + editFilter(filterSets[filterIndex], filterIndex); }); } @@ -475,7 +481,7 @@ define(function (require, exports, module) { _picker.closeDropdown(); // Create a new filter set - editFilter({ name: "", patterns: [] }, _context, -1); + editFilter({ name: "", patterns: [] }, -1); } else if (itemIndex === 1) { // Clear the active filter setLastFilter(); @@ -490,12 +496,10 @@ define(function (require, exports, module) { return _picker.$button; } - // For unit tests only - exports.setLastFilter = setLastFilter; - exports.createFilterPicker = createFilterPicker; exports.commitPicker = commitPicker; exports.getLastFilter = getLastFilter; + exports.setLastFilter = setLastFilter; exports.editFilter = editFilter; exports.compile = compile; exports.filterPath = filterPath; diff --git a/test/spec/FileFilters-test.js b/test/spec/FileFilters-test.js index 682e92e8624..f0ee80993ba 100644 --- a/test/spec/FileFilters-test.js +++ b/test/spec/FileFilters-test.js @@ -27,11 +27,12 @@ define(function (require, exports, module) { 'use strict'; - var FileFilters = require("search/FileFilters"), - SpecRunnerUtils = require("spec/SpecRunnerUtils"), - Dialogs = require("widgets/Dialogs"), - Commands = require("command/Commands"), - KeyEvent = require("utils/KeyEvent"); + var FileFilters = require("search/FileFilters"), + SpecRunnerUtils = require("spec/SpecRunnerUtils"), + Dialogs = require("widgets/Dialogs"), + Commands = require("command/Commands"), + KeyEvent = require("utils/KeyEvent"), + PreferencesManager = require("preferences/PreferencesManager"); describe("FileFilters", function () { @@ -419,6 +420,69 @@ define(function (require, exports, module) { }); }); + describe("Multiple filter sets preferences", function () { + it("should not have any filter sets in preferences initially", function () { + expect(PreferencesManager.get("fileFilters")).toBeFalsy(); + }); + + it("should migrate old filter sets to the new multiple filter sets pref", function () { + PreferencesManager.setViewState("search.exclusions", "*.css, *.less"); + expect(FileFilters.getLastFilter()).toEqual({name: "", patterns: "*.css, *.less"}); + expect(PreferencesManager.get("fileFilters")).toEqual([{name: "", patterns: "*.css, *.less"}]); + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(0); + }); + + it("should select the newly added filter set as the active one", function () { + var existingFilters = [{name: "Node Modules", patterns: "node_module"}, + {name: "Mark Down Files", patterns: "*.md"}], + newFilterSet = {name: "CSS Files", patterns: "*.css, *.less"}; + + // Create two filter sets and make the first one active. + PreferencesManager.set("fileFilters", existingFilters); + PreferencesManager.setViewState("activeFileFilter", 0); + + // Add a new filter set as the last one. + FileFilters.setLastFilter(newFilterSet, -1); + expect(FileFilters.getLastFilter()).toEqual(newFilterSet); + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(2); + expect(PreferencesManager.get("fileFilters")).toEqual(existingFilters.concat([newFilterSet])); + }); + + it("should select the just edited filter set as the active one", function () { + var existingFilters = [{name: "Node Modules", patterns: "node_module"}, + {name: "Mark Down Files", patterns: "*.md"}], + newFilterSet = {name: "CSS Files", patterns: "*.css, *.less"}; + + // Create two filter sets and make the first one active. + PreferencesManager.set("fileFilters", existingFilters); + PreferencesManager.setViewState("activeFileFilter", 0); + + // Replace the second filter set with a new one. + FileFilters.setLastFilter(newFilterSet, 1); + expect(FileFilters.getLastFilter()).toEqual(newFilterSet); + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(1); + + existingFilters.splice(1, 1, newFilterSet); + expect(PreferencesManager.get("fileFilters")).toEqual(existingFilters); + }); + + it("should not have an active filter set after removing the current active one", function () { + var existingFilters = [{name: "Node Modules", patterns: "node_module"}, + {name: "Mark Down Files", patterns: "*.md"}]; + + // Create two filter sets and make the second one active. + PreferencesManager.set("fileFilters", existingFilters); + PreferencesManager.setViewState("activeFileFilter", 1); + + expect(PreferencesManager.get("fileFilters")).toEqual(existingFilters); + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(1); + + // Remove the current active filter + FileFilters.setLastFilter(); + + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(-1); + }); + }); describe("Find in Files filtering", function () { @@ -493,7 +557,7 @@ define(function (require, exports, module) { // This finishes async, since clickDialogButton() finishes async (dialogs close asynchronously) function setExcludeCSSFiles() { // Launch filter editor - $(".filter-picker button").click(); + FileFilters.editFilter({ name: "", patterns: [] }, -1); // Edit the filter & confirm changes $(".modal.instance textarea").val("*.css"); @@ -537,7 +601,7 @@ define(function (require, exports, module) { runs(function () { // Cannot explicitly set *.css filter in dialog because button is hidden // (which is verified here), but filter persists from previous test - expect($(".filter-picker button").is(":visible")).toBeFalsy(); + expect($("button.file-filter-picker").is(":visible")).toBeFalsy(); }); runs(function () { executeSearch("{1}"); @@ -552,7 +616,7 @@ define(function (require, exports, module) { openSearchBar(); runs(function () { // Launch filter editor - $(".filter-picker button").click(); + FileFilters.editFilter({ name: "", patterns: [] }, -1); // Edit the filter & confirm changes $(".modal.instance textarea").val("test1.*\n*.css"); diff --git a/test/spec/FindReplace-test.js b/test/spec/FindReplace-test.js index d0ad8d501e9..3c37cd804c0 100644 --- a/test/spec/FindReplace-test.js +++ b/test/spec/FindReplace-test.js @@ -1540,6 +1540,7 @@ define(function (require, exports, module) { CommandManager, DocumentManager, EditorManager, + FileFilters, FileSystem, FindInFiles, testWindow, @@ -1554,6 +1555,7 @@ define(function (require, exports, module) { CommandManager = testWindow.brackets.test.CommandManager; DocumentManager = testWindow.brackets.test.DocumentManager; EditorManager = testWindow.brackets.test.EditorManager; + FileFilters = testWindow.brackets.test.FileFilters; FileSystem = testWindow.brackets.test.FileSystem; FindInFiles = testWindow.brackets.test.FindInFiles; CommandManager = testWindow.brackets.test.CommandManager; @@ -1650,7 +1652,7 @@ define(function (require, exports, module) { runs(function () { // Launch filter editor - $(".filter-picker button").click(); + FileFilters.editFilter({ name: "", patterns: [] }, -1); // Dialog should state there are 0 files in project $dlg = $(".modal"); From 1f1823749ba44b5cc84687ee9ac44c4ca71c7248 Mon Sep 17 00:00:00 2001 From: Rodrigo Tavares Date: Mon, 19 May 2014 07:30:51 -0700 Subject: [PATCH 064/125] Update pt-br/strings.js --- src/nls/pt-br/strings.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nls/pt-br/strings.js b/src/nls/pt-br/strings.js index 7a0eca0152a..f1274b402f2 100644 --- a/src/nls/pt-br/strings.js +++ b/src/nls/pt-br/strings.js @@ -362,6 +362,7 @@ define({ "CMD_RELEASE_NOTES" : "Notas da versão", "CMD_GET_INVOLVED" : "Envolva-se", "CMD_SHOW_EXTENSIONS_FOLDER" : "Mostrar pasta de extensões", + "CMD_HOMEPAGE" : "Página do Brackets", "CMD_TWITTER" : "{TWITTER_NAME} no Twitter", "CMD_ABOUT" : "Sobre o {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "Abrir arquivo de configurações", @@ -546,4 +547,4 @@ define({ "DOCS_MORE_LINK" : "Leia mais" }); -/* Last translated for 143aac5dc44a3e285bb708870b41d1cd0e2b1a64 */ +/* Last translated for 368a63c4d682185da0a90f9538c1e7fc0612c9c9 */ From 42930a3808a1a406df9dc7f80a1ae97d8c44db64 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Mon, 19 May 2014 11:59:00 -0700 Subject: [PATCH 065/125] Some more integration tests for file filters UI. --- src/search/FileFilters.js | 22 ++ test/spec/FileFilters-test.js | 422 +++++++++++++++++++++++++++++++++- 2 files changed, 439 insertions(+), 5 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 78fe91a57ee..f64302489f6 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -496,6 +496,28 @@ define(function (require, exports, module) { return _picker.$button; } + /** + * Allows unit tests to open the file filter dropdown list. + */ + function showDropdown() { + if (_picker) { + _picker.showDropdown(); + } + } + + /** + * Allows unit tests to close the file filter dropdown list. + */ + function closeDropdown() { + if (_picker) { + _picker.closeDropdown(); + } + } + + // For unit tests only + exports.showDropdown = showDropdown; + exports.closeDropdown = closeDropdown; + exports.createFilterPicker = createFilterPicker; exports.commitPicker = commitPicker; exports.getLastFilter = getLastFilter; diff --git a/test/spec/FileFilters-test.js b/test/spec/FileFilters-test.js index f0ee80993ba..f15abbc01ee 100644 --- a/test/spec/FileFilters-test.js +++ b/test/spec/FileFilters-test.js @@ -32,7 +32,9 @@ define(function (require, exports, module) { Dialogs = require("widgets/Dialogs"), Commands = require("command/Commands"), KeyEvent = require("utils/KeyEvent"), - PreferencesManager = require("preferences/PreferencesManager"); + PreferencesManager = require("preferences/PreferencesManager"), + Strings = require("strings"), + StringUtils = require("utils/StringUtils"); describe("FileFilters", function () { @@ -480,8 +482,8 @@ define(function (require, exports, module) { // Remove the current active filter FileFilters.setLastFilter(); - expect(PreferencesManager.getViewState("activeFileFilter")).toBe(-1); - }); + expect(PreferencesManager.getViewState("activeFileFilter")).toBe(-1); + }); }); describe("Find in Files filtering", function () { @@ -670,6 +672,416 @@ define(function (require, exports, module) { }); }); - }); - + describe("Filter picker UI", function () { + + this.category = "integration"; + + var testPath = SpecRunnerUtils.getTestPath("/spec/InlineEditorProviders-test-files"), + testWindow, + FileFilters, + FileSystem, + FindInFiles, + CommandManager, + $; + + beforeFirst(function () { + // Create a new window that will be shared by ALL tests in this spec. + SpecRunnerUtils.createTestWindowAndRun(this, function (w) { + testWindow = w; + + // Load module instances from brackets.test + FileFilters = testWindow.brackets.test.FileFilters; + FileSystem = testWindow.brackets.test.FileSystem; + FindInFiles = testWindow.brackets.test.FindInFiles; + CommandManager = testWindow.brackets.test.CommandManager; + $ = testWindow.$; + + SpecRunnerUtils.loadProjectInTestWindow(testPath); + }); + }); + + afterLast(function () { + testWindow = null; + FileSystem = null; + FileFilters = null; + FindInFiles = null; + CommandManager = null; + $ = null; + SpecRunnerUtils.closeTestWindow(); + }); + + function openSearchBar(scope) { + // Make sure search bar from previous test has animated out fully + runs(function () { + waitsFor(function () { + return $(".modal-bar").length === 0; + }, "search bar close"); + }); + runs(function () { + FindInFiles._doFindInFiles(scope); + }); + } + + function closeSearchBar() { + var $searchField = $(".modal-bar #find-group input"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", $searchField[0]); + } + + function verifyButtonLabel(expectedLabel) { + var newButtonLabel = StringUtils.format(Strings.EXCLUDE_FILE_FILTER, expectedLabel); + + if (expectedLabel) { + // Verify filter picker button label is updated with the patterns of the selected filter set. + expect($("button.file-filter-picker").text()).toEqual(newButtonLabel); + } else { + expect($("button.file-filter-picker").text()).toEqual(Strings.NO_FILE_FILTER); + } + } + + // This finishes async, since clickDialogButton() finishes async (dialogs close asynchronously) + function setExcludeCSSFiles() { + // Edit the filter & confirm changes + $(".modal.instance .exclusions-name").val("CSS Files"); + $(".modal.instance .exclusions-editor").val("*.css\n*.less\n*.scss"); + SpecRunnerUtils.clickDialogButton(Dialogs.DIALOG_BTN_OK); + } + + // Trigger a mouseover event on the 'parent' and then click on the button with the given 'selector'. + function clickOnMouseOverButton(selector, parent) { + runs(function () { + parent.trigger("mouseover"); + }); + runs(function () { + expect($(selector, parent).is(":visible")).toBeTruthy(); + $(selector, parent).click(); + }); + } + + it("should show 'No files Excluded' in filter picker button by default", function () { + openSearchBar(); + runs(function () { + verifyButtonLabel(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should show two filter commands by default", function () { + openSearchBar(); + runs(function () { + FileFilters.showDropdown(); + }); + + runs(function () { + var $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.is(":visible")).toBeTruthy(); + expect($dropdown.children().length).toEqual(2); + expect($($dropdown.children()[0]).text()).toEqual(Strings.NEW_FILE_FILTER); + expect($($dropdown.children()[1]).text()).toEqual(Strings.CLEAR_FILE_FILTER); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should launch filter editor and add a new filter set when invoked from new filter command", function () { + var $dropdown; + openSearchBar(); + runs(function () { + FileFilters.showDropdown(); + }); + + // Invoke new filter command by pressing down arrow key once and then enter key. + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_DOWN, "keydown", $dropdown[0]); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $dropdown[0]); + }); + + runs(function () { + setExcludeCSSFiles(); + }); + + runs(function () { + FileFilters.showDropdown(); + }); + + runs(function () { + var filterSuffix = StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, 1); + + // Verify filter picker button is updated with the name of the new filter. + verifyButtonLabel("CSS Files"); + + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.is(":visible")).toBeTruthy(); + expect($dropdown.children().length).toEqual(4); + expect($($dropdown.children()[0]).text()).toEqual(Strings.NEW_FILE_FILTER); + expect($($dropdown.children()[1]).text()).toEqual(Strings.CLEAR_FILE_FILTER); + expect($(".recent-filter-name", $($dropdown.children()[3])).text()).toEqual("CSS Files"); + expect($(".recent-filter-patterns", $($dropdown.children()[3])).text()).toEqual(" - *.css, *.less " + filterSuffix); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should clear the active filter set when invoked from clear filter command", function () { + var $dropdown; + openSearchBar(); + runs(function () { + FileFilters.showDropdown(); + }); + + // Invoke new filter command by pressing down arrow key twice and then enter key. + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_DOWN, "keydown", $dropdown[0]); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_DOWN, "keydown", $dropdown[0]); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $dropdown[0]); + }); + + runs(function () { + // Verify filter picker button is updated to show no active filter. + verifyButtonLabel(); + expect($dropdown.is(":visible")).toBeFalsy(); + }); + + // Re-open dropdown list and verify that nothing changed. + runs(function () { + FileFilters.showDropdown(); + }); + + runs(function () { + var filterSuffix = StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, 1); + + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.is(":visible")).toBeTruthy(); + expect($dropdown.children().length).toEqual(4); + expect($($dropdown.children()[0]).text()).toEqual(Strings.NEW_FILE_FILTER); + expect($($dropdown.children()[1]).text()).toEqual(Strings.CLEAR_FILE_FILTER); + expect($(".recent-filter-name", $($dropdown.children()[3])).text()).toEqual("CSS Files"); + expect($(".recent-filter-patterns", $($dropdown.children()[3])).text()).toEqual(" - *.css, *.less " + filterSuffix); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should switch the active filter set to the selected one", function () { + var $dropdown; + openSearchBar(); + runs(function () { + // Verify that there is no active filter (was set from the previous test). + verifyButtonLabel(); + FileFilters.showDropdown(); + }); + + // Select the last filter set in the dropdown by pressing up arrow key once and then enter key. + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_UP, "keydown", $dropdown[0]); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $dropdown[0]); + }); + + runs(function () { + // Verify filter picker button label is updated with the name of the selected filter set. + verifyButtonLabel("CSS Files"); + expect($dropdown.is(":visible")).toBeFalsy(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should launch filter editor and fill in the text fields with selected filter info", function () { + var $dropdown; + openSearchBar(); + + runs(function () { + FileFilters.showDropdown(); + }); + + // Click on the edit icon that shows up in the first filter set on mouseover. + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + clickOnMouseOverButton(".filter-edit-icon", $($dropdown.children()[3])); + }); + + // Remove the name of the filter set and reduce the filter set to '*.css'. + runs(function () { + expect($(".modal.instance .exclusions-name").val()).toEqual("CSS Files"); + expect($(".modal.instance .exclusions-editor").val()).toEqual("*.css\n*.less\n*.scss"); + + $(".modal.instance .exclusions-name").val(""); + $(".modal.instance .exclusions-editor").val("*.css"); + SpecRunnerUtils.clickDialogButton(Dialogs.DIALOG_BTN_OK); + }); + + runs(function () { + // Verify filter picker button label is updated with the patterns of the selected filter set. + verifyButtonLabel("*.css"); + expect($dropdown.is(":visible")).toBeFalsy(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should remove selected filter from filter sets preferences without changing picker button label", function () { + var $dropdown, + filters = [{name: "Node Modules", patterns: ["node_module"]}, + {name: "Mark Down Files", patterns: ["*.md"]}, + {name: "CSS Files", patterns: ["*.css", "*.less"]}]; + + openSearchBar(); + + // Create three filter sets and make the last one active. + runs(function () { + FileFilters.editFilter(filters[0], 0); + SpecRunnerUtils.clickDialogButton(Dialogs.DIALOG_BTN_OK); + }); + + runs(function () { + FileFilters.editFilter(filters[1], -1); + SpecRunnerUtils.clickDialogButton(Dialogs.DIALOG_BTN_OK); + }); + + runs(function () { + FileFilters.editFilter(filters[2], -1); + SpecRunnerUtils.clickDialogButton(Dialogs.DIALOG_BTN_OK); + }); + + runs(function () { + verifyButtonLabel("CSS Files"); + FileFilters.showDropdown(); + }); + + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.children().length).toEqual(6); + }); + + // Click on the delete icon that shows up in the first filter set on mouseover. + runs(function () { + clickOnMouseOverButton(".filter-trash-icon", $($dropdown.children()[3])); + }); + + runs(function () { + expect($dropdown.is(":visible")).toBeTruthy(); + // Verify that button label is still the same since the deleted one is not the active one. + verifyButtonLabel("CSS Files"); + + // Verify that the list has one less item (from 6 to 5). + expect($dropdown.children().length).toEqual(5); + + // Verify data-index of the two remaining filter sets. + expect($("a", $dropdown.children()[3]).data("index")).toBe(3); + expect($("a", $dropdown.children()[4]).data("index")).toBe(4); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should remove selected filter from filter sets preferences plus changing picker button label", function () { + var $dropdown; + + openSearchBar(); + + runs(function () { + verifyButtonLabel("CSS Files"); + FileFilters.showDropdown(); + }); + + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.children().length).toEqual(5); + }); + + // Click on the delete icon that shows up in the last filter set on mouseover. + runs(function () { + clickOnMouseOverButton(".filter-trash-icon", $($dropdown.children()[4])); + }); + + runs(function () { + expect($dropdown.is(":visible")).toBeTruthy(); + // Verify that button label is changed to "No Files Excluded". + verifyButtonLabel(); + + // Verify that the list has one less item. + expect($dropdown.children().length).toEqual(4); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + + it("should also remove the divider from the dropdown list after removing the last remaining filter set", function () { + var $dropdown; + + openSearchBar(); + + runs(function () { + verifyButtonLabel(); + FileFilters.showDropdown(); + }); + + runs(function () { + $dropdown = $(".dropdown-menu.dropdownbutton-popup"); + expect($dropdown.children().length).toEqual(4); + }); + + // Click on the delete icon that shows up in the last filter set on mouseover. + runs(function () { + clickOnMouseOverButton(".filter-trash-icon", $($dropdown.children()[3])); + }); + + runs(function () { + expect($dropdown.is(":visible")).toBeTruthy(); + // Verify that button label still shows "No Files Excluded". + verifyButtonLabel(); + + // Verify that the list has only two filter commands. + expect($dropdown.children().length).toEqual(2); + }); + + runs(function () { + FileFilters.closeDropdown(); + }); + + runs(function () { + closeSearchBar(); + }); + }); + }); + }); }); From 92e44a11dafe7be9d6a157a15a78c00972dfe468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Malbr=C3=A1n?= Date: Mon, 19 May 2014 16:52:10 -0300 Subject: [PATCH 066/125] Fixes after second review --- src/editor/EditorCommandHandlers.js | 12 ++++--- test/spec/EditorCommandHandlers-test.js | 42 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index 0e25faf0c5c..2b4caed3529 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -150,7 +150,7 @@ define(function (require, exports, module) { for (i = startLine; i <= endLine; i++) { line = editor.document.getLine(i); // A line is commented out if it starts with 0-N whitespace chars, then a line comment prefix - if (!line.length || (line.match(/\S/) && !_matchExpressions(line, lineExp))) { + if (line.match(/\S/) && !_matchExpressions(line, lineExp)) { containsNotLineComment = true; break; } @@ -324,7 +324,7 @@ define(function (require, exports, module) { editGroup = [], edit; - var searchCtx, atSuffix, initialPos, endLine; + var searchCtx, atSuffix, suffixEnd, initialPos, endLine; if (!selectionsToTrack) { // Track the original selection. @@ -363,7 +363,7 @@ define(function (require, exports, module) { isBlockComment = true; // If we are in a line that only has a prefix or a suffix and the prefix and suffix are the same string, - // lets find first if this is a prefix or suffix and move the token to the inside of the block comment. + // lets find first if this is a prefix or suffix and move the context position to the inside of the block comment. // This means that the token will be anywere inside the block comment, including the lines with the delimiters. // This is required so that later we can find the prefix by moving backwards and the suffix by moving forwards. if (ctx.token.string === prefix && prefix === suffix) { @@ -406,8 +406,10 @@ define(function (require, exports, module) { } while (result && !ctx.token.string.match(prefixExp)); invalidComment = result && !!ctx.token.string.match(prefixExp); - // We moved the token at the start when it was in a whitespace, but maybe we shouldn't have done it - if ((suffixPos && CodeMirror.cmpPos(sel.start, suffixPos) > 0) || (prefixPos && CodeMirror.cmpPos(sel.end, prefixPos) < 0)) { + // Make sure we didn't search so far backward or forward that we actually found a block comment + // that's entirely before or after the selection. + suffixEnd = suffixPos && { line: suffixPos.line, ch: suffixPos.ch + suffix.length }; + if ((suffixEnd && CodeMirror.cmpPos(sel.start, suffixEnd) > 0) || (prefixPos && CodeMirror.cmpPos(sel.end, prefixPos) < 0)) { canComment = true; } diff --git a/test/spec/EditorCommandHandlers-test.js b/test/spec/EditorCommandHandlers-test.js index 20d8339b29a..849539f2abf 100644 --- a/test/spec/EditorCommandHandlers-test.js +++ b/test/spec/EditorCommandHandlers-test.js @@ -419,6 +419,31 @@ define(function (require, exports, module) { expectSelection({start: {line: 1, ch: 0}, end: {line: 6, ch: 0}}); }); + it("should uncomment ragged partial comments with empty lines in-between", function () { + // Start with lines 1-5 commented out, with "//" snug up against each non-blank line's code + var lines = defaultContent.split("\n"); + lines[1] = " //function bar() {"; + lines[2] = ""; + lines[3] = " //a();"; + lines[4] = ""; + lines[5] = " //}"; + var startingContent = lines.join("\n"); + myDocument.setText(startingContent); + + // select lines 1-5 + myEditor.setSelection({line: 1, ch: 0}, {line: 6, ch: 0}); + + lines = defaultContent.split("\n"); + lines[2] = ""; + lines[4] = ""; + var expectedText = lines.join("\n"); + + CommandManager.execute(Commands.EDIT_LINE_COMMENT, myEditor); + + expect(myDocument.getText()).toEqual(expectedText); + expectSelection({start: {line: 1, ch: 0}, end: {line: 6, ch: 0}}); + }); + it("should uncomment ragged partial comments", function () { // Start with lines 1-5 commented out, with "//" snug up against each non-blank line's code var lines = defaultContent.split("\n"); @@ -630,6 +655,7 @@ define(function (require, exports, module) { expectSelection({start: {line: 1, ch: 0}, end: {line: 4, ch: 0}}); }); }); + describe("Line comment in languages with no given line comment prefix", function () { beforeEach(function () { setupFullEditor(null, "unknown"); @@ -742,6 +768,22 @@ define(function (require, exports, module) { expect(myDocument.getText()).toEqual(defaultContent); expectCursorAt({line: 1, ch: 16}); }); + + it("should block uncomment, cursor within existing block comment suffix", function () { + // Start with part of line 1 wrapped in a block comment + var lines = defaultContent.split("\n"); + lines[1] = " function /*bar()*/ {"; + var startingContent = lines.join("\n"); + myDocument.setText(startingContent); + + // put cursor within block + myEditor.setCursorPos(1, 21); + + CommandManager.execute(Commands.EDIT_BLOCK_COMMENT, myEditor); + + expect(myDocument.getText()).toEqual(defaultContent); + expectCursorAt({line: 1, ch: 18}); + }); it("should block uncomment, selection covering whole sub-line block comment", function () { // Start with part of line 1 wrapped in a block comment From 41080341490e4dac8965cf57b376f5d688c4c81a Mon Sep 17 00:00:00 2001 From: Ingo Richter Date: Mon, 19 May 2014 13:30:58 -0700 Subject: [PATCH 067/125] - update CodeMirror to latest upstream --- src/thirdparty/CodeMirror2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thirdparty/CodeMirror2 b/src/thirdparty/CodeMirror2 index c6e7cd1bd76..eb64d4266e1 160000 --- a/src/thirdparty/CodeMirror2 +++ b/src/thirdparty/CodeMirror2 @@ -1 +1 @@ -Subproject commit c6e7cd1bd76cb42fe67199cd643d2b17cc3d0372 +Subproject commit eb64d4266e1395c38ac0919fe2fc49417349f2a3 From 48508c4a3146fb84784f96c05a224034345dfcbc Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Mon, 19 May 2014 13:40:50 -0700 Subject: [PATCH 068/125] Don't bother to move the cursor after the the space following a colon since it is not in a separate token from the one that only has the colon. --- src/extensions/default/CSSCodeHints/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js index 9a6bba8ca54..a883d482bef 100644 --- a/src/extensions/default/CSSCodeHints/main.js +++ b/src/extensions/default/CSSCodeHints/main.js @@ -387,7 +387,7 @@ define(function (require, exports, module) { // before we locate the colon following it. TokenUtils.moveNextToken(ctx); } - if (TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx) && ctx.token.string === ": ") { + if (TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx) && ctx.token.string === ":") { adjustCursor = true; newCursor = { line: cursor.line, ch: cursor.ch + (hint.length - this.info.name.length) }; From 94913561d5dddd269fffdebfee06595bab375f93 Mon Sep 17 00:00:00 2001 From: Triangle717 Date: Mon, 19 May 2014 16:49:42 -0400 Subject: [PATCH 069/125] Remove `brackets.app.abortQuit` checks --- src/document/DocumentCommandHandlers.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 440a08b25e1..36dddf50360 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1280,10 +1280,7 @@ define(function (require, exports, module) { }, function () { // if fail, tell the app to abort any pending quit operation. - // TODO: remove this if statement when we move to the new CEF3 shell - if (brackets.app.abortQuit) { - brackets.app.abortQuit(); - } + brackets.app.abortQuit(); } ); } @@ -1311,10 +1308,7 @@ define(function (require, exports, module) { }, function () { // if fail, don't exit: user canceled (or asked us to save changes first, but we failed to do so) - // TODO: remove this if statement when we move to the new CEF3 shell - if (brackets.app.abortQuit) { - brackets.app.abortQuit(); - } + brackets.app.abortQuit(); } ); } From 05ca495d47476e3ba3104b74ddd061adc8c46a94 Mon Sep 17 00:00:00 2001 From: Rodrigo Tavares Date: Mon, 19 May 2014 19:44:37 -0700 Subject: [PATCH 070/125] Update pt-br strings --- src/nls/pt-br/strings.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/nls/pt-br/strings.js b/src/nls/pt-br/strings.js index f1274b402f2..ddf156f3fbc 100644 --- a/src/nls/pt-br/strings.js +++ b/src/nls/pt-br/strings.js @@ -41,6 +41,11 @@ define({ "FILE_EXISTS_ERR" : "Arquivo ou pasta já existe.", "FILE" : "arquivo", "DIRECTORY" : "diretório", + "DIRECTORY_NAMES_LEDE" : "Nomes de diretórios", + "FILENAMES_LEDE" : "Nomes de arquivos", + "FILENAME" : "Nome de arquivo", + "DIRECTORY_NAME" : "Nome de diretório", + // Project error strings "ERROR_LOADING_PROJECT" : "Erro ao carregar o projeto", @@ -60,9 +65,9 @@ define({ "ERROR_RENAMING_FILE" : "Ocorreu um erro ao tentar renomear o arquivo {0}. {1}", "ERROR_DELETING_FILE_TITLE" : "Erro ao excluir arquivo", "ERROR_DELETING_FILE" : "Ocorreu um erro ao tentar excluir o arquivo {0}. {1}", - "INVALID_FILENAME_TITLE" : "Nome de {0} inválido", - "INVALID_FILENAME_MESSAGE" : "Nomes de arquivos não podem conter os seguintes caracteres: {0} nem usar palavras reservadas do sistema.", - "FILE_ALREADY_EXISTS" : "Já existe um {0} chamado {1}.", + "INVALID_FILENAME_TITLE" : "{0} inválido", + "INVALID_FILENAME_MESSAGE" : "{0} não podem usar palavras reservadas do sistema, terminar com pontos (.) ou conter qualquer um dos seguintes caracteres: {1}.", + "ENTRY_WITH_SAME_NAME_EXISTS" : "Já existe um arquivo ou diretório como o nome {0}.", "ERROR_CREATING_FILE_TITLE" : "Erro ao criar {0}", "ERROR_CREATING_FILE" : "Ocorreu um erro ao tentar criar o {0} {1}. {2}", @@ -362,7 +367,7 @@ define({ "CMD_RELEASE_NOTES" : "Notas da versão", "CMD_GET_INVOLVED" : "Envolva-se", "CMD_SHOW_EXTENSIONS_FOLDER" : "Mostrar pasta de extensões", - "CMD_HOMEPAGE" : "Página do Brackets", + "CMD_HOMEPAGE" : "Página do {APP_TITLE}", "CMD_TWITTER" : "{TWITTER_NAME} no Twitter", "CMD_ABOUT" : "Sobre o {APP_TITLE}", "CMD_OPEN_PREFERENCES" : "Abrir arquivo de configurações", @@ -547,4 +552,4 @@ define({ "DOCS_MORE_LINK" : "Leia mais" }); -/* Last translated for 368a63c4d682185da0a90f9538c1e7fc0612c9c9 */ +/* Last translated for 5af956bd6a7b12345e0f1db2c0459a05067ccc58 */ From b8eaf18d5db670285c8641114f36ac3563a05acf Mon Sep 17 00:00:00 2001 From: wALF Utility Date: Mon, 19 May 2014 21:50:33 -0700 Subject: [PATCH 071/125] Updated by ALF automation. --- src/nls/fr/strings.js | 13 +++++++++---- src/nls/ja/strings.js | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 5ee5760f87e..d120a74eb58 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -41,6 +41,11 @@ define({ "FILE_EXISTS_ERR": "Le fichier ou le répertoire existe déjà.", "FILE": "fichier", "DIRECTORY": "répertoire", + "DIRECTORY_NAMES_LEDE": "[7549928] !é=Directory names=!", + "FILENAMES_LEDE": "Noms de fichiers", + "FILENAME": "[7549930] !é=filename=!", + "DIRECTORY_NAME": "[7549927] !é=directory name=!", + // Project error strings "ERROR_LOADING_PROJECT": "Erreur lors du chargement du projet", @@ -60,9 +65,9 @@ define({ "ERROR_RENAMING_FILE": "Une erreur s’est produite lorsque vous avez tenté de renommer le fichier {0}. {1}", "ERROR_DELETING_FILE_TITLE": "Erreur lors de la suppression du fichier", "ERROR_DELETING_FILE": "Une erreur s’est produite lors de la tentative de suppression du fichier {0}. {1}", - "INVALID_FILENAME_TITLE": "Nom de {0} incorrect", - "INVALID_FILENAME_MESSAGE": "Les noms de fichiers ne peuvent pas contenir les caractères {0} ni utiliser des termes réservés au système.", - "FILE_ALREADY_EXISTS": "Le {0} {1} existe déjà.", + "INVALID_FILENAME_TITLE": "[6307153] !é=Invalid {0}=!", + "INVALID_FILENAME_MESSAGE": "[6307152] !é={0} cannot use any system reserved words, end with dots (.) or use any of the following characters: {1}=!", + "ENTRY_WITH_SAME_NAME_EXISTS": "[7549929] !é=A file or directory with the name {0} already exists.=!", "ERROR_CREATING_FILE_TITLE": "Erreur lors de la création du {0}", "ERROR_CREATING_FILE": "Une erreur s’est produite lors de la tentative de création du {0} {1}. {2}", @@ -362,7 +367,7 @@ define({ "CMD_RELEASE_NOTES": "Notes de mise à jour", "CMD_GET_INVOLVED": "Participer", "CMD_SHOW_EXTENSIONS_FOLDER": "Afficher le dossier d’extensions", - "CMD_HOMEPAGE": "Page d’accueil de Brackets", + "CMD_HOMEPAGE": "[7540036] !é={APP_TITLE} Homepage=!", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", "CMD_ABOUT": "A propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 45face01f5c..f065ff8c6e4 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -41,6 +41,11 @@ define({ "FILE_EXISTS_ERR": "ファイルまたはディレクトリは既に存在しています。", "FILE": "ファイル", "DIRECTORY": "ディレクトリ", + "DIRECTORY_NAMES_LEDE": "!能=[7549928] Directory names_=!", + "FILENAMES_LEDE": "ファイル名", + "FILENAME": "!能=[7549930] filename_=!", + "DIRECTORY_NAME": "!能=[7549927] directory name_=!", + // Project error strings "ERROR_LOADING_PROJECT": "プロジェクトの読み込みに失敗しました。", @@ -60,9 +65,9 @@ define({ "ERROR_RENAMING_FILE": "ファイル {0} の名前を変更する際にエラーが発生しました。{1}", "ERROR_DELETING_FILE_TITLE": "ファイル削除のエラー", "ERROR_DELETING_FILE": "ファイルを削除する際にエラーが発生しました {0}。{1}", - "INVALID_FILENAME_TITLE": "無効な{0}名", - "INVALID_FILENAME_MESSAGE": "ファイル名には、次の文字を含めることはできません : {0} またはシステムの予約語すべて。", - "FILE_ALREADY_EXISTS": "{0} {1} は既に存在しています。", + "INVALID_FILENAME_TITLE": "!能=[6307153] Invalid {0}_=!", + "INVALID_FILENAME_MESSAGE": "!能=[6307152] {0} cannot use any system reserved words, end with dots (.) or use any of the following characters: {1}_=!", + "ENTRY_WITH_SAME_NAME_EXISTS": "!能=[7549929] A file or directory with the name {0} already exists._=!", "ERROR_CREATING_FILE_TITLE": "{0}を作成する際にエラーが発生しました", "ERROR_CREATING_FILE": "{0} {1} を作成する際にエラーが発生しました。{2}", @@ -362,7 +367,7 @@ define({ "CMD_RELEASE_NOTES": "リリースノート", "CMD_GET_INVOLVED": "コミュニティに参加", "CMD_SHOW_EXTENSIONS_FOLDER": "拡張機能のフォルダーを開く", - "CMD_HOMEPAGE": "Brackets のホームページ", + "CMD_HOMEPAGE": "!能=[7540036] {APP_TITLE} Homepage_=!", "CMD_TWITTER": "Twitter で {TWITTER_NAME} をフォロー", "CMD_ABOUT": "{APP_TITLE} について", "CMD_OPEN_PREFERENCES": "環境設定ファイルを開く", From b04029c069d9757db3f74cee6fef7badde7f2e90 Mon Sep 17 00:00:00 2001 From: Lance Campbell Date: Tue, 20 May 2014 07:10:50 -0700 Subject: [PATCH 072/125] Simplify solution to only scroll to primary selection --- src/editor/EditorCommandHandlers.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index e03cf0bf9da..c2e269833c3 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -735,7 +735,6 @@ define(function (require, exports, module) { lineLength = 0, edits = [], newSels = [], - sel = {}, pos = {}; _.each(lineSelections, function (lineSel) { @@ -803,19 +802,17 @@ define(function (require, exports, module) { } }); - // Make sure correct selections are made and scrolled into view + // Make sure selections are correct and primary selection is scrolled into view if (edits.length) { newSels = doc.doMultipleEdits(edits); + pos.ch = 0; + if (direction === DIRECTION_UP) { editor.setSelections(newSels); - sel = _.first(editor.getSelections()); - pos.ch = sel.start.ch; - pos.line = sel.start.line; + pos.line = editor.getSelection().start.line; } else if (direction === DIRECTION_DOWN) { - sel = _.last(editor.getSelections()); - pos.ch = sel.end.ch; - pos.line = sel.end.line; + pos.line = editor.getSelection().end.line; } else { console.error("EditorCommandHandler.moveLine() called with invalid argument 'direction' = %d", direction); pos = null; From 635f2393b730e393f88b7a8b65e950d93a9643b4 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 20 May 2014 08:45:56 -0700 Subject: [PATCH 073/125] Adjust the cursor to the pos after the trailing whitespace when replacing an existing property name. --- src/extensions/default/CSSCodeHints/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js index a883d482bef..d5c7fe0d551 100644 --- a/src/extensions/default/CSSCodeHints/main.js +++ b/src/extensions/default/CSSCodeHints/main.js @@ -382,7 +382,7 @@ define(function (require, exports, module) { // adjust the cursor position and show code hints for property values. end.ch = start.ch + this.info.name.length; ctx = TokenUtils.getInitialContext(this.editor._codeMirror, cursor); - if (ctx.token.string.length > 0 && !ctx.token.string.match(/\S/)) { + if (ctx.token.string.length > 0 && !/\S/.test(ctx.token.string)) { // We're at the very beginning of a property name. So skip it // before we locate the colon following it. TokenUtils.moveNextToken(ctx); @@ -391,6 +391,10 @@ define(function (require, exports, module) { adjustCursor = true; newCursor = { line: cursor.line, ch: cursor.ch + (hint.length - this.info.name.length) }; + // Adjust cursor to the position after the trailing whitespace if there is any. + if (TokenUtils.moveNextToken(ctx) && ctx.token.string.length > 0 && !/\S/.test(ctx.token.string)) { + newCursor.ch += ctx.token.string.length; + } } else { hint += ": "; } From 3472985942d629829b2514b3820c3737c6105813 Mon Sep 17 00:00:00 2001 From: wALF Utility Date: Tue, 20 May 2014 09:47:05 -0700 Subject: [PATCH 074/125] Updated by ALF automation. --- src/nls/fr/strings.js | 16 ++++++++-------- src/nls/ja/strings.js | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index d120a74eb58..0225f5caeaf 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -41,10 +41,10 @@ define({ "FILE_EXISTS_ERR": "Le fichier ou le répertoire existe déjà.", "FILE": "fichier", "DIRECTORY": "répertoire", - "DIRECTORY_NAMES_LEDE": "[7549928] !é=Directory names=!", - "FILENAMES_LEDE": "Noms de fichiers", - "FILENAME": "[7549930] !é=filename=!", - "DIRECTORY_NAME": "[7549927] !é=directory name=!", + "DIRECTORY_NAMES_LEDE": "Noms de répertoire", + "FILENAMES_LEDE": "Noms de fichier", + "FILENAME": "nom de fichier", + "DIRECTORY_NAME": "nom de répertoire", // Project error strings @@ -65,9 +65,9 @@ define({ "ERROR_RENAMING_FILE": "Une erreur s’est produite lorsque vous avez tenté de renommer le fichier {0}. {1}", "ERROR_DELETING_FILE_TITLE": "Erreur lors de la suppression du fichier", "ERROR_DELETING_FILE": "Une erreur s’est produite lors de la tentative de suppression du fichier {0}. {1}", - "INVALID_FILENAME_TITLE": "[6307153] !é=Invalid {0}=!", - "INVALID_FILENAME_MESSAGE": "[6307152] !é={0} cannot use any system reserved words, end with dots (.) or use any of the following characters: {1}=!", - "ENTRY_WITH_SAME_NAME_EXISTS": "[7549929] !é=A file or directory with the name {0} already exists.=!", + "INVALID_FILENAME_TITLE": "{0} non valide", + "INVALID_FILENAME_MESSAGE": "Le {0} ne peut pas utiliser de termes réservés au système, finir par un point (.) ou contenir l’un des caractères suivants : {1}", + "ENTRY_WITH_SAME_NAME_EXISTS": "Il existe déjà un fichier ou un répertoire portant le nom {0}.", "ERROR_CREATING_FILE_TITLE": "Erreur lors de la création du {0}", "ERROR_CREATING_FILE": "Une erreur s’est produite lors de la tentative de création du {0} {1}. {2}", @@ -367,7 +367,7 @@ define({ "CMD_RELEASE_NOTES": "Notes de mise à jour", "CMD_GET_INVOLVED": "Participer", "CMD_SHOW_EXTENSIONS_FOLDER": "Afficher le dossier d’extensions", - "CMD_HOMEPAGE": "[7540036] !é={APP_TITLE} Homepage=!", + "CMD_HOMEPAGE": "Page d’accueil de {APP_TITLE}", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", "CMD_ABOUT": "A propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index f065ff8c6e4..800dfe14814 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -41,10 +41,10 @@ define({ "FILE_EXISTS_ERR": "ファイルまたはディレクトリは既に存在しています。", "FILE": "ファイル", "DIRECTORY": "ディレクトリ", - "DIRECTORY_NAMES_LEDE": "!能=[7549928] Directory names_=!", + "DIRECTORY_NAMES_LEDE": "ディレクトリ名", "FILENAMES_LEDE": "ファイル名", - "FILENAME": "!能=[7549930] filename_=!", - "DIRECTORY_NAME": "!能=[7549927] directory name_=!", + "FILENAME": "ファイル名", + "DIRECTORY_NAME": "ディレクトリ名", // Project error strings @@ -65,9 +65,9 @@ define({ "ERROR_RENAMING_FILE": "ファイル {0} の名前を変更する際にエラーが発生しました。{1}", "ERROR_DELETING_FILE_TITLE": "ファイル削除のエラー", "ERROR_DELETING_FILE": "ファイルを削除する際にエラーが発生しました {0}。{1}", - "INVALID_FILENAME_TITLE": "!能=[6307153] Invalid {0}_=!", - "INVALID_FILENAME_MESSAGE": "!能=[6307152] {0} cannot use any system reserved words, end with dots (.) or use any of the following characters: {1}_=!", - "ENTRY_WITH_SAME_NAME_EXISTS": "!能=[7549929] A file or directory with the name {0} already exists._=!", + "INVALID_FILENAME_TITLE": "無効な{0}", + "INVALID_FILENAME_MESSAGE": "{0}にはシステムのすべての予約語、末尾のピリオド (.)、および次の文字を含めることはできません : {1}", + "ENTRY_WITH_SAME_NAME_EXISTS": "{0} という名前のファイルまたはディレクトリは既に存在します。", "ERROR_CREATING_FILE_TITLE": "{0}を作成する際にエラーが発生しました", "ERROR_CREATING_FILE": "{0} {1} を作成する際にエラーが発生しました。{2}", @@ -367,7 +367,7 @@ define({ "CMD_RELEASE_NOTES": "リリースノート", "CMD_GET_INVOLVED": "コミュニティに参加", "CMD_SHOW_EXTENSIONS_FOLDER": "拡張機能のフォルダーを開く", - "CMD_HOMEPAGE": "!能=[7540036] {APP_TITLE} Homepage_=!", + "CMD_HOMEPAGE": "{APP_TITLE} ホームページ", "CMD_TWITTER": "Twitter で {TWITTER_NAME} をフォロー", "CMD_ABOUT": "{APP_TITLE} について", "CMD_OPEN_PREFERENCES": "環境設定ファイルを開く", From f392ef5744cb0198c29f3e491f0ddb1967388446 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Tue, 20 May 2014 10:38:43 -0700 Subject: [PATCH 075/125] squashed version of randy/cef1750-issue-7689 branch --- src/editor/Editor.js | 2 +- src/editor/EditorStatusBar.js | 2 +- .../DebugCommands/ErrorNotification.js | 2 +- .../TimingFunctionUtils.js | 2 +- src/utils/AnimationUtils.js | 10 ++++++++-- src/utils/Async.js | 19 ++++++++++++------- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 3c037600877..95e3fd3ccc9 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -1689,7 +1689,7 @@ define(function (require, exports, module) { $(self).on("scroll.msgbox", _removeMessagePopover); // Animate closed -- which includes delay to show message - AnimationUtils.animateUsingClass(self._$messagePopover[0], "animateClose") + AnimationUtils.animateUsingClass(self._$messagePopover[0], "animateClose", 600) .done(_removeMessagePopover); } }); diff --git a/src/editor/EditorStatusBar.js b/src/editor/EditorStatusBar.js index b80112df067..a76a3847c7f 100644 --- a/src/editor/EditorStatusBar.js +++ b/src/editor/EditorStatusBar.js @@ -204,7 +204,7 @@ define(function (require, exports, module) { $statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT); if (!doNotAnimate) { - AnimationUtils.animateUsingClass($statusOverwrite[0], "flash"); + AnimationUtils.animateUsingClass($statusOverwrite[0], "flash", 1500); } } diff --git a/src/extensions/default/DebugCommands/ErrorNotification.js b/src/extensions/default/DebugCommands/ErrorNotification.js index b3b241065b5..5af4fafff41 100644 --- a/src/extensions/default/DebugCommands/ErrorNotification.js +++ b/src/extensions/default/DebugCommands/ErrorNotification.js @@ -78,7 +78,7 @@ define(function (require, exports, module) { } var blink = _.debounce(function () { - AnimationUtils.animateUsingClass($span.parent()[0], "flash"); + AnimationUtils.animateUsingClass($span.parent()[0], "flash", 1500); }, 100); function incErrorCount() { diff --git a/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js b/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js index a297ecc7406..687239f8309 100644 --- a/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js +++ b/src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js @@ -266,7 +266,7 @@ define(function (require, exports, module) { hint.elem.css("display", "block"); } else if (hint.shown) { hint.animationInProgress = true; - AnimationUtils.animateUsingClass(hint.elem[0], "fadeout") + AnimationUtils.animateUsingClass(hint.elem[0], "fadeout", 750) .done(function () { if (hint.animationInProgress) { // do this only if the animation was not cancelled hint.elem.hide(); diff --git a/src/utils/AnimationUtils.js b/src/utils/AnimationUtils.js index de507132a44..b6a7add38b2 100644 --- a/src/utils/AnimationUtils.js +++ b/src/utils/AnimationUtils.js @@ -31,6 +31,8 @@ define(function (require, exports, module) { "use strict"; + var Async = require("utils/Async"); + /** * Start an animation by adding the given class to the given target. When the * animation is complete, removes the class, clears the event handler we attach @@ -38,12 +40,15 @@ define(function (require, exports, module) { * * @param {Element} target The DOM node to animate. * @param {string} animClass The class that applies the animation/transition to the target. + * @param {number=} timeoutDuration Time to wait in ms before rejecting promise. Default is 400. * @return {$.Promise} A promise that is resolved when the animation completes. Never rejected. */ - function animateUsingClass(target, animClass) { + function animateUsingClass(target, animClass, timeoutDuration) { var result = new $.Deferred(), $target = $(target); + timeoutDuration = timeoutDuration || 400; + function finish(e) { if (e.target === target) { $target @@ -65,7 +70,8 @@ define(function (require, exports, module) { .on("webkitTransitionEnd", finish); } - return result.promise(); + // Use timeout in case transition end event is not sent + return Async.withTimeout(result.promise(), timeoutDuration, true); } exports.animateUsingClass = animateUsingClass; diff --git a/src/utils/Async.js b/src/utils/Async.js index 20a9fc73a91..da278c1bd8e 100644 --- a/src/utils/Async.js +++ b/src/utils/Async.js @@ -285,23 +285,28 @@ define(function (require, exports, module) { var ERROR_TIMEOUT = {}; /** - * Adds timeout-driven failure to a Promise: returns a new Promise that is resolved/rejected when - * the given original Promise is resolved/rejected, OR is rejected after the given delay - whichever - * happens first. + * Adds timeout-driven termination to a Promise: returns a new Promise that is resolved/rejected when + * the given original Promise is resolved/rejected, OR is resolved/rejected after the given delay - + * whichever happens first. * * If the original Promise is resolved/rejected first, done()/fail() handlers receive arguments - * piped from the original Promise. If the timeout occurs first instead, fail() is called with the - * token Async.ERROR_TIMEOUT. + * piped from the original Promise. If the timeout occurs first instead, then resolve() or + * fail() (with Async.ERROR_TIMEOUT) is called based on value of resolveTimeout. * * @param {$.Promise} promise * @param {number} timeout + * @param {boolean=} resolveTimeout If true, then resolve deferred on timeout, otherwise reject. Default is false. * @return {$.Promise} */ - function withTimeout(promise, timeout) { + function withTimeout(promise, timeout, resolveTimeout) { var wrapper = new $.Deferred(); var timer = window.setTimeout(function () { - wrapper.reject(ERROR_TIMEOUT); + if (resolveTimeout) { + wrapper.resolve(); + } else { + wrapper.reject(ERROR_TIMEOUT); + } }, timeout); promise.always(function () { window.clearTimeout(timer); From 37390a5f1f593fab87c686c98453de5fe63ea7bf Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Tue, 20 May 2014 16:14:31 -0700 Subject: [PATCH 076/125] unit test for Async.withTimeout() --- test/spec/Async-test.js | 101 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 6 deletions(-) diff --git a/test/spec/Async-test.js b/test/spec/Async-test.js index e6cf88d3f53..e2ea40a53e8 100644 --- a/test/spec/Async-test.js +++ b/test/spec/Async-test.js @@ -22,7 +22,7 @@ */ /*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, describe, beforeEach, afterEach, it, runs, waits, waitsFor, waitsForDone, expect, $, jasmine */ +/*global define, describe, beforeEach, afterEach, it, runs, waits, waitsFor, waitsForDone, waitsForFail, expect, $, jasmine */ define(function (require, exports, module) { "use strict"; @@ -35,7 +35,7 @@ define(function (require, exports, module) { describe("Chain", function () { function zeroArgThatSucceeds() { - var d = $.Deferred(); + var d = new $.Deferred(); setTimeout(function () { d.resolve(); }, 1); @@ -43,7 +43,7 @@ define(function (require, exports, module) { } function zeroArgThatFails() { - var d = $.Deferred(); + var d = new $.Deferred(); setTimeout(function () { d.reject(); }, 1); @@ -51,7 +51,7 @@ define(function (require, exports, module) { } function oneArgThatSucceeds(x) { - var d = $.Deferred(); + var d = new $.Deferred(); setTimeout(function () { d.resolveWith(null, [x]); }, 1); @@ -59,7 +59,7 @@ define(function (require, exports, module) { } function twoArgThatSucceeds(x, y) { - var d = $.Deferred(); + var d = new $.Deferred(); setTimeout(function () { d.resolveWith(null, [x, y]); }, 1); @@ -67,7 +67,7 @@ define(function (require, exports, module) { } function twoArgThatFails(x, y) { - var d = $.Deferred(); + var d = new $.Deferred(); setTimeout(function () { d.rejectWith(null, [x, y]); }, 1); @@ -226,6 +226,95 @@ define(function (require, exports, module) { }); + describe("With Timeout", function () { + function promiseThatSucceeds(duration) { + var d = new $.Deferred(); + setTimeout(function () { + d.resolve(); + }, duration); + return d.promise(); + } + + function promiseThatFails(duration) { + var d = new $.Deferred(); + setTimeout(function () { + d.reject(); + }, duration); + return d.promise(); + } + + it("should resolve promise before rejected with timeout", function () { + var promiseBase, promiseWrapper; + + runs(function () { + promiseBase = promiseThatSucceeds(5); + promiseWrapper = Async.withTimeout(promiseBase, 10); + waitsForDone(promiseWrapper, "promise resolves before timeout"); + }); + + runs(function () { + // base promise resolves wrapper promise + expect(promiseBase.state()).toBe("resolved"); + expect(promiseWrapper.state()).toBe("resolved"); + }); + }); + + it("should reject promise before resolved with timeout", function () { + var promiseBase, promiseWrapper; + + runs(function () { + promiseBase = promiseThatFails(5); + promiseWrapper = Async.withTimeout(promiseBase, 10, true); + waitsForFail(promiseWrapper, "promise rejected before timeout"); + }); + + runs(function () { + // base promise rejects wrapper promise + expect(promiseBase.state()).toBe("rejected"); + expect(promiseWrapper.state()).toBe("rejected"); + }); + }); + + it("should timeout with reject before promise resolves", function () { + var promiseBase, promiseWrapper; + + runs(function () { + promiseBase = promiseThatSucceeds(10); + promiseWrapper = Async.withTimeout(promiseBase, 5); + waitsForFail(promiseWrapper, "times out before promise resolves"); + }); + + runs(function () { + expect(promiseWrapper.state()).toBe("rejected"); + waitsForDone(promiseBase, "promise resolves after timeout"); + }); + + runs(function () { + expect(promiseBase.state()).toBe("resolved"); + }); + }); + + it("should timeout with resolve before promise rejected", function () { + var promiseBase, promiseWrapper; + + runs(function () { + promiseBase = promiseThatFails(10); + promiseWrapper = Async.withTimeout(promiseBase, 5, true); + waitsForDone(promiseWrapper, "times out before promise is rejected"); + }); + + runs(function () { + expect(promiseWrapper.state()).toBe("resolved"); + waitsForFail(promiseBase, "promise is rejected after timeout"); + }); + + runs(function () { + expect(promiseBase.state()).toBe("rejected"); + }); + }); + }); + + describe("Async/sync mix", function () { it("[async/sync] succeed with sync command at beginning", function () { expectChainHelper( From 99aa587cae9c40d90c88038286f926464a690c73 Mon Sep 17 00:00:00 2001 From: Narciso Jaramillo Date: Tue, 20 May 2014 16:50:46 -0700 Subject: [PATCH 077/125] Disable code hints when multiple selections are active --- src/editor/CodeHintManager.js | 23 ++++++++++++ test/spec/CodeHint-test-files/test1.html | 1 + test/spec/CodeHint-test.js | 45 ++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index 04909486c49..bfdd46195ed 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -453,6 +453,12 @@ define(function (require, exports, module) { * @param {Editor} editor */ _beginSession = function (editor) { + // Don't start a session if we have a multiple selection. + var selection = editor.getSelections(); + if (selection.length > 1) { + return; + } + // Find a suitable provider, if any var language = editor.getLanguageForSelection(), enabledProviders = _getProvidersForLanguageId(language.getId()); @@ -560,6 +566,21 @@ define(function (require, exports, module) { } } } + + /** + * Handle a selection change event in the editor. If the selection becomes a + * multiple selection, end our current session. + * @param {Event} jqEvent + * @param {Editor} editor + */ + function _handleCursorActivity(jqEvent, editor) { + if (_inSession(editor)) { + var selection = editor.getSelections(); + if (selection.length > 1) { + _endSession(); + } + } + } /** * Start a new implicit hinting session, or update the existing hint list. @@ -640,6 +661,7 @@ define(function (require, exports, module) { $(current).on("keydown", _handleKeydownEvent); $(current).on("keypress", _handleKeypressEvent); $(current).on("keyup", _handleKeyupEvent); + $(current).on("cursorActivity", _handleCursorActivity); } if (previous) { @@ -648,6 +670,7 @@ define(function (require, exports, module) { $(previous).off("keydown", _handleKeydownEvent); $(previous).off("keypress", _handleKeypressEvent); $(previous).off("keyup", _handleKeyupEvent); + $(previous).off("cursorActivity", _handleCursorActivity); } } diff --git a/test/spec/CodeHint-test-files/test1.html b/test/spec/CodeHint-test-files/test1.html index 8ca86a43ad9..e959a4a768e 100644 --- a/test/spec/CodeHint-test-files/test1.html +++ b/test/spec/CodeHint-test-files/test1.html @@ -2,5 +2,6 @@ < +< \ No newline at end of file diff --git a/test/spec/CodeHint-test.js b/test/spec/CodeHint-test.js index 8e79371987c..4769a032988 100644 --- a/test/spec/CodeHint-test.js +++ b/test/spec/CodeHint-test.js @@ -48,7 +48,8 @@ define(function (require, exports, module) { * Performs setup for a code hint test. Opens a file and set pos. * * @param {!string} openFile Project relative file path to open in a main editor. - * @param {!number} openPos The pos within openFile to place the IP. + * @param {!number|Array} openPos The pos within openFile to place the IP, or an array + * representing a multiple selection to set. */ function initCodeHintTest(openFile, openPos) { SpecRunnerUtils.loadProjectInTestWindow(testPath); @@ -60,7 +61,11 @@ define(function (require, exports, module) { runs(function () { var editor = EditorManager.getCurrentFullEditor(); - editor.setCursorPos(openPos.line, openPos.ch); + if (Array.isArray(openPos)) { + editor.setSelections(openPos); + } else { + editor.setCursorPos(openPos.line, openPos.ch); + } }); } @@ -232,6 +237,42 @@ define(function (require, exports, module) { editor = null; }); }); + + it("should not show code hints if there is a multiple selection", function () { + // minimal markup with an open '<' before IP + // Note: line for pos is 0-based and editor lines numbers are 1-based + initCodeHintTest("test1.html", [ + {start: {line: 3, ch: 1}, end: {line: 3, ch: 1}, primary: true}, + {start: {line: 4, ch: 1}, end: {line: 4, ch: 1}} + ]); + + runs(function () { + invokeCodeHints(); + expectNoHints(); + }); + }); + + it("should dismiss existing code hints if selection changes to a multiple selection", function () { + var editor; + + initCodeHintTest("test1.html", {line: 3, ch: 1}); + + runs(function () { + editor = EditorManager.getCurrentFullEditor(); + expect(editor).toBeTruthy(); + + invokeCodeHints(); + expectSomeHints(); + }); + + runs(function () { + editor.setSelections([ + {start: {line: 3, ch: 1}, end: {line: 3, ch: 1}, primary: true}, + {start: {line: 4, ch: 1}, end: {line: 4, ch: 1}} + ]); + expectNoHints(); + }); + }); it("should dismiss code hints menu with Esc key", function () { var pos = {line: 3, ch: 1}; From 3b59951411247ae2b157f92c11b9db27b8387daf Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 20 May 2014 18:51:48 -0700 Subject: [PATCH 078/125] Update comment. --- src/extensions/default/CSSCodeHints/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js index d5c7fe0d551..932f6c067c8 100644 --- a/src/extensions/default/CSSCodeHints/main.js +++ b/src/extensions/default/CSSCodeHints/main.js @@ -391,7 +391,7 @@ define(function (require, exports, module) { adjustCursor = true; newCursor = { line: cursor.line, ch: cursor.ch + (hint.length - this.info.name.length) }; - // Adjust cursor to the position after the trailing whitespace if there is any. + // Adjust cursor to the position after any whitespace that follows the colon, if there is any. if (TokenUtils.moveNextToken(ctx) && ctx.token.string.length > 0 && !/\S/.test(ctx.token.string)) { newCursor.ch += ctx.token.string.length; } From 98951a2e18270108c42f2d46c9087243b868bf98 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 08:13:48 -0700 Subject: [PATCH 079/125] handle timeout case --- src/utils/AnimationUtils.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/AnimationUtils.js b/src/utils/AnimationUtils.js index b6a7add38b2..3b489f0427b 100644 --- a/src/utils/AnimationUtils.js +++ b/src/utils/AnimationUtils.js @@ -49,11 +49,14 @@ define(function (require, exports, module) { timeoutDuration = timeoutDuration || 400; + function cleanup() { + $target + .removeClass(animClass) + .off(".asyncWithTimeout"); + } + function finish(e) { if (e.target === target) { - $target - .removeClass(animClass) - .off("webkitTransitionEnd", finish); result.resolve(); } } @@ -67,11 +70,12 @@ define(function (require, exports, module) { // a child). $target .addClass(animClass) - .on("webkitTransitionEnd", finish); + .on("webkitTransitionEnd.asyncWithTimeout", finish); } // Use timeout in case transition end event is not sent - return Async.withTimeout(result.promise(), timeoutDuration, true); + return Async.withTimeout(result.promise(), timeoutDuration, true) + .done(cleanup); } exports.animateUsingClass = animateUsingClass; From 3c36810749ed30b847661db9c82b7437bd5c3f1c Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 09:10:54 -0700 Subject: [PATCH 080/125] add mroe details --- src/nls/README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/nls/README.md b/src/nls/README.md index 642c3367077..11d83fcbb57 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -89,30 +89,44 @@ point the process will switch to the one above. But until then, please _do not use_ http://translate.adobe.com for these languages. -# Contributing Translations directly from github.com +## Contributing Translations directly from github.com You must be logged in to your github.com id (e.g. `user1`). ### Adding a New Translation +To add a new translation, you need to start with a copy of the +root `strings.js` file which is located at +[https://github.com/adobe/brackets/blob/master/src/nls/root/strings.js](https://github.com/adobe/brackets/blob/master/src/nls/root/strings.js). New translations can be added by navigating to the [nls folder on github](https://github.com/adobe/brackets/tree/master/src/nls) and then clicking on the [+] button to add a new file. -Subfolders can be added in the path field. +You will be taken to a New File page where you: +1. Specify the file name as *language-id*/strings.js +2. Paste in the contents of root/strings.js and edit strings for new language +3. Add short and (optional) long description of new file +4. CLick "Propose New File" button ### Editing an Existing Translation Existing files can be edited directly in [brackets repo on github](https://github.com/adobe/brackets). +###Branch and Pull Request Either case will create and submit a pull request with a branch named something like `patch-1` on your github fork of brackets of the brackets repository (`https://github.com/user1/brackets`). If you have not yet forked brackets "repo", it's done automatically. +###Code Review Someone on the Brackets team will review the pull request. If it's ok, it will be merged. If changes need to be made, the reviewer will post comments in the pull request which will send you an e-mail notification. -You can make updates in the `patch-1` branch in your github fork of brackets. +You should make updates in the `patch-1` branch in your github fork of brackets +so all of your changes for this update are in a single branch. +Creating a new branch for every update makes it difficult for core team +to see all changes at once, and can even create conflicts that are +very difficult to resolve. + Follow the link in the notification e-mail to the pull request if you need to determine which branch to edit. Saved edits show up as a new commit, so they automatically show up in the original From df099c9c1be61a2a7b8e906597edd15b558ac452 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 09:40:00 -0700 Subject: [PATCH 081/125] add even more details --- src/nls/README.md | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/nls/README.md b/src/nls/README.md index 11d83fcbb57..cb81f7e1a2e 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -104,19 +104,32 @@ You will be taken to a New File page where you: 1. Specify the file name as *language-id*/strings.js 2. Paste in the contents of root/strings.js and edit strings for new language 3. Add short and (optional) long description of new file -4. CLick "Propose New File" button +4. Click "Propose New File" button ### Editing an Existing Translation Existing files can be edited directly in [brackets repo on github](https://github.com/adobe/brackets). -###Branch and Pull Request -Either case will create and submit a pull request with a branch named something like -`patch-1` on your github fork of brackets of the brackets repository -(`https://github.com/user1/brackets`). -If you have not yet forked brackets "repo", it's done automatically. - -###Code Review +Navigate to the file to edit and click "Edit" button above file. +You will be taken to an Edit File page where you: +1. Make desired edits to file +2. Add short and (optional) long description of Commit changes +3. Click "Commit changes" button + +### Branch and Pull Request +If you have not yet forked the brackets repository in your github account +(`https://github.com/user1/brackets`), it's done automatically. +A new branch will be created in your brackets fork with a unique name +which is something like `patch-1` that contains your changes. + +You are then taken to the New Pull Request dialog which is filled in +with all of the information from previous dialog. +It also shows contents of new file or a "diff" of changes to existing file. +You can make any changes if desired, then click "Send Pull Request" when done +(or close page to Cancel). +A pull request for your branch is created and submitted to the brackets "repo". + +### Code Review Someone on the Brackets team will review the pull request. If it's ok, it will be merged. If changes need to be made, the reviewer will post comments in the pull request which will send you an e-mail notification. @@ -128,7 +141,10 @@ to see all changes at once, and can even create conflicts that are very difficult to resolve. Follow the link in the notification e-mail to the pull request if you need -to determine which branch to edit. +to determine which branch to edit. Once in the branch, navigate to the file +to edit (same as you would in main repo) and click "Edit" button. +Make any changes following directions for Editing an Existing Translation. + Saved edits show up as a new commit, so they automatically show up in the original pull request. After making an update, add a comment to the pull request such as "Changes made -- ready for another review" to notify reviewer From 0938ae8100d9c1dd41f59c36cf8c5c7a82e7d524 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 09:41:29 -0700 Subject: [PATCH 082/125] fix lists --- src/nls/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nls/README.md b/src/nls/README.md index cb81f7e1a2e..76142e20b30 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -101,6 +101,7 @@ New translations can be added by navigating to the [nls folder on github](https://github.com/adobe/brackets/tree/master/src/nls) and then clicking on the [+] button to add a new file. You will be taken to a New File page where you: + 1. Specify the file name as *language-id*/strings.js 2. Paste in the contents of root/strings.js and edit strings for new language 3. Add short and (optional) long description of new file @@ -112,6 +113,7 @@ Existing files can be edited directly in Navigate to the file to edit and click "Edit" button above file. You will be taken to an Edit File page where you: + 1. Make desired edits to file 2. Add short and (optional) long description of Commit changes 3. Click "Commit changes" button From 88033ed6562bd036a520b87b56fdaf0b7a218a5b Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 09:45:12 -0700 Subject: [PATCH 083/125] wording change --- src/nls/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nls/README.md b/src/nls/README.md index 76142e20b30..65e29e832ea 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -119,8 +119,8 @@ You will be taken to an Edit File page where you: 3. Click "Commit changes" button ### Branch and Pull Request -If you have not yet forked the brackets repository in your github account -(`https://github.com/user1/brackets`), it's done automatically. +For either case, if you have not yet forked the brackets repository in your +github account (`https://github.com/user1/brackets`), it's done automatically. A new branch will be created in your brackets fork with a unique name which is something like `patch-1` that contains your changes. From 42ec2bbe9d936c76ac312d71872b0717882b37e4 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 13:25:42 -0700 Subject: [PATCH 084/125] remove event namespacing --- src/utils/AnimationUtils.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/AnimationUtils.js b/src/utils/AnimationUtils.js index 3b489f0427b..5d9973aa2b1 100644 --- a/src/utils/AnimationUtils.js +++ b/src/utils/AnimationUtils.js @@ -49,18 +49,18 @@ define(function (require, exports, module) { timeoutDuration = timeoutDuration || 400; - function cleanup() { - $target - .removeClass(animClass) - .off(".asyncWithTimeout"); - } - function finish(e) { if (e.target === target) { result.resolve(); } } + function cleanup() { + $target + .removeClass(animClass) + .off("webkitTransitionEnd", finish); + } + if ($target.is(":hidden")) { // Don't do anything if the element is hidden because webkitTransitionEnd wouldn't fire result.resolve(); @@ -70,7 +70,7 @@ define(function (require, exports, module) { // a child). $target .addClass(animClass) - .on("webkitTransitionEnd.asyncWithTimeout", finish); + .on("webkitTransitionEnd", finish); } // Use timeout in case transition end event is not sent From 789c49ec9e158abdbbce93fe4a656ea1315cf7db Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Wed, 21 May 2014 13:35:31 -0700 Subject: [PATCH 085/125] add steps for updating SHA in strings.js --- src/nls/README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/nls/README.md b/src/nls/README.md index 65e29e832ea..15e82cf721f 100644 --- a/src/nls/README.md +++ b/src/nls/README.md @@ -104,8 +104,13 @@ You will be taken to a New File page where you: 1. Specify the file name as *language-id*/strings.js 2. Paste in the contents of root/strings.js and edit strings for new language -3. Add short and (optional) long description of new file -4. Click "Propose New File" button +3. Add this comment `/* Last translated for SHA_of_root_strings.js */` +at the end of your strings.js and replace `SHA_of_root_strings.js` with the actual SHA. +You can copy the actual SHA in this +[history page](https://github.com/adobe/brackets/commits/master/src/nls/root/strings.js) +by hovering on the one you used for this translation and click on Copy SHA button. +4. Add short and (optional) long description of new file +5. Click "Propose New File" button ### Editing an Existing Translation Existing files can be edited directly in @@ -115,8 +120,12 @@ Navigate to the file to edit and click "Edit" button above file. You will be taken to an Edit File page where you: 1. Make desired edits to file -2. Add short and (optional) long description of Commit changes -3. Click "Commit changes" button +2. Make sure that you also update the comment on the last line with the correct SHA of +strings.js from root directory, which you used for your translation. If the SHA comment +is missing, then add one with the correct SHA. See step 6 in How to add translations +for a new locale section for adding a new one. +3. Add short and (optional) long description of Commit changes +4. Click "Commit changes" button ### Branch and Pull Request For either case, if you have not yet forked the brackets repository in your From 65556c710eccb1db502e1ac052e9cb9f6f3d9ded Mon Sep 17 00:00:00 2001 From: Narciso Jaramillo Date: Wed, 21 May 2014 16:43:14 -0700 Subject: [PATCH 086/125] Clean up unnecessary variables --- src/editor/CodeHintManager.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index bfdd46195ed..0cfab231215 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -454,8 +454,7 @@ define(function (require, exports, module) { */ _beginSession = function (editor) { // Don't start a session if we have a multiple selection. - var selection = editor.getSelections(); - if (selection.length > 1) { + if (editor.getSelections().length > 1) { return; } @@ -575,8 +574,7 @@ define(function (require, exports, module) { */ function _handleCursorActivity(jqEvent, editor) { if (_inSession(editor)) { - var selection = editor.getSelections(); - if (selection.length > 1) { + if (editor.getSelections().length > 1) { _endSession(); } } From 4e80bd33f309280daa56530e8afb6ab188c0a235 Mon Sep 17 00:00:00 2001 From: Larz Date: Wed, 21 May 2014 21:59:07 -0700 Subject: [PATCH 087/125] Removed animation for HTML Menu. --- src/styles/brackets_patterns_override.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 2be5c0d1b22..35f580f56ab 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -122,6 +122,7 @@ a:focus { //max-height: calc(~"100vh - 34px"); doesn't seem to work... max-height: 90vh; overflow-y: auto; + -webkit-animation: none; } } .title { From 218fa7989688d3dee4c4950ababa215a9fe040ce Mon Sep 17 00:00:00 2001 From: Stein Morten Hugubakken Date: Thu, 22 May 2014 13:40:12 +0200 Subject: [PATCH 088/125] Norwegian menutranslations update --- src/nls/nb/strings.js | 191 +++++++++++++++++++++++++++++------------- 1 file changed, 131 insertions(+), 60 deletions(-) diff --git a/src/nls/nb/strings.js b/src/nls/nb/strings.js index 0df1165455d..9bcd0c738a3 100644 --- a/src/nls/nb/strings.js +++ b/src/nls/nb/strings.js @@ -132,62 +132,123 @@ define({ */ // File menu commands - "FILE_MENU" : "Fil", - "CMD_FILE_NEW" : "Ny", - "CMD_FILE_OPEN" : "Åpne\u2026", - "CMD_ADD_TO_WORKING_SET" : "Add To Working Set", - "CMD_OPEN_FOLDER" : "Åpne mappe\u2026", - "CMD_FILE_CLOSE" : "Lukk", - "CMD_FILE_CLOSE_ALL" : "Lukk alle", - "CMD_FILE_SAVE" : "Lagre", - "CMD_FILE_SAVE_ALL" : "Lagre alle", - "CMD_LIVE_FILE_PREVIEW" : "Live Preview", - "CMD_QUIT" : "Avslutt", + "FILE_MENU" : "Fil", + "CMD_FILE_NEW_UNTITLED" : "Ny", + "CMD_FILE_NEW" : "Ny", + "CMD_FILE_NEW_FOLDER" : "Ny mappe", + "CMD_FILE_OPEN" : "Åpne\u2026", + "CMD_ADD_TO_WORKING_SET" : "Tilføye til arbeidsset", + "CMD_OPEN_DROPPED_FILES" : "Åpne droppete filer", + "CMD_OPEN_FOLDER" : "Åpne mappe\u2026", + "CMD_FILE_CLOSE" : "Lukk", + "CMD_FILE_CLOSE_ALL" : "Lukk alle", + "CMD_FILE_CLOSE_LIST" : "Lukk liste", + "CMD_FILE_CLOSE_OTHERS" : "Lukk andre", + "CMD_FILE_CLOSE_ABOVE" : "Lukke andre over", + "CMD_FILE_CLOSE_BELOW" : "Lukk andre under", + "CMD_FILE_SAVE" : "Lagre", + "CMD_FILE_SAVE_ALL" : "Lagre alle", + "CMD_FILE_SAVE_AS" : "Lagre som\u2026", + "CMD_LIVE_FILE_PREVIEW" : "Live Preview", + "CMD_PROJECT_SETTINGS" : "Prosjektinstillinger\u2026", + "CMD_FILE_RENAME" : "Gi nytt navn", + "CMD_FILE_DELETE" : "Slett", + "CMD_INSTALL_EXTENSION" : "Installer utvidelser\u2026", + "CMD_EXTENSION_MANAGER" : "Utvidelsebehandleren\u2026", + "CMD_FILE_REFRESH" : "Oppdater filtre", + "CMD_QUIT" : "Avslutt", + // Used in native File menu on Windows + "CMD_EXIT" : "Avslutt", // Edit menu commands - "EDIT_MENU" : "Rediger", - "CMD_SELECT_ALL" : "Velg alt", - "CMD_FIND" : "Finn", - "CMD_FIND_IN_FILES" : "Finn i filer", - "CMD_FIND_NEXT" : "Finn neste", - "CMD_FIND_PREVIOUS" : "Finn forrige", - "CMD_REPLACE" : "Erstatt", - "CMD_INDENT" : "Øk innrykk", - "CMD_UNINDENT" : "Reduser innrykk", - "CMD_DUPLICATE" : "Dupliker", - "CMD_COMMENT" : "Kommenter/utkommenter linjer", - "CMD_LINE_UP" : "Flytt linje(r) opp", - "CMD_LINE_DOWN" : "Flytt linje(r) ned", + "EDIT_MENU" : "Rediger", + "CMD_UNDO" : "Angre", + "CMD_REDO" : "Gjenta", + "CMD_CUT" : "Klipp", + "CMD_COPY" : "Kopier", + "CMD_PASTE" : "Lim inn", + "CMD_SELECT_ALL" : "Velg alt", + "CMD_SELECT_LINE" : "Velg linje", + "CMD_SPLIT_SEL_INTO_LINES" : "Splitt utvalg til linjer", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Legg til markør på neste linje", + "CMD_ADD_CUR_TO_PREV_LINE" : "Legg til markør på forrige linje", + "CMD_INDENT" : "Øk innrykk", + "CMD_UNINDENT" : "Reduser innrykk", + "CMD_DUPLICATE" : "Dupliser", + "CMD_DELETE_LINES" : "Slett linje", + "CMD_COMMENT" : "Kommenter/utkommenter linjer", + "CMD_BLOCK_COMMENT" : "Veksle blokkommentar", + "CMD_LINE_UP" : "Flytt linje(r) opp", + "CMD_LINE_DOWN" : "Flytt linje(r) ned", + "CMD_OPEN_LINE_ABOVE" : "Åpne linje over", + "CMD_OPEN_LINE_BELOW" : "Åpne linje under", + "CMD_TOGGLE_CLOSE_BRACKETS" : "Automatisk avslutt krøllparenteser", + "CMD_SHOW_CODE_HINTS" : "Vis kodehint", + + // Search menu commands + "FIND_MENU" : "Finn", + "CMD_FIND" : "Finn", + "CMD_FIND_FIELD_PLACEHOLDER" : "Finn\u2026", + "CMD_FIND_NEXT" : "Finn neste", + "CMD_FIND_PREVIOUS" : "Finn forrige", + "CMD_FIND_ALL_AND_SELECT" : "Finn alle og velg", + "CMD_ADD_NEXT_MATCH" : "Legg til neste treff til utvalg", + "CMD_SKIP_CURRENT_MATCH" : "Hopp over og legg til neste treff", + "CMD_FIND_IN_FILES" : "Finn i filer", + "CMD_FIND_IN_SELECTED" : "Finn i valgt fil/mappe", + "CMD_FIND_IN_SUBTREE" : "Finn i\u2026", + "CMD_REPLACE" : "Erstatt", // View menu commands - "VIEW_MENU" : "Vis", - "CMD_HIDE_SIDEBAR" : "Gjem sidestolpe", - "CMD_SHOW_SIDEBAR" : "Vis sidestolpe", - "CMD_INCREASE_FONT_SIZE" : "Større skrift", - "CMD_DECREASE_FONT_SIZE" : "Mindre skrift", - "CMD_RESTORE_FONT_SIZE" : "Tilbakestill skriftstørrelse", + "VIEW_MENU" : "Vis", + "CMD_HIDE_SIDEBAR" : "Gjem sidestolpe", + "CMD_SHOW_SIDEBAR" : "Vis sidestolpe", + "CMD_INCREASE_FONT_SIZE" : "Større skrift", + "CMD_DECREASE_FONT_SIZE" : "Mindre skrift", + "CMD_RESTORE_FONT_SIZE" : "Tilbakestill skriftstørrelse", + "CMD_SCROLL_LINE_UP" : "Rull linje opp", + "CMD_SCROLL_LINE_DOWN" : "Rull linje ned", + "CMD_TOGGLE_LINE_NUMBERS" : "Linjenummer", + "CMD_TOGGLE_ACTIVE_LINE" : "Uthev aktiv linje", + "CMD_TOGGLE_WORD_WRAP" : "Tekstbryting", + "CMD_LIVE_HIGHLIGHT" : "Live Preview Highlight", + "CMD_VIEW_TOGGLE_INSPECTION" : "Lint filer ved lagring", + "CMD_SORT_WORKINGSET_BY_ADDED" : "Sorter på tilføyd", + "CMD_SORT_WORKINGSET_BY_NAME" : "Sorter på navn", + "CMD_SORT_WORKINGSET_BY_TYPE" : "Sorter på type", + "CMD_SORT_WORKINGSET_AUTO" : "Automatisk sortering", // Navigate menu Commands - "NAVIGATE_MENU" : "Naviger", - "CMD_QUICK_OPEN" : "Hurtigåpne", - "CMD_GOTO_LINE" : "Gå til linje", - "CMD_GOTO_DEFINITION" : "Gå til definisjon", - "CMD_TOGGLE_QUICK_EDIT" : "Hurtigrediger", - "CMD_QUICK_EDIT_PREV_MATCH" : "Forrige match", - "CMD_QUICK_EDIT_NEXT_MATCH" : "Neste match", - "CMD_NEXT_DOC" : "Neste dokument", - "CMD_PREV_DOC" : "Forrige dokument", + "NAVIGATE_MENU" : "Naviger", + "CMD_QUICK_OPEN" : "Hurtigåpne", + "CMD_GOTO_LINE" : "Gå til linje", + "CMD_GOTO_DEFINITION" : "Gå til definisjon", + "CMD_GOTO_FIRST_PROBLEM" : "Gå til første feil/advarsel", + "CMD_TOGGLE_QUICK_EDIT" : "Hurtigrediger", + "CMD_TOGGLE_QUICK_DOCS" : "Quick Docs", + "CMD_QUICK_EDIT_PREV_MATCH" : "Forrige treff", + "CMD_QUICK_EDIT_NEXT_MATCH" : "Neste treff", + "CMD_CSS_QUICK_EDIT_NEW_RULE" : "Ny regel", + "CMD_NEXT_DOC" : "Neste dokument", + "CMD_PREV_DOC" : "Forrige dokument", + "CMD_SHOW_IN_TREE" : "Vis i filtre", + "CMD_SHOW_IN_EXPLORER" : "Vis i utforsker", + "CMD_SHOW_IN_FINDER" : "Show in Finder", + "CMD_SHOW_IN_OS" : "Vis i OS", // Help menu commands - "HELP_MENU" : "Hjelp", - "CMD_CHECK_FOR_UPDATE" : "Se etter oppdateringer", - "CMD_SHOW_EXTENSIONS_FOLDER" : "Vis ekstensjoner", - "CMD_FORUM" : "{APP_NAME} forum", - "CMD_ABOUT" : "Om {APP_TITLE}", - - // Special commands invoked by the native shell - "CMD_CLOSE_WINDOW" : "Lukk vindu", - "CMD_ABORT_QUIT" : "Abort lukk", + "HELP_MENU" : "Hjelp", + "CMD_CHECK_FOR_UPDATE" : "Se etter oppdateringer", + "CMD_HOW_TO_USE_BRACKETS" : "Hvordan bruke {APP_NAME}", + "CMD_SUPPORT" : "{APP_NAME} support", + "CMD_SUGGEST" : "Foreslå en funksjonalitet", + "CMD_RELEASE_NOTES" : "Utgivelsesnotat", + "CMD_GET_INVOLVED" : "Bli involvert", + "CMD_SHOW_EXTENSIONS_FOLDER" : "Vis utvidelser", + "CMD_HOMEPAGE" : "{APP_TITLE} hjemmeside", + "CMD_TWITTER" : "{TWITTER_NAME} på Twitter", + "CMD_ABOUT" : "Om {APP_TITLE}", + "CMD_OPEN_PREFERENCES" : "Åpne preferansefilen", // Strings for main-view.html "EXPERIMENTAL_BUILD" : "Experimental build", @@ -212,20 +273,30 @@ define({ // extensions/default/DebugCommands - "DEBUG_MENU" : "Debug", - "CMD_SHOW_DEV_TOOLS" : "Vis utviklerverktøy", - "CMD_REFRESH_WINDOW" : "Oppdater {APP_NAME}", - "CMD_NEW_BRACKETS_WINDOW" : "Nytt {APP_NAME} vindu", - "CMD_SWITCH_LANGUAGE" : "Bytt språk", - "CMD_RUN_UNIT_TESTS" : "Kjør tester", - "CMD_SHOW_PERF_DATA" : "Vis ytelsesdata", - - "LANGUAGE_TITLE" : "Bytt språk", - "LANGUAGE_MESSAGE" : "Velg ønsket språk fra listen under:", - "LANGUAGE_SUBMIT" : "Gjenåpne {APP_NAME}", - "LANGUAGE_CANCEL" : "Avbryt", + // extensions/default/DebugCommands + "DEBUG_MENU" : "Debug", + "ERRORS" : "Errors", + "CMD_SHOW_DEV_TOOLS" : "Vis utviklerverktøy", + "CMD_REFRESH_WINDOW" : "Gjenåpne med utvidelser", + "CMD_RELOAD_WITHOUT_USER_EXTS" : "Gjenåpne uten utvidelser", + "CMD_NEW_BRACKETS_WINDOW" : "Nytt {APP_NAME} vindu", + "CMD_SWITCH_LANGUAGE" : "Bytt språk", + "CMD_RUN_UNIT_TESTS" : "Kjør tester", + "CMD_SHOW_PERF_DATA" : "Vis ytelsesdata", + "CMD_ENABLE_NODE_DEBUGGER" : "Aktiver Node Debugger", + "CMD_LOG_NODE_STATE" : "Logg Nodestatus til konsoll", + "CMD_RESTART_NODE" : "Omstart Node", + "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "Vis feil i statuslinjen", + "LANGUAGE_TITLE" : "Bytt språk", + "LANGUAGE_MESSAGE" : "Velg ønsket språk fra listen under:", + "LANGUAGE_SUBMIT" : "Gjenåpne {APP_NAME}", + "LANGUAGE_CANCEL" : "Avbryt", + "LANGUAGE_SYSTEM_DEFAULT" : "Sett systemforvalg", + // extensions/default/JSLint "CMD_JSLINT" : "Aktiver JSLint", "JSLINT_ERRORS" : "JSLint feil" }); + +/* Last translated for 36fd23e311b2bb7f64c37e56c00006d8795050da */ \ No newline at end of file From aedbcba7146f219c12482cd5653e8a55c207335f Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Thu, 22 May 2014 12:45:06 -0700 Subject: [PATCH 089/125] Address lots of code review feedback and implement the check mark for selected item. --- src/htmlContent/edit-filter-dialog.html | 17 ++ src/nls/root/strings.js | 1 + src/search/FileFilters.js | 199 ++++++++++----------- src/search/FindInFiles.js | 6 +- src/styles/brackets.less | 2 +- src/styles/brackets_patterns_override.less | 23 ++- src/utils/DropdownEventHandler.js | 2 +- src/widgets/DropdownButton.js | 50 +++++- 8 files changed, 190 insertions(+), 110 deletions(-) create mode 100644 src/htmlContent/edit-filter-dialog.html diff --git a/src/htmlContent/edit-filter-dialog.html b/src/htmlContent/edit-filter-dialog.html new file mode 100644 index 00000000000..f96c3a6fa2c --- /dev/null +++ b/src/htmlContent/edit-filter-dialog.html @@ -0,0 +1,17 @@ + diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index cb11e449d21..5fbe8322a7d 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -181,6 +181,7 @@ define({ "EDIT_FILE_FILTER" : "Edit\u2026", "FILE_FILTER_DIALOG" : "Edit Exclusion Set", "FILE_FILTER_INSTRUCTIONS" : "Exclude files and folders matching any of the following strings / substrings or wildcards. Enter each string on a new line.", + "FILTER_NAME_PLACEHOLDER" : "Name this exclusion set (optional)", "FILE_FILTER_CLIPPED_SUFFIX" : "and {0} more", "FILTER_COUNTING_FILES" : "Counting files\u2026", "FILTER_FILE_COUNT" : "Allows {0} of {1} files {2}", diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index f64302489f6..81f31f891d0 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -38,7 +38,9 @@ define(function (require, exports, module) { DropdownButton = require("widgets/DropdownButton").DropdownButton, StringUtils = require("utils/StringUtils"), Strings = require("strings"), - PreferencesManager = require("preferences/PreferencesManager"); + ViewUtils = require("utils/ViewUtils"), + PreferencesManager = require("preferences/PreferencesManager"), + EditFilterTemplate = require("text!htmlContent/edit-filter-dialog.html"); /** @type {number} Constant: first filter index in the filter dropdown list */ var FIRST_FILTER_INDEX = 3; @@ -62,6 +64,8 @@ define(function (require, exports, module) { if (filterSets.length) { dropdownItems.push("---"); + // FIRST_FILTER_INDEX needs to stay in sync with the number of static items (plus separator) + // ie. the number of items populated so far before we concatenate with the actual filter sets. dropdownItems = dropdownItems.concat(filterSets); } _picker.items = dropdownItems; @@ -80,14 +84,7 @@ define(function (require, exports, module) { return index; } - filterSets.forEach(function (curFilter, curIndex) { - if (!found && _.isEqual(curFilter, filter)) { - index = curIndex; - found = true; - } - }); - - return index; + return _.findIndex(filterSets, _.partial(_.isEqual, filter)); } /** @@ -95,7 +92,7 @@ define(function (require, exports, module) { * before passing to filterPath()/filterFileList(). * @return {?{name: string, patterns: Array.}} */ - function getLastFilter() { + function getActiveFilter() { var filterSets = PreferencesManager.get("fileFilters") || [], activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), oldFilter = PreferencesManager.getViewState("search.exclusions") || [], @@ -122,6 +119,8 @@ define(function (require, exports, module) { /** * Get the condensed form of the filter set by joining the first two in the set with * a comma separator and appending a short message with the number of filters being clipped. + * @param {Array.} filter + * @param {string} condensed form of filter set */ function _getCondensedForm(filter) { // Format filter in condensed form @@ -138,7 +137,7 @@ define(function (require, exports, module) { * No Files Excluded if no filter is selected. */ function _updatePicker() { - var filter = getLastFilter(); + var filter = getActiveFilter(); if (filter && filter.patterns.length) { var label = filter.name || _getCondensedForm(filter.patterns); _picker.$button.text(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); @@ -154,7 +153,7 @@ define(function (require, exports, module) { * @param {{name: string, patterns: Array.}=} filter * @param {number=} index The index of the filter set in the list of saved filter sets or -1 if it is a new one */ - function setLastFilter(filter, index) { + function setActiveFilter(filter, index) { var filterSets = PreferencesManager.get("fileFilters") || []; if (filter) { @@ -169,7 +168,7 @@ define(function (require, exports, module) { } } else { // Should not have been called with an invalid index to the available filter sets. - console.log("setLastFilter is called with an invalid index: " + index); + console.log("setActiveFilter is called with an invalid index: " + index); return; } @@ -276,30 +275,26 @@ define(function (require, exports, module) { /** - * Opens a dialog box to edit the given filter. When editing is finished, the value of getLastFilter() changes to + * Opens a dialog box to edit the given filter. When editing is finished, the value of getActiveFilter() changes to * reflect the edits. If the dialog was canceled, the preference is left unchanged. * @param {!{name: string, patterns: Array.}} filter * @param {number} index The index of the filter set to be edited or created. The value is -1 if it is for a new one - * to be created, + * to be created. * @return {!$.Promise} Dialog box promise */ function editFilter(filter, index) { var lastFocus = window.document.activeElement; - var html = StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url) + - "" + - "
    " + - Strings.FILTER_COUNTING_FILES + "
    "; - var buttons = [ - { className : Dialogs.DIALOG_BTN_CLASS_NORMAL, id: Dialogs.DIALOG_BTN_CANCEL, text: Strings.CANCEL }, - { className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, id: Dialogs.DIALOG_BTN_OK, text: Strings.OK } - ]; - var dialog = Dialogs.showModalDialog(DefaultDialogs.DIALOG_ID_INFO, Strings.FILE_FILTER_DIALOG, html, buttons), + var templateVars = { + instruction: StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url), + Strings: Strings + }; + var dialog = Dialogs.showModalDialogUsingTemplate(Mustache.render(EditFilterTemplate, templateVars)), $nameField = dialog.getElement().find(".exclusions-name"), $editField = dialog.getElement().find(".exclusions-editor"); - $nameField.val(filter.name).focus(); - $editField.val(filter.patterns.length ? filter.patterns.join("\n") : ""); + $nameField.val(filter.name); + $editField.val(filter.patterns.join("\n")).focus(); function getValue() { var newFilter = $editField.val().split("\n"); @@ -313,11 +308,11 @@ define(function (require, exports, module) { dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setLastFilter({ name: $nameField.val(), patterns: getValue() }, index); + setActiveFilter({ name: $nameField.val(), patterns: getValue() }, index); _updatePicker(); _doPopulate(); } - lastFocus.focus(); // restore focus to old po + lastFocus.focus(); // restore focus to old pos }); // Code to update the file count readout at bottom of dialog (if context provided) @@ -353,83 +348,78 @@ define(function (require, exports, module) { * @return {!string} 'compiled' filter that can be passed to filterPath()/filterFileList(). */ function commitPicker(picker) { - var filter = getLastFilter(); + var filter = getActiveFilter(); return (filter && filter.patterns.length) ? compile(filter.patterns) : ""; } /** - * Set up mouse click events for 'Delete' and 'Edit' buttons - * when the dropdown is open. - * @param {!Event>} event openDropdown event triggered when the dropdown is open - * @param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list + * Remove the target item from the filter dropdown list and update dropdown button + * and dropdown list UI. + * @param {!Event} e Mouse events */ - function _handleListEvents(event, $dropdown) { + function _handleDeleteFilter(e) { + // Remove the filter set from the preferences and + // clear the active filter set index from view state. + var filterSets = PreferencesManager.get("fileFilters") || [], + activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), + filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX; - function adjustSuccedingFilters(removedFilterIndex) { - $dropdown.children().each(function () { - var index = $(".stylesheet-link", this).data("index"); - if (index > removedFilterIndex) { - if (index === removedFilterIndex + 1) { - $(this).find("a").addClass("selected"); - } - $(".stylesheet-link", this).data("index", index - 1); - } - }); + // Don't let the click bubble upward. + e.stopPropagation(); + + filterSets.splice(filterIndex, 1); + PreferencesManager.set("fileFilters", filterSets); + + if (activeFilterIndex === filterIndex) { + // Removing the active filter, so clear the active filter + // both in the view state. + setActiveFilter(null); + } else if (activeFilterIndex > filterIndex) { + // Adjust the active filter index after the removal of a filter set before it. + --activeFilterIndex; + setActiveFilter(filterSets[activeFilterIndex], activeFilterIndex); } - - $dropdown.find(".filter-trash-icon") - .on("click", function (e) { - // Remove the filter set from the preferences and - // clear the active filter set index from view state. - var filterSets = PreferencesManager.get("fileFilters") || [], - activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), - filterIndex = $(this).parent().data("index") - FIRST_FILTER_INDEX; - // Don't let the click bubble upward. - e.stopPropagation(); + _updatePicker(); + _doPopulate(); + _picker.refresh(); + } - filterSets.splice(filterIndex, 1); - PreferencesManager.set("fileFilters", filterSets); + /** + * Close filter dropdwon list and launch edit filter dialog. + * @param {!Event} e Mouse events + */ + function _handleEditFilter(e) { + var filterSets = PreferencesManager.get("fileFilters") || [], + filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX; - _doPopulate(); - - // Explicitly remove the list item to refresh the dropdown menu - $(this).closest("li").remove(); - - if (filterSets.length === 0) { - $dropdown.find(".divider").remove(); - } + // Don't let the click bubble upward. + e.stopPropagation(); - if (activeFilterIndex === filterIndex) { - // Removing the active filter, so clear the active filter - // both in the view state and the picker button label. - setLastFilter(); - } else if (activeFilterIndex > filterIndex) { - // Adjust the active filter index after the removal of a filter set before it. - setLastFilter(filterSets[--activeFilterIndex], activeFilterIndex); - } + // Close the dropdown first before opening the edit filter dialog + // so that it will restore focus to the DOM element that has focus + // prior to opening it. + _picker.closeDropdown(); - // Also adjust the data-index of all filter sets in the dropdown that are after the deleted one - adjustSuccedingFilters(filterIndex + FIRST_FILTER_INDEX); - - _updatePicker(); - }); + editFilter(filterSets[filterIndex], filterIndex); + } + + /** + * Set up mouse click event listeners for 'Delete' and 'Edit' buttons + * when the dropdown is open. Also set check mark on the active filter. + * @param {!Event>} event openDropdown event triggered when the dropdown is open + * @param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list + */ + function _handleOpenDropdown(event, $dropdown) { + var activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), + checkedItemIndex = (activeFilterIndex > -1) ? (activeFilterIndex + FIRST_FILTER_INDEX) : -1; + _picker.setChecked(checkedItemIndex, true); + + $dropdown.find(".filter-trash-icon") + .on("click", _handleDeleteFilter); $dropdown.find(".filter-edit-icon") - .on("click", function (e) { - var filterSets = PreferencesManager.get("fileFilters") || [], - filterIndex = $(this).parent().data("index") - FIRST_FILTER_INDEX; - - // Don't let the click bubble upward. - e.stopPropagation(); - - // Close the dropdown first before opening the edit filter dialog - // so that it will restore focus to the DOM element that has focus - // prior to opening it. - _picker.closeDropdown(); - - editFilter(filterSets[filterIndex], filterIndex); - }); + .on("click", _handleEditFilter); } /** @@ -438,11 +428,13 @@ define(function (require, exports, module) { * when the UI containing the filter picker is confirmed (which updates the MRU order) and then use the * returned filter object as needed. * - * @param {?{label:string, promise:$.Promise}} context Info on files filter will apply to - see editFilter() + * @param {?{label:string, promise:$.Promise}} context Info on files that filter will apply to. + * This will be saved as _context for later use in creating a new filter or editing an + * existing filter in Edit Filter dialog. * @return {!jQueryObject} Picker UI. To retrieve the selected value, use commitPicker(). */ function createFilterPicker(context) { - + function itemRenderer(item, index) { if (index < FIRST_FILTER_INDEX) { // Prefix the two filter commands with 'recent-filter-name' so that @@ -464,14 +456,15 @@ define(function (require, exports, module) { _context = context; _picker = new DropdownButton("", [], itemRenderer); - _doPopulate(); + _updatePicker(); + _doPopulate(); // Add 'file-filter-picker' to keep some margin space on the left of the button _picker.$button.addClass("file-filter-picker no-focus"); - // Set up mouse click events for 'Delete' and 'Edit' buttons - $(_picker).on("openDropdown", _handleListEvents); + // Set up mouse click event listeners for 'Delete' and 'Edit' buttons + $(_picker).on("openDropdown", _handleOpenDropdown); $(_picker).on("select", function (event, item, itemIndex) { if (itemIndex === 0) { @@ -483,12 +476,16 @@ define(function (require, exports, module) { // Create a new filter set editFilter({ name: "", patterns: [] }, -1); } else if (itemIndex === 1) { + // Uncheck the prior active filter in the dropdown list. + var checkedItemIndex = getActiveFilter() + FIRST_FILTER_INDEX; + _picker.setChecked(itemIndex, false); + // Clear the active filter - setLastFilter(); + setActiveFilter(null); _updatePicker(); } else if (itemIndex >= FIRST_FILTER_INDEX && item) { - var filterSets = PreferencesManager.get("fileFilters") || []; - setLastFilter(item, itemIndex - FIRST_FILTER_INDEX); + setActiveFilter(item, itemIndex - FIRST_FILTER_INDEX); + _picker.setChecked(itemIndex, true); _updatePicker(); } }); @@ -520,8 +517,8 @@ define(function (require, exports, module) { exports.createFilterPicker = createFilterPicker; exports.commitPicker = commitPicker; - exports.getLastFilter = getLastFilter; - exports.setLastFilter = setLastFilter; + exports.getActiveFilter = getActiveFilter; + exports.setActiveFilter = setActiveFilter; exports.editFilter = editFilter; exports.compile = compile; exports.filterPath = filterPath; diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 456b1108e9a..115e382688e 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -954,10 +954,12 @@ define(function (require, exports, module) { $(this.modalBar).on("close", this._handleClose.bind(this)); // Custom closing behavior: if in the middle of executing search, blur shouldn't close ModalBar yet. And - // don't close bar when opening Edit Filter dialog either. + // don't close bar when opening Edit Filter dialog or showing the filter dropdown list either. var self = this; this.modalBar.isLockedOpen = function () { - return self.getDialogTextField().attr("disabled") || $(".modal.instance .exclusions-editor").length > 0; + return self.getDialogTextField().attr("disabled") || + $(".modal.instance .exclusions-editor").length > 0 || + $("ul.dropdown-menu.dropdownbutton-popup").length > 0; }; var $searchField = $("input#find-what"), diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 67db14a6dc6..b2d474744d9 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1225,7 +1225,7 @@ a, img { visibility: hidden; position: relative; top: 2px; - right: -4px; + right: -4px; } .filter-edit-icon:hover { diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index f02c19080d9..30bac5d6d3b 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -489,8 +489,29 @@ a:focus { color: @bc-black !important; } + &.dropdown-menu a { + &::before { + position: absolute; + left: 10px; + text-align: center; + content: "✓"; + display: none; + } + /* toggle checkmark visibility */ + &.checked::before { + display: inline-block; + } + } + + &.dropdown-menu a:hover { + /* toggle checkmark visibility */ + &.checked::before { + display: none; + } + } + &.dropdown-menu a:not(.selected):hover { - background: none; + background: none; } .divider { diff --git a/src/utils/DropdownEventHandler.js b/src/utils/DropdownEventHandler.js index 0218a071376..fac75ec505d 100644 --- a/src/utils/DropdownEventHandler.js +++ b/src/utils/DropdownEventHandler.js @@ -186,7 +186,7 @@ define(function (require, exports, module) { // If the item to be selected is a divider, then rotate one more. if ($(this.$items[pos]).hasClass("divider")) { - this._rotateSelection((distance > 0) ? ++distance : --distance); + this._rotateSelection((distance > 0) ? (distance + 1) : (distance - 1)); } else { this._setSelectedIndex(pos, true); } diff --git a/src/widgets/DropdownButton.js b/src/widgets/DropdownButton.js index 5e102c29a2c..070f41381c7 100644 --- a/src/widgets/DropdownButton.js +++ b/src/widgets/DropdownButton.js @@ -123,6 +123,47 @@ define(function (require, exports, module) { return html; }; + /** + * Refresh the dropdown list by removing and re-creating all list items. + * Call this after deleting/adding any item in the dropdown list. + */ + DropdownButton.prototype.refresh = function () { + if (!this.$dropdown) { + return; + } + + // Remove all list items and then re-create them from this.items. + $("li", this.$dropdown).remove(); + this.$dropdown.append(this._renderList()); + + // Also trigger openDropdown handler so that custom event handlers can be + // set up for any custom UI in the list. + $(this).triggerHandler("openDropdown", [this.$dropdown]); + }; + + /** + * Check/Uncheck the list item of the given index. + * @param {number} index The index of the list item to be checked or unchecked + * @param {boolean} checked True if the list item is to be checked, false to get check + * mark removed. + */ + DropdownButton.prototype.setChecked = function (index, checked) { + if (!this.$dropdown) { + return; + } + + var listItems = $("li", this.$dropdown), + count = listItems.length; + + if (index > -1 && index < count) { + if (checked) { + $("a", listItems[index]).addClass("checked"); + } else if ($(listItems[index]).hasClass("checked")) { + $("a", listItems[index]).removeClass("checked"); + } + } + }; + /** Pops open the dropdown if currently closed. Does nothing if items.length == 0 */ DropdownButton.prototype.showDropdown = function () { // Act like a plain old button if no items to show @@ -194,12 +235,12 @@ define(function (require, exports, module) { DropdownButton.prototype._onDropdownClose = function () { window.document.body.removeEventListener("click", this._onClickOutside, true); $(PanelManager).off("editorAreaResize", this.closeDropdown); - + // Restore focus to old pos, unless "select" handler changed it if (window.document.activeElement === this.$dropdown[0]) { this._lastFocus.focus(); } - + this._dropdownEventHandler = null; this.$dropdown = null; // already remvoed from DOM automatically by PopUpManager }; @@ -215,8 +256,9 @@ define(function (require, exports, module) { DropdownButton.prototype._onClickOutside = function (event) { var $container = $(event.target).closest(".dropdownbutton-popup"); - // If click is outside dropdown list, then close dropdown list - if ($container.length === 0 || $container[0] !== this.$dropdown[0]) { + // If click is outside dropdown list or dropdown button, then close dropdown list + if (!$(event.target).hasClass("btn btn-dropdown") && + ($container.length === 0 || $container[0] !== this.$dropdown[0])) { this.closeDropdown(); } }; From 1954e31ff70c5c3de5770594ce45773f5f92b8ce Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Thu, 22 May 2014 12:59:54 -0700 Subject: [PATCH 090/125] Remove ViewUtils that is no longer needed. --- src/search/FileFilters.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 81f31f891d0..720fe6bfa88 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -38,7 +38,6 @@ define(function (require, exports, module) { DropdownButton = require("widgets/DropdownButton").DropdownButton, StringUtils = require("utils/StringUtils"), Strings = require("strings"), - ViewUtils = require("utils/ViewUtils"), PreferencesManager = require("preferences/PreferencesManager"), EditFilterTemplate = require("text!htmlContent/edit-filter-dialog.html"); From ff6f068ef251a74706597c5573d3634b6076559f Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Thu, 22 May 2014 13:19:37 -0700 Subject: [PATCH 091/125] Missed to include this file in previous commit. --- test/spec/FileFilters-test.js | 74 +++++++++-------------------------- 1 file changed, 18 insertions(+), 56 deletions(-) diff --git a/test/spec/FileFilters-test.js b/test/spec/FileFilters-test.js index f15abbc01ee..4484d9ba8b3 100644 --- a/test/spec/FileFilters-test.js +++ b/test/spec/FileFilters-test.js @@ -429,7 +429,7 @@ define(function (require, exports, module) { it("should migrate old filter sets to the new multiple filter sets pref", function () { PreferencesManager.setViewState("search.exclusions", "*.css, *.less"); - expect(FileFilters.getLastFilter()).toEqual({name: "", patterns: "*.css, *.less"}); + expect(FileFilters.getActiveFilter()).toEqual({name: "", patterns: "*.css, *.less"}); expect(PreferencesManager.get("fileFilters")).toEqual([{name: "", patterns: "*.css, *.less"}]); expect(PreferencesManager.getViewState("activeFileFilter")).toBe(0); }); @@ -444,8 +444,8 @@ define(function (require, exports, module) { PreferencesManager.setViewState("activeFileFilter", 0); // Add a new filter set as the last one. - FileFilters.setLastFilter(newFilterSet, -1); - expect(FileFilters.getLastFilter()).toEqual(newFilterSet); + FileFilters.setActiveFilter(newFilterSet, -1); + expect(FileFilters.getActiveFilter()).toEqual(newFilterSet); expect(PreferencesManager.getViewState("activeFileFilter")).toBe(2); expect(PreferencesManager.get("fileFilters")).toEqual(existingFilters.concat([newFilterSet])); }); @@ -460,8 +460,8 @@ define(function (require, exports, module) { PreferencesManager.setViewState("activeFileFilter", 0); // Replace the second filter set with a new one. - FileFilters.setLastFilter(newFilterSet, 1); - expect(FileFilters.getLastFilter()).toEqual(newFilterSet); + FileFilters.setActiveFilter(newFilterSet, 1); + expect(FileFilters.getActiveFilter()).toEqual(newFilterSet); expect(PreferencesManager.getViewState("activeFileFilter")).toBe(1); existingFilters.splice(1, 1, newFilterSet); @@ -480,7 +480,7 @@ define(function (require, exports, module) { expect(PreferencesManager.getViewState("activeFileFilter")).toBe(1); // Remove the current active filter - FileFilters.setLastFilter(); + FileFilters.setActiveFilter(); expect(PreferencesManager.getViewState("activeFileFilter")).toBe(-1); }); @@ -723,10 +723,20 @@ define(function (require, exports, module) { } function closeSearchBar() { - var $searchField = $(".modal-bar #find-group input"); - SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", $searchField[0]); + runs(function () { + var $searchField = $(".modal-bar #find-group input"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", $searchField[0]); + }); } + beforeEach(function () { + openSearchBar(); + }); + + afterEach(function () { + closeSearchBar(); + }); + function verifyButtonLabel(expectedLabel) { var newButtonLabel = StringUtils.format(Strings.EXCLUDE_FILE_FILTER, expectedLabel); @@ -758,18 +768,12 @@ define(function (require, exports, module) { } it("should show 'No files Excluded' in filter picker button by default", function () { - openSearchBar(); runs(function () { verifyButtonLabel(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should show two filter commands by default", function () { - openSearchBar(); runs(function () { FileFilters.showDropdown(); }); @@ -785,15 +789,10 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should launch filter editor and add a new filter set when invoked from new filter command", function () { var $dropdown; - openSearchBar(); runs(function () { FileFilters.showDropdown(); }); @@ -831,15 +830,10 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should clear the active filter set when invoked from clear filter command", function () { var $dropdown; - openSearchBar(); runs(function () { FileFilters.showDropdown(); }); @@ -878,15 +872,10 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should switch the active filter set to the selected one", function () { var $dropdown; - openSearchBar(); runs(function () { // Verify that there is no active filter (was set from the previous test). verifyButtonLabel(); @@ -905,15 +894,10 @@ define(function (require, exports, module) { verifyButtonLabel("CSS Files"); expect($dropdown.is(":visible")).toBeFalsy(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should launch filter editor and fill in the text fields with selected filter info", function () { var $dropdown; - openSearchBar(); runs(function () { FileFilters.showDropdown(); @@ -940,10 +924,6 @@ define(function (require, exports, module) { verifyButtonLabel("*.css"); expect($dropdown.is(":visible")).toBeFalsy(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should remove selected filter from filter sets preferences without changing picker button label", function () { @@ -952,8 +932,6 @@ define(function (require, exports, module) { {name: "Mark Down Files", patterns: ["*.md"]}, {name: "CSS Files", patterns: ["*.css", "*.less"]}]; - openSearchBar(); - // Create three filter sets and make the last one active. runs(function () { FileFilters.editFilter(filters[0], 0); @@ -1001,16 +979,10 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should remove selected filter from filter sets preferences plus changing picker button label", function () { var $dropdown; - - openSearchBar(); runs(function () { verifyButtonLabel("CSS Files"); @@ -1039,16 +1011,10 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); it("should also remove the divider from the dropdown list after removing the last remaining filter set", function () { var $dropdown; - - openSearchBar(); runs(function () { verifyButtonLabel(); @@ -1077,10 +1043,6 @@ define(function (require, exports, module) { runs(function () { FileFilters.closeDropdown(); }); - - runs(function () { - closeSearchBar(); - }); }); }); }); From 2d79d97e5bc15539d91f4f111a1f520f70cd655c Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Thu, 22 May 2014 13:29:32 -0700 Subject: [PATCH 092/125] prevent navbar wrapping --- test/BootstrapReporterView.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/BootstrapReporterView.css b/test/BootstrapReporterView.css index 1183131e6d0..c685f63c5b7 100644 --- a/test/BootstrapReporterView.css +++ b/test/BootstrapReporterView.css @@ -38,4 +38,11 @@ pre { /* De-emphasize source links to Jasmine framework code (vs. links to test spec & Brackets core code) */ .testframework-link { opacity: 0.45; -} \ No newline at end of file +} + +@media (min-width: 728px) and (max-width: 1199px) { + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 800px; + } +} From 5665631d722e2eeeeed79fca20a31769f1e281ff Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Thu, 22 May 2014 19:06:36 -0700 Subject: [PATCH 093/125] Replace DOM elements for filter list items with a template. --- src/htmlContent/filter-name.html | 4 ++++ src/search/FileFilters.js | 18 ++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 src/htmlContent/filter-name.html diff --git a/src/htmlContent/filter-name.html b/src/htmlContent/filter-name.html new file mode 100644 index 00000000000..b3d50723ca5 --- /dev/null +++ b/src/htmlContent/filter-name.html @@ -0,0 +1,4 @@ +
    ×
    {{{filter-name}}}{{{filter-patterns}}} \ No newline at end of file diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 720fe6bfa88..240f2c29e3d 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -39,7 +39,8 @@ define(function (require, exports, module) { StringUtils = require("utils/StringUtils"), Strings = require("strings"), PreferencesManager = require("preferences/PreferencesManager"), - EditFilterTemplate = require("text!htmlContent/edit-filter-dialog.html"); + EditFilterTemplate = require("text!htmlContent/edit-filter-dialog.html"), + FilterNameTemplate = require("text!htmlContent/filter-name.html"); /** @type {number} Constant: first filter index in the filter dropdown list */ var FIRST_FILTER_INDEX = 3; @@ -442,15 +443,12 @@ define(function (require, exports, module) { } var condensedPatterns = _getCondensedForm(item.patterns), - menuItem = "
    ×
    " + - ""; - - menuItem += _.escape(item.name || condensedPatterns); - menuItem += ""; - menuItem += (item.name ? _.escape(" - " + condensedPatterns) : ""); - menuItem += ""; - - return menuItem; + templateVars = { + "filter-name" : _.escape(item.name || condensedPatterns), + "filter-patterns": item.name ? " - " + _.escape(condensedPatterns) : "" + }; + + return Mustache.render(FilterNameTemplate, templateVars); } _context = context; From 3a86251cbf79f487685fb4e7e082896157080d9b Mon Sep 17 00:00:00 2001 From: Stein Morten Hugubakken Date: Fri, 23 May 2014 14:08:41 +0200 Subject: [PATCH 094/125] Norwegian translation update --- src/nls/nb/strings.js | 448 +++++++++++++++++++++++++++++++++--------- 1 file changed, 350 insertions(+), 98 deletions(-) diff --git a/src/nls/nb/strings.js b/src/nls/nb/strings.js index 9bcd0c738a3..b0773e49a03 100644 --- a/src/nls/nb/strings.js +++ b/src/nls/nb/strings.js @@ -25,108 +25,229 @@ /*global define */ define({ + /** * Errors */ // General file io error strings - "GENERIC_ERROR" : "(feil {0})", - "NOT_FOUND_ERR" : "Kunne ikke finne filen.", - "NOT_READABLE_ERR" : "Filen kunne ikke bli lest.", - "NO_MODIFICATION_ALLOWED_ERR" : "Målkatalogen kunnet ikke bli modifisert.", - "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Rettighetene tillater ikke modifikasjoner.", + "GENERIC_ERROR" : "(feil {0})", + "NOT_FOUND_ERR" : "Kunne ikke finne filen.", + "NOT_READABLE_ERR" : "Filen kunne ikke bli lest.", + "NO_MODIFICATION_ALLOWED_ERR" : "Målkatalogen kunnet ikke bli modifisert.", + "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Rettighetene tillater ikke modifikasjoner.", + "CONTENTS_MODIFIED_ERR" : "Filen har blitt modifisert utenfor {APP_NAME}.", + "UNSUPPORTED_ENCODING_ERR" : "Filen er ikke UTF-8 kodet tekst.", + "FILE_EXISTS_ERR" : "Filen eller katalogen eksisterer allerede.", + "FILE" : "fil", + "DIRECTORY" : "katalog", + "DIRECTORY_NAMES_LEDE" : "Katalognavn", + "FILENAMES_LEDE" : "Filnavn", + "FILENAME" : "filnavn", + "DIRECTORY_NAME" : "katalognavn", + // Project error strings - "ERROR_LOADING_PROJECT" : "Feil ved lasting av prosjektet", - "OPEN_DIALOG_ERROR" : "Det oppstod en feil ved forsøk på å åpne fildialog. (feil {0})", - "REQUEST_NATIVE_FILE_SYSTEM_ERROR" : "Det oppstod en feil ved forsøk på å laste katalogen {0}. (feil {1})", - "READ_DIRECTORY_ENTRIES_ERROR" : "Det oppstod en feil ved lesing av innholdet i katalogen {0}. (feil {1})", + "ERROR_LOADING_PROJECT" : "Feil ved lasting av prosjektet", + "OPEN_DIALOG_ERROR" : "Det oppstod en feil ved forsøk på å åpne fildialog. (feil {0})", + "REQUEST_NATIVE_FILE_SYSTEM_ERROR" : "Det oppstod en feil ved forsøk på å laste katalogen {0}. (feil {1})", + "READ_DIRECTORY_ENTRIES_ERROR" : "Det oppstod en feil ved lesing av innholdet i katalogen {0}. (feil {1})", // File open/save error string - "ERROR_OPENING_FILE_TITLE" : "Feil ved åpning av filen", - "ERROR_OPENING_FILE" : "Det oppstod en feil ved forsøk på å åpne filen {0}. {1}", - "ERROR_RELOADING_FILE_TITLE" : "Feil ved oppfriskning av endringer fra disk", - "ERROR_RELOADING_FILE" : "Det oppstod en feil ved forsøk på å oppfriske filen {0}. {1}", - "ERROR_SAVING_FILE_TITLE" : "Feil ved lagring av fil", - "ERROR_SAVING_FILE" : "Det oppstod en feil ved forsøk på å lagre filen {0}. {1}", - "INVALID_FILENAME_TITLE" : "Ugyldig filnavn", - "INVALID_FILENAME_MESSAGE" : "Filnavn kan ikke inneholde følgende tegn: {0}", - "FILE_ALREADY_EXISTS" : "Filen {0} eksisterer allerede.", - "ERROR_CREATING_FILE_TITLE" : "Feil ved oppretting av fil", - "ERROR_CREATING_FILE" : "Det oppstod en feil ved forsøk på å opprette filen {0}. {1}", + "ERROR_OPENING_FILE_TITLE" : "Feil ved åpning av filen", + "ERROR_OPENING_FILE" : "Det oppstod en feil ved forsøk på å åpne filen {0}. {1}", + "ERROR_OPENING_FILES" : "Det oppstod en feil ved forsøk på å åpne følgende filer:", + "ERROR_RELOADING_FILE_TITLE" : "Feil ved oppfriskning av endringer fra disk", + "ERROR_RELOADING_FILE" : "Det oppstod en feil ved forsøk på å oppfriske filen {0}. {1}", + "ERROR_SAVING_FILE_TITLE" : "Feil ved lagring av fil", + "ERROR_SAVING_FILE" : "Det oppstod en feil ved forsøk på å lagre filen {0}. {1}", + "ERROR_RENAMING_FILE_TITLE" : "Det oppstod en feil ved forsøk på å gi nytt navn til filen", + "ERROR_RENAMING_FILE" : "Det oppstod en feil ved forsøk på å gi nytt navn til filen {0}. {1}", + "ERROR_DELETING_FILE_TITLE" : "Det oppstod en feil ved forsøk på å slette filen", + "ERROR_DELETING_FILE" : "Det oppstod en feil ved forsøk på å slette filen {0}. {1}", + "INVALID_FILENAME_TITLE" : "Ugyldig filnavn {0}", + "INVALID_FILENAME_MESSAGE" : "Filnavn kan ikke inneholde følgende tegn: {0}", + "ENTRY_WITH_SAME_NAME_EXISTS" : "En fil eller katalog med navnet {0} eksisterer allerede.", + "ERROR_CREATING_FILE_TITLE" : "Feil ved oppretting av fil {0}", + "ERROR_CREATING_FILE" : "Det oppstod en feil ved forsøk på å opprette filen {0} {1}. {2}", + + // Application preferences corrupt error strings + "ERROR_PREFS_CORRUPT_TITLE" : "Feil ved lesing av preferanser", + "ERROR_PREFS_CORRUPT" : "Din preferansefil er ikke gyldig JSON. Filen vil bli åpnet slik at du kan korrigere formatet. Du trenger å starte {APP_NAME} på nytt for at endringene skal ha effekt.", // Application error strings - "ERROR_IN_BROWSER_TITLE" : "Oops! {APP_NAME} kjører ikke i nettlesere ennå.", - "ERROR_IN_BROWSER" : "{APP_NAME} er bygd med HTML, men akkurat nå kjører den som en skrivebords-app slik at du kan bruke den til å redigere lokale filer. Vennligst bruk applikasjonsskallet github.com/adobe/brackets-app repo'et for å kjøre {APP_NAME}", + "ERROR_IN_BROWSER_TITLE" : "Oops! {APP_NAME} kjører ikke i nettlesere ennå.", + "ERROR_IN_BROWSER" : "{APP_NAME} er bygd med HTML, men akkurat nå kjører den som en skrivebords-app slik at du kan bruke den til å redigere lokale filer. Vennligst bruk applikasjonsskallet github.com/adobe/brackets-app repo'et for å kjøre {APP_NAME}", // FileIndexManager error string - "ERROR_MAX_FILES_TITLE" : "Feil ved indeksering av filer", - "ERROR_MAX_FILES" : "Maksimalt antall filer har blitt indeksert. Handlinger som slår opp filer i indeksen kan feile.", + "ERROR_MAX_FILES_TITLE" : "Feil ved indeksering av filer", + "ERROR_MAX_FILES" : "Maksimalt antall filer har blitt indeksert. Handlinger som slår opp filer i indeksen kan feile.", - // Live Development error strings - "ERROR_LAUNCHING_BROWSER_TITLE" : "Feil ved åpning av nettleser", - "ERROR_CANT_FIND_CHROME" : "Nettleseren Google Chrome ble ikke funnet. Vennligst sørg for at den er installert.", - "ERROR_LAUNCHING_BROWSER" : "En feil skjedde ved åpning av Nettleseren. (feil {0})", + // Live Preview error strings + "ERROR_LAUNCHING_BROWSER_TITLE" : "Feil ved åpning av nettleser", + "ERROR_CANT_FIND_CHROME" : "Nettleseren Google Chrome ble ikke funnet. Vennligst sørg for at den er installert.", + "ERROR_LAUNCHING_BROWSER" : "En feil skjedde ved åpning av nettleseren. (feil {0})", - "LIVE_DEVELOPMENT_ERROR_TITLE" : "Live Preview feil", - "LIVE_DEVELOPMENT_RELAUNCH_TITLE" : "Kobler til nettleser", - "LIVE_DEVELOPMENT_ERROR_MESSAGE" : "En Live Preview kobling til Chrome kunne ikke bli etablert. For at Live Preview skal fungere må Chrome startes med remote debugging på.

    Ønsker du å start Chrome på nytt med remote debugging slått på?", - "LIVE_DEV_NEED_HTML_MESSAGE" : "Åpne en HTML-fil for å åpne live Preview.", - "LIVE_DEVELOPMENT_INFO_TITLE" : "Velkommen til Live Preview!", - "LIVE_DEVELOPMENT_INFO_MESSAGE" : "Live Preview kobler {APP_NAME} til din nettleser. Den åpner en forhåndsvisning av HTML-filen i nettleseren. Forhåndsvisningen oppdateres umiddelbart når du redigerer koden.

    I denne tidlige versjonen av {APP_NAME} fungerer Live Preview bare for endringer av CSS-filer og bare med Google Chrome. Vi ønsker å implementere det for HTML og JavaScript også snart!

    (Du ser bare denne meldingen en gang).", + "LIVE_DEVELOPMENT_ERROR_TITLE" : "Live Preview feil", + "LIVE_DEVELOPMENT_RELAUNCH_TITLE" : "Kobler til nettleser", + "LIVE_DEVELOPMENT_ERROR_MESSAGE" : "En Live Preview kobling til Chrome kunne ikke bli etablert. For at Live Preview skal fungere må Chrome startes med remote debugging på.

    Ønsker du å start Chrome på nytt med remote debugging slått på?", + "LIVE_DEV_LOADING_ERROR_MESSAGE" : "Kan ikke laste Live Preview siden", + "LIVE_DEV_NEED_HTML_MESSAGE" : "Åpne en HTML-fil for å åpne live Preview.", + "LIVE_DEV_NEED_BASEURL_MESSAGE" : "For å starte Live Preview med en server-side fil må du spesifisere en base-url for dette prosjektet.", + "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "Feil ved starting av HTTP serveren for Live Preview filer. Vennligst prøv igjen.", + "LIVE_DEVELOPMENT_INFO_TITLE" : "Velkommen til Live Preview!", + "LIVE_DEVELOPMENT_INFO_MESSAGE" : "Live Preview kobler {APP_NAME} til din nettleser. Den åpner en forhåndsvisning av HTML-filen i nettleseren. Forhåndsvisningen oppdateres umiddelbart når du redigerer koden.

    I denne tidlige versjonen av {APP_NAME} fungerer Live Preview bare for endringer av CSS-filer og bare med Google Chrome. Vi ønsker å implementere det for HTML og JavaScript også snart!

    (Du ser bare denne meldingen en gang).", + "LIVE_DEVELOPMENT_TROUBLESHOOTING" : "For mer informasjon, se Troubleshooting Live Preview connection errors.", "LIVE_DEV_STATUS_TIP_NOT_CONNECTED" : "Live Preview", - "LIVE_DEV_STATUS_TIP_PROGRESS1" : "Live Preview: Kobler til\u2026", - "LIVE_DEV_STATUS_TIP_PROGRESS2" : "Live Preview: Initaliserer\u2026", - "LIVE_DEV_STATUS_TIP_CONNECTED" : "Koble fra Live Preview", + "LIVE_DEV_STATUS_TIP_PROGRESS1" : "Live Preview: Kobler til\u2026", + "LIVE_DEV_STATUS_TIP_PROGRESS2" : "Live Preview: Initaliserer\u2026", + "LIVE_DEV_STATUS_TIP_CONNECTED" : "Koble fra Live Preview", + "LIVE_DEV_STATUS_TIP_OUT_OF_SYNC" : "Live Preview (lagre fil for oppfriskning)", + "LIVE_DEV_STATUS_TIP_SYNC_ERROR" : "Live Preview (kan ikke oppdatere p.g.a. syntax error)", + + "LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS" : "Live Preview ble kansellert fordi nettleserens utviklerverktøy ble åpnet", + "LIVE_DEV_DETACHED_TARGET_CLOSED" : "Live Preview ble kansellert fordi siden ble stengt i nettleseren", + "LIVE_DEV_NAVIGATED_AWAY" : "Live Preview ble kansellert fordi nettleseren navigerte til en side som ikke er en del av prosjektet", + "LIVE_DEV_CLOSED_UNKNOWN_REASON" : "Live Preview ble kansellert for en ukjent årsak ({0})", + + "SAVE_CLOSE_TITLE" : "Lagre endringer", + "SAVE_CLOSE_MESSAGE" : "Ønsker du å lagre enderinger i dokumentet {0}?", + "SAVE_CLOSE_MULTI_MESSAGE" : "Ønsker du å lagre enderinger i følgende filer?", + "EXT_MODIFIED_TITLE" : "Eksterne endringer", + "CONFIRM_FOLDER_DELETE_TITLE" : "Bekreft sletting", + "CONFIRM_FOLDER_DELETE" : "Er du sikker på at du vil slette katalogen {0}?", + "FILE_DELETED_TITLE" : "Fil slettet", + "EXT_MODIFIED_WARNING" : "{0} har blitt modifisert på disk.

    Vil du lagre filen og overskrive de endringene?", + "EXT_MODIFIED_MESSAGE" : "{0} er blitt endret på disk, men har samtidig ulagrede endringer i {APP_NAME}.

    Hvilken versjon ønsker du å beholde?", + "EXT_DELETED_MESSAGE" : "{0} er blitt slettet på disken, men har ulagrede endringer i {APP_NAME}.

    Ønsker du å beholde endringene?", - "SAVE_CLOSE_TITLE" : "Lagre endringer", - "SAVE_CLOSE_MESSAGE" : "Ønsker du å lagre enderinger i dokumentet {0}?", - "SAVE_CLOSE_MULTI_MESSAGE" : "Ønsker du å lagre enderinger i følgende filer?", - "EXT_MODIFIED_TITLE" : "Eksterne endringer", - "EXT_MODIFIED_MESSAGE" : "{0} er blitt endret på disk, men har samtidig ulagrede endringer i {APP_NAME}.

    Hvilken versjon ønsker du å beholde?", - "EXT_DELETED_MESSAGE" : "{0} er blitt slettet på disken, men har ulagrede endringer i {APP_NAME}.

    Ønsker du å beholde endringene?", + // Generic dialog/button labels + "OK" : "Ok", + "CANCEL" : "Avbryt", + "DONT_SAVE" : "Ikke lagre", + "SAVE" : "Lagre", + "SAVE_AS" : "Lagre som\u2026", + "SAVE_AND_OVERWRITE" : "Overskriv", + "DELETE" : "Slett", + "BUTTON_YES" : "Ja", + "BUTTON_NO" : "Nei", // Find, Replace, Find in Files - "SEARCH_REGEXP_INFO" : "Bruk /re/ syntaks for søk med regulære utrykk", - "WITH" : "Med", - "BUTTON_YES" : "Ja", - "BUTTON_NO" : "Nei", - "BUTTON_STOP" : "Stop", - - "OPEN_FILE" : "Åpne fil", - "CHOOSE_FOLDER" : "Velg katalog", - - "RELEASE_NOTES" : "Versjonsmerknader", - "NO_UPDATE_TITLE" : "Du er oppdatert!", - "NO_UPDATE_MESSAGE" : "Du kjører den nyeste versjonen av {APP_NAME}.", - - "FIND_IN_FILES_TITLE" : "- {0} {1} i {2} {3}", - "FIND_IN_FILES_FILE" : "fil", - "FIND_IN_FILES_FILES" : "filer", - "FIND_IN_FILES_MATCH" : "treff", - "FIND_IN_FILES_MATCHES" : "treff", - "FIND_IN_FILES_MAX" : " (viser kun første {0} treff)", - "FIND_IN_FILES_FILE_PATH" : "Fil: {0}", - "FIND_IN_FILES_LINE" : "linje: {0}", - - "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Feil ved henting av oppdatering info", - "ERROR_FETCHING_UPDATE_INFO_MSG" : "Det oppstod et problem ved å få informasjon fra serveren. Vennligst sørg for at du er koblet til internett og prøv på nytt.", + "FIND_RESULT_COUNT" : "{0} resultater", + "FIND_RESULT_COUNT_SINGLE" : "1 resultat", + "FIND_NO_RESULTS" : "Ingen resultater", + "REPLACE_PLACEHOLDER" : "Erstatt med\u2026", + "BUTTON_REPLACE_ALL" : "Alle\u2026", + "BUTTON_REPLACE" : "Erstatt", + "BUTTON_NEXT" : "\u25B6", + "BUTTON_PREV" : "\u25C0", + "BUTTON_NEXT_HINT" : "Neste treff", + "BUTTON_PREV_HINT" : "Forrige treff", + "BUTTON_CASESENSITIVE_HINT" : "Skill mellom store og små (bokstaver)", + "BUTTON_REGEXP_HINT" : "Regulært uttrykk", + + "OPEN_FILE" : "Åpne fil", + "SAVE_FILE_AS" : "Lagre fil", + "CHOOSE_FOLDER" : "Velg katalog", + + "RELEASE_NOTES" : "Versjonsmerknader", + "NO_UPDATE_TITLE" : "Du er oppdatert!", + "NO_UPDATE_MESSAGE" : "Du kjører den nyeste versjonen av {APP_NAME}.", + + // Replace All (in single file) + "FIND_REPLACE_TITLE_PART1" : "Erstatt \"", + "FIND_REPLACE_TITLE_PART2" : "\" med \"", + "FIND_REPLACE_TITLE_PART3" : "\" — {2} {0} {1}", + + // Find in Files + "FIND_IN_FILES_TITLE_PART1" : "\"", + "FIND_IN_FILES_TITLE_PART2" : "\" funnet", + "FIND_IN_FILES_TITLE_PART3" : "— {0} {1} {2} i {3} {4}", + "FIND_IN_FILES_SCOPED" : "i {0}", + "FIND_IN_FILES_NO_SCOPE" : "i prosjekt", + "FIND_IN_FILES_ZERO_FILES" : "Filter ekskluderer alle filer {0}", + "FIND_IN_FILES_FILE" : "fil", + "FIND_IN_FILES_FILES" : "filer", + "FIND_IN_FILES_MATCH" : "treff", + "FIND_IN_FILES_MATCHES" : "treff", + "FIND_IN_FILES_MORE_THAN" : "Over ", + "FIND_IN_FILES_PAGING" : "{0}—{1}", + "FIND_IN_FILES_FILE_PATH" : "{0} {2} {1}", // We should use normal dashes on Windows instead of em dash eventually + "FIND_IN_FILES_EXPAND_COLLAPSE" : "Ctrl/Cmd klikk for å ekspandere/kollapse alle", + "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Feil ved henting av oppdateringinfo", + "ERROR_FETCHING_UPDATE_INFO_MSG" : "Det var et problem å hente siste oppdateringsinformasjon fra serveren. Vennligst kontroller at du er tilkoblet internett og prøv på nytt.", + + // File exclusion filters + "NO_FILE_FILTER" : "Ekskluder filer\u2026", + "EDIT_FILE_FILTER" : "Rediger\u2026", + "FILE_FILTER_DIALOG" : "Rediger filter", + "FILE_FILTER_INSTRUCTIONS" : "Ekskluder filer og kataloger som er lik følgende strenger / understrenger eller jokertegn. Skriv inn hver streng på egen linje.", + "FILE_FILTER_LIST_PREFIX" : "unntatt", + "FILE_FILTER_CLIPPED_SUFFIX" : "og {0} mere", + "FILTER_COUNTING_FILES" : "Teller filer\u2026", + "FILTER_FILE_COUNT" : "Tillater {0} av {1} filer {2}", + "FILTER_FILE_COUNT_ALL" : "Tillater alle {0} filer {1}", + + // Quick Edit + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND" : "Ingen Quick Edit tilgjengelig for denne markørposisjonen.", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES" : "CSS Quick Edit: plassér markøren på et enkelt klassenavn", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND" : "CSS Quick Edit: ufullstendig klasse attributt", + "ERROR_CSSQUICKEDIT_IDNOTFOUND" : "CSS Quick Edit: ufullstendig id attributt", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR" : "CSS Quick Edit: plassér markøren i tag, class eller id", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX" : "CSS Timing Function Quick Edit: ugyldig syntax", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND" : "JS Quick Edit: plassér markøren i funksjonsnavnet", + + // Quick Docs + "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND" : "Ingen Quick Docs tilgjengelig for denne markørposisjonen", /** * ProjectManager */ - - "UNTITLED" : "Uten Tittel", + "PROJECT_LOADING" : "Laster\u2026", + "UNTITLED" : "Uten tittel", + "WORKING_FILES" : "Arbeidsfiler", /** * Keyboard modifier names */ - "KEYBOARD_CTRL" : "Ctrl", "KEYBOARD_SHIFT" : "Shift", "KEYBOARD_SPACE" : "Space", + /** + * StatusBar strings + */ + "STATUSBAR_CURSOR_POSITION" : "Linje {0}, Kolonne {1}", + "STATUSBAR_SELECTION_CH_SINGULAR" : " \u2014 Valgt {0} kolonne", + "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 Valgt {0} kolonner", + "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 Valgt {0} linje", + "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 Valgt {0} linjer", + "STATUSBAR_SELECTION_MULTIPLE" : " \u2014 {0} valg", + "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Klikk for å bytte indentering til mellomrom", + "STATUSBAR_INDENT_TOOLTIP_TABS" : "Klikk for å bytte indentering til tabulator", + "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "Klikk for å bytte antall mellomrom som brukes til indentering", + "STATUSBAR_INDENT_SIZE_TOOLTIP_TABS" : "Klikk for å bytte antall tabulatorer som brukes til indentering", + "STATUSBAR_SPACES" : "Mellomrom:", + "STATUSBAR_TAB_SIZE" : "Tabulatorbredde:", + "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} Linje", + "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} Linjer", + "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Utvidelser deaktivert", + "STATUSBAR_INSERT" : "INS", + "STATUSBAR_OVERWRITE" : "OVR", + + // CodeInspection: errors/warnings + "ERRORS_PANEL_TITLE_MULTIPLE" : "{0} Problemer", + "SINGLE_ERROR" : "1 {0} Problem", + "MULTIPLE_ERRORS" : "{1} {0} Problemer", + "NO_ERRORS" : "Ingen {0} problemer funnet - godt jobbet!", + "NO_ERRORS_MULTIPLE_PROVIDER" : "Ingen problemer funnet - godt jobbet!", + "LINT_DISABLED" : "Linting er deaktivert", + "NO_LINT_AVAILABLE" : "Ingen linter tilgjengelig for {0}", + "NOTHING_TO_LINT" : "Ingenting å linte", + "LINTER_TIMED_OUT" : "{0} tidsavbrudd etter å ha ventet i {1} ms", + "LINTER_FAILED" : "{0} terminerte med feil: {1}", + /** * Command Name Constants */ @@ -135,11 +256,11 @@ define({ "FILE_MENU" : "Fil", "CMD_FILE_NEW_UNTITLED" : "Ny", "CMD_FILE_NEW" : "Ny", - "CMD_FILE_NEW_FOLDER" : "Ny mappe", + "CMD_FILE_NEW_FOLDER" : "Ny katalog", "CMD_FILE_OPEN" : "Åpne\u2026", "CMD_ADD_TO_WORKING_SET" : "Tilføye til arbeidsset", "CMD_OPEN_DROPPED_FILES" : "Åpne droppete filer", - "CMD_OPEN_FOLDER" : "Åpne mappe\u2026", + "CMD_OPEN_FOLDER" : "Åpne katalogen\u2026", "CMD_FILE_CLOSE" : "Lukk", "CMD_FILE_CLOSE_ALL" : "Lukk alle", "CMD_FILE_CLOSE_LIST" : "Lukk liste", @@ -195,7 +316,7 @@ define({ "CMD_ADD_NEXT_MATCH" : "Legg til neste treff til utvalg", "CMD_SKIP_CURRENT_MATCH" : "Hopp over og legg til neste treff", "CMD_FIND_IN_FILES" : "Finn i filer", - "CMD_FIND_IN_SELECTED" : "Finn i valgt fil/mappe", + "CMD_FIND_IN_SELECTED" : "Finn i valgt fil/katalog", "CMD_FIND_IN_SUBTREE" : "Finn i\u2026", "CMD_REPLACE" : "Erstatt", @@ -251,31 +372,133 @@ define({ "CMD_OPEN_PREFERENCES" : "Åpne preferansefilen", // Strings for main-view.html - "EXPERIMENTAL_BUILD" : "Experimental build", - "SEARCH_RESULTS" : "Søkeresultater", - "OK" : "OK", - "DONT_SAVE" : "Ikke lagre", - "SAVE" : "Lagre", - "CANCEL" : "Avbryt", - "RELOAD_FROM_DISK" : "Oppdater fra disk", - "KEEP_CHANGES_IN_EDITOR" : "Behold endringer i editor", - "CLOSE_DONT_SAVE" : "Lukk (ikke lagre)", - "RELAUNCH_CHROME" : "Start Chrome på nytt", - "ABOUT" : "About", - "CLOSE" : "Lukk", - "ABOUT_TEXT_LINE1" : "sprint {VERSION_MINOR} experimental build {VERSION}", - "ABOUT_TEXT_LINE3" : "Notices, terms and conditions pertaining to third party software are located at {ADOBE_THIRD_PARTY} and incorporated by reference herein.", - "ABOUT_TEXT_LINE4" : "Documentation and source at https://github.com/adobe/brackets/", - "UPDATE_NOTIFICATION_TOOLTIP" : "En ny for {APP_NAME} er tilgjengelig! Klikk her for mer informasjon.", - "UPDATE_AVAILABLE_TITLE" : "Oppdatering er tilgjengelig", - "UPDATE_MESSAGE" : "Hei, en ny bygg for {APP_NAME} er tilgjengelig. Her er noen av de nye funksjonene:", - "GET_IT_NOW" : "Hent den nå!", + "EXPERIMENTAL_BUILD" : "eksperimentell bygg", + "DEVELOPMENT_BUILD" : "utvikler bygg", + "RELOAD_FROM_DISK" : "Oppdater fra disk", + "KEEP_CHANGES_IN_EDITOR" : "Behold endringer i editor", + "CLOSE_DONT_SAVE" : "Lukk (ikke lagre)", + "RELAUNCH_CHROME" : "Start Chrome på nytt", + "ABOUT" : "Om", + "CLOSE" : "Lukk", + "ABOUT_TEXT_LINE1" : "sprint {VERSION_MINOR} {BUILD_TYPE} {VERSION}", + "ABOUT_TEXT_LINE3" : "Notices, terms and conditions pertaining to third party software are located at {ADOBE_THIRD_PARTY} and incorporated by reference herein.", + "ABOUT_TEXT_LINE4" : "Documentation and source at https://github.com/adobe/brackets/", + "ABOUT_TEXT_LINE5" : "Made with \u2764 and JavaScript by:", + "ABOUT_TEXT_LINE6" : "Lots of people (but we're having trouble loading that data right now).", + "ABOUT_TEXT_WEB_PLATFORM_DOCS" : "Web Platform Docs and the Web Platform graphical logo are licensed under a Creative Commons Attribution license, CC-BY 3.0 Unported.", + "UPDATE_NOTIFICATION_TOOLTIP" : "En ny for {APP_NAME} er tilgjengelig! Klikk her for mer informasjon.", + "UPDATE_AVAILABLE_TITLE" : "Oppdatering er tilgjengelig", + "UPDATE_MESSAGE" : "Hei, en ny bygg for {APP_NAME} er tilgjengelig. Her er noen av de nye funksjonene:", + "GET_IT_NOW" : "Hent den nå!", + "PROJECT_SETTINGS_TITLE" : "Prosjektinstillinger for: {0}", + "PROJECT_SETTING_BASE_URL" : "Live Preview base URL", + "PROJECT_SETTING_BASE_URL_HINT" : "For å bruke en lokal server, skriv inn en url lingnende http://localhost:8000/", + "BASEURL_ERROR_INVALID_PROTOCOL" : "Protokollen {0} er ikke støttet av Live Preview—vennligst bruk http: eller https: .", + "BASEURL_ERROR_SEARCH_DISALLOWED" : "Base URL kan ikke inneholde søkeparametere som \"{0}\".", + "BASEURL_ERROR_HASH_DISALLOWED" : "Base URL kan ikke inneholde hashes som \"{0}\".", + "BASEURL_ERROR_INVALID_CHAR" : "Spesialtegn som '{0}' må bli %-kodet.", + "BASEURL_ERROR_UNKNOWN_ERROR" : "Ukjent feil ved tolking av base URL", + + // CSS Quick Edit + "BUTTON_NEW_RULE" : "Ny regel", + // Extension Management strings + "INSTALL" : "Installer", + "UPDATE" : "Oppdater", + "REMOVE" : "Slett", + "OVERWRITE" : "Overskriv", + "CANT_REMOVE_DEV" : "Utvidelser i \"dev\" katalogen må slettes manuelt.", + "CANT_UPDATE" : "Oppdatering er ikke kompatibel med denne versjonen av {APP_NAME}.", + "CANT_UPDATE_DEV" : "Utvidelser i \"dev\" katalogen kan ikke oppdateres automatisk.", + "INSTALL_EXTENSION_TITLE" : "Installer utvidelse", + "UPDATE_EXTENSION_TITLE" : "Oppdater utvidelse", + "INSTALL_EXTENSION_LABEL" : "Utvidelse URL", + "INSTALL_EXTENSION_HINT" : "URL for utvidelsens zipfil eller GitHub repo", + "INSTALLING_FROM" : "Installerer utvidelse fra {0}\u2026", + "INSTALL_SUCCEEDED" : "Installasjon var suksessfull!", + "INSTALL_FAILED" : "Installasjonen feilet.", + "CANCELING_INSTALL" : "Kansellerer\u2026", + "CANCELING_HUNG" : "Kansellering av installasjonen tar lang tid. En intern feil kan ha oppstått.", + "INSTALL_CANCELED" : "Installasjonen kansellert.", + // These must match the error codes in ExtensionsDomain.Errors.* : + "INVALID_ZIP_FILE" : "Nedlastet innhold er ikke en gyldig zipfil", + "INVALID_PACKAGE_JSON" : "Filen package.json er ikke gyldig (error: {0}).", + "MISSING_PACKAGE_NAME" : "Filen package.json spesifiserer ikke pakkenavn.", + "BAD_PACKAGE_NAME" : "{0} er et ugyldig pakkenavn.", + "MISSING_PACKAGE_VERSION" : "Filen package.json spesifiserer ikke en pakkeversjon.", + "INVALID_VERSION_NUMBER" : "Pakkens versjonsnummer {0} er ugyldig.", + "INVALID_BRACKETS_VERSION" : "{APP_NAME} kompatiblitetstreng ({0}) er ugyldig.", + "DISALLOWED_WORDS" : "Ordene ({1}) er ikke tillatt i {0} feltet.", + "API_NOT_COMPATIBLE" : "Utvidelsen er ikke kompatibel med denne versjonen av {APP_NAME}. Den er installert i katalogen for deaktiverte utvidelser.", + "MISSING_MAIN" : "Pakken har ingen main.js fil.", + "EXTENSION_ALREADY_INSTALLED" : "Installasjon av denne pakken vil overskrive en tidligere installert utvidelse. Overskrive den gamle utvidelsen?", + "EXTENSION_SAME_VERSION" : "Denne pakken er den samme versjonen som er allerede installert. Overskrive den eksisterende utvidelsen?", + "EXTENSION_OLDER_VERSION" : "Denne pakken er versjon {0} som er eldre enn den installerte versjonen ({1}). Overskrive den eksisterende installasjonen?", + "DOWNLOAD_ID_IN_USE" : "Intern feil: nedlastingsid er allerede i bruk.", + "NO_SERVER_RESPONSE" : "Kan ikke koble til server.", + "BAD_HTTP_STATUS" : "Fil ikke funnet på server (HTTP {0}).", + "CANNOT_WRITE_TEMP" : "Kan ikke lagre nedlastingen til temporær fil.", + "ERROR_LOADING" : "Det oppstod en feil ved oppstart av utvidelsen.", + "MALFORMED_URL" : "URL er ugyldig. Vennligst kontroller at du tastet inn korrekt.", + "UNSUPPORTED_PROTOCOL" : "URL må være en http eller https URL.", + "UNKNOWN_ERROR" : "Ukjent intern feil.", + // For NOT_FOUND_ERR, see generic strings above + "EXTENSION_MANAGER_TITLE" : "Utvidelsesbehandler", + "EXTENSION_MANAGER_ERROR_LOAD" : "Kan ikke aksessere utvidelsesregisteret. Vennligst prøv igjen senere.", + "INSTALL_FROM_URL" : "Installerer fra URL\u2026", + "EXTENSION_AUTHOR" : "Forfatter", + "EXTENSION_DATE" : "Dato", + "EXTENSION_INCOMPATIBLE_NEWER" : "Denne utvidelsen krever en nyere versjon av {APP_NAME}.", + "EXTENSION_INCOMPATIBLE_OLDER" : "Denne utvidelsen virker bare med en eldre versjon av {APP_NAME}.", + "EXTENSION_LATEST_INCOMPATIBLE_NEWER" : "Versjon {0} av denne utvidelsen krever en nyere versjon av {APP_NAME}. Men du kan installere tidligere versjon {1}.", + "EXTENSION_LATEST_INCOMPATIBLE_OLDER" : "Versjon {0} av denne utvidelsen krever en eldre versjon av {APP_NAME}. Men du kan installere tidligere versjon {1}.", + "EXTENSION_NO_DESCRIPTION" : "Ingen beskrivelse", + "EXTENSION_MORE_INFO" : "Mer info...", + "EXTENSION_ERROR" : "Utvidelsesfeil", + "EXTENSION_KEYWORDS" : "Nøkkelord", + "EXTENSION_INSTALLED" : "Installert", + "EXTENSION_UPDATE_INSTALLED" : "Denne utvidelsen har blitt lastet ned og vil bli installert etter omstart av {APP_NAME}.", + "EXTENSION_SEARCH_PLACEHOLDER" : "Søk", + "EXTENSION_MORE_INFO_LINK" : "Mer", + "BROWSE_EXTENSIONS" : "Bla gjennom utvidelser", + "EXTENSION_MANAGER_REMOVE" : "Slett utvidelse", + "EXTENSION_MANAGER_REMOVE_ERROR" : "Klarte ikkke å fjerne en eller flere utvidelser: {0}. {APP_NAME} vil uansett starte på nytt.", + "EXTENSION_MANAGER_UPDATE" : "Oppdater utvidelse", + "EXTENSION_MANAGER_UPDATE_ERROR" : "Klarte ikke å oppdatere en eller flere utvidelser: {0}. {APP_NAME} will uansett starte på nytt.", + "MARKED_FOR_REMOVAL" : "Markert for sletting", + "UNDO_REMOVE" : "Angre", + "MARKED_FOR_UPDATE" : "Markert for oppdatering", + "UNDO_UPDATE" : "Angre", + "CHANGE_AND_RELOAD_TITLE" : "Endre utvidelser", + "CHANGE_AND_RELOAD_MESSAGE" : "For å oppdatere eller slette markerte utvidelser, må {APP_NAME} starte på nytt. Du vil bli spurt om å lagre You'll be prompted to save unsaved changes.", + "REMOVE_AND_RELOAD" : "Fjern utvidelse og start på nytt", + "CHANGE_AND_RELOAD" : "Endre utvidelse og start på nytt", + "UPDATE_AND_RELOAD" : "Oppdater utvidelse og start på nytt", + "PROCESSING_EXTENSIONS" : "Prosesserer utvidelseendringer\u2026", + "EXTENSION_NOT_INSTALLED" : "Kunne ikke fjerne utvidelsen {0} ettersom den ikke var installert.", + "NO_EXTENSIONS" : "Ingen utvidelser installert ennå.
    Klikk på Tilgjengelig-fanen over for å komme i gang.", + "NO_EXTENSION_MATCHES" : "Fant ingen utvidelser for ditt søk.", + "REGISTRY_SANITY_CHECK_WARNING" : "Vær forsiktig når du installerer utvidelser fra ukjent kilde.", + "EXTENSIONS_INSTALLED_TITLE" : "Installert", + "EXTENSIONS_AVAILABLE_TITLE" : "Tilgjengelig", + "EXTENSIONS_UPDATES_TITLE" : "Oppdateringer", + + "INLINE_EDITOR_NO_MATCHES" : "Ingen treff.", + "CSS_QUICK_EDIT_NO_MATCHES" : "Ingen eksisterende CSS regler passer ditt utvalg.
    Klikk \"Ny regel\" for å lage en.", + "CSS_QUICK_EDIT_NO_STYLESHEETS" : "Det er ingen stilark i prosjektet ditt.
    Lag ett for å legge til CSS regler.", + + // Custom Viewers + "IMAGE_VIEWER_LARGEST_ICON" : "største", - // extensions/default/DebugCommands + /** + * Unit names + */ + + "UNIT_PIXELS" : "piksler", + // extensions/default/DebugCommands "DEBUG_MENU" : "Debug", - "ERRORS" : "Errors", + "ERRORS" : "Feil", "CMD_SHOW_DEV_TOOLS" : "Vis utviklerverktøy", "CMD_REFRESH_WINDOW" : "Gjenåpne med utvidelser", "CMD_RELOAD_WITHOUT_USER_EXTS" : "Gjenåpne uten utvidelser", @@ -287,16 +510,45 @@ define({ "CMD_LOG_NODE_STATE" : "Logg Nodestatus til konsoll", "CMD_RESTART_NODE" : "Omstart Node", "CMD_SHOW_ERRORS_IN_STATUS_BAR" : "Vis feil i statuslinjen", - + "LANGUAGE_TITLE" : "Bytt språk", "LANGUAGE_MESSAGE" : "Velg ønsket språk fra listen under:", "LANGUAGE_SUBMIT" : "Gjenåpne {APP_NAME}", "LANGUAGE_CANCEL" : "Avbryt", "LANGUAGE_SYSTEM_DEFAULT" : "Sett systemforvalg", + + // extensions/default/InlineTimingFunctionEditor + "INLINE_TIMING_EDITOR_TIME" : "Tid", + "INLINE_TIMING_EDITOR_PROGRESSION" : "Progresjon", + "BEZIER_EDITOR_INFO" : " Flytt valgt punkt
    Shift Flytt med ti enheter
    Tab Bytt punkter", + "STEPS_EDITOR_INFO" : " Øk eller mink trinn
    'Start' eller 'Slutt'", + "INLINE_TIMING_EDITOR_INVALID" : "Den gamle verdien {0} er ikke gyldig, den viste funksjonen ble endret til {1}. Dokumentet vil bli oppdatert ved første redigering.", + + // extensions/default/InlineColorEditor + "COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Gjeldende farge", + "COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Original farge", + "COLOR_EDITOR_RGBA_BUTTON_TIP" : "RGBa Format", + "COLOR_EDITOR_HEX_BUTTON_TIP" : "Hex Format", + "COLOR_EDITOR_HSLA_BUTTON_TIP" : "HSLa Format", + "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR" : "{0} (Brukt {1} gang)", + "COLOR_EDITOR_USED_COLOR_TIP_PLURAL" : "{0} (Brukt {1} ganger)", + + // extensions/default/JavaScriptCodeHints + "CMD_JUMPTO_DEFINITION" : "Hopp til definisjonen", + "CMD_SHOW_PARAMETER_HINT" : "Vis parameter hint", + "NO_ARGUMENTS" : "", // extensions/default/JSLint - "CMD_JSLINT" : "Aktiver JSLint", - "JSLINT_ERRORS" : "JSLint feil" + "JSLINT_NAME" : "JSLint", + + // extensions/default/QuickView + "CMD_ENABLE_QUICK_VIEW" : "Quick View ved hovring", + + // extensions/default/RecentProjects + "CMD_TOGGLE_RECENT_PROJECTS" : "Siste prosjekter", + + // extensions/default/WebPlatformDocs + "DOCS_MORE_LINK" : "Les mer" }); -/* Last translated for 36fd23e311b2bb7f64c37e56c00006d8795050da */ \ No newline at end of file +/* Last translated for 36fd23e311b2bb7f64c37e56c00006d8795050da */ From 89c1ffb3f8c0ad4b547344db0d80d7e07ad6a4d4 Mon Sep 17 00:00:00 2001 From: wALF Utility Date: Fri, 23 May 2014 09:47:16 -0700 Subject: [PATCH 095/125] Updated by ALF automation. --- src/nls/fr/strings.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 0225f5caeaf..1837c87d428 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -41,10 +41,10 @@ define({ "FILE_EXISTS_ERR": "Le fichier ou le répertoire existe déjà.", "FILE": "fichier", "DIRECTORY": "répertoire", - "DIRECTORY_NAMES_LEDE": "Noms de répertoire", - "FILENAMES_LEDE": "Noms de fichier", - "FILENAME": "nom de fichier", - "DIRECTORY_NAME": "nom de répertoire", + "DIRECTORY_NAMES_LEDE": "noms de répertoires", + "FILENAMES_LEDE": "noms de fichiers", + "FILENAME": "Nom de fichier", + "DIRECTORY_NAME": "Nom de répertoire", // Project error strings @@ -66,7 +66,7 @@ define({ "ERROR_DELETING_FILE_TITLE": "Erreur lors de la suppression du fichier", "ERROR_DELETING_FILE": "Une erreur s’est produite lors de la tentative de suppression du fichier {0}. {1}", "INVALID_FILENAME_TITLE": "{0} non valide", - "INVALID_FILENAME_MESSAGE": "Le {0} ne peut pas utiliser de termes réservés au système, finir par un point (.) ou contenir l’un des caractères suivants : {1}", + "INVALID_FILENAME_MESSAGE": "Les {0} ne peuvent pas utiliser de termes réservés au système, finir par un point (.) ou contenir l’un des caractères suivants : {1}", "ENTRY_WITH_SAME_NAME_EXISTS": "Il existe déjà un fichier ou un répertoire portant le nom {0}.", "ERROR_CREATING_FILE_TITLE": "Erreur lors de la création du {0}", "ERROR_CREATING_FILE": "Une erreur s’est produite lors de la tentative de création du {0} {1}. {2}", From 6fd732164ce2eb89c7188aaad6ed585501eef08f Mon Sep 17 00:00:00 2001 From: Ingo Richter Date: Fri, 23 May 2014 11:20:23 -0700 Subject: [PATCH 096/125] - changed update notification url --- src/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.json b/src/config.json index b2507aa92d6..07d5d452ea0 100644 --- a/src/config.json +++ b/src/config.json @@ -3,7 +3,7 @@ "app_title": "Brackets", "app_name_about": "Brackets", "about_icon": "styles/images/brackets_icon.svg", - "update_info_url": "http://brackets.io/updates/stable/", + "update_info_url": "http://s3.amazonaws.com/files.brackets.io/updates/stable/", "how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets", "support_url": "https://github.com/adobe/brackets/wiki/Troubleshooting", "suggest_feature_url": "https://github.com/adobe/brackets/wiki/Suggest-a-Feature", From 564931b273b337691f5bf69af5da1bcb6b6d6d7f Mon Sep 17 00:00:00 2001 From: Ingo Richter Date: Fri, 23 May 2014 14:00:43 -0700 Subject: [PATCH 097/125] - there was another occurence of the update url that needed to be updated --- src/brackets.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brackets.config.json b/src/brackets.config.json index bdb07cfcc20..2302c8ffb24 100644 --- a/src/brackets.config.json +++ b/src/brackets.config.json @@ -4,7 +4,7 @@ "app_title" : "Brackets", "app_name_about" : "Brackets", "about_icon" : "styles/images/brackets_icon.svg", - "update_info_url" : "http://dev.brackets.io/updates/stable/", + "update_info_url" : "http://s3.amazonaws.com/files.brackets.io/updates/stable/", "how_to_use_url" : "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets", "support_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting", "suggest_feature_url" : "https://github.com/adobe/brackets/wiki/Suggest-a-Feature", From ba8bd1bab7cdd873661b90455b2df43708af8598 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Fri, 23 May 2014 15:26:43 -0700 Subject: [PATCH 098/125] Making additional changes for second review feedback. --- src/search/FileFilters.js | 4 ++-- src/search/FindInFiles.js | 6 ++---- src/widgets/DropdownButton.js | 25 +++++++++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 240f2c29e3d..250971ce851 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -140,9 +140,9 @@ define(function (require, exports, module) { var filter = getActiveFilter(); if (filter && filter.patterns.length) { var label = filter.name || _getCondensedForm(filter.patterns); - _picker.$button.text(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); + _picker.setButtonLabel(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label)); } else { - _picker.$button.text(Strings.NO_FILE_FILTER); + _picker.setButtonLabel(Strings.NO_FILE_FILTER); } } diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 115e382688e..456b1108e9a 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -954,12 +954,10 @@ define(function (require, exports, module) { $(this.modalBar).on("close", this._handleClose.bind(this)); // Custom closing behavior: if in the middle of executing search, blur shouldn't close ModalBar yet. And - // don't close bar when opening Edit Filter dialog or showing the filter dropdown list either. + // don't close bar when opening Edit Filter dialog either. var self = this; this.modalBar.isLockedOpen = function () { - return self.getDialogTextField().attr("disabled") || - $(".modal.instance .exclusions-editor").length > 0 || - $("ul.dropdown-menu.dropdownbutton-popup").length > 0; + return self.getDialogTextField().attr("disabled") || $(".modal.instance .exclusions-editor").length > 0; }; var $searchField = $("input#find-what"), diff --git a/src/widgets/DropdownButton.js b/src/widgets/DropdownButton.js index 070f41381c7..9835db89a01 100644 --- a/src/widgets/DropdownButton.js +++ b/src/widgets/DropdownButton.js @@ -98,6 +98,17 @@ define(function (require, exports, module) { event.stopPropagation(); }; + /** + * Update the button label. + * @param {string} label + */ + DropdownButton.prototype.setButtonLabel = function (label) { + if (!this.$button) { + return; + } + $(this.$button).text(label); + }; + /** * Called for each item when rendering the dropdown. * @param {*} item from items array @@ -156,11 +167,7 @@ define(function (require, exports, module) { count = listItems.length; if (index > -1 && index < count) { - if (checked) { - $("a", listItems[index]).addClass("checked"); - } else if ($(listItems[index]).hasClass("checked")) { - $("a", listItems[index]).removeClass("checked"); - } + $("a", listItems[index]).toggleClass("checked", checked); } }; @@ -215,7 +222,7 @@ define(function (require, exports, module) { this._dropdownEventHandler = new DropdownEventHandler($dropdown, this._onSelect.bind(this), this._onDropdownClose.bind(this)); this._dropdownEventHandler.open(); - window.document.body.addEventListener("click", this._onClickOutside, true); + window.document.body.addEventListener("mousedown", this._onClickOutside, true); $(PanelManager).on("editorAreaResize", this.closeDropdown); // Manage focus @@ -233,7 +240,7 @@ define(function (require, exports, module) { * was closed. */ DropdownButton.prototype._onDropdownClose = function () { - window.document.body.removeEventListener("click", this._onClickOutside, true); + window.document.body.removeEventListener("mousedown", this._onClickOutside, true); $(PanelManager).off("editorAreaResize", this.closeDropdown); // Restore focus to old pos, unless "select" handler changed it @@ -257,9 +264,11 @@ define(function (require, exports, module) { var $container = $(event.target).closest(".dropdownbutton-popup"); // If click is outside dropdown list or dropdown button, then close dropdown list - if (!$(event.target).hasClass("btn btn-dropdown") && + if (!$(event.target).is(this.$button) && ($container.length === 0 || $container[0] !== this.$dropdown[0])) { this.closeDropdown(); + event.stopPropagation(); + event.preventDefault(); } }; From 51091df3a6f6a062e7dd0d3e09e2cce58fef1902 Mon Sep 17 00:00:00 2001 From: HighwayChile Date: Sat, 24 May 2014 11:49:42 -0700 Subject: [PATCH 099/125] updated wording of UF-8 file load error. Issue #7850 --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 36fd23e311b..c7fe17dbb77 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -37,7 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "The target directory cannot be modified.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "The permissions do not allow you to make modifications.", "CONTENTS_MODIFIED_ERR" : "The file has been modified outside of {APP_NAME}.", - "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text.", + "UNSUPPORTED_ENCODING_ERR" : "Brackets currently only supports UTF-8 encoded text files.", "FILE_EXISTS_ERR" : "The file or directory already exists.", "FILE" : "file", "DIRECTORY" : "directory", From 9b1148473ef2d17af32e2567d1d861709a1a08c5 Mon Sep 17 00:00:00 2001 From: HighwayChile Date: Sat, 24 May 2014 21:45:39 -0700 Subject: [PATCH 100/125] re-added previous error text to make more specific --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index c7fe17dbb77..5b8276e2603 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -37,7 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "The target directory cannot be modified.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "The permissions do not allow you to make modifications.", "CONTENTS_MODIFIED_ERR" : "The file has been modified outside of {APP_NAME}.", - "UNSUPPORTED_ENCODING_ERR" : "Brackets currently only supports UTF-8 encoded text files.", + "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text. Brackets currently only supports UTF-8 encoded text files.", "FILE_EXISTS_ERR" : "The file or directory already exists.", "FILE" : "file", "DIRECTORY" : "directory", From fda91311bc233c9ffe7c0053101e9aec00f7a920 Mon Sep 17 00:00:00 2001 From: HighwayChile Date: Sun, 25 May 2014 00:26:33 -0700 Subject: [PATCH 101/125] changed hardcoded Brackets string to {APP_NAME} --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 5b8276e2603..f380a051538 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -37,7 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "The target directory cannot be modified.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "The permissions do not allow you to make modifications.", "CONTENTS_MODIFIED_ERR" : "The file has been modified outside of {APP_NAME}.", - "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text. Brackets currently only supports UTF-8 encoded text files.", + "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text. {APP_NAME} currently only supports UTF-8 encoded text files.", "FILE_EXISTS_ERR" : "The file or directory already exists.", "FILE" : "file", "DIRECTORY" : "directory", From 1b957c4b1bc63a2e1c4de5b5743c9d5b57b93abd Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Sun, 25 May 2014 12:14:52 -0700 Subject: [PATCH 102/125] Move the triggerHandler call into _renderList instead of calling it directly in refresh(). --- src/search/FileFilters.js | 7 ++--- src/widgets/DropdownButton.js | 53 ++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 250971ce851..df0c52a0e0e 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -407,10 +407,10 @@ define(function (require, exports, module) { /** * Set up mouse click event listeners for 'Delete' and 'Edit' buttons * when the dropdown is open. Also set check mark on the active filter. - * @param {!Event>} event openDropdown event triggered when the dropdown is open + * @param {!Event>} event listRendered event triggered when the dropdown is open * @param {!jQueryObject} $dropdown the jQuery DOM node of the dropdown list */ - function _handleOpenDropdown(event, $dropdown) { + function _handleListRendered(event, $dropdown) { var activeFilterIndex = PreferencesManager.getViewState("activeFileFilter"), checkedItemIndex = (activeFilterIndex > -1) ? (activeFilterIndex + FIRST_FILTER_INDEX) : -1; _picker.setChecked(checkedItemIndex, true); @@ -461,7 +461,7 @@ define(function (require, exports, module) { _picker.$button.addClass("file-filter-picker no-focus"); // Set up mouse click event listeners for 'Delete' and 'Edit' buttons - $(_picker).on("openDropdown", _handleOpenDropdown); + $(_picker).on("listRendered", _handleListRendered); $(_picker).on("select", function (event, item, itemIndex) { if (itemIndex === 0) { @@ -474,7 +474,6 @@ define(function (require, exports, module) { editFilter({ name: "", patterns: [] }, -1); } else if (itemIndex === 1) { // Uncheck the prior active filter in the dropdown list. - var checkedItemIndex = getActiveFilter() + FIRST_FILTER_INDEX; _picker.setChecked(itemIndex, false); // Clear the active filter diff --git a/src/widgets/DropdownButton.js b/src/widgets/DropdownButton.js index 9835db89a01..db25b46338f 100644 --- a/src/widgets/DropdownButton.js +++ b/src/widgets/DropdownButton.js @@ -119,8 +119,16 @@ define(function (require, exports, module) { return _.escape(String(item)); }; - /** Converts the list of item objects into HTML list items in format required by DropdownEventHandler */ - DropdownButton.prototype._renderList = function () { + /** + * Converts the list of item objects into HTML list items in format required by DropdownEventHandler + * @param {!jQueryObject} parent The dropdown element + * @return {!jQueryObject} The dropdown element with the rendered list items appended. + */ + DropdownButton.prototype._renderList = function (parent) { + if (!parent) { + return null; + } + var html = ""; this.items.forEach(function (item, i) { if (item === "---") { @@ -131,7 +139,14 @@ define(function (require, exports, module) { html += "
  • "; } }.bind(this)); - return html; + + parent.append(html); + + // Also trigger listRendered handler so that custom event handlers can be + // set up for any custom UI in the list. + $(this).triggerHandler("listRendered", [parent]); + + return parent; }; /** @@ -145,11 +160,7 @@ define(function (require, exports, module) { // Remove all list items and then re-create them from this.items. $("li", this.$dropdown).remove(); - this.$dropdown.append(this._renderList()); - - // Also trigger openDropdown handler so that custom event handlers can be - // set up for any custom UI in the list. - $(this).triggerHandler("openDropdown", [this.$dropdown]); + this._renderList(this.$dropdown); }; /** @@ -185,20 +196,22 @@ define(function (require, exports, module) { Menus.closeAll(); var $dropdown = $("