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 <link rel="stylesheet" type="text/css" href="./yui/build/menu/assets/skins/sam/menu.css" />
7 <link rel="stylesheet" type="text/css" href="./yui/build/button/assets/skins/sam/button.css" />
8 <link rel="stylesheet" type="text/css" href="./yui/build/fonts/fonts-min.css" />
9 <link rel="stylesheet" type="text/css" href="./yui/build/container/assets/skins/sam/container.css" />
10 <link rel="stylesheet" type="text/css" href="./yui/build/editor/assets/skins/sam/editor.css" />
11 <script type="text/javascript" src="./yui/build/yahoo-dom-event/yahoo-dom-event.js">
13 <script type="text/javascript" src="./yui/build/animation/animation-min.js">
15 <script type="text/javascript" src="./yui/build/element/element-min.js">
17 <script type="text/javascript" src="./yui/build/container/container-min.js">
19 <script type="text/javascript" src="./yui/build/menu/menu-min.js">
21 <script type="text/javascript" src="./yui/build/button/button-min.js">
23 <script type="text/javascript" src="./yui/build/editor/editor-min.js">
27 var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event;
39 YAHOO.log('Set state to off..', 'info', 'example');
41 YAHOO.log('Create the Editor..', 'info', 'example');
42 var myEditor = new YAHOO.widget.Editor('contenteditor', myConfig);
43 myEditor.on('toolbarLoaded', function(){
46 label: 'Edit HTML Code',
49 YAHOO.log('Create the (editcode) Button', 'info', 'example');
50 this.toolbar.addButtonToGroup(codeConfig, 'insertitem');
52 this.toolbar.on('editcodeClick', function(){
53 var ta = this.get('element'), iframe = this.get('iframe').get('element');
57 this.toolbar.set('disabled', false);
58 YAHOO.log('Show the Editor', 'info', 'example');
59 YAHOO.log('Inject the HTML from the textarea into the editor', 'info', 'example');
60 this.setEditorHTML(ta.value);
61 if (!this.browser.ie) {
62 this._setDesignMode('on');
65 Dom.removeClass(iframe, 'editor-hidden');
66 Dom.addClass(ta, 'editor-hidden');
72 YAHOO.log('Show the Code Editor', 'info', 'example');
74 YAHOO.log('Save the Editors HTML', 'info', 'example');
75 Dom.addClass(iframe, 'editor-hidden');
76 Dom.removeClass(ta, 'editor-hidden');
77 this.toolbar.set('disabled', true);
78 this.toolbar.getButtonByValue('editcode').set('disabled', false);
79 this.toolbar.selectButton('editcode');
80 this.dompath.innerHTML = 'Editing HTML Code';
86 this.on('cleanHTML', function(ev){
87 YAHOO.log('cleanHTML callback fired..', 'info', 'example');
88 this.get('element').value = ev.html;
91 this.on('afterRender', function(){
92 var wrapper = this.get('editor_wrapper');
93 wrapper.appendChild(this.get('element'));
94 this.setStyle('width', '100%');
95 this.setStyle('height', '100%');
96 this.setStyle('visibility', '');
97 this.setStyle('top', '');
98 this.setStyle('left', '');
99 this.setStyle('position', '');
101 this.addClass('editor-hidden');
108 function switchsubmit(form, action){
109 document.getElementsByName("action").item(0).value = action;
114 .yui-skin-sam .yui-toolbar-container .yui-toolbar-editcode span.yui-toolbar-icon {
115 background-image: url( ./yui/assets/html_editor.gif );
116 background-position: 0 1px;
120 .yui-skin-sam .yui-toolbar-container .yui-button-editcode-selected span.yui-toolbar-icon {
121 background-image: url( ./yui/assets/html_editor.gif );
122 background-position: 0 1px;
140 <body class="yui-skin-sam">
144 <div class="divstyle" style="width: <%= TABLEWIDTH %>px;">
145 <form action="<%= cgi.script_name %>" method="POST">
146 <input type="hidden" name="target_filepath" value="<%= session["target_filepath"] %>"><% case params["action"]
148 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
151 <td colspan="2" class="formheader">
156 entry = db["newentry"]
157 entry.paramlist.each do |val| %>
158 <tr style="display: <%= entry.display[val] %>;">
159 <td class="formnavi" style="width: 140px;">
160 <%= entry.name[val] %>
162 <td class="forminput">
163 <input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
170 <input type="hidden" name="mode" value="newentry"><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" %>
171 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
174 <td class="forminput" style="text-align: center;">
181 <a href="<%= cgi.script_name %>">メニューに戻る</a>
183 <table style="width: <%= (TABLEWIDTH - 20) %>px;">
186 <td colspan="2" class="formheader">
192 if cgi["action"] == "back"
193 entry = db["newentry"]
195 entry = Entry.new({})
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 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%"><% else %>
205 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor">
206 <%= entry.content_for_generator %>
216 <input type="hidden" name="mode" value="newentry"><input type="hidden" name="action" value="confirm"><input type="submit" value="確認"><% else %>
217 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
220 <td colspan="2" class="formheader">
226 if cgi["action"] == "back"
227 entry = db["newentry"]
229 entry = Entry.new({})
231 entry.paramlist.each do |val| %>
232 <tr style="display: <%= entry.display[val] %>;">
233 <td class="formnavi" style="width: 140px;">
234 <%= entry.name[val] %>
236 <td class="forminput">
237 <% date = Time.now.iso8601 %>
238 <% if val == "content" %>
239 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor">
240 <% if entry.content.empty? %>
243 <%= entry.content_for_generator %>
246 <% elsif val == "entryid" %>
247 <input type="text" name="<%= val %>" value="<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% elsif val == "updated" || val == "published" %>
248 <input type="text" name="<%= val %>" value="<%= date %>" style="width: 100%"><% elsif val == "url" %>
249 <input type="text" name="<%= val %>" value="<%= db["feed"].url %>#<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% else %>
250 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%"><% end %>
257 <input type="hidden" name="mode" value="newentry"><input type="hidden" name="action" value="confirm"><input type="submit" class="wymupdate" value="確認"><% end %>
261 <div class="divstyle" style="border: none;">