|
|
|
|
@@ -1,313 +0,0 @@
|
|
|
|
|
var _=function(){function f(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual&&k.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&k.isFunction(b.isEqual))return b.isEqual(a);var g=e.call(a);if(g!=e.call(b))return!1;switch(g){case "[object String]":return a==String(b);case "[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case "[object Date]":case "[object Boolean]":return+a==+b;case "[object RegExp]":return a.source==
|
|
|
|
|
b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;for(var d=c.length;d--;)if(c[d]==a)return!0;c.push(a);var d=0,j=!0;if(g=="[object Array]"){if(d=a.length,j=d==b.length)for(;d--;)if(!(j=d in a==d in b&&f(a[d],b[d],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(k.has(a,h)&&(d++,!(j=k.has(b,h)&&f(a[h],b[h],c))))break;if(j){for(h in b)if(k.has(b,h)&&!d--)break;
|
|
|
|
|
j=!d}}c.pop();return j}var d=this,h=d._,i={},b=Array.prototype,c=Object.prototype,a=b.slice,g=b.unshift,e=c.toString,j=c.hasOwnProperty,n=b.forEach,o=b.map,l=b.reduce,m=b.reduceRight,p=b.filter,r=b.every,q=b.some,u=b.indexOf,s=b.lastIndexOf,c=Array.isArray,v=Object.keys,w=Function.prototype.bind,k=function(a){return new x(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=k;exports._=k}else d._=k;k.VERSION="1.3.3";var t=k.each=k.forEach=function(a,
|
|
|
|
|
b,e){if(a!=null)if(n&&a.forEach===n)a.forEach(b,e);else if(a.length===+a.length)for(var c=0,g=a.length;c<g;c++){if(c in a&&b.call(e,a[c],c,a)===i)break}else for(c in a)if(k.has(a,c)&&b.call(e,a[c],c,a)===i)break};k.map=k.collect=function(a,b,e){var c=[];if(a==null)return c;if(o&&a.map===o)return a.map(b,e);t(a,function(a,g,k){c[c.length]=b.call(e,a,g,k)});if(a.length===+a.length)c.length=a.length;return c};k.reduce=k.foldl=k.inject=function(a,b,c,e){var g=arguments.length>2;a==null&&(a=[]);if(l&&
|
|
|
|
|
a.reduce===l)return e&&(b=k.bind(b,e)),g?a.reduce(b,c):a.reduce(b);t(a,function(a,k,d){g?c=b.call(e,c,a,k,d):(c=a,g=!0)});if(!g)throw new TypeError("Reduce of empty array with no initial value");return c};k.reduceRight=k.foldr=function(a,b,c,e){var g=arguments.length>2;a==null&&(a=[]);if(m&&a.reduceRight===m)return e&&(b=k.bind(b,e)),g?a.reduceRight(b,c):a.reduceRight(b);var d=k.toArray(a).reverse();e&&!g&&(b=k.bind(b,e));return g?k.reduce(d,b,c,e):k.reduce(d,b)};k.find=k.detect=function(a,b,c){var e;
|
|
|
|
|
D(a,function(a,g,k){if(b.call(c,a,g,k))return e=a,!0});return e};k.filter=k.select=function(a,b,e){var c=[];if(a==null)return c;if(p&&a.filter===p)return a.filter(b,e);t(a,function(a,g,k){b.call(e,a,g,k)&&(c[c.length]=a)});return c};k.reject=function(a,b,c){var e=[];if(a==null)return e;t(a,function(a,g,k){b.call(c,a,g,k)||(e[e.length]=a)});return e};k.every=k.all=function(a,b,e){var c=!0;if(a==null)return c;if(r&&a.every===r)return a.every(b,e);t(a,function(a,g,k){if(!(c=c&&b.call(e,a,g,k)))return i});
|
|
|
|
|
return!!c};var D=k.some=k.any=function(a,b,c){b||(b=k.identity);var e=!1;if(a==null)return e;if(q&&a.some===q)return a.some(b,c);t(a,function(a,g,k){if(e||(e=b.call(c,a,g,k)))return i});return!!e};k.include=k.contains=function(a,b){var e=!1;return a==null?e:u&&a.indexOf===u?a.indexOf(b)!=-1:e=D(a,function(a){return a===b})};k.invoke=function(b,e){var c=a.call(arguments,2);return k.map(b,function(a){return(k.isFunction(e)?e||a:a[e]).apply(a,c)})};k.pluck=function(a,b){return k.map(a,function(a){return a[b]})};
|
|
|
|
|
k.max=function(a,b,e){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&k.isEmpty(a))return-Infinity;var c={computed:-Infinity};t(a,function(a,g,k){g=b?b.call(e,a,g,k):a;g>=c.computed&&(c={value:a,computed:g})});return c.value};k.min=function(a,b,e){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&k.isEmpty(a))return Infinity;var c={computed:Infinity};t(a,function(a,g,k){g=b?b.call(e,a,g,k):a;g<c.computed&&(c={value:a,computed:g})});return c.value};k.shuffle=
|
|
|
|
|
function(a){var b=[],e;t(a,function(a,c){e=Math.floor(Math.random()*(c+1));b[c]=b[e];b[e]=a});return b};k.sortBy=function(a,b,e){var c=k.isFunction(b)?b:function(a){return a[b]};return k.pluck(k.map(a,function(a,b,g){return{value:a,criteria:c.call(e,a,b,g)}}).sort(function(a,b){var e=a.criteria,c=b.criteria;return e===void 0?1:c===void 0?-1:e<c?-1:e>c?1:0}),"value")};k.groupBy=function(a,b){var e={},c=k.isFunction(b)?b:function(a){return a[b]};t(a,function(a,b){var g=c(a,b);(e[g]||(e[g]=[])).push(a)});
|
|
|
|
|
return e};k.sortedIndex=function(a,b,e){e||(e=k.identity);for(var c=0,g=a.length;c<g;){var d=c+g>>1;e(a[d])<e(b)?c=d+1:g=d}return c};k.toArray=function(b){return!b?[]:k.isArray(b)?a.call(b):k.isArguments(b)?a.call(b):b.toArray&&k.isFunction(b.toArray)?b.toArray():k.values(b)};k.size=function(a){return k.isArray(a)?a.length:k.keys(a).length};k.first=k.head=k.take=function(b,e,c){return e!=null&&!c?a.call(b,0,e):b[0]};k.initial=function(b,e,c){return a.call(b,0,b.length-(e==null||c?1:e))};k.last=function(b,
|
|
|
|
|
e,c){return e!=null&&!c?a.call(b,Math.max(b.length-e,0)):b[b.length-1]};k.rest=k.tail=function(b,e,c){return a.call(b,e==null||c?1:e)};k.compact=function(a){return k.filter(a,function(a){return!!a})};k.flatten=function(a,b){return k.reduce(a,function(a,e){if(k.isArray(e))return a.concat(b?e:k.flatten(e));a[a.length]=e;return a},[])};k.without=function(b){return k.difference(b,a.call(arguments,1))};k.uniq=k.unique=function(a,b,e){var e=e?k.map(a,e):a,c=[];a.length<3&&(b=!0);k.reduce(e,function(e,g,
|
|
|
|
|
d){if(b?k.last(e)!==g||!e.length:!k.include(e,g))e.push(g),c.push(a[d]);return e},[]);return c};k.union=function(){return k.uniq(k.flatten(arguments,!0))};k.intersection=k.intersect=function(b){var e=a.call(arguments,1);return k.filter(k.uniq(b),function(a){return k.every(e,function(b){return k.indexOf(b,a)>=0})})};k.difference=function(b){var e=k.flatten(a.call(arguments,1),!0);return k.filter(b,function(a){return!k.include(e,a)})};k.zip=function(){for(var b=a.call(arguments),e=k.max(k.pluck(b,"length")),
|
|
|
|
|
c=Array(e),g=0;g<e;g++)c[g]=k.pluck(b,""+g);return c};k.indexOf=function(a,b,e){if(a==null)return-1;var c;if(e)return e=k.sortedIndex(a,b),a[e]===b?e:-1;if(u&&a.indexOf===u)return a.indexOf(b);e=0;for(c=a.length;e<c;e++)if(e in a&&a[e]===b)return e;return-1};k.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);for(var e=a.length;e--;)if(e in a&&a[e]===b)return e;return-1};k.range=function(a,b,e){arguments.length<=1&&(b=a||0,a=0);for(var e=arguments[2]||1,
|
|
|
|
|
c=Math.max(Math.ceil((b-a)/e),0),g=0,k=Array(c);g<c;)k[g++]=a,a+=e;return k};var E=function(){};k.bind=function(b,e){var c,g;if(b.bind===w&&w)return w.apply(b,a.call(arguments,1));if(!k.isFunction(b))throw new TypeError;g=a.call(arguments,2);return c=function(){if(!(this instanceof c))return b.apply(e,g.concat(a.call(arguments)));E.prototype=b.prototype;var k=new E,d=b.apply(k,g.concat(a.call(arguments)));return Object(d)===d?d:k}};k.bindAll=function(b){var e=a.call(arguments,1);e.length==0&&(e=k.functions(b));
|
|
|
|
|
t(e,function(a){b[a]=k.bind(b[a],b)});return b};k.memoize=function(a,b){var e={};b||(b=k.identity);return function(){var c=b.apply(this,arguments);return k.has(e,c)?e[c]:e[c]=a.apply(this,arguments)}};k.delay=function(b,e){var c=a.call(arguments,2);return setTimeout(function(){return b.apply(null,c)},e)};k.defer=function(b){return k.delay.apply(k,[b,1].concat(a.call(arguments,1)))};k.throttle=function(a,b){var e,c,g,d,j,f,h=k.debounce(function(){j=d=!1},b);return function(){e=this;c=arguments;var k;
|
|
|
|
|
g||(g=setTimeout(function(){g=null;j&&a.apply(e,c);h()},b));d?j=!0:f=a.apply(e,c);h();d=!0;return f}};k.debounce=function(a,b,e){var c;return function(){var g=this,k=arguments;e&&!c&&a.apply(g,k);clearTimeout(c);c=setTimeout(function(){c=null;e||a.apply(g,k)},b)}};k.once=function(a){var b=!1,e;return function(){if(b)return e;b=!0;return e=a.apply(this,arguments)}};k.wrap=function(b,e){return function(){var c=[b].concat(a.call(arguments,0));return e.apply(this,c)}};k.compose=function(){var a=arguments;
|
|
|
|
|
return function(){for(var b=arguments,e=a.length-1;e>=0;e--)b=[a[e].apply(this,b)];return b[0]}};k.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};k.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],e;for(e in a)k.has(a,e)&&(b[b.length]=e);return b};k.values=function(a){return k.map(a,k.identity)};k.functions=k.methods=function(a){var b=[],e;for(e in a)k.isFunction(a[e])&&b.push(e);return b.sort()};k.extend=function(b){t(a.call(arguments,
|
|
|
|
|
1),function(a){for(var e in a)b[e]=a[e]});return b};k.pick=function(b){var e={};t(k.flatten(a.call(arguments,1)),function(a){a in b&&(e[a]=b[a])});return e};k.defaults=function(b){t(a.call(arguments,1),function(a){for(var e in a)b[e]==null&&(b[e]=a[e])});return b};k.clone=function(a){return!k.isObject(a)?a:k.isArray(a)?a.slice():k.extend({},a)};k.tap=function(a,b){b(a);return a};k.isEqual=function(a,b){return f(a,b,[])};k.isEmpty=function(a){if(a==null)return!0;if(k.isArray(a)||k.isString(a))return a.length===
|
|
|
|
|
0;for(var b in a)if(k.has(a,b))return!1;return!0};k.isElement=function(a){return!!(a&&a.nodeType==1)};k.isArray=c||function(a){return e.call(a)=="[object Array]"};k.isObject=function(a){return a===Object(a)};k.isArguments=function(a){return e.call(a)=="[object Arguments]"};if(!k.isArguments(arguments))k.isArguments=function(a){return!(!a||!k.has(a,"callee"))};k.isFunction=function(a){return e.call(a)=="[object Function]"};k.isString=function(a){return e.call(a)=="[object String]"};k.isNumber=function(a){return e.call(a)==
|
|
|
|
|
"[object Number]"};k.isFinite=function(a){return k.isNumber(a)&&isFinite(a)};k.isNaN=function(a){return a!==a};k.isBoolean=function(a){return a===!0||a===!1||e.call(a)=="[object Boolean]"};k.isDate=function(a){return e.call(a)=="[object Date]"};k.isRegExp=function(a){return e.call(a)=="[object RegExp]"};k.isNull=function(a){return a===null};k.isUndefined=function(a){return a===void 0};k.has=function(a,b){return j.call(a,b)};k.noConflict=function(){d._=h;return this};k.identity=function(a){return a};
|
|
|
|
|
k.times=function(a,b,e){for(var c=0;c<a;c++)b.call(e,c)};k.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};k.result=function(a,b){if(a==null)return null;var e=a[b];return k.isFunction(e)?e.call(a):e};k.mixin=function(a){t(k.functions(a),function(b){F(b,k[b]=a[b])})};var G=0;k.uniqueId=function(a){var b=G++;return a?a+b:b};k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,
|
|
|
|
|
escape:/<%-([\s\S]+?)%>/g};var z=/.^/,y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},A;for(A in y)y[y[A]]=A;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,I=/\\(\\|'|r|n|t|u2028|u2029)/g,B=function(a){return a.replace(I,function(a,b){return y[b]})};k.template=function(a,b,e){e=k.defaults(e||{},k.templateSettings);a="__p+='"+a.replace(H,function(a){return"\\"+y[a]}).replace(e.escape||z,function(a,b){return"'+\n_.escape("+B(b)+")+\n'"}).replace(e.interpolate||z,function(a,b){return"'+\n("+
|
|
|
|
|
B(b)+")+\n'"}).replace(e.evaluate||z,function(a,b){return"';\n"+B(b)+"\n;__p+='"})+"';\n";e.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",c=new Function(e.variable||"obj","_",a);if(b)return c(b,k);b=function(a){return c.call(this,a,k)};b.source="function("+(e.variable||"obj")+"){\n"+a+"}";return b};k.chain=function(a){return k(a).chain()};var x=function(a){this._wrapped=a};k.prototype=x.prototype;
|
|
|
|
|
var C=function(a,b){return b?k(a).chain():a},F=function(b,e){x.prototype[b]=function(){var b=a.call(arguments);g.call(b,this._wrapped);return C(e.apply(k,b),this._chain)}};k.mixin(k);t(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var e=b[a];x.prototype[a]=function(){var b=this._wrapped;e.apply(b,arguments);var c=b.length;(a=="shift"||a=="splice")&&c===0&&delete b[0];return C(b,this._chain)}});t(["concat","join","slice"],function(a){var e=b[a];x.prototype[a]=function(){return C(e.apply(this._wrapped,
|
|
|
|
|
arguments),this._chain)}});x.prototype.chain=function(){this._chain=!0;return this};x.prototype.value=function(){return this._wrapped};return k}.call({}),emmet=function(f){function d(a,b,d){var f;f=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};_.extend(f,a);c.prototype=a.prototype;f.prototype=new c;b&&_.extend(f.prototype,b);d&&_.extend(f,d);f.prototype.constructor=f;f.__super__=a.prototype;return f}function h(c){!(c in b)&&a&&a(c);return b[c]}if(typeof _=="undefined")try{_=
|
|
|
|
|
f.require("underscore")}catch(i){}if(typeof _=="undefined")throw"Cannot access to Underscore.js lib";var b={_:_},c=function(){},a=null;return{define:function(a,e){a in b||(b[a]=_.isFunction(e)?this.exec(e):e)},require:h,exec:function(a,b){return a.call(b||f,_.bind(h,this),_,this)},extend:function(a,b){var c=d(this,a,b);c.extend=this.extend;if(a.hasOwnProperty("toString"))c.prototype.toString=a.toString;return c},expandAbbreviation:function(a,b,c,d){if(!a)return"";var b=b||"html",f=h("filters"),i=
|
|
|
|
|
h("abbreviationParser"),c=h("profile").get(c,b);h("tabStops").resetTabstopIndex();a=f.extractFromAbbreviation(a);d=i.parse(a[0],{syntax:b,contextNode:d});b=f.composeList(b,c,a[1]);f.apply(d,b,c);return d.toString()},defaultSyntax:function(){return"html"},defaultProfile:function(){return"plain"},log:function(){f.console&&f.console.log&&f.console.log.apply(f.console,arguments)},setModuleLoader:function(b){a=b}}}(this);
|
|
|
|
|
if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=emmet;exports.emmet=emmet}typeof define!=="undefined"&&define(emmet);
|
|
|
|
|
emmet.define("abbreviationParser",function(f,d){function h(){this.parent=null;this.children=[];this._attributes=[];this.abbreviation="";this.counter=1;this._name=null;this._text="";this.repeatCount=1;this.hasImplicitRepeat=!1;this._data={};this.padding=this.content=this.end=this.start=""}function i(a){return a.substring(1,a.length-1)}function b(a){for(var a=f("utils").trim(a),e=new h,c=e.addChild(),g,j=f("stringStream").create(a),a=1E3,n;!j.eol()&&--a>0;)switch(g=j.peek(),g){case "(":j.start=j.pos;
|
|
|
|
|
if(j.skipToPair("(",")"))g=b(i(j.current())),(n=j.match(/^\*(\d+)?/,!0))&&c._setRepeat(n[1]),d.each(g.children,function(a){c.addChild(a)});else throw'Invalid abbreviation: mo matching ")" found for character at '+j.pos;break;case ">":c=c.addChild();j.next();break;case "+":c=c.parent.addChild();j.next();break;case "^":g=c.parent||c;c=(g.parent||g).addChild();j.next();break;default:j.start=j.pos,j.eatWhile(function(a){if(a=="["||a=="{"){if(j.skipToPair(a,p[a]))return j.backUp(1),!0;throw'Invalid abbreviation: mo matching "'+
|
|
|
|
|
p[a]+'" found for character at '+j.pos;}return a=="+"?(j.next(),a=j.eol()||~"+>^*".indexOf(j.peek()),j.backUp(1),a):a!="("&&o(a)}),c.setAbbreviation(j.current()),j.start=j.pos}if(a<1)throw"Endless loop detected";return e}function c(a){var a=f("utils").trim(a),b=[],a=f("stringStream").create(a);for(a.eatSpace();!a.eol();)if(a.start=a.pos,a.eatWhile(m)){var e=a.current(),c="";if(a.peek()=="="){a.next();a.start=a.pos;var g=a.peek();if(g=='"'||g=="'"){a.next();a:{for(var c=a,d=void 0;d=c.next();)if(d===
|
|
|
|
|
g){c=!0;break a}c=!1}if(c)c=a.current(),c=c.substring(1,c.length-1);else throw"Invalid attribute value";}else if(a.eatWhile(/[^\s\]]/))c=a.current();else throw"Invalid attribute value";}b.push({name:e,value:c});a.eatSpace()}else break;return b}function a(a){for(var b=[],e={"#":"id",".":"class"},d=null,j=f("stringStream").create(a);!j.eol();)switch(j.peek()){case "#":case ".":if(d===null)d=j.pos;var h=e[j.peek()];j.next();j.start=j.pos;j.eatWhile(m);b.push({name:h,value:j.current()});break;case "[":if(d===
|
|
|
|
|
null)d=j.pos;j.start=j.pos;if(!j.skipToPair("[","]"))throw"Invalid attribute set definition";b=b.concat(c(i(j.current())));break;default:j.next()}return!b.length?null:{element:a.substring(0,d),attributes:g(b)}}function g(a){var a=d.map(a,function(a){return d.clone(a)}),b={};return d.filter(a,function(a){if(!(a.name in b))return b[a.name]=a;var e=b[a.name];a.name.toLowerCase()=="class"?e.value+=(e.value.length?" ":"")+a.value:e.value=a.value;return!1})}function e(a){if(!~a.indexOf("{"))return null;
|
|
|
|
|
for(var b=f("stringStream").create(a);!b.eol();)switch(b.peek()){case "[":case "(":b.skipToPair(b.peek(),p[b.peek()]);break;case "{":return b.start=b.pos,b.skipToPair("{","}"),{element:a.substring(0,b.start),text:i(b.current())};default:b.next()}}function j(a){for(var b=a.children.length-1,e,c,g;b>=0;b--)if(c=a.children[b],c.isRepeating()){g=e=c.repeatCount;c.repeatCount=1;c.updateProperty("counter",1);for(c.updateProperty("maxCount",g);--e>0;)c.parent.addChild(c.clone(),b+1).updateProperty("counter",
|
|
|
|
|
e+1).updateProperty("maxCount",g)}d.each(a.children,j);return a}function n(a){for(var b=a.children.length-1;b>=0;b--){var e=a.children[b];e.isGroup()?e.replace(n(e).children):e.isEmpty()&&e.remove()}d.each(a.children,n);return a}function o(a){var b=a.charCodeAt(0);return b>64&&b<91||b>96&&b<123||b>47&&b<58||"#.*:$-_!@|%".indexOf(a)!=-1}var l=/^[\w\-\$\:@\!%]+\+?$/i,m=/[\w\-:\$@]/,p={"[":"]","(":")","{":"}"},r=Array.prototype.splice,q=[],u=[],s=[];h.prototype={addChild:function(a,b){a=a||new h;a.parent=
|
|
|
|
|
this;d.isUndefined(b)?this.children.push(a):this.children.splice(b,0,a);return a},clone:function(){var a=new h;d.each(["abbreviation","counter","_name","_text","repeatCount","hasImplicitRepeat","start","end","content","padding"],function(b){a[b]=this[b]},this);a._attributes=d.map(this._attributes,function(a){return d.clone(a)});a._data=d.clone(this._data);a.children=d.map(this.children,function(b){b=b.clone();b.parent=a;return b});return a},remove:function(){if(this.parent)this.parent.children=d.without(this.parent.children,
|
|
|
|
|
this);return this},replace:function(){var a=this.parent,b=d.indexOf(a.children,this),e=d.flatten(arguments);r.apply(a.children,[b,1].concat(e));d.each(e,function(b){b.parent=a})},updateProperty:function(a,b){this[a]=b;d.each(this.children,function(e){e.updateProperty(a,b)});return this},find:function(a){return this.findAll(a)[0]},findAll:function(a){if(!d.isFunction(a))var b=a.toLowerCase(),a=function(a){return a.name().toLowerCase()==b};var e=[];d.each(this.children,function(b){a(b)&&e.push(b);e=
|
|
|
|
|
e.concat(b.findAll(a))});return d.compact(e)},data:function(a,b){if(arguments.length==2&&(this._data[a]=b,a=="resource"&&f("elements").is(b,"snippet")&&(this.content=b.data,this._text)))this.content=f("abbreviationUtils").insertChildContent(b.data,this._text);return this._data[a]},name:function(){var a=this.matchedResource();return f("elements").is(a,"element")?a.name:this._name},attributeList:function(){var a=[],b=this.matchedResource();f("elements").is(b,"element")&&d.isArray(b.attributes)&&(a=
|
|
|
|
|
a.concat(b.attributes));return g(a.concat(this._attributes))},attribute:function(a,b){if(arguments.length==2){var e=d.indexOf(d.pluck(this._attributes,"name"),a.toLowerCase());~e?this._attributes[e].value=b:this._attributes.push({name:a,value:b})}return(d.find(this.attributeList(),function(b){return b.name==a})||{}).value},matchedResource:function(){return this.data("resource")},index:function(){return this.parent?d.indexOf(this.parent.children,this):-1},_setRepeat:function(a){a?this.repeatCount=
|
|
|
|
|
parseInt(a,10)||1:this.hasImplicitRepeat=!0},setAbbreviation:function(b){var c=this;this.abbreviation=b=(b||"").replace(/\*(\d+)?$/,function(a,b){c._setRepeat(b);return""});var g=e(b);if(g)b=g.element,this.content=this._text=g.text;if(g=a(b))b=g.element,this._attributes=g.attributes;if((this._name=b)&&!l.test(this._name))throw"Invalid abbreviation";},toString:function(){var a=f("utils"),b=this.start,e=this.end,c=this.content,g=this;d.each(s,function(a){b=a(b,g,"start");c=a(c,g,"content");e=a(e,g,
|
|
|
|
|
"end")});var j=d.map(this.children,function(a){return a.toString()}).join(""),c=f("abbreviationUtils").insertChildContent(c,j,{keepVariable:!1});return b+a.padString(c,this.padding)+e},hasEmptyChildren:function(){return!!d.find(this.children,function(a){return a.isEmpty()})},hasImplicitName:function(){return!this._name&&!this.isTextNode()},isGroup:function(){return!this.abbreviation},isEmpty:function(){return!this.abbreviation&&!this.children.length},isRepeating:function(){return this.repeatCount>
|
|
|
|
|
1||this.hasImplicitRepeat},isTextNode:function(){return!this.name()&&!this.attributeList().length},isElement:function(){return!this.isEmpty()&&!this.isTextNode()},deepestChild:function(){if(!this.children.length)return null;for(var a=this;a.children.length;)a=d.last(a.children);return a}};s.push(function(a,b){return f("utils").replaceCounter(a,b.counter,b.maxCount)});return{parse:function(a,e){var e=e||{},c=b(a);if(e.contextNode){c._name=e.contextNode.name;var g={};d.each(c._attributes,function(a){g[a.name]=
|
|
|
|
|
a});d.each(e.contextNode.attributes,function(a){a.name in g?g[a.name].value=a.value:(a=d.clone(a),c._attributes.push(a),g[a.name]=a)})}d.each(q,function(a){a(c,e)});c=n(j(c));d.each(u,function(a){a(c,e)});return c},AbbreviationNode:h,addPreprocessor:function(a){d.include(q,a)||q.push(a)},removeFilter:function(a){preprocessor=d.without(q,a)},addPostprocessor:function(a){d.include(u,a)||u.push(a)},removePostprocessor:function(a){u=d.without(u,a)},addOutputProcessor:function(a){d.include(s,a)||s.push(a)},
|
|
|
|
|
removeOutputProcessor:function(a){s=d.without(s,a)},isAllowedChar:function(a){a=String(a);return o(a)||~">+^[](){}".indexOf(a)}}});
|
|
|
|
|
emmet.exec(function(f,d){function h(i,b){var c=f("resources"),a=f("elements"),g=f("abbreviationParser");d.each(d.clone(i.children),function(e){var j=c.getMatchedResource(e,b);if(d.isString(j))e.data("resource",a.create("snippet",j));else if(a.is(j,"reference")){j=g.parse(j.data,{syntax:b});if(e.repeatCount>1){var f=j.findAll(function(a){return a.hasImplicitRepeat});d.each(f,function(a){a.repeatCount=e.repeatCount;a.hasImplicitRepeat=!1})}var i=j.deepestChild();i&&d.each(e.children,function(a){i.addChild(a)});
|
|
|
|
|
d.each(j.children,function(a){d.each(e.attributeList(),function(b){a.attribute(b.name,b.value)})});e.replace(j.children)}else e.data("resource",j);h(e,b)})}f("abbreviationParser").addPreprocessor(function(d,b){var c=b.syntax||emmet.defaultSyntax();h(d,c)})});
|
|
|
|
|
emmet.exec(function(f,d){function h(a){for(var b=f("range"),c=[],a=f("stringStream").create(a);!a.eol();){if(a.peek()=="\\")a.next();else if(a.start=a.pos,a.match(g,!0)){c.push(b.create(a.start,g));continue}a.next()}return c}function i(a,b){var c=f("utils"),g=h(a);g.reverse();d.each(g,function(g){a=c.replaceSubstring(a,b,g)});return a}function b(a){return h(a.content).length?!0:!!d.find(a.attributeList(),function(a){return!!h(a.value).length})}function c(a,c,g){var h=a.findAll(function(a){return b(a)});
|
|
|
|
|
b(a)&&h.unshift(a);h.length?d.each(h,function(a){a.content=i(a.content,c);d.each(a._attributes,function(a){a.value=i(a.value,c)})}):(a=a.deepestChild()||a,a.content=g?c:f("abbreviationUtils").insertChildContent(a.content,c))}var a=f("abbreviationParser"),g="$#";a.addPreprocessor(function(a,b){if(b.pastedContent){var c=f("utils"),g=d.map(c.splitByLines(b.pastedContent,!0),c.trim);a.findAll(function(a){if(a.hasImplicitRepeat)return a.data("paste",g),a.repeatCount=g.length})}});a.addPostprocessor(function(a,
|
|
|
|
|
b){!a.findAll(function(a){var b=a.data("paste"),e="";d.isArray(b)?e=b[a.counter-1]:d.isFunction(b)?e=b(a.counter-1,a.content):b&&(e=b);e&&c(a,e,!!a.data("pasteOverwrites"));a.data("paste",null);return!!b}).length&&b.pastedContent&&c(a,b.pastedContent)})});emmet.exec(function(f,d){function h(i){var b=f("tagName");d.each(i.children,function(c){if(c.hasImplicitName()||c.data("forceNameResolving"))c._name=b.resolve(c.parent.name());h(c)});return i}f("abbreviationParser").addPostprocessor(h)});
|
|
|
|
|
emmet.define("cssParser",function(f,d){function h(a){return typeof a!=="undefined"}function i(){return{"char":e.chnum,line:e.linenum}}function b(a,b,c){var g=e,c=c||{};j.push({charstart:h(c["char"])?c["char"]:g.chnum,charend:h(c.charend)?c.charend:g.chnum,linestart:h(c.line)?c.line:g.linenum,lineend:h(c.lineend)?c.lineend:g.linenum,value:a,type:b||a})}function c(a,b){var c=e,g=b||{},d=h(g["char"])?g["char"]:c.chnum,g=h(g.line)?g.line:c.linenum;return{name:"ParseError",message:a+" at line "+(g+1)+
|
|
|
|
|
" char "+(d+1),walker:c,tokens:j}}function a(a){var c=e,g=c.ch,d=i(),j=a?a+g:g,g=c.nextChar();for(a&&(d["char"]-=a.length);o(g)||l(g);)j+=g,g=c.nextChar();b(j,"identifier",d)}function g(){var g=e.ch;if(g===" "||g==="\t"){for(var d=e.ch,j="",f=i();d===" "||d==="\t";)j+=d,d=e.nextChar();b(j,"white",f)}else{if(g==="/"){var d=e,g=f=d.ch,h,s=i();h=d.nextChar();if(h!=="*")s.charend=s["char"],s.lineend=s.line,j=b(g,g,s);else{for(;!(f==="*"&&h==="/");)g+=h,f=h,h=d.nextChar();g+=h;d.nextChar();b(g,"comment",
|
|
|
|
|
s)}return j}if(g==='"'||g==="'"){d=e;g=f=j=d.ch;s=i();for(j=d.nextChar();j!==f;){if(j==="\n")if(h=d.nextChar(),h==="\\")g+=j+h;else throw c("Unterminated string",s);else g+=j==="\\"?j+d.nextChar():j;j=d.nextChar()}g+=j;d.nextChar();b(g,"string",s)}else if(g==="("){d=e;j=d.ch;f=0;g=j;h=i();for(j=d.nextChar();j!==")"&&!f;){if(j==="(")f++;else if(j===")")f--;else if(j===!1)throw c("Unterminated brace",h);g+=j;j=d.nextChar()}g+=j;d.nextChar();b(g,"brace",h)}else{if(g==="-"||g==="."||l(g)){j=e;f=j.ch;
|
|
|
|
|
g=i();h=f;var s=h===".",v,f=j.nextChar();v=!l(f);if(s&&v)g.charend=g["char"],g.lineend=g.line,d=b(h,".",g);else if(h==="-"&&v)d=a("-");else{for(;f!==!1&&(l(f)||!s&&f===".");)f==="."&&(s=!0),h+=f,f=j.nextChar();b(h,"number",g)}return d}if(o(g))return a();if(n(g))return d=e,g=d.ch,j=i(),h=d.nextChar(),h==="="&&n(g,!0)?(g+=h,b(g,"match",j),d.nextChar(),f=void 0):(j.charend=j["char"]+1,j.lineend=j.line,b(g,g,j)),f;if(g==="\n")b("line"),e.nextChar();else throw c("Unrecognized character");}}}var e,j=[],
|
|
|
|
|
n,o,l;e={lines:null,total_lines:0,linenum:-1,line:"",ch:"",chnum:-1,init:function(a){var b=e;b.lines=a.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");b.total_lines=b.lines.length;b.chnum=-1;b.linenum=-1;b.ch="";b.line="";b.nextLine();b.nextChar()},nextLine:function(){this.linenum+=1;this.line=this.total_lines<=this.linenum?!1:this.lines[this.linenum];if(this.chnum!==-1)this.chnum=0;return this.line},nextChar:function(){for(this.chnum+=1;this.line.charAt(this.chnum)==="";){if(this.nextLine()===
|
|
|
|
|
!1)return this.ch=!1;this.chnum=-1;return this.ch="\n"}return this.ch=this.line.charAt(this.chnum)},peek:function(){return this.line.charAt(this.chnum+1)}};o=function(a){return a=="&"||a==="_"||a==="-"||a>="a"&&a<="z"||a>="A"&&a<="Z"};l=function(a){return a!==!1&&a>="0"&&a<="9"};n=function(){for(var a="{}[]()+*=.,;:>~|\\%$#@^!".split(""),b="*^|$~".split(""),c={},e={},g=0;g<a.length;g+=1)c[a[g]]=!0;for(g=0;g<b.length;g+=1)e[b[g]]=!0;return function(a,b){return b?!!e[a]:!!c[a]}}();return{lex:function(a){e.init(a);
|
|
|
|
|
for(j=[];e.ch!==!1;)g();return j},parse:function(a){var b=0;return d.map(this.lex(a),function(c){if(c.type=="line")c.value=a.charAt(b)=="\r"&&a.charAt(b+1)=="\n"?"\r\n":a.charAt(b);return{type:c.type,start:b,end:b+=c.value.length}})},toSource:function(a){for(var b=0,c=a.length,e,g="";b<c;b+=1)e=a[b],g+=e.type==="line"?"\n":e.value;return g}}});
|
|
|
|
|
emmet.define("xmlParser",function(f){function d(a,e){function g(b){e.tokenize=b;return b(a,e)}var d=a.next();if(d=="<")if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?g(b("atom","]]\>")):null:a.match("--")?g(b("comment","--\>")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(c(1))):null;else if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),e.tokenize=b("meta","?>"),"meta";else{w=a.eat("/")?"closeTag":"openTag";a.eatSpace();for(v="";d=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=d;e.tokenize=h;return"tag"}else return d==
|
|
|
|
|
"&"?(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error":(a.eatWhile(/[^&<]/),"text")}function h(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=d,w=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(w="equals",null):/[\'\"]/.test(c)?(b.tokenize=i(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function i(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=h;break}return"string"}}
|
|
|
|
|
function b(a,b){return function(c,e){for(;!c.eol();){if(c.match(b)){e.tokenize=d;break}c.next()}return a}}function c(a){return function(b,e){for(var g;(g=b.next())!=null;)if(g=="<")return e.tokenize=c(a+1),e.tokenize(b,e);else if(g==">")if(a==1){e.tokenize=d;break}else return e.tokenize=c(a-1),e.tokenize(b,e);return"meta"}}function a(){for(var a=arguments.length-1;a>=0;a--)k.cc.push(arguments[a])}function g(){a.apply(null,arguments);return!0}function e(){if(k.context)k.context=k.context.prev}function j(a){if(a==
|
|
|
|
|
"openTag")return k.tagName=v,g(m,n(k.startOfLine));else if(a=="closeTag")return a=!1,k.context?k.context.tagName!=v&&(s.implicitlyClosed.hasOwnProperty(k.context.tagName.toLowerCase())&&e(),a=!k.context||k.context.tagName!=v):a=!0,a&&(t="error"),g(o(a));return g()}function n(a){return function(b){if(b=="selfcloseTag"||b=="endTag"&&s.autoSelfClosers.hasOwnProperty(k.tagName.toLowerCase()))return l(k.tagName.toLowerCase()),g();if(b=="endTag"){l(k.tagName.toLowerCase());var b=k.tagName,c=s.doNotIndent.hasOwnProperty(b)||
|
|
|
|
|
k.context&&k.context.noIndent;k.context={prev:k.context,tagName:b,indent:k.indented,startOfLine:a,noIndent:c}}return g()}}function o(a){return function(b){a&&(t="error");if(b=="endTag")return e(),g();t="error";return g(arguments.callee)}}function l(a){for(var b;;){if(!k.context)break;b=k.context.tagName.toLowerCase();if(!s.contextGrabbers.hasOwnProperty(b)||!s.contextGrabbers[b].hasOwnProperty(a))break;e()}}function m(b){if(b=="word")return t="attribute",g(p,m);if(b=="endTag"||b=="selfcloseTag")return a();
|
|
|
|
|
t="error";return g(m)}function p(b){if(b=="equals")return g(r,m);s.allowMissing||(t="error");return b=="endTag"||b=="selfcloseTag"?a():g()}function r(b){if(b=="string")return g(q);if(b=="word"&&s.allowUnquoted)return t="string",g();t="error";return b=="endTag"||b=="selfCloseTag"?a():g()}function q(b){return b=="string"?g(q):a()}function u(a,b){if(a.sol())b.startOfLine=!0,b.indented=0;if(a.eatSpace())return null;t=w=v=null;var c=b.tokenize(a,b);b.type=w;if((c||w)&&c!="comment")for(k=b;;)if((b.cc.pop()||
|
|
|
|
|
j)(w||c))break;b.startOfLine=!1;return t||c}var s={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!0,allowMissing:!0},v=null,w=null,k=null,t;return{parse:function(a,b){for(var b=b||0,c={tokenize:d,cc:[],indented:0,startOfLine:!0,tagName:null,context:null},e=f("stringStream").create(a),g=[];!e.eol();)g.push({type:u(e,c),start:e.start+b,end:e.pos+b}),e.start=e.pos;return g}}});
|
|
|
|
|
emmet.define("string-score",function(){return{score:function(f,d,h){if(f==d)return 1;if(d=="")return 0;for(var i=0,b=d.length,c=f.length,a,g=1,e=0,j,n,o,l;e<b;++e){o=d.charAt(e);j=f.indexOf(o.toLowerCase());n=f.indexOf(o.toUpperCase());l=Math.min(j,n);n=l>-1?l:Math.max(j,n);if(n===-1)if(h){g+=1-h;continue}else return 0;else j=0.1;f[n]===o&&(j+=0.1);n===0?(j+=0.6,e===0&&(a=1)):f.charAt(n-1)===" "&&(j+=0.8);f=f.substring(n+1,c);i+=j}f=i/b;b=(f*(b/c)+f)/2;b/=g;a&&b+0.15<1&&(b+=0.15);return b}}});
|
|
|
|
|
emmet.define("utils",function(f,d){function h(b){this._data=[];this.length=0;b&&this.append(b)}var i="${0}";h.prototype={append:function(b){this._data.push(b);this.length+=b.length},toString:function(){return this._data.join("")},valueOf:function(){return this.toString()}};return{reTag:/<\/?[\w:\-]+(?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*\s*(\/?)>$/,endsWithTag:function(b){return this.reTag.test(b)},isNumeric:function(b){typeof b=="string"&&(b=b.charCodeAt(0));return b&&b>47&&
|
|
|
|
|
b<58},trim:function(b){return(b||"").replace(/^\s+|\s+$/g,"")},getNewline:function(){var b=f("resources");if(!b)return"\n";b=b.getVariable("newline");return d.isString(b)?b:"\n"},setNewline:function(b){var c=f("resources");c.setVariable("newline",b);c.setVariable("nl",b)},splitByLines:function(b,c){var a=this.getNewline(),a=(b||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").replace(/\r/g,"\n").replace(/\n/g,a).split(a);c&&(a=d.filter(a,function(a){return a.length&&!!this.trim(a)},this));return a},
|
|
|
|
|
normalizeNewline:function(b){return this.splitByLines(b).join(this.getNewline())},repeatString:function(b,c){for(var a=[],g=0;g<c;g++)a.push(b);return a.join("")},getStringsPads:function(b){var b=d.map(b,function(a){return d.isString(a)?a.length:+a}),c=d.max(b);return d.map(b,function(a){return(a=c-a)?this.repeatString(" ",a):""},this)},padString:function(b,c){var a=d.isNumber(c)?this.repeatString(f("resources").getVariable("indentation")||"\t",c):c,g=[],e=this.splitByLines(b),j=this.getNewline();
|
|
|
|
|
g.push(e[0]);for(var h=1;h<e.length;h++)g.push(j+a+e[h]);return g.join("")},zeroPadString:function(b,c){for(var a="",g=b.length;c>g++;)a+="0";return a+b},unindentString:function(b,c){for(var a=this.splitByLines(b),g=0;g<a.length;g++)a[g].search(c)==0&&(a[g]=a[g].substr(c.length));return a.join(this.getNewline())},replaceUnescapedSymbol:function(b,c,a){for(var g=0,e=b.length,j=c.length,f=0;g<e;)if(b.charAt(g)=="\\")g+=j+1;else if(b.substr(g,j)==c){var h=j;f++;var i=a;if(d.isFunction(a))(i=a(b,c,g,
|
|
|
|
|
f))?(h=i[0].length,i=i[1]):i=!1;i===!1?g++:(b=b.substring(0,g)+i+b.substring(g+h),e=b.length,g+=i.length)}else g++;return b},replaceVariables:function(b,c){var c=c||{},a=d.isFunction(c)?c:function(a,b){return b in c?c[b]:null},g=f("resources");return f("tabStops").processText(b,{variable:function(b){var c=a(b.token,b.name,b);c===null&&(c=g.getVariable(b.name));if(c===null||d.isUndefined(c))c=b.token;return c}})},replaceCounter:function(b,c,a){b=String(b);c=String(c);/^\-?\d+$/.test(c)&&(c=+c);var g=
|
|
|
|
|
this;return this.replaceUnescapedSymbol(b,"$",function(b,j,f){if(b.charAt(f+1)=="{"||g.isNumeric(b.charAt(f+1)))return!1;for(j=f+1;b.charAt(j)=="$"&&b.charAt(j+1)!="{";)j++;var h=j-f,i=0,m=!1,p;if(p=b.substr(j).match(/^@(\-?)(\d*)/))j+=p[0].length,p[1]&&(m=!0),i=parseInt(p[2]||1)-1;m&&a&&d.isNumber(c)&&(c=a-c+1);c+=i;return[b.substring(f,j),g.zeroPadString(c+"",h)]})},matchesTag:function(b){return this.reTag.test(b||"")},escapeText:function(b){return b.replace(/([\$\\])/g,"\\$1")},unescapeText:function(b){return b.replace(/\\(.)/g,
|
|
|
|
|
"$1")},getCaretPlaceholder:function(){return d.isFunction(i)?i.apply(this,arguments):i},setCaretPlaceholder:function(b){i=b},getLinePadding:function(b){return(b.match(/^(\s+)/)||[""])[0]},getLinePaddingFromPosition:function(b,c){return this.getLinePadding(this.findNewlineBounds(b,c).substring(b))},escapeForRegexp:function(b){return b.replace(RegExp("[.*+?|()\\[\\]{}\\\\]","g"),"\\$&")},prettifyNumber:function(b,c){return b.toFixed(typeof c=="undefined"?2:c).replace(/\.?0+$/,"")},stringBuilder:function(b){return new h(b)},
|
|
|
|
|
replaceSubstring:function(b,c,a,g){if(d.isObject(a)&&"end"in a)g=a.end,a=a.start;d.isString(g)&&(g=a+g.length);d.isUndefined(g)&&(g=a);return a<0||a>b.length?b:b.substring(0,a)+c+b.substring(g)},narrowToNonSpace:function(b,c,a){c=f("range").create(c,a);for(a=/[\s\n\r\u00a0]/;c.start<c.end;){if(!a.test(b.charAt(c.start)))break;c.start++}for(;c.end>c.start;)if(c.end--,!a.test(b.charAt(c.end))){c.end++;break}return c},findNewlineBounds:function(b,c){for(var a=b.length,g=0,e=a-1,d=c-1;d>0;d--){var h=
|
|
|
|
|
b.charAt(d);if(h=="\n"||h=="\r"){g=d+1;break}}for(d=c;d<a;d++)if(h=b.charAt(d),h=="\n"||h=="\r"){e=d;break}return f("range").create(g,e-g)},deepMerge:function(){var b,c,a,g,e,j=arguments[0]||{},f=1,h=arguments.length;for(!d.isObject(j)&&!d.isFunction(j)&&(j={});f<h;f++)if((b=arguments[f])!=null)for(c in b)a=j[c],g=b[c],j!==g&&(g&&(d.isObject(g)||(e=d.isArray(g)))?(e?(e=!1,a=a&&d.isArray(a)?a:[]):a=a&&d.isObject(a)?a:{},j[c]=this.deepMerge(a,g)):g!==void 0&&(j[c]=g));return j}}});
|
|
|
|
|
emmet.define("range",function(f,d){function h(b,c,a){switch(a){case "eq":case "==":return b===c;case "lt":case "<":return b<c;case "lte":case "<=":return b<=c;case "gt":case ">":return b>c;case "gte":case ">=":return b>=c}}function i(b,c){d.isObject(b)&&"start"in b?(this.start=Math.min(b.start,b.end),this.end=Math.max(b.start,b.end)):d.isArray(b)?(this.start=b[0],this.end=b[1]):(c=d.isString(c)?c.length:+c,this.start=b,this.end=b+c)}i.prototype={length:function(){return Math.abs(this.end-this.start)},
|
|
|
|
|
equal:function(b){return this.cmp(b,"eq","eq")},shift:function(b){this.start+=b;this.end+=b;return this},overlap:function(b){return b.start<=this.end&&b.end>=this.start},intersection:function(b){if(this.overlap(b)){var c=Math.max(b.start,this.start);return new i(c,Math.min(b.end,this.end)-c)}return null},union:function(b){if(this.overlap(b)){var c=Math.min(b.start,this.start);return new i(c,Math.max(b.end,this.end)-c)}return null},inside:function(b){return this.cmp(b,"lte","gt")},contains:function(b){return this.cmp(b,
|
|
|
|
|
"lt","gt")},include:function(){return this.cmp(loc,"lte","gte")},cmp:function(b,c,a){var g;b instanceof i?(g=b.start,b=b.end):g=b;return h(this.start,g,c||"<=")&&h(this.end,b,a||">")},substring:function(b){return this.length()>0?b.substring(this.start,this.end):""},clone:function(){return new i(this.start,this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return"{"+this.start+", "+this.length()+"}"}};return{create:function(b,c){if(d.isUndefined(b)||b===null)return null;
|
|
|
|
|
if(b instanceof i)return b;if(d.isObject(b)&&"start"in b&&"end"in b)c=b.end-b.start,b=b.start;return new i(b,c)},create2:function(b,c){d.isNumber(b)&&d.isNumber(c)&&(c-=b);return this.create(b,c)}}});
|
|
|
|
|
emmet.define("handlerList",function(f,d){function h(){this._list=[]}h.prototype={add:function(f,b){this._list.push(d.extend({order:0},b||{},{fn:f}))},remove:function(f){this._list=d.without(this._list,d.find(this._list,function(b){return b.fn===f}))},list:function(){return d.sortBy(this._list,"order").reverse()},listFn:function(){return d.pluck(this.list(),"fn")},exec:function(f,b){var b=b||[],c=null;d.find(this.list(),function(a){c=a.fn.apply(a,b);if(c!==f)return!0});return c}};return{create:function(){return new h}}});
|
|
|
|
|
emmet.define("tokenIterator",function(f,d){function h(d){this.tokens=d;this._position=0;this.reset()}h.prototype={next:function(){if(this.hasNext()){var d=this.tokens[++this._i];this._position=d.start;return d}return null},current:function(){return this.tokens[this._i]},position:function(){return this._position},hasNext:function(){return this._i<this._il-1},reset:function(){this._i=-1;this._il=this.tokens.length},item:function(){return this.tokens[this._i]},itemNext:function(){return this.tokens[this._i+
|
|
|
|
|
1]},itemPrev:function(){return this.tokens[this._i-1]},nextUntil:function(f,b){for(var c,a=d.isString(f)?function(a){return a.type==f}:f;c=this.next();)if(b&&b.call(this,c),a.call(this,c))break}};return{create:function(d){return new h(d)}}});
|
|
|
|
|
emmet.define("stringStream",function(){function f(d){this.pos=this.start=0;this.string=d}f.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(d){var f=this.string.charAt(this.pos);if(typeof d=="string"?f==d:f&&(d.test?d.test(f):d(f)))return++this.pos,f},eatWhile:function(d){for(var f=this.pos;this.eat(d););
|
|
|
|
|
return this.pos>f},eatSpace:function(){for(var d=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>d},skipToEnd:function(){this.pos=this.string.length},skipTo:function(d){d=this.string.indexOf(d,this.pos);if(d>-1)return this.pos=d,!0},skipToPair:function(d,f){for(var i=0,b,c=this.pos,a=this.string.length;c<a;)if(b=this.string.charAt(c++),b==d)i++;else if(b==f&&(i--,i<1))return this.pos=c,!0;return!1},backUp:function(d){this.pos-=d},match:function(d,f,i){if(typeof d==
|
|
|
|
|
"string"){if(i=i?function(b){return b.toLowerCase()}:function(b){return b},i(this.string).indexOf(i(d),this.pos)==this.pos)return f!==!1&&(this.pos+=d.length),!0}else return(d=this.string.slice(this.pos).match(d))&&f!==!1&&(this.pos+=d[0].length),d},current:function(){return this.string.slice(this.start,this.pos)}};return{create:function(d){return new f(d)}}});
|
|
|
|
|
emmet.define("resources",function(f,d){function h(a,c,g){var d=f("utils"),c=d.replaceUnescapedSymbol(c,"|",d.getCaretPlaceholder());if(g=="snippets")return f("elements").create("snippet",c);if(g=="abbreviations"){g=c;f("utils").trim(a);var a=f("elements"),h;return(h=b.exec(g))?a.create("element",h[1],h[2],h[4]=="/"):a.create("reference",g)}}var i={},b=/^<(\w+\:?[\w\-]*)((?:\s+[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/,c={},a={},g=f("handlerList").create();return{setVocabulary:function(b,g){i={};g==
|
|
|
|
|
"system"?c=b:a=b},getVocabulary:function(b){return b=="system"?c:a},getMatchedResource:function(a,b){return g.exec(null,d.toArray(arguments))||this.findSnippet(b,a.name())},getVariable:function(a){return(this.getSection("variables")||{})[a]},setVariable:function(a,b){var c=this.getVocabulary("user")||{};if(!("variables"in c))c.variables={};c.variables[a]=b;this.setVocabulary(c,"user")},hasSyntax:function(a){return a in this.getVocabulary("user")||a in this.getVocabulary("system")},addResolver:function(a,
|
|
|
|
|
b){g.add(a,b)},removeResolver:function(a){g.remove(a)},getSection:function(b){if(!b)return null;b in i||(i[b]=f("utils").deepMerge({},c[b],a[b]));for(var g=i[b],h=d.rest(arguments),o;g&&(o=h.shift());)if(o in g)g=g[o];else return null;return g},findItem:function(a,b){for(var c=this.getSection(a);c;){if(b in c)return c[b];c=this.getSection(c["extends"])}},findSnippet:function(a,b,c){if(!a||!b)return null;var c=c||[],g=[b];~b.indexOf("-")&&g.push(b.replace(/\-/g,":"));var f=this.getSection(a),i=null;
|
|
|
|
|
d.find(["snippets","abbreviations"],function(b){var c=this.getSection(a,b);if(c)return d.find(g,function(a){if(c[a])return i=h(a,c[a],b)})},this);c.push(a);return!i&&f["extends"]&&!d.include(c,f["extends"])?this.findSnippet(f["extends"],b,c):i},fuzzyFindSnippet:function(a,b,c){var c=c||0.3,a=this.getAllSnippets(a),g=f("string-score"),b=b.replace(/:$/,"").replace(/:/g,"-"),h=d.map(a,function(a,c){return{key:c,score:g.score(a.nk,b,0.1)}});if((h=d.last(d.sortBy(h,"score")))&&h.score>=c)return a[h.key].parsedValue},
|
|
|
|
|
getAllSnippets:function(a){var b="all-"+a;if(!i[b]){var c=[],g=[];do{var f=this.getSection(a);if(!f)break;d.each(["snippets","abbreviations"],function(a){var b={};d.each(f[a]||null,function(c,g){b[g]={nk:g.replace(/:$/,"").replace(/:/g,"-"),value:c,parsedValue:h(g,c,a),type:a}});c.push(b)});g.push(a);a=f["extends"]}while(a&&!d.include(g,a));i[b]=d.extend.apply(d,c.reverse())}return i[b]}}});
|
|
|
|
|
emmet.define("actions",function(f,d){function h(b){return f("utils").trim(b.charAt(0).toUpperCase()+b.substring(1).replace(/_[a-z]/g,function(b){return" "+b.charAt(1).toUpperCase()}))}var i={};return{add:function(b,c,a){b=b.toLowerCase();a=a||{};if(!a.label)a.label=h(b);i[b]={name:b,fn:c,options:a}},get:function(b){return i[b.toLowerCase()]},run:function(b,c){d.isArray(c)||(c=d.rest(arguments));var a=this.get(b);return a?a.fn.apply(emmet,c):(emmet.log('Action "%s" is not defined',b),!1)},getAll:function(){return i},
|
|
|
|
|
getList:function(){return d.values(this.getAll())},getMenu:function(b){var c=[],b=b||[];d.each(this.getList(),function(a){if(!a.options.hidden&&!d.include(b,a.name)){var g=h(a.name),e=c;if(a.options.label)for(var j=a.options.label.split("/"),g=j.pop(),f,i;f=j.shift();)i=d.find(e,function(a){return a.type=="submenu"&&a.name==f}),i||(i={name:f,type:"submenu",items:[]},e.push(i)),e=i.items;e.push({type:"action",name:a.name,label:g})}});return c},getActionNameForMenuTitle:function(b,c){var a=null;d.find(c||
|
|
|
|
|
this.getMenu(),function(c){if(c.type=="action"){if(c.label==b||c.name==b)return a=c.name}else return a=this.getActionNameForMenuTitle(b,c.items)},this);return a||null}}});
|
|
|
|
|
emmet.define("profile",function(f,d){function h(a){d.extend(this,g,a)}function i(a,b){switch(String(b||"").toLowerCase()){case "lower":return a.toLowerCase();case "upper":return a.toUpperCase()}return a}function b(b,c){return a[b.toLowerCase()]=new h(c)}function c(){b("xhtml");b("html",{self_closing_tag:!1});b("xml",{self_closing_tag:!0,tag_nl:!0});b("plain",{tag_nl:!1,indent:!1,place_cursor:!1});b("line",{tag_nl:!1,indent:!1,extraFilters:"s"})}var a={},g={tag_case:"asis",attr_case:"asis",attr_quotes:"double",
|
|
|
|
|
tag_nl:"decide",tag_nl_leaf:!1,place_cursor:!0,indent:!0,inline_break:3,self_closing_tag:"xhtml",filters:"",extraFilters:""};h.prototype={tagName:function(a){return i(a,this.tag_case)},attributeName:function(a){return i(a,this.attr_case)},attributeQuote:function(){return this.attr_quotes=="single"?"'":'"'},selfClosing:function(){return this.self_closing_tag=="xhtml"?" /":this.self_closing_tag===!0?"/":""},cursor:function(){return this.place_cursor?f("utils").getCaretPlaceholder():""}};c();return{create:function(a,
|
|
|
|
|
c){return arguments.length==2?b(a,c):new h(d.defaults(a||{},g))},get:function(b,c){if(!b&&c){var g=f("resources").findItem(c,"profile");g&&(b=g)}return!b?a.plain:b instanceof h?b:d.isString(b)&&b.toLowerCase()in a?a[b.toLowerCase()]:this.create(b)},remove:function(b){b=(b||"").toLowerCase();b in a&&delete a[b]},reset:function(){a={};c()},stringCase:i}});
|
|
|
|
|
emmet.define("editorUtils",function(f){return{isInsideTag:function(d,f){for(var i=/^<\/?\w[\w\:\-]*.*?>/,b=f;b>-1;){if(d.charAt(b)=="<")break;b--}return b!=-1&&(i=i.exec(d.substring(b)))&&f>b&&f<b+i[0].length?!0:!1},outputInfo:function(d,f,i){i=i||d.getProfileName();return{syntax:String(f||d.getSyntax()),profile:i?String(i):null,content:String(d.getContent())}},unindent:function(d,h){return f("utils").unindentString(h,this.getCurrentLinePadding(d))},getCurrentLinePadding:function(d){return f("utils").getLinePadding(d.getCurrentLine())}}});
|
|
|
|
|
emmet.define("actionUtils",function(f){return{mimeTypes:{gif:"image/gif",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml",html:"text/html",htm:"text/html"},extractAbbreviation:function(d){for(var h=d.length,i=-1,b=0,c=0,a=0,g=f("utils"),e=f("abbreviationParser");;){h--;if(h<0){i=0;break}var j=d.charAt(h);if(j=="]")c++;else if(j=="["){if(!c){i=h+1;break}c--}else if(j=="}")a++;else if(j=="{"){if(!a){i=h+1;break}a--}else if(j==")")b++;else if(j=="("){if(!b){i=h+1;break}b--}else if(!c&&
|
|
|
|
|
!a&&(!e.isAllowedChar(j)||j==">"&&g.endsWithTag(d.substring(0,h+1)))){i=h+1;break}}return i!=-1&&!a&&!c&&!b?d.substring(i).replace(/^[\*\+\>\^]+/,""):""},getImageSize:function(d){var f=function(){return d.charCodeAt(i++)};if(d.substr(0,8)==="\u0089PNG\r\n\u001a\n"){var i=d.indexOf("IHDR")+4;return{width:f()<<24|f()<<16|f()<<8|f(),height:f()<<24|f()<<16|f()<<8|f()}}else if(d.substr(0,4)==="GIF8")return i=6,{width:f()|f()<<8,height:f()|f()<<8};else if(d.substr(0,2)==="\u00ff\u00d8")for(var i=2,b=d.length;i<
|
|
|
|
|
b;){if(f()!=255)break;var c=f();if(c==218)break;var a=f()<<8|f();if(c>=192&&c<=207&&!(c&4)&&!(c&8))return i+=1,{height:f()<<8|f(),width:f()<<8|f()};else i+=a-2}},captureContext:function(d){if(String(d.getSyntax())in{html:1,xml:1,xsl:1}){var h=String(d.getContent()),i=f("htmlMatcher").find(h,d.getCaretPos());if(i&&i.type=="tag"){for(var d=/([\w\-:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,i=i.open,h=i.range.substring(h).replace(/^<[\w\-\:]+/,""),i={name:i.name,attributes:[]},
|
|
|
|
|
b;b=d.exec(h);)i.attributes.push({name:b[1],value:b[2]});return i}}return null},findExpressionBounds:function(d,h){for(var i=String(d.getContent()),b=i.length,c=d.getCaretPos()-1,a=c+1;c>=0&&h(i.charAt(c),c,i);)c--;for(;a<b&&h(i.charAt(a),a,i);)a++;if(a>c)return f("range").create([++c,a])},compoundUpdate:function(d,f){if(f){var i=d.getSelectionRange();d.replaceContent(f.data,f.start,f.end,!0);d.createSelection(f.caret,f.caret+i.end-i.start);return!0}return!1},detectSyntax:function(d,h){var i=h||"html";
|
|
|
|
|
f("resources").hasSyntax(i)||(i="html");if(i=="html"&&(this.isStyle(d)||this.isInlineCSS(d)))i="css";return i},detectProfile:function(d){var h=d.getSyntax(),i=f("resources").findItem(h,"profile");if(i)return i;switch(h){case "xml":case "xsl":return"xml";case "css":if(this.isInlineCSS(d))return"line";break;case "html":return(i=f("resources").getVariable("profile"))||(i=this.isXHTML(d)?"xhtml":"html"),i}return"xhtml"},isXHTML:function(d){return d.getContent().search(/<!DOCTYPE[^>]+XHTML/i)!=-1},isStyle:function(d){var h=
|
|
|
|
|
String(d.getContent()),d=d.getCaretPos();return(h=f("htmlMatcher").tag(h,d))&&h.open.name.toLowerCase()=="style"&&h.innerRange.cmp(d,"lte","gte")},isInlineCSS:function(d){var h=String(d.getContent()),d=d.getCaretPos();return(h=f("xmlEditTree").parseFromPosition(h,d,!0))?(h=h.itemFromPosition(d,!0))&&h.name().toLowerCase()=="style"&&h.valueRange(!0).cmp(d,"lte","gte"):!1}}});
|
|
|
|
|
emmet.define("abbreviationUtils",function(f,d){return{isSnippet:function(d){return f("elements").is(d.matchedResource(),"snippet")},isUnary:function(d){var i=d.matchedResource();return d.children.length||this.isSnippet(d)?!1:i&&i.is_empty||f("tagName").isEmptyElement(d.name())},isInline:function(d){return d.isTextNode()||!d.name()||f("tagName").isInlineLevel(d.name())},isBlock:function(d){return this.isSnippet(d)||!this.isInline(d)},isSnippet:function(d){return f("elements").is(d.matchedResource(),
|
|
|
|
|
"snippet")},hasTagsInContent:function(d){return f("utils").matchesTag(d.content)},hasBlockChildren:function(f){return this.hasTagsInContent(f)&&this.isBlock(f)||d.any(f.children,function(d){return this.isBlock(d)},this)},insertChildContent:function(h,i,b){var b=d.extend({keepVariable:!0,appendIfNoChild:!0},b||{}),c=!1,a=f("utils"),h=a.replaceVariables(h,function(g,e,d){var f=g;e=="child"&&(f=a.padString(i,a.getLinePaddingFromPosition(h,d.start)),c=!0,b.keepVariable&&(f+=g));return f});!c&&b.appendIfNoChild&&
|
|
|
|
|
(h+=i);return h}}});
|
|
|
|
|
emmet.define("base64",function(){return{encode:function(f){for(var d=[],h,i,b,c,a,g,e=0,j=f.length;e<j;)c=f.charCodeAt(e++),a=f.charCodeAt(e++),g=f.charCodeAt(e++),h=c&255,i=a&255,b=g&255,c=h>>2,h=(h&3)<<4|i>>4,i=(i&15)<<2|b>>6,b&=63,isNaN(a)?i=b=64:isNaN(g)&&(b=64),d.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(i)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b));
|
|
|
|
|
return d.join("")},decode:function(f){var d,h,i,b,c,a=0,g=0,e=[],j=f.length;if(!f)return f;f+="";do d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(f.charAt(a++)),h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(f.charAt(a++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(f.charAt(a++)),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(f.charAt(a++)),i=d<<18|h<<12|b<<6|c,d=i>>16&
|
|
|
|
|
255,h=i>>8&255,i&=255,b==64?e[g++]=String.fromCharCode(d):c==64?e[g++]=String.fromCharCode(d,h):e[g++]=String.fromCharCode(d,h,i);while(a<j);return e.join("")}}});
|
|
|
|
|
emmet.define("htmlMatcher",function(f,d){function h(b){var e={},d;return{open:function(a){return(a=this.matches(a))&&a.type=="open"?a:null},close:function(a){return(a=this.matches(a))&&a.type=="close"?a:null},matches:function(h){var i="p"+h;if(!(i in e)&&b.charAt(h)=="<"){var l=b.slice(h);e[i]=(d=l.match(c))?{name:d[1],selfClose:!!d[3],range:f("range").create(h,d[0]),type:"open"}:(d=l.match(a))?{name:d[1],range:f("range").create(h,d[0]),type:"close"}:!1}return e[i]},text:function(){return b}}}function i(a,
|
|
|
|
|
b,c){return a.substring(b,b+c.length)==c}function b(a,b){for(var c=[],f=null,h=b.text(),l=a.range.end,m=h.length;l<m;l++){if(i(h,l,"<\!--"))for(f=l;f<m;f++)if(i(h,f,"--\>")){l=f+3;break}if(f=b.matches(l))if(f.type=="open"&&!f.selfClose)c.push(f.name);else if(f.type=="close"){if(!c.length)return f.name==a.name?f:null;if(d.last(c)==f.name)c.pop();else{for(var p=!1;c.length&&!p;)c.pop()==f.name&&(p=!0);if(!c.length&&!p)return f.name==a.name?f:null}}}}var c=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
|
|
|
|
|
a=/^<\/([\w\:\-]+)[^>]*>/;return{find:function(a,c){for(var j=f("range"),n=h(a),o=null,l=null,m=c;m>=0;m--)if(o=n.open(m))if(o.selfClose){if(o.range.cmp(c,"lt","gt"))break}else{if(l=b(o,n)){if(j.create2(o.range.start,l.range.end).contains(c))break}else if(o.range.contains(c))break;o=null}else if(i(a,m,"--\>"))for(var p=m-1;p>=0;p--)if(i(a,p,"--\>"))break;else{if(i(a,p,"<\!--")){m=p;break}}else if(i(a,m,"<\!--")){p=m+4;for(o=a.length;p<o;p++)if(i(a,p,"--\>")){p+=3;break}o={range:f("range").create(m,
|
|
|
|
|
d.isNumber(p)?p-m:p[0]),type:"comment"};break}if(o)return p=m=null,l?(m=j.create2(o.range.start,l.range.end),p=j.create2(o.range.end,l.range.start)):m=p=j.create2(o.range.start,o.range.end),o.type=="comment"&&(j=m.substring(a),p.start+=j.length-j.replace(/^<\!--\s*/,"").length,p.end-=j.length-j.replace(/\s*--\>$/,"").length),{open:o,close:l,type:o.type=="comment"?"comment":"tag",innerRange:p,innerContent:function(){return this.innerRange.substring(a)},outerRange:m,outerContent:function(){return this.outerRange.substring(a)},
|
|
|
|
|
range:!p.length()||!p.cmp(c,"lte","gte")?m:p,content:function(){return this.range.substring(a)},source:a}},tag:function(a,b){var c=this.find(a,b);if(c&&c.type=="tag")return c}}});
|
|
|
|
|
emmet.define("tabStops",function(f,d){var h=100,i=0,b={replaceCarets:!1,escape:function(b){return"\\"+b},tabstop:function(b){return b.token},variable:function(b){return b.token}};f("abbreviationParser").addOutputProcessor(function(b,a){var g=0,e=f("tabStops"),d=f("utils"),h={tabstop:function(a){var b=parseInt(a.group);if(b==0)return"${0}";b>g&&(g=b);return a.placeholder?(b+=i,a=e.processText(a.placeholder,h),"${"+b+":"+a+"}"):"${"+(b+i)+"}"}},b=e.processText(b,h),b=d.replaceVariables(b,e.variablesResolver(a));
|
|
|
|
|
i+=g+1;return b});return{extract:function(c,a){var g=f("utils"),e={carets:""},j=[],a=d.extend({},b,a,{tabstop:function(a){var b=a.token,c="";if(a.placeholder=="cursor")j.push({start:a.start,end:a.start+b.length,group:"carets",value:""});else{if("placeholder"in a)e[a.group]=a.placeholder;a.group in e&&(c=e[a.group]);j.push({start:a.start,end:a.start+b.length,group:a.group,value:c})}return b}});a.replaceCarets&&(c=c.replace(RegExp(g.escapeForRegexp(g.getCaretPlaceholder()),"g"),"${0:cursor}"));var c=
|
|
|
|
|
this.processText(c,a),h=g.stringBuilder(),i=0,g=d.map(j,function(a){h.append(c.substring(i,a.start));var b=h.length,g=e[a.group]||"";h.append(g);i=a.end;return{group:a.group,start:b,end:b+g.length}});h.append(c.substring(i));return{text:h.toString(),tabstops:d.sortBy(g,"start")}},processText:function(c,a){for(var a=d.extend({},b,a),g=f("utils").stringBuilder(),e=f("stringStream").create(c),j,h;j=e.next();)if(j=="\\"&&!e.eol())g.append(a.escape(e.next()));else{h=j;if(j=="$")if(e.start=e.pos-1,e.match(/^[0-9]+/))h=
|
|
|
|
|
a.tabstop({start:g.length,group:e.current().substr(1),token:e.current()});else if(j=e.match(/^\{([a-z_\-][\w\-]*)\}/))h=a.variable({start:g.length,name:j[1],token:e.current()});else if(j=e.match(/^\{([0-9]+)(:.+?)?\}/,!1)){e.skipToPair("{","}");h={start:g.length,group:j[1],token:e.current()};if(j=h.token.substring(h.group.length+2,h.token.length-1))h.placeholder=j.substr(1);h=a.tabstop(h)}g.append(h)}return g.toString()},upgrade:function(b,a){var g=0,e={tabstop:function(b){var c=parseInt(b.group);
|
|
|
|
|
c>g&&(g=c);return b.placeholder?"${"+(c+a)+":"+b.placeholder+"}":"${"+(c+a)+"}"}};d.each(["start","end","content"],function(a){b[a]=this.processText(b[a],e)},this);return g},variablesResolver:function(b){var a={},g=f("resources");return function(e,j){if(j=="child")return e;if(j=="cursor")return f("utils").getCaretPlaceholder();var i=b.attribute(j);if(!d.isUndefined(i)&&i!==e)return i;if(i=g.getVariable(j))return i;a[j]||(a[j]=h++);return"${"+a[j]+":"+j+"}"}},resetTabstopIndex:function(){i=0;h=100}}});
|
|
|
|
|
emmet.define("preferences",function(f,d){var h={},i={},b=null,c=null;return{define:function(a,b,c){var f=a;d.isString(a)&&(f={},f[a]={value:b,description:c});d.each(f,function(a,b){i[b]=d.isObject(a)&&"value"in a&&d.keys(a).length<3?a:{value:a}})},set:function(a,b){var c=a;d.isString(a)&&(c={},c[a]=b);d.each(c,function(a,b){if(!(b in i))throw'Property "'+b+'" is not defined. You should define it first with `define` method of current module';if(a!==i[b].value){switch(typeof i[b].value){case "boolean":var c=
|
|
|
|
|
a;d.isString(c)?(c=c.toLowerCase(),a=c=="yes"||c=="true"||c=="1"):a=!!c;break;case "number":a=parseInt(a+"",10)||0;break;default:a+=""}h[b]=a}else b in h&&delete h[b]})},get:function(a){if(a in h)return h[a];if(a in i)return i[a].value},getArray:function(a){a=this.get(a);d.isUndefined(a)||(a=d.map(a.split(","),f("utils").trim),a.length||(a=null));return a},getDict:function(a){var b={};d.each(this.getArray(a),function(a){a=a.split(":");b[a[0]]=a[1]});return b},description:function(a){return a in i?
|
|
|
|
|
i[a].description:void 0},remove:function(a){d.isArray(a)||(a=[a]);d.each(a,function(a){a in h&&delete h[a];a in i&&delete i[a]})},list:function(){return d.map(d.keys(i).sort(),function(a){return{name:a,value:this.get(a),type:typeof i[a].value,description:i[a].description}},this)},load:function(a){d.each(a,function(a,b){this.set(b,a)},this)},exportModified:function(){return d.clone(h)},reset:function(){h={}},_startTest:function(){b=i;c=h;i={};h={}},_stopTest:function(){i=b;h=c}}});
|
|
|
|
|
emmet.define("filters",function(f,d){function h(b){return!b?[]:d.isString(b)?b.split(/[\|,]/g):b}var i={};return{add:function(b,c){i[b]=c},apply:function(b,c,a){var g=f("utils"),a=f("profile").get(a);d.each(h(c),function(c){(c=g.trim(c.toLowerCase()))&&c in i&&(b=i[c](b,a))});return b},composeList:function(b,c,a){c=f("profile").get(c);b=h(c.filters||f("resources").findItem(b,"filters")||"html");c.extraFilters&&(b=b.concat(h(c.extraFilters)));a&&(b=b.concat(h(a)));if(!b||!b.length)b=h("html");return b},
|
|
|
|
|
extractFromAbbreviation:function(b){var c="",b=b.replace(/\|([\w\|\-]+)$/,function(a,b){c=b;return""});return[b,h(c)]}}});
|
|
|
|
|
emmet.define("elements",function(f,d){function h(a){return{data:a}}var i={},b=/([\w\-]+)\s*=\s*(['"])(.*?)\2/g,c={add:function(a,b){var c=this;i[a]=function(){var d=b.apply(c,arguments);if(d)d.type=a;return d}},get:function(a){return i[a]},create:function(a){var b=[].slice.call(arguments,1),c=this.get(a);return c?c.apply(this,b):null},is:function(a,b){return a&&a.type===b}};c.add("element",function(a,c,e){var f={name:a,is_empty:!!e};if(c)if(f.attributes=[],d.isArray(c))f.attributes=c;else if(d.isString(c))for(;a=
|
|
|
|
|
b.exec(c);)f.attributes.push({name:a[1],value:a[3]});else d.each(c,function(a,b){f.attributes.push({name:b,value:a})});return f});c.add("snippet",h);c.add("reference",h);c.add("empty",function(){return{}});return c});
|
|
|
|
|
emmet.define("editTree",function(f,d,h){function i(a,b){this.options=d.extend({offset:0},b);this.source=a;this._children=[];this._positions={name:0};this.initialize.apply(this,arguments)}function b(a,b,c){this.parent=a;this._name=b.value;this._value=c?c.value:"";this._positions={name:b.start,value:c?c.start:-1};this.initialize.apply(this,arguments)}var c=f("range").create;i.extend=h.extend;i.prototype={initialize:function(){},_updateSource:function(a,b,e){var j=c(b,d.isUndefined(e)?0:e-b),h=a.length-
|
|
|
|
|
j.length(),i=function(a){d.each(a,function(b,c){b>=j.end&&(a[c]+=h)})};i(this._positions);d.each(this.list(),function(a){i(a._positions)});this.source=f("utils").replaceSubstring(this.source,a,j)},add:function(a,c){var d=new b(a,c);this._children.push(d);return d},get:function(a){return d.isNumber(a)?this.list()[a]:d.isString(a)?d.find(this.list(),function(b){return b.name()===a}):a},getAll:function(a){d.isArray(a)||(a=[a]);var b=[],c=[];d.each(a,function(a){d.isString(a)?b.push(a):d.isNumber(a)&&
|
|
|
|
|
c.push(a)});return d.filter(this.list(),function(a,f){return d.include(c,f)||d.include(b,a.name())})},value:function(a,b,c){var f=this.get(a);if(f)return f.value(b);if(!d.isUndefined(b))return this.add(a,b,c)},values:function(a){return d.map(this.getAll(a),function(a){return a.value()})},remove:function(a){if(a=this.get(a))this._updateSource("",a.fullRange()),this._children=d.without(this._children,a)},list:function(){return this._children},indexOf:function(a){return d.indexOf(this.list(),this.get(a))},
|
|
|
|
|
name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this._updateSource(a,this._positions.name,this._positions.name+this._name.length),this._name=a;return this._name},nameRange:function(a){return c(this._positions.name+(a?this.options.offset:0),this.name())},range:function(a){return c(a?this.options.offset:0,this.toString())},itemFromPosition:function(a,b){return d.find(this.list(),function(c){return c.range(b).inside(a)})},toString:function(){return this.source}};b.extend=h.extend;b.prototype=
|
|
|
|
|
{initialize:function(){},_pos:function(a,b){return a+(b?this.parent.options.offset:0)},value:function(a){if(!d.isUndefined(a)&&this._value!==(a=String(a)))this.parent._updateSource(a,this.valueRange()),this._value=a;return this._value},name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this.parent._updateSource(a,this.nameRange()),this._name=a;return this._name},namePosition:function(a){return this._pos(this._positions.name,a)},valuePosition:function(a){return this._pos(this._positions.value,
|
|
|
|
|
a)},range:function(a){return c(this.namePosition(a),this.toString())},fullRange:function(a){return this.range(a)},nameRange:function(a){return c(this.namePosition(a),this.name())},valueRange:function(a){return c(this.valuePosition(a),this.value())},toString:function(){return this.name()+this.value()},valueOf:function(){return this.toString()}};return{EditContainer:i,EditElement:b,createToken:function(a,b,c){a={start:a||0,value:b||"",type:c};a.end=a.start+a.value.length;return a}}});
|
|
|
|
|
emmet.define("cssEditTree",function(f,d){function h(a,b){return f("range").create(a,b)}function i(a,b){var b=b||g|e,c=["white","line"];if((b&e)==e)for(;a.length&&d.include(c,d.last(a).type);)a.pop();if((b&g)==g)for(;a.length&&d.include(c,a[0].type);)a.shift();return a}function b(a){var b=["white","line",":"],c=[],f,j;a.nextUntil(function(){return!d.include(b,this.itemNext().type)});for(j=a.current().end;f=a.next();){if(f.type=="}"||f.type==";")return i(c,g|(f.type=="}"?e:0)),c.length?(j=c[0].start,
|
|
|
|
|
a=d.last(c).end):a=j,h(j,a-j);c.push(f)}if(c.length)return h(c[0].start,d.last(c).end-c[0].start)}function c(a){var b=f("stringStream").create(a),c=[],g=/[\s\u00a0,]/,e=function(){b.next();c.push(h(b.start,b.current()));b.start=b.pos};b.eatSpace();for(b.start=b.pos;a=b.next();)if(a=='"'||a=="'"){b.next();if(!b.skipTo(a))break;e()}else if(a=="("){b.backUp(1);if(!b.skipToPair("(",")"))break;b.backUp(1);e()}else if(g.test(a))c.push(h(b.start,b.current().length-1)),b.eatWhile(g),b.start=b.pos;e();return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,
|
|
|
|
|
function(a){return a.toString()}).value()}var a={styleBefore:"\n\t",styleSeparator:": ",offset:0},g=1,e=2,j=f("editTree").EditContainer.extend({initialize:function(c){d.defaults(this.options,a);var g=f("editTree"),e=f("tokenIterator").create(f("cssParser").parse(c)),j,r=[],q;for(j=e.position();q=e.next();){if(q.type=="{")break;r.push(q)}i(r);r.length?(j=r[0].start,r=d.last(r).end):r=j;j=h(j,r-j);this._positions.name=j.start;this._name=j.substring(c);if(!e.current()||e.current().type!="{")throw"Invalid CSS rule";
|
|
|
|
|
for(this._positions.contentStart=e.position()+1;j=e.next();){if(r=j.type=="identifier")a:{r=e.tokens;q=e._i+1;for(var u=r.length;q<u;q++){if(r[q].type==":"){r=!0;break a}if(r[q].type=="identifier"||r[q].type=="line"){r=!1;break a}}r=!1}r&&(j=h(j),r=b(e),q=e.current()&&e.current().type==";"?h(e.current()):h(r.end,0),this._children.push(new n(this,g.createToken(j.start,j.substring(c)),g.createToken(r.start,r.substring(c)),g.createToken(q.start,q.substring(c)))))}this._saveStyle()},_saveStyle:function(){var a=
|
|
|
|
|
this._positions.contentStart,b=this.source,c=f("utils");d.each(this.list(),function(g){g.styleBefore=b.substring(a,g.namePosition());var e=c.splitByLines(g.styleBefore);if(e.length>1)g.styleBefore="\n"+d.last(e);g.styleSeparator=b.substring(g.nameRange().end,g.valuePosition());g.styleBefore=d.last(g.styleBefore.split("*/"));g.styleSeparator=g.styleSeparator.replace(/\/\*.*?\*\//g,"");a=g.range().end})},add:function(a,b,c){var g=this.list(),e=this._positions.contentStart,j=d.pick(this.options,"styleBefore",
|
|
|
|
|
"styleSeparator"),h=f("editTree");if(d.isUndefined(c))c=g.length;var i=g[c];if(i)e=i.fullRange().start;else if(i=g[c-1])i.end(";"),e=i.range().end;i&&(j=d.pick(i,"styleBefore","styleSeparator"));a=h.createToken(e+j.styleBefore.length,a);b=h.createToken(a.end+j.styleSeparator.length,b);h=new n(this,a,b,h.createToken(b.end,";"));d.extend(h,j);this._updateSource(h.styleBefore+h.toString(),e);this._children.splice(c,0,h);return h}}),n=f("editTree").EditElement.extend({initialize:function(a,b,c,g){this.styleBefore=
|
|
|
|
|
a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;this._end=g.value;this._positions.end=g.start},valueParts:function(a){var b=c(this.value());if(a){var g=this.valuePosition(!0);d.each(b,function(a){a.shift(g)})}return b},end:function(a){if(!d.isUndefined(a)&&this._end!==a)this.parent._updateSource(a,this._positions.end,this._positions.end+this._end.length),this._end=a;return this._end},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
|
|
|
|
this.styleSeparator+this.value()+this.end()}});return{parse:function(a,b){return new j(a,b)},parseFromPosition:function(a,b,c){c=this.extractRule(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractRule:function(a,b,c){for(var g="",d=a.length,e=-1,j;b>=0;){j=a.charAt(b);if(j=="{"){e=b;break}else if(j=="}"&&!c){b++;break}b--}for(;b<d;){j=a.charAt(b);if(j=="{")e=b;else if(j=="}"){e!=-1&&(g=a.substring(e,b+1));break}b++}if(g){b=e-1;for(c="";b>=0;){j=a.charAt(b);if("{}/\\<>\n\r".indexOf(j)!=
|
|
|
|
|
-1)break;b--}c=a.substring(b+1,e).replace(/^[\s\n\r]+/m,"");return f("range").create(e-c.length,g.length+c.length)}return null},baseName:function(a){return a.replace(/^\s*\-\w+\-/,"")},findParts:c}});
|
|
|
|
|
emmet.define("xmlEditTree",function(f,d){var h={styleBefore:" ",styleSeparator:"=",styleQuote:'"',offset:0},i=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/m,b=f("editTree").EditContainer.extend({initialize:function(a){d.defaults(this.options,h);this._positions.name=1;var b=null,e=f("xmlParser").parse(a),j=f("range");d.each(e,function(e){e.value=j.create(e).substring(a);switch(e.type){case "tag":if(/^<[^\/]+/.test(e.value))this._name=e.value.substring(1);
|
|
|
|
|
break;case "attribute":b&&this._children.push(new c(this,b));b=e;break;case "string":this._children.push(new c(this,b,e)),b=null}},this);b&&this._children.push(new c(this,b));this._saveStyle()},_saveStyle:function(){var a=this.nameRange().end,b=this.source;d.each(this.list(),function(c){c.styleBefore=b.substring(a,c.namePosition());if(c.valuePosition()!==-1)c.styleSeparator=b.substring(c.namePosition()+c.name().length,c.valuePosition()-c.styleQuote.length);a=c.range().end})},add:function(a,b,e){var j=
|
|
|
|
|
this.list(),h=this.nameRange().end,i=f("editTree"),l=d.pick(this.options,"styleBefore","styleSeparator","styleQuote");if(d.isUndefined(e))e=j.length;var m=j[e];if(m)h=m.fullRange().start;else if(m=j[e-1])h=m.range().end;m&&(l=d.pick(m,"styleBefore","styleSeparator","styleQuote"));b=l.styleQuote+b+l.styleQuote;a=new c(this,i.createToken(h+l.styleBefore.length,a),i.createToken(h+l.styleBefore.length+a.length+l.styleSeparator.length,b));d.extend(a,l);this._updateSource(a.styleBefore+a.toString(),h);
|
|
|
|
|
this._children.splice(e,0,a);return a}}),c=f("editTree").EditElement.extend({initialize:function(a,b,c){this.styleBefore=a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;b="";a=a.options.styleQuote;if(c)b=c.value,a=b.charAt(0),a=='"'||a=="'"?b=b.substring(1):a="",a&&b.charAt(b.length-1)==a&&(b=b.substring(0,b.length-1));this.styleQuote=a;this._value=b;this._positions.value=c?c.start+a.length:-1},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
|
|
|
|
this.styleSeparator+this.styleQuote+this.value()+this.styleQuote}});return{parse:function(a,c){return new b(a,c)},parseFromPosition:function(a,b,c){c=this.extractTag(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractTag:function(a,b,c){var d=a.length,h,o=f("range"),l=Math.min(2E3,d),m=null,p=function(b){var c;if(a.charAt(b)=="<"&&(c=a.substr(b,l).match(i)))return o.create(b,c[0])};for(h=b;h>=0;h--)if(m=p(h))break;if(m&&(m.inside(b)||c))return m;if(!m&&c)return null;
|
|
|
|
|
for(h=b;h<d;h++)if(m=p(h))return m}}});
|
|
|
|
|
emmet.define("expandAbbreviation",function(f,d){var h=f("handlerList").create(),i=null,b=f("actions");b.add("expand_abbreviation",function(b,a,g){var e=d.toArray(arguments),j=f("editorUtils").outputInfo(b,a,g);e[1]=j.syntax;e[2]=j.profile;return h.exec(!1,e)});b.add("expand_abbreviation_with_tab",function(c,a,d){var e=c.getSelection(),j=f("resources").getVariable("indentation");if(e)return d=f("utils"),a=f("range").create(c.getSelectionRange()),e=d.padString(e,j),c.replaceContent(j+"${0}",c.getCaretPos()),
|
|
|
|
|
j=f("range").create(c.getCaretPos(),a.length()),c.replaceContent(e,j.start,j.end,!0),c.createSelection(j.start,j.start+e.length),!0;b.run("expand_abbreviation",c,a,d)||c.replaceContent(j,c.getCaretPos());return!0},{hidden:!0});h.add(function(b,a,d){var e=b.getSelectionRange().end,j=i.findAbbreviation(b);return j&&(a=emmet.expandAbbreviation(j,a,d,f("actionUtils").captureContext(b)))?(b.replaceContent(a,e-j.length,e),!0):!1},{order:-1});return i={addHandler:function(b,a){h.add(b,a)},removeHandler:function(b){h.remove(b,
|
|
|
|
|
options)},findAbbreviation:function(b){var a=f("range").create(b.getSelectionRange()),d=String(b.getContent());if(a.length())return a.substring(d);b=b.getCurrentLineRange();return f("actionUtils").extractAbbreviation(d.substring(b.start,a.start))}}});
|
|
|
|
|
emmet.define("wrapWithAbbreviation",function(f){var d=null;f("actions").add("wrap_with_abbreviation",function(h,i,b,c){var b=f("editorUtils").outputInfo(h,b,c),a=f("utils"),c=f("editorUtils"),i=i||h.prompt("Enter abbreviation");if(!i)return null;var i=String(i),g=f("range").create(h.getSelectionRange());if(!g.length()){g=f("htmlMatcher").tag(b.content,g.start);if(!g)return!1;g=a.narrowToNonSpace(b.content,g.range)}a=a.escapeText(g.substring(b.content));return(i=d.wrap(i,c.unindent(h,a),b.syntax,b.profile,
|
|
|
|
|
f("actionUtils").captureContext(h)))?(h.replaceContent(i,g.start,g.end),!0):!1});return d={wrap:function(d,i,b,c,a){var g=f("filters"),e=f("utils"),b=b||emmet.defaultSyntax(),c=f("profile").get(c,b);f("tabStops").resetTabstopIndex();d=g.extractFromAbbreviation(d);return(i=f("abbreviationParser").parse(d[0],{syntax:b,pastedContent:i,contextNode:a}))?(b=g.composeList(b,c,d[1]),g.apply(i,b,c),e.replaceVariables(i.toString())):null}}});
|
|
|
|
|
emmet.exec(function(f,d){function h(b,a){var g=a-(b.options.offset||0),e=/^[\s\n\r]/;return d.find(b.list(),function(a){return a.range().end===g?e.test(b.source.charAt(g)):a.range().inside(g)})}function i(b,a,d,e){for(var j=-1,h=-1;a--;)if(b.substr(a,d.length)==d){j=a;break}if(j!=-1){a=j;for(d=b.length;d>=a++;)if(b.substr(a,e.length)==e){h=a+e.length;break}}return j!=-1&&h!=-1?f("range").create(j,h-j):null}function b(b,a,d,e){function j(b){return b.replace(RegExp("^"+p.escapeForRegexp(a)+"\\s*"),
|
|
|
|
|
function(a){l-=a.length;return""}).replace(RegExp("\\s*"+p.escapeForRegexp(d)+"$"),"")}var h=f("editorUtils"),o=h.outputInfo(b).content,l=b.getCaretPos(),m=null,p=f("utils");(m=i(o,l,a,d))&&m.overlap(e)?(e=m,m=j(e.substring(o))):(m=a+" "+e.substring(o).replace(RegExp(p.escapeForRegexp(a)+"\\s*|\\s*"+p.escapeForRegexp(d),"g"),"")+" "+d,l+=a.length+1);return m!==null?(m=p.escapeText(m),b.setCaretPos(e.start),b.replaceContent(h.unindent(b,m),e.start,e.end),b.setCaretPos(l),!0):!1}f("actions").add("toggle_comment",
|
|
|
|
|
function(c){var a=f("editorUtils").outputInfo(c);if(a.syntax=="css"){var d=c.getCaretPos(),e=f("htmlMatcher").tag(a.content,d);if(e&&e.open.range.inside(d))a.syntax="html"}if(a.syntax=="css"){e=f("range").create(c.getSelectionRange());a=f("editorUtils").outputInfo(c);if(!e.length()&&(d=f("cssEditTree").parseFromPosition(a.content,c.getCaretPos())))e=(e=h(d,c.getCaretPos()))?e.range(!0):f("range").create(d.nameRange(!0).start,d.source);e.length()||(e=f("range").create(c.getCurrentLineRange()),f("utils").narrowToNonSpace(a.content,
|
|
|
|
|
e));c=b(c,"/*","*/",e)}else{a=f("range").create(c.getSelectionRange());d=f("editorUtils").outputInfo(c);if(!a.length()&&(d=f("htmlMatcher").tag(d.content,c.getCaretPos())))a=d.outerRange;c=b(c,"<\!--","--\>",a)}return c})});
|
|
|
|
|
emmet.exec(function(f){function d(d,f,b){function c(b){for(var c=b;c>=0;){var d=a.charAt(c);if(d=="\n"||d=="\r")break;c--}return a.substring(c,b)}for(var f=f||1,b=d.getCaretPos()+(b||0),a=String(d.getContent()),d=a.length,g=-1,e=/^\s+$/;b<=d&&b>=0;){b+=f;var j=a.charAt(b),n=a.charAt(b+1),o=a.charAt(b-1);switch(j){case '"':case "'":n==j&&o=="="&&(g=b+1);break;case ">":n=="<"&&(g=b+1);break;case "\n":case "\r":e.test(c(b-1))&&(g=b)}if(g!=-1)break}return g}f=f("actions");f.add("prev_edit_point",function(f){var i=
|
|
|
|
|
f.getCaretPos(),b=d(f,-1);b==i&&(b=d(f,-1,-2));return b!=-1?(f.setCaretPos(b),!0):!1},{label:"Previous Edit Point"});f.add("next_edit_point",function(f){var i=d(f,1);return i!=-1?(f.setCaretPos(i),!0):!1})});
|
|
|
|
|
emmet.exec(function(f,d){function h(a,b,c,d){var e=f("range"),g=f("editorUtils").outputInfo(a).content,j=g.length,h,i=e.create(-1,0),m=e.create(a.getSelectionRange());h=m.start;for(var n=1E5;h>=0&&h<j&&--n>0;){if(e=c(g,h,b)){if(i.equal(e))break;i=e.clone();if(h=d(e.substring(g),e.start,m.clone()))return a.createSelection(h.start,h.end),!0;else h=b?e.start:e.end-1}h+=b?-1:1}return!1}function i(a){var b=!0;return h(a,!1,function(a,c){if(b){b=!1;var d;a:{d=c;for(var g;d>=0;){if(g=e(a,d)){d=g;break a}d--}d=
|
|
|
|
|
null}return d}else return e(a,c)},function(a,b,c){return g(a,b,c,!1)})}function b(a){return h(a,!0,e,function(a,b,c){return g(a,b,c,!0)})}function c(b,c,e){var e=e||0,g=f("range"),h=[],k=-1,i="",m="",n,l;d.each(c,function(c){switch(c.type){case "tag":l=b.substring(c.start,c.end);/^<[\w\:\-]/.test(l)&&h.push(g.create({start:c.start+1,end:c.end}));break;case "attribute":k=c.start;i=b.substring(c.start,c.end);break;case "string":h.push(g.create(k,c.end-k)),n=g.create(c),m=n.substring(b),j(m.charAt(0))&&
|
|
|
|
|
n.start++,j(m.charAt(m.length-1))&&n.end--,h.push(n),i=="class"&&(h=h.concat(a(n.substring(b),n.start)))}});d.each(h,function(a){a.shift(e)});return d.chain(h).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}function a(a,b){var b=b||0,c=[],d=f("stringStream").create(a),e=f("range");d.eatSpace();d.start=d.pos;for(var g;g=d.next();)if(/[\s\u00a0]/.test(g))c.push(e.create(d.start+b,d.pos-d.start-1)),d.eatSpace(),d.start=d.pos;c.push(e.create(d.start+b,d.pos-
|
|
|
|
|
d.start));return c}function g(a,b,e,g){a=c(a,f("xmlParser").parse(a),b);g&&a.reverse();return(b=d.find(a,function(a){return a.equal(e)}))?(g=d.indexOf(a,b),g<a.length-1?a[g+1]:null):g?d.find(a,function(a){return a.start<e.start}):!b&&(g=d.filter(a,function(a){return a.inside(e.end)}),g.length>1)?g[1]:d.find(a,function(a){return a.end>e.end})}function e(a,b){var c;if(a.charAt(b)=="<"&&(c=a.substring(b,a.length).match(p)))return f("range").create(b,c[0])}function j(a){return a=='"'||a=="'"}function n(a){var b=
|
|
|
|
|
a.valueRange(!0),c=[a.range(!0),b],e=f("stringStream"),g=f("cssEditTree"),k=f("range"),j=a.value();d.each(a.valueParts(),function(a){var f=a.clone();c.push(f.shift(b.start));var h=e.create(a.substring(j));if(h.match(/^[\w\-]+\(/,!0)){h.start=h.pos;h.skipToPair("(",")");var i=h.current();c.push(k.create(f.start+h.start,i));d.each(g.findParts(i),function(a){c.push(k.create(f.start+h.start+a.start,a.substring(i)))})}});return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}
|
|
|
|
|
function o(a,b,c){var e=null,g=null,f=a.list(),j,h;c?(f.reverse(),j=function(a){return a.range(!0).start<=b.start},h=function(a){return a.start<b.start}):(j=function(a){return a.range(!0).end>=b.end},h=function(a){return a.end>b.start});for(;e=d.find(f,j);){a=n(e);c&&a.reverse();if(g=d.find(a,function(a){return a.equal(b)})){if(g=d.indexOf(a,g),g!=a.length-1){g=a[g+1];break}}else{g=d.filter(a,function(a){return a.inside(b.end)});if(g.length>1){g=g[1];break}if(g=d.find(a,h))break}g=null;b.start=b.end=
|
|
|
|
|
c?e.range(!0).start-1:e.range(!0).end+1}return g}function l(a,b,c){a=f("cssEditTree").parse(a,{offset:b});b=a.nameRange(!0);return c.end<b.end?b:o(a,c,!1)}function m(a,b,c){b=f("cssEditTree").parse(a,{offset:b});a=o(b,c,!0);return!a&&(b=b.nameRange(!0),c.start>b.start)?b:a}var p=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=f("actions");r.add("select_next_item",function(a){return a.getSyntax()=="css"?h(a,!1,f("cssEditTree").extractRule,l):i(a)});r.add("select_previous_item",
|
|
|
|
|
function(a){return a.getSyntax()=="css"?h(a,!0,f("cssEditTree").extractRule,m):b(a)})});
|
|
|
|
|
emmet.exec(function(f){function d(c,a){var a=String((a||"out").toLowerCase()),d=f("editorUtils").outputInfo(c),e=f("range").create(c.getSelectionRange()),d=d.content;b&&!b.range.equal(e)&&(b=null);if(b&&e.length())if(a=="in")if(b.type=="tag"&&!b.close)return!1;else if(b.range.equal(b.outerRange))b.range=b.innerRange;else{var j=f("utils").narrowToNonSpace(d,b.innerRange);if((b=i.find(d,j.start+1))&&b.range.equal(e)&&b.outerRange.equal(e))b.range=b.innerRange}else if(!b.innerRange.equal(b.outerRange)&&
|
|
|
|
|
b.range.equal(b.innerRange)&&e.equal(b.range))b.range=b.outerRange;else{if((b=i.find(d,e.start))&&b.range.equal(e)&&b.innerRange.equal(e))b.range=b.outerRange}else b=i.find(d,e.start);if(b&&!b.range.equal(e))return c.createSelection(b.range.start,b.range.end),!0;b=null;return!1}var h=f("actions"),i=f("htmlMatcher"),b=null;h.add("match_pair",d,{hidden:!0});h.add("match_pair_inward",function(b){return d(b,"in")},{label:"HTML/Match Pair Tag (inward)"});h.add("match_pair_outward",function(b){return d(b,
|
|
|
|
|
"out")},{label:"HTML/Match Pair Tag (outward)"});h.add("matching_pair",function(b){var a=String(b.getContent()),d=b.getCaretPos();a.charAt(d)=="<"&&d++;return(a=i.tag(a,d))&&a.close?(a.open.range.inside(d)?b.setCaretPos(a.close.range.start):b.setCaretPos(a.open.range.start),!0):!1},{label:"HTML/Go To Matching Tag Pair"})});
|
|
|
|
|
emmet.exec(function(f){f("actions").add("remove_tag",function(d){var h=f("utils"),i=f("editorUtils").outputInfo(d),b=f("htmlMatcher").tag(i.content,d.getCaretPos());if(b){if(b.close){var c=h.narrowToNonSpace(i.content,b.innerRange),a=h.findNewlineBounds(i.content,c.start),a=h.getLinePadding(a.substring(i.content)),i=c.substring(i.content),i=h.unindentString(i,a);d.replaceContent(h.getCaretPlaceholder()+h.escapeText(i),b.outerRange.start,b.outerRange.end)}else d.replaceContent(h.getCaretPlaceholder(),
|
|
|
|
|
b.range.start,b.range.end);return!0}return!1},{label:"HTML/Remove Tag"})});
|
|
|
|
|
emmet.exec(function(f){f("actions").add("split_join_tag",function(d,h){var i=f("htmlMatcher"),b=f("editorUtils").outputInfo(d,null,h),c=f("profile").get(b.profile);if(i=i.tag(b.content,d.getCaretPos())){if(i.close){var b=f("utils"),c=c.selfClosing()||" /",c=i.open.range.substring(i.source).replace(/\s*>$/,c+">"),a=d.getCaretPos();c.length+i.outerRange.start<a&&(a=c.length+i.outerRange.start);c=b.escapeText(c);d.replaceContent(c,i.outerRange.start,i.outerRange.end)}else{var b=f("utils"),g=b.getNewline(),
|
|
|
|
|
e=f("resources").getVariable("indentation"),a=d.getCaretPos(),c=c.tag_nl===!0?g+e+g:"",g=i.outerContent().replace(/\s*\/>$/,">"),a=i.outerRange.start+g.length;g+=c+"</"+i.open.name+">";g=b.escapeText(g);d.replaceContent(g,i.outerRange.start,i.outerRange.end)}d.setCaretPos(a);i=!0}else i=!1;return i},{label:"HTML/Split\\Join Tag Declaration"})});
|
|
|
|
|
emmet.define("reflectCSSValue",function(f,d){function h(c){var a=f("cssEditTree"),d=f("editorUtils").outputInfo(c),c=c.getCaretPos();if(a=a.parseFromPosition(d.content,c))if(d=a.itemFromPosition(c,!0)){var e=a.source,j=a.options.offset,c=c-j-d.range().start;b.exec(!1,[d]);if(e!==a.source)return{data:a.source,start:j,end:j+e.length,caret:j+d.range().start+c}}}function i(b){var b=f("cssEditTree").baseName(b),a;if(b=="opacity"||b=="filter")return/^(?:\-\w+\-)?(?:opacity|filter)$/;else if(a=b.match(/^border-radius-(top|bottom)(left|right)/))return RegExp("^(?:\\-\\w+\\-)?(?:"+
|
|
|
|
|
b+"|border-"+a[1]+"-"+a[2]+"-radius)$");else if(a=b.match(/^border-(top|bottom)-(left|right)-radius/))return RegExp("^(?:\\-\\w+\\-)?(?:"+b+"|border-radius-"+a[1]+a[2]+")$");return RegExp("^(?:\\-\\w+\\-)?"+b+"$")}var b=f("handlerList").create();f("actions").add("reflect_css_value",function(b){return b.getSyntax()!="css"?!1:f("actionUtils").compoundUpdate(b,h(b))},{label:"CSS/Reflect Value"});b.add(function(b){var a=i(b.name());d.each(b.parent.list(),function(d){if(a.test(d.name())){var e;var j=b.name(),
|
|
|
|
|
h=b.value(),i=d.name();e=d.value();var l=f("cssEditTree"),m=f("utils"),j=l.baseName(j),i=l.baseName(i);e=j=="opacity"&&i=="filter"?e.replace(/opacity=[^)]*/i,"opacity="+Math.floor(parseFloat(h)*100)):j=="filter"&&i=="opacity"?(j=h.match(/opacity=([^)]*)/i))?m.prettifyNumber(parseInt(j[1])/100):e:h;d.value(e)}})},{order:-1});return{addHandler:function(c,a){b.add(c,a)},removeHandler:function(c){b.remove(c,options)}}});
|
|
|
|
|
emmet.exec(function(f){f("actions").add("evaluate_math_expression",function(d){var h=f("actionUtils"),i=f("utils"),b=String(d.getContent()),c=f("range").create(d.getSelectionRange());c.length()||(c=h.findExpressionBounds(d,function(a){return i.isNumeric(a)||".+-*/\\".indexOf(a)!=-1}));if(c&&c.length()){h=c.substring(b);h=h.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"Math.round($1/$2)");try{var a=i.prettifyNumber((new Function("return "+h))());d.replaceContent(a,c.start,c.end);d.setCaretPos(c.start+a.length);
|
|
|
|
|
return!0}catch(g){}}return!1},{label:"Numbers/Evaluate Math Expression"})});
|
|
|
|
|
emmet.exec(function(f,d){function h(b,a){var g=f("utils"),e=!1,j=!1,h=f("actionUtils").findExpressionBounds(b,function(a,b,c){return g.isNumeric(a)?!0:a=="."?!g.isNumeric(c.charAt(b+1))?!1:j?!1:j=!0:a=="-"?e?!1:e=!0:!1});if(h&&h.length()){var o=h.substring(String(b.getContent())),l=parseFloat(o);if(!d.isNaN(l)){l=g.prettifyNumber(l+a);if(/^(\-?)0+[1-9]/.test(o)){var m="";RegExp.$1&&(m="-",l=l.substring(1));l=l.split(".");l[0]=g.zeroPadString(l[0],i(o));l=m+l.join(".")}b.replaceContent(l,h.start,h.end);
|
|
|
|
|
b.createSelection(h.start,h.start+l.length);return!0}}return!1}function i(b){b=b.replace(/^\-/,"");return~b.indexOf(".")?b.split(".")[0].length:b.length}var b=f("actions");d.each([1,-1,10,-10,0.1,-0.1],function(c){var a=c>0?"increment":"decrement";b.add(a+"_number_by_"+String(Math.abs(c)).replace(".","").substring(0,2),function(a){return h(a,c)},{label:"Numbers/"+a.charAt(0).toUpperCase()+a.substring(1)+" number by "+Math.abs(c)})})});
|
|
|
|
|
emmet.exec(function(f,d){var h=f("actions"),i=f("preferences");i.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefere indented closing brace of CSS rule for better readability. This preference\u2019s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when \u201cInsert formatted linebreak\u201d action will be performed in CSS file). If you\u2019re such user, you may want to write put a value like <code>\\n\\t</code> in this preference.");
|
|
|
|
|
h.add("insert_formatted_line_break_only",function(b){var c=f("utils"),a=f("resources"),g=f("editorUtils").outputInfo(b),e=b.getCaretPos(),j=c.getNewline();if(d.include(["html","xml","xsl"],g.syntax)){if(a=a.getVariable("indentation"),(g=f("htmlMatcher").tag(g.content,e))&&!g.innerRange.length())return b.replaceContent(j+a+c.getCaretPlaceholder()+j,e),!0}else if(g.syntax=="css"&&(g=g.content,e&&g.charAt(e-1)=="{")){var h=i.get("css.closeBraceIndentation"),a=a.getVariable("indentation"),o=g.charAt(e)==
|
|
|
|
|
"}";if(!o)for(var l=e,m=g.length,p;l<m;l++){p=g.charAt(l);if(p=="{")break;if(p=="}"){h="";o=!0;break}}o||(h+="}");c=j+a+c.getCaretPlaceholder()+h;b.replaceContent(c,e);return!0}return!1},{hidden:!0});h.add("insert_formatted_line_break",function(b){if(!h.run("insert_formatted_line_break_only",b)){for(var c=f("utils"),a=f("editorUtils").getCurrentLinePadding(b),d=String(b.getContent()),e=b.getCaretPos(),j=d.length,c=c.getNewline(),i="",o=b.getCurrentLineRange().end+1,l;o<j;o++)if(l=d.charAt(o),l==" "||
|
|
|
|
|
l=="\t")i+=l;else break;i.length>a.length?b.replaceContent(c+i,e,e,!0):b.replaceContent(c,e)}return!0},{hidden:!0})});
|
|
|
|
|
emmet.exec(function(f){f("actions").add("merge_lines",function(d){var h=f("htmlMatcher"),i=f("utils"),b=f("editorUtils").outputInfo(d),c=f("range").create(d.getSelectionRange());if(!c.length()&&(h=h.find(b.content,d.getCaretPos())))c=h.outerRange;if(c.length()){b=c.substring(b.content);b=i.splitByLines(b);for(h=1;h<b.length;h++)b[h]=b[h].replace(/^\s+/,"");b=b.join("").replace(/\s{2,}/," ");h=b.length;b=i.escapeText(b);d.replaceContent(b,c.start,c.end);d.createSelection(c.start,c.start+h);return!0}return!1})});
|
|
|
|
|
emmet.exec(function(f){function d(d,b,c){c=c||0;return b.charAt(c)==d.charAt(0)&&b.substr(c,d.length)==d}function h(d,b,c){var a=f("file"),g=f("actionUtils"),e=d.getFilePath();if(e===null)throw"You should save your file before using this action";var h=a.locateFile(e,b);if(h===null)throw"Can't find "+b+" file";a.read(h,function(e,o){if(e)throw"Unable to read "+h+": "+e;var l=f("base64").encode(String(o));if(!l)throw"Can't encode file content to base64";l="data:"+(g.mimeTypes[String(a.getExt(h))]||
|
|
|
|
|
"application/octet-stream")+";base64,"+l;d.replaceContent("$0"+l,c,c+b.length)});return!0}f("actions").add("encode_decode_data_url",function(i){var b=String(i.getSelection()),c=i.getCaretPos();if(!b)for(var a=String(i.getContent());c-- >=0;)if(d("src=",a,c)){if(a=a.substr(c).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))b=a[3],c+=a[1].length;break}else if(d("url(",a,c)){if(a=a.substr(c).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))b=a[3],c+=a[1].length;break}if(b)if(d("data:",b))if(a=String(i.prompt("Enter path to file (absolute or relative)"))){var g=
|
|
|
|
|
f("file"),e=g.createPath(i.getFilePath(),a);if(!e)throw"Can't save file";g.save(e,f("base64").decode(b.replace(/^data\:.+?;.+?,/,"")));i.replaceContent("$0"+a,c,c+b.length);i=!0}else i=!1;else i=h(i,b,c);else i=!1;return i},{label:"Encode\\Decode data:URL image"})});
|
|
|
|
|
emmet.exec(function(f,d){function h(c){var a=c.getCaretPos(),g=f("editorUtils").outputInfo(c),e=f("xmlEditTree").parseFromPosition(g.content,a,!0);e&&(e.name()||"").toLowerCase()=="img"&&b(c,e.value("src"),function(b){if(b){var g=e.range(!0);e.value("width",b.width);e.value("height",b.height,e.indexOf("width")+1);f("actionUtils").compoundUpdate(c,d.extend(g,{data:e.toString(),caret:a}))}})}function i(c){var a=c.getCaretPos(),g=f("editorUtils").outputInfo(c),e=f("cssEditTree").parseFromPosition(g.content,
|
|
|
|
|
a,!0);if(e){var g=e.itemFromPosition(a,!0),h;g&&(h=/url\((["']?)(.+?)\1\)/i.exec(g.value()||""))&&b(c,h[2],function(b){if(b){var g=e.range(!0);e.value("width",b.width+"px");e.value("height",b.height+"px",e.indexOf("width")+1);f("actionUtils").compoundUpdate(c,d.extend(g,{data:e.toString(),caret:a}))}})}}function b(b,a,d){var e=f("actionUtils");if(a){if(/^data:/.test(a))return b=f("base64").decode(a.replace(/^data\:.+?;.+?,/,"")),d(e.getImageSize(b));var h=f("file"),i=h.locateFile(b.getFilePath(),
|
|
|
|
|
a);if(i===null)throw"Can't find "+a+" file";h.read(i,function(a,b){if(a)throw"Unable to read "+i+": "+a;d(e.getImageSize(String(b)))})}}f("actions").add("update_image_size",function(b){d.include(["css","less","scss"],String(b.getSyntax()))?i(b):h(b);return!0})});
|
|
|
|
|
emmet.define("cssResolver",function(f,d){function h(a){var b=a&&a.charCodeAt(0);return a&&a=="."||b>47&&b<58}function i(a){a=f("utils").trim(a);if(~a.indexOf("/*")||/[\n\r]/.test(a))return!1;if(!/^[a-z0-9\-]+\s*\:/i.test(a))return!1;a=f("tabStops").processText(a,{replaceCarets:!0,tabstop:function(){return"value"}});return a.split(":").length==2}function b(a){a.charAt(0)=="-"&&!/^\-[\.\d]/.test(a)&&(a=a.replace(/^\-+/,""));if(a.charAt(0)=="#"){var b=a.replace(/^#+/,"")||"0";if(b.toLowerCase()=="t")a=
|
|
|
|
|
"transparent";else{var d=f("utils").repeatString,a=null;switch(b.length){case 1:a=d(b,6);break;case 2:a=d(b,3);break;case 3:a=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2);break;case 4:a=b+b.substr(0,2);break;case 5:a=b+b.charAt(0);break;default:a=b.substr(0,6)}q.get("css.color.short")&&(b=a.split(""),b[0]==b[1]&&b[2]==b[3]&&b[4]==b[5]&&(a=b[0]+b[2]+b[4]));switch(q.get("css.color.case")){case "upper":a=a.toUpperCase();break;case "lower":a=a.toLowerCase()}a="#"+a}}else a=
|
|
|
|
|
c(a);return a}function c(a){var b=q.getDict("css.keywordAliases");return a in b?b[a]:a}function a(a){return d.include(q.getArray("css.keywords"),c(a))}function g(a,b){var c=r[b];c||(c=d.find(r,function(a){return a.prefix==b}));return c&&c.supports(a)}function e(a,b){var c=[];d.each(r,function(b,d){g(a,d)&&c.push(d)});!c.length&&!b&&d.each(r,function(a,b){a.obsolete||c.push(b)});return c}function j(a,b){d.isString(b)&&(b={prefix:b});r[a]=d.extend({},p,b)}function n(a,b){if(b){var c=q.get(b+"."+a);
|
|
|
|
|
if(!d.isUndefined(c))return c}return q.get("css."+a)}function o(a,b,c){if(!d.isString(a))a=a.data;if(!i(a))return a;b&&(~a.indexOf(";")?a=a.split(";").join(" !important;"):a+=" !important");b=a.indexOf(":");a=a.substring(0,b).replace(/\s+$/,"")+n("valueSeparator",c)+f("utils").trim(a.substring(b+1));return a.replace(/\s*;\s*$/,n("propertyEnd",c))}function l(a){var b=q.getArray(a);d.each(q.getArray(a+"Addon"),function(a){a.charAt(0)=="-"?b=d.without(b,a.substr(1)):(a.charAt(0)=="+"&&(a=a.substr(1)),
|
|
|
|
|
b.push(a))});return b}var m=null,p={prefix:"emmet",obsolete:!1,transformName:function(a){return"-"+this.prefix+"-"+a},properties:function(){return l("css."+this.prefix+"Properties")||[]},supports:function(a){return d.include(this.properties(),a)}},r={},q=f("preferences");q.define("css.valueSeparator",": ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations.");q.define("css.propertyEnd",";","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations.");
|
|
|
|
|
q.define("stylus.valueSeparator"," ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations in Stylus dialect.");q.define("stylus.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in Stylus dialect.");q.define("sass.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in SASS dialect.");q.define("css.autoInsertVendorPrefixes",
|
|
|
|
|
!0,"Automatically generate vendor-prefixed copies of expanded CSS property. By default, Emmet will generate vendor-prefixed properties only when you put dash before abbreviation (e.g. <code>-bxsh</code>). With this option enabled, you don\u2019t need dashes before abbreviations: Emmet will produce vendor-prefixed properties for you.");var u=d.template("A comma-separated list of CSS properties that may have <code><%= vendor %></code> vendor prefix. This list is used to generate a list of prefixed properties when expanding <code>-property</code> abbreviations. Empty list means that all possible CSS values may have <code><%= vendor %></code> prefix."),
|
|
|
|
|
s=d.template("A comma-separated list of <em>additional</em> CSS properties for <code>css.<%= vendor %>Preperties</code> preference. You should use this list if you want to add or remove a few CSS properties to original set. To add a new property, simply write its name, to remove it, precede property with hyphen.<br>For example, to add <em>foo</em> property and remove <em>border-radius</em> one, the preference value will look like this: <code>foo, -border-radius</code>.");d.each({webkit:"animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius",
|
|
|
|
|
moz:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius",
|
|
|
|
|
ms:"accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode",
|
|
|
|
|
o:"dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style"},
|
|
|
|
|
function(a,b){q.define("css."+b+"Properties",a,u({vendor:b}));q.define("css."+b+"PropertiesAddon","",s({vendor:b}))});q.define("css.unitlessProperties","z-index, line-height, opacity, font-weight, zoom","The list of properties whose values \u200b\u200bmust not contain units.");q.define("css.intUnit","px","Default unit for integer values");q.define("css.floatUnit","em","Default unit for float values");q.define("css.keywords","auto, inherit","A comma-separated list of valid keywords that can be used in CSS abbreviations.");
|
|
|
|
|
q.define("css.keywordAliases","a:auto, i:inherit, s:solid, da:dashed, do:dotted, t:transparent","A comma-separated list of keyword aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:keyword_name</code>.");q.define("css.unitAliases","e:em, p:%, x:ex, r:rem","A comma-separated list of unit aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:unit_value</code>.");q.define("css.color.short",!0,"Should color values like <code>#ffffff</code> be shortened to <code>#fff</code> after abbreviation with color was expanded.");
|
|
|
|
|
q.define("css.color.case","keep","Letter case of color values generated by abbreviations with color (like <code>c#0</code>). Possible values are <code>upper</code>, <code>lower</code> and <code>keep</code>.");q.define("css.fuzzySearch",!0,"Enable fuzzy search among CSS snippet names. When enabled, every <em>unknown</em> snippet will be scored against available snippet names (not values or CSS properties!). The match with best score will be used to resolve snippet value. For example, with this preference enabled, the following abbreviations are equal: <code>ov:h</code> == <code>ov-h</code> == <code>o-h</code> == <code>oh</code>");
|
|
|
|
|
q.define("css.fuzzySearchMinScore",0.3,"The minium score (from 0 to 1) that fuzzy-matched abbreviation should achive. Lower values may produce many false-positive matches, higher values may reduce possible matches.");q.define("css.alignVendor",!1,"If set to <code>true</code>, all generated vendor-prefixed properties will be aligned by real property name.");j("w",{prefix:"webkit"});j("m",{prefix:"moz"});j("s",{prefix:"ms"});j("o",{prefix:"o"});var v=["css","less","sass","scss","stylus"];f("resources").addResolver(function(a,
|
|
|
|
|
b){return d.include(v,b)&&a.isElement()?m.expandToSnippet(a.abbreviation,b):null});var w=f("expandAbbreviation");w.addHandler(function(a,b,c){if(!d.include(v,b))return!1;var e=a.getSelectionRange().end,g=w.findAbbreviation(a);return g&&(b=emmet.expandAbbreviation(g,b,c))?(g=e-g.length,c=e,a.getContent().charAt(e)==";"&&b.charAt(b.length-1)==";"&&c++,a.replaceContent(b,g,c),!0):!1});return m={addPrefix:j,supportsPrefix:g,prefixed:function(a,b){return g(a,b)?"-"+b+"-"+a:a},listPrefixes:function(){return d.map(r,
|
|
|
|
|
function(a){return a.prefix})},getPrefix:function(a){return r[a]},removePrefix:function(a){a in r&&delete r[a]},extractPrefixes:function(a){if(a.charAt(0)!="-")return{property:a,prefixes:null};for(var b=1,c=a.length,d,e=[];b<c;){d=a.charAt(b);if(d=="-"){b++;break}if(d in r)e.push(d);else{e.length=0;b=1;break}b++}if(b==c-1)b=1,e.length=1;return{property:a.substring(b),prefixes:e.length?e:"all"}},findValuesInAbbreviation:function(b,c){for(var c=c||"css",d=0,e=b.length,g="",j;d<e;){j=b.charAt(d);if(h(j)||
|
|
|
|
|
j=="#"||j=="-"&&h(b.charAt(d+1))){g=b.substring(d);break}d++}j=b.substring(0,b.length-g.length);d=f("resources");for(e=[];~j.indexOf("-")&&!d.findSnippet(c,j);){j=j.split("-");var i=j.pop();if(!a(i))break;e.unshift(i);j=j.join("-")}return e.join("-")+g},parseValues:function(c){for(var e=f("stringStream").create(c),g=[],j=null;j=e.next();){if(j=="#")e.match(/^t|[0-9a-f]+/i,!0);else if(j=="-"){if(a(d.last(g))||e.start&&h(c.charAt(e.start-1)))e.start=e.pos;e.match(/^\-?[0-9]*(\.[0-9]+)?[a-z%\.]*/,!0)}else e.match(/^[0-9]*(\.[0-9]*)?[a-z%]*/,
|
|
|
|
|
!0);g.push(e.current());e.start=e.pos}return d.map(d.compact(g),b)},extractValues:function(a){var b=this.findValuesInAbbreviation(a);return!b?{property:a,values:null}:{property:a.substring(0,a.length-b.length).replace(/-$/,""),values:this.parseValues(b)}},normalizeValue:function(a,b){var b=(b||"").toLowerCase(),c=q.getArray("css.unitlessProperties");return a.replace(/^(\-?[0-9\.]+)([a-z]*)$/,function(a,e,g){if(!g&&(e=="0"||d.include(c,b)))return e;g?(a=q.getDict("css.unitAliases"),e+=g in a?a[g]:
|
|
|
|
|
g):e=e.replace(/\.$/,"")+q.get(~e.indexOf(".")?"css.floatUnit":"css.intUnit");return e})},expand:function(a,b,c){var c=c||"css",g=f("resources"),h=q.get("css.autoInsertVendorPrefixes"),j;if(j=/^(.+)\!$/.test(a))a=RegExp.$1;var m=g.findSnippet(c,a);if(m&&!h)return o(m,j,c);var a=this.extractPrefixes(a),l=this.extractValues(a.property),a=d.extend(a,l);m?a.values=null:m=g.findSnippet(c,a.property);!m&&q.get("css.fuzzySearch")&&(m=g.fuzzyFindSnippet(c,a.property,parseFloat(q.get("css.fuzzySearchMinScore"))));
|
|
|
|
|
if(m){if(!d.isString(m))m=m.data}else m=a.property+":${1};";if(!i(m))return m;var n=this.splitSnippet(m),v=[];!b&&a.values&&(b=d.map(a.values,function(a){return this.normalizeValue(a,n.name)},this).join(" ")+";");n.value=b||n.value;var b=a.prefixes=="all"||!a.prefixes&&h?e(n.name,h&&a.prefixes!="all"):a.prefixes,p=[],w;d.each(b,function(a){a in r&&(w=r[a].transformName(n.name),p.push(w),v.push(o(w+":"+n.value,j,c)))});v.push(o(n.name+":"+n.value,j,c));p.push(n.name);if(q.get("css.alignVendor"))var s=
|
|
|
|
|
f("utils").getStringsPads(p),v=d.map(v,function(a,b){return s[b]+a});return v},expandToSnippet:function(a,b){var c=this.expand(a,null,b);return d.isArray(c)?c.join("\n"):!d.isString(c)?c.data:String(c)},splitSnippet:function(a){var b=f("utils"),a=b.trim(a);if(a.indexOf(":")==-1)return{name:a,value:"${1};"};a=a.split(":");return{name:b.trim(a.shift()),value:b.trim(a.join(":")).replace(/^(\$\{0\}|\$0)(\s*;?)$/,"${1}$2")}},getSyntaxPreference:n,transformSnippet:o}});
|
|
|
|
|
emmet.define("cssGradient",function(f,d){function h(a){return f("utils").trim(a).replace(/\s+/g," ")}function i(a){var a=h(a),b=null,a=a.replace(/^(\w+\(.+?\))\s*/,function(a,c){b=c;return""});b||(a=a.split(" "),b=a[0],a=a[1]||"");var c={color:b};a&&a.replace(/^(\-?[\d\.]+)([a-z%]+)?$/,function(a,b,d){c.position=b;~b.indexOf(".")?d="":d||(d="%");if(d)c.unit=d});return c}function b(a){var b=0;d.each(a,function(c,e){if(!e)return c.position=c.position||0;if(e==a.length-1&&!("position"in c))c.position=
|
|
|
|
|
1;if("position"in c){var g=a[b].position||0,f=(c.position-g)/(e-b);d.each(a.slice(b,e),function(a,b){a.position=g+f*b});b=e}})}function c(a){var b=parseFloat(a);if(!d.isNaN(b))switch(b%360){case 0:return"left";case 90:return"bottom";case 180:return"right";case 240:return"top"}return a}function a(a){a=c(a);if(q.test(a))throw"The direction is an angle that can\u2019t be converted.";var b=function(b){return~a.indexOf(b)?"100%":"0"};return b("right")+" "+b("bottom")+", "+b("left")+" "+b("top")}function g(a){var b=
|
|
|
|
|
s.getArray("css.gradient.prefixes"),b=d.map(b,function(b){return"-"+b+"-"+a});b.push(a);return b}function e(a,b){var c=[],e=f("cssResolver");s.get("css.gradient.fallback")&&~b.toLowerCase().indexOf("background")&&c.push({name:"background-color",value:"${1:"+a.colorStops[0].color+"}"});d.each(s.getArray("css.gradient.prefixes"),function(d){var g=e.prefixed(b,d);if(d=="webkit"&&s.get("css.gradient.oldWebkit"))try{c.push({name:g,value:p.oldWebkitLinearGradient(a)})}catch(f){}c.push({name:g,value:p.toString(a,
|
|
|
|
|
d)})});return c.sort(function(a,b){return b.name.length-a.name.length})}function j(a,b,c){var h=a.parent,j=f("utils"),i=f("preferences").get("css.alignVendor"),m=a.styleSeparator,l=a.styleBefore;d.each(h.getAll(g(a.name())),function(b){if(b!=a&&/gradient/i.test(b.value())){if(b.styleSeparator.length<m.length)m=b.styleSeparator;if(b.styleBefore.length<l.length)l=b.styleBefore;h.remove(b)}});if(i){if(l!=a.styleBefore){var n=a.fullRange();h._updateSource(l,n.start,n.start+a.styleBefore.length);a.styleBefore=
|
|
|
|
|
l}if(m!=a.styleSeparator)h._updateSource(m,a.nameRange().end,a.valueRange().start),a.styleSeparator=m}var o=a.value();c||(c=f("range").create(0,a.value()));a.value(function(a){return j.replaceSubstring(o,a,c)}(p.toString(b))+"${2}");b=e(b,a.name());if(i){i=d.pluck(b,"value");n=d.pluck(b,"name");i.push(a.value());n.push(a.name());var r=j.getStringsPads(d.map(i,function(a){return a.substring(0,a.indexOf("("))})),q=j.getStringsPads(n);a.name(d.last(q)+a.name());d.each(b,function(a,b){a.name=q[b]+a.name;
|
|
|
|
|
a.value=r[b]+a.value});a.value(d.last(r)+a.value())}d.each(b,function(b){h.add(b.name,b.value,h.indexOf(a))})}function n(a){var b=a.value(),c=null;return(a=d.find(a.valueParts(),function(a){return c=p.parse(a.substring(b))}))&&c?{gradient:c,valueRange:a}:null}function o(a,b){var c=s.get("css.gradient.defaultProperty");if(!c)return!1;var g=String(a.getContent()),h=f("range").create(a.getCurrentLineRange()),j=h.substring(g).replace(/^\s+/,function(a){h.start+=a.length;return""}).replace(/\s+$/,function(a){h.end-=
|
|
|
|
|
a.length;return""}),g=f("cssResolver");if(j=p.parse(j)){var i=e(j,c);i.push({name:c,value:p.toString(j)+"${2}"});var m=g.getSyntaxPreference("valueSeparator",b),l=g.getSyntaxPreference("propertyEnd",b);if(f("preferences").get("css.alignVendor")){var n=f("utils").getStringsPads(d.map(i,function(a){return a.value.substring(0,a.value.indexOf("("))}));d.each(i,function(a,b){a.value=n[b]+a.value})}i=d.map(i,function(a){return a.name+m+a.value+l});a.replaceContent(i.join("\n"),h.start,h.end);return!0}return!1}
|
|
|
|
|
function l(a,b){var c=null,e=f("cssEditTree").parseFromPosition(a,b,!0);e&&((c=e.itemFromPosition(b,!0))||(c=d.find(e.list(),function(a){return a.range(!0).end==b})));return{rule:e,property:c}}var m=["top","to bottom","0deg"],p=null,r=["css","less","sass","scss","stylus","styl"],q=/\d+deg/i,u=/top|bottom|left|right/i,s=f("preferences");s.define("css.gradient.prefixes","webkit, moz, o","A comma-separated list of vendor-prefixes for which values should be generated.");s.define("css.gradient.oldWebkit",
|
|
|
|
|
!0,"Generate gradient definition for old Webkit implementations");s.define("css.gradient.omitDefaultDirection",!0,"Do not output default direction definition in generated gradients.");s.define("css.gradient.defaultProperty","background-image","When gradient expanded outside CSS value context, it will produce properties with this name.");s.define("css.gradient.fallback",!1,"With this option enabled, CSS gradient generator will produce <code>background-color</code> property with gradient first color as fallback for old browsers.");
|
|
|
|
|
f("expandAbbreviation").addHandler(function(a,b,c){c=f("editorUtils").outputInfo(a,b,c);if(!d.include(r,c.syntax))return!1;var e=a.getCaretPos(),g=c.content,c=l(g,e);if(c.property){var h=n(c.property);if(h){var i=c.rule.options.offset||0,m=i+c.rule.toString().length;if(/[\n\r]/.test(c.property.value())){var p=c.property.valueRange(!0).start+h.valueRange.end,g=f("utils").replaceSubstring(g,";",p),e=l(g,e);e.property&&(h=n(e.property),c=e)}c.property.end(";");var e=c.property.name(),g=f("resources"),
|
|
|
|
|
p=f("preferences"),q=g.findSnippet(b,e);!q&&p.get("css.fuzzySearch")&&(q=g.fuzzyFindSnippet(b,e,parseFloat(p.get("css.fuzzySearchMinScore"))));if(q){if(!d.isString(q))q=q.data;b=f("cssResolver").splitSnippet(q).name}else b=void 0;b&&c.property.name(b);j(c.property,h.gradient,h.valueRange);a.replaceContent(c.rule.toString(),i,m,!0);return!0}}return o(a,b)});f("reflectCSSValue").addHandler(function(a){var b=f("utils"),c=n(a);if(!c)return!1;var e=a.value(),h=function(a){return b.replaceSubstring(e,a,
|
|
|
|
|
c.valueRange)};d.each(a.parent.getAll(g(a.name())),function(b){if(b!==a){var d=b.value().match(/^\s*(\-([a-z]+)\-)?linear\-gradient/);d?b.value(h(p.toString(c.gradient,d[2]||""))):b.value().match(/\s*\-webkit\-gradient/)&&b.value(h(p.oldWebkitLinearGradient(c.gradient)))}});return!0});return p={parse:function(a){var b=null;f("utils").trim(a).replace(/^([\w\-]+)\((.+?)\)$/,function(a,c,e){c=c.toLowerCase().replace(/^\-[a-z]+\-/,"");if(c=="linear-gradient"||c=="lg"){for(var a=m[0],e=f("stringStream").create(f("utils").trim(e)),
|
|
|
|
|
c=[],g;g=e.next();)e.peek()==","?(c.push(e.current()),e.next(),e.eatSpace(),e.start=e.pos):g=="("&&e.skipTo(")");c.push(e.current());c=d.compact(d.map(c,h));if(c.length){if(q.test(c[0])||u.test(c[0]))a=c.shift();b={type:"linear",direction:a,colorStops:d.map(c,i)}}else b=null;return""}return a});return b},oldWebkitLinearGradient:function(c){d.isString(c)&&(c=this.parse(c));if(!c)return null;var e=d.map(c.colorStops,d.clone);d.each(e,function(a){if("position"in a)if(~a.position.indexOf(".")||a.unit==
|
|
|
|
|
"%")a.position=parseFloat(a.position)/(a.unit=="%"?100:1);else throw"Can't convert color stop '"+(a.position+(a.unit||""))+"'";});b(e);e=d.map(e,function(a,b){return!a.position&&!b?"from("+a.color+")":a.position==1&&b==e.length-1?"to("+a.color+")":"color-stop("+a.position.toFixed(2).replace(/\.?0+$/,"")+", "+a.color+")"});return"-webkit-gradient(linear, "+a(c.direction)+", "+e.join(", ")+")"},toString:function(a,b){if(a.type=="linear"){var c=(b?"-"+b+"-":"")+"linear-gradient",e=d.map(a.colorStops,
|
|
|
|
|
function(a){return a.color+("position"in a?" "+a.position+(a.unit||""):"")});a.direction&&(!s.get("css.gradient.omitDefaultDirection")||!d.include(m,a.direction))&&e.unshift(a.direction);return c+"("+e.join(", ")+")"}}}});emmet.exec(function(f,d){var h=f("handlerList").create(),i=f("resources");d.extend(i,{addGenerator:function(b,c,a){d.isString(b)&&(b=RegExp(b));h.add(function(a,d){var f;return(f=b.exec(a.name()))?c(f,a,d):null},a)}});i.addResolver(function(b,c){return h.exec(null,d.toArray(arguments))})});
|
|
|
|
|
emmet.define("tagName",function(f,d){var h={empty:"area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command".split(","),blockLevel:"address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6".split(","),inlineLevel:"a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")},
|
|
|
|
|
i={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};return{resolve:function(b){b=(b||"").toLowerCase();return b in i?this.getMapping(b):this.isInlineLevel(b)?"span":"div"},getMapping:function(b){return i[b.toLowerCase()]},isInlineLevel:function(b){return this.isTypeOf(b,"inlineLevel")},isBlockLevel:function(b){return this.isTypeOf(b,"blockLevel")},isEmptyElement:function(b){return this.isTypeOf(b,
|
|
|
|
|
"empty")},isTypeOf:function(b,c){return d.include(h[c],b)},addMapping:function(b,c){i[b]=c},removeMapping:function(b){b in i&&delete i[b]},addElementToCollection:function(b,c){h[c]||(h[c]=[]);var a=this.getCollection(c);d.include(a,b)||a.push(b)},removeElementFromCollection:function(b,c){c in h&&(h[c]=d.without(this.getCollection(c),b))},getCollection:function(b){return h[b]}}});
|
|
|
|
|
emmet.exec(function(f,d){function h(){return{element:g.get("bem.elementSeparator"),modifier:g.get("bem.modifierSeparator")}}function i(a){if(f("abbreviationUtils").isSnippet(a))return a;a.__bem={block:"",element:"",modifier:""};var e=b(a.attribute("class")).split(" "),g=/^[a-z]\-/i;a.__bem.block=d.find(e,function(a){return g.test(a)});if(!a.__bem.block)g=/^[a-z]/i,a.__bem.block=d.find(e,function(a){return g.test(a)})||"";(e=d.chain(e).map(function(b){var d;d=c(b,a,"element");d=c(d,a,"modifier");var e=
|
|
|
|
|
"",g="",f="",b=h();~d.indexOf(b.element)?(e=d.split(b.element),f=e[1].split(b.modifier),e=e[0],g=f.shift(),f=f.join(b.modifier)):~d.indexOf(b.modifier)&&(f=d.split(b.modifier),e=f.shift(),f=f.join(b.modifier));if(e||g||f){if(!e)e=a.__bem.block;d=e;var i=[];g&&(d+=b.element+g);i.push(d);f&&i.push(d+b.modifier+f);a.__bem.block=e;a.__bem.element=g;a.__bem.modifier=f;b=i}else b=d;return b}).flatten().uniq().value().join(" "))&&a.attribute("class",e);return a}function b(a){var b=f("utils"),a=(" "+(a||
|
|
|
|
|
"")+" ").replace(/\s+/g," "),c=g.get("bem.shortElementPrefix");c&&(c=RegExp("\\s("+b.escapeForRegexp(c)+"+)","g"),a=a.replace(c,function(a,c){return" "+b.repeatString(h().element,c.length)}));return b.trim(a)}function c(a,b,c){var d=h(),e=RegExp("^("+d[c]+")+","g");if(e.test(a)){for(var g=0,e=a.replace(e,function(a){g=a.length/d[c].length;return""}),f=b;f.parent&&g--;)f=f.parent;if(!f||!f.__bem)f=b;if(f&&f.__bem)return a=f.__bem.block,c=="modifier"&&f.__bem.element&&(a+=d.element+f.__bem.element),
|
|
|
|
|
a+d[c]+e}return a}function a(b,c){b.name&&i(b,c);var g=f("abbreviationUtils");d.each(b.children,function(b){a(b,c);!g.isSnippet(b)&&b.start&&(e=!0)});return b}var g=f("preferences");g.define("bem.elementSeparator","__","Class name\u2019s element separator.");g.define("bem.modifierSeparator","_","Class name\u2019s modifier separator.");g.define("bem.shortElementPrefix","-","Symbol for describing short \u201cblock-element\u201d notation. Class names prefixed with this symbol will be treated as element name for parent\u2018s block name. Each symbol instance traverses one level up in parsed tree for block name lookup. Empty value will disable short notation.");
|
|
|
|
|
var e=!1;f("filters").add("bem",function(b,c){e=!1;b=a(b,c);e&&(b=f("filters").apply(b,"html",c));return b})});
|
|
|
|
|
emmet.exec(function(f,d){function h(c,a,g){var e=f("utils"),h=b.get("filter.commentTrigger");if(h=="*"||d.find(h.split(","),function(a){return!!c.attribute(e.trim(a))}))h={node:c,name:c.name(),padding:c.parent?c.parent.padding:"",attr:function(a,b,d){return(a=c.attribute(a))?(b||"")+a+(d||""):""}},a=e.normalizeNewline(a?a(h):""),g=e.normalizeNewline(g?g(h):""),c.start=c.start.replace(/</,a+"<"),c.end=c.end.replace(/>/,">"+g)}function i(b,a,g){var e=f("abbreviationUtils");d.each(b.children,function(b){e.isBlock(b)&&
|
|
|
|
|
h(b,a,g);i(b,a,g)});return b}var b=f("preferences");b.define("filter.commentAfter",'\n<\!-- /<%= attr("id", "#") %><%= attr("class", ".") %> --\>',"A definition of comment that should be placed <i>after</i> matched element when <code>comment</code> filter is applied. This definition is an ERB-style template passed to <code>_.template()</code> function (see Underscore.js docs for details). In template context, the following properties and functions are availabe:\n<ul><li><code>attr(name, before, after)</code> \u2013 a function that outputsspecified attribute value concatenated with <code>before</code> and <code>after</code> strings. If attribute doesn't exists, the empty string will be returned.</li><li><code>node</code> \u2013 current node (instance of <code>AbbreviationNode</code>)</li><li><code>name</code> \u2013 name of current tag</li><li><code>padding</code> \u2013 current string padding, can be used for formatting</li></ul>");
|
|
|
|
|
b.define("filter.commentBefore","","A definition of comment that should be placed <i>before</i> matched element when <code>comment</code> filter is applied. For more info, read description of <code>filter.commentAfter</code> property");b.define("filter.commentTrigger","id, class","A comma-separated list of attribute names that should exist in abbreviatoin where comment should be added. If you wish to add comment for every element, set this option to <code>*</code>");f("filters").add("c",function(c){var a=
|
|
|
|
|
d.template(b.get("filter.commentBefore")),g=d.template(b.get("filter.commentAfter"));return i(c,a,g)})});emmet.exec(function(f,d){function h(b){return b.replace(/([<>&])/g,function(b,a){return i[a]})}var i={"<":"<",">":">","&":"&"};f("filters").add("e",function c(a){d.each(a.children,function(a){a.start=h(a.start);a.end=h(a.end);a.content=h(a.content);c(a)});return a})});
|
|
|
|
|
emmet.exec(function(f,d){function h(a){return a.parent&&!a.parent.parent&&!a.index()}function i(a,c){var d=f("abbreviationUtils");return c.tag_nl===!0||d.isBlock(a)?!0:!a.parent||!c.inline_break?!1:b(a.parent,c)}function b(a,b){var c=0,h=f("abbreviationUtils");return!!d.find(a.children,function(a){a.isTextNode()||!h.isInline(a)?c=0:h.isInline(a)&&c++;if(c>=b.inline_break)return!0})}function c(a,c){var h=f("abbreviationUtils");return!d.any(a.children,function(a){return h.isSnippet(a)?!1:!h.isInline(a)})?
|
|
|
|
|
b(a,c):!0}var a=f("preferences");a.define("format.noIndentTags","html","A comma-separated list of tag names that should not get inner indentation.");a.define("format.forceIndentationForTags","body","A comma-separated list of tag names that should <em>always</em> get inner indentation.");f("filters").add("_format",function e(b,n,o){var o=o||0,l=f("abbreviationUtils");d.each(b.children,function(b){if(l.isSnippet(b)){if(b.start=b.end="",!h(b)&&n.tag_nl!==!1&&i(b,n)&&(!b.parent.parent||!f("abbreviationUtils").isInline(b.parent)))b.start=
|
|
|
|
|
f("utils").getNewline()+b.start}else{b.start=b.end="%s";var j=f("utils"),r=f("abbreviationUtils"),q=r.isUnary(b),j=j.getNewline(),u=d.include(a.getArray("format.noIndentTags")||[],b.name())?"":f("resources").getVariable("indentation");if(n.tag_nl!==!1){var s=n.tag_nl===!0&&(n.tag_nl_leaf||b.children.length);s||(s=d.include(a.getArray("format.forceIndentationForTags")||[],b.name()));if(!b.isTextNode()){if(i(b,n)){if(!h(b)&&(!r.isSnippet(b.parent)||b.index()))b.start=j+b.start;if(r.hasBlockChildren(b)||
|
|
|
|
|
b.children.length&&i(b.children[0],n)||s&&!q)b.end=j+b.end;if(r.hasTagsInContent(b)||s&&!b.children.length&&!q)b.start+=j+u}else if(r.isInline(b)&&b.parent&&f("abbreviationUtils").hasBlockChildren(b.parent)&&!h(b))b.start=j+b.start;else if(r.isInline(b)&&c(b,n))b.end=j+b.end;b.padding=u}}}e(b,n,o+1)});return b})});
|
|
|
|
|
emmet.exec(function(f,d){function h(h,b){var c="",a=[],g=b.attributeQuote(),e=b.cursor();d.each(h.attributeList(),function(d){var h=b.attributeName(d.name);switch(h.toLowerCase()){case "id":c+="#"+(d.value||e);break;case "class":c+="."+f("utils").trim(d.value||e).replace(/\s+/g,".");break;default:a.push(":"+h+" => "+g+(d.value||e)+g)}});a.length&&(c+="{"+a.join(", ")+"}");return c}f("filters").add("haml",function b(c,a,g){var g=g||0,e=f("abbreviationUtils");g||(c=f("filters").apply(c,"_format",a));
|
|
|
|
|
d.each(c.children,function(c){if(!e.isSnippet(c)&&c.parent){var d=f("abbreviationUtils"),o=f("utils"),l=h(c,a),m=a.cursor(),d=d.isUnary(c),p=a.self_closing_tag&&d?"/":"",r="",r="%"+a.tagName(c.name());r.toLowerCase()=="%div"&&l&&l.indexOf("{")==-1&&(r="");c.end="";c.start=o.replaceSubstring(c.start,r+l+p+" ",c.start.indexOf("%s"),"%s");!c.children.length&&!d&&(c.start+=m)}b(c,a,g+1)});return c})});
|
|
|
|
|
emmet.exec(function(f,d){function h(f,b){var c=b.attributeQuote(),a=b.cursor();return d.map(f.attributeList(),function(d){return" "+b.attributeName(d.name)+"="+c+(d.value||a)+c}).join("")}f("filters").add("html",function b(c,a,g){var g=g||0,e=f("abbreviationUtils");g||(c=f("filters").apply(c,"_format",a));d.each(c.children,function(c){if(!e.isSnippet(c)&&c.parent){var d=f("abbreviationUtils"),o=f("utils"),l=h(c,a),m=a.cursor(),d=d.isUnary(c),p="",r="";if(!c.isTextNode()){var q=a.tagName(c.name());
|
|
|
|
|
d?(p="<"+q+l+a.selfClosing()+">",c.end=""):(p="<"+q+l+">",r="</"+q+">")}c.start=o.replaceSubstring(c.start,p,c.start.indexOf("%s"),"%s");c.end=o.replaceSubstring(c.end,r,c.end.indexOf("%s"),"%s");!c.children.length&&!d&&!~c.content.indexOf(m)&&!f("tabStops").extract(c.content).tabstops.length&&(c.start+=m)}b(c,a,g+1)});return c})});
|
|
|
|
|
emmet.exec(function(f,d){var h=/^\s+/,i=/[\n\r]/g;f("filters").add("s",function c(a){var g=f("abbreviationUtils");d.each(a.children,function(a){if(!g.isSnippet(a))a.start=a.start.replace(h,""),a.end=a.end.replace(h,"");a.start=a.start.replace(i,"");a.end=a.end.replace(i,"");a.content=a.content.replace(i,"");c(a)});return a})});
|
|
|
|
|
emmet.exec(function(f,d){function h(f,b){d.each(f.children,function(c){if(c.content)c.content=c.content.replace(b,"");h(c,b)});return f}f("preferences").define("filter.trimRegexp","[\\s|\\u00a0]*[\\d|#|\\-|*|\\u2022]+\\.?\\s*","Regular expression used to remove list markers (numbers, dashes, bullets, etc.) in <code>t</code> (trim) filter. The trim filter is useful for wrapping with abbreviation lists, pased from other documents (for example, Word documents).");f("filters").add("t",function(d){var b=
|
|
|
|
|
RegExp(f("preferences").get("filter.trimRegexp"));return h(d,b)})});emmet.exec(function(f,d){var h={"xsl:variable":1,"xsl:with-param":1};f("filters").add("xsl",function b(c){var a=f("abbreviationUtils");d.each(c.children,function(c){if(!a.isSnippet(c)&&(c.name()||"").toLowerCase()in h&&c.children.length)c.start=c.start.replace(/\s+select\s*=\s*(['"]).*?\1/,"");b(c)});return c})});
|
|
|
|
|
emmet.exec(function(f,d){function h(a,b){return Math.round(Math.random()*(b-a)+a)}function i(a,b){for(var c=a.length,g=Math.min(c,b),f=[];f.length<g;){var i=h(0,c-1);d.include(f,i)||f.push(i)}return d.map(f,function(b){return a[b]})}function b(a,b){a.length&&(a[0]=a[0].charAt(0).toUpperCase()+a[0].substring(1));return a.join(" ")+(b||(d.isString("?!...")?"?!...".charAt(h(0,4)):"?!..."[h(0,4)]))}function c(a){var b=a.length,c=0,c=b>3&&b<=6?h(0,1):b>6&&b<=12?h(0,2):h(1,4);d.each(i(d.range(c)),function(b){a[b]+=
|
|
|
|
|
","})}f("abbreviationParser").addPreprocessor(function(d){var f=/^(?:lorem|lipsum)(\d*)$/i,n;d.findAll(function(d){if(d._name&&(n=d._name.match(f))){var e=n[1]||30;d._name="";d.data("forceNameResolving",d.isRepeating()||d.attributeList().length);d.data("pasteOverwrites",!0);d.data("paste",function(d){var f=e,j=!d,d=[],n=0,f=parseInt(f,10);j&&(j=a.slice(0,f),j.length>5&&(j[4]+=","),n+=j.length,d.push(b(j,".")));for(;n<f;)j=i(g,Math.min(h(3,12)*h(1,5),f-n)),n+=j.length,c(j),d.push(b(j));return d.join(" ")})}})});
|
|
|
|
|
var a="lorem ipsum dolor sit amet consectetur adipisicing elit".split(" "),g=["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus",
|
|
|
|
|
"tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus",
|
|
|
|
|
"quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod",
|
|
|
|
|
"explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]});emmet.exec(function(f){f("actions").add("select_line",function(d){var f=d.getCurrentLineRange();d.createSelection(f.start,f.end);return!0})});
|
|
|
|
|
emmet.exec(function(f){f("resources").setVocabulary({variables:{lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"},css:{filters:"html",snippets:{"@i":"@import url(|);","@import":"@import url(|);","@m":"@media ${1:screen} {\n\t|\n}","@media":"@media ${1:screen} {\n\t|\n}","@f":"@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}","@f+":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}",
|
|
|
|
|
"@kf":"@-webkit-keyframes ${1:identifier} {\n\t${2:from} { ${3} }${6}\n\t${4:to} { ${5} }\n}\n@-o-keyframes ${1:identifier} {\n\t${2:from} { ${3} }${6}\n\t${4:to} { ${5} }\n}\n@-moz-keyframes ${1:identifier} {\n\t${2:from} { ${3} }${6}\n\t${4:to} { ${5} }\n}\n@keyframes ${1:identifier} {\n\t${2:from} { ${3} }${6}\n\t${4:to} { ${5} }\n}",anim:"animation:|;","anim-":"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode};",animdel:"animation-delay:${1:time};",
|
|
|
|
|
animdir:"animation-direction:${1:normal};","animdir:n":"animation-direction:normal;","animdir:r":"animation-direction:reverse;","animdir:a":"animation-direction:alternate;","animdir:ar":"animation-direction:alternate-reverse;",animdur:"animation-duration:${1:0}s;",animfm:"animation-fill-mode:${1:both};","animfm:f":"animation-fill-mode:forwards;","animfm:b":"animation-fill-mode:backwards;","animfm:bt":"animation-fill-mode:both;","animfm:bh":"animation-fill-mode:both;",animic:"animation-iteration-count:${1:1};",
|
|
|
|
|
"animic:i":"animation-iteration-count:infinite;",animn:"animation-name:${1:none};",animps:"animation-play-state:${1:running};","animps:p":"animation-play-state:paused;","animps:r":"animation-play-state:running;",animtf:"animation-timing-function:${1:linear};","animtf:e":"animation-timing-function:ease;","animtf:ei":"animation-timing-function:ease-in;","animtf:eo":"animation-timing-function:ease-out;","animtf:eio":"animation-timing-function:ease-in-out;","animtf:l":"animation-timing-function:linear;",
|
|
|
|
|
"animtf:cb":"animation-timing-function:cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1});",ap:"appearance:${none}","!":"!important",pos:"position:${1:relative};","pos:s":"position:static;","pos:a":"position:absolute;","pos:r":"position:relative;","pos:f":"position:fixed;",t:"top:|;","t:a":"top:auto;",r:"right:|;","r:a":"right:auto;",b:"bottom:|;","b:a":"bottom:auto;",l:"left:|;","l:a":"left:auto;",z:"z-index:|;","z:a":"z-index:auto;",fl:"float:${1:left};","fl:n":"float:none;","fl:l":"float:left;",
|
|
|
|
|
"fl:r":"float:right;",cl:"clear:${1:both};","cl:n":"clear:none;","cl:l":"clear:left;","cl:r":"clear:right;","cl:b":"clear:both;",colm:"columns:|;",colmc:"column-count:|;",colmf:"column-fill:|;",colmg:"column-gap:|;",colmr:"column-rule:|;",colmrc:"column-rule-color:|;",colmrs:"column-rule-style:|;",colmrw:"column-rule-width:|;",colms:"column-span:|;",colmw:"column-width:|;",d:"display:${1:block};","d:n":"display:none;","d:b":"display:block;","d:i":"display:inline;","d:ib":"display:inline-block;","d:li":"display:list-item;",
|
|
|
|
|
"d:ri":"display:run-in;","d:cp":"display:compact;","d:tb":"display:table;","d:itb":"display:inline-table;","d:tbcp":"display:table-caption;","d:tbcl":"display:table-column;","d:tbclg":"display:table-column-group;","d:tbhg":"display:table-header-group;","d:tbfg":"display:table-footer-group;","d:tbr":"display:table-row;","d:tbrg":"display:table-row-group;","d:tbc":"display:table-cell;","d:rb":"display:ruby;","d:rbb":"display:ruby-base;","d:rbbg":"display:ruby-base-group;","d:rbt":"display:ruby-text;",
|
|
|
|
|
"d:rbtg":"display:ruby-text-group;",v:"visibility:${1:hidden};","v:v":"visibility:visible;","v:h":"visibility:hidden;","v:c":"visibility:collapse;",ov:"overflow:${1:hidden};","ov:v":"overflow:visible;","ov:h":"overflow:hidden;","ov:s":"overflow:scroll;","ov:a":"overflow:auto;",ovx:"overflow-x:${1:hidden};","ovx:v":"overflow-x:visible;","ovx:h":"overflow-x:hidden;","ovx:s":"overflow-x:scroll;","ovx:a":"overflow-x:auto;",ovy:"overflow-y:${1:hidden};","ovy:v":"overflow-y:visible;","ovy:h":"overflow-y:hidden;",
|
|
|
|
|
"ovy:s":"overflow-y:scroll;","ovy:a":"overflow-y:auto;",ovs:"overflow-style:${1:scrollbar};","ovs:a":"overflow-style:auto;","ovs:s":"overflow-style:scrollbar;","ovs:p":"overflow-style:panner;","ovs:m":"overflow-style:move;","ovs:mq":"overflow-style:marquee;",zoo:"zoom:1;",zm:"zoom:1;",cp:"clip:|;","cp:a":"clip:auto;","cp:r":"clip:rect(${1:top} ${2:right} ${3:bottom} ${4:left});",bxz:"box-sizing:${1:border-box};","bxz:cb":"box-sizing:content-box;","bxz:bb":"box-sizing:border-box;",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:color};",
|
|
|
|
|
"bxsh:r":"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:spread }rgb(${6:0}, ${7:0}, ${8:0});","bxsh:ra":"box-shadow:${1:inset }${2:h} ${3:v} ${4:blur} ${5:spread }rgba(${6:0}, ${7:0}, ${8:0}, .${9:5});","bxsh:n":"box-shadow:none;",m:"margin:|;","m:a":"margin:auto;",mt:"margin-top:|;","mt:a":"margin-top:auto;",mr:"margin-right:|;","mr:a":"margin-right:auto;",mb:"margin-bottom:|;","mb:a":"margin-bottom:auto;",ml:"margin-left:|;","ml:a":"margin-left:auto;",p:"padding:|;",pt:"padding-top:|;",
|
|
|
|
|
pr:"padding-right:|;",pb:"padding-bottom:|;",pl:"padding-left:|;",w:"width:|;","w:a":"width:auto;",h:"height:|;","h:a":"height:auto;",maw:"max-width:|;","maw:n":"max-width:none;",mah:"max-height:|;","mah:n":"max-height:none;",miw:"min-width:|;",mih:"min-height:|;",mar:"max-resolution:${1:res};",mir:"min-resolution:${1:res};",ori:"orientation:|;","ori:l":"orientation:landscape;","ori:p":"orientation:portrait;",ol:"outline:|;","ol:n":"outline:none;",olo:"outline-offset:|;",olw:"outline-width:|;",ols:"outline-style:|;",
|
|
|
|
|
olc:"outline-color:#${1:000};","olc:i":"outline-color:invert;",bd:"border:|;","bd+":"border:${1:1px} ${2:solid} ${3:#000};","bd:n":"border:none;",bdbk:"border-break:${1:close};","bdbk:c":"border-break:close;",bdcl:"border-collapse:|;","bdcl:c":"border-collapse:collapse;","bdcl:s":"border-collapse:separate;",bdc:"border-color:#${1:000};","bdc:t":"border-color:transparent;",bdi:"border-image:url(|);","bdi:n":"border-image:none;",bdti:"border-top-image:url(|);","bdti:n":"border-top-image:none;",bdri:"border-right-image:url(|);",
|
|
|
|
|
"bdri:n":"border-right-image:none;",bdbi:"border-bottom-image:url(|);","bdbi:n":"border-bottom-image:none;",bdli:"border-left-image:url(|);","bdli:n":"border-left-image:none;",bdci:"border-corner-image:url(|);","bdci:n":"border-corner-image:none;","bdci:c":"border-corner-image:continue;",bdtli:"border-top-left-image:url(|);","bdtli:n":"border-top-left-image:none;","bdtli:c":"border-top-left-image:continue;",bdtri:"border-top-right-image:url(|);","bdtri:n":"border-top-right-image:none;","bdtri:c":"border-top-right-image:continue;",
|
|
|
|
|
bdbri:"border-bottom-right-image:url(|);","bdbri:n":"border-bottom-right-image:none;","bdbri:c":"border-bottom-right-image:continue;",bdbli:"border-bottom-left-image:url(|);","bdbli:n":"border-bottom-left-image:none;","bdbli:c":"border-bottom-left-image:continue;",bdf:"border-fit:${1:repeat};","bdf:c":"border-fit:clip;","bdf:r":"border-fit:repeat;","bdf:sc":"border-fit:scale;","bdf:st":"border-fit:stretch;","bdf:ow":"border-fit:overwrite;","bdf:of":"border-fit:overflow;","bdf:sp":"border-fit:space;",
|
|
|
|
|
bdlen:"border-length:|;","bdlen:a":"border-length:auto;",bdsp:"border-spacing:|;",bds:"border-style:|;","bds:n":"border-style:none;","bds:h":"border-style:hidden;","bds:dt":"border-style:dotted;","bds:ds":"border-style:dashed;","bds:s":"border-style:solid;","bds:db":"border-style:double;","bds:dtds":"border-style:dot-dash;","bds:dtdtds":"border-style:dot-dot-dash;","bds:w":"border-style:wave;","bds:g":"border-style:groove;","bds:r":"border-style:ridge;","bds:i":"border-style:inset;","bds:o":"border-style:outset;",
|
|
|
|
|
bdw:"border-width:|;",bdtw:"border-top-width:|;",bdrw:"border-right-width:|;",bdbw:"border-bottom-width:|;",bdlw:"border-left-width:|;",bdt:"border-top:|;",bt:"border-top:|;","bdt+":"border-top:${1:1px} ${2:solid} ${3:#000};","bdt:n":"border-top:none;",bdts:"border-top-style:|;","bdts:n":"border-top-style:none;",bdtc:"border-top-color:#${1:000};","bdtc:t":"border-top-color:transparent;",bdr:"border-right:|;",br:"border-right:|;","bdr+":"border-right:${1:1px} ${2:solid} ${3:#000};","bdr:n":"border-right:none;",
|
|
|
|
|
bdrst:"border-right-style:|;","bdrst:n":"border-right-style:none;",bdrc:"border-right-color:#${1:000};","bdrc:t":"border-right-color:transparent;",bdb:"border-bottom:|;",bb:"border-bottom:|;","bdb+":"border-bottom:${1:1px} ${2:solid} ${3:#000};","bdb:n":"border-bottom:none;",bdbs:"border-bottom-style:|;","bdbs:n":"border-bottom-style:none;",bdbc:"border-bottom-color:#${1:000};","bdbc:t":"border-bottom-color:transparent;",bdl:"border-left:|;",bl:"border-left:|;","bdl+":"border-left:${1:1px} ${2:solid} ${3:#000};",
|
|
|
|
|
"bdl:n":"border-left:none;",bdls:"border-left-style:|;","bdls:n":"border-left-style:none;",bdlc:"border-left-color:#${1:000};","bdlc:t":"border-left-color:transparent;",bdrs:"border-radius:|;",bdtrrs:"border-top-right-radius:|;",bdtlrs:"border-top-left-radius:|;",bdbrrs:"border-bottom-right-radius:|;",bdblrs:"border-bottom-left-radius:|;",bg:"background:|;","bg+":"background:${1:#fff} url(${2}) ${3:0} ${4:0} ${5:no-repeat};","bg:n":"background:none;","bg:ie":"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1:x}.png',sizingMethod='${2:crop}');",
|
|
|
|
|
bgc:"background-color:#${1:fff};","bgc:t":"background-color:transparent;",bgi:"background-image:url(|);","bgi:n":"background-image:none;",bgr:"background-repeat:|;","bgr:n":"background-repeat:no-repeat;","bgr:x":"background-repeat:repeat-x;","bgr:y":"background-repeat:repeat-y;","bgr:sp":"background-repeat:space;","bgr:rd":"background-repeat:round;",bga:"background-attachment:|;","bga:f":"background-attachment:fixed;","bga:s":"background-attachment:scroll;",bgp:"background-position:${1:0} ${2:0};",
|
|
|
|
|
bgpx:"background-position-x:|;",bgpy:"background-position-y:|;",bgbk:"background-break:|;","bgbk:bb":"background-break:bounding-box;","bgbk:eb":"background-break:each-box;","bgbk:c":"background-break:continuous;",bgcp:"background-clip:${1:padding-box};","bgcp:bb":"background-clip:border-box;","bgcp:pb":"background-clip:padding-box;","bgcp:cb":"background-clip:content-box;","bgcp:nc":"background-clip:no-clip;",bgo:"background-origin:|;","bgo:pb":"background-origin:padding-box;","bgo:bb":"background-origin:border-box;",
|
|
|
|
|
"bgo:cb":"background-origin:content-box;",bgsz:"background-size:|;","bgsz:a":"background-size:auto;","bgsz:ct":"background-size:contain;","bgsz:cv":"background-size:cover;",c:"color:#${1:000};","c:r":"color:rgb(${1:0}, ${2:0}, ${3:0});","c:ra":"color:rgba(${1:0}, ${2:0}, ${3:0}, .${4:5});",cm:"/* |${child} */",cnt:"content:'|';","cnt:n":"content:normal;","cnt:oq":"content:open-quote;","cnt:noq":"content:no-open-quote;","cnt:cq":"content:close-quote;","cnt:ncq":"content:no-close-quote;","cnt:a":"content:attr(|);",
|
|
|
|
|
"cnt:c":"content:counter(|);","cnt:cs":"content:counters(|);",tbl:"table-layout:|;","tbl:a":"table-layout:auto;","tbl:f":"table-layout:fixed;",cps:"caption-side:|;","cps:t":"caption-side:top;","cps:b":"caption-side:bottom;",ec:"empty-cells:|;","ec:s":"empty-cells:show;","ec:h":"empty-cells:hide;",lis:"list-style:|;","lis:n":"list-style:none;",lisp:"list-style-position:|;","lisp:i":"list-style-position:inside;","lisp:o":"list-style-position:outside;",list:"list-style-type:|;","list:n":"list-style-type:none;",
|
|
|
|
|
"list:d":"list-style-type:disc;","list:c":"list-style-type:circle;","list:s":"list-style-type:square;","list:dc":"list-style-type:decimal;","list:dclz":"list-style-type:decimal-leading-zero;","list:lr":"list-style-type:lower-roman;","list:ur":"list-style-type:upper-roman;",lisi:"list-style-image:|;","lisi:n":"list-style-image:none;",q:"quotes:|;","q:n":"quotes:none;","q:ru":"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C';","q:en":"quotes:'\\201C' '\\201D' '\\2018' '\\2019';",ct:"content:|;","ct:n":"content:normal;",
|
|
|
|
|
"ct:oq":"content:open-quote;","ct:noq":"content:no-open-quote;","ct:cq":"content:close-quote;","ct:ncq":"content:no-close-quote;","ct:a":"content:attr(|);","ct:c":"content:counter(|);","ct:cs":"content:counters(|);",coi:"counter-increment:|;",cor:"counter-reset:|;",va:"vertical-align:${1:top};","va:sup":"vertical-align:super;","va:t":"vertical-align:top;","va:tt":"vertical-align:text-top;","va:m":"vertical-align:middle;","va:bl":"vertical-align:baseline;","va:b":"vertical-align:bottom;","va:tb":"vertical-align:text-bottom;",
|
|
|
|
|
"va:sub":"vertical-align:sub;",ta:"text-align:${1:left};","ta:l":"text-align:left;","ta:c":"text-align:center;","ta:r":"text-align:right;","ta:j":"text-align:justify;","ta-lst":"text-align-last:|;","tal:a":"text-align-last:auto;","tal:l":"text-align-last:left;","tal:c":"text-align-last:center;","tal:r":"text-align-last:right;",td:"text-decoration:${1:none};","td:n":"text-decoration:none;","td:u":"text-decoration:underline;","td:o":"text-decoration:overline;","td:l":"text-decoration:line-through;",
|
|
|
|
|
te:"text-emphasis:|;","te:n":"text-emphasis:none;","te:ac":"text-emphasis:accent;","te:dt":"text-emphasis:dot;","te:c":"text-emphasis:circle;","te:ds":"text-emphasis:disc;","te:b":"text-emphasis:before;","te:a":"text-emphasis:after;",th:"text-height:|;","th:a":"text-height:auto;","th:f":"text-height:font-size;","th:t":"text-height:text-size;","th:m":"text-height:max-size;",ti:"text-indent:|;","ti:-":"text-indent:-9999px;",tj:"text-justify:|;","tj:a":"text-justify:auto;","tj:iw":"text-justify:inter-word;",
|
|
|
|
|
"tj:ii":"text-justify:inter-ideograph;","tj:ic":"text-justify:inter-cluster;","tj:d":"text-justify:distribute;","tj:k":"text-justify:kashida;","tj:t":"text-justify:tibetan;",tov:"text-overflow:${ellipsis};","tov:e":"text-overflow:ellipsis;","tov:c":"text-overflow:clip;",to:"text-outline:|;","to+":"text-outline:${1:0} ${2:0} ${3:#000};","to:n":"text-outline:none;",tr:"text-replace:|;","tr:n":"text-replace:none;",tt:"text-transform:${1:uppercase};","tt:n":"text-transform:none;","tt:c":"text-transform:capitalize;",
|
|
|
|
|
"tt:u":"text-transform:uppercase;","tt:l":"text-transform:lowercase;",tw:"text-wrap:|;","tw:n":"text-wrap:normal;","tw:no":"text-wrap:none;","tw:u":"text-wrap:unrestricted;","tw:s":"text-wrap:suppress;",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000};","tsh:r":"text-shadow:${1:h} ${2:v} ${3:blur} rgb(${4:0}, ${5:0}, ${6:0});","tsh:ra":"text-shadow:${1:h} ${2:v} ${3:blur} rgba(${4:0}, ${5:0}, ${6:0}, .${7:5});","tsh+":"text-shadow:${1:0} ${2:0} ${3:0} ${4:#000};","tsh:n":"text-shadow:none;",
|
|
|
|
|
trf:"transform:|;","trf:skx":"transform: skewX(${1:angle});","trf:sky":"transform: skewY(${1:angle});","trf:sc":"transform: scale(${1:x}, ${2:y});","trf:scx":"transform: scaleX(${1:x});","trf:scy":"transform: scaleY(${1:y});","trf:r":"transform: rotate(${1:angle});","trf:t":"transform: translate(${1:x}, ${2:y});","trf:tx":"transform: translateX(${1:x});","trf:ty":"transform: translateY(${1:y});",trfo:"transform-origin:|;",trfs:"transform-style:${1:preserve-3d};",trs:"transition:${1:prop} ${2:time};",
|
|
|
|
|
trsde:"transition-delay:${1:time};",trsdu:"transition-duration:${1:time};",trsp:"transition-property:${1:prop};",trstf:"transition-timing-function:${1:tfunc};",lh:"line-height:|;",whs:"white-space:|;","whs:n":"white-space:normal;","whs:p":"white-space:pre;","whs:nw":"white-space:nowrap;","whs:pw":"white-space:pre-wrap;","whs:pl":"white-space:pre-line;",whsc:"white-space-collapse:|;","whsc:n":"white-space-collapse:normal;","whsc:k":"white-space-collapse:keep-all;","whsc:l":"white-space-collapse:loose;",
|
|
|
|
|
"whsc:bs":"white-space-collapse:break-strict;","whsc:ba":"white-space-collapse:break-all;",wob:"word-break:|;","wob:n":"word-break:normal;","wob:k":"word-break:keep-all;","wob:l":"word-break:loose;","wob:bs":"word-break:break-strict;","wob:ba":"word-break:break-all;",wos:"word-spacing:|;",wow:"word-wrap:|;","wow:nm":"word-wrap:normal;","wow:n":"word-wrap:none;","wow:u":"word-wrap:unrestricted;","wow:s":"word-wrap:suppress;",lts:"letter-spacing:|;",f:"font:|;","f+":"font:${1:1em} ${2:Arial,sans-serif};",
|
|
|
|
|
fw:"font-weight:|;","fw:n":"font-weight:normal;","fw:b":"font-weight:bold;","fw:br":"font-weight:bolder;","fw:lr":"font-weight:lighter;",fs:"font-style:${italic};","fs:n":"font-style:normal;","fs:i":"font-style:italic;","fs:o":"font-style:oblique;",fv:"font-variant:|;","fv:n":"font-variant:normal;","fv:sc":"font-variant:small-caps;",fz:"font-size:|;",fza:"font-size-adjust:|;","fza:n":"font-size-adjust:none;",ff:"font-family:|;","ff:s":"font-family:serif;","ff:ss":"font-family:sans-serif;","ff:c":"font-family:cursive;",
|
|
|
|
|
"ff:f":"font-family:fantasy;","ff:m":"font-family:monospace;",fef:"font-effect:|;","fef:n":"font-effect:none;","fef:eg":"font-effect:engrave;","fef:eb":"font-effect:emboss;","fef:o":"font-effect:outline;",fem:"font-emphasize:|;",femp:"font-emphasize-position:|;","femp:b":"font-emphasize-position:before;","femp:a":"font-emphasize-position:after;",fems:"font-emphasize-style:|;","fems:n":"font-emphasize-style:none;","fems:ac":"font-emphasize-style:accent;","fems:dt":"font-emphasize-style:dot;","fems:c":"font-emphasize-style:circle;",
|
|
|
|
|
"fems:ds":"font-emphasize-style:disc;",fsm:"font-smooth:|;","fsm:a":"font-smooth:auto;","fsm:n":"font-smooth:never;","fsm:aw":"font-smooth:always;",fst:"font-stretch:|;","fst:n":"font-stretch:normal;","fst:uc":"font-stretch:ultra-condensed;","fst:ec":"font-stretch:extra-condensed;","fst:c":"font-stretch:condensed;","fst:sc":"font-stretch:semi-condensed;","fst:se":"font-stretch:semi-expanded;","fst:e":"font-stretch:expanded;","fst:ee":"font-stretch:extra-expanded;","fst:ue":"font-stretch:ultra-expanded;",
|
|
|
|
|
op:"opacity:|;","op:ie":"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);","op:ms":"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';",rsz:"resize:|;","rsz:n":"resize:none;","rsz:b":"resize:both;","rsz:h":"resize:horizontal;","rsz:v":"resize:vertical;",cur:"cursor:${pointer};","cur:a":"cursor:auto;","cur:d":"cursor:default;","cur:c":"cursor:crosshair;","cur:ha":"cursor:hand;","cur:he":"cursor:help;","cur:m":"cursor:move;","cur:p":"cursor:pointer;","cur:t":"cursor:text;",
|
|
|
|
|
pgbb:"page-break-before:|;","pgbb:au":"page-break-before:auto;","pgbb:al":"page-break-before:always;","pgbb:l":"page-break-before:left;","pgbb:r":"page-break-before:right;",pgbi:"page-break-inside:|;","pgbi:au":"page-break-inside:auto;","pgbi:av":"page-break-inside:avoid;",pgba:"page-break-after:|;","pgba:au":"page-break-after:auto;","pgba:al":"page-break-after:always;","pgba:l":"page-break-after:left;","pgba:r":"page-break-after:right;",orp:"orphans:|;",us:"user-select:${none};",wid:"widows:|;",
|
|
|
|
|
wfsm:"-webkit-font-smoothing:${antialiased};","wfsm:a":"-webkit-font-smoothing:antialiased;","wfsm:s":"-webkit-font-smoothing:subpixel-antialiased;","wfsm:sa":"-webkit-font-smoothing:subpixel-antialiased;","wfsm:n":"-webkit-font-smoothing:none;"}},html:{filters:"html",profile:"html",snippets:{"!!!":"<!doctype html>","!!!4t":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',"!!!4s":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
|
|
|
|
|
"!!!xt":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',"!!!xs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',"!!!xxs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',c:"<\!-- |${child} --\>","cc:ie6":"<\!--[if lte IE 6]>\n\t${child}|\n<![endif]--\>","cc:ie":"<\!--[if IE]>\n\t${child}|\n<![endif]--\>","cc:noie":"<\!--[if !IE]><\!--\>\n\t${child}|\n<\!--<![endif]--\>"},
|
|
|
|
|
abbreviations:{"!":"html:5",a:'<a href="">',"a:link":'<a href="http://|">',"a:mail":'<a href="mailto:|">',abbr:'<abbr title="">',acronym:'<acronym title="">',base:'<base href="" />',bdo:'<bdo dir="">',"bdo:r":'<bdo dir="rtl">',"bdo:l":'<bdo dir="ltr">',link:'<link rel="stylesheet" href="" />',"link:css":'<link rel="stylesheet" href="${1:style}.css" media="all" />',"link:print":'<link rel="stylesheet" href="${1:print}.css" media="print" />',"link:favicon":'<link rel="shortcut icon" type="image/x-icon" href="${1:favicon.ico}" />',
|
|
|
|
|
"link:touch":'<link rel="apple-touch-icon" href="${1:favicon.png}" />',"link:rss":'<link rel="alternate" type="application/rss+xml" title="RSS" href="${1:rss.xml}" />',"link:atom":'<link rel="alternate" type="application/atom+xml" title="Atom" href="${1:atom.xml}" />',"meta:utf":'<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />',"meta:win":'<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />',"meta:vp":'<meta name="viewport" content="width=${1:device-width}, user-scalable=${2:no}, initial-scale=${3:1.0}, maximum-scale=${4:1.0}, minimum-scale=${5:1.0}" />',
|
|
|
|
|
"meta:compat":'<meta http-equiv="X-UA-Compatible" content="${1:IE=7}" />',style:"<style>",script:"<script>","script:src":'<script src="">',img:'<img src="" alt="" />',iframe:'<iframe src="" frameborder="0">',embed:'<embed src="" type="" />',object:'<object data="" type="">',param:'<param name="" value="" />',map:'<map name="">',area:'<area shape="" coords="" href="" alt="" />',"area:d":'<area shape="default" href="" alt="" />',"area:c":'<area shape="circle" coords="" href="" alt="" />',"area:r":'<area shape="rect" coords="" href="" alt="" />',
|
|
|
|
|
"area:p":'<area shape="poly" coords="" href="" alt="" />',form:'<form action="">',"form:get":'<form action="" method="get">',"form:post":'<form action="" method="post">',label:'<label for="">',input:'<input type="${1:text}" />',inp:'<input type="${1:text}" name="" id="" />',"input:hidden":"input[type=hidden name]","input:h":"input:hidden","input:text":"inp","input:t":"inp","input:search":"inp[type=search]","input:email":"inp[type=email]","input:url":"inp[type=url]","input:password":"inp[type=password]",
|
|
|
|
|
"input:p":"input:password","input:datetime":"inp[type=datetime]","input:date":"inp[type=date]","input:datetime-local":"inp[type=datetime-local]","input:month":"inp[type=month]","input:week":"inp[type=week]","input:time":"inp[type=time]","input:number":"inp[type=number]","input:color":"inp[type=color]","input:checkbox":"inp[type=checkbox]","input:c":"input:checkbox","input:radio":"inp[type=radio]","input:r":"input:radio","input:range":"inp[type=range]","input:file":"inp[type=file]","input:f":"input:file",
|
|
|
|
|
"input:submit":'<input type="submit" value="" />',"input:s":"input:submit","input:image":'<input type="image" src="" alt="" />',"input:i":"input:image","input:button":'<input type="button" value="" />',"input:b":"input:button","input:reset":"input:button[type=reset]",select:'<select name="" id="">',option:'<option value="">',textarea:'<textarea name="" id="" cols="${1:30}" rows="${2:10}">',"menu:context":"menu[type=context]>","menu:c":"menu:context","menu:toolbar":"menu[type=toolbar]>","menu:t":"menu:toolbar",
|
|
|
|
|
video:'<video src="">',audio:'<audio src="">',"html:xml":'<html xmlns="http://www.w3.org/1999/xhtml">',bq:"blockquote",acr:"acronym",fig:"figure",figc:"figcaption",ifr:"iframe",emb:"embed",obj:"object",src:"source",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",opt:"option",tarea:"textarea",leg:"legend",sect:"section",art:"article",hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",
|
|
|
|
|
out:"output",det:"details",cmd:"command",doc:"html>(head>meta[charset=UTF-8]+title{${1:Document}})+body",doc4:'html>(head>meta[http-equiv="Content-Type" content="text/html;charset=${charset}"]+title{${1:Document}})',"html:4t":"!!!4t+doc4[lang=${lang}]","html:4s":"!!!4s+doc4[lang=${lang}]","html:xt":"!!!xt+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]","html:xs":"!!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]","html:xxs":"!!!xxs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
|
|
|
|
"html:5":"!!!+doc[lang=${lang}]","ol+":"ol>li","ul+":"ul>li","dl+":"dl>dt+dd","map+":"map>area","table+":"table>tr>td","colgroup+":"colgroup>col","colg+":"colgroup>col","tr+":"tr>td","select+":"select>option","optgroup+":"optgroup>option","optg+":"optgroup>option"}},xml:{"extends":"html",profile:"xml",filters:"html"},xsl:{"extends":"html",profile:"xml",filters:"html, xsl",abbreviations:{tm:'<xsl:template match="" mode="">',tmatch:"tm",tn:'<xsl:template name="">',tname:"tn",call:'<xsl:call-template name=""/>',
|
|
|
|
|
ap:'<xsl:apply-templates select="" mode=""/>',api:"<xsl:apply-imports/>",imp:'<xsl:import href=""/>',inc:'<xsl:include href=""/>',ch:"<xsl:choose>","xsl:when":'<xsl:when test="">',wh:"xsl:when",ot:"<xsl:otherwise>","if":'<xsl:if test="">',par:'<xsl:param name="">',pare:'<xsl:param name="" select=""/>',"var":'<xsl:variable name="">',vare:'<xsl:variable name="" select=""/>',wp:'<xsl:with-param name="" select=""/>',key:'<xsl:key name="" match="" use=""/>',elem:'<xsl:element name="">',attr:'<xsl:attribute name="">',
|
|
|
|
|
attrs:'<xsl:attribute-set name="">',cp:'<xsl:copy select=""/>',co:'<xsl:copy-of select=""/>',val:'<xsl:value-of select=""/>',each:'<xsl:for-each select="">',"for":"each",tex:"<xsl:text></xsl:text>",com:"<xsl:comment>",msg:'<xsl:message terminate="no">',fall:"<xsl:fallback>",num:'<xsl:number value=""/>',nam:'<namespace-alias stylesheet-prefix="" result-prefix=""/>',pres:'<xsl:preserve-space elements=""/>',strip:'<xsl:strip-space elements=""/>',proc:'<xsl:processing-instruction name="">',sort:'<xsl:sort select="" order=""/>',
|
|
|
|
|
"choose+":"xsl:choose>xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}"},snippets:{"!!!":'<?xml version="1.0" encoding="UTF-8"?>'}},haml:{filters:"haml","extends":"html",profile:"xml"},scss:{"extends":"css"},sass:{"extends":"css"},less:{"extends":"css"},stylus:{"extends":"css"}},"system")});
|
|
|
|
|
emmet.define("cm-editor-proxy",function(f,d){function h(){if(CodeMirror.version>="3.1")return CodeMirror.Pass;throw CodeMirror.Pass;}var i=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)||/Mac/.test(navigator.platform),b={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation_with_tab","Cmd-D":"match_pair_outward","Shift-Cmd-D":"match_pair_inward","Cmd-T":"matching_pair","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point",
|
|
|
|
|
"Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment","Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Alt-Up":"increment_number_by_01","Alt-Down":"decrement_number_by_01","Ctrl-Alt-Up":"increment_number_by_10","Ctrl-Alt-Down":"decrement_number_by_10","Shift-Cmd-.":"select_next_item","Shift-Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break_only"},
|
|
|
|
|
c={"text/html":"html","application/xml":"xml","text/xsl":"xsl","text/css":"css","text/x-less":"less"};CodeMirror.defineOption?CodeMirror.defineOption("profile","html"):CodeMirror.defaults.profile="html";var a={context:null,getSelectionRange:function(){var a=this.getCaretPos();return{start:a,end:a+this.getSelection().length}},createSelection:function(a,b){a==b?this.context.setCursor(this.context.posFromIndex(a)):this.context.setSelection(this.context.posFromIndex(a),this.context.posFromIndex(b))},
|
|
|
|
|
getCurrentLineRange:function(){var a=this.context.getCursor(!0);return{start:this.context.indexFromPos({line:a.line,ch:0}),end:this.context.indexFromPos({line:a.line,ch:this.context.getLine(a.line).length})}},getCaretPos:function(){return this.context.indexFromPos(this.context.getCursor(!0))},setCaretPos:function(a){this.createSelection(a,a)},getCurrentLine:function(){return this.context.getLine(this.context.getCursor(!0).line)||""},replaceContent:function(a,b,c,h){d.isUndefined(c)&&(c=d.isUndefined(b)?
|
|
|
|
|
content.length:b);d.isUndefined(b)&&(b=0);var i=f("utils");h||(a=i.padString(a,i.getLinePaddingFromPosition(this.getContent(),b)));var h=f("tabStops").extract(a,{escape:function(a){return a}}),a=h.text,l=h.tabstops[0];l?(l.start+=b,l.end+=b):l={start:a.length+b,end:a.length+b};var m=this;(this.context.operation||this.context.compoundChange).call(this.context,function(){m.context.replaceRange(a,m.context.posFromIndex(b),m.context.posFromIndex(c));m.createSelection(l.start,l.end)})},getContent:function(){return this.context.getValue()},
|
|
|
|
|
getSyntax:function(){var a=this.context.getOption("mode");a in c&&(a=c[a]);return f("actionUtils").detectSyntax(this,a)},getProfileName:function(){return this.context.getOption("profile")?this.context.getOption("profile"):f("actionUtils").detectProfile(this)},prompt:function(a){return prompt(a)},getSelection:function(){return this.context.getSelection()||""},getFilePath:function(){return location.href},setupContext:function(a){this.context=a;var b="\t";a.getOption("indentWithTabs")||(b=f("utils").repeatString(" ",
|
|
|
|
|
a.getOption("indentUnit")));f("resources").setVariable("indentation",b)},addAction:function(b,c,d){var n="emmet."+b;CodeMirror.commands[n]||(CodeMirror.commands[n]=function(c){var d;a.setupContext(c);var e;if(e=b=="expand_abbreviation_with_tab")if(!(e=a.getSelection()))e=a.getSyntax(),e=!f("resources").hasSyntax(e);if(e)d=h();else{e=!0;try{var i=f("actions").run(b,a);(b=="next_edit_point"||b=="prev_edit_point")&&c.replaceSelection("");!i&&b=="insert_formatted_line_break_only"&&(e=!1)}catch(j){}e||
|
|
|
|
|
(d=h())}return d});if(c){if(!d)if(CodeMirror.keyMap&&CodeMirror.keyMap["default"])d=CodeMirror.keyMap["default"];else{if(!CodeMirror.defaults.extraKeys)CodeMirror.defaults.extraKeys={};d=CodeMirror.defaults.extraKeys}i||(c=c.replace("Cmd","Ctrl"));d&&(d[c]=n)}}};typeof emmetKeymap!="undefined"&&(b=emmetKeymap);d.each(b,function(b,c){a.addAction(b,c)});return a});
|