mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-22 21:13:47 +02:00
move semantic.dropdown.custom.js to webpack (#9064)
* move semantic.dropdown.custom.js to webpack Also disabled a annoying linter rule which insisted that imports can not contain a file extension. Fixes: https://github.com/go-gitea/gitea/issues/8971 * reorganize web_src files and rebuild * restart ci
This commit is contained in:
1 parent
f0aaffeedc
commit
7bc8c6b180
16 files changed
+455
-468
No files matched your search
+1
-2
@@ -1,2 +1 @@
|
||||
/public/js/semantic.dropdown.custom.js
|
||||
/web_src/js/vendor/**
|
||||
/web_src/js/semanticDropdown.js
|
||||
@@ -25,14 +25,15 @@ globals:
|
||||
Vue: false
|
||||
|
||||
rules:
|
||||
arrow-body-style: [0]
|
||||
camelcase: [0]
|
||||
comma-dangle: [2, only-multiline]
|
||||
consistent-return: [0]
|
||||
default-case: [0]
|
||||
func-names: [0]
|
||||
import/extensions: [0]
|
||||
max-len: [0]
|
||||
newline-per-chained-call: [0]
|
||||
arrow-body-style: [0]
|
||||
no-alert: [0]
|
||||
no-continue: [0]
|
||||
no-mixed-operators: [0]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,,,,,,,,function(t,n,e){(t.exports=e(10)(!1)).push([t.i,"#git-graph-container, #rel-container {float:left;}\n#rel-container {max-width:30%; overflow-x:auto;}\n#git-graph-container {overflow-x:auto; width:100%}\n#git-graph-container li {list-style-type:none;height:20px;line-height:20px; white-space:nowrap;}\n#git-graph-container li .node-relation {font-family:'Bitstream Vera Sans Mono', 'Courier', monospace;}\n#git-graph-container li .author {color:#666666;}\n#git-graph-container li .time {color:#999999;font-size:80%}\n#git-graph-container li a {color:#000000;}\n#git-graph-container li a:hover {text-decoration:underline;}\n#git-graph-container li a em {color:#BB0000;border-bottom:1px dotted #BBBBBB;text-decoration:none;font-style:normal;}\n#rev-container {width:100%}\n#rev-list {margin:0;padding:0 5px 0 5px;min-width:95%}\n#graph-raw-list {margin:0px;}\n",""])},function(t,n,e){"use strict";t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var e=function(t,n){var e=t[1]||"",i=t[3];if(!i)return e;if(n&&"function"==typeof btoa){var r=(a=i,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(l," */")),o=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot).concat(t," */")}));return[e].concat(o).concat([r]).join("\n")}var a,c,l;return[e].join("\n")}(n,t);return n[2]?"@media ".concat(n[2],"{").concat(e,"}"):e})).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var a=0;a<t.length;a++){var c=t[a];null!=c[0]&&i[c[0]]||(e&&!c[2]?c[2]=e:e&&(c[2]="(".concat(c[2],") and (").concat(e,")")),n.push(c))}},n}},function(t,n,e){"use strict";var i,r={},o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var t={};return function(n){if(void 0===t[n]){var e=document.querySelector(n);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}t[n]=e}return t[n]}}();function c(t,n){for(var e=[],i={},r=0;r<t.length;r++){var o=t[r],a=n.base?o[0]+n.base:o[0],c={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(c):e.push(i[a]={id:a,parts:[c]})}return e}function l(t,n){for(var e=0;e<t.length;e++){var i=t[e],o=r[i.id],a=0;if(o){for(o.refs++;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(v(i.parts[a],n))}else{for(var c=[];a<i.parts.length;a++)c.push(v(i.parts[a],n));r[i.id]={id:i.id,refs:1,parts:c}}}}function s(t){var n=document.createElement("style");if(void 0===t.attributes.nonce){var i=e.nc;i&&(t.attributes.nonce=i)}if(Object.keys(t.attributes).forEach((function(e){n.setAttribute(e,t.attributes[e])})),"function"==typeof t.insert)t.insert(n);else{var r=a(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}return n}var u,f=(u=[],function(t,n){return u[t]=n,u.filter(Boolean).join("\n")});function h(t,n,e,i){var r=e?"":i.css;if(t.styleSheet)t.styleSheet.cssText=f(n,r);else{var o=document.createTextNode(r),a=t.childNodes;a[n]&&t.removeChild(a[n]),a.length?t.insertBefore(o,a[n]):t.appendChild(o)}}function p(t,n,e){var i=e.css,r=e.media,o=e.sourceMap;if(r&&t.setAttribute("media",r),o&&btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var d=null,g=0;function v(t,n){var e,i,r;if(n.singleton){var o=g++;e=d||(d=s(n)),i=h.bind(null,e,o,!1),r=h.bind(null,e,o,!0)}else e=s(n),i=p.bind(null,e,n),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)};return i(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;i(t=n)}else r()}}t.exports=function(t,n){(n=n||{}).attributes="object"==typeof n.attributes?n.attributes:{},n.singleton||"boolean"==typeof n.singleton||(n.singleton=o());var e=c(t,n);return l(e,n),function(t){for(var i=[],o=0;o<e.length;o++){var a=e[o],s=r[a.id];s&&(s.refs--,i.push(s))}t&&l(c(t,n),n);for(var u=0;u<i.length;u++){var f=i[u];if(0===f.refs){for(var h=0;h<f.parts.length;h++)f.parts[h]();delete r[f.id]}}}}},function(t,n,e){"use strict";function i(t,n,e){if(t.getContext){void 0===e&&(e={unitSize:20,lineWidth:3,nodeRadius:4});var i=[],r=[],o=t.getContext("2d"),a=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1),c=function(){var t,n,e="0123456789ABCDEF",i="";for(n=0;n<6;n++)t=Math.floor(Math.random()*e.length),i+=e.substring(t,t+1);return i},l=function(t){for(var n=i.length;n--&&i[n]Line truncated
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,,,,,,,,,function(t,e,n){(t.exports=n(11)(!1)).push([t.i,"/* This is a customized version of https://github.com/bluef/gitgraph.js/blob/master/gitgraph.css\n Changes include the removal of `body` and `em` styles */\n#git-graph-container, #rel-container {float:left;}\n#rel-container {max-width:30%; overflow-x:auto;}\n#git-graph-container {overflow-x:auto; width:100%}\n#git-graph-container li {list-style-type:none;height:20px;line-height:20px; white-space:nowrap;}\n#git-graph-container li .node-relation {font-family:'Bitstream Vera Sans Mono', 'Courier', monospace;}\n#git-graph-container li .author {color:#666666;}\n#git-graph-container li .time {color:#999999;font-size:80%}\n#git-graph-container li a {color:#000000;}\n#git-graph-container li a:hover {text-decoration:underline;}\n#git-graph-container li a em {color:#BB0000;border-bottom:1px dotted #BBBBBB;text-decoration:none;font-style:normal;}\n#rev-container {width:100%}\n#rev-list {margin:0;padding:0 5px 0 5px;min-width:95%}\n#graph-raw-list {margin:0px;}\n",""])},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(a=i,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(s," */")),o=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot).concat(t," */")}));return[n].concat(o).concat([r]).join("\n")}var a,c,s;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2],"{").concat(n,"}"):n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var a=0;a<t.length;a++){var c=t[a];null!=c[0]&&i[c[0]]||(n&&!c[2]?c[2]=n:n&&(c[2]="(".concat(c[2],") and (").concat(n,")")),e.push(c))}},e}},function(t,e,n){"use strict";var i,r={},o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}();function c(t,e){for(var n=[],i={},r=0;r<t.length;r++){var o=t[r],a=e.base?o[0]+e.base:o[0],c={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(c):n.push(i[a]={id:a,parts:[c]})}return n}function s(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=r[i.id],a=0;if(o){for(o.refs++;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(v(i.parts[a],e))}else{for(var c=[];a<i.parts.length;a++)c.push(v(i.parts[a],e));r[i.id]={id:i.id,refs:1,parts:c}}}}function l(t){var e=document.createElement("style");if(void 0===t.attributes.nonce){var i=n.nc;i&&(t.attributes.nonce=i)}if(Object.keys(t.attributes).forEach((function(n){e.setAttribute(n,t.attributes[n])})),"function"==typeof t.insert)t.insert(e);else{var r=a(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}return e}var u,f=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=f(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function p(t,e,n){var i=n.css,r=n.media,o=n.sourceMap;if(r&&t.setAttribute("media",r),o&&btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var d=null,g=0;function v(t,e){var n,i,r;if(e.singleton){var o=g++;n=d||(d=l(e)),i=h.bind(null,n,o,!1),r=h.bind(null,n,o,!0)}else n=l(e),i=p.bind(null,n,e),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){(e=e||{}).attributes="object"==typeof e.attributes?e.attributes:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=c(t,e);return s(n,e),function(t){for(var i=[],o=0;o<n.length;o++){var a=n[o],l=r[a.id];l&&(l.refs--,i.push(l))}t&&s(c(t,e),e);for(var u=0;u<i.length;u++){var f=i[u];if(0===f.refs){for(var h=0;h<f.parts.length;h++)f.parts[h]();delete r[f.id]}}}}},function(t,e,n){"use strict";function i(t,e,n){if(t.getContext){void 0===n&&(n={unitSize:20,lineWidth:3,nodeRadius:4});var i=[],r=[],o=t.getContext("2d"),a=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1),c=function(){vLine truncated
|
||||
//# sourceMappingURL=gitgraph.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///./web_src/vendor/gitgraph.js/gitgraph.custom.css","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack:///./web_src/vendor/gitgraph.js/gitgraph.custom.js","webpack:///./web_src/vendor/gitgraph.js/gitgraph.custom.css?a09e"],"names":["module","exports","push","i","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","modules","mediaQuery","alreadyImportedModules","length","id","_i","memo","stylesInDom","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","listToStyles","options","styles","newStyles","base","part","css","media","parts","addStylesToDom","domStyle","j","refs","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","index","replacement","filter","applyToSingletonTag","remove","obj","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","newList","mayRemove","_domStyle","gitGraph","canvas","rawGraphList","config","getContext","unitSize","lineWidth","nodeRadius","flows","graphList","ctx","ratio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","genRandomStr","rnum","chars","randomString","Math","floor","random","substring","findFlow","findColomn","symbol","row","findBranchOut","findLineBreak","genNewFlow","newId","color","drawLine","moveX","moveY","lineX","lineY","strokeStyle","beginPath","moveTo","lineTo","stroke","drawLineRight","x","y","drawLineUp","drawNode","arc","PI","fill","drawLineIn","drawLineOut","midStr","maxWidth","l","replace","max","split","unshift","width","height","lineJoin","lineCap","scale","init","colomn","colomnIndex","prevColomn","condenseIndex","nodePos","tempFlow","lastLinePos","condenseCurrentLength","breakIndex","prevRowLength","flowSwapPos","condensePrevLength","inlineIntersect","currentRow","nextRow","prevRow","val","splice","draw","locals"],"mappings":"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 truncated
|
||||
{"version":3,"sources":["webpack:///./web_src/css/gitGraph.css","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack:///./web_src/js/gitGraph.js","webpack:///./web_src/css/gitGraph.css?6696"],"names":["module","exports","push","i","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","modules","mediaQuery","alreadyImportedModules","length","id","_i","memo","stylesInDom","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","listToStyles","options","styles","newStyles","base","part","css","media","parts","addStylesToDom","domStyle","j","refs","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","index","replacement","filter","applyToSingletonTag","remove","obj","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","newList","mayRemove","_domStyle","gitGraph","canvas","rawGraphList","config","getContext","unitSize","lineWidth","nodeRadius","flows","graphList","ctx","ratio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","genRandomStr","rnum","chars","randomString","Math","floor","random","substring","findFlow","findColomn","symbol","row","findBranchOut","findLineBreak","genNewFlow","newId","color","drawLine","moveX","moveY","lineX","lineY","strokeStyle","beginPath","moveTo","lineTo","stroke","drawLineRight","x","y","drawLineUp","drawNode","arc","PI","fill","drawLineIn","drawLineOut","midStr","maxWidth","l","replace","max","split","unshift","width","height","lineJoin","lineCap","scale","init","colomn","colomnIndex","prevColomn","condenseIndex","nodePos","tempFlow","lastLinePos","condenseCurrentLength","breakIndex","prevRowLength","flowSwapPos","condensePrevLength","inlineIntersect","currentRow","nextRow","prevRow","val","splice","draw","locals"],"mappings":"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 truncated
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
!function(e){function t(t){for(var n,i,o=t[0],r=t[1],c=0,l=[];c<o.length;c++)i=o[c],Object.prototype.hasOwnProperty.call(a,i)&&a[i]&&l.push(a[i][0]),a[i]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(s&&s(t);l.length;)l.shift()()}var n={},a={1:0};function i(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.e=function(e){var t=[],n=a[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((function(t,i){n=a[e]=[t,i]}));t.push(n[2]=o);var r,c=document.createElement("script");c.charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.src=function(e){return i.p+""+({0:"gitgraph"}[e]||e)+".js"}(e);var s=new Error;r=function(t){c.onerror=c.onload=null,clearTimeout(l);var n=a[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",s.name="ChunkLoadError",s.type=i,s.request=o,n[1](s)}a[e]=void 0}};var l=setTimeout((function(){r({type:"timeout",target:c})}),12e4);c.onerror=c.onload=r,document.head.appendChild(c)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],r=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var s=r;i(i.s=2)}([function(e,t,n){e.exports=n(4)},function(e,t,n){var a=n(5),i=n(6),o=n(7);e.exports=function(e,t){return a(e)||i(e,t)||o()}},function(e,t,n){e.exports=n(8)},function(e,t,n){if(document.currentScript&&document.currentScript.src){var a=new URL(document.currentScript.src);n.p="".concat(a.pathname.replace(/\/[^/]*$/,""),"/")}else{var i=document.querySelector('script[src*="/index.js"]');n.p="".concat(i.getAttribute("src").replace(/\/[^/]*$/,""),"/")}},function(e,t,n){var a=function(e){"use strict";var t,n=Object.prototype,a=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",r=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,n,a){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),r=new q(a||[]);return o._invoke=function(e,t,n){var a=d;return function(i,o){if(a===h)throw new Error("Generator is already running");if(a===f){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var r=n.delegate;if(r){var c=C(r,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=h;var s=l(e,t,n);if("normal"===s.type){if(a=n.done?f:u,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=f,n.method="throw",n.arg=s.arg)}}}(e,n,r),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",u="suspendedYield",h="executing",f="completed",p={};function m(){}function v(){}function $(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==n&&a.call(w,o)&&(g=w);var y=$.prototype=m.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function _(e){var t;this._invoke=function(n,i){function o(){return new Promise((function(t,o){!function t(n,i,o,r){var c=l(e[n],e,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==typeof d&&a.call(d,"__await")?Promise.resolve(d.__await).then((function(e){t("next",e,o,r)}),(function(e){t("throw",e,o,r)})):Promise.resolve(d).then((function(e){s.value=e,o(s)}),(function(e){return t("throw",e,o,r)}))}r(c.arg)}(n,i,t,o)}))}return t=t?t.then(o,o):o()}}function C(e,n){var a=e.iterator[n.method];if(a===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=l(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.deleLine truncated
|
||||
!function(e){function t(t){for(var n,a,o=t[0],r=t[1],s=0,l=[];s<o.length;s++)a=o[s],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&l.push(i[a][0]),i[a]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(c&&c(t);l.length;)l.shift()()}var n={},i={1:0};function a(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.e=function(e){var t=[],n=i[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((function(t,a){n=i[e]=[t,a]}));t.push(n[2]=o);var r,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({0:"gitgraph"}[e]||e)+".js"}(e);var c=new Error;r=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=i[e];if(0!==n){if(n){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+a+": "+o+")",c.name="ChunkLoadError",c.type=a,c.request=o,n[1](c)}i[e]=void 0}};var l=setTimeout((function(){r({type:"timeout",target:s})}),12e4);s.onerror=s.onload=r,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],r=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var c=r;a(a.s=2)}([function(e,t,n){e.exports=n(4)},function(e,t,n){var i=n(5),a=n(6),o=n(7);e.exports=function(e,t){return i(e)||a(e,t)||o()}},function(e,t,n){e.exports=n(9)},function(e,t,n){if(document.currentScript&&document.currentScript.src){var i=new URL(document.currentScript.src);n.p="".concat(i.pathname.replace(/\/[^/]*$/,""),"/")}else{var a=document.querySelector('script[src*="/index.js"]');n.p="".concat(a.getAttribute("src").replace(/\/[^/]*$/,""),"/")}},function(e,t,n){var i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",r=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n,i){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),r=new T(i||[]);return o._invoke=function(e,t,n){var i=d;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===f){if("throw"===a)throw o;return L()}for(n.method=a,n.arg=o;;){var r=n.delegate;if(r){var s=k(r,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var c=l(e,t,n);if("normal"===c.type){if(i=n.done?f:u,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=f,n.method="throw",n.arg=c.arg)}}}(e,n,r),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",u="suspendedYield",h="executing",f="completed",m={};function v(){}function p(){}function g(){}var b={};b[o]=function(){return this};var $=Object.getPrototypeOf,w=$&&$($(A([])));w&&w!==n&&i.call(w,o)&&(b=w);var y=g.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function C(e){var t;this._invoke=function(n,a){function o(){return new Promise((function(t,o){!function t(n,a,o,r){var s=l(e[n],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&i.call(d,"__await")?Promise.resolve(d.__await).then((function(e){t("next",e,o,r)}),(function(e){t("throw",e,o,r)})):Promise.resolve(d).then((function(e){c.value=e,o(c)}),(function(e){return t("throw",e,o,r)}))}r(s.arg)}(n,a,t,o)}))}return t=t?t.then(o,o):o()}}function k(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=l(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.deleLine truncated
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/regenerator/index.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./web_src/js/publicPath.js","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./web_src/js/index.js","webpack:///./web_src/js/gitGraph.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","1","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","arrayWithHoles","iterableToArrayLimit","nonIterableRest","arr","currentScript","url","URL","__webpack_public_path__","pathname","replace","querySelector","getAttribute","runtime","Op","hasOwn","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","makeInvokeMethod","fn","obj","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","invoke","result","__await","then","unwrapped","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","constructor","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","Array","isArray","_arr","_n","_d","_e","_s","_i","csrf","suburl","previewFileModes","simpleMDEditor","codeMirrorEditor","htmlEncode","text","jQuery","html","initCommentPreviewTab","$form","$tabMenu","find","tab","click","$this","$","post","_csrf","val","$previewPanel","emojify","run","each","hljs","highlightBlock","buttonsClickOnEnter","initEditForm","$previewTab","split","initEditPreviewTab","content","$diffPreviewPanel","updateIssuesMeta","action","issueIds","elementId","ajax","issue_ids","id","success","reload","location","initImagePaste","field","addEventListener","pasteEvent","callback","clipboardData","items","indexOf","blob","getAsFile","preventDefault","stopPropagation","retrieveImageFromClipboardAsBlob","img","substr","lastIndexOf","selectionStart","startPos","endPos","selectionEnd","substring","insertAtCursor","file","xhr","XMLHttpRequest","status","responseText","open","setRequestHeader","formData","FormData","append","send","uploadFile","res","JSON","parse","oldval","newval","replaceAndKeepCursor","uuid","input","initCommentForm","$selectBranch","selectedValue","css","removeClass","addClass","initListSubmits","selectItem","selector","outerSelector","$list","$noSelect","$listMenu","hasLabelUpdateAction","labels","dropdown","label","hasClass","listIds","parent","join","select_id","input_id","$menu","hasUpdateAction","initRepository","$data","searchTerm","noResults","canCreateBranch","menuVisible","active","branch","tag","selected","remove","Vue","delimiters","el","beforeMount","vm","$el","body","contains","set","watch","visible","focusSearchField","computed","filteredItems","filter","item","toLowerCase","showCreateNewBranch","showNoResults","methods","getSelected","href","createNewBranch","$refs","newBranchForm","submit","nextTick","searchField","focus","j","getSelectedIndexInFiltered","scrollToActive","cont","scrollContainer","offsetTop","scrollTop","clientHeight","keydown"Line truncated
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/regenerator/index.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///./web_src/js/publicPath.js","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./web_src/js/semanticDropdown.js","webpack:///./web_src/js/gitGraphLoader.js","webpack:///./web_src/js/index.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","1","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","arrayWithHoles","iterableToArrayLimit","nonIterableRest","arr","currentScript","url","URL","__webpack_public_path__","pathname","replace","querySelector","getAttribute","runtime","Op","hasOwn","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","makeInvokeMethod","fn","obj","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","invoke","result","__await","then","unwrapped","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","constructor","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","Array","isArray","_arr","_n","_d","_e","_s","_i","$","Math","dropdown","parameters","returnedValue","$allModules","$document","moduleSelector","selector","hasTouch","documentElement","time","Date","getTime","performance","query","arguments","methodInvoked","queryArguments","lastAriaID","each","elementIndex","initialLoad","pageLostFocus","willRefocus","elementNamespace","id","selectObserver","menuObserver","settings","isPlainObject","extend","className","fields","metadata","namespace","regExp","templates","eventNamespace","moduleNamespace","$module","$context","$text","find","text","$search","search","$sizer","sizer","$input","input","$icon","icon","$combo","$menu","children","menu","$item","item","activated","itemActivated","internalChange","element","instance","initialize","debug","is","alreadySetup","setup","reference","layout","change","refreshData","save","defaults","restore","selected","events","observeChanges","instantiate","aria","verbose","destroy","remove","tabbable","off","removeData","disconnect","MutationObserver","select","mutation","observe","has","childList","subtree","random","substr","userChoice","$userChoices","$userChoice","html","userValues","index","addition","add","variables","addResult","attr","addClass","hideAdditions","hidden","userLabels","label","appendTo","insertAfter","minCharacters","filter","hide","firstUnfiltered","selectedItem","not","unselectable","eq","nextAvailable","$selected","$nextAvailable","nextAll","$prevAvailable","prevAll","guessRole","nextID","prefix","getElementById","setExpanded","expanded","refreshDescendant","$currentlySelected","$activeItem","active","$selectedItem","removeDescendant","removeAttr","isIcon","hasClass","hasSearch","hasInput","isMultiple","multiple","api","apiSettings","urlData","on","returnedObject","prop","insertBefore","searchSelection","allowTab","set","selectValues"Line truncated
|
||||
Vendored
+2
-2
@@ -31,9 +31,9 @@
|
||||
<td><a href="https://github.com/Semantic-Org/Semantic-UI/archive/2.3.1.tar.gz">semantic-UI-2.3.1.tar.gz</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="../js/semantic.dropdown.custom.js">semantic.dropdown.custom.js</a></td>
|
||||
<td><a href="../js/index.js">semantic.dropdown</a></td>
|
||||
<td><a href="https://semantic-ui.mit-license.org/">Expat</a></td>
|
||||
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">semantic.dropdown.custom.js</a></td>
|
||||
<td><a href="https://github.com/go-gitea/gitea/tree/master/web_src/vendor/semantic.dropdown">semantic.dropdown.custom.js</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="../js/index.js">index.js</a></td>
|
||||
|
||||
@@ -118,7 +118,6 @@
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js"></script>
|
||||
<script src="{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}"></script>
|
||||
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
|
||||
{{if .EnableHeatmap}}
|
||||
<script src="{{StaticUrlPrefix}}/vendor/plugins/moment/moment.min.js" charset="utf-8"></script>
|
||||
|
||||
@@ -7,7 +7,6 @@ var urlsToCache = [
|
||||
'{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js',
|
||||
'{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}',
|
||||
'{{StaticUrlPrefix}}/js/gitgraph.js?v={{MD5 AppVer}}',
|
||||
'{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}',
|
||||
'{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js',
|
||||
'{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js',
|
||||
'{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* This is a customized version of https://github.com/bluef/gitgraph.js/blob/master/gitgraph.css
|
||||
Changes include the removal of `body` and `em` styles */
|
||||
#git-graph-container, #rel-container {float:left;}
|
||||
#rel-container {max-width:30%; overflow-x:auto;}
|
||||
#git-graph-container {overflow-x:auto; width:100%}
|
||||
+422
-12
@@ -1,16 +1,426 @@
|
||||
$(async () => {
|
||||
const graphCanvas = document.getElementById('graph-canvas');
|
||||
if (!graphCanvas) return;
|
||||
/* This is a customized version of https://github.com/bluef/gitgraph.js/blob/master/gitgraph.js
|
||||
Changes include conversion to ES6 and linting fixes */
|
||||
|
||||
const [{ default: gitGraph }] = await Promise.all([
|
||||
import(/* webpackChunkName: "gitgraph" */'../vendor/gitgraph.js/gitgraph.custom.js'),
|
||||
import(/* webpackChunkName: "gitgraph" */'../vendor/gitgraph.js/gitgraph.custom.css'),
|
||||
]);
|
||||
/*
|
||||
* @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD 3-Clause
|
||||
* Copyright (c) 2011, Terrence Lee <kill889@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
export default function gitGraph(canvas, rawGraphList, config) {
|
||||
if (!canvas.getContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof config === 'undefined') {
|
||||
config = {
|
||||
unitSize: 20,
|
||||
lineWidth: 3,
|
||||
nodeRadius: 4
|
||||
};
|
||||
}
|
||||
|
||||
const flows = [];
|
||||
const graphList = [];
|
||||
$('#graph-raw-list li span.node-relation').each(function () {
|
||||
graphList.push($(this).text());
|
||||
});
|
||||
|
||||
gitGraph(graphCanvas, graphList);
|
||||
});
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
const devicePixelRatio = window.devicePixelRatio || 1;
|
||||
const backingStoreRatio = ctx.webkitBackingStorePixelRatio
|
||||
|| ctx.mozBackingStorePixelRatio
|
||||
|| ctx.msBackingStorePixelRatio
|
||||
|| ctx.oBackingStorePixelRatio
|
||||
|| ctx.backingStorePixelRatio || 1;
|
||||
|
||||
const ratio = devicePixelRatio / backingStoreRatio;
|
||||
|
||||
const init = function () {
|
||||
let maxWidth = 0;
|
||||
let i;
|
||||
const l = rawGraphList.length;
|
||||
let row;
|
||||
let midStr;
|
||||
|
||||
for (i = 0; i < l; i++) {
|
||||
midStr = rawGraphList[i].replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '');
|
||||
|
||||
maxWidth = Math.max(midStr.replace(/(_|\s)/g, '').length, maxWidth);
|
||||
|
||||
row = midStr.split('');
|
||||
|
||||
graphList.unshift(row);
|
||||
}
|
||||
|
||||
const width = maxWidth * config.unitSize;
|
||||
const height = graphList.length * config.unitSize;
|
||||
|
||||
canvas.width = width * ratio;
|
||||
canvas.height = height * ratio;
|
||||
|
||||
canvas.style.width = `${width}px`;
|
||||
canvas.style.height = `${height}px`;
|
||||
|
||||
ctx.lineWidth = config.lineWidth;
|
||||
ctx.lineJoin = 'round';
|
||||
ctx.lineCap = 'round';
|
||||
|
||||
ctx.scale(ratio, ratio);
|
||||
};
|
||||
|
||||
const genRandomStr = function () {
|
||||
const chars = '0123456789ABCDEF';
|
||||
const stringLength = 6;
|
||||
let randomString = '', rnum, i;
|
||||
for (i = 0; i < stringLength; i++) {
|
||||
rnum = Math.floor(Math.random() * chars.length);
|
||||
randomString += chars.substring(rnum, rnum + 1);
|
||||
}
|
||||
|
||||
return randomString;
|
||||
};
|
||||
|
||||
const findFlow = function (id) {
|
||||
let i = flows.length;
|
||||
|
||||
while (i-- && flows[i].id !== id);
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findColomn = function (symbol, row) {
|
||||
let i = row.length;
|
||||
|
||||
while (i-- && row[i] !== symbol);
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findBranchOut = function (row) {
|
||||
if (!row) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
let i = row.length;
|
||||
|
||||
while (i--
|
||||
&& !(row[i - 1] && row[i] === '/' && row[i - 1] === '|')
|
||||
&& !(row[i - 2] && row[i] === '_' && row[i - 2] === '|'));
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findLineBreak = function (row) {
|
||||
if (!row) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
let i = row.length;
|
||||
|
||||
while (i--
|
||||
&& !(row[i - 1] && row[i - 2] && row[i] === ' ' && row[i - 1] === '|' && row[i - 2] === '_'));
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const genNewFlow = function () {
|
||||
let newId;
|
||||
|
||||
do {
|
||||
newId = genRandomStr();
|
||||
} while (findFlow(newId) !== -1);
|
||||
|
||||
return { id: newId, color: `#${newId}` };
|
||||
};
|
||||
|
||||
// Draw methods
|
||||
const drawLine = function (moveX, moveY, lineX, lineY, color) {
|
||||
ctx.strokeStyle = color;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(moveX, moveY);
|
||||
ctx.lineTo(lineX, lineY);
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
const drawLineRight = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x + config.unitSize, y + config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawLineUp = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawNode = function (x, y, color) {
|
||||
ctx.strokeStyle = color;
|
||||
|
||||
drawLineUp(x, y, color);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, config.nodeRadius, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
};
|
||||
|
||||
const drawLineIn = function (x, y, color) {
|
||||
drawLine(x + config.unitSize, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawLineOut = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x + config.unitSize, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const draw = function (graphList) {
|
||||
let colomn, colomnIndex, prevColomn, condenseIndex, breakIndex = -1;
|
||||
let x, y;
|
||||
let color;
|
||||
let nodePos;
|
||||
let tempFlow;
|
||||
let prevRowLength = 0;
|
||||
let flowSwapPos = -1;
|
||||
let lastLinePos;
|
||||
let i, l;
|
||||
let condenseCurrentLength, condensePrevLength = 0;
|
||||
|
||||
let inlineIntersect = false;
|
||||
|
||||
// initiate color array for first row
|
||||
for (i = 0, l = graphList[0].length; i < l; i++) {
|
||||
if (graphList[0][i] !== '_' && graphList[0][i] !== ' ') {
|
||||
flows.push(genNewFlow());
|
||||
}
|
||||
}
|
||||
|
||||
y = (canvas.height / ratio) - config.unitSize * 0.5;
|
||||
|
||||
// iterate
|
||||
for (i = 0, l = graphList.length; i < l; i++) {
|
||||
x = config.unitSize * 0.5;
|
||||
|
||||
const currentRow = graphList[i];
|
||||
const nextRow = graphList[i + 1];
|
||||
const prevRow = graphList[i - 1];
|
||||
|
||||
flowSwapPos = -1;
|
||||
|
||||
condenseCurrentLength = currentRow.filter((val) => {
|
||||
return (val !== ' ' && val !== '_');
|
||||
}).length;
|
||||
|
||||
// pre process begin
|
||||
// use last row for analysing
|
||||
if (prevRow) {
|
||||
if (!inlineIntersect) {
|
||||
// intersect might happen
|
||||
for (colomnIndex = 0; colomnIndex < prevRowLength; colomnIndex++) {
|
||||
if (prevRow[colomnIndex + 1]
|
||||
&& (prevRow[colomnIndex] === '/' && prevRow[colomnIndex + 1] === '|')
|
||||
|| ((prevRow[colomnIndex] === '_' && prevRow[colomnIndex + 1] === '|')
|
||||
&& (prevRow[colomnIndex + 2] === '/'))) {
|
||||
flowSwapPos = colomnIndex;
|
||||
|
||||
// swap two flow
|
||||
tempFlow = { id: flows[flowSwapPos].id, color: flows[flowSwapPos].color };
|
||||
|
||||
flows[flowSwapPos].id = flows[flowSwapPos + 1].id;
|
||||
flows[flowSwapPos].color = flows[flowSwapPos + 1].color;
|
||||
|
||||
flows[flowSwapPos + 1].id = tempFlow.id;
|
||||
flows[flowSwapPos + 1].color = tempFlow.color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line */
|
||||
if (condensePrevLength < condenseCurrentLength
|
||||
&& ((nodePos = findColomn('*', currentRow)) !== -1
|
||||
&& (findColomn('_', currentRow) === -1))) {
|
||||
flows.splice(nodePos - 1, 0, genNewFlow());
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line */
|
||||
if (prevRowLength > currentRow.length
|
||||
&& (nodePos = findColomn('*', prevRow)) !== -1) {
|
||||
if (findColomn('_', currentRow) === -1
|
||||
&& findColomn('/', currentRow) === -1
|
||||
&& findColomn('\\', currentRow) === -1) {
|
||||
flows.splice(nodePos + 1, 1);
|
||||
}
|
||||
}
|
||||
} // done with the previous row
|
||||
|
||||
prevRowLength = currentRow.length; // store for next round
|
||||
colomnIndex = 0; // reset index
|
||||
condenseIndex = 0;
|
||||
condensePrevLength = 0;
|
||||
breakIndex = -1; // reset break index
|
||||
while (colomnIndex < currentRow.length) {
|
||||
colomn = currentRow[colomnIndex];
|
||||
|
||||
if (colomn !== ' ' && colomn !== '_') {
|
||||
++condensePrevLength;
|
||||
}
|
||||
|
||||
// check and fix line break in next row
|
||||
if (colomn === '/' && currentRow[colomnIndex - 1] && currentRow[colomnIndex - 1] === '|') {
|
||||
/* eslint-disable-next-line */
|
||||
if ((breakIndex = findLineBreak(nextRow)) !== -1) {
|
||||
nextRow.splice(breakIndex, 1);
|
||||
}
|
||||
}
|
||||
// if line break found replace all '/' with '|' after breakIndex in previous row
|
||||
if (breakIndex !== -1 && colomn === '/' && colomnIndex > breakIndex) {
|
||||
currentRow[colomnIndex] = '|';
|
||||
colomn = '|';
|
||||
}
|
||||
|
||||
if (colomn === ' '
|
||||
&& currentRow[colomnIndex + 1]
|
||||
&& currentRow[colomnIndex + 1] === '_'
|
||||
&& currentRow[colomnIndex - 1]
|
||||
&& currentRow[colomnIndex - 1] === '|') {
|
||||
currentRow.splice(colomnIndex, 1);
|
||||
|
||||
currentRow[colomnIndex] = '/';
|
||||
colomn = '/';
|
||||
}
|
||||
|
||||
// create new flow only when no intersect happened
|
||||
if (flowSwapPos === -1
|
||||
&& colomn === '/'
|
||||
&& currentRow[colomnIndex - 1]
|
||||
&& currentRow[colomnIndex - 1] === '|') {
|
||||
flows.splice(condenseIndex, 0, genNewFlow());
|
||||
}
|
||||
|
||||
// change \ and / to | when it's in the last position of the whole row
|
||||
if (colomn === '/' || colomn === '\\') {
|
||||
if (!(colomn === '/' && findBranchOut(nextRow) === -1)) {
|
||||
/* eslint-disable-next-line */
|
||||
if ((lastLinePos = Math.max(findColomn('|', currentRow),
|
||||
findColomn('*', currentRow))) !== -1
|
||||
&& (lastLinePos < colomnIndex - 1)) {
|
||||
while (currentRow[++lastLinePos] === ' ');
|
||||
|
||||
if (lastLinePos === colomnIndex) {
|
||||
currentRow[colomnIndex] = '|';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (colomn === '*'
|
||||
&& prevRow
|
||||
&& prevRow[condenseIndex + 1] === '\\') {
|
||||
flows.splice(condenseIndex + 1, 1);
|
||||
}
|
||||
|
||||
if (colomn !== ' ') {
|
||||
++condenseIndex;
|
||||
}
|
||||
|
||||
++colomnIndex;
|
||||
}
|
||||
|
||||
condenseCurrentLength = currentRow.filter((val) => {
|
||||
return (val !== ' ' && val !== '_');
|
||||
}).length;
|
||||
|
||||
// do some clean up
|
||||
if (flows.length > condenseCurrentLength) {
|
||||
flows.splice(condenseCurrentLength, flows.length - condenseCurrentLength);
|
||||
}
|
||||
|
||||
colomnIndex = 0;
|
||||
|
||||
// a little inline analysis and draw process
|
||||
while (colomnIndex < currentRow.length) {
|
||||
colomn = currentRow[colomnIndex];
|
||||
prevColomn = currentRow[colomnIndex - 1];
|
||||
|
||||
if (currentRow[colomnIndex] === ' ') {
|
||||
currentRow.splice(colomnIndex, 1);
|
||||
x += config.unitSize;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// inline interset
|
||||
if ((colomn === '_' || colomn === '/')
|
||||
&& currentRow[colomnIndex - 1] === '|'
|
||||
&& currentRow[colomnIndex - 2] === '_') {
|
||||
inlineIntersect = true;
|
||||
|
||||
tempFlow = flows.splice(colomnIndex - 2, 1)[0];
|
||||
flows.splice(colomnIndex - 1, 0, tempFlow);
|
||||
currentRow.splice(colomnIndex - 2, 1);
|
||||
|
||||
colomnIndex -= 1;
|
||||
} else {
|
||||
inlineIntersect = false;
|
||||
}
|
||||
|
||||
color = flows[colomnIndex].color;
|
||||
|
||||
switch (colomn) {
|
||||
case '_':
|
||||
drawLineRight(x, y, color);
|
||||
|
||||
x += config.unitSize;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
drawNode(x, y, color);
|
||||
break;
|
||||
|
||||
case '|':
|
||||
drawLineUp(x, y, color);
|
||||
break;
|
||||
|
||||
case '/':
|
||||
if (prevColomn
|
||||
&& (prevColomn === '/'
|
||||
|| prevColomn === ' ')) {
|
||||
x -= config.unitSize;
|
||||
}
|
||||
|
||||
drawLineOut(x, y, color);
|
||||
|
||||
x += config.unitSize;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
drawLineIn(x, y, color);
|
||||
break;
|
||||
}
|
||||
|
||||
++colomnIndex;
|
||||
}
|
||||
|
||||
y -= config.unitSize;
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
draw(graphList);
|
||||
}
|
||||
// @end-license
|
||||
@@ -0,0 +1,16 @@
|
||||
$(async () => {
|
||||
const graphCanvas = document.getElementById('graph-canvas');
|
||||
if (!graphCanvas) return;
|
||||
|
||||
const [{ default: gitGraph }] = await Promise.all([
|
||||
import(/* webpackChunkName: "gitgraph" */'./gitGraph.js'),
|
||||
import(/* webpackChunkName: "gitgraph" */'../css/gitGraph.css'),
|
||||
]);
|
||||
|
||||
const graphList = [];
|
||||
$('#graph-raw-list li span.node-relation').each(function () {
|
||||
graphList.push($(this).text());
|
||||
});
|
||||
|
||||
gitGraph(graphCanvas, graphList);
|
||||
});
|
||||
+3
-2
@@ -2,8 +2,9 @@
|
||||
/* exported timeAddManual, toggleStopwatch, cancelStopwatch, initHeatmap */
|
||||
/* exported toggleDeadlineForm, setDeadline, updateDeadline, deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */
|
||||
|
||||
import './publicPath';
|
||||
import './gitGraph';
|
||||
import './publicPath.js';
|
||||
import './gitGraphLoader.js';
|
||||
import './semanticDropdown.js';
|
||||
|
||||
function htmlEncode(text) {
|
||||
return jQuery('<div />').text(text).html();
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* This is a patched version of semantic.dropdown which includes a11y changes, see
|
||||
https://github.com/go-gitea/gitea/pull/8638#issuecomment-549175290 */
|
||||
|
||||
/*!
|
||||
* # Semantic UI 2.3.1 - Dropdown
|
||||
* http://github.com/semantic-org/semantic-ui/
|
||||
Vendored
-24
@@ -1,24 +0,0 @@
|
||||
Copyright (c) 2011, Terrence Lee <kill889@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the fgdev nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-419
@@ -1,419 +0,0 @@
|
||||
/*
|
||||
* @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD 3-Clause
|
||||
* Copyright (c) 2011, Terrence Lee <kill889@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
export default function gitGraph(canvas, rawGraphList, config) {
|
||||
if (!canvas.getContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof config === 'undefined') {
|
||||
config = {
|
||||
unitSize: 20,
|
||||
lineWidth: 3,
|
||||
nodeRadius: 4
|
||||
};
|
||||
}
|
||||
|
||||
const flows = [];
|
||||
const graphList = [];
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
const devicePixelRatio = window.devicePixelRatio || 1;
|
||||
const backingStoreRatio = ctx.webkitBackingStorePixelRatio
|
||||
|| ctx.mozBackingStorePixelRatio
|
||||
|| ctx.msBackingStorePixelRatio
|
||||
|| ctx.oBackingStorePixelRatio
|
||||
|| ctx.backingStorePixelRatio || 1;
|
||||
|
||||
const ratio = devicePixelRatio / backingStoreRatio;
|
||||
|
||||
const init = function () {
|
||||
let maxWidth = 0;
|
||||
let i;
|
||||
const l = rawGraphList.length;
|
||||
let row;
|
||||
let midStr;
|
||||
|
||||
for (i = 0; i < l; i++) {
|
||||
midStr = rawGraphList[i].replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '');
|
||||
|
||||
maxWidth = Math.max(midStr.replace(/(_|\s)/g, '').length, maxWidth);
|
||||
|
||||
row = midStr.split('');
|
||||
|
||||
graphList.unshift(row);
|
||||
}
|
||||
|
||||
const width = maxWidth * config.unitSize;
|
||||
const height = graphList.length * config.unitSize;
|
||||
|
||||
canvas.width = width * ratio;
|
||||
canvas.height = height * ratio;
|
||||
|
||||
canvas.style.width = `${width}px`;
|
||||
canvas.style.height = `${height}px`;
|
||||
|
||||
ctx.lineWidth = config.lineWidth;
|
||||
ctx.lineJoin = 'round';
|
||||
ctx.lineCap = 'round';
|
||||
|
||||
ctx.scale(ratio, ratio);
|
||||
};
|
||||
|
||||
const genRandomStr = function () {
|
||||
const chars = '0123456789ABCDEF';
|
||||
const stringLength = 6;
|
||||
let randomString = '', rnum, i;
|
||||
for (i = 0; i < stringLength; i++) {
|
||||
rnum = Math.floor(Math.random() * chars.length);
|
||||
randomString += chars.substring(rnum, rnum + 1);
|
||||
}
|
||||
|
||||
return randomString;
|
||||
};
|
||||
|
||||
const findFlow = function (id) {
|
||||
let i = flows.length;
|
||||
|
||||
while (i-- && flows[i].id !== id);
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findColomn = function (symbol, row) {
|
||||
let i = row.length;
|
||||
|
||||
while (i-- && row[i] !== symbol);
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findBranchOut = function (row) {
|
||||
if (!row) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
let i = row.length;
|
||||
|
||||
while (i--
|
||||
&& !(row[i - 1] && row[i] === '/' && row[i - 1] === '|')
|
||||
&& !(row[i - 2] && row[i] === '_' && row[i - 2] === '|'));
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const findLineBreak = function (row) {
|
||||
if (!row) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
let i = row.length;
|
||||
|
||||
while (i--
|
||||
&& !(row[i - 1] && row[i - 2] && row[i] === ' ' && row[i - 1] === '|' && row[i - 2] === '_'));
|
||||
|
||||
return i;
|
||||
};
|
||||
|
||||
const genNewFlow = function () {
|
||||
let newId;
|
||||
|
||||
do {
|
||||
newId = genRandomStr();
|
||||
} while (findFlow(newId) !== -1);
|
||||
|
||||
return { id: newId, color: `#${newId}` };
|
||||
};
|
||||
|
||||
// Draw methods
|
||||
const drawLine = function (moveX, moveY, lineX, lineY, color) {
|
||||
ctx.strokeStyle = color;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(moveX, moveY);
|
||||
ctx.lineTo(lineX, lineY);
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
const drawLineRight = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x + config.unitSize, y + config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawLineUp = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawNode = function (x, y, color) {
|
||||
ctx.strokeStyle = color;
|
||||
|
||||
drawLineUp(x, y, color);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, config.nodeRadius, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
};
|
||||
|
||||
const drawLineIn = function (x, y, color) {
|
||||
drawLine(x + config.unitSize, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const drawLineOut = function (x, y, color) {
|
||||
drawLine(x, y + config.unitSize / 2, x + config.unitSize, y - config.unitSize / 2, color);
|
||||
};
|
||||
|
||||
const draw = function (graphList) {
|
||||
let colomn, colomnIndex, prevColomn, condenseIndex, breakIndex = -1;
|
||||
let x, y;
|
||||
let color;
|
||||
let nodePos;
|
||||
let tempFlow;
|
||||
let prevRowLength = 0;
|
||||
let flowSwapPos = -1;
|
||||
let lastLinePos;
|
||||
let i, l;
|
||||
let condenseCurrentLength, condensePrevLength = 0;
|
||||
|
||||
let inlineIntersect = false;
|
||||
|
||||
// initiate color array for first row
|
||||
for (i = 0, l = graphList[0].length; i < l; i++) {
|
||||
if (graphList[0][i] !== '_' && graphList[0][i] !== ' ') {
|
||||
flows.push(genNewFlow());
|
||||
}
|
||||
}
|
||||
|
||||
y = (canvas.height / ratio) - config.unitSize * 0.5;
|
||||
|
||||
// iterate
|
||||
for (i = 0, l = graphList.length; i < l; i++) {
|
||||
x = config.unitSize * 0.5;
|
||||
|
||||
const currentRow = graphList[i];
|
||||
const nextRow = graphList[i + 1];
|
||||
const prevRow = graphList[i - 1];
|
||||
|
||||
flowSwapPos = -1;
|
||||
|
||||
condenseCurrentLength = currentRow.filter((val) => {
|
||||
return (val !== ' ' && val !== '_');
|
||||
}).length;
|
||||
|
||||
// pre process begin
|
||||
// use last row for analysing
|
||||
if (prevRow) {
|
||||
if (!inlineIntersect) {
|
||||
// intersect might happen
|
||||
for (colomnIndex = 0; colomnIndex < prevRowLength; colomnIndex++) {
|
||||
if (prevRow[colomnIndex + 1]
|
||||
&& (prevRow[colomnIndex] === '/' && prevRow[colomnIndex + 1] === '|')
|
||||
|| ((prevRow[colomnIndex] === '_' && prevRow[colomnIndex + 1] === '|')
|
||||
&& (prevRow[colomnIndex + 2] === '/'))) {
|
||||
flowSwapPos = colomnIndex;
|
||||
|
||||
// swap two flow
|
||||
tempFlow = { id: flows[flowSwapPos].id, color: flows[flowSwapPos].color };
|
||||
|
||||
flows[flowSwapPos].id = flows[flowSwapPos + 1].id;
|
||||
flows[flowSwapPos].color = flows[flowSwapPos + 1].color;
|
||||
|
||||
flows[flowSwapPos + 1].id = tempFlow.id;
|
||||
flows[flowSwapPos + 1].color = tempFlow.color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (condensePrevLength < condenseCurrentLength
|
||||
&& ((nodePos = findColomn('*', currentRow)) !== -1
|
||||
&& (findColomn('_', currentRow) === -1))) {
|
||||
flows.splice(nodePos - 1, 0, genNewFlow());
|
||||
}
|
||||
|
||||
if (prevRowLength > currentRow.length
|
||||
&& (nodePos = findColomn('*', prevRow)) !== -1) {
|
||||
if (findColomn('_', currentRow) === -1
|
||||
&& findColomn('/', currentRow) === -1
|
||||
&& findColomn('\\', currentRow) === -1) {
|
||||
flows.splice(nodePos + 1, 1);
|
||||
}
|
||||
}
|
||||
} // done with the previous row
|
||||
|
||||
prevRowLength = currentRow.length; // store for next round
|
||||
colomnIndex = 0; // reset index
|
||||
condenseIndex = 0;
|
||||
condensePrevLength = 0;
|
||||
breakIndex = -1; // reset break index
|
||||
while (colomnIndex < currentRow.length) {
|
||||
colomn = currentRow[colomnIndex];
|
||||
|
||||
if (colomn !== ' ' && colomn !== '_') {
|
||||
++condensePrevLength;
|
||||
}
|
||||
|
||||
// check and fix line break in next row
|
||||
if (colomn === '/' && currentRow[colomnIndex - 1] && currentRow[colomnIndex - 1] === '|') {
|
||||
if ((breakIndex = findLineBreak(nextRow)) !== -1) {
|
||||
nextRow.splice(breakIndex, 1);
|
||||
}
|
||||
}
|
||||
// if line break found replace all '/' with '|' after breakIndex in previous row
|
||||
if (breakIndex !== -1 && colomn === '/' && colomnIndex > breakIndex) {
|
||||
currentRow[colomnIndex] = '|';
|
||||
colomn = '|';
|
||||
}
|
||||
|
||||
if (colomn === ' '
|
||||
&& currentRow[colomnIndex + 1]
|
||||
&& currentRow[colomnIndex + 1] === '_'
|
||||
&& currentRow[colomnIndex - 1]
|
||||
&& currentRow[colomnIndex - 1] === '|') {
|
||||
currentRow.splice(colomnIndex, 1);
|
||||
|
||||
currentRow[colomnIndex] = '/';
|
||||
colomn = '/';
|
||||
}
|
||||
|
||||
// create new flow only when no intersect happened
|
||||
if (flowSwapPos === -1
|
||||
&& colomn === '/'
|
||||
&& currentRow[colomnIndex - 1]
|
||||
&& currentRow[colomnIndex - 1] === '|') {
|
||||
flows.splice(condenseIndex, 0, genNewFlow());
|
||||
}
|
||||
|
||||
// change \ and / to | when it's in the last position of the whole row
|
||||
if (colomn === '/' || colomn === '\\') {
|
||||
if (!(colomn === '/' && findBranchOut(nextRow) === -1)) {
|
||||
if ((lastLinePos = Math.max(findColomn('|', currentRow),
|
||||
findColomn('*', currentRow))) !== -1
|
||||
&& (lastLinePos < colomnIndex - 1)) {
|
||||
while (currentRow[++lastLinePos] === ' ');
|
||||
|
||||
if (lastLinePos === colomnIndex) {
|
||||
currentRow[colomnIndex] = '|';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (colomn === '*'
|
||||
&& prevRow
|
||||
&& prevRow[condenseIndex + 1] === '\\') {
|
||||
flows.splice(condenseIndex + 1, 1);
|
||||
}
|
||||
|
||||
if (colomn !== ' ') {
|
||||
++condenseIndex;
|
||||
}
|
||||
|
||||
++colomnIndex;
|
||||
}
|
||||
|
||||
condenseCurrentLength = currentRow.filter((val) => {
|
||||
return (val !== ' ' && val !== '_');
|
||||
}).length;
|
||||
|
||||
// do some clean up
|
||||
if (flows.length > condenseCurrentLength) {
|
||||
flows.splice(condenseCurrentLength, flows.length - condenseCurrentLength);
|
||||
}
|
||||
|
||||
colomnIndex = 0;
|
||||
|
||||
// a little inline analysis and draw process
|
||||
while (colomnIndex < currentRow.length) {
|
||||
colomn = currentRow[colomnIndex];
|
||||
prevColomn = currentRow[colomnIndex - 1];
|
||||
|
||||
if (currentRow[colomnIndex] === ' ') {
|
||||
currentRow.splice(colomnIndex, 1);
|
||||
x += config.unitSize;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// inline interset
|
||||
if ((colomn === '_' || colomn === '/')
|
||||
&& currentRow[colomnIndex - 1] === '|'
|
||||
&& currentRow[colomnIndex - 2] === '_') {
|
||||
inlineIntersect = true;
|
||||
|
||||
tempFlow = flows.splice(colomnIndex - 2, 1)[0];
|
||||
flows.splice(colomnIndex - 1, 0, tempFlow);
|
||||
currentRow.splice(colomnIndex - 2, 1);
|
||||
|
||||
colomnIndex -= 1;
|
||||
} else {
|
||||
inlineIntersect = false;
|
||||
}
|
||||
|
||||
color = flows[colomnIndex].color;
|
||||
|
||||
switch (colomn) {
|
||||
case '_':
|
||||
drawLineRight(x, y, color);
|
||||
|
||||
x += config.unitSize;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
drawNode(x, y, color);
|
||||
break;
|
||||
|
||||
case '|':
|
||||
drawLineUp(x, y, color);
|
||||
break;
|
||||
|
||||
case '/':
|
||||
if (prevColomn
|
||||
&& (prevColomn === '/'
|
||||
|| prevColomn === ' ')) {
|
||||
x -= config.unitSize;
|
||||
}
|
||||
|
||||
drawLineOut(x, y, color);
|
||||
|
||||
x += config.unitSize;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
drawLineIn(x, y, color);
|
||||
break;
|
||||
}
|
||||
|
||||
++colomnIndex;
|
||||
}
|
||||
|
||||
y -= config.unitSize;
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
draw(graphList);
|
||||
}
|
||||
// @end-license
|
||||
Reference in new issue
Block a user