

var LibJs = {
_instances: {},
user: 'nobody',
groups: [],
createId: function() {
do {
for (var id = '', i = 0; i < 6; i ++)
id += '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmmnopqrstuvwxyz'.charAt(Math.floor(63 * Math.random()));
} while (this._instances[id]);
return id;
},
register: function(obj) {
id = this.createId();
this._instances[id] = obj;
return id;
},
get: function(nodeId) {
if (!this._instances[nodeId])
throw new LibJs.Exception(new Error(), 'L.001', nodeId, [nodeId]);
return this._instances[nodeId];
},
is: function(nodeId) {
return typeof this._instances[nodeId] != 'undefined';
},
remove:  function(nodeId) {
if (delete this._instances[nodeId] == false)
throw new LibJs.Exception(new Error(), 'L.002', nodeId, [nodeId])
},
start: function(loader, element) {
try {
this.running = true;
this.Lang.code = this.Config.defaultLang;
LibJs.XWin.start(loader, element);
this.Daemon.addEvent(this.System.bind(this.Notify, this.Notify.__execute), 200);
this.Daemon.addEvent(this.System.bind(this, this.__checkUrl), 200);
this.Daemon.addEvent(this.System.bind(this, this.__sync), 60000);
this.Daemon.addEvent(this.System.bind(this, this.__GC), 300);
this.Daemon.start();
} catch(e) {
this.__atExit();
}
},
dump: function(text) {
document.getElementsByTagName('body')[0].appendChild($E('pre', {
style: {borderTop: '1px solid #000;'},
children: [$E('pre', { children: [$T(text)]})]
}));
},
__checkUrl: function() {
var match = /^#([a-z0-9_]{6})/i.exec(location.hash);
if (!match && !LibJs.XWin.getActivePage())
match = [ '', this.Config.rootId ];
if (match && match[1] != $L(LibJs.XWin.body).active && typeof $L(LibJs.XWin.body).render == 'function')
$L(LibJs.XWin.body).render(match[1]);
},
__sync: function() {
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'noop' }, transaction);
LibJs.Server.commit(transaction, null, function() {});
},
__GC: function() {
var size = 0; removed = 0;
try {
for (var nodeId in this._instances)
if (this._instances[nodeId].getState() != ''
&& this._instances[nodeId].parent.length > 0
&& typeof this._instances[this._instances[nodeId].parent] == 'undefined'
&& typeof this.XWin._handles[nodeId] == 'undefined'
) {
removed++;
this.remove(nodeId);
} else
size++;
} catch (error) {
$L(LibJs.XWin.body).setLabel('error', $C('error', { properties: { text: $S('core', 'error_garbage_collector'), error: error}}));
$L(LibJs.XWin.body).setState('rendered');
}
if (LibJs.Config.Debug.collector)
window.status = 'Heap: ' + size + ' nodes, removed: ' + removed + ' nodes';
},
__atExit: function() {
this.running = false;
clearInterval(LibJs.Daemon.handler);
for (var nodeId in this._instances)
delete this._instances[nodeId];
LibJs.Factory.__atExit();
LibJs.Event.__atExit();
},
createDOMElement: function(name, options) {
var node = document.createElement(name);
options = options || {};
if (options.className)
node.className = options.className;
LibJs.System.extendObject(node, options.attributes || {});
for (name in options.style || {})
node.style[name] = options.style[name];
for (var i = 0; i < (options.children || []).length; i++)
node.appendChild(options.children[i]);
if (name == 'img' && parseFloat(navigator.appVersion.split("MSIE")[1]) >= 5.5 && options.attributes && options.attributes.src && options.attributes.src.substr(options.attributes.src.length - 3).toLowerCase() == 'png') {
var span = document.createElement('span');
span.style['filter'] = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + options.attributes.src + '\', sizingMethod=\'image\')';
span.appendChild(node);
node = span;
}
return node;
}
}
$L = function(id) { return LibJs.get(id); }
$D = function(id) { return $L(id).getDomSet(); }
$E = LibJs.createDOMElement;
$C = function(name, options) { return LibJs.Component.create(name, options, LibJs.Component, 'fetchComponent') };
$F = function(name, options) { return LibJs.Component.create(name, options, LibJs.Factory.Component, 'fetchFactoryComponent'); };
$A = function(name, options) { return LibJs.Component.create(name, options, LibJs.Admin, 'fetchAdminComponent'); };
$X = function(name, options) { return LibJs.Component.create(name, options, LibJs.XWin.Component, 'fetchXWinComponent'); };
$T = function(text) { return document.createTextNode(text); };
$W = function(widgetId) {
if (!LibJs.Factory.widgets[widgetId])
throw new LibJs.Exception(new Error(), 'L.003', null, [widgetId]);
return LibJs.Factory.widgets[widgetId];
}
$S = function(component, name, vars)  { return LibJs.Lang.getText(component, name, vars); }
$ST = function(component, name, vars)  { return LibJs.Lang.getTextNode(component, name, vars); }
LibJs.Config = {lang: ['de'],defaultLang: 'de',rootId: '3PrF5L',domainName: 'pfadiwinti.ch',productive: true,modules: ['ball', 'events', 'faq', 'gallery', 'garden', 'linklist', 'stat', 'history', 'anschlag']}

LibJs.System = {
createClass: function() {
return function() {
this.initialize.apply(this, arguments);
}
},
extendObject: function(destination, source) {
for (property in source)
destination[property] = source[property];
return destination;
},
cloneObject: function(source) {
return this.extendObject({}, source);
},
bind: function(object, method) {
var args = this.toArray(arguments).slice(2);
return function() {
try {
return method.apply(object, args.concat(LibJs.System.toArray(arguments)));
} catch (error) {
(options.onError || function(error, source) { LibJs.XWin.openError(error, source); })(error, transport.responseText);
}
}
},
bindAsEventListener: function(object, method) {
var args = this.toArray(arguments).slice(2);
return function(event) {
try {
return method.apply(object, args.concat([event || window.event]));
} catch (error) {
(options.onError || function(error, source) { LibJs.XWin.openError(error, source); })(error, transport.responseText);
}
}
},
getElementStyle: function(element, style) {
if (!element.style)
return '';
var value = element.style[style];
if (!value) {
if (document.defaultView && document.defaultView.getComputedStyle) {
var css = document.defaultView.getComputedStyle(element, null);
value = css ? css.getPropertyValue(style) : null;
} else if (element.currentStyle) {
value = element.currentStyle[style];
}
}
return value;
},
toArray: function(obj) {
arr = [];
for (var i = 0; i < obj.length || 0; i++)
arr.push(obj[i]);
return arr;
},
withoutItem: function(array, item) {
result = [];
for (var i = 0; i < array.length; i++)
if (array[i] != item)
result.push(array[i]);
return result;
},
indexOfItem: function(array, item) {
for (var i = 0; i < array.length; i++)
if (array[i] == item)
return i;
return -1;
},
swapItems: function(array, first, second) {
var index = this.indexOfItem(array, second);
array[this.indexOfItem(array, first)] = second;
array[index] = first;
return array;
},
sendAjaxRequest: function(url, options) {
try {
transport = new XMLHttpRequest();
} catch (e) {
try {
transport = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
transport = new ActiveXObject('Microsoft.XMLHTTP');
}
}
options = this.extendObject({
method: 'post',
asynchronous: true,
parameters: '',
postBody: '',
url: url,
attempt: 0
}, options || {});
if (options.method == 'get' && options.parameters.length > 0)
url += (url.match(/\?/) ? '&' : '?') + options.parameters;
transport.open(options.method, url, options.asynchronous);
if (options.asynchronous)
transport.onreadystatechange = this.bind(this, this.__onAjaxStateChange, url, options, transport);
requestHeaders = [];
if (options.method == 'post') {
requestHeaders.push('Content-type', 'application/x-www-form-urlencoded');
if (transport.overrideMimeType)
requestHeaders.push('Connection', 'close');
}
if (options.requestHeaders)
requestHeaders.push.apply(requestHeaders, options.requestHeaders);
for (var i = 0; i < requestHeaders.length; i += 2)
transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
transport.send(options.method == 'post' ? options.postBody : null);
},
__onAjaxStateChange: function(url, options, transport) {
if (!LibJs.running)
return;
try {
if (transport.readyState == 4)
if (transport.responseText.length > 0) {
if (LibJs.Config.Debug.request)
document.getElementsByTagName('body')[0].appendChild($E('pre', { children: [$T(transport.responseText), $E('hr')]}));
var result = eval(transport.responseText);
if (result > 0) {
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'fetchSerializedWidgets', index: result }, transaction);
LibJs.Server.commit(transaction, options.onComplete || function(){}, options.onError || function(){});
} else
(options.onComplete || (function(){}))();
transport.onreadystatechange = function(){};
} else if (options.attempt < 5) {
++options.attempt;
setTimeout(this.bind(this, this.sendAjaxRequest, options.url, options), 200);
} else if (LibJs.running)
throw new Error('No answer after 5 attemps to the request: \n\n' + options.postBody);
} catch (error) {
(options.onError || function(error, source) { LibJs.XWin.openError(error, source); })(error, transport.responseText);
}
}
}


LibJs.History = {
logs: [],
fetchLog: function(widgetId, callback) {
var transaction = LibJs.Server.start();
LibJs.Server.send({type: 'fetchLog', widgetId: widgetId}, transaction);
LibJs.Server.commit(transaction, callback, null, 'history/js');
}
}
LibJs.History.Editorwidget = {
__getOptions: function() {
return {
labels: { close: $C('hyperlink', { properties: { title: $S('component', 'close'), name: 'closeEditor' }})},
properties: { logs: [] }
};
},
loaded: function() {
LibJs.History.fetchLog(this.widgetId, LibJs.System.bind(this, this.repaint))
},
onCreate: function() {
var rows = [$E('tr', { children: [
$E('th', { children: [$ST('history', 'hist_ttl_t_tocid')]}),
$E('th', { children: [$ST('history', 'hist_ttl_t_time')]}),
$E('th', { children: [$ST('history', 'hist_ttl_t_email')]}),
$E('th', { children: [$ST('history', 'hist_ttl_t_action')]}),
$E('th', { children: [$ST('history', 'hist_ttl_t_name')]}),
$E('th', { children: [$ST('history', 'hist_ttl_t_value')]})
]})];
if (typeof LibJs.History.logs[this.widgetId] != 'undefined')
for (var tocId in LibJs.History.logs[this.widgetId])
for (var i = 0; i < LibJs.History.logs[this.widgetId][tocId].length; i++)
if (LibJs.History.logs[this.widgetId][tocId][i].type == 'properties') {
rows.push($E('tr', { children: [
$E('td', { children: [$T(tocId)]}),
$E('td', { children: [$T(LibJs.History.logs[this.widgetId][tocId][i].time)]}),
$E('td', { children: [$T(LibJs.History.logs[this.widgetId][tocId][i].userEmail)]}),
$E('td', { children: [$T($S('history', LibJs.History.logs[this.widgetId][tocId][i].type))]}),
$E('td', { children: [$T(LibJs.History.logs[this.widgetId][tocId][i].name)]}),
$E('td', { children: [$T(LibJs.History.logs[this.widgetId][tocId][i].value)]})
]}));
}
return [$E('div', { children: [
$E('table', { className: 'LibJsComponentHistory', attributes: {width: '100%', cellSpacing: '0', cellPadding: '0'}, children: [
$E('tbody', { children: rows })
]})
].concat($D(this.labels.close))
})];
}
}


