diff options
author | wei <> | 2007-01-26 02:06:46 +0000 |
---|---|---|
committer | wei <> | 2007-01-26 02:06:46 +0000 |
commit | 5a34c0337eda45f2b1342771a937fd9a029cb319 (patch) | |
tree | 9b690a21c60054c4f64677dbe14974d8bf84fc0e /demos/quickstart | |
parent | e30048fca6e6cb351f311b2dc039f31210db8eec (diff) |
add "view all comments" for quickstart comments.
Diffstat (limited to 'demos/quickstart')
-rw-r--r-- | demos/quickstart/protected/controls/Comments/CommentBlock.tpl | 3 | ||||
-rw-r--r-- | demos/quickstart/protected/controls/Comments/comments.css | 12 | ||||
-rw-r--r-- | demos/quickstart/protected/controls/Comments/comments.js | 51 | ||||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/comment.gif | bin | 0 -> 330 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/comment_add.gif | bin | 0 -> 361 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/comments.gif | bin | 0 -> 367 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/error.gif | bin | 0 -> 579 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/information.gif | bin | 0 -> 606 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/lightbulb.gif | bin | 0 -> 606 bytes | |||
-rw-r--r-- | demos/quickstart/themes/PradoSoft/style.css | 41 |
10 files changed, 83 insertions, 24 deletions
diff --git a/demos/quickstart/protected/controls/Comments/CommentBlock.tpl b/demos/quickstart/protected/controls/Comments/CommentBlock.tpl index 794e230c..56f5cb7a 100644 --- a/demos/quickstart/protected/controls/Comments/CommentBlock.tpl +++ b/demos/quickstart/protected/controls/Comments/CommentBlock.tpl @@ -9,6 +9,7 @@ <ul id="comment-nav">
<li><a href="#comment-list" style="display:none" id="show-comment-link" >View Comments</a></li>
<li><a href="#add-comment" class="active" id="add-comment-link">Add New Comment</a></li>
+ <li><a href="#comment-list" style="display:none" id="all-comments-link">View All Comments</a></li>
</ul>
<a href="javascript:;" class="right-tab" style="display:none" id="close-comments">Close</a>
<a href="#" class="right-tab" id="to-top">Top</a>
@@ -50,7 +51,7 @@ ControlToValidate="content"
ErrorMessage="*" />
</div>
- <com:TTextBox TextMode="MultiLine" ID="content" />
+ <com:TActiveTextBox TextMode="MultiLine" ID="content" />
<com:THiddenField ID="block_id" Value="top-content"/>
</div>
diff --git a/demos/quickstart/protected/controls/Comments/comments.css b/demos/quickstart/protected/controls/Comments/comments.css index fb03951f..a7cf7f33 100644 --- a/demos/quickstart/protected/controls/Comments/comments.css +++ b/demos/quickstart/protected/controls/Comments/comments.css @@ -158,12 +158,12 @@ div.block-hover margin-top: -1.95em;
}
-#comment-list .comment
+#comment-list .comment, #comment-list-edit .comment
{
margin-bottom: 2em;
}
-#comment-list .comment span
+#comment-list .comment span, #comment-list-edit .comment span
{
font-size: 0.85em;
border-bottom: 1px dotted #ccc;
@@ -171,7 +171,7 @@ div.block-hover display: block;
}
-#comment-list .comment div
+#comment-list .comment div, #comment-list-edit .comment div
{
padding: 0.5em;
@@ -223,4 +223,10 @@ div.block-hover position: absolute;
z-index: 0;
filter: Alpha(Opacity=50);
+}
+
+#comment-list .source-link, #comment-list-edit .source-link
+{
+ float: right;
+ margin-top: -1.5em;
}
\ No newline at end of file diff --git a/demos/quickstart/protected/controls/Comments/comments.js b/demos/quickstart/protected/controls/Comments/comments.js index 629694a5..46dd0a16 100644 --- a/demos/quickstart/protected/controls/Comments/comments.js +++ b/demos/quickstart/protected/controls/Comments/comments.js @@ -6,14 +6,28 @@ function show_comment_list() $('add-comment').hide();
$('show-comment-link').addClassName("active");
$('add-comment-link').removeClassName("active");
+ $('all-comments-link').removeClassName("active");
+ show_comments_in_list(currentCommentID);
}
+function show_all_comments()
+{
+ $('comment-list').show();
+ $('add-comment').hide();
+ $('show-comment-link').removeClassName("active");
+ $('add-comment-link').removeClassName("active");
+ $('all-comments-link').addClassName("active");
+ show_comments_in_list();
+}
+
+
function show_add_comment()
{
$('comment-list').hide();
$('add-comment').show();
$('show-comment-link').removeClassName("active");
$('add-comment-link').addClassName("active");
+ $('all-comments-link').removeClassName("active");
}
function hide_add_comment()
@@ -24,18 +38,8 @@ function hide_add_comment() $(currentCommentID).style.zIndex = 0;
}
-function show_comments(block)
+function show_comments_in_list(id)
{
- var id = block.id
- currentCommentID = id;
- $(hidden_block_id).value = id;
- var commentBlock = $('user-comments');
- var pos = Position.cumulativeOffset(block);
- var top = pos[1] + block.offsetHeight;
- commentBlock.style.top = top+"px";
- commentBlock.style.width = (block.offsetWidth-22)+"px";
-
- commentBlock.show();
var list = $('comment-list');
var count=0;
for(var i=0, k=list.childNodes.length; i < k; i++)
@@ -43,7 +47,7 @@ function show_comments(block) var node = list.childNodes[i];
if(node.nodeType == 1) //an element node
{
- if(node.className.indexOf(id) >= 0)
+ if(typeof(id) == "undefined" || node.className.indexOf(id) >= 0)
{
node.style.display="block"
count++;
@@ -52,8 +56,25 @@ function show_comments(block) node.style.display="none";
}
}
+ return count;
+}
+
+function show_comments(block)
+{
+ var id = block.id
+ currentCommentID = id;
+ $(hidden_block_id).value = id;
+ var commentBlock = $('user-comments');
+ var pos = Position.cumulativeOffset(block);
+ var top = pos[1] + block.offsetHeight;
+ commentBlock.style.top = top+"px";
+ commentBlock.style.width = (block.offsetWidth-22)+"px";
- list.show();
+ commentBlock.show();
+
+ var count = show_comments_in_list(id);
+
+ $('comment-list').show();
if(count > 0)
show_comment_list();
else
@@ -164,9 +185,12 @@ if(!Prado.Browser.ie) //not IE 4,5,6 $('show-comment-link').style.display="";
$('to-top').hide();
$('close-comments').show();
+ $('all-comments-link').show();
userComments.hide();
$('comments-header').hide();
+ $$('#comment-list .source-link').each(function(el){ el.hide(); });
+
$$('#content .block-content').each(function(el)
{
Event.observe(el, 'mouseover', function(e){ if(typeof(show_block)!="undefined") show_block(Event.element(e)); });
@@ -176,6 +200,7 @@ if(!Prado.Browser.ie) //not IE 4,5,6 Event.observe($('show-comment-link'), "click", function(e) { show_comment_list(); Event.stop(e); });
Event.observe($('add-comment-link'), "click", function(e) { show_add_comment(); Event.stop(e); });
+ Event.observe($('all-comments-link'), "click", function(e) { show_all_comments(); Event.stop(e); });
Event.observe($('close-comments'), "click", function(e) { hide_add_comment(); Event.stop(e); });
})();
diff --git a/demos/quickstart/themes/PradoSoft/comment.gif b/demos/quickstart/themes/PradoSoft/comment.gif Binary files differnew file mode 100644 index 00000000..413717ea --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/comment.gif diff --git a/demos/quickstart/themes/PradoSoft/comment_add.gif b/demos/quickstart/themes/PradoSoft/comment_add.gif Binary files differnew file mode 100644 index 00000000..25ca1e8e --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/comment_add.gif diff --git a/demos/quickstart/themes/PradoSoft/comments.gif b/demos/quickstart/themes/PradoSoft/comments.gif Binary files differnew file mode 100644 index 00000000..07852058 --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/comments.gif diff --git a/demos/quickstart/themes/PradoSoft/error.gif b/demos/quickstart/themes/PradoSoft/error.gif Binary files differnew file mode 100644 index 00000000..b41ea452 --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/error.gif diff --git a/demos/quickstart/themes/PradoSoft/information.gif b/demos/quickstart/themes/PradoSoft/information.gif Binary files differnew file mode 100644 index 00000000..3169faa4 --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/information.gif diff --git a/demos/quickstart/themes/PradoSoft/lightbulb.gif b/demos/quickstart/themes/PradoSoft/lightbulb.gif Binary files differnew file mode 100644 index 00000000..f52e8592 --- /dev/null +++ b/demos/quickstart/themes/PradoSoft/lightbulb.gif diff --git a/demos/quickstart/themes/PradoSoft/style.css b/demos/quickstart/themes/PradoSoft/style.css index 799dbf36..9c3489d6 100644 --- a/demos/quickstart/themes/PradoSoft/style.css +++ b/demos/quickstart/themes/PradoSoft/style.css @@ -544,22 +544,29 @@ pre code div.tip, div.info, div.note
{
- border:1px solid #0cf;
- padding:1em;
+ border-top:2px solid #0cf;
+ border-bottom:2px solid #0cf;
+ padding:1em 1em 1em 40px;
margin: 1em 2em;
- background-color: #eff;
+ border-color: #32CD32;
+ background-color: #EBFFCE;
+ background-repeat: no-repeat;
+ background-position: 10px 50%;
+ background-image: url(lightbulb.gif);
}
div.info
{
- border-color: #32CD32;
- background-color: #EBFFCE;
+ border-color: #87CEFA;
+ background-color: #EEF9FD;
+ background-image: url(information.gif);
}
div.note
{
- border-color: Orange;
+ border-color: #FFD700;
background-color: #FFF5E1;
+ background-image: url(error.gif);
}
div b.tip
@@ -607,4 +614,24 @@ div.last-modified color: #999;
margin-top: 5em;
margin-bottom: -3em;
-}
\ No newline at end of file +}
+
+#comment-nav li a#show-comment-link,
+#comment-nav li a#add-comment-link,
+#comment-nav li a#all-comments-link
+{
+ background-image: url(comment.gif);
+ background-repeat: no-repeat;
+ background-position: 7px 50%;
+ padding-left: 30px;
+}
+
+#comment-nav li a#add-comment-link
+{
+ background-image: url(comment_add.gif);
+}
+
+#comment-nav li a#all-comments-link
+{
+ background-image: url(comments.gif);
+}
|