Permalink
Browse files

* add help links.

  • Loading branch information...
1 parent 3a8ab9d commit 58164894cdc371a99db7727c12f72d9633a27c50 @kou committed Mar 17, 2009
@@ -12,8 +12,15 @@
<%
if @content.language == "ja"
ruby_plugin = ",ruby"
+ ruby_help_toolbar_item = ",
+ {
+ text: #{document_page_title('ruby').to_json},
+ href: #{ruby_document_path.to_json}
+ }
+"
else
ruby_plugin = ""
+ ruby_help_toolbar_item = ""
end
-%>
<%= javascript_tag(<<-EOC
@@ -26,6 +33,15 @@ Ext.onReady(function() {
"-"
]
toolbar = toolbar.concat(#{content_edit_toolbar_data(@content).to_json});
+ toolbar = toolbar.concat([
+ "-",
+ #{t("Usage").to_json} + ":",
+ {
+ text: #{document_page_title('image').to_json},
+ href: #{image_upload_document_path.to_json}
+ }
+ #{ruby_help_toolbar_item}
+ ]);
toolbarItemsSetLinkHandler(toolbar);
content = new Ext.Panel({
@@ -50,7 +66,7 @@ Ext.onReady(function() {
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,|,forecolor,backcolor",
+ theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "styleprops,|#{ruby_plugin},cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak",
theme_advanced_toolbar_location : "top",
@@ -1,10 +1,12 @@
+<% tbar ||= [].to_json %>
<%= javascript_tag(<<-EOC
Ext.onReady(function() {
content = new Ext.Panel({
title: #{document_page_title(controller.action_name).to_json},
region: 'center',
contentEl: #{content_element_id.to_json},
- autoScroll: true
+ autoScroll: true,
+ tbar: #{tbar}
});
});
EOC
@@ -55,4 +55,33 @@
</div>
<%= render(:partial => "panel",
- :locals => {:content_element_id => "experienced-usage"}) %>
+ :locals => {
+ :content_element_id => "experienced-usage",
+ :tbar => "
+ [
+ {
+ text: #{document_page_title('usage').to_json},
+ handler: function () {
+ document.location = #{general_usage_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('image').to_json},
+ handler: function () {
+ document.location = #{image_upload_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ruby').to_json},
+ handler: function () {
+ document.location = #{ruby_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ftp').to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ }
+ ]",
+ }) %>
@@ -94,4 +94,34 @@
</div>
<%= render(:partial => "panel",
- :locals => {:content_element_id => "ftp-upload"}) %>
+ :locals => {
+ :content_element_id => "ftp-upload",
+ :tbar => "
+ [
+ {
+ text: #{t('Site Admin').to_json},
+ handler: function () {
+ document.location = #{site_path(Site.default).to_json};
+ }
+ },
+ '-',
+ {
+ text: #{document_page_title('usage').to_json},
+ handler: function () {
+ document.location = #{general_usage_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('image').to_json},
+ handler: function () {
+ document.location = #{image_upload_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ruby').to_json},
+ handler: function () {
+ document.location = #{ruby_document_path.to_json};
+ }
+ }
+ ]",
+ }) %>
@@ -98,4 +98,27 @@
</div>
<%= render(:partial => "panel",
- :locals => {:content_element_id => "image-upload"}) %>
+ :locals => {
+ :content_element_id => "image-upload",
+ :tbar => "
+ [
+ {
+ text: #{document_page_title('usage').to_json},
+ handler: function () {
+ document.location = #{general_usage_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ruby').to_json},
+ handler: function () {
+ document.location = #{ruby_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ftp').to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ }
+ ]",
+ }) %>
@@ -40,4 +40,27 @@
</div>
<%= render(:partial => "panel",
- :locals => {:content_element_id => "ruby"}) %>
+ :locals => {
+ :content_element_id => "ruby",
+ :tbar => "
+ [
+ {
+ text: #{document_page_title('usage').to_json},
+ handler: function () {
+ document.location = #{general_usage_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('image').to_json},
+ handler: function () {
+ document.location = #{image_upload_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ftp').to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ }
+ ]",
+ }) %>
@@ -221,4 +221,27 @@
</div>
<%= render(:partial => "panel",
- :locals => {:content_element_id => "usage"}) %>
+ :locals => {
+ :content_element_id => "usage",
+ :tbar => "
+ [
+ {
+ text: #{document_page_title('image').to_json},
+ handler: function () {
+ document.location = #{image_upload_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ruby').to_json},
+ handler: function () {
+ document.location = #{ruby_document_path.to_json};
+ }
+ },
+ {
+ text: #{document_page_title('ftp').to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ }
+ ]",
+ }) %>
@@ -34,6 +34,13 @@ Ext.onReady(function() {
contentEl: 'site-form',
tbar: [
{
+ text: #{t("Usage").to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ },
+ "-",
+ {
text: #{t("Show").to_json},
handler: function () {
document.location = #{site_path(@site).to_json};
@@ -63,6 +63,13 @@ Ext.onReady(function() {
autoScroll: true,
tbar: [
{
+ text: #{t("Usage").to_json},
+ handler: function () {
+ document.location = #{ftp_upload_document_path.to_json};
+ }
+ },
+ "-",
+ {
text: #{t("Edit").to_json},
handler: function () {
document.location = #{edit_site_path(@site).to_json};

0 comments on commit 5816489

Please sign in to comment.