LibJs.XWin = {
_handles: {},
_stack: 0,
_currWinZ: 20,
_currWinOffsetTop: 0,
_currWinOffsetLeft: 0,
_show: function(nodeId) {
this._handles[nodeId] = true;
for (var i = 0; i < $D(nodeId).length; i++)
this.domRoot.appendChild($D(nodeId)[i]);
return nodeId;
},
getWinZ: function() {
return this._currWinZ;
},
getNextWinZ: function() {
return this._currWinZ += 50;
},
getWindowInitOffsetTop: function() {
return this._currWinOffsetTop;
},
getNextWindowInitOffsetTop: function() {
if (
(window.innerHeight && window.innerHeight - 300 < this._currWinOffsetTop) ||
(!window.innerHeight && document.documentElement && document.documentElement.clientHeight && document.documentElement.clientHeight - 300 < this._currWinOffsetTop) ||
(!window.innerHeight && !document.documentElement && document.body.offsetHeight && document.body.offsetHeight - 300 < this._currWinOffsetTop)
)
this._currWinOffsetTop = 0;
return this._currWinOffsetTop += 20;
},
getWindowInitOffsetLeft: function() {
return this._currWinOffsetLeft;
},
getNextWindowInitOffsetLeft: function() {
if (
(window.innerWidth && window.innerWidth - 600 < this._currWinOffsetLeft) ||
(!window.innerWidth && document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth - 600 < this._currWinOffsetLeft) ||
(!window.innerWidth && !document.documentElement && document.body.offsetWidth && document.body.offsetWidth - 600 < this._currWinOffsetLeft)
)
this._currWinOffsetLeft = 20;
return this._currWinOffsetLeft += 20;
},
getNrOpenErrors: function() {
var nrerr = 0;
for (var index in this._handles)
if ($L(index).name == 'error')
++nrerr;
return nrerr;
},
start: function(loader, element) {
this.domRoot = typeof element == 'undefined' ? document.getElementsByTagName('body')[0] : element;
this._handles[this._loading = $X('loading')] = true;
this.body = loader('body');
return this._show(this.body);
},
render: function(widgetId) {
$L(this.body).render(widgetId);
},
reload: function() {
this.render($L(this.body).active)
},
getActivePage: function() {
return $L(this.body).active;
},
openWindow: function(options) {
return this._show($X('window', options));
},
openTooltip: function(top, left, body) {
return this._show($X('tooltip', {labels: { body: body }, properties: { top: top, left: left }}));
},
openError: function(error, source) {
return this._show($X('error', {properties: {text: $S('error', 'error_occured'), error: error || {}, source: source}}));
},
openContextmenu: function(top, left, items) {
if ((items || []).length)
return this._show($X('contextmenu', {properties: { top: top, left: left, items: items}}));
},
openMessage: function(options) {
return this._show($X('message', options));
},
openConfirm: function(options) {
return this._show($X('confirm', options));
},
openLoading: function() {
if (this.body) {
$L(this._loading).setState('created');
return this._show(this._loading);
}
},
closeLoading: function () {
if (this.body)
$L(this._loading).setState('closed');
},
closeAll: function(exceptions) {
for (var index in this._handles)
if (this._handles[index] && typeof $L(index).closeComponent != 'undefined' && LibJs.System.indexOfItem(exceptions || [], index) == -1)
$L(index).closeComponent();
},
remove: function(nodeId) {
if (this._handles[nodeId] && delete this._handles[nodeId] == false)
throw new LibJs.Exception(new Error(), 'Could not delete handle', nodeId);
}
}


LibJs.Visitor = LibJs.System.createClass();
LibJs.System.extendObject(LibJs.Visitor, {
create: function(id, component) {
return new LibJs.Visitor(id, component);
}
});
LibJs.Visitor.prototype = {
initialize: function(id, component) {
this.id = id;
LibJs.System.extendObject(this, LibJs.Visitor[component.charAt(0).toUpperCase() + component.substr(1)] || {});
}
}


LibJs.Server = {
connectionId: null,
_transactions: {},
_tocId: null,
_queue: [],
_requests: {},
_lock: false,
start: function() {
do
var transaction = LibJs.createId();
while (this._transactions[transaction]);
this._transactions[transaction] = '';
return transaction;
},
send: function(action, transaction) {
this._transactions[transaction] += '<call type="' + action.type + '">';
for (var index in action)
if (index != 'type')
this._transactions[transaction] += '<argument name="' + index + '">' + action[index] + '</argument>';
this._transactions[transaction] += '</call>';
},
commit: function(transaction, onComplete, onError, serverUrl) {
if (!this.connectionId)
this.connectionId = 'c' + LibJs.createId();
if (this._transactions[transaction] == '') {
(onComplete || (function(){}))();
delete this._transactions[transaction];
} else {
if (this._lock)
return setTimeout(LibJs.System.bind(LibJs.Server, LibJs.Server.commit, transaction, onComplete, onError, serverUrl), 10);
this._lock = true;
url = serverUrl || LibJs.Config.protocol + '/js';
if (this._requests[url]) {
++this._requests[url].threads;
this._requests[url].requests.push({
transaction: transaction,
onComplete: onComplete || (function(){}),
onError: onError
});
} else
this._requests[url] = {
threads: 1,
requests: [{
transaction: transaction,
onComplete: onComplete || (function(){}),
onError: onError
}]
};
setTimeout(LibJs.System.bind(LibJs.Server, LibJs.Server.__commit, url), 100);
this._lock = false;
}
},
__commit: function(url) {
if (this._lock)
return setTimeout(LibJs.System.bind(LibJs.Server, LibJs.Server.__commit, url), 10);
this._lock = true;
if (--this._requests[url].threads == 0) {
var postBody = 'request=<?xml version="1.0" encoding="utf-8"?>'
+ '<request connectionId="' + this.connectionId + '" dbDebugger="' + (LibJs.Config.Debug.database ? 'yes' : 'no') + '">';
var isErrorHandler = false;
for (var i = 0; i < this._requests[url].requests.length; ++i) {
postBody += this._transactions[this._requests[url].requests[i].transaction];
isErrorHandler = isErrorHandler || this._requests[url].requests[i].onError;
delete this._transactions[this._requests[url].requests[i].transaction];
}
postBody += '</request>';
if (LibJs.Config.Debug.request)
document.getElementsByTagName('body')[0].appendChild($E('pre', { children: [$T(postBody), $E('hr')]}));
LibJs.System.sendAjaxRequest(LibJs.Config.baseDir + url + '/request', {
requestHeaders: document.cookie ? ['Cookie', document.cookie] : [],
postBody: postBody,
method: 'post',
onComplete: LibJs.System.bind(LibJs.Server, LibJs.Server.__aggregatedComplete, this._requests[url].requests),
onError: isErrorHandler ? LibJs.System.bind(LibJs.Server, LibJs.Server.__aggregatedError, this._requests[url].requests) : false
});
this._requests[url] = null;
}
this._lock = false;
},
__aggregatedComplete: function(request) {
for (var i = 0; i < request.length; ++i)
request[i].onComplete();
delete request;
},
__aggregatedError: function(request) {
for (var i = 0; i < request.length; ++i)
if (request[i].onError)
request[i].onError();
delete request;
},
__onComplete: function(tocId) {
if (this._tocId && this._tocId != tocId) {
var transaction = this.start();
this.send({ type: 'sync', tocId: this._tocId }, transaction);
LibJs.Server.commit(transaction);
}
this._tocId = tocId;
}
}


LibJs.Notify = {
_widgetIds: {},
_queue: [],
_events: ['set', 'add', 'added', 'remove', 'removed', 'swap', 'swaped'],
_lock: false,
observeAll: function (observerId, widgetId, callback) {
for (var i = 0; i < this._events.length; i++)
this.observe(observerId, widgetId, callback, this._events[i]);
},
observe: function (observerId, widgetId, callback, event) {
if (!this._widgetIds[widgetId])
this._widgetIds[widgetId] = [];
this._widgetIds[widgetId].push({ event: event, id: observerId, callback: callback})
},
notifyAll: function(widgetId) {
for (var i = 0; i < this._events.length; i++)
this.notify(widgetId, this._events[i]);
},
notify: function (widgetId, event) {
for (var i = 0; i < this._queue.length; i++)
if (this._queue[i].widgetId == widgetId && this._queue[i].event == event)
return;
this._queue.push({widgetId: widgetId, event: event});
},
__execute: function () {
if (this._lock)
return;
this._lock = true;
for (var i = 0; i < this._queue.length; i++)
if (this._widgetIds[this._queue[i].widgetId]) {
var validNodes = [];
for (var j = 0; j < this._widgetIds[this._queue[i].widgetId].length; j++)
if (LibJs.is(this._widgetIds[this._queue[i].widgetId][j].id)) {
if (this._widgetIds[this._queue[i].widgetId][j].event == this._queue[i].event)
this._widgetIds[this._queue[i].widgetId][j].callback(this._queue[i].widgetId, this._queue[i].event);
validNodes.push(this._widgetIds[this._queue[i].widgetId][j]);
}
this._widgetIds[this._queue[i].widgetId] = validNodes;
}
this._queue = [];
this._lock = false;
}
}


LibJs.Lang = {
_data: {},
_fullData: {},
code: null,
getText: function(component, name, vars)  {
if (!this._data[component])
this._data[component] = {};
if (!this._data[component][name])
this._data[component][name] = {};
if (!this._data[component][name][LibJs.Lang.code]) {
this._data[component][name][LibJs.Lang.code] = LibJs.Compiler.toAscii(component) + '.' + LibJs.Compiler.toAscii(name);
if (vars) {
this._data[component][name][LibJs.Lang.code] += '[';
for (var index in vars)
this._data[component][name][LibJs.Lang.code] += index + ':$' + index + ',';
this._data[component][name][LibJs.Lang.code] = this._data[component][name][LibJs.Lang.code].substr(0, this._data[component][name][LibJs.Lang.code].length - 1) + ']';
}
if (LibJs.Config.Debug.consolelog)
console.log('Unknown: $S(\'' + component + '\',\'' + name + '\')');
}
if (typeof this._data[component][name][LibJs.Lang.code] == 'object') {
if (this._data[component][name][LibJs.Lang.code].length)
this._data[component][name][LibJs.Lang.code] = this._data[component][name][LibJs.Lang.code][0].textContent;
if (LibJs.Config.Debug.consolelog)
console.log('$ST(...) instead of $S(' + component + ',' + name + ')');
}
var value = LibJs.Compiler.fromAscii(String(this._data[component][name][LibJs.Lang.code]));
for (var index in vars || {})
value = value.replace(new RegExp('\\$' + index), vars[index]);
if (LibJs.Config.Debug.lang)
value += ' (' + component + ', ' + name + ')';
return value;
},
getTextNode: function(component, name, vars)  {
if (!this._data[component])
this._data[component] = {};
if (!this._data[component][name])
this._data[component][name] = {};
if (!this._data[component][name][LibJs.Lang.code]) {
var text = LibJs.Compiler.toAscii(component) + '.' + LibJs.Compiler.toAscii(name);
if (vars) {
text += '[';
for (var index in vars)
text += index + ':$' + index + ',';
text = text.substr(0, text.length - 1) + ']';
}
this._data[component][name][LibJs.Lang.code] = [$T(text)];
if (LibJs.Config.Debug.consolelog)
console.log('Unknown: $ST(\'' + component + '\',\'' + name + '\')');
}
if (typeof this._data[component][name][LibJs.Lang.code] == 'string') {
this._data[component][name][LibJs.Lang.code] = [$T(LibJs.Compiler.toAscii(component) + '.' + LibJs.Compiler.toAscii(name) + '(Error: wrong string type)')];
if (LibJs.Config.Debug.consolelog)
console.log('$S(...) instead of $ST(' + component + ',' + name + ')');
}
if (this._data[component][name][LibJs.Lang.code].length == 1)
var node = this._data[component][name][LibJs.Lang.code][0];
else
var node = $E('span', { children: this._data[component][name][LibJs.Lang.code]});
return this.replaceVarsInNode(node.cloneNode(true), component, name, vars);
return node;
},
replaceVarsInNode: function(node, component, name, vars) {
switch (node.nodeType) {
case 1:
for (var i = 0; i < node.childNodes.length; ++i)
this.replaceVarsInNode(node.childNodes[i], component, name, vars);
break;
case 3:
for (var index in vars || {})
node.nodeValue = node.nodeValue.replace(new RegExp('\\$' + index), vars[index]);
if (LibJs.Config.Debug.lang)
node.nodeValue += ' (' + component + ', ' + name + ')';
}
return node;
},
setText: function(code, component, name, value, async, flag, transaction) {
if (!this._data[component])
this._data[component] = {};
if (typeof this._data[component][name] == 'undefined')
this._data[component][name] = {};
this._data[component][name][code] = value = LibJs.Compiler.toAscii(value);
if (flag != 'wiki')
value = value.replace(/</ig, '#lt;').replace(/>/ig, '#gt;');
LibJs.Server.send({
type: 'setText',
component: component,
name: LibJs.Compiler.toAscii(name).replace(/</ig, '#lt;').replace(/>/ig, '#gt;'),
code: code,
value: value,
flag: flag
}, transaction);
if (
typeof this._fullData[component][name] != 'undefined' &&
typeof this._fullData[component][name][1][code] != 'undefined' &&
this._fullData[component][name][1][code][1] != async
)
LibJs.Server.send({
type: 'setAsync',
component: component,
name: LibJs.Compiler.toAscii(name).replace(/</ig, '#lt;').replace(/>/ig, '#gt;'),
code: code,
async: async
}, transaction);
if (typeof this._fullData[component][name] == 'undefined')
this._fullData[component][name] = [flag, {code: [value, async]}, []];
else {
this._fullData[component][name][0] = flag;
this._fullData[component][name][1][code] = [value, async];
}
},
deleteText: function(component, name, transaction) {
if(this._fullData[component][name])
delete this._fullData[component][name];
LibJs.Server.send({
type: 'deleteText',
component: component,
name: LibJs.Compiler.toAscii(name).replace(/</ig, '#lt;').replace(/>/ig, '#gt;')
}, transaction);
},
getTextRecord: function(component, name)  {
return this._fullData[component][name];
},
getComponents: function() {
var names = [];
for (var index in this._fullData)
names.push(index);
return names;
},
getTextNames: function(component) {
var names = [];
if (!this._fullData[component])
return [];
for (var index in this._fullData[component])
names.push(index);
return names;
},
__setText: function(component, data) {
if (!this._data[component])
this._data[component] = {};
LibJs.System.extendObject(this._data[component], data);
},
__setAllTexts: function(data) {
this._fullData = data;
}
}


