Skip to content

Commit

Permalink
Merge pull request #3 from lostsnow/v1
Browse files Browse the repository at this point in the history
bump version to v1
  • Loading branch information
lostsnow committed Jan 20, 2017
2 parents 7dfc3f6 + e698d4e commit c0b5e5b
Show file tree
Hide file tree
Showing 16 changed files with 786 additions and 971 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.idea
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Pinboard+

A better firefox add-on for [Pinboard.in](http://pinboard.in).

Current version: 1.0.0

Feature
-------

* Built with Firefox [WebExtensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions)
* Add/Update/Delete bookmark from the popup window.
* Icon changing to show current page has been saved or not.

> **WebExtensions are currently in an experimental alpha state. The first stable release in Firefox 48.**
Install
-------

Expand All @@ -20,4 +20,4 @@ Install From [Firefox Add-ons site](https://addons.mozilla.org/en-US/firefox/add
Thanks
------

This Firefox add-on was ported from the Chrome extension at [Pinboard-Plus](https://github.com/clvrobj/Pinboard-Plus)
Chrome extension at [Pinboard-Plus](https://github.com/clvrobj/Pinboard-Plus)
21 changes: 0 additions & 21 deletions css/libs/angular-csp.css

This file was deleted.

41 changes: 28 additions & 13 deletions css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,44 @@ body {
padding: 0;
}

header, section {
padding: .5em 5%;
}
header {
background: #efefef;
border-bottom: 1px solid #ccc;
padding: 16px 5%;
background: #efefef;
border-bottom: 1px solid #ccc;
}

header h1 {
height: 24px;
margin: 0;
padding: 12px 60px;
background: url("../img/appicon-48.png") transparent no-repeat 0 50%;
}

section {
padding: 1.5em 5%;
}

header + section {
box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.2);
}

span.checkbox {
display: block;
float: left;
width: 3em;
height: 3em;
vertical-align: top;
display: inline-block;
width: 1.5em;
height: 14px;
vertical-align: middle;
}
span.checkbox input {
margin: 0;
}

.meta {
color: #999;
display: block;
color: #999;
height: 12px;
padding-left: 1.5em;
}

p {
height: 25px;
margin: 0 0 12px 0;
}
12 changes: 8 additions & 4 deletions css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ input[type="submit"] {
padding-top: 2px;
}

#state-mask, #login-window, #login-error, #bookmark-window, #add-post-form, #auto-complete {
display: none;
}

#state-mask {
position: absolute;
width: 470px;
Expand Down Expand Up @@ -135,15 +139,15 @@ input[type="submit"] {
border: 1px solid #FFB3B3;
}

.auto-complete {
#auto-complete {
background-color: #FFF;
border: 1px solid #AAA;
box-shadow: 1px 1px 3px rgba(0, 0, 110, 0.33);
min-width: 200px;
position: absolute;
}

.auto-complete li {
#auto-complete li {
background-color: #FFF;
border-bottom: 0 solid #FFF;
color: #2255AA;
Expand All @@ -152,12 +156,12 @@ input[type="submit"] {
cursor: pointer;
}

.auto-complete .active {
#auto-complete .active {
background-color: #969696;
color: #FFF;
}

.auto-complete li.exclude {
#auto-complete li.exclude {
display: none;
}

Expand Down
8 changes: 1 addition & 7 deletions html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
<head>
<meta charset="utf-8">
<title>Pinboard+ Options</title>
<link href="/css/options.css" rel="stylesheet" type="text/css">
<link href="../css/options.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<h1>
<img src="/img/appicon_48.png"/>
Pinboard+ Options
</h1>
</header>
<section>
<p>
<span class="checkbox"><input type="checkbox" id="no-ping" /></span>
<label for="no-ping">Do not check if page has already been bookmarked</label>
<br/>
<span class="meta">
(Stop pinging the Pinboard API; Icon will be grey)
</span>
Expand All @@ -25,10 +23,6 @@ <h1>
<span class="checkbox"><input type="checkbox" id="all-private" /></span>
<label for="all-private">Private checkbox checked by default</label>
</p>
<p>
<span class="checkbox"><input type="checkbox" id="use-blockquote" /></span>
<label for="use-blockquote">Wrap selected text on a page with <code>&lt;blockquote&gt;</code> in the Notes field</label>
</p>
</section>
<script type="text/javascript" src="/js/libs/jquery.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
Expand Down
199 changes: 96 additions & 103 deletions html/popup.html
Original file line number Diff line number Diff line change
@@ -1,112 +1,105 @@
<!doctype html>
<html ng-app="popupApp" ng-csp>
<head>
<meta charset="utf-8">
<link href="/css/popup.css" rel="stylesheet" type="text/css">
<link href="/css/libs/angular-csp.css" rel="stylesheet" type="text/css">
</head>
<body ng-controller="PopupCtrl">
<div id="wrapper">
<div id="state-mask" ng-show="isLoading">{{loadingText}}</div>
<html>
<head>
<meta charset="utf-8">
<title>Pinboard+</title>
<link href="../css/popup.css" rel="stylesheet" type="text/css">
</head>

<div id="login-window" ng-show="isAnony">
<div id="header">
<div class="logo-unlogin">Pinboard - please login</div>
</div>
<form id="login-form" ng-submit="loginSubmit()" ng-show="!isLoading">
<ul>
<li id="login-error" ng-show="isLoginError">
<span>Login Failed.</span>
</li>
<li>
<label class="item-title">API Token</label>
<input id="token" name="token" type="text" size="50" ng-model="userLogin.authToken" placeholder="API Token"/>
<div class="meta clear">
You can find API token on your <a href="#" title="Pinboard Password page" ng-click="openUrl('https://pinboard.in/settings/password')">Pinboard Password page</a>.
</div>
</li>
<li>
<input id="login-btn" type="submit" value="log in" />
</li>
</ul>
</form>
<body>
<div id="wrapper">
<div id="state-mask"></div>

<div id="login-window">
<div id="header">
<div class="logo-unlogin">Pinboard - please login</div>
</div>
<form id="login-form">
<ul>
<li id="login-error">
<span>Login Failed.</span>
</li>
<li>
<label class="item-title">API Token</label>
<input id="token" name="token" type="text" size="50" placeholder="API Token"/>
<div class="meta clear">
You can find API token on your
<a class="link" title="Pinboard Password page"
href="https://pinboard.in/settings/password">Pinboard Password page</a>.
</div>
</li>
<li>
<input id="login-btn" type="submit" value="log in" />
</li>
</ul>
</form>
</div>

<div id="bookmark-window" ng-show="!isAnony">
<div id="header">
<div class="logo">
<a id="logo-link" href="#" title="Click to open Pinboard.in"
ng-click="openUrl('http:pinboard.in/')">
Pinboard - (<span id="user">{{userInfo.name}}</span>)
</a>
<a class="random" href="#" title="Random unread item" ng-click="openUrl('http:pinboard.in/random/?type=unread')">R</a>
<a class="option" href="#" title="Options" ng-click="openOptions()">O</a>
</div>
<div class="alert alert-error" ng-show="isPostError && !isLoading">{{postErrorText}}</div>
<div class="alert" ng-show="pageInfo.isSaved && !isPostError && !isLoading">{{renderSavedTime(pageInfo.time)}}</div>
<div class="logout">[<a href="#" ng-click="logout()">log out</a>]</div>
<div id="bookmark-window" ng-show="!isAnony">
<div id="header">
<div class="logo">
<a id="logo-link" class="link" title="Click to open Pinboard.in"
href="https://pinboard.in/">Pinboard - (<span id="username"></span>)
</a>
<a class="random link" title="Random unread item" href="https://pinboard.in/random/?type=unread">R</a>
<a class="option" href="#" title="Options">O</a>
</div>
<form id="add-post-form" ng-submit="postSubmit()" ng-show="!isLoading">
<ul>
<li>
<label class="item-title">URL</label>
<input id="url" type="text" ng-model="pageInfo.url"/>
</li>
<li>
<label class="item-title">Title</label>
<input id="title" type="text" ng-model="pageInfo.title"/>
</li>
<li>
<label class="item-title">Notes</label>
<textarea id="desc" rows="4" ng-model="pageInfo.desc"></textarea>
<div id="blockquote-hint" ng-show="isQuoteHintShown">
Text in &lt;blockquote&gt; will be displayed as cited text in Pinboard.
</div>
</li>
<li>
<label class="item-title">Tags</label>
<input id="tag" type="text" autofocus="autofocus" ng-model="pageInfo.tag" ng-change="showAutoComplete()" ng-keydown="chooseTag($event)"/>
</li>
<li ng-show="suggests.length > 0">
<label class="item-title">Suggest</label>
<div id="suggest">
<a href="#" ng-class="{'selected':pageInfo.tag.split(' ').indexOf(suggest) != -1}"
ng-repeat="suggest in suggests" ng-click="addTags([suggest])">{{suggest}}</a>
<a href="#" id="add-all" ng-click="addTags(suggests)">Add all</a>
</div>
</li>
<li class="nomargin">
<label class="item-title"></label>
<input type="checkbox" name="private" id="private" ng-model="pageInfo.isPrivate" ng-checked="pageInfo.isPrivate">
<label for="private">private</label>
<input type="checkbox" name="toread" id="toread" ng-model="pageInfo.toread" ng-checked="pageInfo.toread">
<label for="toread">read later</label>
</li>
<li class="nomargin">
<label class="item-title"></label>
<input id="submit" type="submit" value="Submit" />
<span>
<a id="delete" class="opt" href="#" ng-show="pageInfo.isSaved" ng-hide="isShowDeleteConfirm" ng-click="showDeleteConfirm()">delete</a>
<span class="confirm" ng-show="isShowDeleteConfirm">
<a id="cancel-delete" class="opt" href="#" ng-click="isShowDeleteConfirm=false">cancel</a> /
<a id="destroy" href="#" class="opt opt-destroy" ng-click="postDelete()">destroy</a>
</span>
</span>
</li>
</ul>
</form>
<div class="alert alert-error" style="display: none;"></div>
<div class="alert alert-savetime" style="display: none;"></div>
<div class="logout">[<a href="#">log out</a>]</div>
</div>
<div class="auto-complete" ng-show="isShowAutoComplete && !isLoading" ng-style="autoCompleteStyle">
<form id="add-post-form">
<ul>
<li ng-repeat="item in autoCompleteItems" ng-class="{active: item.isActive == true}">{{item.text}}</li>
<li>
<label class="item-title">URL</label>
<input id="url" type="text" value="" />
</li>
<li>
<label class="item-title">Title</label>
<input id="title" type="text" value="" />
</li>
<li>
<label class="item-title">Notes</label>
<textarea id="desc" rows="4"></textarea>
<div id="blockquote-hint">
Text in &lt;blockquote&gt; will be displayed as cited text in Pinboard.
</div>
</li>
<li>
<label class="item-title">Tags</label>
<input id="tag" type="text" autofocus="autofocus" />
</li>
<li id="suggest-list" style="display: none;">
<label class="item-title">Suggest</label>
<div id="suggest"></div>
</li>
<li class="nomargin">
<label class="item-title"></label>
<input type="checkbox" name="private" id="private" />
<label for="private">private</label>
<input type="checkbox" name="toread" id="toread" />
<label for="toread">read later</label>
</li>
<li class="nomargin">
<label class="item-title"></label>
<input id="submit" type="submit" value="Submit" />
<span>
<a id="opt-delete" class="opt" href="#" style="display: none;">delete</a>
<span id="opt-confirm" style="display: none;">
<a id="opt-cancel-delete" class="opt" href="#">cancel</a> /
<a id="opt-destroy" href="#" class="opt opt-destroy">destroy</a>
</span>
</span>
</li>
</ul>
</div>
</div>
<script type="text/javascript" src="/js/libs/jquery.min.js"></script>
<script type="text/javascript" src="/js/libs/angular.min.js"></script>
<script type="text/javascript" src="/js/libs/underscore-min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/popup.js"></script>
</body>
</form>
</div>
<div id="auto-complete">
<ul></ul>
</div>
</div>
<script type="text/javascript" src="../js/libs/jquery.min.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/popup.js"></script>
</body>
</html>
Loading

0 comments on commit c0b5e5b

Please sign in to comment.