Skip to content

Commit 789eaad

Browse files
committed
4.0-style dashlet titlebar actions for Site Blog Dashlet
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Site Blog Dashlet@1185 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent a25b502 commit 789eaad

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed
Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
<script type="text/javascript">//<![CDATA[
2-
new Alfresco.dashlet.SiteBlog("${args.htmlid}").setOptions(
2+
var dashlet = new Alfresco.dashlet.SiteBlog("${args.htmlid}").setOptions(
33
{
44
"siteId": "${page.url.templateArgs.site!''}"
55
}).setMessages(
66
${messages}
77
);
88
new Alfresco.widget.DashletResizer("${args.htmlid}", "${instance.object.id}");
9+
10+
var createPostEvent = new YAHOO.util.CustomEvent("onDashletCreatePost");
11+
createPostEvent.subscribe(dashlet.onCreatePostClick, dashlet, true);
12+
13+
new Alfresco.widget.DashletTitleBarActions("${args.htmlid}").setOptions(
14+
{
15+
actions:
16+
[
17+
<#if userIsSiteContributor>
18+
{
19+
cssClass: "createPost",
20+
eventOnClick: createPostEvent,
21+
tooltip: "${msg("dashlet.createBlogPost.tooltip")?js_string}"
22+
},
23+
</#if>
24+
{
25+
cssClass: "help",
26+
bubbleOnClick:
27+
{
28+
message: "${msg("dashlet.help")?js_string}"
29+
},
30+
tooltip: "${msg("dashlet.help.tooltip")?js_string}"
31+
}
32+
]
33+
});
934
//]]></script>
1035

1136
<div class="dashlet site-blog-posts">
1237
<div class="title">${msg("header.siteBlog")}</div>
13-
<#if userIsSiteContributor>
14-
<div class="toolbar">
15-
<a id="${args.htmlid}-createPost-link" class="theme-color-1" title="${msg('list.createLink')}" href="${url.context}/page/site/${page.url.templateArgs.site}/blog-postedit">${msg("list.createLink")}</a>
16-
</div>
17-
</#if>
1838
<div class="body scrollableList" id="${args.htmlid}-body" <#if args.height??>style="height: ${args.height}px;"</#if>>
1939
</div>
2040
</div>

config/alfresco/site-webscripts/org/alfresco/components/dashlets/site-blog.get.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ message.unsavedChanges.blog=You have unsaved text in the blog post dialogue
77
message.savedDraft=Saved draft post successfully
88
message.posted=Blog entry posted successfully
99
message.postExternalFailure=Blog entry was posted successfully but could not be published externally
10-
message.postFailure=Failed to save blog post
10+
message.postFailure=Failed to save blog post
11+
dashlet.help=This dashlet displays recent blog entries within the site. If you have Contributor permission then you can also create new blog posts directly from the dashlet.
12+
dashlet.createBlogPost.tooltip=Create Blog Post

source/web/components/dashlets/site-blog.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@
2121
.site-blog-posts h4
2222
{
2323
margin-bottom: 0.25em;
24+
}
25+
26+
.site-blog-posts .titleBarActions .createPost
27+
{
28+
background-image: url("../images/new-blog-16.png");
2429
}

source/web/components/dashlets/site-blog.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@
132132
{
133133
// The body container
134134
this.bodyContainer = Dom.get(this.id + "-body");
135-
136-
Event.addListener(this.id + "-createPost-link", "click", this.onCreatePostClick, this, true);
137135
this.loadPosts();
138136
},
139137

0 commit comments

Comments
 (0)