LibJs.Factory = {
definitions: {},
roots: {},
widgets: {},
queries: {},
logs: {},
createWidget: function(type, parentId, transaction) {
var children = {};
for (var index in this.definitions[type].children)
children[index] = [];
var widget = new LibJs.Factory.Widget(LibJs.createId(), type, [], {r: 'y', w: 'y', g: 'n', a: 'y', m: 'n', k: 'n'}, [], children, LibJs.System.cloneObject(this.definitions[type].variables));
this.widgets[widget.id] = widget;
LibJs.Server.send({ type: 'create', parentId: parentId, widgetId: widget.id, widgetType: widget.type }, transaction);
widget.setVariable(widget.getTitle(), type, transaction);
for (var i = 0; i < this.definitions[type].variables.length; ++i)
if (
typeof widget.varTypes != 'undefined' &&
typeof widget.varTypes[this.definitions[type].variables[i]] != 'undefined' &&
typeof widget.varTypes[this.definitions[type].variables[i]].defaultValue != 'undefined'
)
widget.setVariable(this.definitions[type].variables[i], widget.varTypes[this.definitions[type].variables[i]].defaultValue, transaction);
$W(parentId).appendWidget(widget.id);
return widget.id;
},
deleteWidget: function(widgetId, transaction) {
for (var i = 0; i < this.widgets[widgetId].parents.length; i++)
for (var index in this.widgets[this.widgets[widgetId].parents[i]].children) {
this.widgets[this.widgets[widgetId].parents[i]].children[index] = LibJs.System.withoutItem(this.widgets[this.widgets[widgetId].parents[i]].children[index], widgetId);
LibJs.Notify.notify(this.widgets[widgetId].parents[i], 'remove')
}
var stack = [widgetId];
while (stack.length > 0) {
childId = stack.shift();
if (this.widgets[childId]) {
stack = stack.concat(this.widgets[childId].getAllChildren());
if (delete this.widgets[childId] == false)
throw new LibJs.Exception(new Error(), 'LibJs.Factory.001', childId, [childId]);
}
}
LibJs.Server.send({ type: 'delete', widgetId: widgetId }, transaction);
},
useWidget: function(widgetId, transaction) {
if (!this.widgets[widgetId])
LibJs.Server.send({ type: 'fetchWidget', widgetId: widgetId }, transaction);
},
useWidgetIfExists: function(widgetId, transaction) {
if (!this.widgets[widgetId])
LibJs.Server.send({ type: 'fetchWidgetIfExists', widgetId: widgetId }, transaction);
},
useWidgetChildren: function(widgetId, transaction) {
if (!this.widgets[widgetId])
return LibJs.Server.send({ type: 'fetchChildren', widgetId: widgetId }, transaction);
for (var i = 0; i < this.widgets[widgetId].getAllChildren().length; i++)
if (!this.widgets[this.widgets[widgetId].getAllChildren()[i]])
return LibJs.Server.send({ type: 'fetchChildren', widgetId: widgetId }, transaction);
},
useWidgetAncestors: function(widgetId, transaction) {
var stack = [widgetId];
while (stack.length > 0) {
if (!this.widgets[stack[0]])
return LibJs.Server.send({ type: 'fetchAncestors', widgetId: widgetId }, transaction);
stack = stack.concat($W(stack.shift()).parents);
}
},
useRoots: function(storeName, transaction) {
if (!this.roots[storeName])
return LibJs.Server.send({ type: 'fetchRoots', store: storeName }, transaction);
},
sendQuery: function(query, transaction) {
var queryId = LibJs.createId();
LibJs.Server.send({type: 'query', queryId: queryId, query: LibJs.Compiler.toAscii(query.replace(/[*]/ig, '%').replace(/\?/ig, '_'))}, transaction);
return queryId;
},
findUser: function(pattern, transaction) {
var queryId = LibJs.createId();
LibJs.Server.send({type: 'finduser', queryId: queryId, pattern: LibJs.Compiler.toAscii(pattern.replace(/[*]/ig, '%').replace(/\?/ig, '_'))}, transaction);
return queryId;
},
widgetsByAncestor: function(widgetid, transaction) {
var queryId = LibJs.createId();
LibJs.Server.send({type: 'fetchwidgetsbyancestor', queryId: queryId, widgetId: widgetid}, transaction);
return queryId;
},
__sync: function(changes) {
var transaction = LibJs.Server.start();
for (var i = 0; i < changes.length; i++)
if (this.widgets[changes[i]])
LibJs.Server.send({ type: 'fetchWidget', widgetId: changes[i] }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__notifySync, changes));
},
__notifySync: function(changes) {
for (var i = 0; i < changes.length; i++)
LibJs.Notify.notifyAll(changes[i]);
},
__atExit: function() {
for (var widgetId in this.widgets)
delete this.widgets[widgetId];
}
}


LibJs.Exception = LibJs.System.createClass();
LibJs.System.extendObject(LibJs.Exception, {
instances: []
});
LibJs.Exception.prototype = {
initialize: function(error, code, nodeId, parameters) {
LibJs.System.extendObject(this, { line: error.lineNumber, stack: error.stack, code: code || 0, nodeId: nodeId || null, parameters: parameters || [] });
LibJs.Exception.instances.push(error);
}
}


LibJs.Event = LibJs.System.createClass();
LibJs.System.extendObject(LibJs.Event, {
_instances: [],
register: function(event) {
this._instances.push(event);
},
__atExit: function() {
for (var i = 0; i < this._instances.length; i++)
delete this._instances[i];
}
});
LibJs.Event.prototype = {
initialize: function(nodeId, options) {
LibJs.Event.register(this);
LibJs.System.extendObject(this, { nodeId: nodeId, type: options.type, event: options.event || 'click', arguments: options.arguments || null, name: options.name, callback: options.callback });
switch (this.type) {
case 'ancestors':
this.observer = LibJs.System.bind($L(nodeId), $L(nodeId).callFromAncestors, this.name, this.arguments);
break;
case 'this':
this.observer = LibJs.System.bind($L(nodeId), $L(nodeId)[this.name], this.arguments);
break;
default:
this.observer = this.callback;
}
this.invokeByEvent = LibJs.System.bindAsEventListener(this,  function(event) {
try {
this.instance = event;
this.observer(this);
} catch (error) {
LibJs.XWin.openError(error, '');
}
});
},
element: function() {
return this.instance.target || this.instance.srcElement;
},
isLeftClick: function() {
return (((this.instance.which) && (this.instance.which == 1)) || ((this.instance.button) && (this.instance.button == 1)));
},
pointer: function() {
return [
this.instance.pageX || (this.instance.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)),
this.instance.pageY || (this.instance.clientY + (document.documentElement.scrollTop || document.body.scrollTop))
];
},
keyCode: function() {
if(this.instance.which)
return this.instance.which;
if(this.instance.keyCode)
return this.instance.keyCode;
return 0;
},
stop: function() {
if (this.instance.preventDefault) {
this.instance.preventDefault();
this.instance.stopPropagation();
} else {
this.instance.returnValue = false;
this.instance.cancelBubble = true;
}
},
invoke: function() {
return this.observer(this);
},
observe: function(element) {
if (element.addEventListener)
element.addEventListener(this.event, this.invokeByEvent, false);
else if (element.attachEvent)
element.attachEvent('on' + this.event, this.invokeByEvent);
return element;
},
observeSet: function(list) {
for (var i = 0; i < list.length; i++)
this.observe(list[i]);
return list;
},
stopObserving: function(element) {
if (element.removeEventListener)
element.removeEventListener(this.event, this.invokeByEvent, false);
else if (element.detachEvent)
element.detachEvent('on' + this.event, this.invokeByEvent);
}
}


LibJs.Daemon = {
_events: [],
currentlyExecuting: false,
start: function() {
this.handler = setInterval(LibJs.System.bind(this, this.onTimerEvent), 50);
},
addEvent: function(callback, frequency) {
this._events.push({callback: callback, frequency: frequency, time: Date.parse(new Date())})
},
onTimerEvent: function() {
if (!this.currentlyExecuting) {
this.currentlyExecuting = true;
for (var i = 0; i < this._events.length; i++)
if (this._events[i].time + this._events[i].frequency < Date.parse(new Date()))
try {
this._events[i].time = Date.parse(new Date());
this._events[i].callback();
} catch(e) {}
this.currentlyExecuting = false;
}
}
}



LibJs.System.extendObject(LibJs.Config, {
Debug: {
database: false,
collector: false,
request: false,
compiler: false,
tree: false,
consolelog: false,
lang: false,
widgetmultiplier: false
},
protocol: location.pathname.lastIndexOf('/dyn/') == -1 ? 'adm' : 'dyn',
baseDir: location.pathname.substring(0,Math.max(location.pathname.lastIndexOf('/dyn/'),location.pathname.lastIndexOf('/adm/'))) + '/'
});


LibJs.Component = LibJs.System.createClass();
LibJs.System.extendObject(LibJs.Component, {
loading: {},
create: function(name, options, base, fetchCommand) {
var component = new LibJs.Component(name, options);
if (typeof base[name.charAt(0).toUpperCase() + name.substr(1)] == 'object') {
if (navigator.appVersion.match(/Konqueror|Safari|KHTML/))
component.__load(base);
else
setTimeout(LibJs.System.bind(component, component.__load, base), 10);
} else {
if (!this.loading[name]) {
this.loading[name] = [];
LibJs.System.sendAjaxRequest(LibJs.Config.baseDir + 'shr/' + fetchCommand + '/' + name, {onComplete: LibJs.System.bind(this, this.__load, name, base)});
LibJs.XWin.openLoading();
}
this.loading[name].push(component.id);
}
return component.id;
},
__load: function(name, base) {
LibJs.XWin.closeLoading();
for (var i = 0; i < this.loading[name].length; i++)
$L(this.loading[name][i]).__load(base);
delete this.loading[name];
}
});
LibJs.Component.prototype = {
initialize: function(name, options) {
this.name = name;
this.id = LibJs.register(this);

this.parent = (options || []).parent || '';
this.opacity = 0;
this.events = [];
this.labels = {};
this.stateStack = [];
this.states = {};
this._set = [];
this._initialize(options);
},
_initialize: function(options) {
options = LibJs.System.extendObject({states: {}, events: [], children: [], labels: {}, properties: {}}, options || {});
this.widgetId = options.widgetId || this.widgetId;
this.fade = options.fade || this.fade || 0;
this.visitor = options.visitor || this.visitor || {};
for (var i = 0; i < options.children.length; i++)
this.setLabel(options.children[i], options.children[i]);
for (var i in options.labels)
this.setLabel(i, options.labels[i]);
for (var i in options.states)
this.states[i] = options.states[i];
this.properties = LibJs.System.extendObject((this.properties || {}), options.properties);
for (var i = 0; i < options.events.length; i++)
this.events.push(new LibJs.Event(this.id, options.events[i]));
},
getOptions: function() {},
load: function() {},
loaded: function() {},
__load: function(base) {
LibJs.System.extendObject(this, base[this.name.charAt(0).toUpperCase() + this.name.substr(1)]);
this.visitor = LibJs.System.extendObject(LibJs.Visitor.create(this.id, this.name), this.visitor);
this._initialize(this.getOptions());
this.states['created'] = new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onCreate)});
this.load();
this.setState('created');
for (var i = 0; this.fade && i <= 10; ++i)
setTimeout(LibJs.System.bind(this, function(value) { this.opacity = value; this.setOpacity(this.opacity);}, i / 10), i * this.fade / 10);
this.loaded();
},
callFromAncestors: function(name, arguments) {
try {
if (typeof this[name] == 'function')
return this[name](arguments);
else if (this.parent)
return $L(this.parent).callFromAncestors(name, arguments);
} catch (error) {
LibJs.XWin.openError(error, '');
}
},
setOpacity: function(value) {
for (var i = 0; i < this._set.length; i++) {
this._set[i].style.opacity = String(value);
this._set[i].style.MozOpacity = String(value);
this._set[i].style.KhtmlOpacity = String(value);
this._set[i].style.filter = 'alpha(opacity=' + String(value * 100) + ')';
this._set[i].style.display = '';
}
},
getDomSet: function(force) {
if (force || this._set.length == 0) {
if (this.stateStack.length)
this._set = this.states[this.stateStack[0]].invoke();
else
this._set = [$E('span')];
for (var i = 0; i < this.events.length; i++)
this.events[i].observeSet(this._set);
if (this.face && this.opacity < 1)
this.setOpacity(this.opacity);
}
return this._set;
},
getLabelsDomSet: function(labels) {
for (var set = [], i = 0; i < labels.length; i++)
set = set.concat($D(this.labels[labels[i]]));
return set;
},
repaint: function() {
if (this._set.length > 0 && this._set[0].parentNode) {
var node = this._set[0];
var parentNode = node.parentNode;
for (var i = 1; i < this._set.length; i++)
this._set[i].parentNode.removeChild(this._set[i]);
this.getDomSet(true);
if (node.parentNode) {
for (var i = 0; i < this._set.length; i++)
node.parentNode.insertBefore(this._set[i], node);
node.parentNode.removeChild(node);
} else
for (var i = 0; i < this._set.length; i++)
parentNode.appendChild(this._set[i]);
} else if (this._set.length == 0 && this.parent && this.getDomSet(true).length > 0) {
$L(this.parent).repaint();
} else
this._set = [];
},
deleteLabel: function(label) {
if (this.labels[label]) {
LibJs.remove(this.labels[label]);
delete this.labels[label];
}
},
setLabel: function(label, newChild) {
if (this.labels[label])
LibJs.remove(this.labels[label]);
this.labels[label] = newChild;
$L(newChild).parent = this.id;
return newChild;
},
getChildren: function() {
children = [];
for (i in this.labels)
children.push(this.labels[i]);
return children;
},
setState: function(state) {
this.stateStack.unshift(state);
this.repaint();
},
setStateBefore: function(nr) {
if (this.stateStack.length)
this.stateStack = this.stateStack.slice(nr);
this.repaint();
},
getState: function() {
return this.stateStack.length ? this.stateStack[0] : '';
},
onCreate: function() {
return [$E('span')];
}
}


