diff --git a/mobile/chrome/content/urlbar.xml b/mobile/chrome/content/bindings.xml
similarity index 52%
rename from mobile/chrome/content/urlbar.xml
rename to mobile/chrome/content/bindings.xml
index e6a0a75755f..4707df0bf42 100644
--- a/mobile/chrome/content/urlbar.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -1,5 +1,9 @@
-
+
+
+%browserDTD;
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ document.getAnonymousElementByAttribute(this, "anonid", "name");
+
+
+ document.getAnonymousElementByAttribute(this, "anonid", "uri");
+
+
+ document.getAnonymousElementByAttribute(this, "anonid", "tags");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 || currentTags.length > 0) {
+ var tagsToRemove = [];
+ var tagsToAdd = [];
+ var i;
+ for (i = 0; i < currentTags.length; i++) {
+ if (tags.indexOf(currentTags[i]) == -1)
+ tagsToRemove.push(currentTags[i]);
+ }
+ for (i = 0; i < tags.length; i++) {
+ if (currentTags.indexOf(tags[i]) == -1)
+ tagsToAdd.push(tags[i]);
+ }
+
+ if (tagsToAdd.length > 0)
+ PlacesUtils.tagging.tagURI(uri, tagsToAdd);
+ if (tagsToRemove.length > 0)
+ PlacesUtils.tagging.untagURI(uri, tagsToRemove);
+ }
+
+ if (uri.spec != this.uri) {
+ var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+ var newuri = ios.newURI(this.uri, null, null);
+
+ PlacesUtils.bookmarks.changeBookmarkURI(item, newuri);
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js
index 69cfa0a4366..cfcafe76136 100644
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -78,6 +78,7 @@ var BrowserUI = {
_autocompleteNavbuttons : null,
_favicon : null,
_faviconLink : null,
+ _editingBookmark : null,
_titleChanged : function(aDocument) {
var browser = Browser.currentBrowser;
@@ -338,13 +339,7 @@ var BrowserUI = {
forward.setAttribute("disabled", !browser.canGoForward);
// Check for a bookmarked page
- var star = document.getElementById("tool-star");
- if (PlacesUtils.getMostRecentBookmarkForURI(browser.currentURI) != -1) {
- star.setAttribute("starred", "true");
- }
- else {
- star.removeAttribute("starred");
- }
+ this.updateStar();
var urlString = this.getDisplayURI(browser);
if (urlString == "about:blank") {
@@ -459,7 +454,7 @@ var BrowserUI = {
this._showToolbar(false);
this._editToolbar(false);
- window.addEventListener("keypress", this.closePopup, false);
+ window.addEventListener("keypress", this.closeBookmarks, false);
bookmark.hidden = true;
panelUI.hidden = true;
@@ -502,33 +497,116 @@ var BrowserUI = {
for (var i=0; i 0 || currentTags.length > 0) {
- var tagsToRemove = [];
- var tagsToAdd = [];
- var i;
- for (i=0; i 0)
- PlacesUtils.tagging.tagURI(this._uri, tagsToAdd);
- if (tagsToRemove.length > 0)
- PlacesUtils.tagging.untagURI(this._uri, tagsToRemove);
- }
-
- }
},
close : function() {
+ var bookmarkEdit = document.getElementById("bookmark-edit");
window.removeEventListener("keypress", this, true);
- document.getElementById("bookmark-form").removeEventListener("change", this, true);
-
- this._item = null;
BrowserUI.show(UIMODE_NONE);
+ BrowserUI.updateStar();
},
handleEvent: function (aEvent) {
- switch (aEvent.type) {
- case "keypress":
- if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
- document.getElementById("bookmark-close").focus();
- this.close();
- }
- break;
- case "change":
- this.save();
- break;
- }
+ if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE)
+ document.getElementById("bookmark-edit").stopEditing(true);
}
};
diff --git a/mobile/chrome/content/browser.css b/mobile/chrome/content/browser.css
index c01b3e93a43..788fe3d0b53 100644
--- a/mobile/chrome/content/browser.css
+++ b/mobile/chrome/content/browser.css
@@ -1,5 +1,5 @@
#urlbar-edit {
- -moz-binding: url("chrome://browser/content/urlbar.xml#autocomplete-aligned");
+ -moz-binding: url("chrome://browser/content/bindings.xml#autocomplete-aligned");
}
#tabs {
@@ -36,5 +36,9 @@ notification button {
}
#popup_autocomplete {
- -moz-binding: url("chrome://browser/content/urlbar.xml#popup_autocomplete");
+ -moz-binding: url("chrome://browser/content/bindings.xml#popup_autocomplete");
+}
+
+editbookmark {
+ -moz-binding: url("chrome://browser/content/bindings.xml#editbookmark");
}
diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul
index 7752c21aa1a..449b4baaebf 100644
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -334,12 +334,14 @@
-
+
-
+ onkeypress="if (event.target == this && event.keyCode == event.DOM_VK_RETURN)
+ BrowserUI.goToBookmark(this)"
+ onclose="BrowserUI.stopEditBookmark()"/>
+
-
+
@@ -351,36 +353,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/mobile/chrome/jar.mn b/mobile/chrome/jar.mn
index a4b0cc74b3d..08ba9cf3914 100644
--- a/mobile/chrome/jar.mn
+++ b/mobile/chrome/jar.mn
@@ -15,7 +15,7 @@ browser.jar:
content/browser.js (content/browser.js)
content/browser-ui.js (content/browser-ui.js)
content/commandUtil.js (content/commandUtil.js)
- content/urlbar.xml (content/urlbar.xml)
+ content/bindings.xml (content/bindings.xml)
content/tabs.xml (content/tabs.xml)
content/notification.xml (content/notification.xml)
content/browser.css (content/browser.css)
diff --git a/mobile/chrome/skin/browser.css b/mobile/chrome/skin/browser.css
index 96aa063c1f7..00a516f4a5d 100644
--- a/mobile/chrome/skin/browser.css
+++ b/mobile/chrome/skin/browser.css
@@ -353,7 +353,7 @@ toolbarbutton.panel-button {
padding: 8px;
}
-#urllist-close {
+.close-button {
-moz-appearance: none;
border: none;
margin: 0;
diff --git a/mobile/locales/en-US/chrome/browser.dtd b/mobile/locales/en-US/chrome/browser.dtd
index 367bd336d07..730ce07fdce 100644
--- a/mobile/locales/en-US/chrome/browser.dtd
+++ b/mobile/locales/en-US/chrome/browser.dtd
@@ -32,10 +32,11 @@
-
-
-
-
+
+
+
+
+