diff --git a/dist/cli/handlebars/abe/printInput.js b/dist/cli/handlebars/abe/printInput.js index 023ed842..7bb17b0d 100755 --- a/dist/cli/handlebars/abe/printInput.js +++ b/dist/cli/handlebars/abe/printInput.js @@ -42,6 +42,8 @@ function printInput() { params.value = ''; } + if (typeof params.value === 'string') params.value = params.value.replace(/\"/g, '"'); + var inputClass = 'form-control form-abe'; var commonParams = 'id="' + params.key + '"\n data-id="' + params.key + '"\n value="' + params.value + '"\n maxlength="' + params.maxLength + '"\n reload="' + params.reload + '"\n tabIndex="' + params.order + '"\n data-required="' + params.required + '"\n data-display="' + params.display + '"\n data-visible="' + params.visible + '"\n data-autocomplete="' + params.autocomplete + '"\n placeholder="' + params.placeholder + '"'; diff --git a/dist/server/public/scripts/admin-compiled.js b/dist/server/public/scripts/admin-compiled.js index fe6cf9f6..d5073427 100644 --- a/dist/server/public/scripts/admin-compiled.js +++ b/dist/server/public/scripts/admin-compiled.js @@ -64,7 +64,7 @@ defineCache[id]=[id,deps,factory];}else {runFactory(id,deps,factory);}} //define //cache. Useful for AMD modules that all have IDs in the file, //but need to finally export a value to node based on one of those //IDs. -define.require=function(id){if(loaderCache[id]){return loaderCache[id];}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id];}};define.amd={};return define;}module.exports=amdefine;}).call(this,require('_process'),"/node_modules/amdefine/amdefine.js");},{"_process":46,"path":45}],2:[function(require,module,exports){},{}],3:[function(require,module,exports){'use strict';exports.__esModule=true; // istanbul ignore next +define.require=function(id){if(loaderCache[id]){return loaderCache[id];}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id];}};define.amd={};return define;}module.exports=amdefine;}).call(this,require('_process'),"/node_modules/amdefine/amdefine.js");},{"_process":35,"path":34}],2:[function(require,module,exports){},{}],3:[function(require,module,exports){'use strict';exports.__esModule=true; // istanbul ignore next function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{'default':obj};}var _handlebarsRuntime=require('./handlebars.runtime');var _handlebarsRuntime2=_interopRequireDefault(_handlebarsRuntime); // Compiler imports var _handlebarsCompilerAst=require('./handlebars/compiler/ast');var _handlebarsCompilerAst2=_interopRequireDefault(_handlebarsCompilerAst);var _handlebarsCompilerBase=require('./handlebars/compiler/base');var _handlebarsCompilerCompiler=require('./handlebars/compiler/compiler');var _handlebarsCompilerJavascriptCompiler=require('./handlebars/compiler/javascript-compiler');var _handlebarsCompilerJavascriptCompiler2=_interopRequireDefault(_handlebarsCompilerJavascriptCompiler);var _handlebarsCompilerVisitor=require('./handlebars/compiler/visitor');var _handlebarsCompilerVisitor2=_interopRequireDefault(_handlebarsCompilerVisitor);var _handlebarsNoConflict=require('./handlebars/no-conflict');var _handlebarsNoConflict2=_interopRequireDefault(_handlebarsNoConflict);var _create=_handlebarsRuntime2['default'].create;function create(){var hb=_create();hb.compile=function(input,options){return _handlebarsCompilerCompiler.compile(input,options,hb);};hb.precompile=function(input,options){return _handlebarsCompilerCompiler.precompile(input,options,hb);};hb.AST=_handlebarsCompilerAst2['default'];hb.Compiler=_handlebarsCompilerCompiler.Compiler;hb.JavaScriptCompiler=_handlebarsCompilerJavascriptCompiler2['default'];hb.Parser=_handlebarsCompilerBase.parser;hb.parse=_handlebarsCompilerBase.parse;return hb;}var inst=create();inst.create=create;_handlebarsNoConflict2['default'](inst);inst.Visitor=_handlebarsCompilerVisitor2['default'];inst['default']=inst;exports['default']=inst;module.exports=exports['default'];},{"./handlebars.runtime":4,"./handlebars/compiler/ast":6,"./handlebars/compiler/base":7,"./handlebars/compiler/compiler":9,"./handlebars/compiler/javascript-compiler":11,"./handlebars/compiler/visitor":14,"./handlebars/no-conflict":28}],4:[function(require,module,exports){'use strict';exports.__esModule=true; // istanbul ignore next function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{'default':obj};} // istanbul ignore next @@ -89,7 +89,7 @@ yy.locInfo=function(locInfo){return new yy.SourceLocation(options&&options.srcNa // they are running on the browser and thus have no need for the source-map library. var SourceMap=require('source-map');SourceNode=SourceMap.SourceNode;}}catch(err){} /* NOP */ /* istanbul ignore if: tested but not covered in istanbul due to dist build */if(!SourceNode){SourceNode=function SourceNode(line,column,srcFile,chunks){this.src='';if(chunks){this.add(chunks);}}; /* istanbul ignore next */SourceNode.prototype={add:function add(chunks){if(_utils.isArray(chunks)){chunks=chunks.join('');}this.src+=chunks;},prepend:function prepend(chunks){if(_utils.isArray(chunks)){chunks=chunks.join('');}this.src=chunks+this.src;},toStringWithSourceMap:function toStringWithSourceMap(){return {code:this.toString()};},toString:function toString(){return this.src;}};}function castChunk(chunk,codeGen,loc){if(_utils.isArray(chunk)){var ret=[];for(var i=0,len=chunk.length;i 0 +var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s +if(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function splitPath(filename){return splitPathRe.exec(filename).slice(1);}; // path.resolve([from ...], to) +// posix version +exports.resolve=function(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd(); // Skip empty and invalid entries +if(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';} // At this point the path should be resolved to a full absolute path, but +// handle relative paths to be safe (might happen when process.cwd() fails) +// Normalize the path +resolvedPath=normalizeArray(filter(resolvedPath.split('/'),function(p){return !!p;}),!resolvedAbsolute).join('/');return (resolvedAbsolute?'/':'')+resolvedPath||'.';}; // path.normalize(path) +// posix version +exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==='/'; // Normalize the path +path=normalizeArray(filter(path.split('/'),function(p){return !!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return (isAbsolute?'/':'')+path;}; // posix version +exports.isAbsolute=function(path){return path.charAt(0)==='/';}; // posix version +exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));}; // path.relative(from, to) +// posix version +exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return [];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=internals.parseObject(chain,val,options);}else {obj[cleanRoot]=internals.parseObject(chain,val,options);}}return obj;};internals.parseKeys=function(givenKey,val,options){if(!givenKey){return;} // Transform dot notation to bracket notation +var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,'[$1]'):givenKey; // The regex chunks +var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g; // Get the parent +var segment=parent.exec(key); // Stash the parent if it exists +var keys=[];if(segment[1]){ // If we aren't using plain objects, optionally prefix keys +// that would overwrite object prototype properties +if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])){if(!options.allowPrototypes){return;}}keys.push(segment[1]);} // Loop through children appending to the array until we hit depth +var i=0;while((segment=child.exec(key))!==null&&i=0x30&&c<=0x39|| // 0-9 +c>=0x41&&c<=0x5A|| // a-z +c>=0x61&&c<=0x7A // A-Z +){out+=string.charAt(i);continue;}if(c<0x80){out=out+hexTable[c];continue;}if(c<0x800){out=out+(hexTable[0xC0|c>>6]+hexTable[0x80|c&0x3F]);continue;}if(c<0xD800||c>=0xE000){out=out+(hexTable[0xE0|c>>12]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F]);continue;}i+=1;c=0x10000+((c&0x3FF)<<10|string.charCodeAt(i)&0x3FF);out+=hexTable[0xF0|c>>18]+hexTable[0x80|c>>12&0x3F]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];}return out;};exports.compact=function(obj,references){if((typeof obj==="undefined"?"undefined":_typeof(obj))!=='object'||obj===null){return obj;}var refs=references||[];var lookup=refs.indexOf(obj);if(lookup!==-1){return refs[lookup];}refs.push(obj);if(Array.isArray(obj)){var compacted=[];for(var i=0;i0);return encoded;}; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string via the out parameter. - */exports.decode=function base64VLQ_decode(aStr,aIndex,aOutParam){var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do {if(aIndex>=strLen){throw new Error("Expected more digits in base 64 VLQ value.");}digit=base64.decode(aStr.charCodeAt(aIndex++));if(digit===-1){throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1));}continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<=strLen){throw new Error("Expected more digits in base 64 VLQ value.");}digit=base64.decode(aStr.charCodeAt(aIndex++));if(digit===-1){throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1));}continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<=0){if(aCompare(aHaystack[index],aHaystack[index-1],true)!==0){break;}--index;}return index;};});},{"amdefine":1}],38:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* +while(index-1>=0){if(aCompare(aHaystack[index],aHaystack[index-1],true)!==0){break;}--index;}return index;};});},{"amdefine":1}],45:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2014 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -606,7 +715,7 @@ this._last={generatedLine:-1,generatedColumn:0};} /** * performance. The return value must NOT be mutated, and should be treated as * an immutable borrow. If you want to take ownership, you must make your own * copy. - */MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositionsInflated);this._sorted=true;}return this._array;};exports.MappingList=MappingList;});},{"./util":43,"amdefine":1}],39:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositionsInflated);this._sorted=true;}return this._array;};exports.MappingList=MappingList;});},{"./util":50,"amdefine":1}],46:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -673,7 +782,7 @@ doQuickSort(ary,comparator,p,q-1);doQuickSort(ary,comparator,q+1,r);}} /** * An array to sort. * @param {function} comparator * Function to use to compare two items. - */exports.quickSort=function(ary,comparator){doQuickSort(ary,comparator,0,ary.length-1);};});},{"amdefine":1}],40:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */exports.quickSort=function(ary,comparator){doQuickSort(ary,comparator,0,ary.length-1);};});},{"amdefine":1}],47:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -993,7 +1102,7 @@ if(section.consumer.sources.indexOf(util.getArg(aArgs,'source'))===-1){continue; // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. -var adjustedMapping={source:source,generatedLine:mapping.generatedLine+(section.generatedOffset.generatedLine-1),generatedColumn:mapping.column+(section.generatedOffset.generatedLine===mapping.generatedLine)?section.generatedOffset.generatedColumn-1:0,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:name};this.__generatedMappings.push(adjustedMapping);if(typeof adjustedMapping.originalLine==='number'){this.__originalMappings.push(adjustedMapping);}};};quickSort(this.__generatedMappings,util.compareByGeneratedPositionsDeflated);quickSort(this.__originalMappings,util.compareByOriginalPositions);};exports.IndexedSourceMapConsumer=IndexedSourceMapConsumer;});},{"./array-set":34,"./base64-vlq":35,"./binary-search":37,"./quick-sort":39,"./util":43,"amdefine":1}],41:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* +var adjustedMapping={source:source,generatedLine:mapping.generatedLine+(section.generatedOffset.generatedLine-1),generatedColumn:mapping.column+(section.generatedOffset.generatedLine===mapping.generatedLine)?section.generatedOffset.generatedColumn-1:0,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:name};this.__generatedMappings.push(adjustedMapping);if(typeof adjustedMapping.originalLine==='number'){this.__originalMappings.push(adjustedMapping);}};};quickSort(this.__generatedMappings,util.compareByGeneratedPositionsDeflated);quickSort(this.__originalMappings,util.compareByOriginalPositions);};exports.IndexedSourceMapConsumer=IndexedSourceMapConsumer;});},{"./array-set":41,"./base64-vlq":42,"./binary-search":44,"./quick-sort":46,"./util":50,"amdefine":1}],48:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1066,7 +1175,7 @@ result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOr * Externalize the source map. */SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file;}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot;}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot);}return map;}; /** * Render the source map being generated to a string. - */SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON());};exports.SourceMapGenerator=SourceMapGenerator;});},{"./array-set":34,"./base64-vlq":35,"./mapping-list":38,"./util":43,"amdefine":1}],42:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON());};exports.SourceMapGenerator=SourceMapGenerator;});},{"./array-set":41,"./base64-vlq":42,"./mapping-list":45,"./util":50,"amdefine":1}],49:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1165,7 +1274,7 @@ aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapCo * Returns the string representation of this source node along with a source * map. */SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name});}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true;}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false;}for(var idx=0,length=chunk.length;idxaStr2){return 1;}return -1;} /** * Comparator between two mappings with inflated source and name strings where * the generated positions are compared. - */function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp!==0){return cmp;}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp!==0){return cmp;}return strcmp(mappingA.name,mappingB.name);};exports.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;});},{"amdefine":1}],44:[function(require,module,exports){(function(global){ // Best place to find information on XHR features is: -// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest -var reqfields=['responseType','withCredentials','timeout','onprogress']; // Simple and small ajax function -// Takes a parameters object and a callback function -// Parameters: -// - url: string, required -// - headers: object of `{header_name: header_value, ...}` -// - body: -// + string (sets content type to 'application/x-www-form-urlencoded' if not set in headers) -// + FormData (doesn't set content type so that browser will set as appropriate) -// - method: 'GET', 'POST', etc. Defaults to 'GET' or 'POST' based on body -// - cors: If your using cross-origin, you will need this true for IE8-9 -// -// The following parameters are passed onto the xhr object. -// IMPORTANT NOTE: The caller is responsible for compatibility checking. -// - responseType: string, various compatability, see xhr docs for enum options -// - withCredentials: boolean, IE10+, CORS only -// - timeout: long, ms timeout, IE8+ -// - onprogress: callback, IE10+ -// -// Callback function prototype: -// - statusCode from request -// - response -// + if responseType set and supported by browser, this is an object of some type (see docs) -// + otherwise if request completed, this is the string text of the response -// + if request is aborted, this is "Abort" -// + if request times out, this is "Timeout" -// + if request errors before completing (probably a CORS issue), this is "Error" -// - request object -// -// Returns the request object. So you can call .abort() or other methods -// -// DEPRECATIONS: -// - Passing a string instead of the params object has been removed! -// -exports.ajax=function(params,callback){ // Any variable used more than once is var'd here because -// minification will munge the variables whereas it can't munge -// the object access. -var headers=params.headers||{},body=params.body,method=params.method||(body?'POST':'GET'),called=false;var req=getRequest(params.cors);function cb(statusCode,responseText){return function(){if(!called){callback(req.status===undefined?statusCode:req.status,req.status===0?"Error":req.response||req.responseText||responseText,req);called=true;}};}req.open(method,params.url,true);var success=req.onload=cb(200);req.onreadystatechange=function(){if(req.readyState===4)success();};req.onerror=cb(null,'Error');req.ontimeout=cb(null,'Timeout');req.onabort=cb(null,'Abort');if(body){setDefault(headers,'X-Requested-With','XMLHttpRequest');if(!global.FormData||!(body instanceof global.FormData)){setDefault(headers,'Content-Type','application/x-www-form-urlencoded');}}for(var i=0,len=reqfields.length,field;i 0 -var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s -if(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function splitPath(filename){return splitPathRe.exec(filename).slice(1);}; // path.resolve([from ...], to) -// posix version -exports.resolve=function(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd(); // Skip empty and invalid entries -if(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';} // At this point the path should be resolved to a full absolute path, but -// handle relative paths to be safe (might happen when process.cwd() fails) -// Normalize the path -resolvedPath=normalizeArray(filter(resolvedPath.split('/'),function(p){return !!p;}),!resolvedAbsolute).join('/');return (resolvedAbsolute?'/':'')+resolvedPath||'.';}; // path.normalize(path) -// posix version -exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==='/'; // Normalize the path -path=normalizeArray(filter(path.split('/'),function(p){return !!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return (isAbsolute?'/':'')+path;}; // posix version -exports.isAbsolute=function(path){return path.charAt(0)==='/';}; // posix version -exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));}; // path.relative(from, to) -// posix version -exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return [];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=parseObject(chain,val,options);}else {obj[cleanRoot]=parseObject(chain,val,options);}}return obj;};var parseKeys=function parseKeys(givenKey,val,options){if(!givenKey){return;} // Transform dot notation to bracket notation -var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,'[$1]'):givenKey; // The regex chunks -var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g; // Get the parent -var segment=parent.exec(key); // Stash the parent if it exists -var keys=[];if(segment[1]){ // If we aren't using plain objects, optionally prefix keys -// that would overwrite object prototype properties -if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])){if(!options.allowPrototypes){return;}}keys.push(segment[1]);} // Loop through children appending to the array until we hit depth -var i=0;while((segment=child.exec(key))!==null&&i=0x30&&c<=0x39|| // 0-9 -c>=0x41&&c<=0x5A|| // a-z -c>=0x61&&c<=0x7A // A-Z -){out+=string.charAt(i);continue;}if(c<0x80){out=out+hexTable[c];continue;}if(c<0x800){out=out+(hexTable[0xC0|c>>6]+hexTable[0x80|c&0x3F]);continue;}if(c<0xD800||c>=0xE000){out=out+(hexTable[0xE0|c>>12]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F]);continue;}i+=1;c=0x10000+((c&0x3FF)<<10|string.charCodeAt(i)&0x3FF);out+=hexTable[0xF0|c>>18]+hexTable[0x80|c>>12&0x3F]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];}return out;};exports.compact=function(obj,references){if((typeof obj==="undefined"?"undefined":_typeof(obj))!=='object'||obj===null){return obj;}var refs=references||[];var lookup=refs.indexOf(obj);if(lookup!==-1){return refs[lookup];}refs.push(obj);if(Array.isArray(obj)){var compacted=[];for(var i=0;i0&&select.offsetHeight>0){var value=select.querySelector('option:checked').getAttribute('clean-value');if(typeof value!=='undefined'&&value!==null&&value!==''){path+=value+'/';}else if(typeof select.value!=='undefined'&&select.value!==null&&select.value!==''){path+=select.value+'/';}}});path=path.slice(0,-1);path=path.split('/');path=path.join('/');path='/'+path.replace(/^\//,'');return path;}},{key:'_submit',value:function _submit(type){var inputs=[].slice.call(document.querySelectorAll('.form-create input'));inputs=inputs.concat([].slice.call(document.querySelectorAll('.form-create select')));var values={};Array.prototype.forEach.call(inputs,function(input){values[input.getAttribute('name')]=input.value;});var toSave=_qs2.default.stringify(values);this._ajax({url:document.location.origin+'/abe/'+type+'/?'+toSave,body:toSave,headers:{},method:'get'},function(code,responseText,request){var jsonRes=JSON.parse(responseText);if(jsonRes.success==1&&typeof jsonRes.json.abe_meta!=='undefined'&&jsonRes.json.abe_meta!==null){window.location.href=window.location.origin+'/abe/'+jsonRes.json.abe_meta.template+'?filePath='+jsonRes.json.abe_meta.link;}else {alert('error');}});}},{key:'_btnDuplicateManagerClick',value:function _btnDuplicateManagerClick(e){e.preventDefault();this._submit('duplicate');}},{key:'_btnUpdateManagerClick',value:function _btnUpdateManagerClick(e){e.preventDefault();this._submit('update');}},{key:'_btnCreateManagerClick',value:function _btnCreateManagerClick(e){e.preventDefault();this._submit('create');}}]);return FormCreate;}();exports.default=FormCreate;},{"./FolderSelect":52,"./TemplateSelect":55,"nanoajax":44,"qs":47}],54:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&select.offsetHeight>0){var value=select.querySelector('option:checked').getAttribute('clean-value');if(typeof value!=='undefined'&&value!==null&&value!==''){path+=value+'/';}else if(typeof select.value!=='undefined'&&select.value!==null&&select.value!==''){path+=select.value+'/';}}});path=path.slice(0,-1);path=path.split('/');path=path.join('/');path='/'+path.replace(/^\//,'');return path;}},{key:'_submit',value:function _submit(type){var inputs=[].slice.call(document.querySelectorAll('.form-create input'));inputs=inputs.concat([].slice.call(document.querySelectorAll('.form-create select')));var values={};Array.prototype.forEach.call(inputs,function(input){values[input.getAttribute('name')]=input.value;});var toSave=_qs2.default.stringify(values);this._ajax({url:document.location.origin+'/abe/'+type+'/?'+toSave,body:toSave,headers:{},method:'get'},function(code,responseText,request){var jsonRes=JSON.parse(responseText);if(jsonRes.success==1&&typeof jsonRes.json.abe_meta!=='undefined'&&jsonRes.json.abe_meta!==null){window.location.href=window.location.origin+'/abe/'+jsonRes.json.abe_meta.template+'?filePath='+jsonRes.json.abe_meta.link;}else {alert('error');}});}},{key:'_btnDuplicateManagerClick',value:function _btnDuplicateManagerClick(e){e.preventDefault();this._submit('duplicate');}},{key:'_btnUpdateManagerClick',value:function _btnUpdateManagerClick(e){e.preventDefault();this._submit('update');}},{key:'_btnCreateManagerClick',value:function _btnCreateManagerClick(e){e.preventDefault();this._submit('create');}}]);return FormCreate;}();exports.default=FormCreate;},{"./FolderSelect":52,"./TemplateSelect":55,"nanoajax":33,"qs":36}],54:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i 0 +var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s +if(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function splitPath(filename){return splitPathRe.exec(filename).slice(1);}; // path.resolve([from ...], to) +// posix version +exports.resolve=function(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd(); // Skip empty and invalid entries +if(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';} // At this point the path should be resolved to a full absolute path, but +// handle relative paths to be safe (might happen when process.cwd() fails) +// Normalize the path +resolvedPath=normalizeArray(filter(resolvedPath.split('/'),function(p){return !!p;}),!resolvedAbsolute).join('/');return (resolvedAbsolute?'/':'')+resolvedPath||'.';}; // path.normalize(path) +// posix version +exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==='/'; // Normalize the path +path=normalizeArray(filter(path.split('/'),function(p){return !!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return (isAbsolute?'/':'')+path;}; // posix version +exports.isAbsolute=function(path){return path.charAt(0)==='/';}; // posix version +exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));}; // path.relative(from, to) +// posix version +exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return [];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=internals.parseObject(chain,val,options);}else {obj[cleanRoot]=internals.parseObject(chain,val,options);}}return obj;};internals.parseKeys=function(givenKey,val,options){if(!givenKey){return;} // Transform dot notation to bracket notation +var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,'[$1]'):givenKey; // The regex chunks +var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g; // Get the parent +var segment=parent.exec(key); // Stash the parent if it exists +var keys=[];if(segment[1]){ // If we aren't using plain objects, optionally prefix keys +// that would overwrite object prototype properties +if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])){if(!options.allowPrototypes){return;}}keys.push(segment[1]);} // Loop through children appending to the array until we hit depth +var i=0;while((segment=child.exec(key))!==null&&i=0x30&&c<=0x39|| // 0-9 +c>=0x41&&c<=0x5A|| // a-z +c>=0x61&&c<=0x7A // A-Z +){out+=string.charAt(i);continue;}if(c<0x80){out=out+hexTable[c];continue;}if(c<0x800){out=out+(hexTable[0xC0|c>>6]+hexTable[0x80|c&0x3F]);continue;}if(c<0xD800||c>=0xE000){out=out+(hexTable[0xE0|c>>12]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F]);continue;}i+=1;c=0x10000+((c&0x3FF)<<10|string.charCodeAt(i)&0x3FF);out+=hexTable[0xF0|c>>18]+hexTable[0x80|c>>12&0x3F]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];}return out;};exports.compact=function(obj,references){if((typeof obj==="undefined"?"undefined":_typeof2(obj))!=='object'||obj===null){return obj;}var refs=references||[];var lookup=refs.indexOf(obj);if(lookup!==-1){return refs[lookup];}refs.push(obj);if(Array.isArray(obj)){var compacted=[];for(var i=0;i0);return encoded;}; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string via the out parameter. - */exports.decode=function base64VLQ_decode(aStr,aIndex,aOutParam){var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do {if(aIndex>=strLen){throw new Error("Expected more digits in base 64 VLQ value.");}digit=base64.decode(aStr.charCodeAt(aIndex++));if(digit===-1){throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1));}continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<=strLen){throw new Error("Expected more digits in base 64 VLQ value.");}digit=base64.decode(aStr.charCodeAt(aIndex++));if(digit===-1){throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1));}continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<=0){if(aCompare(aHaystack[index],aHaystack[index-1],true)!==0){break;}--index;}return index;};});},{"amdefine":1}],40:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* +while(index-1>=0){if(aCompare(aHaystack[index],aHaystack[index-1],true)!==0){break;}--index;}return index;};});},{"amdefine":1}],48:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2014 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -955,7 +1064,7 @@ this._last={generatedLine:-1,generatedColumn:0};} /** * performance. The return value must NOT be mutated, and should be treated as * an immutable borrow. If you want to take ownership, you must make your own * copy. - */MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositionsInflated);this._sorted=true;}return this._array;};exports.MappingList=MappingList;});},{"./util":45,"amdefine":1}],41:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositionsInflated);this._sorted=true;}return this._array;};exports.MappingList=MappingList;});},{"./util":53,"amdefine":1}],49:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1022,7 +1131,7 @@ doQuickSort(ary,comparator,p,q-1);doQuickSort(ary,comparator,q+1,r);}} /** * An array to sort. * @param {function} comparator * Function to use to compare two items. - */exports.quickSort=function(ary,comparator){doQuickSort(ary,comparator,0,ary.length-1);};});},{"amdefine":1}],42:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */exports.quickSort=function(ary,comparator){doQuickSort(ary,comparator,0,ary.length-1);};});},{"amdefine":1}],50:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1342,7 +1451,7 @@ if(section.consumer.sources.indexOf(util.getArg(aArgs,'source'))===-1){continue; // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. -var adjustedMapping={source:source,generatedLine:mapping.generatedLine+(section.generatedOffset.generatedLine-1),generatedColumn:mapping.column+(section.generatedOffset.generatedLine===mapping.generatedLine)?section.generatedOffset.generatedColumn-1:0,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:name};this.__generatedMappings.push(adjustedMapping);if(typeof adjustedMapping.originalLine==='number'){this.__originalMappings.push(adjustedMapping);}};};quickSort(this.__generatedMappings,util.compareByGeneratedPositionsDeflated);quickSort(this.__originalMappings,util.compareByOriginalPositions);};exports.IndexedSourceMapConsumer=IndexedSourceMapConsumer;});},{"./array-set":36,"./base64-vlq":37,"./binary-search":39,"./quick-sort":41,"./util":45,"amdefine":1}],43:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* +var adjustedMapping={source:source,generatedLine:mapping.generatedLine+(section.generatedOffset.generatedLine-1),generatedColumn:mapping.column+(section.generatedOffset.generatedLine===mapping.generatedLine)?section.generatedOffset.generatedColumn-1:0,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:name};this.__generatedMappings.push(adjustedMapping);if(typeof adjustedMapping.originalLine==='number'){this.__originalMappings.push(adjustedMapping);}};};quickSort(this.__generatedMappings,util.compareByGeneratedPositionsDeflated);quickSort(this.__originalMappings,util.compareByOriginalPositions);};exports.IndexedSourceMapConsumer=IndexedSourceMapConsumer;});},{"./array-set":44,"./base64-vlq":45,"./binary-search":47,"./quick-sort":49,"./util":53,"amdefine":1}],51:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1415,7 +1524,7 @@ result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOr * Externalize the source map. */SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file;}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot;}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot);}return map;}; /** * Render the source map being generated to a string. - */SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON());};exports.SourceMapGenerator=SourceMapGenerator;});},{"./array-set":36,"./base64-vlq":37,"./mapping-list":40,"./util":45,"amdefine":1}],44:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* + */SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON());};exports.SourceMapGenerator=SourceMapGenerator;});},{"./array-set":44,"./base64-vlq":45,"./mapping-list":48,"./util":53,"amdefine":1}],52:[function(require,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause @@ -1514,7 +1623,7 @@ aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapCo * Returns the string representation of this source node along with a source * map. */SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name});}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true;}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false;}for(var idx=0,length=chunk.length;idxaStr2){return 1;}return -1;} /** * Comparator between two mappings with inflated source and name strings where * the generated positions are compared. - */function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp!==0){return cmp;}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp!==0){return cmp;}return strcmp(mappingA.name,mappingB.name);};exports.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;});},{"amdefine":1}],46:[function(require,module,exports){(function(global){ // Best place to find information on XHR features is: -// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest -var reqfields=['responseType','withCredentials','timeout','onprogress']; // Simple and small ajax function -// Takes a parameters object and a callback function -// Parameters: -// - url: string, required -// - headers: object of `{header_name: header_value, ...}` -// - body: -// + string (sets content type to 'application/x-www-form-urlencoded' if not set in headers) -// + FormData (doesn't set content type so that browser will set as appropriate) -// - method: 'GET', 'POST', etc. Defaults to 'GET' or 'POST' based on body -// - cors: If your using cross-origin, you will need this true for IE8-9 -// -// The following parameters are passed onto the xhr object. -// IMPORTANT NOTE: The caller is responsible for compatibility checking. -// - responseType: string, various compatability, see xhr docs for enum options -// - withCredentials: boolean, IE10+, CORS only -// - timeout: long, ms timeout, IE8+ -// - onprogress: callback, IE10+ -// -// Callback function prototype: -// - statusCode from request -// - response -// + if responseType set and supported by browser, this is an object of some type (see docs) -// + otherwise if request completed, this is the string text of the response -// + if request is aborted, this is "Abort" -// + if request times out, this is "Timeout" -// + if request errors before completing (probably a CORS issue), this is "Error" -// - request object -// -// Returns the request object. So you can call .abort() or other methods -// -// DEPRECATIONS: -// - Passing a string instead of the params object has been removed! -// -exports.ajax=function(params,callback){ // Any variable used more than once is var'd here because -// minification will munge the variables whereas it can't munge -// the object access. -var headers=params.headers||{},body=params.body,method=params.method||(body?'POST':'GET'),called=false;var req=getRequest(params.cors);function cb(statusCode,responseText){return function(){if(!called){callback(req.status===undefined?statusCode:req.status,req.status===0?"Error":req.response||req.responseText||responseText,req);called=true;}};}req.open(method,params.url,true);var success=req.onload=cb(200);req.onreadystatechange=function(){if(req.readyState===4)success();};req.onerror=cb(null,'Error');req.ontimeout=cb(null,'Timeout');req.onabort=cb(null,'Abort');if(body){setDefault(headers,'X-Requested-With','XMLHttpRequest');if(!global.FormData||!(body instanceof global.FormData)){setDefault(headers,'Content-Type','application/x-www-form-urlencoded');}}for(var i=0,len=reqfields.length,field;i 0 -var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s -if(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function splitPath(filename){return splitPathRe.exec(filename).slice(1);}; // path.resolve([from ...], to) -// posix version -exports.resolve=function(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd(); // Skip empty and invalid entries -if(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';} // At this point the path should be resolved to a full absolute path, but -// handle relative paths to be safe (might happen when process.cwd() fails) -// Normalize the path -resolvedPath=normalizeArray(filter(resolvedPath.split('/'),function(p){return !!p;}),!resolvedAbsolute).join('/');return (resolvedAbsolute?'/':'')+resolvedPath||'.';}; // path.normalize(path) -// posix version -exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==='/'; // Normalize the path -path=normalizeArray(filter(path.split('/'),function(p){return !!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return (isAbsolute?'/':'')+path;}; // posix version -exports.isAbsolute=function(path){return path.charAt(0)==='/';}; // posix version -exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));}; // path.relative(from, to) -// posix version -exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return [];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=parseObject(chain,val,options);}else {obj[cleanRoot]=parseObject(chain,val,options);}}return obj;};var parseKeys=function parseKeys(givenKey,val,options){if(!givenKey){return;} // Transform dot notation to bracket notation -var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,'[$1]'):givenKey; // The regex chunks -var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g; // Get the parent -var segment=parent.exec(key); // Stash the parent if it exists -var keys=[];if(segment[1]){ // If we aren't using plain objects, optionally prefix keys -// that would overwrite object prototype properties -if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])){if(!options.allowPrototypes){return;}}keys.push(segment[1]);} // Loop through children appending to the array until we hit depth -var i=0;while((segment=child.exec(key))!==null&&i=0x30&&c<=0x39|| // 0-9 -c>=0x41&&c<=0x5A|| // a-z -c>=0x61&&c<=0x7A // A-Z -){out+=string.charAt(i);continue;}if(c<0x80){out=out+hexTable[c];continue;}if(c<0x800){out=out+(hexTable[0xC0|c>>6]+hexTable[0x80|c&0x3F]);continue;}if(c<0xD800||c>=0xE000){out=out+(hexTable[0xE0|c>>12]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F]);continue;}i+=1;c=0x10000+((c&0x3FF)<<10|string.charCodeAt(i)&0x3FF);out+=hexTable[0xF0|c>>18]+hexTable[0x80|c>>12&0x3F]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];}return out;};exports.compact=function(obj,references){if((typeof obj==="undefined"?"undefined":_typeof2(obj))!=='object'||obj===null){return obj;}var refs=references||[];var lookup=refs.indexOf(obj);if(lookup!==-1){return refs[lookup];}refs.push(obj);if(Array.isArray(obj)){var compacted=[];for(var i=0;i0){var results=[].slice.call(this._currentInput.parentNode.querySelectorAll('.autocomplete-result-wrapper .autocomplete-result'));var json=this._json.data;json[id]=[];Array.prototype.forEach.call(results,function(result){var value=result.getAttribute('value');if(value!==''){if(value.indexOf('{')>-1||value.indexOf('[')>-1){json[id].push(JSON.parse(value));}else {json[id].push(value);}}});this._json.data=json;try{Array.prototype.forEach.call(nodeComments,function(nodeComment){var blockHtml=unescape(nodeComment.textContent.replace(/\[\[([\S\s]*?)\]\]/,'')).replace(/\[0\]-/g,'[0]-'); // var blockHtml = unescape(blockContent.innerHTML).replace(/\[0\]-/g, '[0]-') var template=_handlebars2.default.compile(blockHtml,{noEscape:true});var compiled=template(_this2._json.data);nodeComment.parentNode.innerHTML=compiled+('');});}catch(e){console.log(e);}}else if(typeof id!=='undefined'&&id!==null){if(this._currentInput.getAttribute('visible')===true){var nodes=_EditorUtils2.default.getNode(attr);Array.prototype.forEach.call(nodes,function(node){_EditorUtils2.default.formToHtml(node,_this2._currentInput);});}}this.onReload._fire();}},{key:'_documentClick',value:function _documentClick(e){if(this._visible&&!this._canSelect){if(typeof this._divWrapper.parentNode!=='undefined'&&this._divWrapper.parentNode!==null){this._hide();}}}},{key:'_select',value:function _select(target){var val=JSON.parse(target.getAttribute('data-value'));var maxLength=this._currentInput.getAttribute('data-maxlength');if(typeof maxLength!=='undefined'&&maxLength!==null&&maxLength!==''){maxLength=parseInt(maxLength);var countLength=[].slice.call(this._currentInput.parentNode.querySelectorAll('.autocomplete-result-wrapper .autocomplete-result')).length;if(countLength+1>maxLength){return;}}var display=target.getAttribute('data-display');var div=document.createElement('div');div.classList.add('autocomplete-result');div.setAttribute('data-parent-id',this._currentInput.getAttribute('data-id'));div.setAttribute('value',target.getAttribute('data-value'));div.innerHTML=''+this._deep_value_array(val,display);var resWrapper=this._divWrapper.parentNode.querySelector('.autocomplete-result-wrapper');var remove=document.createElement('span');remove.classList.add('glyphicon','glyphicon-remove');remove.setAttribute('data-autocomplete-remove','true');remove.addEventListener('click',this._handleRemove);div.appendChild(remove);resWrapper.appendChild(div);this._saveData();}},{key:'_selectValue',value:function _selectValue(e){this._select(e.currentTarget);}},{key:'_showAutocomplete',value:function _showAutocomplete(sources,target,val){var _this3=this;var display=target.getAttribute('data-display');var first=true;this._divWrapper.innerHTML='';if(typeof sources!=='undefined'&&sources!==null){if((typeof sources==='undefined'?'undefined':_typeof(sources))==='object'&&Object.prototype.toString.call(sources)==='[object Object]'){sources=[sources];}Array.prototype.forEach.call(sources,function(source){var sourceVal=_this3._deep_value_array(source,display);if(typeof sourceVal!=='undefined'&&sourceVal!==null){sourceVal=sourceVal.toLowerCase();if(sourceVal.indexOf(val)>-1){var div=document.createElement('div');div.addEventListener('mousedown',_this3._handleSelectValue);div.setAttribute('data-value',JSON.stringify(source));div.setAttribute('data-display',display);if(first){div.classList.add('selected');}first=false;div.innerHTML=sourceVal.replace(val,''+val+'');_this3._divWrapper.appendChild(div);}}});}this._show(target);}},{key:'_hide',value:function _hide(){if(this._visible){this._visible=false;this._shouldBeVisible=false;this._divWrapper.parentNode.removeChild(this._divWrapper);}}},{key:'_show',value:function _show(target){if(!this._visible){this._visible=true;this._divWrapper.style.marginTop=target.offsetHeight+'px';this._divWrapper.style.width=target.offsetWidth+'px';target.parentNode.insertBefore(this._divWrapper,target);}}},{key:'_startAutocomplete',value:function _startAutocomplete(target){var _this4=this;var val=target.value.toLowerCase();if(val.length>2){if(this._previousValue===val){this._show(target);return;}else {this._previousValue=val;}var dataVal=target.getAttribute('data-value');if(dataVal.indexOf('http')===0){this._ajax({url:''+dataVal+val,body:'',cors:true,method:'get'},function(code,responseText,request){_this4._showAutocomplete(JSON.parse(responseText),target,val);});}else {var sources=JSON.parse(target.getAttribute('data-value'));this._showAutocomplete(sources,target,val);}}else {this._hide();}}},{key:'_keyUp',value:function _keyUp(e){if(e.keyCode!==13){this._startAutocomplete(e.currentTarget);}}},{key:'_keyDown',value:function _keyDown(e){if(this._canSelect){var parent=this._currentInput.parentNode.querySelector('.autocomplete-wrapper');if(typeof parent!=='undefined'&&parent!==null){var current=this._currentInput.parentNode.querySelector('.autocomplete-wrapper .selected');var newSelected=null;var selected=document.querySelector('.autocomplete-wrapper .selected');switch(e.keyCode){case 9: // tab this._hide();break;case 13: // enter e.preventDefault();if(typeof selected!=='undefined'&&selected!==null){this._select(selected);this._hide();}break;case 27: // escape e.preventDefault();this._hide();break;case 40: // down e.preventDefault();if(typeof selected!=='undefined'&&selected!==null){newSelected=selected.nextSibling;this._show(e.currentTarget);}break;case 38: // prev -e.preventDefault();if(typeof selected!=='undefined'&&selected!==null){newSelected=selected.previousSibling;}break;default:break;}if(typeof newSelected!=='undefined'&&newSelected!==null){var scrollTopMin=parent.scrollTop;var scrollTopMax=parent.scrollTop+parent.offsetHeight-newSelected.offsetHeight;var offsetTop=newSelected.offsetTop;if(scrollTopMaxoffsetTop){parent.scrollTop=newSelected.offsetTop;}current.classList.remove('selected');newSelected.classList.add('selected');}}}}},{key:'_focus',value:function _focus(e){this._canSelect=true;this._currentInput=e.currentTarget;this._startAutocomplete(e.currentTarget);}},{key:'_blur',value:function _blur(e){this._canSelect=false;this._currentInput=null;this._hide();}},{key:'_remove',value:function _remove(e){var target=e.currentTarget.parentNode;this._currentInput=document.querySelector('#'+target.getAttribute('data-parent-id'));target.parentNode.removeChild(target);this._saveData();this._currentInput=null;}},{key:'_deep_value_array',value:function _deep_value_array(obj,path){var _this5=this;if(path.indexOf('.')===-1){return typeof obj[path]!=='undefined'&&obj[path]!==null?obj[path]:null;}var pathSplit=path.split('.');var res=JSON.parse(JSON.stringify(obj));while(pathSplit.length>0){if(typeof res[pathSplit[0]]!=='undefined'&&res[pathSplit[0]]!==null){if(_typeof(res[pathSplit[0]])==='object'&&Object.prototype.toString.call(res[pathSplit[0]])==='[object Array]'){var resArray=[];Array.prototype.forEach.call(res[pathSplit[0]],function(item){resArray.push(_this5._deep_value_array(item,pathSplit.join('.').replace(pathSplit[0]+'.','')));});res=resArray;pathSplit.shift();}else {res=res[pathSplit[0]];}}else {return null;}pathSplit.shift();}return res;}},{key:'_deep_value',value:function _deep_value(obj,path){if(path.indexOf('.')===-1){return typeof obj[path]!=='undefined'&&obj[path]!==null?obj[path]:null;}var pathSplit=path.split('.');var res=JSON.parse(JSON.stringify(obj));for(var i=0;ioffsetTop){parent.scrollTop=newSelected.offsetTop;}current.classList.remove('selected');newSelected.classList.add('selected');}}}}},{key:'_focus',value:function _focus(e){this._canSelect=true;this._currentInput=e.currentTarget;this._startAutocomplete(e.currentTarget);}},{key:'_blur',value:function _blur(e){this._canSelect=false;this._currentInput=null;this._hide();}},{key:'_remove',value:function _remove(e){var target=e.currentTarget.parentNode;this._currentInput=document.querySelector('#'+target.getAttribute('data-parent-id'));target.parentNode.removeChild(target);this._saveData();this._currentInput=null;}},{key:'_deep_value_array',value:function _deep_value_array(obj,path){var _this5=this;if(path.indexOf('.')===-1){return typeof obj[path]!=='undefined'&&obj[path]!==null?obj[path]:null;}var pathSplit=path.split('.');var res=JSON.parse(JSON.stringify(obj));while(pathSplit.length>0){if(typeof res[pathSplit[0]]!=='undefined'&&res[pathSplit[0]]!==null){if(_typeof(res[pathSplit[0]])==='object'&&Object.prototype.toString.call(res[pathSplit[0]])==='[object Array]'){var resArray=[];Array.prototype.forEach.call(res[pathSplit[0]],function(item){resArray.push(_this5._deep_value_array(item,pathSplit.join('.').replace(pathSplit[0]+'.','')));});res=resArray;pathSplit.shift();}else {res=res[pathSplit[0]];}}else {return null;}pathSplit.shift();}return res;}},{key:'_deep_value',value:function _deep_value(obj,path){if(path.indexOf('.')===-1){return typeof obj[path]!=='undefined'&&obj[path]!==null?obj[path]:null;}var pathSplit=path.split('.');var res=JSON.parse(JSON.stringify(obj));for(var i=0;i0){Array.prototype.forEach.call(richs,function(rich){rich.remove();});var newRichs=[].slice.call(newBlock.querySelectorAll('.rich'));Array.prototype.forEach.call(newRichs,function(newRich){new _richTexarea2.default(newRich,_this2.color,_this2.link);});}return newNumber;}}]);return EditorBlock;}();exports.default=EditorBlock;},{"../utils/color-picker":67,"../utils/dom":68,"../utils/iframe":69,"../utils/link-picker":70,"../utils/rich-texarea":72,"./EditorInputs":60,"./EditorJson":61,"./EditorUtils":65,"on":47}],59:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){Array.prototype.forEach.call(richs,function(rich){rich.remove();});var newRichs=[].slice.call(newBlock.querySelectorAll('.rich'));Array.prototype.forEach.call(newRichs,function(newRich){new _richTexarea2.default(newRich,_this2.color,_this2.link);});}return newNumber;}}]);return EditorBlock;}();exports.default=EditorBlock;},{"../utils/color-picker":67,"../utils/dom":68,"../utils/iframe":69,"../utils/link-picker":70,"../utils/rich-texarea":72,"./EditorInputs":60,"./EditorJson":61,"./EditorUtils":65,"on":36}],59:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;imaxLength){var lastValues=JSON.parse(target.getAttribute('last-values'));Array.prototype.forEach.call(optionsChecked,function(optionChecked){var unselect=true;Array.prototype.forEach.call(lastValues,function(lastValue){if(optionChecked.value.indexOf('{')>-1||optionChecked.value.indexOf('[')>-1){if(JSON.stringify(JSON.parse(optionChecked.value))==JSON.stringify(lastValue)){unselect=false;}}else {if(optionChecked.value==lastValue){unselect=false;}}});if(unselect){optionChecked.removeAttribute('selected');optionChecked.selected=false;optionChecked.disabled=true;}});}else {var lastValues='[';Array.prototype.forEach.call(optionsChecked,function(optionChecked){if(optionChecked.value!==''){if(optionChecked.value.indexOf('{')>-1||optionChecked.value.indexOf('[')>-1){lastValues+=JSON.stringify(JSON.parse(optionChecked.value));}else {lastValues+='"'+optionChecked.value+'"';}}lastValues+=',';});lastValues=lastValues.substring(0,lastValues.length-1);lastValues+=']';target.setAttribute('last-values',lastValues);}} // var blockContent = IframeNode('#page-template', '.select-' + attr.id)[0] var nodeComments=(0,_iframe.IframeCommentNode)('#page-template',attr.id);if(typeof nodeComments!=='undefined'&&nodeComments!==null&&nodeComments.length>0){var checked=e.target.querySelectorAll('option:checked');var json=this._json.data;json[attr.id]=[];Array.prototype.forEach.call(checked,function(check){if(check.value!==''){if(check.value.indexOf('{')>-1||check.value.indexOf('[')>-1){json[attr.id].push(JSON.parse(check.value));}else {json[attr.id].push(check.value);}}});this._json.data=json;try{Array.prototype.forEach.call(nodeComments,function(nodeComment){var blockHtml=unescape(nodeComment.textContent.replace(/\[\[([\S\s]*?)\]\]/,'')).replace(/\[0\]-/g,'[0]-'); // var blockHtml = unescape(blockContent.innerHTML).replace(/\[0\]-/g, '[0]-') -var template=_handlebars2.default.compile(blockHtml,{noEscape:true});var compiled=template(_this5._json.data);nodeComment.parentNode.innerHTML=compiled+('');});}catch(e){console.log(e);}}else if(typeof attr.id!=='undefined'&&attr.id!==null){var nodes=_EditorUtils2.default.getNode(attr);Array.prototype.forEach.call(nodes,function(node){_EditorUtils2.default.formToHtml(node,target);});}Array.prototype.forEach.call(options,function(option){option.disabled=false;});}}]);return EditorInputs;}();exports.default=EditorInputs;},{"../modules/EditorJson":61,"../modules/EditorSave":64,"../modules/EditorUtils":65,"../utils/color-picker":67,"../utils/iframe":69,"../utils/link-picker":70,"../utils/rich-texarea":72,"handlebars":34,"on":47,"qs":50}],61:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i');});}catch(e){console.log(e);}}else if(typeof attr.id!=='undefined'&&attr.id!==null){var nodes=_EditorUtils2.default.getNode(attr);Array.prototype.forEach.call(nodes,function(node){_EditorUtils2.default.formToHtml(node,target);});}Array.prototype.forEach.call(options,function(option){option.disabled=false;});}}]);return EditorInputs;}();exports.default=EditorInputs;},{"../modules/EditorJson":61,"../modules/EditorSave":64,"../modules/EditorUtils":65,"../utils/color-picker":67,"../utils/iframe":69,"../utils/link-picker":70,"../utils/rich-texarea":72,"handlebars":34,"on":36,"qs":39}],61:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0;i--){script.setAttribute(node.attributes[i].name,node.attributes[i].value);}return script;}},{key:'reload',value:function reload(){var iframe=document.querySelector('#page-template');var iframeBody=(0,_iframe.IframeDocument)('#page-template').body;var scrollTop=iframeBody.scrollTop;var json=JSON.parse(JSON.stringify(this._json.data));delete json.abe_source;var data=_qs2.default.stringify({json:json});this._ajax({url:iframe.getAttribute('data-iframe-src'),body:data,method:'post'},function(code,responseText,request){if(typeof responseText!=='undefined'&&responseText!==null){var str=responseText;var doc=iframe.contentWindow.document;str=str.replace(/<\/head>/,'');doc.open();doc.write(str);doc.close();setTimeout(function(){var iframeDoc=(0,_iframe.IframeDocument)('#page-template');if(typeof iframeDoc!=='undefined'&&iframeDoc!==null&&typeof iframeDoc.body!=='undefined'&&iframeDoc.body!==null){iframeDoc.body.scrollTop=scrollTop;}},1000);}return;});}}],[{key:'instance',get:function get(){if(!this[singleton]){this[singleton]=new Reload(singletonEnforcer);window.formJson=this[singleton];}return this[singleton];}}]);return Reload;}();exports.default=Reload;},{"../modules/EditorJson":61,"../utils/iframe":69,"es6-promise":3,"nanoajax":46,"qs":50}],64:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&_typeof2(Symbol.iterator)==="symbol"?function(obj){return typeof obj==="undefined"?"undefined":_typeof2(obj);}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj==="undefined"?"undefined":_typeof2(obj);};var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0;i--){script.setAttribute(node.attributes[i].name,node.attributes[i].value);}return script;}},{key:'reload',value:function reload(){var iframe=document.querySelector('#page-template');var iframeBody=(0,_iframe.IframeDocument)('#page-template').body;var scrollTop=iframeBody.scrollTop;var json=JSON.parse(JSON.stringify(this._json.data));delete json.abe_source;var data=_qs2.default.stringify({json:json});this._ajax({url:iframe.getAttribute('data-iframe-src'),body:data,method:'post'},function(code,responseText,request){var str=responseText;var doc=iframe.contentWindow.document;str=str.replace(/<\/head>/,'');doc.open();doc.write(str);doc.close();setTimeout(function(){var iframeDoc=(0,_iframe.IframeDocument)('#page-template');if(typeof iframeDoc!=='undefined'&&iframeDoc!==null&&typeof iframeDoc.body!=='undefined'&&iframeDoc.body!==null){iframeDoc.body.scrollTop=scrollTop;}},1000);return;});}}],[{key:'instance',get:function get(){if(!this[singleton]){this[singleton]=new Reload(singletonEnforcer);window.formJson=this[singleton];}return this[singleton];}}]);return Reload;}();exports.default=Reload;},{"../modules/EditorJson":61,"../utils/iframe":69,"es6-promise":3,"nanoajax":35,"qs":39}],64:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&_typeof2(Symbol.iterator)==="symbol"?function(obj){return typeof obj==="undefined"?"undefined":_typeof2(obj);}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj==="undefined"?"undefined":_typeof2(obj);};var _createClass=function(){function defineProperties(target,props){for(var i=0;i-1){var obj=dataId.split('[')[0];var index=dataId.match(/[^\[]+?(?=\])/)[0];var key=dataId.replace(/[^\.]+?-/,'');if(typeof _this2._json.data[obj]==='undefined'||_this2._json.data[obj]===null)_this2._json.data[obj]=[];if(typeof _this2._json.data[obj][index]==='undefined'||_this2._json.data[obj][index]===null)_this2._json.data[obj][index]={};_this2._json.data[obj][index][key]=input.value;}else {var value;if(input.nodeName==='SELECT'){var checked=input.querySelectorAll('option:checked');value=[];Array.prototype.forEach.call(checked,function(check){if(check.value!==''){if(check.value.indexOf('{')>-1||check.value.indexOf('[')>-1){value.push(JSON.parse(check.value));}else {value.push(check.value);}}});}else if(input.getAttribute('data-autocomplete')==='true'){var results=input.parentNode.querySelectorAll('.autocomplete-result-wrapper .autocomplete-result');value=[];Array.prototype.forEach.call(results,function(result){var val=result.getAttribute('value');if(val!==''){if(val.indexOf('{')>-1||val.indexOf('[')>-1){value.push(JSON.parse(val));}else {value.push(val);}}});}else {value=input.value.replace(/\"/g,'\"')+"";}_this2._json.data[dataId]=value;}}});}},{key:'savePage',value:function savePage(type){var tplName=arguments.length<=1||arguments[1]===undefined?null:arguments[1];var filePath=arguments.length<=2||arguments[2]===undefined?null:arguments[2];var target=document.querySelector('[data-action="'+type+'"]');this.serializeForm();target.classList.add('loading');target.setAttribute('disabled','disabled');this._json.save(this._saveType).then(function(result){target.classList.add('done'); // this._populateFromJson(this._json.data) @@ -1800,7 +1800,7 @@ if(typeof nodes[0]!=='undefined'&&nodes[0]!==null){var bounds=nodes[0].getBoundi * @return {null} */},{key:'formToHtml',value:function formToHtml(node,input){var val=input.value;var id=input.id;var placeholder=input.getAttribute('placeholder');if(typeof placeholder==='undefined'||placeholder==='undefined'||placeholder===null){placeholder="";}if(val.replace(/^\s+|\s+$/g,'').length<1){val=placeholder;}switch(input.nodeName.toLowerCase()){case 'input':var dataAbeAttr=node.getAttribute('data-abe-attr-'+id.replace(/\[([0-9]*)\]/g,'$1'));if(typeof dataAbeAttr!=='undefined'&&dataAbeAttr!==null){node.setAttribute(dataAbeAttr,val);}else {node.innerHTML=val;}break;case 'textarea':node.innerHTML=input.classList.contains('form-rich')?input.parentNode.querySelector('[contenteditable]').innerHTML:val;break;case 'select':var key=node.getAttribute('data-abe-'+id);var dataAbeAttr=node.getAttribute('data-abe-attr-'+id.replace(/\[([0-9]*)\]/g,'$1'));var dataAbeAttrEscaped=unescape(node.getAttribute('data-abe-attr-escaped'));var option=input.querySelector('option:checked');if(typeof option!=='undefined'&&option!==null){val=option.value;if(typeof dataAbeAttr!=='undefined'&&dataAbeAttr!==null){try{var template=_handlebars2.default.compile(dataAbeAttrEscaped,{noEscape:true});var json={};json[key]=val;var compiled=template(json);node.setAttribute(dataAbeAttr,compiled);}catch(e){console.log(e);}}else {node.innerHTML=val;}}break;}}}]);return EditorUtils;}();exports.default=EditorUtils;},{"../../../../cli/handlebars/utils/math":54,"../../../../cli/handlebars/utils/translate-front":55,"../utils/iframe":69,"handlebars":34}],66:[function(require,module,exports){'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i';});colorHTML+='';});colorHTML+='\n ';this.wrapper.innerHTML=colorHTML;this.bindEvt();}_createClass(ColorPicker,[{key:'bindEvt',value:function bindEvt(){var _this=this;this.onColor=(0,_on2.default)(this);this.wrapper.addEventListener('click',function(e){var target=e.target;if(target.classList.contains('wysiwyg-toolbar-color')){_this.onColor._fire(target.getAttribute('title'));_this.popup.close();}});}},{key:'show',value:function show(el){var elBounds=el.getBoundingClientRect();this.popup.open(elBounds.left,elBounds.top+elBounds.height+5);}}]);return ColorPicker;}();exports.default=ColorPicker;},{"./popup":71,"on":47}],68:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.nextSibling=nextSibling;exports.getClosest=getClosest;function nextSibling(parent,ele){var next;var found=false;Array.prototype.forEach.call(parent.childNodes,function(node){if(node.nodeName.indexOf('text')===-1){if(found){next=node;found=false;}if(node===ele){found=true;}}});return next;} /** +});}}]);return Engine;}();var engine=new Engine();window.abe={json:engine.json,inputs:engine._inputs,files:engine._files,blocks:engine._blocks,autocomplete:engine._autocomplete,editorReload:_EditorReload2.default};document.addEventListener("DOMContentLoaded",function(event){if(document.querySelector('#page-template'))engine.loadIframe();});},{"./devtool/Devtool":56,"./modules/EditorAutocomplete":57,"./modules/EditorBlock":58,"./modules/EditorFiles":59,"./modules/EditorInputs":60,"./modules/EditorJson":61,"./modules/EditorManager":62,"./modules/EditorReload":63,"./modules/EditorSave":64,"./modules/EditorUtils":65,"qs":39}],67:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i';});colorHTML+='';});colorHTML+='\n ';this.wrapper.innerHTML=colorHTML;this.bindEvt();}_createClass(ColorPicker,[{key:'bindEvt',value:function bindEvt(){var _this=this;this.onColor=(0,_on2.default)(this);this.wrapper.addEventListener('click',function(e){var target=e.target;if(target.classList.contains('wysiwyg-toolbar-color')){_this.onColor._fire(target.getAttribute('title'));_this.popup.close();}});}},{key:'show',value:function show(el){var elBounds=el.getBoundingClientRect();this.popup.open(elBounds.left,elBounds.top+elBounds.height+5);}}]);return ColorPicker;}();exports.default=ColorPicker;},{"./popup":71,"on":36}],68:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.nextSibling=nextSibling;exports.getClosest=getClosest;function nextSibling(parent,ele){var next;var found=false;Array.prototype.forEach.call(parent.childNodes,function(node){if(node.nodeName.indexOf('text')===-1){if(found){next=node;found=false;}if(node===ele){found=true;}}});return next;} /** * Get closest DOM element up the tree that contains a class, ID, or data attribute * @param {Node} elem The base element * @param {String} selector The class, id, data attribute, or tag to look for @@ -1810,7 +1810,7 @@ for(;elem&&elem!==document;elem=elem.parentNode){ // If selector is a class if(firstChar==='.'){if(elem.classList.contains(selector.substr(1))){return elem;}} // If selector is an ID if(firstChar==='#'){if(elem.id===selector.substr(1)){return elem;}} // If selector is a data attribute if(firstChar==='['){if(elem.hasAttribute(selector.substr(1,selector.length-2))){return elem;}} // If selector is a tag -if(elem.tagName.toLowerCase()===selector){return elem;}}return false;};},{}],69:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.IframeDocument=IframeDocument;exports.IframeNode=IframeNode;exports.IframeCommentNode=IframeCommentNode;function IframeDocument(frameId){var iframe=document.querySelector(frameId);var iframeDocument=iframe.contentDocument||iframe.contentWindow.document;return iframeDocument;}function IframeNode(frameId,selector){return IframeDocument(frameId).querySelectorAll(selector.replace(/\[([0-9]*)\]/g,'$1'));}function IframeGetComment(frameId,prop,val,meth,nd,useSelf){var prop="nodeType";var val=8;var meth=null;var r=[],any=IframeGetComment[val]===true;nd=nd||IframeDocument(frameId).documentElement;if(nd.constructor===Array){nd={childNodes:nd};}for(var cn=nd.childNodes,i=0,mx=cn.length;i-1){found.push(node);}});return found;}},{}],70:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i'+window.getSelection().toString()+'');var off=this.link.onLink(function(obj){if(obj.link!==null){var html=_this2.textEditor.getHTML().replace('[LINK]',obj.link);if(obj.target)html=html.replace(/\[TARGET\]/,'_blank');else html=html.replace(/target=\"\[TARGET\]\"/,'');if(obj.noFollow)html=html.replace(/\[REL\]/,'nofollow');else html=html.replace(/rel=\"\[REL\]\"/,'');_this2.textEditor.setHTML(html);}else _this2.textEditor.setHTML(html);_this2.setHTML();off();});this.link.show(this.el);break;}}else if(this.action==='code'){this._replaceSelectionWithHtml('
'+window.getSelection().toString()+'
');this.textEditor.setHTML(this.textEditor.getHTML());this.setHTML();}else {this.textEditor[this.action](this.param);this.setHTML();}}}]);return RichTexarea;}();exports.default=RichTexarea;},{}],73:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i-1){found.push(node);}});return found;}},{}],70:[function(require,module,exports){'use strict';Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i'+window.getSelection().toString()+'');var off=this.link.onLink(function(obj){if(obj.link!==null){var html=_this2.textEditor.getHTML().replace('[LINK]',obj.link);if(obj.target)html=html.replace(/\[TARGET\]/,'_blank');else html=html.replace(/target=\"\[TARGET\]\"/,'');if(obj.noFollow)html=html.replace(/\[REL\]/,'nofollow');else html=html.replace(/rel=\"\[REL\]\"/,'');_this2.textEditor.setHTML(html);}else _this2.textEditor.setHTML(html);_this2.setHTML();off();});this.link.show(this.el);break;}}else if(this.action==='code'){this._replaceSelectionWithHtml('
'+window.getSelection().toString()+'
');this.textEditor.setHTML(this.textEditor.getHTML());this.setHTML();}else {this.textEditor[this.action](this.param);this.setHTML();}}}]);return RichTexarea;}();exports.default=RichTexarea;},{}],73:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i