EliteJournal 1.9.400 → 1.9.401

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  <h2><%= @post.subject %></h2>
3
3
  <ul class="postdata">
4
4
  <li>Posted On <%= @post.created_at %></li>
5
- <li>Trackback URL: <%= url_for :controller => 'ping', :action => 'trackback', :id => @post.id, :only_path => false %>/li>
5
+ <li>Trackback URL: <%= url_for :controller => 'ping', :action => 'trackback', :id => @post.id, :only_path => false %></li>
6
6
  <% if @post.updated? -%>
7
7
  <li>Update On <%= @post.updated_at %></li>
8
8
  <% end -%>
Binary file
@@ -0,0 +1,28 @@
1
+ var styleSheet;
2
+ var runLiveCss = true;
3
+
4
+ function startLiveCss() {
5
+ styleSheet = document.createElement('link');
6
+ styleSheet.rel = 'stylesheet';
7
+ styleSheet.type = 'text/css';
8
+ document.getElementsByTagName('head')[0].appendChild(styleSheet);
9
+ applycss();
10
+ }
11
+
12
+ function applycss() {
13
+ if (runLiveCss == true) {
14
+ styleSheet.href = "data:text/css,"+escape(document.getElementById('css').value);
15
+ setTimeout(applycss, 250);
16
+ } else {
17
+ styleSheet.href = "data:text/css,";
18
+ }
19
+ }
20
+
21
+ function toggleLiveCss() {
22
+ if (runLiveCss == true) {
23
+ runLiveCss = false;
24
+ } else {
25
+ runLiveCss = true;
26
+ applycss();
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ function ToHex(n) { return (n < 16 ? "0" : "") + n.toString(16); }
2
+ function RubyFade(element, iteration) {
3
+ if (typeof iteration == 'undefined')
4
+ iteration = 0;
5
+ var el = document.getElementById(element);
6
+ if (iteration < 256) {
7
+ setTimeout("RubyFade('"+element+"', " + (iteration + 16) + ")", 100);
8
+ } else {
9
+ el.style.backgroundColor = 'transparent';
10
+ return;
11
+ }
12
+ el.style.backgroundColor = "#FF" + ToHex(iteration) + ToHex(iteration);
13
+ }
@@ -0,0 +1,33 @@
1
+ /* This file contains javascripts to manipulate the UI */
2
+ function showReply(post) {
3
+ postreply = document.getElementById('post_reply_' + post);
4
+ document.getElementById("postreply_" + post).style.display = 'block';
5
+ postreply.innerHTML = 'Cancel Reply';
6
+ postreply.onclick = new Function("return hideReply('" + post + "')");
7
+ document.getElementById('comment_subject_' + post).focus();
8
+ return false;
9
+ }
10
+
11
+ function hideReply(post) {
12
+ postreply = document.getElementById('post_reply_' + post);
13
+ postreply.innerHTML = 'Reply';
14
+ postreply.onclick = new Function("return showReply('" + post + "')");
15
+ document.getElementById("postreply_" + post).style.display = 'none';
16
+ return false;
17
+ }
18
+
19
+ function showTagger(post) {
20
+ document.getElementById('post_tags_' + post).style.display = 'block';
21
+ document.getElementById('post_tagger_' + post).innerHTML = 'Hide Tagger';
22
+ document.getElementById('post_tagger_' + post).onclick = new Function("return hideTagger('" + post + "')");
23
+ document.getElementById('post_tags_ip_' + post).focus();
24
+ return false;
25
+ }
26
+
27
+ function hideTagger(post) {
28
+ document.getElementById('post_tags_' + post).style.display = 'none';
29
+ document.getElementById('post_tags_ip_' + post).value = '';
30
+ document.getElementById('post_tagger_' + post).innerHTML = 'Add Tags';
31
+ document.getElementById('post_tagger_' + post).onclick = new Function("return showTagger('" + post + "')");
32
+ return false;
33
+ }
@@ -0,0 +1,38 @@
1
+ /** XHConn - Simple XMLHTTP Interface - brad@xkr.us - 2005-01-24 **
2
+ ** Code licensed under Creative Commons Attribution-ShareAlike License **
3
+ ** http://creativecommons.org/licenses/by-sa/2.0/ **/
4
+ function XHConn()
5
+ {
6
+ var xmlhttp;
7
+ try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
8
+ catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
9
+ catch (e) { try { xmlhttp = new XMLHttpRequest(); }
10
+ catch (e) { xmlhttp = false; }}}
11
+ if (!xmlhttp) return null;
12
+ this.connect = function(sURL, sMethod, sVars, fnDone)
13
+ {
14
+ if (!xmlhttp) return false;
15
+ sMethod = sMethod.toUpperCase();
16
+
17
+ try {
18
+ if (sMethod == "GET")
19
+ {
20
+ xmlhttp.open(sMethod, sURL+"?"+sVars, true);
21
+ sVars = "";
22
+ }
23
+ else
24
+ {
25
+ xmlhttp.open(sMethod, sURL, true);
26
+ xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
27
+ xmlhttp.setRequestHeader("Content-Type",
28
+ "application/x-www-form-urlencoded");
29
+ }
30
+ xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState == 4) {
31
+ fnDone(xmlhttp); }};
32
+ xmlhttp.send(sVars);
33
+ }
34
+ catch(z) { return false; }
35
+ return true;
36
+ };
37
+ return this;
38
+ }
@@ -0,0 +1,214 @@
1
+ /* These functions are intended to be called right from the UI */
2
+
3
+ // "Live Reply"
4
+ function sendReply(post) {
5
+ document.getElementById('reply_submit_' + post).disabled = true;
6
+
7
+ // subject, posted_by, body
8
+ subject = document.getElementById('comment_subject_' + post).value;
9
+ posted_by = document.getElementById('comment_posted_by_' + post).value;
10
+ body = document.getElementById('comment_body_' + post).value;
11
+ postData = "comment[subject]=" + subject + "&comment[posted_by]=" + posted_by + "&comment[body]=" + body;
12
+ if (!(xmlhttp = new XHConn())) {
13
+ return true;
14
+ }
15
+ xmlhttp.connect('/journal/replyxml/' + post, 'POST', postData, _sendReply);
16
+ return false;
17
+ }
18
+
19
+ // "Live Post Delete"
20
+ function deletePost(post) {
21
+ if (confirm('Delete this post?') == false) {
22
+ return false;
23
+ }
24
+ if (!(xmlhttp = new XHConn())) {
25
+ return true;
26
+ }
27
+ xmlhttp.connect('/post/destroyxml/' + post, 'GET', '', _deletePost);
28
+ return false;
29
+ }
30
+
31
+ // "Live commenting toggle"
32
+ function toggleCommenting(post) {
33
+ if (!(xmlhttp = new XHConn())) {
34
+ return true;
35
+ }
36
+ xmlhttp.connect('/post/toggle_commentingxml/' + post, 'GET', '', _toggleCommenting);
37
+ return false;
38
+ }
39
+
40
+ // "Live tagging"
41
+ function sendTags(form) {
42
+ if (!(xmlhttp = new XHConn())) {
43
+ alert('Could not tag post.');
44
+ hideTagger(form.post_id.value);
45
+ return true;
46
+ }
47
+ postData = 'post_id=' + form.post_id.value + '&tags=' + escape(form.tags.value);
48
+ xmlhttp.connect('/tags/addxml', 'POST', postData, _sendTags);
49
+ hideTagger(form.post_id.value);
50
+ return false;
51
+ }
52
+
53
+
54
+
55
+ /* These functions are behind the scenese XMLHttpRequet callbacks. You do
56
+ * not call these yourself. I mean it. */
57
+ function _sendReply(oXML) {
58
+ postid = oXML.responseXML.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
59
+ comcnt = oXML.responseXML.getElementsByTagName('comments')[0].childNodes[0].nodeValue;
60
+ message = oXML.responseXML.getElementsByTagName('message')[0].childNodes[0].nodeValue;
61
+
62
+ document.getElementById('comment_count_' + postid).innerHTML = "Comments (" + comcnt + ")";
63
+ document.getElementById("replylink_" + postid).innerHTML = message;
64
+ hideReply(postid)
65
+ RubyFade('replylink_' + postid);
66
+ }
67
+
68
+ function _deletePost(oXML) {
69
+ postid = oXML.responseXML.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
70
+ document.getElementById('postsubject_' + postid).innerHTML = '';
71
+ document.getElementById('postsubject_' + postid).style.display = 'none';
72
+ document.getElementById('postdiv_' + postid).innerHTML = '';
73
+ document.getElementById('postdiv_' + postid).style.display = 'none';
74
+ }
75
+
76
+ function _toggleCommenting(oXML) {
77
+ postid = oXML.responseXML.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
78
+ status = oXML.responseXML.getElementsByTagName('status')[0].childNodes[0].nodeValue;
79
+ message = oXML.responseXML.getElementsByTagName('message')[0].childNodes[0].nodeValue;
80
+ document.getElementById('togglecomment_' + postid).childNodes[0].innerHTML = message;
81
+ // Hide the reply link and Comments (x) text
82
+ dstat = status == 'true' ? 'inline' : 'none';
83
+ document.getElementById("replylink_" + postid).style.display = dstat;
84
+ document.getElementById("comment_count_" + postid).style.display = dstat;
85
+ // RubyFade('togglecomment_' + postid);
86
+ }
87
+
88
+ function _sendTags(oXML) {
89
+ postid = oXML.responseXML.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
90
+ link = oXML.responseXML.getElementsByTagName('link')[0].childNodes[0].nodeValue;
91
+
92
+ if ((el = document.getElementById('posttags_' + postid))) {
93
+ el.innerHTML = 'Tags: ' + link;
94
+ } else {
95
+ ul = document.getElementById('postdata_' + postid);
96
+ li = document.createElement('li');
97
+ li.id = 'posttags_' + postid;
98
+ li.innerHTML = 'Tags: ' + link;
99
+ ul.appendChild(li);
100
+ }
101
+ RubyFade('posttags_' + postid);
102
+ }
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ // This is for toggling commenting
112
+
113
+
114
+
115
+ // Edit in place
116
+ function processSetupEditInPlace() {
117
+ if (req.readyState == 4) {
118
+ if (req.status == 200) {
119
+ var xml = req.responseXML;
120
+ postid = xml.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
121
+ subject = xml.getElementsByTagName('subject')[0].childNodes[0].nodeValue;
122
+ bodytxt = xml.getElementsByTagName('body')[0].childNodes[0].nodeValue;
123
+ if (xml.getElementsByTagName('tags')[0].childNodes.length > 0) {
124
+ tags = xml.getElementsByTagName('tags')[0].childNodes[0].nodeValue;
125
+ } else {
126
+ tags = '';
127
+ }
128
+
129
+ // Create the input elements, loaded with the post data.
130
+ subj = document.getElementById('postsubject_' + postid);
131
+ subj.innerHTML = '<input type="text" class="editsubject" id="editsubject_' + postid + '" value="' + subject + '" />';
132
+
133
+ document.getElementById('posttags_' + postid).style.display = 'none';
134
+
135
+ body = document.getElementById('postbody_' + postid);
136
+ body.innerHTML = 'Tags:<br /><input type="text" class="editsubject" id="edittags_' + postid + '" value="' + tags + '" />';
137
+ body.innerHTML += '<textarea class="editbody" id="editbody_' + postid + '">' + bodytxt + '</textarea>';
138
+ body.innerHTML += '<br /><a href="#" onclick="return submitEditInPlace(\'' + postid + '\');">Submit Edit</a>';
139
+ body.innerHTML += '&nbsp;&nbsp;<a href="#" onclick="return cancelEditInPlace(\'' + postid + '\')">Cancel Edit</a>';
140
+ }
141
+ }
142
+ }
143
+ function setupEditInPlace(post) {
144
+ // First, fetch the post data from the server. We do this because we don't
145
+ // have an unrendered copy of the post data.
146
+ req = createXMLObj();
147
+ req.onreadystatechange = processSetupEditInPlace;
148
+
149
+ var url = '/post/postxml/' + post;
150
+ req.open("GET", url, true);
151
+ if (window.XMLHttpRequest) {
152
+ req.send(null);
153
+ } else {
154
+ req.send();
155
+ }
156
+ return false;
157
+ }
158
+
159
+ function processCancelEditInPlace() {
160
+ if (req.readyState == 4) {
161
+ if (req.status == 200) {
162
+ var xml = req.responseXML;
163
+ postid = xml.getElementsByTagName('postid')[0].childNodes[0].nodeValue;
164
+ subject = xml.getElementsByTagName('subject')[0].childNodes[0].nodeValue;
165
+ bodyhtml = xml.getElementsByTagName('rendered')[0].childNodes[0].nodeValue;
166
+ if (xml.getElementsByTagName('tags')[0].childNodes.length > 0) {
167
+ tags = xml.getElementsByTagName('tags')[0].childNodes[0].nodeValue;
168
+ } else {
169
+ tags = '';
170
+ }
171
+
172
+ // Create the input elements, loaded with the post data.
173
+ document.getElementById('posttags_' + postid).style.display = 'inline';
174
+
175
+ subj = document.getElementById('postsubject_' + postid);
176
+ subj.innerHTML = '<h2>' + subject + '</h2>';
177
+
178
+ body = document.getElementById('postbody_' + postid);
179
+ body.innerHTML = '<div id="postbody_' + postid + '">' + bodyhtml + '</div>';
180
+ }
181
+ }
182
+ }
183
+ function cancelEditInPlace(post) {
184
+ // First, fetch the post data from the server. We do this because we don't
185
+ // have an unrendered copy of the post data.
186
+ req = createXMLObj();
187
+ req.onreadystatechange = processCancelEditInPlace;
188
+
189
+ var url = '/post/postxml/' + post;
190
+ req.open("GET", url, true);
191
+ if (window.XMLHttpRequest) {
192
+ req.send(null);
193
+ } else {
194
+ req.send();
195
+ }
196
+ return false;
197
+ }
198
+
199
+ function submitEditInPlace(post) {
200
+ req = createXMLObj();
201
+ req.onreadystatechange = processCancelEditInPlace;
202
+
203
+ var url = '/post/postxml/' + post;
204
+ req.open("POST", url, true);
205
+ req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
206
+ // subject, posted_by, body
207
+ subject = document.getElementById('editsubject_' + post).value;
208
+ body = document.getElementById('editbody_' + post).value;
209
+ req.send("post[subject]=" + subject + "&post[body]=" + body);
210
+
211
+ req.send();
212
+ return false;
213
+ }
214
+
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: EliteJournal
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.9.400
6
+ version: 1.9.401
7
7
  date: 2005-02-16
8
8
  summary: "Easy to install, multi-user blog software"
9
9
  require_paths:
@@ -133,8 +133,12 @@ files:
133
133
  - public/dispatch.cgi
134
134
  - public/dispatch.fcgi
135
135
  - public/dispatch.rb
136
- - public/images
137
- - public/javascripts
136
+ - public/images/postbg.gif
137
+ - public/javascripts/livecss.js
138
+ - public/javascripts/ruby_fade.js
139
+ - public/javascripts/uimanip.js
140
+ - public/javascripts/xmlhttp.js
141
+ - public/javascripts/xmlhttpreq.js
138
142
  - public/stylesheets/ej-layout.css
139
143
  - public/stylesheets/ej-style.css
140
144
  - public/stylesheets/undohtml.css