Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: gaelian/backpack-pages-for-chrome
base: 0ff051a423
...
head fork: gaelian/backpack-pages-for-chrome
compare: 39713caa10
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Nov 24, 2011
@gaelian Fixed obscure bug where if on first run, the extension is closed befo…
…re all

AJAX requests are finsihed, the user ID is never set.
150c6d4
@gaelian Reworked CSS for displaying the options form. Different size window s…
…hould not

affect where the success tick appears.
d82b4f4
@gaelian Added background image for filter text input. Removed label. 3c3f251
Commits on Nov 25, 2011
@gaelian Keyboard inputs should work as expected, i.e. Enter should submit a f…
…orm, links

should be able to be tabbed through and visited with keyboard input.
39713ca
View
11 css/application.css
@@ -67,6 +67,13 @@ input[type='text']
margin:12px 0 6px 0;
}
+#filter
+{
+ background:url('/images/magnifying_glass.png') no-repeat 2px 3px;
+ padding-left:14px;
+ font-size:1em;
+}
+
#main ul
{
color:#06c;
@@ -169,7 +176,7 @@ header
#optionsForm
{
- width:50%;
+ width:600px;
margin:auto;
padding:12px 0 0 0;
}
@@ -193,5 +200,5 @@ header
#optionsForm > #success
{
float:right;
- margin:8px 590px 0 0;
+ margin:5px 505px 0 0;
}
View
BIN  images/magnifying_glass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
32 js/application.js
@@ -1,4 +1,3 @@
-// TODO: keyboard shortcuts?
$(document).ready(function()
{
init();
@@ -30,6 +29,8 @@ function init()
window.localStorage.clear();
$('#save').click(function(){
+ event.preventDefault();
+
if ($username.val().length > 0)
{
setItem('username', $username.val().toLowerCase());
@@ -37,8 +38,8 @@ function init()
$userDetails.hide();
$reminderForm.hide();
$main.show();
- request('ws/pages/all');
request('me.xml');
+ request('ws/pages/all');
}
else
{
@@ -51,6 +52,12 @@ function init()
var username = getItem('username');
$userDetails.hide();
$reminderForm.hide();
+
+ if (getItem('userId') == undefined)
+ {
+ request('me.xml');
+ }
+
request('ws/pages/all');
}
}
@@ -65,7 +72,7 @@ function initMainContent(xml)
if ($page.attr('title').toLowerCase() != username + ' home')
{
- $('#pageList').append('<li id="' + $page.attr('id') + '">' + $page.attr('title') + '</li>');
+ $('#pageList').append('<li><a href="#" id="' + $page.attr('id') + '">' + $page.attr('title') + '</a></li>');
}
else
{
@@ -77,7 +84,7 @@ function initMainContent(xml)
$('#pageList').click(function(event){
$target = $(event.target);
- if ($target.is('li'))
+ if ($target.is('a'))
{
chrome.tabs.create({ url: getProtocol() + username + '.backpackit.com/pages/' + $target.attr('id') });
}
@@ -120,6 +127,7 @@ function initReminders()
$back.unbind('click');
$setReminder.click(function(event){
+ event.preventDefault();
var content = '';
var postData = '';
@@ -227,18 +235,18 @@ function initPageListFilter()
{
$('#filterForm').keyup(function() {
var $searchQuery = $(this).children("input[type='text']").val();
- var $listItems = $('#pageList > li');
+ var $links = $('#pageList > li > a');
- $listItems.each(function(){
- var $listItem = $(this);
+ $links.each(function(){
+ var $link = $(this);
- if ($listItem.text().search(new RegExp($searchQuery, 'i')) == -1)
+ if ($link.text().search(new RegExp($searchQuery, 'i')) == -1)
{
- $listItem.hide();
+ $link.hide();
}
else
{
- var text = $listItem.text().replace("/</?strong>/g", "");
+ var text = $link.text().replace("/</?strong>/g", "");
if ($searchQuery.length != 0)
{
@@ -247,8 +255,8 @@ function initPageListFilter()
});
}
- $listItem.html(text);
- $listItem.show();
+ $link.html(text);
+ $link.show();
}
});
});
View
2  js/options.js
@@ -22,6 +22,8 @@ function init()
}
$('#save').click(function(){
+ event.preventDefault();
+
if ($username.val().length > 0)
{
setItem('username', $username.val().toLowerCase());
View
6 options.html
@@ -12,16 +12,16 @@
<header>
<h1>Backpack pages for Chrome</h1>
</header>
- <div id="optionsForm">
+ <form action="" method="post" id="optionsForm">
<label for="username">Backpack username</label>
<input type="text" id="username">
<label for="useSsl">Use SSL with my Backpack account
<input type="checkbox" id="useSsl">
</label>
- <input type="button" id="save" value="Save">
+ <input type="submit" id="save" value="Save">
<div id="success">
<img src="images/tick.png" alt="success">
</div>
- </div>
+ </form>
</body>
</html>
View
25 popup.html
@@ -8,24 +8,24 @@
<body>
<div id="error">
</div>
- <div id="userDetails">
+ <form action="" method="post" id="userDetails">
<label for="username">Backpack username</label>
<input type="text" id="username">
<label for="useSsl">Use SSL with my Backpack account
<input type="checkbox" id="useSsl">
</label>
- <input type="button" id="save" value="Save">
- </div>
+ <input type="submit" id="save" value="Save">
+ </form>
<div id="main">
<div id="addReminder">
<a href="#">Quick add reminder</a>
</div>
<ul id="topLinks">
- <li id="newsroom">Newsroom</li>
- <li id="calendar">Calendar</li>
- <li id="reminders">Reminders</li>
- <li id="writeboards">Writeboards</li>
- <li id="journal_entries">Journal</li>
+ <li><a href="#" id="newsroom">Newsroom</a></li>
+ <li><a href="#" id="calendar">Calendar</a></li>
+ <li><a href="#" id="reminders">Reminders</a></li>
+ <li><a href="#" id="writeboards">Writeboards</a></li>
+ <li><a href="#" id="journal_entries">Journal</a></li>
</ul>
<div id="loading">
<img src="images/loading.gif" alt="Loading...">
@@ -35,14 +35,13 @@
</div>
<div id="pageContainer">
<div id="filterForm">
- <label for="filter">Filter page list</label>
<input type="text" id="filter">
</div>
<ul id="pageList">
- <li id="home"></li>
+ <li><a href="#" id="home"></a></li>
</ul>
</div><!-- #pageContainer -->
- <div id="reminderForm">
+ <form action="" method="post" id="reminderForm">
<p>Set a reminder</p>
<input type="text" id="reminderText">
<input type="hidden" id="date">
@@ -61,7 +60,7 @@
<option value="">----------</option>
<option value="specificTime">At a specific time...</option>
</select>
- <input type="button" id="setReminder" value="Set reminder">
+ <input type="submit" id="setReminder" value="Set reminder">
<p id="humanDate"></p>
<div id="time">
<span>at</span>
@@ -99,7 +98,7 @@
</select>
</div><!-- #time -->
<a id="back" href="">Back >>></a>
- </div><!-- #reminderForm -->
+ </form><!-- #reminderForm -->
</div><!-- #main -->
<script src="js/jquery-1.7.min.js"></script>
<script src="js/jquery-ui-1.8.16.custom.min.js"></script>

No commit comments for this range

Something went wrong with that request. Please try again.