made changes in UI

git-svn-id: file:///tmp/snv/trunk@13 12951d8a-c33d-4b7c-b961-822215c816e1
master
Abhinav Sarkar 2008-12-05 13:35:41 +00:00
parent cd689e8948
commit fc0419fc57
5 changed files with 27 additions and 61 deletions

View File

@ -176,7 +176,6 @@ var DiggSidebar = {
for (attr in attributes) for (attr in attributes)
li.setAttribute(attr, attributes[attr]); li.setAttribute(attr, attributes[attr]);
if (DiggSidebar.storyIds.indexOf(story.id) != -1) li.new = false;
li.read = story.read; li.read = story.read;
} }
if (DiggSidebar.storyIds.indexOf(story.id) == -1) newStoryIds.push(story.id); if (DiggSidebar.storyIds.indexOf(story.id) == -1) newStoryIds.push(story.id);

View File

@ -9,15 +9,12 @@
<stylesheet src="chrome://diggsidebar/skin/diggsidebar.css"/> <stylesheet src="chrome://diggsidebar/skin/diggsidebar.css"/>
</resources> </resources>
<content> <content>
<xul:vbox> <xul:vbox flex="1">
<html:div class="storyHeader"> <xul:vbox class="storyHeader" flex="1">
<html:span class="storyNew" title="New">New</html:span> <xul:label xbl:inherits="xbl:text=title" class="storyTitle"/>
<html:span class="storyRead" title="Unread">Unread</html:span> </xul:vbox>
<html:img src="chrome://diggsidebar/content/image/up.jpg" class="storyCEIcon" /> <xul:vbox class="storyDetails" flex="1">
<html:span xbl:inherits="xbl:text=title" class="storyTitle"></html:span> <html:div class="storyCategory">
</html:div>
<html:div class="storyDetails">
<html:div>
<html:span xbl:inherits="xbl:text=container" class="storyContainer"></html:span> &gt; <html:span xbl:inherits="xbl:text=container" class="storyContainer"></html:span> &gt;
<html:span xbl:inherits="xbl:text=topic" class="storyTopic"></html:span> / <html:span xbl:inherits="xbl:text=topic" class="storyTopic"></html:span> /
<html:span xbl:inherits="xbl:text=status" class="storyStatus"></html:span> <html:span xbl:inherits="xbl:text=status" class="storyStatus"></html:span>
@ -48,7 +45,7 @@
onclick="DiggSidebar.Utils.openUrlInTab(this.href); return false"></html:a> onclick="DiggSidebar.Utils.openUrlInTab(this.href); return false"></html:a>
<html:span xbl:inherits="xbl:text=date" class="storyDate"></html:span> <html:span xbl:inherits="xbl:text=date" class="storyDate"></html:span>
</html:div> </html:div>
</html:div> </xul:vbox>
</xul:vbox> </xul:vbox>
</content> </content>
<implementation> <implementation>
@ -56,39 +53,20 @@
<![CDATA[ <![CDATA[
this.d = {}; this.d = {};
this.d.read = false; this.d.read = false;
this.d.new = true;
this.d.collapsed = true; this.d.collapsed = true;
]]> ]]>
</constructor> </constructor>
<property name="read" <property name="read"
onget="return this.d.read;" onget="return this.d.read;"
onset="this.d.read = val; if(val==true) this.markAsRead();"/> onset="this.d.read = val; if(val==true) this.markAsRead();"/>
<property name="new"
onget="return this.d.new;"
onset="this.d.new = val; if(val==false) this.markAsOld();"/>
<property name="collapsed" <property name="collapsed"
onget="return this.d.collapsed;" onget="return this.d.collapsed;"
onset="this.d.collapsed = val;"/> onset="this.d.collapsed = val;"/>
<method name="markAsRead"> <method name="markAsRead">
<body> <body>
<![CDATA[ <![CDATA[
with (document.getAnonymousElementByAttribute(this, "class", "storyRead")) { with (document.getAnonymousElementByAttribute(this, "class", "storyTitle")) {
style.backgroundColor = "black"; style.color = "#333333";
style.color = "white";
title = "Read";
textContent = "Read";
}
]]>
</body>
</method>
<method name="markAsOld">
<body>
<![CDATA[
with (document.getAnonymousElementByAttribute(this, "class", "storyNew")) {
style.backgroundColor = "black";
style.color = "white";
title = "Old";
textContent = "Old";
} }
]]> ]]>
</body> </body>
@ -96,8 +74,6 @@
<method name="showDescription"> <method name="showDescription">
<body> <body>
<![CDATA[ <![CDATA[
document.getAnonymousElementByAttribute(this, "class", "storyCEIcon").src =
"chrome://diggsidebar/content/image/down.jpg";
document.getAnonymousElementByAttribute(this, "class", "storyDetails").style.display = 'block'; document.getAnonymousElementByAttribute(this, "class", "storyDetails").style.display = 'block';
this.read = true; this.read = true;
this.collapsed = false; this.collapsed = false;
@ -107,8 +83,6 @@
<method name="hideDescription"> <method name="hideDescription">
<body> <body>
<![CDATA[ <![CDATA[
document.getAnonymousElementByAttribute(this, "class", "storyCEIcon").src =
"chrome://diggsidebar/content/image/up.jpg";
document.getAnonymousElementByAttribute(this, "class", "storyDetails").style.display = 'none'; document.getAnonymousElementByAttribute(this, "class", "storyDetails").style.display = 'none';
this.collapsed = true; this.collapsed = true;
]]> ]]>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

View File

@ -6,20 +6,16 @@ a {
a img { a img {
border: none; border: none;
} }
#dsStoryListBox { .storyHeader {
margin: 1px; cursor: pointer;
border-style: solid !important; padding: 1px;
border-color: #000;
border-width: 1px;
} }
.storyDetails { .storyDetails {
padding: 3px; padding: 3px;
display: none; display: none;
background-color: #ffffff; background-color: #ffffff;
clear: both; clear: both;
border: 1px dashed black; margin: 0px 5px 5px 5px;
margin: 0px 8px 8px 8px;
width: 230px;
} }
.storyDetails > div { .storyDetails > div {
clear: both; clear: both;
@ -27,19 +23,18 @@ a img {
font-size: x-small; font-size: x-small;
} }
.storyTitle { .storyTitle {
padding: 0px 5px;
font-size: x-small; font-size: x-small;
font-weight: bold; font-weight: bold;
width: 100%; width: 100%;
color: #105CB6;
} }
.storyNew, .storyRead, .storyPopularity { .storyCategory {
background-color: rgb(252,243,164);
text-align: center;
}
.storyPopularity {
float: right; float: right;
} }
.storyNew, .storyRead {
padding: 0px 2px;
font-size: xx-small;
font-family: monospace;
}
.storyHref { .storyHref {
font-weight: bold; font-weight: bold;
padding: 2px 3px; padding: 2px 3px;
@ -48,27 +43,25 @@ a img {
.storyDesc { .storyDesc {
height: auto!important; height: auto!important;
} }
.storyHeader {
cursor: pointer;
padding: 2px;
width: 250px;
}
.storyHref:hover, .storyUserLink:hover { .storyHref:hover, .storyUserLink:hover {
color: white; color: white;
background-color: blue; background-color: blue;
} }
#dsStoryListBox richlistitem{ #dsStoryListBox richlistitem{
border-bottom: 1px solid black; border: 2px solid #E5ECF3;
border-top: none;
color: #000000!important; color: #000000!important;
-moz-binding: url("chrome://diggsidebar/content/diggstory.xml#diggstoryitem"); -moz-binding: url("chrome://diggsidebar/content/diggstory.xml#diggstoryitem");
} }
richlistitem[selected="true"] { richlistitem[selected="true"] {
background-color: #FFEBF0; background-color: #E5ECF3;
color: inherit; color: inherit;
} }
richlistitem .storyTitle:hover { .storyHeader:hover {
background-color: green; background-color: rgb(252,243,164);
color: white; }
.storyHeader:hover .storyTitle{
color: #000;
} }