Skip to content

Commit

Permalink
update to v1.5.0 (#8)
Browse files Browse the repository at this point in the history
Updated Preferences page
Minor fixes
  • Loading branch information
jhonatasrm authored Oct 11, 2019
1 parent 75ff45b commit 4af649b
Show file tree
Hide file tree
Showing 7 changed files with 10,423 additions and 53 deletions.
Binary file modified print-preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions src/css/bootstrap.css

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

69 changes: 40 additions & 29 deletions src/html/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,54 @@
<link rel="shortcut icon" href="../res/icons/favicon.ico" type="image/x-icon"/>
<link rel="icon" href="../res/icons/favicon.ico" type="image/x-icon"/>
<link href="../css/bootstrap.css" rel="stylesheet"/>
<script src="../js/jquery-3.3.1.js"></script>
<script src="../js/background.js"></script>
<link href="../css/style.css" rel="stylesheet"/>
</head>

<body style="background-color:white;" class="col-md-12">
<main>
<header>
<nav class="icons">
<ul>
<div>
<img src="../res/icons/icon.png" style="float:left; padding-right:10px;margin-top:-10px;"><h4><strong id="version"></strong></h4>
</div>
<li>
<a href="https://github.com/jhonatasrm/print-preview/" title="Github" target="_blank"><img src="../res/icons/github.png" width="20" height="20" style="margin-bottom:7px;margin-right:15px;"></a>
<a href='https://ko-fi.com/S6S5S3WU' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com'/></a>
</li>
</ul>
</nav>
</header>
<header>
<nav class="icons">
<ul>
<div>
<img src="../res/icons/icon.png" style="float:left; padding-right:10px;margin-top:-10px;"><h4>
<strong id="version"></strong></h4>
</div>
<li>
<a href="https://github.com/jhonatasrm/print-preview/" title="Github" target="_blank"><img
src="../res/icons/github.png" width="20" height="20"
style="margin-bottom:7px;margin-right:15px;"></a>
<a href='https://ko-fi.com/S6S5S3WU' target='_blank'><img height='36'
style='border:0px;height:36px;'
src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0'
border='0'
alt='Buy Me a Coffee at ko-fi.com'/></a>
</li>
</ul>
</nav>
</header>
<div class="alert alert-success alert-dismissible fade show" style="display:none;" id="success">
<strong data-i18n="saved_preferences"></strong>
<strong data-i18n="saved_preferences"></strong>
<button type="button" class="close" data-dismiss="alert"></button>
</div>
<fieldset class="col-md-12">
<div>
<h4><strong id="preferences" data-i18n="preferences"></strong>
<a href="../html/about.html" title="About" ><img src="../res/icons/about.png" style="float:right;"></a></h4>
</div><br>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="contextMenu">
<label class="custom-control-label" data-i18n="contextMenu" for="contextMenu"></label>
</div>
<small class="form-text text-muted" data-i18n="description_contextmenu"></small>

<div class="col-md-12" style="text-align: center; margin-top:10px;">
<button type="submit" class="btn btn-primary" data-i18n="save_preferences" style="float:right;" id="save_preferences"></button>
</div>
</fieldset>
<fieldset class="col-md-12">
<div>
<h4><strong id="preferences" data-i18n="preferences"></strong>
<a href="../html/about.html" title="About"><img src="../res/icons/about.png" style="float:right;"></a>
</h4>
</div>
<br>
<div class="col-md-12 col-sm-12" style="margin-top:20px;">
<label data-i18n="contextMenu">
</label>
<label class="btn btn-outline-primary " style="width:200px;float:right; margin-top:2px;">
<input type="radio" name="contextMenu" value="false" checked="checked">Off</label>
<label class="btn btn-outline-primary " style="width:200px;float:right;margin-top:2px;">
<input type="radio" name="contextMenu" value="true">On</label>
<small class="form-text text-muted" data-i18n="description_contextmenu" style="margin-top:-10px;"></small>
</div>
</fieldset>
</main>
<script src="../js/language.js"></script>
<script src="../js/preferences.js"></script>
Expand Down
6 changes: 5 additions & 1 deletion src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ browser.browserAction.onClicked.addListener(() => {
browser.tabs.printPreview()
});

if (localStorage.getItem('contextMenu') == 'undefined' || localStorage.getItem('contextMenu') == null){
localStorage.setItem('contextMenu', false);
}

startContextMenu();

function onCreated() {
Expand All @@ -13,7 +17,7 @@ function onCreated() {
}

function startContextMenu(){
if(localStorage.getItem("loadMyPreferences") == "true"){
if(localStorage.getItem("contextMenu") == "true"){
browser.menus.create({
id: "print-preview",
title: "Print Preview",
Expand Down
Loading

0 comments on commit 4af649b

Please sign in to comment.