Warning: Declaration of action_plugin_stratatemplatery::register(Doku_Event_Handler &$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/stratatemplatery/action.php on line 24
Warning: Declaration of action_plugin_editx::register(&$contr) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/editx/action.php on line 18
Warning: Declaration of action_plugin_templatery::register(Doku_Event_Handler &$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/templatery/action.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/stratatemplatery/action.php:35) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/exe/js.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/stratatemplatery/action.php:35) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/inc/httputils.php on line 225
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/stratatemplatery/action.php:35) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/inc/httputils.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nielsvantol/public_html/dragonseye/rpwiki/lib/plugins/stratatemplatery/action.php:35) in /usr/home/nielsvantol/public_html/dragonseye/rpwiki/inc/httputils.php on line 28
',
classes: {
// used to get elements from templates
button: 'qq-upload-button',
drop: 'qq-upload-drop-area',
dropActive: 'qq-upload-drop-area-active',
list: 'qq-upload-list',
nameInput: 'qq-upload-name-input',
overwriteInput: 'qq-overwrite-check',
uploadButton: 'qq-upload-action',
file: 'qq-upload-file',
spinner: 'qq-upload-spinner',
size: 'qq-upload-size',
cancel: 'qq-upload-cancel',
// added to list item when upload completes
// used in css to hide progress spinner
success: 'qq-upload-success',
fail: 'qq-upload-fail',
failedText: 'qq-upload-failed-text'
}
});
qq.extend(this._options, o);
this._element = this._options.element;
this._element.innerHTML = this._options.template;
this._listElement = this._options.listElement || this._find(this._element, 'list');
this._classes = this._options.classes;
this._button = this._createUploadButton(this._find(this._element, 'button'));
this._bindCancelEvent();
this._bindUploadEvent();
this._setupDragDrop();
};
qq.extend(qq.FileUploaderExtended.prototype, qq.FileUploader.prototype);
qq.extend(qq.FileUploaderExtended.prototype, {
_bindUploadEvent: function(){
var self = this,
list = this._listElement;
qq.attach(document.getElementById('mediamanager__upload_button'), 'click', function(e){
e = e || window.event;
var target = e.target || e.srcElement;
qq.preventDefault(e);
self._handler._options.onUpload();
jQuery(".qq-upload-name-input").each(function (i) {
jQuery(this).attr('disabled', 'disabled');
});
});
},
_onComplete: function(id, fileName, result){
this._filesInProgress--;
// mark completed
var item = this._getItemByFileId(id);
qq.remove(this._find(item, 'cancel'));
qq.remove(this._find(item, 'spinner'));
var nameInput = this._find(item, 'nameInput');
var fileElement = this._find(item, 'file');
qq.setText(fileElement, nameInput.value);
qq.removeClass(fileElement, 'hidden');
qq.remove(nameInput);
jQuery('.qq-upload-button, #mediamanager__upload_button').remove();
jQuery('.dw__ow').parent().hide();
jQuery('.qq-upload-drop-area').remove();
if (result.success){
qq.addClass(item, this._classes.success);
$link = '' + nameInput.value + '';
jQuery(fileElement).html($link);
} else {
qq.addClass(item, this._classes.fail);
var fail = this._find(item, 'failedText');
if (result.error) qq.setText(fail, result.error);
}
if (document.getElementById('media__content') && !document.getElementById('mediamanager__done_form')) {
var action = document.location.href;
var i = action.indexOf('?');
if (i) action = action.substr(0, i);
var button = '';
jQuery('#mediamanager__uploader').append(button);
}
}
});
qq.extend(qq.UploadHandlerForm.prototype, {
uploadAll: function(params){
this._uploadAll(params);
},
getName: function(id){
var file = this._inputs[id];
var name = document.getElementById('mediamanager__upload_item'+id);
if (name != null) {
return name.value;
} else {
if (file != null) {
// get input value and remove path to normalize
return file.value.replace(/.*(\/|\\)/, "");
} else {
return null;
}
}
},
_uploadAll: function(params){
jQuery(".qq-upload-spinner").each(function (i) {
jQuery(this).removeClass('hidden');
});
for (key in this._inputs) {
this.upload(key, params);
}
},
_upload: function(id, params){
var input = this._inputs[id];
if (!input){
throw new Error('file with passed id was not added, or already uploaded or cancelled');
}
var fileName = this.getName(id);
var iframe = this._createIframe(id);
var form = this._createForm(iframe, params);
form.appendChild(input);
var nameInput = qq.toElement('');
form.appendChild(nameInput);
var checked = jQuery('.dw__ow').is(':checked');
var owCheckbox = jQuery('.dw__ow').clone();
owCheckbox.attr('checked', checked);
jQuery(form).append(owCheckbox);
var self = this;
this._attachLoadEvent(iframe, function(){
self.log('iframe loaded');
var response = self._getIframeContentJSON(iframe);
self._options.onComplete(id, fileName, response);
self._dequeue(id);
delete self._inputs[id];
// timeout added to fix busy state in FF3.6
setTimeout(function(){
qq.remove(iframe);
}, 1);
});
form.submit();
qq.remove(form);
return id;
}
});
qq.extend(qq.UploadHandlerXhr.prototype, {
uploadAll: function(params){
this._uploadAll(params);
},
getName: function(id){
var file = this._files[id];
var name = document.getElementById('mediamanager__upload_item'+id);
if (name != null) {
return name.value;
} else {
if (file != null) {
// fix missing name in Safari 4
return file.fileName != null ? file.fileName : file.name;
} else {
return null;
}
}
},
getSize: function(id){
var file = this._files[id];
if (file == null) return null;
return file.fileSize != null ? file.fileSize : file.size;
},
_upload: function(id, params){
var file = this._files[id],
name = this.getName(id),
size = this.getSize(id);
if (name == null || size == null) return;
this._loaded[id] = 0;
var xhr = this._xhrs[id] = new XMLHttpRequest();
var self = this;
xhr.upload.onprogress = function(e){
if (e.lengthComputable){
self._loaded[id] = e.loaded;
self._options.onProgress(id, name, e.loaded, e.total);
}
};
xhr.onreadystatechange = function(){
if (xhr.readyState == 4){
self._onComplete(id, xhr);
}
};
// build query string
params = params || {};
params['qqfile'] = name;
params['ow'] = jQuery('.dw__ow').is(':checked');
var queryString = qq.obj2url(params, this._options.action);
xhr.open("POST", queryString, true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
xhr.setRequestHeader("Content-Type", "application/octet-stream");
xhr.send(file);
},
_uploadAll: function(params){
jQuery(".qq-upload-spinner").each(function (i) {
jQuery(this).removeClass('hidden');
});
for (key in this._files) {
this.upload(key, params);
}
}
});
/* XXXXXXXXXX end of lib/scripts/fileuploaderextended.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/helpers.js XXXXXXXXXX */
/**
* Various helper functions
*/
/**
* A PHP-style substr_replace
*
* Supports negative start and length and omitting length, but not
* str and replace arrays.
* See http://php.net/substr-replace for further documentation.
*/
function substr_replace(str, replace, start, length) {
var a2, b1;
a2 = (start < 0 ? str.length : 0) + start;
if (typeof length === 'undefined') {
length = str.length - a2;
} else if (length < 0 && start < 0 && length <= start) {
length = 0;
}
b1 = (length < 0 ? str.length : a2) + length;
return str.substring(0, a2) + replace + str.substring(b1);
}
/**
* Bind variables to a function call creating a closure
*
* Use this to circumvent variable scope problems when creating closures
* inside a loop
*
* @author Adrian Lang
* @link http://www.cosmocode.de/en/blog/gohr/2009-10/15-javascript-fixing-the-closure-scope-in-loops
* @param functionref fnc - the function to be called
* @param mixed - any arguments to be passed to the function
* @returns functionref
*/
function bind(fnc/*, ... */) {
var Aps = Array.prototype.slice,
// Store passed arguments in this scope.
// Since arguments is no Array nor has an own slice method,
// we have to apply the slice method from the Array.prototype
static_args = Aps.call(arguments, 1);
// Return a function evaluating the passed function with the
// given args and optional arguments passed on invocation.
return function (/* ... */) {
// Same here, but we use Array.prototype.slice solely for
// converting arguments to an Array.
return fnc.apply(this,
static_args.concat(Aps.call(arguments, 0)));
};
}
/**
* Report an error from a JS file to the console
*
* @param e The error object
* @param file The file in which the error occurred
*/
function logError(e, file) {
if (window.console && console.error) {
console.error('The error "%s: %s" occurred in file "%s". ' +
'If this is in a plugin try updating or disabling the plugin, ' +
'if this is in a template try updating the template or switching to the "dokuwiki" template.',
e.name, e.message, file);
if(e.stack) {
console.error(e.stack);
}
}
}
/* XXXXXXXXXX end of lib/scripts/helpers.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/delay.js XXXXXXXXXX */
/**
* Manage delayed and timed actions
*
* @license GPL2 (http://www.gnu.org/licenses/gpl.html)
* @author Adrian Lang
*/
/**
* Provide a global callback for window.setTimeout
*
* To get a timeout for non-global functions, just call
* delay.add(func, timeout).
*/
var timer = {
_cur_id: 0,
_handlers: {},
execDispatch: function (id) {
timer._handlers[id]();
},
add: function (func, timeout) {
var id = ++timer._cur_id;
timer._handlers[id] = func;
return window.setTimeout('timer.execDispatch(' + id + ')', timeout);
}
};
/**
* Provide a delayed start
*
* To call a function with a delay, just create a new Delay(func, timeout) and
* call that object’s method “start”.
*/
function Delay (func, timeout) {
this.func = func;
if (timeout) {
this.timeout = timeout;
}
}
Delay.prototype = {
func: null,
timeout: 500,
delTimer: function () {
if (this.timer !== null) {
window.clearTimeout(this.timer);
this.timer = null;
}
},
start: function () {
DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');
this.delTimer();
var _this = this;
this.timer = timer.add(function () { _this.exec.call(_this); },
this.timeout);
this._data = {
_this: arguments[0],
_params: Array.prototype.slice.call(arguments, 2)
};
},
exec: function () {
this.delTimer();
this.func.call(this._data._this, this._data._params);
}
};
/* XXXXXXXXXX end of lib/scripts/delay.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/cookie.js XXXXXXXXXX */
/**
* Handles the cookie used by several JavaScript functions
*
* Only a single cookie is written and read. You may only save
* simple name-value pairs - no complex types!
*
* You should only use the getValue and setValue methods
*
* @author Andreas Gohr
* @author Michal Rezler
*/
var DokuCookie = {
data: {},
name: 'DOKU_PREFS',
/**
* Save a value to the cookie
*
* @author Andreas Gohr
*/
setValue: function(key,val){
var text = [],
_this = this;
this.init();
this.data[key] = val;
//save the whole data array
jQuery.each(_this.data, function (key, val) {
if (_this.data.hasOwnProperty(key)) {
text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));
}
});
jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_COOKIE_PARAM.path, secure: DOKU_COOKIE_PARAM.secure});
},
/**
* Get a Value from the Cookie
*
* @author Andreas Gohr
*/
getValue: function(key){
this.init();
return this.data[key];
},
/**
* Loads the current set cookie
*
* @author Andreas Gohr
*/
init: function(){
var text, parts, i;
if(!jQuery.isEmptyObject(this.data)) {
return;
}
text = jQuery.cookie(this.name);
if(text){
parts = text.split('#');
for(i = 0; i < parts.length; i += 2){
this.data[decodeURIComponent(parts[i])] = decodeURIComponent(parts[i+1]);
}
}
}
};
/* XXXXXXXXXX end of lib/scripts/cookie.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/script.js XXXXXXXXXX */
// if jQuery was loaded, let's make it noConflict here.
if ('function' === typeof jQuery && 'function' === typeof jQuery.noConflict) {
jQuery.noConflict();
}
/**
* Some browser detection
*/
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var is_macos = navigator.appVersion.indexOf('Mac') != -1;
var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) &&
(clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1));
var is_safari = ((clientPC.indexOf('applewebkit')!=-1) && (clientPC.indexOf('spoofer')==-1));
var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ));
if (clientPC.indexOf('opera')!=-1) {
var is_opera = true;
var is_opera_preseven = (window.opera && !document.childNodes);
var is_opera_seven = (window.opera && document.childNodes);
}
/**
* Handler to close all open Popups
*/
function closePopups(){
jQuery('div.JSpopup').hide();
}
jQuery(function () {
jQuery(document).click(closePopups);
});
/* XXXXXXXXXX end of lib/scripts/script.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/qsearch.js XXXXXXXXXX */
/**
* AJAX functions for the pagename quicksearch
*
* @license GPL2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr
* @author Adrian Lang
* @author Michal Rezler
*/
jQuery.fn.dw_qsearch = function (overrides) {
var dw_qsearch = {
output: '#qsearch__out',
$inObj: this,
$outObj: null,
timer: null,
curRequest: null,
/**
* initialize the quick search
*
* Attaches the event handlers
*
*/
init: function () {
var do_qsearch;
dw_qsearch.$outObj = jQuery(dw_qsearch.output);
// objects found?
if (dw_qsearch.$inObj.length === 0 ||
dw_qsearch.$outObj.length === 0) {
return;
}
// attach eventhandler to search field
do_qsearch = function () {
// abort any previous request
if (dw_qsearch.curRequest != null) {
dw_qsearch.curRequest.abort();
}
var value = dw_qsearch.getSearchterm();
if (value === '') {
dw_qsearch.clear_results();
return;
}
dw_qsearch.$inObj.parents('form').addClass('searching');
dw_qsearch.curRequest = jQuery.post(
DOKU_BASE + 'lib/exe/ajax.php',
{
call: 'qsearch',
q: encodeURI(value)
},
dw_qsearch.onCompletion,
'html'
);
};
dw_qsearch.$inObj.keyup(
function () {
if (dw_qsearch.timer) {
window.clearTimeout(dw_qsearch.timer);
dw_qsearch.timer = null;
}
dw_qsearch.timer = window.setTimeout(do_qsearch, 500);
}
);
// attach eventhandler to output field
dw_qsearch.$outObj.click(dw_qsearch.clear_results);
},
/**
* Read search term from input
*/
getSearchterm: function() {
return dw_qsearch.$inObj.val();
},
/**
* Empty and hide the output div
*/
clear_results: function () {
dw_qsearch.$inObj.parents('form').removeClass('searching');
dw_qsearch.$outObj.hide();
dw_qsearch.$outObj.text('');
},
/**
* Callback. Reformat and display the results.
*
* Namespaces are shortened here to keep the results from overflowing
* or wrapping
*
* @param data The result HTML
*/
onCompletion: function (data) {
var max, $links, too_big;
dw_qsearch.$inObj.parents('form').removeClass('searching');
dw_qsearch.curRequest = null;
if (data === '') {
dw_qsearch.clear_results();
return;
}
dw_qsearch.$outObj
.html(data)
.show()
.css('white-space', 'nowrap');
// disable overflow during shortening
dw_qsearch.$outObj.find('li').css('overflow', 'visible');
$links = dw_qsearch.$outObj.find('a');
max = dw_qsearch.$outObj[0].clientWidth; // maximum width allowed (but take away paddings below)
if (document.documentElement.dir === 'rtl') {
max -= parseInt(dw_qsearch.$outObj.css('padding-left'));
too_big = function (l) {
return l.offsetLeft < 0;
};
} else {
max -= parseInt(dw_qsearch.$outObj.css('padding-right'));
too_big = function (l) {
return l.offsetWidth + l.offsetLeft > max;
};
}
$links.each(function () {
var start, length, replace, nsL, nsR, eli, runaway;
if (!too_big(this)) {
return;
}
nsL = this.textContent.indexOf('(');
nsR = this.textContent.indexOf(')');
eli = 0;
runaway = 0;
while ((nsR - nsL > 3) && too_big(this) && runaway++ < 500) {
if (eli !== 0) {
// elipsis already inserted
if ((eli - nsL) > (nsR - eli)) {
// cut left
start = eli - 2;
length = 2;
} else {
// cut right
start = eli + 1;
length = 1;
}
replace = '';
} else {
// replace middle with ellipsis
start = Math.floor(nsL + ((nsR - nsL) / 2));
length = 1;
replace = '…';
}
this.textContent = substr_replace(this.textContent,
replace, start, length);
eli = this.textContent.indexOf('…');
nsL = this.textContent.indexOf('(');
nsR = this.textContent.indexOf(')');
}
});
// reenable overflow
dw_qsearch.$outObj.find('li').css('overflow', 'hidden').css('text-overflow', 'ellipsis');
}
};
jQuery.extend(dw_qsearch, overrides);
if (!overrides.deferInit) {
dw_qsearch.init();
}
return dw_qsearch;
};
jQuery(function () {
jQuery('#qsearch__in').dw_qsearch({
output: '#qsearch__out'
});
});
/* XXXXXXXXXX end of lib/scripts/qsearch.js XXXXXXXXXX */
/* XXXXXXXXXX begin of lib/scripts/search.js XXXXXXXXXX */
jQuery(function () {
'use strict';
const $searchForm = jQuery('.search-results-form');
if (!$searchForm.length) {
return;
}
const $toggleAssistanceButton = jQuery('