Upload via GUI (293 Dateien)
This commit is contained in:
31
bundle.js
31
bundle.js
@@ -39,7 +39,7 @@ const aboutBody =
|
||||
'const o=y("p");o.innerHTML=`Git: ${a.link().outerHTML}`,' +
|
||||
'e.appendChild(y("div",[y("div|class:version",[_t.render(),' +
|
||||
'y("div|class:version-details",[y("h1:MyStart|class:version-app-name"),' +
|
||||
'y("p:Version 1.0.0|class:version-number")])]),y("hr"),s,o,y("div|id:mystart-autostart-row,class:mystart-autostart-row")]))';
|
||||
'y("p:Version 1.0.1|class:version-number")])]),y("hr"),s,o,y("div|id:mystart-autostart-row,class:mystart-autostart-row")]))';
|
||||
mainJs = mainJs.slice(0, i) + aboutBody + mainJs.slice(j + aEndMarker.length);
|
||||
|
||||
// --- 2) Rename branding (visible text + storage keys) consistently ---
|
||||
@@ -171,6 +171,35 @@ const windowControlsJs = `(function(){
|
||||
document.addEventListener('mousedown',function(ev){
|
||||
if(ev.button===0&&ev.altKey){ev.preventDefault();send('window-drag');}
|
||||
},true);
|
||||
// Edge/corner resize: the WebView fills the whole window, so the OS never
|
||||
// sees the real window border to hit-test for a resize drag -- every mouse
|
||||
// event lands in the page first. Watch the pointer ourselves near the
|
||||
// viewport edges and hand off to the native resize loop, same trick as
|
||||
// the drag grip above.
|
||||
var RM=6; // px from the true edge that counts as a resize zone
|
||||
var CURSOR={n:'ns-resize',s:'ns-resize',e:'ew-resize',w:'ew-resize',
|
||||
ne:'nesw-resize',sw:'nesw-resize',nw:'nwse-resize',se:'nwse-resize'};
|
||||
function edgeAt(x,y){
|
||||
var w=window.innerWidth,h=window.innerHeight;
|
||||
var l=x<=RM,r=x>=w-RM,t=y<=RM,b=y>=h-RM;
|
||||
if(t&&l)return'nw';if(t&&r)return'ne';if(b&&l)return'sw';if(b&&r)return'se';
|
||||
if(l)return'w';if(r)return'e';if(t)return'n';if(b)return's';
|
||||
return null;
|
||||
}
|
||||
document.addEventListener('mousemove',function(ev){
|
||||
if(ev.buttons)return; // an active drag (e.g. scrollbar) is in progress -> leave it alone
|
||||
var onCtrls=ev.target.closest&&ev.target.closest('#mystart-winctrls');
|
||||
var edge=onCtrls?null:edgeAt(ev.clientX,ev.clientY);
|
||||
document.documentElement.style.cursor=edge?CURSOR[edge]:'';
|
||||
},true);
|
||||
document.addEventListener('mousedown',function(ev){
|
||||
if(ev.button!==0)return;
|
||||
if(ev.target.closest&&ev.target.closest('#mystart-winctrls'))return;
|
||||
var edge=edgeAt(ev.clientX,ev.clientY);
|
||||
if(edge){ev.preventDefault();send2('window-resize',{edge:edge});}
|
||||
},true);
|
||||
document.addEventListener('mouseleave',function(){document.documentElement.style.cursor='';},true);
|
||||
function send2(t,extra){try{window.chrome.webview.postMessage(Object.assign({type:t},extra));}catch(e){}}
|
||||
})();`;
|
||||
|
||||
mainJs = trInfra + autostartJs + windowControlsJs + mainJs;
|
||||
|
||||
Reference in New Issue
Block a user