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|Android)/ %>
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 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
153 <td colspan="2" class="formheader">
158 entry = db["newentry"]
159 entry.paramlist.each do |val| %>
160 <tr style="display: <%= entry.display[val] %>;">
161 <td class="formnavi" style="width: 140px;">
162 <%= entry.name[val] %>
164 <td class="forminput">
165 <input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
172 <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" %>
173 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
176 <td class="forminput" style="text-align: center;">
183 <a href="<%= cgi.script_name %>">メニューに戻る</a>
185 <table style="width: <%= (TABLEWIDTH - 20) %>px;">
188 <td colspan="2" class="formheader">
194 if cgi["action"] == "back"
195 entry = db["newentry"]
197 entry = Entry.new({})
199 entry.paramlist.each do |val| %>
200 <tr style="display: <%= entry.display[val] %>;">
201 <td class="formnavi" style="width: 140px;">
202 <%= entry.name[val] %>
204 <td class="forminput">
205 <% if val != "content" %>
206 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%"><% else %>
207 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
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"><% if entry.content.empty? %><p><br></p><% else %><%= entry.content_for_generator %><% end %></textarea>
240 <% elsif val == "entryid" %>
241 <input type="text" name="<%= val %>" value="<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% elsif val == "updated" || val == "published" %>
242 <input type="text" name="<%= val %>" value="<%= date %>" style="width: 100%"><% elsif val == "url" %>
243 <input type="text" name="<%= val %>" value="<%= db["feed"].url %>#<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% else %>
244 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%"><% end %>
251 <input type="hidden" name="mode" value="newentry"><input type="hidden" name="action" value="confirm"><input type="submit" class="wymupdate" value="確認"><% end %>
255 <div class="divstyle" style="border: none;">