Изменения от Главреда ГитЖС | Changes of GitJS Glavred

This commit is contained in:
Главред | Glavred committed 2021-02-05 15:01:34 +03:00
1 parent 84bf901b76
commit 2f8c262382
23 files changed
+330 -64

No files matched your search

+19 -14
View File
@@ -2,23 +2,28 @@
0.1.0
https://git.opengamestudio.org/kornerr/AMYP
x /00🕸jquery🕸jquery-3.5.1.min.js
/01🕸uikit🕸uikit-icons.min.js
/01🕸uikit🕸uikit.min.css
/01🕸uikit🕸uikit.min.js
x /01🕸uikit🕸🎬.js
/01🕸uikit🕸🎬.череда
x /02🕸UIK🕸🎬.js
/02🕸UIK🕸🎬.череда
x /00🕸jquery_3.5.1🕸jquery-3.5.1.min.js
x /01🕸uikit_3.2.0🕸.js
/01🕸uikit_3.2.0🕸.череда
/01🕸uikit_3.2.0🕸uikit-icons.min.js
/01🕸uikit_3.2.0🕸uikit.min.css
/01🕸uikit_3.2.0🕸uikit.min.js
x /02🕸UIK🕸.js
/02🕸UIK🕸.череда
/02🕸UIK🕸🙈.css
/02🕸UIK🕸🙈.html
x /70🕸механика🕸🎬.js
/70🕸механика🕸🎬.череда
x /80🕸морда🕸🎬.js
/80🕸морда🕸🎬.череда
x /03🕸isomorphic-git_1.7.2🕸.js
/03🕸isomorphic-git_1.7.2🕸.череда
/03🕸isomorphic-git_1.7.2🕸index.js
/03🕸isomorphic-git_1.7.2🕸index.umd.min.js
/03🕸isomorphic-git_1.7.2🕸lightning-fs.min.js
x /70🕸механика🕸.js
/70🕸механика🕸.череда
x /80🕸морда🕸.js
/80🕸морда🕸.череда
x /80🕸морда🕸📖.js
x /81🕸➕🕸🎬.js
/81🕸➕🕸🎬.череда
x /81🕸➕🕸.js
/81🕸➕🕸.череда
/81🕸➕🕸🙈.html
x /90🕸🎬.js
/90🕸🎬.череда
File renamed without changes.
@@ -1,10 +1,11 @@
УстановитьUIkit = мир =>
{
var м = мир.модули.модульПоУказателю(УКАЗАТЕЛЬ_ЭТОГО_МОДУЛЯ);
var css = м.содержимое["/01🕸uikit🕸uikit.min.css"];
var js = м.содержимое["/01🕸uikit🕸uikit.min.js"];
var iconsJS = м.содержимое["/01🕸uikit🕸uikit-icons.min.js"];
var префикс = ИМЯ_ЭТОГО_ФАЙЛА.substring(0, ИМЯ_ЭТОГО_ФАЙЛА.length - 3);
var css = м.содержимое[префикс + "uikit.min.css"];
var js = м.содержимое[префикс + "uikit.min.js"];
var iconsJS = м.содержимое[префикс + "uikit-icons.min.js"];
// Применить стиль.
var style = document.createElement("style");
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3 -9
View File
@@ -60,15 +60,9 @@
ЗагрузитьМакетUIK = мир =>
{
var м = мир.модули.модульПоУказателю(УКАЗАТЕЛЬ_ЭТОГО_МОДУЛЯ);
var префикс = ИМЯ_ЭТОГО_ФАЙЛА.substring(0, ИМЯ_ЭТОГО_ФАЙЛА.length - 3);
мир.макет = {
"структура": м.содержимое["/02🕸UIK🕸🙈.html"],
"вид": м.содержимое["/02🕸UIK🕸🙈.css"],
"структура": м.содержимое[префикс + "🙈.html"],
"вид": м.содержимое[префикс + "🙈.css"],
};
};
console.debug("обработали модуль UIK")
File renamed without changes.
+22
View File
@@ -0,0 +1,22 @@
УстановитьIsomorphicGit = мир =>
{
var м = мир.модули.модульПоУказателю(УКАЗАТЕЛЬ_ЭТОГО_МОДУЛЯ);
var префикс = ИМЯ_ЭТОГО_ФАЙЛА.substring(0, ИМЯ_ЭТОГО_ФАЙЛА.length - 3);
var isogit = м.содержимое[префикс + "index.umd.min.js"];
var http = м.содержимое[префикс + "index.js"];
var lfs = м.содержимое[префикс + "lightning-fs.min.js"];
function загрузитьСкрипт(код)
{
var скрипт = document.createElement("script");
скрипт.innerHTML = код;
document.body.appendChild(скрипт);
}
загрузитьСкрипт(lfs);
загрузитьСкрипт(isogit);
eval(http);
мир.гитHTTP = { request };
};
@@ -0,0 +1,2 @@
ручной пуск
установить IsomorphicGit
+167
View File
@@ -0,0 +1,167 @@
// https://unpkg.com/isomorphic-git@1.7.2/http/web/index.js
/**
* @typedef {Object} GitProgressEvent
* @property {string} phase
* @property {number} loaded
* @property {number} total
*/
/**
* @callback ProgressCallback
* @param {GitProgressEvent} progress
* @returns {void | Promise<void>}
*/
/**
* @typedef {Object} GitHttpRequest
* @property {string} url - The URL to request
* @property {string} [method='GET'] - The HTTP method to use
* @property {Object<string, string>} [headers={}] - Headers to include in the HTTP request
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
* @property {object} [signal] - Reserved for future use (canceling a request)
*/
/**
* @typedef {Object} GitHttpResponse
* @property {string} url - The final URL that was fetched after any redirects
* @property {string} [method] - The HTTP method that was used
* @property {Object<string, string>} [headers] - HTTP response headers
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of the response
* @property {number} statusCode - The HTTP status code
* @property {string} statusMessage - The HTTP status message
*/
/**
* @callback HttpFetch
* @param {GitHttpRequest} request
* @returns {Promise<GitHttpResponse>}
*/
/**
* @typedef {Object} HttpClient
* @property {HttpFetch} request
*/
// Convert a value to an Async Iterator
// This will be easier with async generator functions.
function fromValue(value) {
let queue = [value];
return {
next() {
return Promise.resolve({ done: queue.length === 0, value: queue.pop() })
},
return() {
queue = [];
return {}
},
[Symbol.asyncIterator]() {
return this
},
}
}
function getIterator(iterable) {
if (iterable[Symbol.asyncIterator]) {
return iterable[Symbol.asyncIterator]()
}
if (iterable[Symbol.iterator]) {
return iterable[Symbol.iterator]()
}
if (iterable.next) {
return iterable
}
return fromValue(iterable)
}
// Currently 'for await' upsets my linters.
async function forAwait(iterable, cb) {
const iter = getIterator(iterable);
while (true) {
const { value, done } = await iter.next();
if (value) await cb(value);
if (done) break
}
if (iter.return) iter.return();
}
async function collect(iterable) {
let size = 0;
const buffers = [];
// This will be easier once `for await ... of` loops are available.
await forAwait(iterable, value => {
buffers.push(value);
size += value.byteLength;
});
const result = new Uint8Array(size);
let nextIndex = 0;
for (const buffer of buffers) {
result.set(buffer, nextIndex);
nextIndex += buffer.byteLength;
}
return result
}
// Convert a web ReadableStream (not Node stream!) to an Async Iterator
// adapted from https://jakearchibald.com/2017/async-iterators-and-generators/
function fromStream(stream) {
// Use native async iteration if it's available.
if (stream[Symbol.asyncIterator]) return stream
const reader = stream.getReader();
return {
next() {
return reader.read()
},
return() {
reader.releaseLock();
return {}
},
[Symbol.asyncIterator]() {
return this
},
}
}
/* eslint-env browser */
/**
* HttpClient
*
* @param {GitHttpRequest} request
* @returns {Promise<GitHttpResponse>}
*/
async function request({
onProgress,
url,
method = 'GET',
headers = {},
body,
}) {
// streaming uploads aren't possible yet in the browser
if (body) {
body = await collect(body);
}
const res = await fetch(url, { method, headers, body });
const iter =
res.body && res.body.getReader
? fromStream(res.body)
: [new Uint8Array(await res.arrayBuffer())];
// convert Header object to ordinary JSON
headers = {};
for (const [key, value] of res.headers.entries()) {
headers[key] = value;
}
return {
url: res.url,
method: res.method,
statusCode: res.status,
statusMessage: res.statusText,
body: iter,
headers: headers,
}
}
var index = { request };
//export default index;
//export { request };
+10
View File
@@ -0,0 +1,10 @@
// https://unpkg.com/isomorphic-git@1.7.2/index.umd.min.js
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.git=e():t.git=e()}(self,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=152)}([function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(24);function i(t,e){if(void 0===e)throw new n.a(t)}},function(t,e,r){"use strict";function n(t){return t.replace(/\/\.\//g,"/").replace(/\/{2,}/g,"/").replace(/^\/\.$/,"/").replace(/^\.\/$/,".").replace(/^\.\//,"").replace(/\/\.$/,"").replace(/(.+)\/$/,"$1").replace(/^$/,".")}function i(...t){return n(t.map(n).join("/"))}r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return u}));var n=r(21),i=r.n(n),o=r(33),a=r(26);function s(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,c,"next",t)}function c(t){s(o,n,i,a,c,"throw",t)}a(void 0)}))}}class u{constructor(t){if(void 0!==t._original_unwrapped_fs)return t;const e=Object.getOwnPropertyDescriptor(t,"promises");e&&e.enumerable?(this._readFile=t.promises.readFile.bind(t.promises),this._writeFile=t.promises.writeFile.bind(t.promises),this._mkdir=t.promises.mkdir.bind(t.promises),this._rmdir=t.promises.rmdir.bind(t.promises),this._unlink=t.promises.unlink.bind(t.promises),this._stat=t.promises.stat.bind(t.promises),this._lstat=t.promises.lstat.bind(t.promises),this._readdir=t.promises.readdir.bind(t.promises),this._readlink=t.promises.readlink.bind(t.promises),this._symlink=t.promises.symlink.bind(t.promises)):(this._readFile=i()(t.readFile.bind(t)),this._writeFile=i()(t.writeFile.bind(t)),this._mkdir=i()(t.mkdir.bind(t)),this._rmdir=i()(t.rmdir.bind(t)),this._unlink=i()(t.unlink.bind(t)),this._stat=i()(t.stat.bind(t)),this._lstat=i()(t.lstat.bind(t)),this._readdir=i()(t.readdir.bind(t)),this._readlink=i()(t.readlink.bind(t)),this._symlink=i()(t.symlink.bind(t))),this._original_unwrapped_fs=t}exists(t,e={}){var r=this;return c((function*(){try{return yield r._stat(t),!0}catch(t){if("ENOENT"===t.code||"ENOTDIR"===t.code)return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',t),t}}))()}read(e,r={}){var n=this;return c((function*(){try{let i=yield n._readFile(e,r);return"string"!=typeof i&&(i=t.from(i)),i}catch(t){return null}}))()}write(t,e,r={}){var n=this;return c((function*(){try{return void(yield n._writeFile(t,e,r))}catch(i){yield n.mkdir(Object(a.a)(t)),yield n._writeFile(t,e,r)}}))()}mkdir(t,e=!1){var r=this;return c((function*(){try{return void(yield r._mkdir(t))}catch(n){if(null===n)return;if("EEXIST"===n.code)return;if(e)throw n;if("ENOENT"===n.code){const e=Object(a.a)(t);if("."===e||"/"===e||e===t)throw n;yield r.mkdir(e),yield r.mkdir(t,!0)}}}))()}rm(t){var e=this;return c((function*(){try{yield e._unlink(t)}catch(t){if("ENOENT"!==t.code)throw t}}))()}rmdir(t){var e=this;return c((function*(){try{yield e._rmdir(t)}catch(t){if("ENOENT"!==t.code)throw t}}))()}readdir(t){var e=this;return c((function*(){try{const r=yield e._readdir(t);return r.sort(o.a),r}catch(t){return"ENOTDIR"===t.code?null:[]}}))()}readdirDeep(t){var e=this;return c((function*(){const r=yield e._readdir(t);return(yield Promise.all(r.map(function(){var r=c((function*(r){const n=t+"/"+r;return(yield e._stat(n)).isDirectory()?e.readdirDeep(n):n}));return function(t){return r.apply(this,arguments)}}()))).reduce((t,e)=>t.concat(e),[])}))()}lstat(t){var e=this;return c((function*(){try{return yield e._lstat(t)}catch(t){if("ENOENT"===t.code)return null;throw t}}))()}readlink(t,e={encoding:"buffer"}){var r=this;return c((function*(){try{return r._readlink(t,e)}catch(t){if("ENOENT"===t.code)return null;throw t}}))()}writelink(t,e){var r=this;return c((function*(){return r._symlink(e.toString("utf8"),t)}))()}}}).call(this,r(10).Buffer)},function(t,e,r){"use strict";var n=r(28),i=r(58),o=r(9);class a{constructor(t){if(this.refs=new Map,this.parsedConfig=Line truncated
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var n=r(131),i=r(132),o=r(133);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=d(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|h(e.length);return 0===(t=s(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=s(t,e<0?0:0|h(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|h(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===c)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){for(var l=!0,d=0;d<c;d++)if(u(t,o+d)!==u(e,d)){l=!1;break}if(l)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function b(t,e,r,n){return H(M(e,t.length-r),t,r,n)}function _(t,e,r,n){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return _(t,e,r,n)}function O(t,e,r,n){return H(F(e),tLine truncated
//# sourceMappingURL=index.umd.min.js.map
+2
View File
@@ -0,0 +1,2 @@
// https://unpkg.com/@isomorphic-git/lightning-fs@4.3.0/dist/lightning-fs.min.js
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LightningFS=e():t.LightningFS=e()}(self,function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}([function(t,e){function i(t){if(0===t.length)return".";let e=n(t);return e=e.reduce(s,[]),r(...e)}function r(...t){if(0===t.length)return"";let e=t.join("/");return e=e.replace(/\/{2,}/g,"/")}function n(t){if(0===t.length)return[];if("/"===t)return["/"];let e=t.split("/");return""===e[e.length-1]&&e.pop(),"/"===t[0]?e[0]="/":"."!==e[0]&&e.unshift("."),e}function s(t,e){if(0===t.length)return t.push(e),t;if("."===e)return t;if(".."===e){if(1===t.length){if("/"===t[0])throw new Error("Unable to normalize path - traverses above root directory");if("."===t[0])return t.push(e),t}return".."===t[t.length-1]?(t.push(".."),t):(t.pop(),t)}return t.push(e),t}t.exports={join:r,normalize:i,split:n,basename:function(t){if("/"===t)throw new Error(`Cannot get basename of "${t}"`);const e=t.lastIndexOf("/");return-1===e?t:t.slice(e+1)},dirname:function(t){const e=t.lastIndexOf("/");if(-1===e)throw new Error(`Cannot get dirname of "${t}"`);return 0===e?"/":t.slice(0,e)},resolve:function(...t){let e="";for(let n of t)e=n.startsWith("/")?n:i(r(e,n));return e}}},function(t,e){function i(t){return class extends Error{constructor(...e){super(...e),this.code=t,this.message?this.message=t+": "+this.message:this.message=t}}}const r=i("EEXIST"),n=i("ENOENT"),s=i("ENOTDIR"),o=i("ENOTEMPTY"),a=i("ETIMEDOUT");t.exports={EEXIST:r,ENOENT:n,ENOTDIR:s,ENOTEMPTY:o,ETIMEDOUT:a}},function(t,e,i){"use strict";i.r(e),i.d(e,"Store",function(){return r}),i.d(e,"get",function(){return o}),i.d(e,"set",function(){return a}),i.d(e,"update",function(){return h}),i.d(e,"del",function(){return c}),i.d(e,"clear",function(){return l}),i.d(e,"keys",function(){return u}),i.d(e,"close",function(){return d});class r{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbName=t,this._storeName=e,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,e)=>{const i=indexedDB.open(this._dbName);i.onerror=(()=>e(i.error)),i.onsuccess=(()=>t(i.result)),i.onupgradeneeded=(()=>{i.result.createObjectStore(this._storeName)})}))}_withIDBStore(t,e){return this._init(),this._dbp.then(i=>new Promise((r,n)=>{const s=i.transaction(this.storeName,t);s.oncomplete=(()=>r()),s.onabort=s.onerror=(()=>n(s.error)),e(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let n;function s(){return n||(n=new r),n}function o(t,e=s()){let i;return e._withIDBStore("readwrite",e=>{i=e.get(t)}).then(()=>i.result)}function a(t,e,i=s()){return i._withIDBStore("readwrite",i=>{i.put(e,t)})}function h(t,e,i=s()){return i._withIDBStore("readwrite",i=>{const r=i.get(t);r.onsuccess=(()=>{i.put(e(r.result),t)})})}function c(t,e=s()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function l(t=s()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=s()){const e=[];return t._withIDBStore("readwrite",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}function d(t=s()){return t._close()}},function(t,e,i){const r=i(4),n=i(5);function s(t,e){"function"==typeof t&&(e=t);return[(...t)=>e(null,...t),e=r(e)]}t.exports=class{constructor(...t){this.promises=new n(...t),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this)}init(t,e){this.promises.init(t,e)}readFile(t,e,i){const[r,n]=s(e,i);this.promises.readFile(t,e).then(r).catch(n)}writeFile(t,e,i,r){const[n,o]=s(i,r);this.promises.wriLine truncated
File renamed without changes.
File renamed without changes.
File renamed without changes.
+83
View File
@@ -0,0 +1,83 @@
ИмпортироватьХранилище = мир =>
{
(async() => {
await git.clone({
fs: мир.импортХранилища.фс,
http: мир.гитHTTP,
dir: мир.импортХранилища.директория,
url: мир.импортХранилища.хранилище,
corsProxy: мир.импортХранилища.прокси,
});
//мир.уведомить("склонировали хранилище");
})();
};
// // // //
ЗадатьПараметрыИмпортаХранилища = мир =>
{
const хранилище = $(`#окно-добавление-хранилища-гит-хранилище`).val();
const прокси = $(`#окно-добавление-хранилища-гит-прокси`).val();
const имяФС = "git_" + хранилище;
мир.импортХранилища = {
"хранилище": хранилище,
"фс": new LightningFS(имяФС),
"директория": "/",
"прокси": прокси,
};
};
// // // //
ОтобразитьОкноДобавленияХранилища = мир =>
{
UIkit.modal($("#окно-добавление-хранилища")).show();
};
// // // //
ЗадатьПроксиИмпортаПоУмолчанию = мир =>
{
$(`#окно-добавление-хранилища-гит-прокси`).val("https://cors.isomorphic-git.org");
};
// // // //
СоздатьОкноДобавленияХранилища = мир =>
{
var м = мир.модули.модульПоУказателю(УКАЗАТЕЛЬ_ЭТОГО_МОДУЛЯ);
var префикс = ИМЯ_ЭТОГО_ФАЙЛА.substring(0, ИМЯ_ЭТОГО_ФАЙЛА.length - 3);
var содержимое = м.содержимое[префикс + "🙈.html"];
$(document.body).prepend(содержимое);
$(`#окно-добавление-хранилища-гит-учётка`).submit(function(событие) {
событие.preventDefault();
мир.уведомить("кнопка импорта в окне добавления хранилища");
});
};
// // // //
СоздатьКнопкуПлюсВШапке = мир =>
{
мир.кнопкиШапки.push({
"🎃": "шапка-кнопка-плюс",
"💥": "кнопка плюс в шапке",
"🍲": "➕",
});
мир.уведомить("изменили кнопки шапки");
};
+11
View File
@@ -0,0 +1,11 @@
пуск амура
создать кнопку плюс в шапке
создать окно добавления хранилища
задать прокси импорта по умолчанию
кнопка плюс в шапке
отобразить окно добавления хранилища
кнопка импорта в окне добавления хранилища
задать параметры импорта хранилища
импортировать хранилище
-29
View File
@@ -1,29 +0,0 @@
ОтобразитьОкноДобавленияХранилища = мир =>
{
UIkit.modal($("#окно-добавление-хранилища")).show();
};
// // // //
ДобавитьОкноДобавленияХранилища = мир =>
{
var м = мир.модули.модульПоУказателю(УКАЗАТЕЛЬ_ЭТОГО_МОДУЛЯ);
var содержимое = м.содержимое["/81🕸➕🕸🙈.html"];
$(document.body).prepend(содержимое);
};
// // // //
ДобавитьКнопкуПлюсВШапку = мир =>
{
мир.кнопкиШапки.push({
"🎃": "шапка-кнопка-плюс",
"💥": "шапки кнопка плюс",
"🍲": "➕",
});
мир.уведомить("изменили кнопки шапки");
};
-6
View File
@@ -1,6 +0,0 @@
пуск амура
добавить кнопку плюс в шапку
добавить окно добавления хранилища
шапки кнопка плюс
отобразить окно добавления хранилища
+6 -2
View File
@@ -2,9 +2,13 @@
<div class="uk-modal-dialog">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-modal-header">
<h2 class="uk-modal-title">Добавить ⚬ 添加 ⚬ Add</h2>
<h2 class="uk-modal-title">Добавить 🕸 添加 🕸 Add</h2>
</div>
<div id="___окно-со-списком-модулей-список" class="uk-modal-body" uk-overflow-auto>
<form id="окно-добавление-хранилища-гит-учётка" class="uk-padding">
<input id="окно-добавление-хранилища-гит-прокси" class="uk-input uk-margin-small" type="text" placeholder="Прокси 🕸 代理 🕸 Proxy">
<input id="окно-добавление-хранилища-гит-хранилище" class="uk-input uk-margin-small" type="text" placeholder="Хранилище 🕸 存储库 🕸 Repository">
<button class="uk-button uk-button-primary uk-margin-small">Импортировать 🕸 导入 🕸 Import</button>
</form>
</div>
</div>
</div>