This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 821461 - Use inline web activity when saving bookmark
- Loading branch information
Arthur Chen
committed
Dec 21, 2012
1 parent
004f337
commit 3b3276f
Showing
10 changed files
with
152 additions
and
80 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
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,11 @@ | ||
|
||
'use strict'; | ||
|
||
var Message = function Message(type, data) { | ||
this.type = type; | ||
this.data = data; | ||
}; | ||
|
||
Message.Type = { | ||
'ADD_BOOKMARK': 0 | ||
}; |
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,26 @@ | ||
'use strict'; | ||
|
||
if (navigator.mozSetMessageHandler) { | ||
navigator.mozSetMessageHandler('activity', function onActivity(activity) { | ||
switch (activity.source.name) { | ||
case 'save-bookmark': | ||
var bookmarkSaved = function sb_bookmarkSaved() { | ||
activity.postResult('saved'); | ||
}; | ||
var addBookmarkCancelled = function sb_addBookmarkCancelled() { | ||
activity.postError('cancelled'); | ||
}; | ||
|
||
var data = activity.source.data; | ||
if (data.type === 'url') { | ||
var options = { | ||
data: data, | ||
onsaved: bookmarkSaved, | ||
oncancelled: addBookmarkCancelled | ||
}; | ||
BookmarkEditor.init(options); | ||
} | ||
break; | ||
} | ||
}); | ||
} |
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,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0"> | ||
<link rel="stylesheet" type="text/css" href="style/homescreen.css"> | ||
<link rel="stylesheet" type="text/css" href="style/bookmark.css"> | ||
|
||
<!-- Shared code --> | ||
<script type="text/javascript" src="shared/js/l10n.js"></script> | ||
<script type="text/javascript" src="shared/js/l10n_date.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="shared/style/buttons.css"> | ||
<link rel="stylesheet" type="text/css" href="shared/style/headers.css"> | ||
<link rel="stylesheet" type="text/css" href="shared/style/input_areas.css"> | ||
<link rel="stylesheet" type="text/css" href="shared/style/confirm.css"> | ||
|
||
<!-- Specific code --> | ||
<script type="text/javascript" src="js/message.js"></script> | ||
<script type="text/javascript" src="js/bookmark.js"></script> | ||
<script type="text/javascript" src="js/save-bookmark.js"></script> | ||
|
||
<link rel="resource" type="application/l10n" href="locales/locales.ini"> | ||
<link rel="resource" type="application/l10n" href="shared/locales/date.ini"> | ||
</head> | ||
<body> | ||
<section id="bookmark-entry-sheet" role="region" class="skin-dark"> | ||
<header> | ||
<button id="button-bookmark-cancel"> | ||
<span class="icon icon-close" data-l10n-id="cancel">Cancel</span> | ||
</button> | ||
<h1 data-l10n-id="add-to-home-screen">Add to Home Screen</h1> | ||
</header> | ||
<form id="bookmark-form"> | ||
<label data-l10n-id="website-name"> | ||
Website Name<input type="text" id="bookmark-title"></input> | ||
</label> | ||
<label data-l10n-id="address"> | ||
Address <input type="url" id="bookmark-url"></input> | ||
</label> | ||
<button id="button-bookmark-add" data-l10n-id="add-to-home-screen">Add to Home Screen</button> | ||
</form> | ||
</section> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#bookmark-entry-sheet { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
background-color: #edeee9; | ||
z-index: 10001; | ||
} | ||
|
||
#bookmark-form { | ||
padding: 1.5rem; | ||
} | ||
|
||
#bookmark-form label { | ||
text-transform: uppercase; | ||
font-size: 1.5rem; | ||
} | ||
|
||
#bookmark-form input { | ||
margin-bottom: 1.5rem; | ||
} |
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