summaryrefslogtreecommitdiff
path: root/templates/main.js
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-07-07 23:07:38 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-07-07 23:07:38 +1000
commit11409bb9d71e7cd7bd3c5abd604569472cdd8254 (patch)
treec56f8a42a3b0079cd3ab71167a6692197ad0dca5 /templates/main.js
parent235163883da3cac3523d7681670a00cf7649c371 (diff)
made inline expanding of images optional
Diffstat (limited to 'templates/main.js')
-rw-r--r--templates/main.js54
1 files changed, 29 insertions, 25 deletions
diff --git a/templates/main.js b/templates/main.js
index e4063ae9..577e6f66 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -113,31 +113,7 @@ function rememberStuff() {
}
}
-function init()
-{
- newElement = document.createElement('div');
- newElement.className = 'styles';
-
- for(x=0;x<styles.length;x++) {
- style = document.createElement('a');
- style.innerHTML = '[' + styles[x][0] + ']';
- style.href = 'javascript:changeStyle(' + x + ');';
- if(selectedstyle == styles[x][0])
- style.className = 'selected';
- newElement.appendChild(style);
- }
-
- document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
-
- if(document.forms.postcontrols) {
- document.forms.postcontrols.password.value = localStorage.password;
- }
-
- if (window.location.hash.indexOf('q') == 1)
- citeReply(window.location.hash.substring(2));
- else if (window.location.hash.substring(1))
- highlightReply(window.location.hash.substring(1));
-
+function init_expanding() {
link = document.getElementsByTagName('a');
for ( i in link ) {
if(typeof link[i] == "object" && link[i].childNodes[0].src) {
@@ -169,6 +145,34 @@ function init()
}
}
+function init()
+{
+ newElement = document.createElement('div');
+ newElement.className = 'styles';
+
+ for(x=0;x<styles.length;x++) {
+ style = document.createElement('a');
+ style.innerHTML = '[' + styles[x][0] + ']';
+ style.href = 'javascript:changeStyle(' + x + ');';
+ if(selectedstyle == styles[x][0])
+ style.className = 'selected';
+ newElement.appendChild(style);
+ }
+
+ document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild)
+
+ if(document.forms.postcontrols) {
+ document.forms.postcontrols.password.value = localStorage.password;
+ }
+
+ if (window.location.hash.indexOf('q') == 1)
+ citeReply(window.location.hash.substring(2));
+ else if (window.location.hash.substring(1))
+ highlightReply(window.location.hash.substring(1));
+
+ {config[inline_expanding]?init_expanding();}
+}
+
var RecaptchaOptions = {
theme : 'clean'
};