LibJs.Compiler = LibJs.System.createClass();
LibJs.System.extendObject(LibJs.Compiler, {
_instances: {},
_callbacks: [],
loaded: false,
load: function(callback) {
if (this.loaded)
return (callback || (function(){}))();
if (this._callbacks.length == 0) {
LibJs.XWin.openLoading();
LibJs.System.sendAjaxRequest(LibJs.Config.baseDir + 'shr/fetchCompiler', {onComplete: LibJs.System.bind(this, this.__load)});
}
this._callbacks.push(callback || (function(){}));
},
__load: function() {
this.loaded = true;
LibJs.XWin.closeLoading();
for (var i = 0; i < this._callbacks.length; i++)
this._callbacks[i]();
},
getInstance: function(sourceLang, targetLang) {
if (!this.loaded)
throw new LibJs.Exception(new Error(),'compiler is not loaded!');
if (!this._instances[sourceLang])
this._instances[sourceLang] = {};
if (!this._instances[sourceLang][targetLang])
this._instances[sourceLang][targetLang] = new LibJs.Compiler(
new LibJs.Compiler.Parser.Classes[sourceLang](),
new LibJs.Compiler.Serializer.Classes[targetLang]()
);
return this._instances[sourceLang][targetLang];
},
toAscii: function(input) {
var output = '';
for (var pos = 0; pos < (input || '').length; pos++)
if (input.charCodeAt(pos) < 128 && '&#\n\'%'.indexOf(input.charAt(pos)) == -1)
output += input.charAt(pos);
else
output += '#' + input.charCodeAt(pos) + ';';
return output;
},
fromAscii: function(input) {
var output = '';
for (var pos = 0; pos < (input || '').length; pos++)
if (input.length > pos + 1 && input.charAt(pos) == '#' && '1234567890'.indexOf(input.charAt(pos + 1)) > -1) {
var code = 0;
for (pos++; input.length > pos && '1234567890'.indexOf(input.charAt(pos)) > -1; pos++)
code = 10 * code + parseInt(input.charAt(pos));
output += String.fromCharCode(code);
} else
output += input.charAt(pos);
return output.replace(/#lt;/ig, '<').replace(/#gt;/ig, '>');
}
});
LibJs.Compiler.prototype = {
initialize: function(parser, serializer) {
this.parser = parser;
this.serializer = serializer;
},
compile: function(source) {
if (LibJs.Config.Debug.compiler) {
this.parser.parse(source || '').dump(this.serializer);
}
return this.serializer.serialize(this.parser.parse(source || ''));
}
}


LibJs.Admin = {
installedLangs: {},
installedComponents: [],
backupedLangs: []
}


LibJs.Factory.Widget = LibJs.System.createClass();
LibJs.Factory.Widget.prototype = {
initialize: function(widgetId, type, access, permissions, parents, children, variables) {
LibJs.System.extendObject(this, { id: widgetId, type: type, access: access, permissions: permissions, parents: parents, children: children, _variables: variables, varTypes: {} });
LibJs.System.extendObject(this, LibJs.Factory.Widget[type.charAt(0).toUpperCase() + type.substr(1)]);
this.load();
LibJs.Factory.widgets[widgetId] = this;
},
load: function() {},
isAccess: function(mode) {
return (LibJs.user == 'webGod' || this.permissions[mode] == true);
},
setAccess: function(group, rule, access, transaction) {
this.access[group] = this.access[group] || {};
this.access[group][rule] = access;
LibJs.Server.send({ type: 'setAccess', group: group, widgetId: this.id, rule: rule, access: access }, transaction);
for (var i = 0, active = false; i < 6; i++)
active = active || (this.access[group][['r', 'w', 'g', 'a', 'm', 'k'][i]] != 'i');
if (!active)
delete this.access[group];
},
getVariable: function(name) {
return LibJs.Compiler.fromAscii(this._variables[name]);
},
setVariable: function(name, value, transaction) {
if (this._variables[name] != LibJs.Compiler.toAscii(String(value))) {
this._variables[name] = LibJs.Compiler.toAscii(String(value));
if (transaction)
LibJs.Server.send({ type: 'save', widgetId: this.id, name: name, value: LibJs.Compiler.toAscii(String(value)) }, transaction);
LibJs.Notify.notify(this.id, 'set');
}
},
getSiblings: function(widgetId) {
var children = [];
for (var index in this.children)
if (LibJs.System.indexOfItem(this.children[index], widgetId) > -1)
return this.children[index];
return [];
},
getAllChildren: function() {
var children = [];
for (var index in this.children)
children = children.concat(this.children[index]);
return children;
},
appendWidget: function(widgetId, transaction) {
for (var index in LibJs.Factory.definitions[this.type].children)
for (var i = 0; i < LibJs.Factory.definitions[this.type].children[index].length; i++)
if (LibJs.Factory.definitions[this.type].children[index][i] == $W(widgetId).type)
var childType = index;
if (LibJs.System.indexOfItem(this.children[childType], widgetId) > -1)
return;
this.children[childType].push(widgetId);
$W(widgetId).parents.push(this.id);
$W(widgetId).permissions = {r: false, w: false, g: false, a: false, m: false, k: false};
for (var i = 0; i < $W(widgetId).parents.length; i++)
for (var j = 0, rules = ['r', 'w', 'g', 'a', 'm', 'k'];  j < rules.length; j++)
if (LibJs.Factory.widgets[$W(widgetId).parents[i]])
$W(widgetId).permissions[rules[j]] = $W(widgetId).permissions[rules[j]] || $W($W(widgetId).parents[i]).permissions[rules[j]];
if (transaction)
LibJs.Server.send({ type: 'connect', parentId: this.id, childId: widgetId }, transaction);
LibJs.Notify.notify(this.id, 'add');
LibJs.Notify.notify(widgetId, 'added');
},
remove: function(childId, transaction) {
$W(childId).parents = LibJs.System.withoutItem($W(childId).parents, this.id);
for (var index in this.children)
this.children[index] = LibJs.System.withoutItem(this.children[index], childId);
$W(childId).permissions = {r: false, w: false, g: false, a: false, m: false, k: false};
for (var i = 0; i < $W(childId).parents.length; i++)
for (var j = 0, rules = ['r', 'w', 'g', 'a', 'm', 'k']; j < rules.length; j++)
if (LibJs.Factory.widgets[$W(childId).parents[i]])
$W(childId).permissions[rules[j]] = $W(childId).permissions[rules[j]] || $W($W(childId).parents[i]).permissions[rules[j]];
if (transaction)
LibJs.Server.send({ type: 'disconnect', parentId: this.id, childId: childId }, transaction);
LibJs.Notify.notify(this.id, 'remove')
LibJs.Notify.notify(childId, 'removed')
},
swap: function(lowerId, upperId, transaction) {
for (var index in this.children)
if (LibJs.System.indexOfItem(this.children[index], lowerId) > -1)
this.children[index] = LibJs.System.swapItems(this.children[index], lowerId, upperId);
LibJs.Server.send({ type: 'swap', parentId: this.id, upperId: upperId, lowerId: lowerId }, transaction);
LibJs.Notify.notify(this.id, 'swap')
LibJs.Notify.notify(lowerId, 'swaped')
LibJs.Notify.notify(upperId, 'swaped')
},
getTitle: function() {
return 'title';
},
getTitleStr: function() {
return this.getVariable(this.getTitle());
}
}


LibJs.Factory.Component = {


}


LibJs.XWin.Component = {
__getOptions: function() {},
getOptions: function() {
options = this.__getOptions() || {};
if (window.innerHeight && window.innerWidth)
options.properties = LibJs.System.extendObject(
{innerWidth: innerWidth, innerHeight: innerHeight, scrollOffset: pageYOffset}, options.properties || {}
);
else if(document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
options.properties = LibJs.System.extendObject(
{innerWidth: document.documentElement.clientWidth, innerHeight: document.documentElement.clientHeight, scrollOffset: document.documentElement.scrollTop}, options.properties || {}
);
else
options.properties = LibJs.System.extendObject(
{innerWidth: document.body.offsetWidth, innerHeight: document.body.offsetHeight, scrollOffset: document.body.scrollTop}, options.properties || {}
);
options.states = LibJs.System.extendObject({closed: new LibJs.Event(this.id, { type: 'call', callback: LibJs.System.bind(this, this.onClose)})}, options.states || {});
options.events = (options.events || []).concat([new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.placeInFront)})]);
return options;
},
placeInFront: function(e) {
if (this.properties.zindex < LibJs.XWin.getWinZ()) {
this.properties.zindex = String(LibJs.XWin.getNextWinZ());
$D(this.id)[0].style.zIndex = this.properties.zindex;
}
},
startMove: function(e) {
this.placeInFront(e);
this.properties.leftStartOffset = e.pointer()[0] - $D(this.id)[0].offsetLeft;
},
move: function(e) {
var layer = $D(this.id)[0];
if (e.pointer()[0] - this.properties.leftStartOffset > 0)
this.properties.left = (e.pointer()[0] - this.properties.leftStartOffset);
else
this.properties.left = 0;
if ((e.pointer()[1] - 8) > 0)
this.properties.top = (e.pointer()[1] - 8);
else
this.properties.top = 0;
layer.style.left = this.properties.left + 'px';
layer.style.top = this.properties.top + 'px';
return false;
},
resize: function(e) {
var layer = $D(this.id)[0];
this.properties.width = Math.max(0, e.pointer()[0] - layer.offsetLeft + 4);
this.properties.heigth = Math.max(0, e.pointer()[1] - layer.offsetTop + 4);
layer.style.width = this.properties.width + 'px';
layer.style.height = this.properties.heigth + 'px';
return false;
},
closeComponent: function() {
for (var i = 0; i <= 10; ++i)
setTimeout(LibJs.System.bind(this, this.setOpacity, 1 - i / 10), 15 * i);
setTimeout(LibJs.System.bind(this, this.__closeComponent), 150);
},
__closeComponent: function() {
this.setState('closed');
LibJs.XWin.remove(this.id);
},
onClose: function() {
return [];
}
}


LibJs.Factory.Widget.Ballwrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Ballview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
link: { type: 'selector', store: '.ball', selectableTypes: ['ballroot'], displayTypes: ['ballroot'] }
}
}


LibJs.Factory.Widget.Balltuple = {
getTitle: function() {
return 'nickname';
},
getTitleStr: function() {
var title = $W(this.id).getVariable('nickname');
if (title.length > 0 && ($W(this.id).getVariable('firstname') || $W(this.id).getVariable('lastname')))
title += ', ';
title += $W(this.id).getVariable('firstname') + ' ' + $W(this.id).getVariable('lastname');
return title;
},
varTypes: {
firstname: { type: 'text'},
lastname: { type: 'text'},
nickname: { type: 'text'},
branch: { type: 'text'},
addressline1: { type: 'text'},
zip: { type: 'text'},
city: { type: 'text'},
email: { type: 'text'},
birthdate: { type: 'datetime', year: 'birthyear', month: 'birthmonth', day: 'birthday', yearMin: 1940, yearMax: (new Date()).getFullYear()},
nrtickets: { type: 'text'},
dancecourse: { type: 'selectbox', options: ['none', 'beginner', 'advanced', 'expert']},
haspaid: { type: 'selectbox', options: ['y', 'n']}
}
}


