editIndex = -1;
}
else {
+ var temp_content = entryList[index].content;
+ alert(temp_content);
document.getElementById("entry_title").value = entryList[index].title;
- document.getElementById("entry_stdin").value = entryList[index].content;
+ document.getElementById("entry_stdin").value = temp_content;
editIndex = index;
}
}
* @param {Object} obj
*/
function FeedInfo(obj){
- this.title = xmlAttrContentUnescape($("title:first", obj).text());
- this.subtitle = xmlAttrContentUnescape($("subtitle:first", obj).text());
- this.self = xmlAttrContentUnescape($("link[rel=self]", obj).attr("href"));
- this.alternate = xmlAttrContentUnescape($("link[rel=alternate]", obj).attr("href"));
- this.updated = xmlAttrContentUnescape($("updated:first", obj).text());
- this.id = xmlAttrContentUnescape($("id:first", obj).text());
- this.rights = xmlAttrContentUnescape($("rights:first", obj).text());
- this.authorname = xmlAttrContentUnescape($("author>name", obj).text());
- this.authoremail = xmlAttrContentUnescape($("author>email", obj).text());
+ this.title = $("title:first", obj).text();
+ this.subtitle = $("subtitle:first", obj).text();
+ this.self = $("link[rel=self]", obj).attr("href");
+ this.alternate = $("link[rel=alternate]", obj).attr("href");
+ this.updated = $("updated:first", obj).text();
+ this.id = $("id:first", obj).text();
+ this.rights = $("rights:first", obj).text();
+ this.authorname = $("author>name", obj).text();
+ this.authoremail = $("author>email", obj).text();
}
/**
* @param {Object} obj entry 要素の DOM オブジェクト
*/
function Entry(obj){
- this.id = xmlAttrContentUnescape($("id:first", obj).text());
- this.title = xmlAttrContentUnescape($("title:first", obj).text());
- this.summary = xmlAttrContentUnescape($("summary:first", obj).text());
- this.published = xmlAttrContentUnescape($("published:first", obj).text());
- this.updated = xmlAttrContentUnescape($("updated:first", obj).text());
- this.link = xmlAttrContentUnescape($("link:first", obj).attr("href"));
- this.content = xmlAttrContentUnescape($("content:first", obj).text());
- this.content = xmlAttrContentUnescape(this.content);
+ this.id = $("id:first", obj).text();
+ this.title = $("title:first", obj).text();
+ this.summary = $("summary:first", obj).text();
+ this.published = $("published:first", obj).text();
+ this.updated = $("updated:first", obj).text();
+ this.link = $("link:first", obj).attr("href");
+ this.content = $("content:first", obj).text();
if (inputValidateMode == 1) {
this.content = this.content.replace(/[\r\n]|\r\n/g, "");
function convertContent(content){
if (document.getElementById("addContentBr").checked) {
content = content.replace(/[\n\r]|\r\n/g, "<br>\n");
- // content = content.replace(/(<br>|<\/p>|<\/h\d>|<\/div>)(?=[^\n])/ig, "$1\n");
}
else {
content = content.replace(/<br>/ig, "\n");
}
/**
- * XMLのエスケープを行う関数
- * @param {String} str エスケープを行う文字列
+ * XMLの逆エスケープを行う関数
+ * バグあり!&の処理がおかしい
+ * @param {String} str 逆エスケープを行う文字列
*/
function xmlAttrContentUnescape(str){
- return str.replace(/"/g, '"').replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&");
+ return str.replace(/ /g, " ").replace(/"/g, '"').replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&");
}
/**