summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorkaernyk <kaernyk@gmail.com>2014-09-28 04:30:22 -0400
committerkaernyk <kaernyk@gmail.com>2014-09-28 04:30:22 -0400
commitf6e827ca75453f8769d725056460194c55c95696 (patch)
tree22cce8b0a7c1eb8d459b1233105566e5e28daf90 /js
parent78cf4a8b56393358a6383d258bc237e481b7b323 (diff)
parent197e4d4bfcb5a312a699e1f6d012da03ee36fbe2 (diff)
Merge branch 'master' of https://github.com/kaernyk/vichan
Conflicts: stylesheets/style.css
Diffstat (limited to 'js')
-rw-r--r--js/catalog-link.js10
-rw-r--r--js/expand-all-images.js5
-rw-r--r--js/multi-image.js7
-rw-r--r--js/threadscroll.js4
4 files changed, 14 insertions, 12 deletions
diff --git a/js/catalog-link.js b/js/catalog-link.js
index 5c5d9b13..05ee9efb 100644
--- a/js/catalog-link.js
+++ b/js/catalog-link.js
@@ -15,13 +15,8 @@
function catalog() {
var board = $("input[name='board']");
-if (board.length>0) {
-if (window.location.pathname.indexOf("/res/")>0){ //if we are inside a thread
-var catalog_url = '../catalog.html';
-}
-else {
-var catalog_url = 'catalog.html';
-}
+var catalog_url = configRoot + board.first().val() + "/catalog.html";
+
var pages = document.getElementsByClassName('pages')[0];
var bottom = document.getElementsByClassName('boardlist bottom')[0]
var subtitle = document.getElementsByClassName('subtitle')[0];
@@ -57,7 +52,6 @@ if (subtitle) {
subtitle.appendChild(link2);
}
}
-}
if (active_page == 'thread' || active_page == 'index') {
$(document).ready(catalog);
diff --git a/js/expand-all-images.js b/js/expand-all-images.js
index fc273e5e..5545045c 100644
--- a/js/expand-all-images.js
+++ b/js/expand-all-images.js
@@ -27,7 +27,10 @@ onready(function(){
$(this).parent().click();
});
- $('hr:first').before('<div id="shrink-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
+ if (!$('#shrink-all-images').length) {
+ $('hr:first').before('<div id="shrink-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
+ }
+
$('div#shrink-all-images a')
.text(_('Shrink all images'))
.click(function(){
diff --git a/js/multi-image.js b/js/multi-image.js
index 32d1f256..db4c6bd2 100644
--- a/js/multi-image.js
+++ b/js/multi-image.js
@@ -18,7 +18,12 @@ function multi_image() {
var images_len = $('form:not([id="quick-reply"]) [type=file]').length;
if (!(images_len >= max_images)) {
- $('.add_image').after('<br class="file_separator"/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">');
+ var new_file = '<br class="file_separator"/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">';
+
+ $('[type=file]:last').after(new_file);
+ if ($("#quick-reply").length) {
+ $('form:not(#quick-reply) [type=file]:last').after(new_file);
+ }
if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]'));
}
})
diff --git a/js/threadscroll.js b/js/threadscroll.js
index c3c6deef..0a233f58 100644
--- a/js/threadscroll.js
+++ b/js/threadscroll.js
@@ -16,7 +16,7 @@ if(active_page == "index" || active_page == "ukko"){
if(par.length == 1){
if(par.prev().attr("id") != null){
if(par.prev().attr("id").match("^thread")){
- window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.prev().attr("id");
+ par.prev()[0].scrollIntoView(true);
}
}
}
@@ -28,7 +28,7 @@ if(active_page == "index" || active_page == "ukko"){
if(par.length == 1){
if(par.next().attr("id") != null){
if(par.next().attr("id").match("^thread")){
- window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.next().attr("id");
+ par.next()[0].scrollIntoView(true);
}
}
}