add navigation menu and clear cookies function

This commit is contained in:
Damillora 2017-07-03 19:42:07 +07:00
parent 339d65385d
commit 69d122ea53
2 changed files with 172 additions and 15 deletions

172
dock.js
View File

@ -6,25 +6,177 @@ const options = {userAgent: 'Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6
module.exports.navitemplate = function(win){
const template = [
{
label: "My Page",
click(){ win.loadURL("http://imas.gree-apps.net/app/index.php/mypage",options)}
label: "Main",
submenu: [
{
label: "My Page",
click(){ win.loadURL("http://imas.gree-apps.net/app/index.php/mypage",options)}
},
{
label: "Eigyo",click() {win.loadURL("http://imas.gree-apps.net/app/index.php/eigyo?from=mypage_main_button",options) }
},
{
label: "Lesson",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/lesson",options)}
},
{
label: "Gasha",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/gasha",options)}
},
{
label: "Event",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/event",options)}
},
{
label: "Live Battle",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/livebattle",options)}
},
{
label: "Theater",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/theater",options)}
}
]
},
{
label: "Eigyo",click() {win.loadURL("http://imas.gree-apps.net/app/index.php/eigyo?from=mypage_main_button",options) }
label: "Card",
submenu: [
{
label: "Deck",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/deck",options)}
},
{
label: "Card Inventory",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/cardinventory",options)}
},
{
label: "Card Folder",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/cardfolder",options)}
},
{
label: "Potential Skill",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/potential_skill",options)}
},
{
label: "Bazaar",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/bazaar",options)}
},
{
label: "Trade",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/trade",options)}
}
]
},
{
label: "Lesson",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/lesson",options)}
label: "Idol",
submenu: [
{
label: "Unit",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/unit",options)}
},
{
label: "Idol List",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/idol",options)}
},
{
label: "Album",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/album",options)}
},
{
label: "Ranking",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/ranking",options)}
},
{
label: "Voice Drama",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/voice_drama/top",options)}
},
{
label: "Audio Room",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/audio_room",options)}
}
]
},
{
label: "Gasha",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/gasha",options)}
label: "Item",
submenu:
[
{
label: "Shop",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/shop",options)}
},
{
label: "Item",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/item",options)}
},
{
label: "Present Box",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/present",options)}
},
{
label: "Exchange",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/exchange",options)}
}
]
},
{
label: "Event",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/event",options)}
label: "Friend",
submenu: [
{
label: "Friend List",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/friend",options)}
},
{
label: "Lounge",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/lounge",options)}
},
{
label: "Producer Title",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/title",options)}
},
{
label: "Convention Center",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/convention_center",options)}
},
{
label: "Invite",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/invite",options)}
},
{
label: "Wishlist",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/wantlist",options)}
}
]
},
]
{
label: "Other",
submenu:
[
{
label: "Memories",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/memories",options)}
},
{
label: "Drama Theater",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/short_story",options)}
},
{
label: "My Data",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/mypage/mydata",options)}
},
{
label: "Million Live! Settings",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/config",options)}
},
{
label: "Help",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/help",options)}
},
{
label: "Return to Splash Page",
click() { win.loadURL("http://pf.gree.net/58737",options)}
}
]
}
]
return template;
}
module.exports.setdock = function(win) {

15
menu.js
View File

@ -1,5 +1,8 @@
const { app, Menu } = require('electron');
const navi = require('./dock');
const options = {userAgent: 'Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F27E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36'};
module.exports = function(win){
const template = [
{
@ -29,16 +32,17 @@ module.exports = function(win){
{role: 'togglefullscreen'}
]
},
{
label: 'Go',
submenu: navi.navitemplate(win)
},
{
role: 'window',
submenu: [
{role: 'minimize'},
{role: 'close'}
]
},
{
label: 'Go',
submenu: navi.navitemplate(win)
}
]
@ -47,6 +51,7 @@ module.exports = function(win){
label: app.getName(),
submenu: [
{role: 'about'},
{label: "Clear Cookies / Log Out",click(){win.webContents.session.clearStorageData({storages: "cookies"});win.loadURL("http://pf.gree.net/58737",options)}},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
@ -71,7 +76,7 @@ module.exports = function(win){
)
// Window menu
template[3].submenu = [
template[4].submenu = [
{role: 'close'},
{role: 'minimize'},
{role: 'zoom'},