зеркало из https://github.com/mozilla/pjs.git
Bug 514217: Apply new awesomebar format/styling to bookmarks manager, r=mfinkle
This commit is contained in:
Родитель
c39a4758b4
Коммит
56a014bd66
|
@ -479,14 +479,18 @@
|
|||
return;
|
||||
|
||||
this._isEditing = true;
|
||||
if (this.control)
|
||||
if (this.control) {
|
||||
this.setAttribute("selected", "true");
|
||||
this.control.scrollBoxObject.ensureElementIsVisible(this);
|
||||
this.control.activeItem = this;
|
||||
}
|
||||
|
||||
this.updateFields();
|
||||
|
||||
this._nameField.focus();
|
||||
if (autoSelect)
|
||||
this._nameField.select();
|
||||
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -498,8 +502,10 @@
|
|||
this.save();
|
||||
|
||||
this._isEditing = false;
|
||||
if (this.control)
|
||||
if (this.control) {
|
||||
this.control.activeItem.removeAttribute("selected");
|
||||
this.control.activeItem = null;
|
||||
}
|
||||
|
||||
this.updateFields();
|
||||
|
||||
|
@ -533,6 +539,7 @@
|
|||
if (tagsToRemove.length > 0)
|
||||
PlacesUtils.tagging.untagURI(this._uri, tagsToRemove);
|
||||
}
|
||||
this.setAttribute('tags', this.tags);
|
||||
|
||||
// If the URI was updated change it in the bookmark, but don't
|
||||
// allow a blank URI. Revert to previous URI if blank.
|
||||
|
@ -541,6 +548,7 @@
|
|||
try {
|
||||
this._uri = this._ioService.newURI(spec, null, null);
|
||||
PlacesUtils.bookmarks.changeBookmarkURI(this._itemId, this._uri);
|
||||
this.setAttribute('uri', this.spec);
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
|
@ -550,6 +558,7 @@
|
|||
|
||||
// Update the name and use the URI if name is blank
|
||||
this.name = this.name || spec;
|
||||
this.setAttribute('title', this.name);
|
||||
PlacesUtils.bookmarks.setItemTitle(this._itemId, this.name);
|
||||
]]>
|
||||
</body>
|
||||
|
@ -606,84 +615,63 @@
|
|||
</binding>
|
||||
|
||||
<binding id="place-item" extends="chrome://browser/content/bindings.xml#place-base">
|
||||
<content>
|
||||
<xul:image anonid="favicon" class="bookmark-item-image"/>
|
||||
<xul:grid flex="1">
|
||||
<xul:columns>
|
||||
<xul:column flex="1"/>
|
||||
<xul:column/>
|
||||
</xul:columns>
|
||||
<xul:rows>
|
||||
<xul:row align="center">
|
||||
<xul:textbox anonid="name" readonly="true" xbl:inherits="value=title"/>
|
||||
<xul:hbox align="center" anonid="edit-controls" class="bookmark-manage-controls">
|
||||
<xul:image anonid="close-button" class="close-button"
|
||||
onmousedown="document.getBindingParent(this).remove()"/>
|
||||
<xul:button anonid="folder-button" label="&editBookmarkMove.label;"
|
||||
oncommand="document.getBindingParent(this).move()"/>
|
||||
<xul:button anonid="edit-button" label="&editBookmarkEdit.label;"
|
||||
oncommand="document.getBindingParent(this).startEditing()"/>
|
||||
<xul:button anonid="done-button" label="&editBookmarkDone.label;" hidden="true"
|
||||
oncommand="document.getBindingParent(this).stopEditing(true)"/>
|
||||
</xul:hbox>
|
||||
</xul:row>
|
||||
<xul:row anonid="uri-row" align="center" hidden="true">
|
||||
<content align="center">
|
||||
<xul:hbox flex="1">
|
||||
<xul:image anonid="favicon" class="bookmark-item-image"/>
|
||||
|
||||
<xul:vbox flex="1">
|
||||
<xul:hbox anonid="description-box" flex="1" align="center">
|
||||
<xul:vbox flex="1">
|
||||
<xul:label class="bookmark-item-name" xbl:inherits="value=title"/>
|
||||
<xul:label class="bookmark-item-uri" xbl:inherits="value=uri" crop="center"/>
|
||||
</xul:vbox>
|
||||
<xul:label class="bookmark-item-tags" xbl:inherits="value=tags"/>
|
||||
</xul:hbox>
|
||||
|
||||
<xul:vbox flex="1" anonid="bookmark-edit-textboxes" class="bookmark-edit-textboxes" hidden="true">
|
||||
<xul:textbox anonid="name" xbl:inherits="value=title"/>
|
||||
<xul:textbox anonid="uri" xbl:inherits="value=uri"/>
|
||||
</xul:row>
|
||||
<xul:row anonid="tags-row" align="center" hidden="true">
|
||||
<xul:textbox anonid="tags" xbl:inherits="value=tags" emptytext="&editBookmarkTags.label;"/>
|
||||
</xul:row>
|
||||
</xul:rows>
|
||||
</xul:grid>
|
||||
</xul:vbox>
|
||||
|
||||
<xul:hbox anonid="bookmark-manage-controls" align="center" class="bookmark-manage-controls" hidden="true">
|
||||
<xul:button anonid="close-button" class="bookmark-close-button"
|
||||
label="&editBookmarkRemove.label;" onmousedown="document.getBindingParent(this).remove()"/>
|
||||
<xul:button anonid="folder-button" class="bookmark-folder-button"
|
||||
label="&editBookmarkMove.label;" oncommand="document.getBindingParent(this).move()"/>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button anonid="done-button" label="&editBookmarkDone.label;"
|
||||
oncommand="document.getBindingParent(this).stopEditing(true)"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<method name="updateFields">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this._nameField.readOnly = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "edit-button").hidden = this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "done-button").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "description-box").hidden = this._isEditing;
|
||||
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "uri-row").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "tags-row").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "bookmark-edit-textboxes").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "bookmark-manage-controls").hidden = !this._isEditing;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="place-folder" extends="chrome://browser/content/bindings.xml#place-base">
|
||||
<content align="center">
|
||||
<xul:image anonid="favicon" class="bookmark-folder-image"/>
|
||||
<xul:grid flex="1">
|
||||
<xul:columns>
|
||||
<xul:column flex="1"/>
|
||||
<xul:column/>
|
||||
</xul:columns>
|
||||
<xul:rows>
|
||||
<xul:row align="center">
|
||||
<xul:textbox anonid="name" readonly="true" xbl:inherits="value=title"/>
|
||||
<xul:hbox align="center" anonid="edit-controls" class="bookmark-manage-controls">
|
||||
<xul:image anonid="close-button" class="close-button"
|
||||
onmousedown="document.getBindingParent(this).remove()"/>
|
||||
<xul:button anonid="folder-button" label="&editBookmarkMove.label;"
|
||||
oncommand="document.getBindingParent(this).move()"/>
|
||||
<xul:button anonid="edit-button" label="&editBookmarkEdit.label;"
|
||||
oncommand="document.getBindingParent(this).startEditing()"/>
|
||||
<xul:button anonid="done-button" label="&editBookmarkDone.label;" hidden="true"
|
||||
oncommand="document.getBindingParent(this).stopEditing(true)"/>
|
||||
</xul:hbox>
|
||||
</xul:row>
|
||||
</xul:rows>
|
||||
</xul:grid>
|
||||
</content>
|
||||
<binding id="place-folder" extends="chrome://browser/content/bindings.xml#place-item">
|
||||
<implementation>
|
||||
<method name="updateFields">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this._nameField.readOnly = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "edit-button").hidden = this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "done-button").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "description-box").hidden = this._isEditing;
|
||||
|
||||
this._uriField.hidden = true;
|
||||
this._tagsField.hidden = true;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "bookmark-edit-textboxes").hidden = !this._isEditing;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "bookmark-manage-controls").hidden = !this._isEditing;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -920,9 +908,14 @@
|
|||
<parameter name="aItem"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aEvent.target.isEditing || aEvent.originalTarget.localName == "button")
|
||||
if (aEvent.originalTarget.localName == "button" || this._activeItem == aItem)
|
||||
return;
|
||||
|
||||
if (this._manageUI) {
|
||||
aItem.startEditing();
|
||||
return;
|
||||
}
|
||||
|
||||
if (aItem.type == "folder") {
|
||||
this.openFolder(aItem.itemId);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<!ENTITY bookmarksManage.label "Manage">
|
||||
<!ENTITY foldersHeader.label "Folders">
|
||||
|
||||
<!ENTITY editBookmarkEdit.label "Edit">
|
||||
<!ENTITY editBookmarkRemove.label "Remove">
|
||||
<!ENTITY editBookmarkMove.label "Move">
|
||||
<!ENTITY editBookmarkDone.label "Done">
|
||||
<!ENTITY editBookmarkTags.label "Add tags here">
|
||||
|
|
|
@ -460,44 +460,72 @@ toolbarbutton.page-button {
|
|||
}
|
||||
|
||||
.bookmark-folder, .bookmark-item {
|
||||
padding: 0.5mm 0.2mm;
|
||||
padding: 0.5mm 1.1mm;
|
||||
border-bottom: 0.1mm solid rgb(207,207,207);
|
||||
min-height: 14.4mm; /* row size */
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
.bookmark-folder textbox[readonly="true"], .bookmark-item textbox[readonly="true"] {
|
||||
-moz-appearance: none !important;
|
||||
background-color: transparent;
|
||||
border: none !important;
|
||||
-moz-user-select: none !important;
|
||||
.bookmark-manage-controls {
|
||||
padding-top: 1.1mm;
|
||||
padding-bottom: 1.1mm;
|
||||
}
|
||||
|
||||
.bookmark-edit-textboxes {
|
||||
padding-top: 1.1mm;
|
||||
}
|
||||
|
||||
.bookmark-item-image {
|
||||
max-height: 16px;
|
||||
max-width: 16px;
|
||||
margin: 1.6mm 4mm 5mm 2mm;
|
||||
}
|
||||
|
||||
placeitem[selected] .bookmark-item-image {
|
||||
margin-top: 4mm;
|
||||
}
|
||||
|
||||
.bookmark-item-name {
|
||||
font-size: 15.75pt !important;
|
||||
}
|
||||
|
||||
.bookmark-item-uri {
|
||||
font-size: 10pt !important;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.bookmark-item-tags {
|
||||
color: black;
|
||||
margin-right: 2.2mm;
|
||||
font-size: 11.75pt !important;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
placelabel.bookmark-folder {
|
||||
border-bottom: 0.1mm solid rgb(255,255,255);
|
||||
}
|
||||
|
||||
.bookmark-item-image, .bookmark-folder-image {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
/* folders have a fixed image */
|
||||
.bookmark-folder-image {
|
||||
placeitem[type=folder] .bookmark-item-image {
|
||||
list-style-image: url("chrome://browser/skin/images/folder-30.png");
|
||||
}
|
||||
|
||||
/* hide the unuseful fields for folder */
|
||||
placeitem[type=folder] .bookmark-item-uri,
|
||||
placeitem[type=folder] .bookmark-item-tags {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* control the manage controls */
|
||||
.bookmark-manage-controls, .bookmark-folder-new {
|
||||
.bookmark-folder-new {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
placelist[ui="manage"] .bookmark-manage-controls,
|
||||
placelist[ui="manage"] .bookmark-folder-new,
|
||||
placeitem[ui="manage"] .bookmark-manage-controls {
|
||||
placelist[ui="manage"] .bookmark-folder-new {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
placeitem[ui="manage"] .bookmark-close-button,
|
||||
placeitem[ui="manage"] .bookmark-folder-button,
|
||||
placeitem[ui="manage"] .bookmark-item-image {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,10 @@ textbox {
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
textbox[isempty="true"] {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/* panels ------------------------------------------------------------------ */
|
||||
.panel-dark {
|
||||
color: white;
|
||||
|
|
|
@ -242,7 +242,7 @@
|
|||
}
|
||||
|
||||
/* folders have a fixed image */
|
||||
.bookmark-folder-image {
|
||||
placeitem[type=folder] .bookmark-item-image {
|
||||
list-style-image: url("chrome://browser/skin/images/folder-30.png");
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@
|
|||
}
|
||||
|
||||
/* folders have a fixed image */
|
||||
.bookmark-folder-image {
|
||||
placeitem[type=folder] .bookmark-item-image {
|
||||
list-style-image: url("chrome://browser/skin/images/folder-24.png");
|
||||
}
|
||||
|
||||
|
|
|
@ -247,39 +247,67 @@ toolbarbutton.page-button {
|
|||
}
|
||||
|
||||
.bookmark-folder, .bookmark-item {
|
||||
padding: 0.25mm 0.1mm;
|
||||
padding: 0.25mm 0.55mm;
|
||||
border-bottom: 0.05mm solid rgb(207,207,207);
|
||||
min-height: 7.2mm; /* row size */
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
.bookmark-folder textbox[readonly="true"], .bookmark-item textbox[readonly="true"] {
|
||||
-moz-appearance: none !important;
|
||||
background-color: transparent;
|
||||
border: none !important;
|
||||
-moz-user-select: none !important;
|
||||
.bookmark-manage-controls {
|
||||
padding-top: 0.55mm;
|
||||
padding-bottom: 0.55mm;
|
||||
}
|
||||
|
||||
.bookmark-edit-textboxes {
|
||||
padding-top: 0.55mm;
|
||||
}
|
||||
|
||||
.bookmark-item-image {
|
||||
max-height: 16px;
|
||||
max-width: 16px;
|
||||
margin: 1.6mm 1.5mm 0mm 2mm;
|
||||
}
|
||||
|
||||
placeitem[selected] .bookmark-item-image {
|
||||
margin-top: 3mm;
|
||||
}
|
||||
|
||||
.bookmark-item-name {
|
||||
font-size: 9pt !important;
|
||||
}
|
||||
|
||||
.bookmark-item-uri {
|
||||
font-size: 8pt !important;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.bookmark-item-tags {
|
||||
color: black;
|
||||
margin-right: 1.1mm;
|
||||
font-size: 8pt !important;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
placelabel.bookmark-folder {
|
||||
border-bottom: 0.05mm solid rgb(255,255,255);
|
||||
}
|
||||
|
||||
.bookmark-item-image, .bookmark-folder-image {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
/* hide the unuseful fields for folder */
|
||||
placeitem[type=folder] .bookmark-item-uri,
|
||||
placeitem[type=folder] .bookmark-item-tags {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* control the manage controls */
|
||||
.bookmark-manage-controls, .bookmark-folder-new {
|
||||
.bookmark-folder-new {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
placelist[ui="manage"] .bookmark-manage-controls,
|
||||
placelist[ui="manage"] .bookmark-folder-new,
|
||||
placeitem[ui="manage"] .bookmark-manage-controls {
|
||||
placelist[ui="manage"] .bookmark-folder-new {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
placeitem[ui="manage"] .bookmark-close-button,
|
||||
placeitem[ui="manage"] .bookmark-folder-button,
|
||||
placeitem[ui="manage"] .bookmark-item-image {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,10 @@ textbox {
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
textbox[isempty="true"] {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/* panels ------------------------------------------------------------------ */
|
||||
.panel-dark {
|
||||
color: white;
|
||||
|
|
Загрузка…
Ссылка в новой задаче