LibJs.Factory.Widget.Ballroot = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Unit = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Nlview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
link: { type: 'selector', store: '.events', selectableTypes: ['nl'], displayTypes: ['eventroot', 'channel', 'nl'] }
}
}


LibJs.Factory.Widget.Nl = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Eventwrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Eventview = {
canSetAccess: true,
varTypes: {
title: { type: 'text'},
starttype: { type: 'selectbox', options: ['startnow', 'startweek', 'startmonth', 'start2month', 'start3month', 'start4month', 'start6month', 'startyear', 'startinfinity']},
endtype: { type: 'selectbox', options: ['endnow', 'endweek', 'endmonth', 'end2month', 'end3month', 'end4month', 'end6month', 'endyear', 'endinfinity']},
link: { type: 'selector', store: '.events', selectableTypes: ['unit'], displayTypes: ['eventroot', 'unit'] }
}
}


LibJs.Factory.Widget.Eventroot = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Email = {
getTitle: function() {
return 'address';
},
varTypes: {
address: { type: 'text'},
registerdate: { type: 'datetime', year: 'registeryear', month: 'registermonth', day: 'registerday', hour: 'registerhour', minute: 'registerminute' }
}
}


LibJs.Factory.Widget.Channel = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Blogview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
archive: { type: 'selector', store: LibJs.Config.domainName, selectableTypes: ['blogview'], displayTypes: ['page', 'frame', 'col', 'blogview'] },
link: { type: 'selector', store: '.events', selectableTypes: ['channel'], displayTypes: ['eventroot', 'channel'] },
nrfull: { type: 'text' },
nrabstract: { type: 'text' },
nrtitle: { type: 'text' },
nrentriesperpage: { type: 'text' }
}
}


LibJs.Factory.Widget.Blog = {
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
},
varTypes: {
publishdate: { type: 'datetime', year: 'publishyear', month: 'publishmonth', day: 'publishday', hour: 'publishhour', minute: 'publishminute' },
published: { type: 'selectbox', options: ['y', 'n']},
author: { type: 'selector', store: '.auth', selectableTypes: ['user'] }
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++) {
LibJs.Factory.Widget.Blog.varTypes['title' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Blog.varTypes['abstract' + (i + 1)] = { type: 'wiki' };
LibJs.Factory.Widget.Blog.varTypes['content' + (i + 1)] = { type: 'wiki' };
}


LibJs.Factory.Widget.Anschlagview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
unit: { type: 'selector', store: '.agenda', selectableTypes: ['unit'], displayTypes: ['eventroot', 'unit'] }
}
}


LibJs.Factory.Widget.Agendaview = {
canSetAccess: true,
varTypes: {
title: { type: 'text'},
link: { type: 'selector', store: '.events', selectableTypes: ['unit'], displayTypes: ['eventroot', 'unit'] }
}
}


LibJs.Factory.Widget.Activity = {
canSetAccess: true,
varTypes: {
activitytype: { type: 'selectbox', options: ['event', 'anschlag', 'camp']},
startdate: { type: 'datetime', year: 'startyear', month: 'startmonth', day: 'startday', hour: 'starthour', minute: 'startminute' },
startplace: { type: 'text'},
enddate: { type: 'datetime', year: 'endyear', month: 'endmonth', day: 'endday', hour: 'endhour', minute: 'endminute' },
endplace: { type: 'text'},
internallink: { type: 'selector', store: LibJs.Config.domainName, selectableTypes: ['page'], displayTypes: ['page'] },
externallink: { type: 'text'},
contact: { type: 'text'},
author: { type: 'text'}
},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++) {
LibJs.Factory.Widget.Activity.varTypes['type' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Activity.varTypes['title' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Activity.varTypes['description' + (i + 1)] = { type: 'wiki' };
}


LibJs.Factory.Widget.Faqsection = {
varTypes: {},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++)
LibJs.Factory.Widget.Faqsection.varTypes['title' + (i + 1)] = { type: 'text' };


LibJs.Factory.Widget.Faqitem = {
varTypes: {},
getTitle: function() {
return 'question' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++) {
LibJs.Factory.Widget.Faqitem.varTypes['question' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Faqitem.varTypes['answer' + (i + 1)] = { type: 'wiki' };
}


LibJs.Factory.Widget.Faq = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Image = {
varTypes: {
title: { type: 'text'},
description: { type: 'longtext'},
keywords: { type: 'longtext'},
file: { type: 'image'}
},
getUri: function() {
return LibJs.Config.baseDir + 'shr/view/' + this.id + '.' + this.getVariable('ext');
},
getThumbUri: function() {
return LibJs.Config.baseDir + 'shr/view/' + this.id + '.thumb.' + this.getVariable('ext');
}
}


LibJs.Factory.Widget.Gallerywrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Galleryview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
columns: { type: 'text' },
gallery: { type: 'selector', store: '.gallery', selectableTypes: ['gallery'], displayTypes: ['gallery'] }
}
}


LibJs.Factory.Widget.Gallery = {
canSetAccess: true,
varTypes: {
title: { type: 'text'},
description: { type: 'longtext'},
keywords: { type: 'longtext'}
}
}


LibJs.Factory.Widget.Notice = {
varTypes: {
title: { type: 'text' },
source: { type: 'wiki' }
}
}


LibJs.Factory.Widget.Gardenwrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Gardenview = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Folder = {
canSetAccess: true,
varTypes: {
title: { type: 'text'},
description: { type: 'longtext'},
keywords: { type: 'longtext'}
}
}


LibJs.Factory.Widget.File = {
varTypes: {
title: { type: 'text'},
description: { type: 'longtext'},
keywords: { type: 'longtext'},
file: { type: 'file'}
},
getUri: function() {
return LibJs.Config.baseDir + 'shr/download/' + this.id + '.' + this.getVariable('ext');
}
}


LibJs.Factory.Widget.Downloaditem = {
varTypes: {},
varTypes: {
filelink: { type: 'selector', store: '.garden', selectableTypes: ['file'], displayTypes: ['folder', 'file'] }
},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++) {
LibJs.Factory.Widget.Downloaditem.varTypes['title' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Downloaditem.varTypes['description' + (i + 1)] = { type: 'longtext' };
}


LibJs.Factory.Widget.Download = {
canSetAccess: true,
varTypes: {},
varTypes: {},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++)
LibJs.Factory.Widget.Downloaditem.varTypes['title' + (i + 1)] = { type: 'text' };


LibJs.Factory.Widget.Linklistitem = {
varTypes: {},
varTypes: {
target: { type: 'text', defaultValue: 'http://'}
},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++) {
LibJs.Factory.Widget.Linklistitem.varTypes['title' + (i + 1)] = { type: 'text' };
LibJs.Factory.Widget.Linklistitem.varTypes['description' + (i + 1)] = { type: 'longtext' };
}


LibJs.Factory.Widget.Linklist = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}


LibJs.Factory.Widget.Stat = {
canSetAccess: true,
varTypes: {
title: { type: 'text'}
}
}




LibJs.Factory.Widget.Anschlag = {
varTypes: {
title: { type: 'text', defaultValue: 'Gruppen' + String.fromCharCode(252) + 'bung'},
meinedummevariable: { type: 'dateselector', year: 'startyear', month: 'startmonth', day: 'startday'},
startdate: { type: 'datetime', hour: 'starthour', minute: 'startminute'},
enddate: { type: 'datetime', hour: 'endhour', minute: 'endminute'},
startplace: { type: 'text'},
endplace: { type: 'text'},
mitnehmen: { type: 'text'},
description: { type: 'wiki'},
email: { type: 'text'},
author: { type: 'text'}
}
}


LibJs.Factory.Widget.Wiki = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++)
LibJs.Factory.Widget.Wiki.varTypes['source' + (i + 1)] = { type: 'wiki' };


LibJs.Factory.Widget.User = {
varTypes: {
name: { type: 'text' },
email: { type: 'text' },
passwd: { type: 'password' }
},
getTitle: function() {
return 'name';
}
}


LibJs.Factory.Widget.Redirect = {
varTypes: {
location: { type: 'text'},
target: { type: 'text'}
},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++)
LibJs.Factory.Widget.Redirect.varTypes['title' + (i + 1)] = { type: 'text' };


LibJs.Factory.Widget.Pagewrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Page = {
canSetAccess: true,
varTypes: {},
getTitle: function() {
return 'title' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1);
}
}
for (var i = 0; i < LibJs.Config.lang.length; i++)
LibJs.Factory.Widget.Page.varTypes['title' + (i + 1)] = { type: 'text' };


LibJs.Factory.Widget.Nav = {
canSetAccess: true,
varTypes: {
title: { type: 'text' },
startlevel: { type: 'text' },
endlevel: { type: 'text' }
}
}


LibJs.Factory.Widget.Langmanager = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Group = {
canSetAccess: true,
varTypes: {
name: { type: 'text' }
},
getTitle: function() {
return 'name';
}
}


LibJs.Factory.Widget.Frame = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}


LibJs.Factory.Widget.Col = {
canSetAccess: true,
varTypes: {
title: { type: 'text'},
width: { type: 'text', defaultValue: '100%'}
}
}


