Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Toolbar on top #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion App/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ <h3>Settings</h3>
<input type="checkbox" id="show-notifications" checked><label for="show-notifications">Show notifications</label>
<input type="checkbox" id="auto-instapaperizer"><label for="auto-instapaperizer">Auto Instapaper</label>
<input type="checkbox" id="night-mode"><label for="night-mode">Night Mode</label>
<input type="checkbox" id="top-toolbar"><label for="top-toolbar">Toolbar on top</label>
<input type="checkbox" id="remember-last-feed" checked><label for="remember-last-feed">Remember Last Feed</label>
</div>
</div>
Expand Down Expand Up @@ -294,4 +295,4 @@ <h1 class="title"><%= title %></h1>
</script>

</body>
</html>
</html>
3 changes: 1 addition & 2 deletions App/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions App/css/toptoolbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#feeds-column #filters { top: 35px; bottom: 0 }
#feeds-column #feeds { top: 136px; bottom: 0; }

#articles-column #articles { top: 35px; bottom: 0; }
#post-column #post-window { top: 35px; bottom: 0; }

.bar { top: 0; bottom: 0; border-top: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.2); }

.scope:after, .scope:before { top: 35px; bottom: 0px; -webkit-transform: rotate(180deg);}
.scope:before { border-bottom-color: #d6d4d4; border-width: 10px; left: 50%; margin-left: -10px; }
.scope:after { border-bottom-color: #b9b8b8; border-width: 11px; left: 50%; margin-left: -11px; }

#articles .splitter:first-child { margin-top: 0; margin-bottom: 1px; }
7 changes: 6 additions & 1 deletion App/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function default_settings() {
notifications: true,
autoInstapaperizer: false,
nightMode: false,
topToolbar: false,
rememberLastFeed: true,
lastFeed: false,
label: {}
Expand Down Expand Up @@ -196,6 +197,7 @@ $(function() {
notifications: $('#show-notifications'),
autoInstapaperizer: $('#auto-instapaperizer'),
nightMode: $('#night-mode'),
topToolbar: $('#top-toolbar'),
rememberLastFeed: $('#remember-last-feed'),
max: {
special: $('#max-special'),
Expand Down Expand Up @@ -625,9 +627,12 @@ $(function() {
$$.settings.nightMode.on('change', function() {
ui.nightMode($(this).prop('checked'))
})
$$.settings.topToolbar.on('change', function() {
ui.topToolbar($(this).prop('checked'))
})
$$.settings.rememberLastFeed.on('change', function() {
settings.rememberLastFeed = $(this).prop('checked')
storage.savePrefs()
})

})
})
18 changes: 18 additions & 0 deletions App/scripts/app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,9 +1281,11 @@ ui = {
$$.settings.max.read.val(settings.max.read)
$$.settings.autoInstapaperizer.prop('checked', settings.autoInstapaperizer)
$$.settings.nightMode.prop('checked', settings.nightMode)
$$.settings.topToolbar.prop('checked', settings.topToolbar)
$$.settings.rememberLastFeed.prop('checked', settings.rememberLastFeed)
core.refreshOnTimer()
ui.nightMode()
ui.topToolbar()
},

pocket: function() {
Expand Down Expand Up @@ -1339,6 +1341,22 @@ ui = {
// Disable nightmode
$('head .night-mode').remove()
}
},
topToolbar: function(status) {
if (status === undefined) {
status = settings.topToolbar
} else {
settings.topToolbar = status
storage.savePrefs()
}

if (status) {
// Enable nightmode
$('head').append('<link class="top-toolbar" rel="stylesheet" href="css/toptoolbar.css">')
} else {
// Disable nightmode
$('head .top-toolbar').remove()
}
}
}