feat:样板编辑器升级
This commit is contained in:
1 parent
a04069b0ee
commit
00addfcbf3
8 files changed
+80
-27
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
!function(){var t=function(u){var i={};function n(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return u[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}return n.m=u,n.c=i,n.d=function(t,e,u){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:u})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var u=Object.create(null);if(n.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(u,i,function(t){return e[t]}.bind(null,i));return u},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,u){"use strict";var i=u(1).Beautifier,n=u(5).Options;t.exports=function(t,e){return new i(t,e).beautify()},t.exports.defaultOptions=function(){return new n}},function(t,e,u){"use strict";var i=u(2).Output,n=u(3).Token,o=u(4),_=u(5).Options,s=u(7).Tokenizer,p=u(7).line_starters,l=u(7).positionable_operators,f=u(7).TOKEN;function c(t,e){return-1!==e.indexOf(t)}function a(t,e){return t&&t.type===f.RESERVED&&t.text===e}function d(t,e){return t&&t.type===f.RESERVED&&c(t.text,e)}var b=["case","return","do","if","throw","else","await","break","continue","async"],g=function(t){for(var e={},u=0;u<t.length;u++)e[t[u].replace(/-/g,"_")]=t[u];return e}(["before-newline","after-newline","preserve-newline"]),k=[g.before_newline,g.preserve_newline],m="BlockStatement",w="Statement",r="ObjectLiteral",h="ArrayLiteral",y="ForInitializer",x="Conditional",v="Expression";function E(t,e){e.multiline_frame||e.mode===y||e.mode===x||t.remove_indent(e.start_line_index)}function R(t){return t===h}function O(t){return c(t,[v,y,x])}function T(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new _(e)}T.prototype.create_flags=function(t,e){var u=0;return t&&(u=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>u&&(u=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new n(f.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:u,alignment:0,line_indent_level:t?t.line_indent_level:u,start_line_index:this._output.get_line_number(),ternary_depth:0}},T.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var u=new s(t,this._options);return this._tokens=u.tokenize(),t},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&o.lineBreak.test(t||"")&&(e=t.match(o.lineBreak)[0]));for(var u=this._tokens.next();u;)this.handle_token(u),this._last_last_text=this._flags.last_token.text,this._flags.last_token=u,u=this._tokens.next();return this._output.get_code(e)},T.prototype.handle_token=function(t,e){t.type===f.START_EXPR?this.handle_start_expr(t):t.type===f.END_EXPR?this.handle_end_expr(t):t.type===f.START_BLOCK?this.handle_start_block(t):t.type===f.END_BLOCK?this.handle_end_block(t):t.type===f.WORD?this.handle_word(t):t.type===f.RESERVED?this.handle_word(t):t.type===f.SEMICOLON?this.handle_semicolon(t):t.type===f.STRING?this.handle_string(t):t.type===f.EQUALS?this.handle_equals(t):t.type===f.OPERATOR?this.handle_operator(t):t.type===f.COMMA?this.handle_comma(t):t.type===f.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===f.COMMENT?this.handle_comment(t,e):t.type===f.DOT?this.handle_dot(t):t.type===f.EOF?this.handle_eof(t):(t.type,f.UNKNOWN,this.handle_unknown(t,e))},T.prototype.handle_whitespace_and_comments=function(t,e){var u=t.newlines,i=this._options.keep_array_indentation&&R(this._flags.mode);if(t.comments_before)for(var n=t.comments_before.next();n;)this.handle_whitespace_and_comments(n,e),this.handle_token(n,e),n=t.comments_before.next();if(i)for(var _=0;_<u;_+=1)this.print_newline(0<_,e);else if(this._options.max_preserve_newlines&&u>this._options.max_preserve_newlines&&(u=this._options.max_preserve_newlines),this._options.preserve_newlines&&1<u){this.print_newline(!1,e);for(var s=1;s<u;s+=1)this.print_newline(!0,e)}};var A=["async","break","continue","return","throw","yield"];T.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var u=this._options.preserve_newlines&&t.newlines||e;if(c(this._flags.last_token.text,lLine truncated
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("beautifier",[],e):"object"==typeof exports?exports.beautifier=e():t.beautifier=e()}("undefined"!=typeof self?self:"undefined"!=typeof windows?window:"undefined"!=typeof global?global:this,(function(){return function(){"use strict";var t={7:function(t){function e(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.t=e},418:function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function i(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}i.prototype.restart=function(){this.__position=0},i.prototype.back=function(){this.__position>0&&(this.__position-=1)},i.prototype.hasNext=function(){return this.__position<this.__input_length},i.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},i.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},i.prototype.__match=function(t,i){t.lastIndex=i;var n=t.exec(this.__input);return!n||e&&t.sticky||n.index!==i&&(n=null),n},i.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},i.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},i.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},i.prototype.read=function(t,e,i){var n,_="";return t&&(n=this.match(t))&&(_+=n[0]),!e||!n&&t||(_+=this.readUntil(e,i)),_},i.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var _=t.exec(this.__input);return _?(n=_.index,e&&(n+=_[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},i.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},i.prototype.get_regexp=function(t,i){var n=null,_="g";return i&&e&&(_="y"),"string"==typeof t&&""!==t?n=new RegExp(t,_):t&&(n=new RegExp(t.source,_)),n},i.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},i.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},i.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.g=i},915:function(t){function e(t,e){this.raw_options=function(t,e){var i,n={};for(i in t=function(t){var e,i={};for(e in t)i[e.replace(/-/g,"_")]=t[e];return i}(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}e.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},e.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},e.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},e.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},e.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' cLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
var JSHINT;"undefined"==typeof window&&(window={}),function(){var e;e=function t(n,r,i){function o(a,u){if(!r[a]){if(!n[a]){var c="function"==typeof e&&e;if(!u&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[a]={exports:{}};n[a][0].call(f.exports,function(e){var t=n[a][1][e];return o(t||e)},f,f.exports,t,n,r,i)}return r[a].exports}for(var s="function"==typeof e&&e,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){for(var r=[],i=0;i<128;i++)r[i]=36===i||i>=65&&i<=90||95===i||i>=97&&i<=122;for(var o=[],i=0;i<128;i++)o[i]=r[i]||i>=48&&i<=57;t.exports={asciiIdentifierStartTable:r,asciiIdentifierPartTable:o}},{}],2:[function(e,t,n){var r=[];[[768,112],[1155,5],[1425,45],1472,[1473,2],[1476,2],1480,[1552,11],[1611,31],1649,[1750,7],[1759,6],[1767,2],[1770,4],[1776,10],1810,[1840,27],[1958,11],[1984,10],[2027,9],[2070,4],[2075,9],[2085,3],[2089,5],[2137,3],[2276,27],[2304,4],[2362,3],[2366,18],[2385,7],[2402,2],[2406,10],[2433,3],2493,[2494,7],[2503,2],[2507,3],2520,[2530,2],[2534,10],[2561,3],2621,[2622,5],[2631,2],[2635,3],2642,[2662,12],2678,[2689,3],2749,[2750,8],[2759,3],[2763,3],[2786,2],[2790,10],[2817,3],2877,[2878,7],[2887,2],[2891,3],[2902,2],[2914,2],[2918,10],2947,[3006,5],[3014,3],[3018,4],3032,[3046,10],[3073,3],[3134,7],[3142,3],[3146,4],[3157,2],[3170,2],[3174,10],[3202,2],3261,[3262,7],[3270,3],[3274,4],[3285,2],[3298,2],[3302,10],[3330,2],[3390,7],[3398,3],[3402,4],3416,[3426,2],[3430,10],[3458,2],3531,[3535,6],3543,[3544,8],[3570,2],3634,[3636,7],[3655,8],[3664,10],3762,[3764,6],[3771,2],[3784,6],[3792,10],[3864,2],[3872,10],3894,3896,3898,[3902,2],[3953,20],[3974,2],[3981,11],[3993,36],4039,[4139,20],[4160,10],[4182,4],[4190,3],[4194,3],[4199,7],[4209,4],[4226,12],[4239,15],[4957,3],[5906,3],[5938,3],[5970,2],[6002,2],[6068,32],6110,[6112,10],[6155,3],[6160,10],6314,[6432,12],[6448,12],[6470,10],[6576,17],[6600,2],[6608,10],[6679,5],[6741,10],[6752,29],[6783,11],[6800,10],[6912,5],[6964,17],[6992,10],[7019,9],[7040,3],[7073,13],[7088,10],[7142,14],[7204,20],[7232,10],[7248,10],[7376,3],[7380,21],7406,[7410,3],[7616,39],[7676,4],[8204,2],[8255,2],8277,[8400,13],8418,[8421,12],[11503,3],11648,[11744,32],[12330,6],[12441,2],[42528,10],42608,[42612,10],42656,[42736,2],43011,43015,43020,[43043,5],[43136,2],[43188,17],[43216,10],[43232,18],[43264,10],[43302,8],[43335,13],[43392,4],[43443,14],[43472,10],[43561,14],43588,[43596,2],[43600,10],43644,43697,[43698,3],[43703,2],[43710,2],43714,[43755,5],[43765,2],[44003,8],[44012,2],[44016,10],64287,[65024,16],[65056,7],[65075,2],[65101,3],[65296,10],65344].forEach(function(o){for(var x=0;x<(o[1]||1);x++)r.push((o[0]||o)+x)});t.exports=r},{}],3:[function(e,t,n){var r=[];[171,182,187,[192,23],[216,31],[248,458],[710,12],[736,5],749,751,[880,5],[886,2],[890,4],903,[904,3],909,[910,20],[931,83],[1015,139],[1162,158],[1329,38],1370,[1377,39],[1488,27],[1520,3],[1568,43],[1646,2],[1649,99],1750,[1765,2],[1774,2],[1786,3],1792,1809,[1810,30],[1869,89],1970,[1994,33],[2036,2],2043,[2048,22],2075,2085,2089,[2112,25],2209,[2210,11],[2308,54],2366,2385,[2392,10],[2417,7],[2425,7],[2437,8],[2447,2],[2451,22],[2474,7],2483,[2486,4],2494,2511,[2524,2],[2527,3],[2544,2],[2565,6],[2575,2],[2579,22],[2602,7],[2610,2],[2613,2],[2616,2],[2649,4],2655,[2674,3],[2693,9],[2703,3],[2707,22],[2730,7],[2738,2],[2741,5],2750,2769,[2784,2],[2821,8],[2831,2],[2835,22],[2858,7],[2866,2],[2869,5],2878,[2908,2],[2911,3],2930,2948,[2949,6],[2958,3],[2962,4],[2969,2],2973,[2974,2],[2979,2],[2984,3],[2990,12],3025,[3077,8],[3086,3],[3090,23],[3114,10],[3125,5],3134,[3160,2],[3168,2],[3205,8],[3214,3],[3218,23],[3242,10],[3253,5],3262,3295,[3296,2],[3313,2],[3333,8],[3342,3],[3346,41],3390,3407,[3424,2],[3450,6],[3461,18],[3482,24],[3507,9],3518,[3520,7],[3585,48],[3634,2],[3648,7],[3713,2],3717,[3719,2],3723,3726,[3732,4],[3737,7],[3745,3],3750,3752,[3754,2],[3757,4],[3762,2],3774,[3776,5],3783,[3804,4],3841,[3904,8],[3913,36],[3976,5],[4096,43],4160,[4176,6],[4186,4],4194,[4197,2],[4206,3],[4213,13],4239,[4256,38],4296,4302,[4304,43],[4348,333],[4682,4],[4688,7],4697,[4698,4],[4704,41],[4746,4],[4752,33],[4786,4],[4792,7],4801,[4802,4],[4808,15],[4824,57],[4882,4],[4888,67],[4992,16],[5024,85],[5121,620],[5743,17],[5761,26],[5792,75],[5870,3],[5888,13],[5902,4],[5920,18],[5952,18],[5984,13],[5998,3],[6016,52],6104,6109,[6176,88],[6272,41],6315,[6320,70],[6400,29],[6480,30],[6512,5],[6528,44],[6593,7],[6656,23],[6688,53],6824,[6917,47],[6981,7],[7043,30],[7086,2],[7098,44],[7168,36],[7245,3],[7258,36],[7401,4],[7406,4],[7413,2],[7424,192],[7680,278],[7960,6],[7968,38],[8008,6],[8016,8],8026,8028,8030,[8031,31],[8064,53],[8118,7],8127,[8130,3],[8134,7],[8144,4],[8150,6],[8160,13],[8178,3],[8182,7],8306,8320,[8336,13],8451,8456,[8458,10],8470,[8473,5],8485,8487,8489,[8490,4],[8495,11],[8508,4],[8517,5],8527,[8544,41],[11264,47],[11312,47],[11360,133],[11499,4],[11506,2],[11520,38],11560,11566,[11568,56],116Line truncated
|
||||
var JSHINT;"undefined"==typeof window&&(window={}),function(){var c=function r(i,u,o){function a(n,e){if(!u[n]){if(!i[n]){var t="function"==typeof c&&c;if(!e&&t)return t(n,!0);if(s)return s(n,!0);e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}t=u[n]={exports:{}};i[n][0].call(t.exports,function(e){var t=i[n][1][e];return a(t||e)},t,t.exports,r,i,u,o)}return u[n].exports}for(var s="function"==typeof c&&c,e=0;e<o.length;e++)a(o[e]);return a}({1:[function(e,t,n){for(var r=[],i=0;i<128;i++)r[i]=36===i||65<=i&&i<=90||95===i||97<=i&&i<=122;for(var u=[],i=0;i<128;i++)u[i]=r[i]||48<=i&&i<=57;t.exports={asciiIdentifierStartTable:r,asciiIdentifierPartTable:u}},{}],2:[function(e,t,n){t.exports=/^(?:[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0525\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971\u0972\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3D\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8B\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCB\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA65F\uA662-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B\uA78C\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA2D\uFA30-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC])(?:[\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0525\u0531-\u0556\u0559\u0561-\u0Line truncated
|
||||
Binary file not shown.
@@ -699,3 +699,12 @@ div.checkboxSet {
|
||||
.etableInputDiv textarea:hover {
|
||||
margin: -5px;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: code;
|
||||
src: url(./FiraCode.ttf);
|
||||
}
|
||||
|
||||
.main .CodeMirror {
|
||||
font-family: code, 微软雅黑, 黑体, 新宋体, Verdana;
|
||||
}
|
||||
@@ -710,3 +710,11 @@ div.checkboxSet {
|
||||
margin: -5px;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Fira;
|
||||
src: url(./FiraCode.ttf);
|
||||
}
|
||||
|
||||
.main .CodeMirror {
|
||||
font-family: Fira, Menlo, Consolas, 'Courier New', Courier, monospace;
|
||||
}
|
||||
+31
-7
@@ -7,11 +7,11 @@ editor_multi = function () {
|
||||
var extraKeys = {
|
||||
"Ctrl-/": function (cm) { cm.toggleComment(); },
|
||||
"Ctrl-B": function (cm) { ternServer.jumpToDef(cm); },
|
||||
"Ctrl-Q": function(cm) { ternServer.rename(cm); },
|
||||
"Ctrl-Q": function (cm) { ternServer.rename(cm); },
|
||||
"Cmd-F": CodeMirror.commands.findPersistent,
|
||||
"Ctrl-F": CodeMirror.commands.findPersistent,
|
||||
"Ctrl-R": CodeMirror.commands.replaceAll,
|
||||
"Ctrl-D": function(cm){ cm.foldCode(cm.getCursor()); },
|
||||
"Ctrl-D": function (cm) { cm.foldCode(cm.getCursor()); },
|
||||
"Ctrl-O": function () { editor_multi.openUrl('/_docs/#/api'); },
|
||||
"Ctrl-P": function () { editor_multi.openUrl('https://h5mota.com/plugins/'); }
|
||||
};
|
||||
@@ -48,14 +48,14 @@ editor_multi = function () {
|
||||
'Ctrl-P': '打开在线插件列表(Ctrl+P)'
|
||||
};
|
||||
|
||||
document.getElementById('codemirrorCommands').innerHTML =
|
||||
"<option value='' selected>执行操作...</option>" +
|
||||
document.getElementById('codemirrorCommands').innerHTML =
|
||||
"<option value='' selected>执行操作...</option>" +
|
||||
Object.keys(commandsName).map(function (name) {
|
||||
return "<option value='" + name + "'>" + commandsName[name] + "</option>"
|
||||
}).join('');
|
||||
|
||||
var coredef = terndefs_f6783a0a_522d_417e_8407_94c67b692e50[2];
|
||||
Object.keys(core.material.enemys).forEach(function (name){
|
||||
Object.keys(core.material.enemys).forEach(function (name) {
|
||||
coredef.core.material.enemys[name] = {
|
||||
"!type": "enemy",
|
||||
"!doc": core.material.enemys[name].name || "怪物"
|
||||
@@ -236,7 +236,15 @@ editor_multi = function () {
|
||||
document.getElementById('left7').style = 'z-index:-1;opacity: 0;';
|
||||
}
|
||||
editor_multi.setLint = function () {
|
||||
codeEditor.setOption("lint", editor_multi.lintAutocomplete);
|
||||
if (editor_multi.lintAutocomplete) {
|
||||
codeEditor.setOption("lint", {
|
||||
options: {
|
||||
esversion: 2021
|
||||
}
|
||||
});
|
||||
} else {
|
||||
codeEditor.setOption("lint", false);
|
||||
}
|
||||
codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete);
|
||||
document.getElementById("lintCheckbox").checked = editor_multi.lintAutocomplete;
|
||||
}
|
||||
@@ -253,7 +261,7 @@ editor_multi = function () {
|
||||
var _format = function () {
|
||||
if (!editor_multi.lintAutocomplete) return;
|
||||
var offset = (codeEditor.getScrollInfo() || {}).top || 0;
|
||||
_setValue(js_beautify(codeEditor.getValue(), {
|
||||
_setValue(beautifier.js(codeEditor.getValue(), {
|
||||
brace_style: "collapse-preserve-inline",
|
||||
indent_with_tabs: true,
|
||||
jslint_happy: true
|
||||
@@ -486,6 +494,22 @@ editor_multi = function () {
|
||||
editor_multi.importFile(dict[mod])
|
||||
}
|
||||
|
||||
// 字体大小
|
||||
{
|
||||
const CONFIG_KEY = "editor_multi.fontSize";
|
||||
let fontsize = editor.config.get(CONFIG_KEY, 14);
|
||||
const input = document.getElementById("editor_multi_fontsize");
|
||||
const check = document.getElementById("editor_multi_fontweight")
|
||||
input.value = fontsize;
|
||||
editor_multi.setFontSize = function () {
|
||||
const value = Number(input.value);
|
||||
editor.config.set(CONFIG_KEY, value);
|
||||
const ele = codeEditor.getWrapperElement()
|
||||
ele.style.fontSize = `${value}px`;
|
||||
ele.style.fontWeight = `${check.checked ? 'bold' : 'normal'}`
|
||||
}
|
||||
}
|
||||
|
||||
return editor_multi;
|
||||
}
|
||||
//editor_multi=editor_multi();
|
||||
+15
-9
@@ -242,15 +242,21 @@
|
||||
<button onclick="confirmColor()">确定</button>
|
||||
</div>
|
||||
<div id="left7" style="z-index:-1;opacity: 0;"><!-- 多行文本编辑器 -->
|
||||
<button onclick="editor_multi.confirm()">确认</button>
|
||||
<button onclick="editor_multi.cancel()">取消</button>
|
||||
<button onclick="editor_multi.confirm(true)">应用</button>
|
||||
<button onclick="editor_multi.format()">格式化</button>
|
||||
<button id="editor_multi_preview" style="display: none;">预览</button>
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox"
|
||||
style="vertical-align: middle;margin-left:6px"/>
|
||||
<span style="vertical-align: middle; margin-left: -3px">语法检查</span>
|
||||
<select id="codemirrorCommands" onchange="editor_multi.doCommand(this)" style="vertical-align: middle; margin-left: 6px;"></select>
|
||||
<div>
|
||||
<button onclick="editor_multi.confirm()">确认</button>
|
||||
<button onclick="editor_multi.cancel()">取消</button>
|
||||
<button onclick="editor_multi.confirm(true)">应用</button>
|
||||
<button onclick="editor_multi.format()">格式化</button>
|
||||
<button id="editor_multi_preview" style="display: none;">预览</button>
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox"
|
||||
style="vertical-align: middle;margin-left:6px"/>
|
||||
<span style="vertical-align: middle; margin-left: -3px">语法检查</span>
|
||||
<select id="codemirrorCommands" onchange="editor_multi.doCommand(this)" style="vertical-align: middle; margin-left: 6px;"></select>
|
||||
<span>字体大小</span>
|
||||
<input style="width: 40px" type="number" onchange="editor_multi.setFontSize()" id="editor_multi_fontsize" />
|
||||
<span>字体加粗</span>
|
||||
<input style="width: 40px" type="checkbox" onchange="editor_multi.setFontSize()" id="editor_multi_fontweight" />
|
||||
</div>
|
||||
<textarea id="multiLineCode" name="multiLineCode"></textarea>
|
||||
</div>
|
||||
<div id="left8" class='leftTab' style="z-index:-1;opacity: 0;"><!-- functions -->
|
||||
|
||||
+15
-9
@@ -238,15 +238,21 @@
|
||||
<button onclick="confirmColor()">确定</button>
|
||||
</div>
|
||||
<div id="left7" style="z-index:-1;opacity: 0;"><!-- 多行文本编辑器 -->
|
||||
<button onclick="editor_multi.confirm()">确认</button>
|
||||
<button onclick="editor_multi.cancel()">取消</button>
|
||||
<button onclick="editor_multi.confirm(true)">应用</button>
|
||||
<button onclick="editor_multi.format()">格式化</button>
|
||||
<button id="editor_multi_preview" style="display: none;">预览</button>
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox"
|
||||
style="vertical-align: middle;margin-left:6px"/>
|
||||
<span style="vertical-align: middle; margin-left: -3px">语法检查</span>
|
||||
<select id="codemirrorCommands" onchange="editor_multi.doCommand(this)" style="vertical-align: middle; margin-left: 6px;"></select>
|
||||
<div>
|
||||
<button onclick="editor_multi.confirm()">确认</button>
|
||||
<button onclick="editor_multi.cancel()">取消</button>
|
||||
<button onclick="editor_multi.confirm(true)">应用</button>
|
||||
<button onclick="editor_multi.format()">格式化</button>
|
||||
<button id="editor_multi_preview" style="display: none;">预览</button>
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox"
|
||||
style="vertical-align: middle;margin-left:6px"/>
|
||||
<span style="vertical-align: middle; margin-left: -3px">语法检查</span>
|
||||
<select id="codemirrorCommands" onchange="editor_multi.doCommand(this)" style="vertical-align: middle; margin-left: 6px;"></select>
|
||||
<span>字体大小</span>
|
||||
<input style="width: 40px" type="number" onchange="editor_multi.setFontSize()" id="editor_multi_fontsize" />
|
||||
<span>字体加粗</span>
|
||||
<input style="width: 40px" type="checkbox" onchange="editor_multi.setFontSize()" id="editor_multi_fontweight" />
|
||||
</div>
|
||||
<textarea id="multiLineCode" name="multiLineCode"></textarea>
|
||||
</div>
|
||||
<div id="left8" class='leftTab' style="z-index:-1;opacity: 0;"><!-- functions -->
|
||||
|
||||
Reference in new issue
Block a user