Beginning to implement localPage: a page to launch the animes directly from KawAnime.

This commit is contained in:
Kylart 2017-03-04 17:03:21 +01:00
parent e8658c96b1
commit 7e0c956b54
6 changed files with 70 additions and 6 deletions

View File

@ -41,7 +41,7 @@
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="22">
<list size="23">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
@ -64,6 +64,7 @@
<item index="19" class="java.lang.String" itemvalue="md-theme" />
<item index="20" class="java.lang.String" itemvalue="p" />
<item index="21" class="java.lang.String" itemvalue="md-snackbar" />
<item index="22" class="java.lang.String" itemvalue="downloader" />
</list>
</value>
</option>

View File

@ -21,7 +21,7 @@
</button>
</div>
<div id="container" >
<div id="container" style="display: none;">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
mdl-layout--fixed-header">
<header class="mdl-layout__header">
@ -47,6 +47,7 @@
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="#" v-on:click="getDownloader()">Download an anime</a>
<a class="mdl-navigation__link" href="#" v-on:click="getMainPage()">Recent releases</a>
<a class="mdl-navigation__link" href="#" v-on:click="getLocalPage()">Local animes</a>
<a class="mdl-navigation__link" href="#" v-on:click="getNewsPage()">Get news</a>
<a class="mdl-navigation__link" href="#" v-on:click="getSeasonPage()">Check animes from season</a>
<a class="mdl-navigation__link" href="#">Watch List</a>
@ -96,6 +97,9 @@
</div>
</template>
</div>
<div id="local-page" v-if="show">
<local-page></local-page>
</div>
<div id="loader-container" v-if="show">
<div class="loading-text">
<h3>少々お待ち下さい。</h3>

View File

@ -5,3 +5,5 @@
* of the information page.
*
*/
const functions = require('./functions.js')

View File

@ -0,0 +1,8 @@
/**
* Created by Kylart on 01/03/2017.
*
* In this file, all the functions needed by the local page
* are present. This is for cleaner code.
*
*/

28
src/localPage/index.js Normal file
View File

@ -0,0 +1,28 @@
/**
* Created by Kylart on 04/03/2017.
*
* In this file is present the vue object to render this HTML part
* of the local page.
*
*/
const functions = require('./functions.js')
const html = `
<div>
<h1>{{ message }}</h1>
</div>`
Vue.component('local-page', {
template: html,
data: function () {
return {
message: "Hello"
}
},
methods: {
findFiles: function () {
return functions.findFiles()
}
}
})

View File

@ -5,6 +5,8 @@
*
*/
const self = this
/* ------------------ IMPORTS ------------------ */
const remote = require('electron').remote
@ -25,6 +27,8 @@ const malScraper = require('mal-scraper')
/* ----------------- VUE IMPORTS ----------------- */
require(path.join(__dirname, 'downloader', 'index.js'))
// require(path.join(__dirname, 'infoPage', 'index.js'))
require(path.join(__dirname, 'localPage', 'index.js'))
const VueMaterial = require('vue-material')
@ -255,7 +259,7 @@ let seasonalInfo = malScraper.getSeason(getCurrentSeason().year, getCurrentSeaso
/* ------------------- VUE.JS OBJECTS ----------------- */
let lastPage = 'release'
exports.lastPage = 'release'
let downloader = new Vue({
el: '#download-container',
@ -295,11 +299,18 @@ let releases = new Vue({
disableDownloaderBackground()
lastPage = 'release'
self.lastPage = 'release'
}
}
})
let localPage = new Vue({
el: '#local-page',
data: {
show: false
}
})
let loader = new Vue({
el: '#loader-container',
data: {
@ -338,7 +349,7 @@ let info = new Vue({
},
back: function () {
this.hide()
switch (lastPage)
switch (self.lastPage)
{
case 'release':
releases.show = true
@ -442,7 +453,7 @@ let season = new Vue({
this.show = false
loader.show = true
makeResearchOnMal(arg)
lastPage = 'season'
self.lastPage = 'season'
disableDownloaderBackground()
},
@ -487,6 +498,16 @@ new Vue({
downloader.show = false
}
},
getLocalPage: function () {
releases.show = false
news.show = false
loader.show = false
season.show = false
downloader.show = false
localPage.show = true
disableDownloaderBackground()
},
getNewsPage: function () {
// For first time
if (news.display === 'none')