LibJs.Factory.Widget.Authwrapper = {
canSetAccess: true,
varTypes: {
title: { type: 'text' }
}
}
LibJs.Lang.__setText('system', {});
LibJs.Lang.__setText('history', {'hist_ttl_t_tocid':{de:[$T(LibJs.Compiler.fromAscii('ID'))]},'hist_ttl_t_time':{de:[$T(LibJs.Compiler.fromAscii('Zeit/Datum'))]},'hist_ttl_t_email':{de:[$T(LibJs.Compiler.fromAscii('Email'))]},'hist_ttl_t_action':{de:[$T(LibJs.Compiler.fromAscii('#196;nderung'))]},'hist_ttl_t_name':{de:[$T(LibJs.Compiler.fromAscii('Name'))]},'hist_ttl_t_value':{de:[$T(LibJs.Compiler.fromAscii('Wert'))]}});
LibJs.Lang.__setText('xwin', {});
LibJs.Lang.__setText('visitor', {});
LibJs.Lang.__setText('server', {});
LibJs.Lang.__setText('notify', {});
LibJs.Lang.__setText('lang', {});
LibJs.Lang.__setText('factory', {});
LibJs.Lang.__setText('exception', {});
LibJs.Lang.__setText('event', {});
LibJs.Lang.__setText('deamon', {});
LibJs.Lang.__setText('config', {});
LibJs.Lang.__setText('component', {'apply':{de:'#220;bernehmen'},'back':{de:'Zur#252;ck'},'cancel':{de:'Abbrechen'},'close':{de:'Schliessen'},'form_btn_cancel':{de:'Abbrechen'},'form_btn_exec':{de:'Ausf#252;hren'},'form_btn_save':{de:'Speichern'},'loading':{de:'Laden'},'no':{de:'nein'},'save':{de:'Speichern'},'std_btn_cancel':{de:'Abbrechen'},'std_btn_close':{de:'Schliessen'},'std_btn_delete':{de:'L#246;schen'},'std_btn_no':{de:'Nein'},'std_btn_remove':{de:'Entfernen'},'std_btn_save':{de:'Speichern'},'std_btn_submit':{de:'Abschicken'},'std_btn_yes':{de:'Ja'},'std_msg_loading':{de:'Lade ...'},'yes':{de:'Ja'},'std_msg_s_loading':{de:'Lade ...'},'std_msg_t_loading':{de:[$T(LibJs.Compiler.fromAscii('Lade ...'))]}});
LibJs.Lang.__setText('compiler', {});
LibJs.Lang.__setText('admin', {'admin_ttl_area':{de:'Adminbereich'},'admin_ttl_lang':{de:'Lang'},'admin_ttl_stores':{de:'Stores'},'export':{de:'Exportieren $lang'},'lang_btn_import':{de:'Importieren'},'lang_cap_export':{de:[$T(LibJs.Compiler.fromAscii('Export'))]},'lang_cap_import':{de:[$T(LibJs.Compiler.fromAscii('Import'))]},'lang_msg_exported':{de:'Sprachexport erfolgreich'},'lang_msg_imported':{de:'Sprachimport erfolgreich'},'link_ttl_dyn':{de:[$T(LibJs.Compiler.fromAscii('Dynamische Ansicht'))]},'link_ttl_xsl':{de:[$T(LibJs.Compiler.fromAscii('Statische Ansicht'))]},'prefix':{de:[$T(LibJs.Compiler.fromAscii('Prefix'))]},'store_btn_export':{de:'Daten exportieren'},'store_cap_export_prefix':{de:[$T(LibJs.Compiler.fromAscii('Prefix des Exports'))]},'store_msg_exported':{de:'Datenexport erfolgreich'}});
LibJs.Lang.__setText('widget', {});
LibJs.Lang.__setText('ballwrapper', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('ballview', {'no_link_set':{de:'Kein Link gesetzt'},'viewer':{},'manager':{de:'Manager'},'subscribe':{},'place':{de:'Platz'},'birthdate':{de:'Geburtstag'},'dancecourse':{de:'Tanzkurs'},'back':{de:'Zur#252;ck'},'has_subscribed':{},'edit':{de:'Bearbeiten'},'sub_id':{},'firstname':{de:'Vorname'},'lastname':{de:'Nachname'},'nickname':{de:'Pfadiname'},'addressline1':{de:'adresszeile'},'zip_city':{de:'PLZ/Ort'},'email':{de:'Email'},'nrtickets':{de:'Anzahl Tickets'},'haspaid':{de:'bezahlt?'},'db_var_link':{de:'Link'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('balltuple', {'db_var_addressline1':{de:'Adresszeile'},'db_var_birthday':{de:'Geburtsttag'},'db_var_birthmonth':{de:'Geburtsmonat'},'db_var_birthyear':{de:'Geburtsjahr'},'db_var_branch':{de:'Abteilung'},'db_var_city':{de:'Stadt'},'db_var_dancecourse':{de:'Tanzkurs'},'db_var_email':{de:'Email'},'db_var_firstname':{de:'Vorname'},'db_var_haspaid':{de:'bezahlt?'},'db_val_y':{de:'Ja'},'db_val_n':{de:'Nein'},'db_var_lastname':{de:'Nachname'},'db_var_nickname':{de:'Pfadiname'},'db_var_nrtickets':{de:'Anzahl Tickets'},'db_var_zip':{de:'PLZ'}});
LibJs.Lang.__setText('ballroot', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('unit', {'db_var_title':{de:'titel'}});
LibJs.Lang.__setText('nlview', {'send':{de:'Eintragen'},'mail_title':{de:'Newsletter Abmeldung'},'mail_prefix':{de:'Klicke auf folgenden Link um dich aus dem Newsletter definitiv auszutragen: '},'mail_suffix':{de:' '},'subscribe':{de:'eintragen'},'unsubscribe':{de:'austragen'},'no_link_set':{de:'Kein Link gesetzt'},'has_suscribed':{de:'eingetragen'},'has_unsuscribed':{de:'ausgetragen'},'db_var_link':{de:'Link'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('nl', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('eventwrapper', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('eventview', {'add_event_link':{de:'Event Link hinzuf#252;gen'},'edit':{de:'Bearbeiten'},'no_link_set':{de:'Kein Link gesetzt'},'edit_event_link':{de:'Event Link Bearbeiten'},'db_var_endtype':{de:'Endtyp'},'db_var_link':{de:'Link'},'db_var_starttype':{de:'Starttyp'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('eventroot', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('email', {'db_var_address':{de:'Adresse'},'db_var_registerday':{de:'Tag'},'db_var_registerhour':{de:'Stunde'},'db_var_registerminute':{de:'Minute'},'db_var_registermonth':{de:'Monat'},'db_var_registeryear':{de:'Jahr'},'db_var_rmcode':{de:'Registrierungshash'}});
LibJs.Lang.__setText('channel', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('blogview', {'add_blog_link':{de:'Neuer Eintrag'},'no_link_set':{de:'Kein Link gesetzt'},'show_prev':{de:'zur#252;ck'},'show_next':{de:'weiter'},'edit_blog_link':{de:'Eintrag bearbeiten'},'delete_blog_link':{de:'Eintrag l#246;schen'},'edit':{de:'Bearbeiten'},'delete_confirm_prefix':{de:'Willst du'},'delete_confirm_suffix':{de:'wirklich l#246;schen?'},'publish':{de:'Publizieren'},'publish_confirm_prefix':{de:'Diesen Text als Newsletter versenden?'},'title':{de:'Titel'},'abstract':{de:'Zusammenfassung'},'content':{de:'Inhalt'},'db_var_archive':{de:'Archiv'},'db_var_link':{de:'Link'},'db_var_nrabstract':{de:'Anzahl Zusammenfassung'},'db_var_nrentriesperpage':{de:'Anzahl Eintr#228;ge pro Seite'},'db_var_nrfull':{de:'Anzahl Gesamt'},'db_var_nrtitle':{de:'Anzahl Titel'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('blog', {'db_var_abstract1':{de:'Zusammenfassung DE'},'db_var_abstract2':{de:'Zusammenfassung FR'},'db_var_abstract3':{de:'Zusammenfassung IT'},'db_var_abstract4':{de:'Zusammenfassung EN'},'db_var_abstract5':{},'db_var_abstract6':{},'db_var_author':{de:'Autor'},'db_var_content1':{de:'Inhalt DE'},'db_var_content2':{de:'Inhalt FR'},'db_var_content3':{de:'Inhalt IT'},'db_var_content4':{de:'Inhalt EN'},'db_var_content5':{},'db_var_content6':{},'db_var_publishday':{de:'Tag'},'db_var_published':{de:'Ver#246;ffentlicht'},'db_val_y':{de:'Ja'},'db_val_n':{de:'Nein'},'db_var_publishhour':{de:'Stunde'},'db_var_publishminute':{de:'Minute'},'db_var_publishmonth':{de:'Monat'},'db_var_publishyear':{de:'Jahr'},'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('anschlagview', {'Daten Laden ...':{de:'Daten Laden ...'},'Es ist kein Anschlag vorhanden.':{de:'Es ist kein Anschlag vorhanden.'},'db_var_link':{de:'Link'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('agendaview', {'add_event_link':{de:'Even Link hinzuf#252;gen'},'edit':{de:'Bearbeiten'},'no_link_set':{de:'Kein Link gesetzt'},'edit_event_link':{de:'Event Link bearbeiten'},'delete_event_link':{de:'Event Link l#246;schen'},'delete_confirm_prefix':{de:'L#246;schen?'},'delete_confirm_suffix':{de:'L#246;schen?'},'db_var_link':{de:'Link'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('activity', {'db_var_activitytype':{de:'Aktivit#228;tstyp'},'db_var_author':{de:'Autor'},'db_var_contact':{de:'Kontakt'},'db_var_description1':{de:'Beschreibung DE'},'db_var_description2':{de:'Beschreibung FR'},'db_var_description3':{de:'Beschreibung IT'},'db_var_description4':{de:'Beschreibung EN'},'db_var_description5':{},'db_var_description6':{},'db_var_endday':{de:'Endtag'},'db_var_endhour':{de:'Endstunde'},'db_var_endminute':{de:'Endminute'},'db_var_endmonth':{de:'Endmonat'},'db_var_endplace':{de:'Endplatz'},'db_var_endyear':{de:'Endjahr'},'db_var_externallink':{de:'Externer Link'},'db_var_internallink':{de:'Interner Link'},'db_var_startday':{de:'Starttag'},'db_var_starthour':{de:'Startstunde'},'db_var_startminute':{de:'Startminute'},'db_var_startmonth':{de:'Startmonat'},'db_var_startplace':{de:'Startplatz'},'db_var_startyear':{de:'Startjahr'},'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{},'db_var_type1':{de:'Typ DE'},'db_var_type2':{de:'Typ FR'},'db_var_type3':{de:'Typ IT'},'db_var_type4':{de:'Typ EN'},'db_var_type5':{},'db_var_type6':{}});
LibJs.Lang.__setText('faqsection', {'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('faqitem', {'db_var_answer1':{de:'Antwort DE'},'db_var_answer2':{de:'Antwort FR'},'db_var_answer3':{de:'Antwort IT'},'db_var_answer4':{de:'Antwort EN'},'db_var_answer5':{},'db_var_answer6':{},'db_var_question1':{de:'Frage DE'},'db_var_question2':{de:'Frage FR'},'db_var_question3':{de:'Frage IT'},'db_var_question4':{de:'Frage EN'},'db_var_question5':{},'db_var_question6':{}});
LibJs.Lang.__setText('faq', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('image', {'db_var_description':{de:'Beschreibung'},'db_var_ext':{de:'Dateiendung'},'db_var_file':{de:'Datei'},'db_var_filesize':{de:'Dateigr#246;sse'},'db_var_keywords':{de:'Schlagw#246;rter'},'db_var_lastmodified':{de:'Zuletzt ge#228;ndert'},'db_var_mine':{de:'MIME-Typ'},'db_var_sizex':{de:'Breite'},'db_var_sizey':{de:'H#246;he'},'db_var_thumbsize':{de:'Vorschaugr#246;sse'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('gallerywrapper', {'edit':{de:'Bearbeiten'},'view':{de:'Ansicht'},'upload_images':{de:'Bilder hochladen'},'size':{de:'Gr#246;sse'},'k':{de:'k'},'lastmodified':{de:'Zuletzt ge#228;ndert'},'mime-type':{de:'MIME-Typ'},'dimensions':{de:'Gr#246;ssen'},'db_var_gallery':{de:'Gallerie'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('galleryview', {'go_last':{de:'Zur#252;ck'},'overview':{de:'#220;bersicht'},'go_next':{de:'Weiter'},'db_var_columns':{de:'Spalten'},'db_var_gallery':{de:'Gallerie'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('gallery', {'db_var_description':{de:'Beschreibung'},'db_var_keywords':{de:'Schlagw#246;rter'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('notice', {'db_var_source':{de:'Quelle'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('gardenwrapper', {'edit':{de:'Bearbeiten'},'download':{de:'Herunterladen'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('gardenview', {'folders':{de:'Ordner'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('folder', {'db_var_description':{de:'Beschreibung'},'db_var_keywords':{de:'Schlagw#246;rter'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('file', {'db_var_description':{de:'Beschreibung'},'db_var_ext':{de:'Dateiendung'},'db_var_file':{de:'Datei'},'db_var_filesize':{de:'Dateigr#246;sse'},'db_var_keywords':{de:'Schlagw#246;rter'},'db_var_lastmodified':{de:'Zuletzt Bearbeitet'},'db_var_mine':{de:'MIME-Typ'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('downloaditem', {'db_var_description1':{de:'Beschreibung DE'},'db_var_description2':{de:'Beschreibung FR'},'db_var_description3':{de:'Beschreibung IT'},'db_var_description4':{de:'Beschreibung EN'},'db_var_description5':{},'db_var_description6':{},'db_var_filelink':{de:'Dateilink'},'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('download', {'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('linklistitem', {'db_var_description1':{de:'Beschreibung DE'},'db_var_description2':{de:'Beschreibung FR'},'db_var_description3':{de:'Beschreibung IT'},'db_var_description4':{de:'Beschreibung EN'},'db_var_description5':{},'db_var_description6':{},'db_var_target':{de:'Ziel'},'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('linklist', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('stat', {'activated':{de:'aktiviert'},'browser':{de:'Browser'},'color':{de:'Farbe'},'days_counted':{de:'Anzahl gemessene  Tage'},'db_var_title':{de:'Titel'},'deactivated':{de:'deaktiviert'},'friday':{de:'Freitag'},'general_stats':{de:'Allgemeine Statistik'},'guest':{de:'Gast'},'hits_per_day':{de:'Zugrifffe pro Tag'},'hits_today':{de:'Zugriffe Heute'},'hits_total':{de:'Zugriffe Gesamt'},'hours':{de:'Stunden'},'java':{de:'Java'},'javascript':{de:'Javascript'},'lastmonth':{de:'letzter Monat'},'monday':{de:'Montag'},'operating_system':{de:'Betriebssystem'},'page':{de:'Seite'},'saturday':{de:'Samstag'},'screen_resolution':{de:'Aufl#246;sung'},'sunday':{de:'Sonntag'},'thursday':{de:'Donnerstag'},'tuesday':{de:'Dienstag'},'user':{de:'Benutzer'},'wednesday':{de:'Mittwoch'},'weekdays':{de:'Wochentage'}});
LibJs.Lang.__setText('anschlag', {'modify_anschlag':{de:'Anschlag bearbeiten'},'not_loggedin':{de:'Du bist nicht angemeldet! Um den Anschlag zu #228;ndern musst du dich zuerst Anmelden (rechts oben)'},'view_anschlag':{de:'Anschlag ansehen'},'expired':{de:[$T(LibJs.Compiler.fromAscii('Es wurde noch kein Anschlag geschrieben...'))]},'start':{de:[$T(LibJs.Compiler.fromAscii('Beginn'))]},'end':{de:[$T(LibJs.Compiler.fromAscii('Ende'))]},'mitnehmen':{de:[$T(LibJs.Compiler.fromAscii('Mitnehmen'))]},'db_var_author':{de:'Leiter'},'db_var_description':{de:'Eigener Text (Wenn du dieses Feld ausf#252;llst, wird nur noch dein eigener Text angezeigt z.B f#252;r Ferienanschl#228;ge, Lager etc...)'},'db_var_email':{de:'Emailadresse'},'db_var_endhour':{},'db_var_endminute':{},'db_var_endplace':{de:'Abtreten'},'db_var_mitnehmen':{de:'Mitnehmen'},'db_var_party':{},'db_var_startday':{},'db_var_starthour':{},'db_var_startminute':{},'db_var_startmonth':{},'db_var_startplace':{de:'Antreten'},'db_var_startyear':{},'db_var_title':{de:'#220;berschrift'},'db_var_meinedummevariable':{de:'Datum'},'db_var_startdate':{de:'Beginn'},'db_var_enddate':{de:'Ende'}});
LibJs.Lang.__setText('wiki', {'db_var_source1':{de:'Text DE'},'db_var_source2':{de:'Text FR'},'db_var_source3':{de:'Text IT'},'db_var_source4':{de:'Text EN'},'db_var_source5':{},'db_var_source6':{},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('user', {'db_var_activated':{de:'aktiviert'},'db_var_email':{de:'Email'},'db_var_name':{de:'Name'},'db_var_newpasswd':{de:'neues Passwort'},'db_var_passwd':{de:'Passwort'}});
LibJs.Lang.__setText('redirect', {'db_var_location':{de:'Adresse'},'db_var_target':{de:'Zielfenster'},'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('pagewrapper', {'db_var_title':{de:'Titel'},'edit':{de:'Bearbeiten'},'view':{de:'Ansehen'}});
LibJs.Lang.__setText('page', {'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});
LibJs.Lang.__setText('nav', {'db_var_endlevel':{de:'Ende mit Level'},'db_var_startlevel':{de:'Beginne mit Level'},'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('langmanager', {'db_var_title':{de:'Titel'},'delete_string':{de:'String l#246;schen'},'delete_string_confirm':{de:'String l#246;schen?'},'edit':{de:'Bearbeite'},'edit_string':{de:'String bearbeiten'},'edit_string_head':{de:[$T(LibJs.Compiler.fromAscii('String #39;$name#39; bearbeiten'))]},'edit_string_title':{de:'String bearbeiten: $name'},'langmanager':{de:[$T(LibJs.Compiler.fromAscii('Sprachverwaltung'))]},'scan_js':{de:[$T(LibJs.Compiler.fromAscii('Nach neuen Strings suchen'))]},'scan_js_finished':{de:'Durchsuchen nach neuen Strings fertig'},'setvalues':{de:'Werte setzen'},'vars':{de:[$T(LibJs.Compiler.fromAscii('Variablen'))]},'string':{de:[$T(LibJs.Compiler.fromAscii('String'))]},'wiki':{de:[$T(LibJs.Compiler.fromAscii('Wiki'))]},'async':{de:[$T(LibJs.Compiler.fromAscii('async'))]}});
LibJs.Lang.__setText('group', {'db_var_name':{de:'Name'}});
LibJs.Lang.__setText('frame', {'db_var_title':{de:'Titel'}});
LibJs.Lang.__setText('col', {'db_var_title':{de:'Titel'},'db_var_width':{de:'Breite'}});
LibJs.Lang.__setText('authwrapper', {'db_var_title':{de:'Titel'},'email':{de:'Email'},'find':{de:'Suchen'},'name':{de:'Name'},'permissions_set':{de:'Gesetzte Rechte'},'positions':{de:'Funktionen'},'search':{de:[$T(LibJs.Compiler.fromAscii('Suchen'))]},'search_help':{de:'Es wird nach Benutzername und Email gesucht. (Platzhalter: * und ?)'},'userfinder':{de:'Benutzer suchen'},'userlist':{de:'Liste der Benutzer'}});



LibJs.Visitor.Body = {

getMenuNr: function() {
return 1;
},

getMenu: function() {
return [$C('menu', {widgetId: $L(this.id).active, properties: { type: 'list' }})];
},

getViewer: function() {
return $C('extend', {widgetId: $L(this.id).active, properties: { extend: LibJs.Component.Body.Viewer }});
},

getPageTitle: function() {
return $W($L(this.id).active).getVariable($W($L(this.id).active).getTitle());
},

onCreate: function() {
return [
$E('div', {className: 'LibJsAdminNavbar', children: [
$E('div', {className: 'LibJsAdminNavbarContainer', children: [
$E('div', {className: 'LibJsAdminNavbarLeft', children: [
$E('a', {attributes: { href: '../../xsl/1/'+$L(this.id).active+'.html', target: '_blank'}, children: [
$T('zur Webseite')
]})
]}),
$E('div', {className: 'LibJsAdminNavbarRight', children:
$D($L(this.id).labels.login)
})
]})
]}),
$E('div', {className: 'LibJsAdminHeader', children: [
$E('div', {className: 'LibJsAdminHeaderLogo', children: [
$E('img', { attributes: {src: LibJs.Config.baseDir + 'shr/img/admin/admin_logo.gif'}})
]}),
$E('div', {className: 'LibJsAdminHeaderTitle', children: [
$T('Urulu Administration Interface')
]})
]}),
$E('table', {className: 'LibJsAdminBody', attributes: {width: '100%', cellSpacing: '0', cellPadding: '0'}, children: [
$E('tbody', {children: [
$E('tr', {attributes: {vAlign: 'top'}, children: [
$E('td', {className: 'LibJsAdminBodyNavigation', children: [
$E('div', {className: 'LibJsAdminBodyNavigationSpacer', children: [
$E('img', { style: {verticalAlign: 'baseline'}, attributes: {src: LibJs.Config.baseDir + 'shr/img/design/spacer.gif'}})
]}),
$E('div', {className: 'LibJsAdminBodyNavigationTree', children:
$D($L(this.id).labels.menu0)
})
]}),
$E('td', {attributes: {vAlign: 'top'}, className: 'LibJsAdminBodyContent', children:
$D($L(this.id).labels.body)
})
]})
]})
]}),
$E('div', {className: 'uruluFooter', children: [
$T('powered by '),
$E('a', { attributes: { href: 'http://www.urulu.org', target:'_blank' }, children: [
$T('urulu.org')
]})
]})
];
}
}


LibJs.Component.Body = {
getOptions: function() {
var labels = { langSwitch: $C('element'), login: $C('element'), body: $C('element') };
for (var i = 0; i < this.visitor.getMenuNr(); ++i)
labels['menu' + i] = $C('element');
return {
labels: labels,
properties: { manageId: '' }
};
},
reload: function() {
this.render(this.active);
},
render: function(widgetId) {
LibJs.XWin.openLoading();
LibJs.XWin.closeAll([this.properties.manageId]);
this.active = widgetId;
var transaction = LibJs.Server.start();
LibJs.Factory.useWidget(widgetId, transaction);
LibJs.Factory.useWidgetChildren(widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__render));
},
__render: function() {
LibJs.XWin.closeLoading();
document.title = this.visitor.getPageTitle();
if (LibJs.Config.lang.length > 1)
this.setLabel('langSwitch', $C('langswitch'));
for (var i = 0, menus = this.visitor.getMenu(); i < menus.length; i++)
this.setLabel('menu' + i, menus[i]);
this.setLabel('login', $C('login', {widgetId: this.active }));
this.setLabel('body', this.visitor.getViewer());
this.repaint();
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'stat') > -1) {
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'registerstat',
screenWidth: screen.width,
screenHeight: screen.height,
java: navigator.javaEnabled(),
color: (screen.colorDepth ? screen.colorDepth : screen.pixelDepth),
page: this.active
}, transaction);
LibJs.Server.commit(transaction, null, null, 'statprt/js');
}
},
openManager: function() {
var stores = [
{store: LibJs.Config.domainName, title: 'webpage', component: 'pagewrapper'},
{store: '.auth', title: 'users', component: 'authwrapper'}
];
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'gallery') > -1)
stores.push({store: '.gallery', title: 'images', component: 'gallerywrapper'});
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'garden') > -1)
stores.push({store: '.garden', title: 'files', component: 'gardenwrapper'});
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'events') > -1)
stores.push({store: '.events', title: 'events', component: 'eventwrapper'});
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'etat') > -1)
stores.push({store: '.etat', title: 'etat', component: 'etatwrapper'})
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'crm') > -1)
stores.push({store: '.crm', title: 'crm', component: 'crmwrapper'})
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'ball') > -1)
stores.push({store: '.ball', title: 'ball', component: 'ballwrapper'})
if (LibJs.System.indexOfItem(LibJs.Config.modules, 'gimun') > -1)
stores.push({store: '.gimun', title: 'gimun', component: 'gimunwrapper'})
this.properties.manageId = LibJs.XWin.openWindow({
labels: { body: $C('manager', { properties: { stores: stores }})},
properties: { title: $S('body', 'manage_title') }
});
},
onCreate: function() {
return this.visitor.onCreate();
}
}

LibJs.Component.Body.Viewer = {
__getOptions: function() {
return { labels: { body: $C('viewer', {widgetId: this.widgetId })}};
},
onCreate: function() {
return [$E('div', { className: 'uruluBodyContent', children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('body', {'manage_title':{de:'Titel'}});



LibJs.Component.Menu = {
getOptions: function() {
return {properties: { hasNotify: [] }};
},
loaded: function() {
var transaction = LibJs.Server.start();
LibJs.Factory.useWidgetAncestors(this.widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.render));
},
render: function() {
ancestors = [];
for (var parents = [this.widgetId]; parents.length > 0; parents = $W(parents[0]).parents)
if ($W(parents[0]).type == 'page' || $W(parents[0]).type == 'redirect')
ancestors.unshift(parents[0]);
this.properties.start = this.properties.start || 1;
this.properties.end = Math.min(this.properties.end || ancestors.length, ancestors.length);
var transaction = LibJs.Server.start();
if (this.properties.start - 1 < ancestors.length) {
this.properties.ancestors = ancestors.slice(this.properties.start - 1, this.properties.end);
for (var i = 0; i < this.properties.ancestors.length; i++)
LibJs.Factory.useWidgetChildren(this.properties.ancestors[i], transaction);
}
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__render));
},
__render: function() {
this.setState('created');
},
getItem: function(level) {
for (var i = 0 , items = [], children = $W(this.properties.ancestors[level]).children['pages']; i < children.length; i++) {
if ($W(children[i]).type == 'page')
items.push($E(this.properties.type == 'table' ? 'td' : 'li', { children: ([
$E('div', { className: 'LibJsComponentMenuBodyItem' + ( LibJs.XWin.getActivePage() == children[i] ? 'Selected' : '' ), children: [
$E('a', { children: [$T($W(children[i]).getTitleStr())], attributes: {href: '#' + children[i]}})
]})
]).concat(children[i] == this.properties.ancestors[level + 1] && level + 1 < this.properties.ancestors.length ? this.getItem(level + 1) : [])}));
else {
var attributes = { href: $W(children[i]).getVariable('location') };
if ($W(children[i]).getVariable('target'))
attributes.target = $W(children[i]).getVariable('target');
items.push($E(this.properties.type == 'table' ? 'td' : 'li', { children: ([
$E('div', { className: 'LibJsComponentMenuBodyItem', children: [
$E('a', { children: [ $T($W(children[i]).getTitleStr()) ], attributes: attributes})
]})
])}));
}
if (typeof this.properties.hasNotify[children[i]] == 'undefined') {
this.properties.hasNotify[children[i]] = true;
LibJs.Notify.observeAll(this.id, children[i], LibJs.System.bind(this, this.setState, 'created'));
}
}
if (this.properties.type == 'table')
return [$E('table', { attributes: {cellPadding: '0', cellSpacing: '0'}, className: 'LibJsComponentMenuHeader', children: [
$E('tbody', { children:[$E('tr', { className: 'LibJsComponentMenuBodyLayer' + (this.properties.start + level), children: items })]})
]})];
else
return [$E('ul', { className: 'LibJsComponentMenuBodyLayer' + (this.properties.start + level), children: items })];
},
onCreate: function() {
if (this.properties.ancestors) {
var dom = this.getItem(0);
if (typeof this.properties.hasNotify[this.properties.ancestors[0]] == 'undefined') {
this.properties.hasNotify[this.properties.ancestors[0]] = true;
LibJs.Notify.observeAll(this.id, this.properties.ancestors[0], LibJs.System.bind(this, this.setState, 'created'));
}
} else
var dom = [$E('div')];
return dom;
}
}
LibJs.Lang.__setText('menu', {});


LibJs.Component.Login = {
getOptions: function() {
if (LibJs.user == 'nobody')
LibJs.System.extendObject(this, LibJs.Component.Login.Login);
else
LibJs.System.extendObject(this, LibJs.Component.Login.Logout);
return this.__getOptions();
}
}

LibJs.Component.Login.Login = {
__getOptions: function() {
return { labels: {
login: $C('hyperlink', {properties: { type: 'link', title: $S('login', 'login'), name: 'login'}}),
register: $C('hyperlink', {properties: { type: 'link', title: $S('login', 'register'), name: 'register'}}),
newpasswd: $C('hyperlink', {properties: { type: 'link', title: $S('login', 'lost_password'), name: 'newPasswd'}})
}};
},
loaded: function() {
if (/^#OL/i.exec(location.hash)) {
location.href = '#';
this.login();
}
},
login: function() {
LibJs.XWin.openWindow({
labels: { body: $C('loginwin')},
properties: { title: $S('login', 'login') }
})
},
register: function() {
LibJs.XWin.openWindow({
labels: { body: $C('register')},
properties: { title: $S('login', 'register') }
})
},
newPasswd: function() {
LibJs.XWin.openWindow({
labels: { body: $C('newpasswd')},
properties: { title: $S('login', 'set_new_passwd') }
})
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentLoginLogin', children: [$E('div', { children: this.getLabelsDomSet(['login', 'register', 'newpasswd'])})]})];
}
}

LibJs.Component.Login.Logout = {
__getOptions: function() {
if (LibJs.user == 'webGod')
var admin = $C('element', {
properties: { name: 'a', attributes: { href: '../../adm/html/adm.html', target: '_blank' }},
children: [ $C('text', {properties: {value: $S('login', 'admin_panel')}}) ]
});
else
var admin = $C('element');
return {
labels: {
logout: $C('hyperlink', {properties: { type: 'link', title: $W(LibJs.user).getTitleStr() + ' ' + $S('login', 'logout'), name: 'logout'}}),
profile: $C('hyperlink', {properties: { type: 'link', title: $S('login', 'profile'), name: 'profile'}}),
manage: $C('hyperlink', {properties: { type: 'link', title: $S('login', 'manage_pages'), name: 'openManager'}}),
admin: admin
}
};
},
loaded: function() {
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'noop' }, transaction);
LibJs.Server.commit(transaction, function(){}, function(){}, 'shr/aggregate/manage');
},
logout: function() {
LibJs.System.extendObject(LibJs.Factory, {roots: {}, widgets: {}, queries: {}, logs: {}});
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'logout' }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(LibJs.XWin, LibJs.XWin.reload));
},
profile: function() {
LibJs.XWin.openWindow({
labels: { body: $C('profile')},
properties: { title: $S('login', 'profile') }
})
},
onCreate: function() {
return [$E('div', {className: 'LibJsComponentLoginLogout', children: this.getLabelsDomSet(['logout', 'profile', 'manage', 'admin'])})];
}
}
LibJs.Lang.__setText('login', {'admin_panel':{de:'Administration'},'login':{de:'Anmelden'},'logout':{de:'Abmelden'},'lost_password':{de:'Passwort vergessen?'},'manage_pages':{de:'Seitenverwaltung'},'profile':{de:'Profil'},'register':{de:'Registrieren'},'set_new_passwd':{de:'Neues Passwort setzen'}});



LibJs.Component.Langswitch = {
getOptions: function() {
var labels = {};
if (LibJs.Config.lang.length > 1)
for (var i = 0; i < LibJs.Config.lang.length; ++i)
labels[LibJs.Config.lang[i]] = $C('icon', {
properties: {src: 'lang/' + LibJs.Config.lang[i] + '.gif'},
events: [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, function(index){
LibJs.Lang.code = LibJs.Config.lang[index];
LibJs.XWin.reload();
}, i)})]
});
else
labels[LibJs.Config.defaultLang] = $C('element');
return { labels: labels };
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentLangswitch', children: this.getLabelsDomSet(LibJs.Config.lang)})];
}
}
LibJs.Lang.__setText('langswitch', {});



LibJs.Component.Extend = {
getOptions: function() {
LibJs.System.extendObject(this, this.properties.extend);
return this.__getOptions();
},
__getOptions: function() {}
}
LibJs.Lang.__setText('extend', {});



LibJs.Component.Viewer = {
getOptions: function() {
return { labels: { body: $F($W(this.widgetId).type, { widgetId: this.widgetId })}};
},
onCreate: function() {
return [$E(this.properties.name || 'div', { attributes: this.properties.attributes || {}, children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('viewer', {});


LibJs.Visitor.Bindchildren = {

getCreator: function(widgetId) {
return $C($L(this.id).properties.creator, { widgetId: widgetId, properties: $L(this.id).properties.creatorProperties || {}});
}
}



LibJs.Component.Bindchildren = {
getOptions: function() {
return {
states: { rendered: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onRender)})},
properties: { name: this.properties.name || 'div' }
};
},
loaded: function() {
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.render), 'add');
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.render), 'remove');
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.render), 'swap');
var transaction = LibJs.Server.start();
LibJs.Factory.useWidgetChildren(this.widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.render));
},
render: function() {
for (var i = 0, map = {}, children = this.getChildren(); i < children.length; i++) {
if (typeof map[$L(children[i]).widgetId] == 'undefined')
map[$L(children[i]).widgetId] = [];
map[$L(children[i]).widgetId].push(children[i]);
delete this.labels[children[i]];
}
for (var i = 0, children = $W(this.widgetId).getAllChildren(); i < children.length; i++)
if (!this.properties.types || LibJs.System.indexOfItem(this.properties.types, $W(children[i]).type) > -1) {
if (typeof map[children[i]] != 'undefined')
var nodeId = map[children[i]].shift();
else
var nodeId = this.visitor.getCreator(children[i]);
this.setLabel(nodeId, nodeId);
}
for (var index in map)
for (var i = 0; i < map[index].length; i++)
LibJs.remove(map[index][i]);
this.setState('rendered');
},
onCreate: function() {
return [$E('div', { children: [ $E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/loading.gif' }}), $T(' ' + $S('component', 'std_msg_s_loading'))]})];
},
onRender: function() {
return [$E(this.properties.name, { children: this.getLabelsDomSet(this.getChildren())})];
}
}
LibJs.Lang.__setText('bindchildren', {});



LibJs.Component.Bindwiki = {
getOptions: function() {
if ($W(this.widgetId).isAccess('w'))
return {
events: [new LibJs.Event(this.id, {event: 'dblclick', type: 'call', callback: LibJs.System.bind(this, this.openEditor)})],
states: { editing: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onEdit)})},
properties: { domSet: [$ST('bindwiki', 'loading')] }
};
},
loaded: function() {
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.render), 'set');
this.render();
},
render: function() {
if (LibJs.Compiler.loaded)
this.__render(LibJs.Compiler.getInstance('xml', 'htmldom').compile($W(this.widgetId).getVariable(this.properties.variable)));
else {
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'compiletohtml',
stringCallback: '(LibJs.is(\'' + this.id + '\')?LibJs.System.bind($L(\'' + this.id + '\'), $L(\'' + this.id + '\').__render):(function(){}))',
widgetId: this.widgetId,
variable: this.properties.variable
}, transaction);
LibJs.Server.commit(transaction);
}
},
__render: function(domSet) {
this.properties.domSet = domSet;
this.setState('created');
},
openEditor: function() {
if (this.getState() != 'editing') {
this.setLabel('editor', $C('editorwiki', {
widgetId: this.widgetId,
visitor: { bindId: this.id, closeEditor: function () { $L(this.bindId).close() } },
properties: { variable: this.properties.variable, showButtons: true }
}));
this.setState('editing');
}
},
close: function() {
this.properties.domSet = LibJs.Compiler.getInstance('xml', 'htmldom').compile($W(this.widgetId).getVariable(this.properties.variable));
this.setState('created');
},
onEdit: function() {
return [$E('div', { children: $D(this.labels.editor)})];
},
onCreate: function() {
if (typeof this.properties.domSet != 'undefined' && this.properties.domSet.length == 0)
this.properties.domSet = [$E('div', {className: 'LibJsComponentBindwikiNotext', children: [$ST('bindwiki', 'no_text_available')]})];
return [$E('div', { className: this.properties.className || '', children: this.properties.domSet || [$ST('component', 'std_msg_t_loading')] })];
}
}
LibJs.Lang.__setText('bindwiki', {'loading':{de:[$T(LibJs.Compiler.fromAscii('Lade...'))]},'no_text_available':{de:[$T(LibJs.Compiler.fromAscii('Kein Text verf#252;gbar. Doppelklick um einen Text zu erfassen.'))]}});



LibJs.Component.Element = {
onCreate: function() {
return [$E(this.properties.name || 'div', {
className: this.properties.className || '',
attributes: this.properties.attributes || {},
style: this.properties.style || {},
children: this.getLabelsDomSet(this.getChildren())})];
}
}
LibJs.Lang.__setText('element', {});


LibJs.Visitor.Hyperlink = {

getEvents: function() {
return [new LibJs.Event(this.id, {type: 'ancestors', name: $L(this.id).properties.name, arguments: $L(this.id).properties.arguments})];
}
}



LibJs.Component.Hyperlink = {
getOptions: function() {
return { events: this.visitor.getEvents() };
},
onCreate: function() {
if (this.properties.type == 'link')
return [$E('a', {
className: this.properties.className || 'LibJsComponentHyperlinkLink',
children: (this.properties.element ? $D(this.properties.element) : []).concat([
$T(this.properties.title)
])
})];
else
return [$E('input', {
className: this.properties.className || 'LibJsComponentHyperlinkButton',
attributes: { type: 'button', value: this.properties.title }
})];
}
};
LibJs.Lang.__setText('hyperlink', {});



LibJs.Component.Text = {
onCreate: function() {
if (this.properties.plain)
return $T(this.properties.value || '');
else
return [$E(this.properties.tag || 'span', {
className: this.properties.className || 'LibJsComponentText',
style: this.properties.style || {},
children: [$T(this.properties.value || '')]
})];
}
}
LibJs.Lang.__setText('text', {});


LibJs.Factory.Component.Page = {
getOptions: function() {
return { labels: { body: $C('bindchildren', { widgetId: this.widgetId, properties: {types: ['frame'], creator: 'viewer'}})}};
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentPage', children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('page', {'db_var_title1':{de:'Titel DE'},'db_var_title2':{de:'Titel FR'},'db_var_title3':{de:'Titel IT'},'db_var_title4':{de:'Titel EN'},'db_var_title5':{},'db_var_title6':{}});


LibJs.Factory.Component.Frame = {
getOptions: function() {
return { labels: { body: $C('bindchildren', {
widgetId: this.widgetId,
visitor: { getCreator: function(widgetId) {
return $C($L(this.id).properties.creator, { widgetId: widgetId, properties: { name: 'td', attributes: { vAlign: 'top', width: $W(widgetId).getVariable('width') }}})
}},
properties: {name: 'tr', creator: 'viewer'}
})}};
},
onCreate: function() {
return [$E('table', { className: 'LibJsComponentFrame', children: [$E('tbody', { children: $D(this.labels.body)})]})];
}
}
LibJs.Lang.__setText('frame', {'db_var_title':{de:'Titel'}});


LibJs.Factory.Component.Col = {
getOptions: function() {
return { labels: { body: $C('bindchildren', { widgetId: this.widgetId, properties: { creator: 'viewer' }})}};
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentCol', children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('col', {'db_var_title':{de:'Titel'},'db_var_width':{de:'Breite'}});


LibJs.Factory.Component.Wiki = {
getOptions: function() {
return { labels: { body: $C('bindwiki', { widgetId: this.widgetId, properties: {
variable: 'source' + (LibJs.System.indexOfItem(LibJs.Config.lang, LibJs.Lang.code) + 1)
}})}};
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentWiki', children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('wiki', {'db_var_source1':{de:'Text DE'},'db_var_source2':{de:'Text FR'},'db_var_source3':{de:'Text IT'},'db_var_source4':{de:'Text EN'},'db_var_source5':{},'db_var_source6':{},'db_var_title':{de:'Titel'}});



LibJs.XWin.Component.Loading = LibJs.System.extendObject(LibJs.System.cloneObject(LibJs.XWin.Component), {
__getOptions: function() {
return { properties: { zindex: String(LibJs.XWin.getNextWinZ()) }};
},
onCreate: function() {
ie6 = (navigator.appVersion.indexOf("MSIE 6.0") != -1);
return [$E('div', {
className: 'LibJsComponentLoading',
style: {
zIndex: this.properties.zindex,
top: (Math.round(this.properties.innerHeight / 2 - 50) + this.properties.scrollOffset) + 'px',
left: Math.round(this.properties.innerWidth / 2 - 100) + 'px',
background: 'url(' + LibJs.Config.baseDir + (ie6 ? 'shr/img/xwin/loading_ie.gif':'shr/img/xwin/loading.png') + ')',
backgroundRepeat: 'no-repeat'
},
children: [
$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/loading.gif' }}),
$E('div', { children: [$T(' ' + $S('component', 'std_msg_s_loading'))]})
]
})];
}
});
LibJs.Lang.__setText('loading', {});
0

