3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title><%= APPTITLE %></title>
5 <link rel="stylesheet" href="./erbtemp/stylesheet.css" type="text/css">
6 <% unless cgi.user_agent =~ /(iPod|iPhone|iPad)/ %>
7 <link rel="stylesheet" type="text/css" href="./yui/build/menu/assets/skins/sam/menu.css" />
8 <link rel="stylesheet" type="text/css" href="./yui/build/button/assets/skins/sam/button.css" />
9 <link rel="stylesheet" type="text/css" href="./yui/build/fonts/fonts-min.css" />
10 <link rel="stylesheet" type="text/css" href="./yui/build/container/assets/skins/sam/container.css" />
11 <link rel="stylesheet" type="text/css" href="./yui/build/editor/assets/skins/sam/editor.css" />
12 <script type="text/javascript" src="./yui/build/yahoo-dom-event/yahoo-dom-event.js">
14 <script type="text/javascript" src="./yui/build/animation/animation-min.js">
16 <script type="text/javascript" src="./yui/build/element/element-min.js">
18 <script type="text/javascript" src="./yui/build/container/container-min.js">
20 <script type="text/javascript" src="./yui/build/menu/menu-min.js">
22 <script type="text/javascript" src="./yui/build/button/button-min.js">
24 <script type="text/javascript" src="./yui/build/editor/editor-min.js">
28 var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event;
40 YAHOO.log('Set state to off..', 'info', 'example');
42 YAHOO.log('Create the Editor..', 'info', 'example');
43 var myEditor = new YAHOO.widget.Editor('contenteditor', myConfig);
44 myEditor.on('toolbarLoaded', function(){
47 label: 'Edit HTML Code',
50 YAHOO.log('Create the (editcode) Button', 'info', 'example');
51 this.toolbar.addButtonToGroup(codeConfig, 'insertitem');
53 this.toolbar.on('editcodeClick', function(){
54 var ta = this.get('element'), iframe = this.get('iframe').get('element');
58 this.toolbar.set('disabled', false);
59 YAHOO.log('Show the Editor', 'info', 'example');
60 YAHOO.log('Inject the HTML from the textarea into the editor', 'info', 'example');
61 this.setEditorHTML(ta.value);
62 if (!this.browser.ie) {
63 this._setDesignMode('on');
66 Dom.removeClass(iframe, 'editor-hidden');
67 Dom.addClass(ta, 'editor-hidden');
73 YAHOO.log('Show the Code Editor', 'info', 'example');
75 YAHOO.log('Save the Editors HTML', 'info', 'example');
76 Dom.addClass(iframe, 'editor-hidden');
77 Dom.removeClass(ta, 'editor-hidden');
78 this.toolbar.set('disabled', true);
79 this.toolbar.getButtonByValue('editcode').set('disabled', false);
80 this.toolbar.selectButton('editcode');
81 this.dompath.innerHTML = 'Editing HTML Code';
87 this.on('cleanHTML', function(ev){
88 YAHOO.log('cleanHTML callback fired..', 'info', 'example');
89 this.get('element').value = ev.html;
92 this.on('afterRender', function(){
93 var wrapper = this.get('editor_wrapper');
94 wrapper.appendChild(this.get('element'));
95 this.setStyle('width', '100%');
96 this.setStyle('height', '100%');
97 this.setStyle('visibility', '');
98 this.setStyle('top', '');
99 this.setStyle('left', '');
100 this.setStyle('position', '');
102 this.addClass('editor-hidden');
109 function switchsubmit(form, action){
110 document.getElementsByName("action").item(0).value = action;
115 .yui-skin-sam .yui-toolbar-container .yui-toolbar-editcode span.yui-toolbar-icon {
116 background-image: url( ./yui/assets/html_editor.gif );
117 background-position: 0 1px;
121 .yui-skin-sam .yui-toolbar-container .yui-button-editcode-selected span.yui-toolbar-icon {
122 background-image: url( ./yui/assets/html_editor.gif );
123 background-position: 0 1px;
142 <body class="yui-skin-sam">
146 <div class="divstyle" style="width: <%= TABLEWIDTH %>px;">
147 <form action="<%= cgi.script_name %>" method="POST">
148 <input type="hidden" name="target_filepath" value="<%= session["target_filepath"] %>"><% case params["action"]
150 <input type="hidden" name="editid" value="<%= session["editid"] %>">
151 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
154 <td colspan="2" class="formheader">
159 entry = db["editentry"]
160 entry.paramlist.each do |val| %>
161 <tr style="display: <%= entry.display[val] %>;">
162 <td class="formnavi" style="width: 140px;">
163 <%= entry.name[val] %>
165 <td class="forminput">
166 <input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
173 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'exec')"><% when "exec" %>
174 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px">
177 <td class="forminput" style="text-align: center;">
184 <a href="<%= cgi.script_name %>">メニューに戻る</a>
186 <input type="hidden" name="editid" value="<%= session["editid"] %>">
187 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
190 <td colspan="2" class="formheader">
196 entry = db["editentry"]
197 entry.paramlist.each do |val| %>
198 <tr style="display: <%= entry.display[val] %>;">
199 <td class="formnavi" style="width: 140px;">
200 <%= entry.name[val] %>
202 <td class="forminput">
203 <% if val == "content" %>
204 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
205 <% elsif val == "updated" %>
206 <input type="text" name="<%= val %>" value="<%= Time.now.iso8601 %>" style="width: 100%;"><% else %>
207 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%;"><% end %>
214 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="confirm"><input type="submit" value="確認"><% when "back" %>
215 <input type="hidden" name="editid" value="<%= session["editid"] %>">
216 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
219 <td colspan="2" class="formheader">
225 entry = db["editentry"]
226 entry.paramlist.each do |val| %>
227 <tr style="display: <%= entry.display[val] %>;">
228 <td class="formnavi" style="width: 140px;">
229 <%= entry.name[val] %>
231 <td class="forminput">
232 <% if val == "content" %>
233 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
235 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%;"><% end %>
242 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="confirm"><input type="submit" class="wymupdate" value="確認"><% else %>
243 <% db.transaction do %>
244 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
247 <td class="formheader" colspan="3">
252 <td class="formheader">
255 <td class="formheader" style="text-align: center;">
258 <td class="formheader" style="text-align: center;">
262 <% db["entry"].each_with_index do |entry, i| %>
264 <td class="forminput" style="width: 30px; text-align: center;">
265 <input type="radio" name="editid" value="<%= entry.send("entryid") %>">
267 <td class="forminput">
268 <%= entry.send("title") %>
270 <td class="forminput" style="width: 150px; text-align: center;">
271 <%= entry.send("published").gsub("+09:00", "").gsub("T", " ") %>
278 <% if db["entry"].length != 0 %>
279 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="edit"><input type="submit" value="編集"><% else %>
289 <div class="divstyle" style="border: none;">