Skip to content

Instantly share code, notes, and snippets.

@ataraxie
Created August 18, 2015 07:13
Show Gist options
  • Save ataraxie/84824a24ef1dbaf13e72 to your computer and use it in GitHub Desktop.
Save ataraxie/84824a24ef1dbaf13e72 to your computer and use it in GitHub Desktop.
var SOME_MODULE = (function($) {
var PAGE_IDS = [2031628,2392174,5046273,5046286,9568331/*, ...*/];
var BASE_URL = 'http://wiki.myconfluence.com/pages/editpage.action?pageId=';
function openRange(from, to) {
var doOpen = function(index) {
var win = window.open(BASE_URL + PAGE_IDS[index], '_blank');
win.focus();
};
var recur = function(index) {
if (index >= from && index <= to) {
doOpen(index-1);
setTimeout(function() {
recur(index+1)
}, 1000);
}
};
recur(from);
}
return {
openRange: openRange
};
}(jQuery))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment