|
@@ -3,6 +3,7 @@ const {ipcRenderer} = require('electron');
|
|
|
let ipc=require('electron').ipcRenderer;
|
|
let ipc=require('electron').ipcRenderer;
|
|
|
/*注册命名空间*/
|
|
/*注册命名空间*/
|
|
|
let US_Browser=[];
|
|
let US_Browser=[];
|
|
|
|
|
+let BrowersWindow=require('electron').remote.getCurrentWindow();
|
|
|
Namespace.register("US_Browser");
|
|
Namespace.register("US_Browser");
|
|
|
/*浏览器函数*/
|
|
/*浏览器函数*/
|
|
|
US_Browser.CreatBrower=function (address,flag) {//创建窗口,url,是否为用户选择文件
|
|
US_Browser.CreatBrower=function (address,flag) {//创建窗口,url,是否为用户选择文件
|
|
@@ -315,7 +316,7 @@ US_Browser.SourceCode = function () {//查看源代码
|
|
|
US_Browser.CreatBrower("view-source:"+US_Browser.Head[5].value);
|
|
US_Browser.CreatBrower("view-source:"+US_Browser.Head[5].value);
|
|
|
};
|
|
};
|
|
|
US_Browser.Exit=function(){
|
|
US_Browser.Exit=function(){
|
|
|
- window.close();
|
|
|
|
|
|
|
+ BrowersWindow.close();
|
|
|
// ipc.send('window-all-closed');
|
|
// ipc.send('window-all-closed');
|
|
|
};
|
|
};
|
|
|
US_Browser.goBack = function(){//执行后退
|
|
US_Browser.goBack = function(){//执行后退
|
|
@@ -473,11 +474,12 @@ US_Browser.HeadBind=function(){
|
|
|
US_Browser.AddButton=$(".BrowwerAdd")[0];//获取新建标签页按钮
|
|
US_Browser.AddButton=$(".BrowwerAdd")[0];//获取新建标签页按钮
|
|
|
US_Browser.ControlButton=$(".browerHeaderControl button");
|
|
US_Browser.ControlButton=$(".browerHeaderControl button");
|
|
|
US_Browser.ControlButton[0].onclick=function(){//最小化
|
|
US_Browser.ControlButton[0].onclick=function(){//最小化
|
|
|
- ipc.send('hide-window');
|
|
|
|
|
|
|
+ BrowersWindow.minimize();
|
|
|
};
|
|
};
|
|
|
US_Browser.ControlButton[1].onclick=function(){//最大化
|
|
US_Browser.ControlButton[1].onclick=function(){//最大化
|
|
|
if(isBig){
|
|
if(isBig){
|
|
|
ipc.send('show-window');
|
|
ipc.send('show-window');
|
|
|
|
|
+ BrowersWindow.maximize();
|
|
|
this.className='icon-window-restore';
|
|
this.className='icon-window-restore';
|
|
|
US_Browser.NavContainer.style.padding = "5px 0 0";
|
|
US_Browser.NavContainer.style.padding = "5px 0 0";
|
|
|
US_Browser.RightMenu.style.top='71px';
|
|
US_Browser.RightMenu.style.top='71px';
|
|
@@ -486,7 +488,7 @@ US_Browser.HeadBind=function(){
|
|
|
elm.style.height='calc(100% - 70px)';
|
|
elm.style.height='calc(100% - 70px)';
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
- ipc.send('orignal-window');
|
|
|
|
|
|
|
+ BrowersWindow.restore();
|
|
|
this.className='icon-window-maximize';
|
|
this.className='icon-window-maximize';
|
|
|
US_Browser.NavContainer.style.padding = "15px 0 0";
|
|
US_Browser.NavContainer.style.padding = "15px 0 0";
|
|
|
US_Browser.RightMenu.style.top='81px';
|
|
US_Browser.RightMenu.style.top='81px';
|