UNPKG

zcloudcmd

Version:

### [Main][MainURL] [Blog][BlogURL] Live([Heroku][HerokuURL], [Now][NowURL])

2 lines 4.01 kB
!function(t){function n(n){for(var r,u,f=n[0],c=n[1],a=n[2],d=0,p=[];d<f.length;d++)u=f[d],o[u]&&p.push(o[u][0]),o[u]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r]);for(l&&l(n);p.length;)p.shift()();return i.push.apply(i,a||[]),e()}function e(){for(var t,n=0;n<i.length;n++){for(var e=i[n],r=!0,f=1;f<e.length;f++){var c=e[f];0!==o[c]&&(r=!1)}r&&(i.splice(n--,1),t=u(u.s=e[0]))}return t}var r={},o={4:0},i=[];function u(n){if(r[n])return r[n].exports;var e=r[n]={i:n,l:!1,exports:{}};return t[n].call(e.exports,e,e.exports,u),e.l=!0,e.exports}u.m=t,u.c=r,u.d=function(t,n,e){u.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,n){if(1&n&&(t=u(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(u.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)u.d(e,r,function(n){return t[n]}.bind(null,r));return e},u.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(n,"a",n),n},u.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},u.p="/dist/";var f=window.webpackJsonp=window.webpackJsonp||[],c=f.push.bind(f);f.push=n,f=f.slice();for(var a=0;a<f.length;a++)n(f[a]);var l=c;i.push([80,0]),e()}({80:function(t,n,e){"use strict";function r(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,o=!1,i=void 0;try{for(var u,f=t[Symbol.iterator]();!(r=(u=f.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==f.return||f.return()}finally{if(o)throw i}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t,n,e,r,o,i,u){try{var f=t[i](u),c=f.value}catch(t){return void e(t)}f.done?n(c):Promise.resolve(c).then(r,o)}function u(t){return function(){var n=this,e=arguments;return new Promise(function(r,o){var u=t.apply(n,e);function f(t){i(u,r,o,f,c,"next",t)}function c(t){i(u,r,o,f,c,"throw",t)}f(void 0)})}}var f=e(6).promisify,c=e(20),a=e(2),l=e(4),d=f(l.js),p=e(5).MAX_FILE_SIZE,s=e(9),v=s.time,h=s.timeEnd;CloudCmd.Edit=n;var y,w,b=CloudCmd.config("editor"),m=!0,g={afterShow:function(){w.moveCursorTo(0,0).focus()}};function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){o(t,n,e[n])})}return t}({},t,g);if(!t.afterShow)return n;!function(t,n){if("function"!=typeof n)throw Error(t+" should be a function!")}("options.afterShow",t.afterShow);var e={config:n};return n.afterShow=function(){e(),t.afterShow()},n}function x(){return w}t.exports.init=u(function*(){var t=function(){var t=a("div",{style:'width : 100%;height : 100%;font-family: "Droid Sans Mono";',notAppend:!0});return y=t,t}();yield CloudCmd.View(),yield O(t)}),t.exports.show=function(t){m||(CloudCmd.View.show(y,S(t)),x().setOptions({fontSize:16}))},t.exports.getEditor=x,t.exports.getElement=function(){return y},t.exports.hide=function(){CloudCmd.View.hide()};var O=function(){var t=u(function*(t){var n="".concat(CloudCmd.prefix,"/").concat(b),e=CloudCmd.prefix,o="".concat(CloudCmd.prefixSocket,"/").concat(b),i="".concat(n,"/").concat(b,".js");v("Edit load"),yield d(i);var u=f(window[b]),a=r(yield c(u,t,{maxSize:p,prefix:n,prefixSocket:o,socketPath:e}),1)[0];h("Edit load"),w=a,m=!1});return function(n){return t.apply(this,arguments)}}()}}); //# sourceMappingURL=edit.js.map