Subdomain Posts
None | 2 days ago
None | 8 days ago
None | 12 days ago
None | 12 days ago
None | 17 days ago
JavaScript | 27 days ago
Python | 27 days ago
JavaScript | 27 days ago
None | 48 days ago
JavaScript | 48 days ago
Recent Posts
None | 15 sec ago
None | 30 sec ago
Power Shell | 37 sec ago
None | 43 sec ago
None | 57 sec ago
None | 1 min ago
Bash | 1 min ago
None | 1 min ago
None | 1 min ago
VisualBasic | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By -Xv on the 15th of Dec 2007 04:17:06 PM
Download |
Raw |
Embed |
Report
// Use custom field input boxes if they already exist
story.getTiddlerField = function(title, field) {
var tiddlerElem = document.getElementById(this.idPrefix + title);
return this.getTiddlerFieldFromPlace(tiddlerElem, field);
};
story.getTiddlerFieldFromPlace = function(tiddlerElem, field) {
var e = null;
if(tiddlerElem != null) {
var children = tiddlerElem.getElementsByTagName("*");
for(var t=0; t<children.length; t++) {
var c = children[t];
if(c.tagName.toLowerCase() == "input" || c.tagName.toLowerCase() == "textarea") {
//if(!e)
// e = c; // -Xv: Why this code?! We may be returning a wrong input/textarea!
if(c.getAttribute("edit") == field) {
e = c;
break; // -Xv: This break is not in the original method
}
}
}
}
return e;
};
story.addCustomFields = function(place,customFields) {
var fields = customFields.decodeHashMap();
var w = document.createElement("div");
w.style.display = "none";
place.appendChild(w);
for(var t in fields) {
var e = story.getTiddlerFieldFromPlace(place, t);
if (!e) {
e = document.createElement("input");
e.setAttribute("type","text");
w.appendChild(e);
e.setAttribute("edit",t);
}
e.value = fields[t];
}
};
Submit a correction or amendment below.
Make A New Post