-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
191 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
window.navigation = window.navigation || {}, | ||
function(n) { | ||
navigation.menu = { | ||
constants: { | ||
sectionTemplate: '.section-template', | ||
contentContainer: '#wrapper', | ||
startSectionMenuItem: '#welcome-menu', | ||
startSection: '#welcome' | ||
}, | ||
|
||
importSectionsToDOM: function() { | ||
const links = document.querySelectorAll('link[rel="import"]') | ||
Array.prototype.forEach.call(links, function (link) { | ||
let template = link.import.querySelector(navigation.menu.constants.sectionTemplate) | ||
let clone = document.importNode(template.content, true) | ||
document.querySelector(navigation.menu.constants.contentContainer).appendChild(clone) | ||
}) | ||
}, | ||
|
||
setMenuOnClickEvent: function () { | ||
document.body.addEventListener('click', function (event) { | ||
if (event.target.dataset.section) { | ||
navigation.menu.hideAllSections() | ||
navigation.menu.showSection(event) | ||
} | ||
}) | ||
}, | ||
|
||
showSection: function(event) { | ||
const sectionId = event.target.dataset.section | ||
$('#' + sectionId).show() | ||
$('#' + sectionId + ' section').show() | ||
}, | ||
|
||
showStartSection: function() { | ||
$(this.constants.startSectionMenuItem).click() | ||
$(this.constants.startSection).show() | ||
$(this.constants.startSection + ' section').show() | ||
}, | ||
|
||
hideAllSections: function() { | ||
$(this.constants.contentContainer + ' section').hide() | ||
}, | ||
|
||
init: function() { | ||
this.importSectionsToDOM() | ||
this.setMenuOnClickEvent() | ||
this.showStartSection() | ||
} | ||
}; | ||
|
||
n(function() { | ||
navigation.menu.init() | ||
}) | ||
|
||
}(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
window.localization = window.localization || {}, | ||
function(n) { | ||
localization.translate = { | ||
localization.translate = { | ||
|
||
menu: function() { | ||
$('#save-changes').text(i18n.__('Save')); | ||
$('#create-new-file').text(i18n.__('Save as')); | ||
$('#select-file').text(i18n.__('Open')); | ||
}, | ||
menu: function() { | ||
$('#welcome-menu').text(i18n.__('Welcome')); | ||
$('#editor-menu').text(i18n.__('Editor')); | ||
}, | ||
|
||
init: function() { | ||
this.button(); | ||
} | ||
}; | ||
welcome: function() { | ||
$('#welcome .inner h1').text(i18n.__('Welcome Header')); | ||
$('#welcome .inner p').text(i18n.__('Welcome Text')); | ||
}, | ||
|
||
n(function() { | ||
localization.translate.init(); | ||
}) | ||
init: function() { | ||
this.welcome(); | ||
this.menu(); | ||
this.editorFrame(); | ||
} | ||
}; | ||
|
||
n(function() { | ||
localization.translate.init(); | ||
}); | ||
|
||
}(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,10 @@ | |
margin-top: (_size(element-margin) * -0.3); | ||
line-height: 1.5em; | ||
} | ||
} | ||
|
||
#wrapper { | ||
section { | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
css_dir = "assets/css" # by Compass.app | ||
sass_dir = "assets/sass" # by Compass.app | ||
images_dir = "assets/css/images" # by Compass.app | ||
output_style = :compressed # :expanded or :nested or :compact or :compressed | ||
relative_assets = false # by Compass.app | ||
line_comments = true # by Compass.app | ||
sass_options = {:debug_info=>false} # by Compass.app | ||
sourcemap = false # by Compass.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE HTML> | ||
<!-- | ||
Hyperspace by HTML5 UP | ||
html5up.net | @ajlkn | ||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) | ||
--> | ||
<html> | ||
<head> | ||
<title>The Novelist</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="stylesheet" href="assets/css/main.css" /> | ||
<link rel="import" href="./sections/welcome.html"> | ||
<link rel="import" href="./sections/editor.html"> | ||
</head> | ||
<body> | ||
|
||
<!-- Sidebar --> | ||
<section id="sidebar"> | ||
<div class="inner"> | ||
<nav> | ||
<ul> | ||
<li><a id="welcome-menu" data-section="welcome" href="#">Welcome</a></li> | ||
<li><a id="editor-menu" data-section="editorFrame" href="#">Editor</a></li> | ||
</ul> | ||
</nav> | ||
</div> | ||
</section> | ||
|
||
<!-- Wrapper --> | ||
<div id="wrapper"> | ||
|
||
</div> | ||
|
||
<!-- Scripts --> | ||
|
||
<script>window.$ = window.jQuery = require('./assets/js/jquery.min.js');</script> | ||
<script>window.i18n = new(require('./translations/i18n'));</script> | ||
<script src="assets/js/jquery.scrollex.min.js"></script> | ||
<script src="assets/js/jquery.scrolly.min.js"></script> | ||
<script src="assets/js/skel.min.js"></script> | ||
<script src="assets/js/util.js"></script> | ||
<script src="assets/js/main.js"></script> | ||
<script> | ||
require('./assets/js/menu'); | ||
require('./assets/js/translations'); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template class="section-template"> | ||
<section id="editorFrame"> | ||
<div class="inner"> | ||
<!-- Files Dialog (invisible) --> | ||
<section id="files-dialog"> | ||
<div style="text-align:center;"> | ||
<input type="text" placeholder="Please select a file" id="actual-file" disabled="disabled" style="display: none; visibility: hidden;"/> | ||
<input type="button" id="delete-file" value="Delete file" style="display: none; visibility: hidden;"/> | ||
<input type="button" id="save-changes" value="Save"/> | ||
<input type="button" value="Save as" id="create-new-file"/> | ||
<input type="button" value="Open" id="select-file"/> | ||
</div> | ||
</br> | ||
</section> | ||
|
||
<!-- Editor --> | ||
<section id="editor"> | ||
<textarea id="content-editor" rows="20" style="width: 99%"></textarea><br><br> | ||
</section> | ||
</div> | ||
</section> | ||
<script src='./js/fileDialogSaveLoadDelete.js'></script> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template class="section-template"> | ||
<section id="welcome" class="wrapper style1 fullscreen intro"> | ||
<div class="inner"> | ||
<h1>Welcome to "The Novelist"</h1> | ||
<p>Welcome to "The Novelist". This is the main page for the app.</p> | ||
</div> | ||
</section> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters