


LibJs.Component.Userfinder = {
getOptions: function() {
return {
labels: {
body: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
find: $C('hyperlink', { properties: { title: $S('userfinder', 'find_user'), name: 'findUser'}})
},
states: { selected: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onSelect)})}
};
},
getValue: function() {
return $D(this.labels.body)[0].value;
},
setValue: function(name) {
$D(this.labels.body)[0].value = name;
this.setState('created');
},
findUser: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
this.properties.queryId = LibJs.Factory.findUser(
this.getValue() ? '%' + this.getValue() + '%' : '',
transaction
);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__findUser));
},
__findUser: function() {
LibJs.XWin.closeLoading();
if (LibJs.Factory.queries[this.properties.queryId].length == 0)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('userfinder', 'no_users_found')}})}});
else
this.setState('selected');
},
onCreate: function() {
return [$E('div', { children: this.getLabelsDomSet(['body', 'find'])})];
},
onSelect: function() {
items = [];
for (var i = 0, list = LibJs.Factory.queries[this.properties.queryId]; i < list.length; ++i)
items.push((new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.setValue, list[i])})).observe($E('li', {
children: [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/widgets/user.png'}}), $T(list[i])]
})));
return  [$E('div', { children:
this.getLabelsDomSet(['body', 'find']).concat([$E('ul', { className: 'LibJsComponentUserfinder', children: items })])
})];
}
}
LibJs.Lang.__setText('userfinder', {'find_user':{},'no_users_found':{}});


LibJs.Visitor.Dnd = {

onDndStart: function() {},

onDndMove: function(e) {
return $D(this.id)[0];
},

onDndEnd: function(e) {}
}



LibJs.Component.Dnd = {
getOptions: function() {
return {
events: [new LibJs.Event(this.id, {event: 'mousedown', type: 'call', callback: LibJs.System.bind(this, this.dndStart)})],
properties: {
dndMove: new LibJs.Event(this.id, {event: 'mousemove', type: 'call', callback: LibJs.System.bind(this, this.dndMove)}),
dndEnd: new LibJs.Event(this.id, {event: 'mouseup', type: 'call', callback: LibJs.System.bind(this, this.dndEnd)})
}
};
},
dndStart: function(e) {
if (!e.isLeftClick())
return;
this.properties.dndMove.observe(document);
this.properties.dndEnd.observe(document);
e.stop();
this.visitor.onDndStart(e);
},
dndMove: function(e) {
var layer = this.visitor.onDndMove(e);
if (layer) {
layer.style.left = e.pointer()[0] - (this.properties.shiftLeft || 8) + 'px';
layer.style.top = e.pointer()[1] - (this.properties.shiftTop || 8) + 'px';
}
},
dndEnd: function(e) {
this.properties.dndMove.stopObserving(document);
this.properties.dndEnd.stopObserving(document);
this.visitor.onDndEnd(e);
},
onCreate: function() {
return [$E(this.properties.name || 'span', {
className: this.properties.className || 'LibJsComponentDnd',
attributes: this.properties.attributes || {},
style: this.properties.style || {},
children: $D(this.labels.body)
})];
}
}
LibJs.Lang.__setText('dnd', {});



LibJs.Component.Icon = {
onCreate: function() {
if (!this.properties.isAbsolute)
this.properties.src = LibJs.Config.baseDir + 'shr/img/' + this.properties.src;
var attributes = {src: this.properties.src};
if (this.properties.width)
attributes.width = this.properties.width;
if (this.properties.height)
attributes.height = this.properties.height;
if (this.properties.title)
attributes.title = this.properties.title;
if (this.properties.alt)
attributes.alt = this.properties.alt;
return [$E('img', {
events: this.events || [],
className: this.properties.className || 'LibJsComponentIcon',
style: this.properties.style || {},
attributes: attributes
})];
}
}
LibJs.Lang.__setText('icon', {});



LibJs.Component.Tabarea = {
load: function() {
this.selected = 0;
for (var i = 0; i < this.properties.items.length; i++) {
$L(this.properties.items[i].head).parent = this.id;
$L(this.properties.items[i].body).parent = this.id;
}
this.className = (this.properties.className ? this.properties.className : 'LibJsComponentTabArea');
},
select: function(index) {
this.selected = index;
this.setStateBefore(0);
},
onCreate: function() {
for (var i = 0, tabs = []; i < this.properties.items.length; i++) {
tabs.push((new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.select, i)})).observe($E('div', {
className: (this.selected == i ? this.className + 'HeadTabSelected' : this.className + 'HeadTabDeSelected'),
children: [$E('div', {className: this.className + 'HeadTabInline', children: $D(this.properties.items[i].head)})]
})));
if (this.selected == i)
var body = $D(this.properties.items[i].body);
}
return [$E('div', { className: this.className, children: [ $E('div', {className: this.className + 'Head', children: tabs}), $E('div', {className: this.className + 'Body', children: body})]})];
}
}
LibJs.Lang.__setText('tabarea', {});



LibJs.Component.Combuddy = {
getOptions: function() {
return { states: { fetched: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onFetched)})}};
},
loaded: function() {
if (LibJs.System.indexOfItem(LibJs.Comutil.Notify.buddies, this.id) == -1)
LibJs.Comutil.Notify.buddies.push(this.id);
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Comutil.findBuddies(this.widgetId, transaction);
if (this.widgetId == LibJs.Comutil.person)
LibJs.Comutil.findApproveBuddies(transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'cty/js');
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.notify();
},
notify: function() {
for (var label in this.labels)
this.deleteLabel(label);
if (this.widgetId == LibJs.Comutil.person)
for (var i = 0; i < LibJs.Comutil.buddiesToApprove.length; ++i) {
var childId = $C('extend', {widgetId: LibJs.Comutil.buddiesToApprove[i], properties: { extend: LibJs.Component.Combuddy.PersonToApprove }});
this.setLabel(childId, childId);
}
if (!this.properties.truncated)
for (var i = 0; i < LibJs.Comutil.buddies[this.widgetId].length; ++i) {
var childId = $C('extend', {widgetId: LibJs.Comutil.buddies[this.widgetId][i], properties: { extend: LibJs.Component.Combuddy.Person }});
this.setLabel(childId, childId);
}
if (!this.properties.truncated && this.widgetId == LibJs.Comutil.person)
for (var i = 0; i < LibJs.Comutil.notApprovedBuddies.length; ++i) {
var childId = $C('extend', {widgetId: LibJs.Comutil.notApprovedBuddies[i], properties: { extend: LibJs.Component.Combuddy.PersonNotApproved }});
this.setLabel(childId, childId);
}
this.setState('fetched');
},
onCreate: function() {
return [ $E('div', { children: [$ST('component', 'std_msg_loading')]})];
},
onFetched: function() {
if (this.properties.truncated)
var children = [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comprofile', 'buddy_ttl_list_truncated')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('comprofile', 'buddy_txt_list_truncated')]})
];
else
var children = [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comprofile', 'buddy_ttl_list')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('comprofile', 'buddy_txt_list')]})
];
return [$E('div', { children: children.concat([
$E('div', { className: 'LibJsComponentComprofileBuddies', children: this.getLabelsDomSet(this.getChildren()) })
])})];
}
}

LibJs.Component.Combuddy.PersonToApprove = {
__getOptions: function() {
return {
labels: {
icon: $C('icon', { properties: {
isAbsolute: true,
src: LibJs.Config.baseDir + 'cty/personimage/' + $W(this.widgetId).getVariable('personid1'),
title: $S('comprofile', 'buddy_ttl_icon')},
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'viewProfile'})]
}),
view: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/profile.png', title: $S('comprofile', 'buddy_btn_view_profile')}}), name: 'viewProfile'}}),
approve: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/approve_buddy.png', title: $S('comprofile', 'buddy_btn_approve')}}), name: 'approve'}}),
decline: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/decline_buddy.png', title: $S('comprofile', 'buddy_btn_decline')}}), name: 'decline'}})
}
};
},
viewProfile: function() {
LibJs.XWin.openWindow({
labels: { body: $C('compersonview', { widgetId: $W(this.widgetId).getVariable('personid1') })},
properties: { title: $S('compersonfinder', 'list_ttl_win', {person: $W($W(this.widgetId).getVariable('personid1')).getTitleStr()}) }
});
},
approve: function() {
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: this.widgetId, properties: { approveId: this.id, extend: LibJs.Component.Combuddy.AddToBuddy }})},
properties: { title: $S('compersonview', 'buddy_ttl_add_buddy', {username: $W(this.widgetId).getTitleStr()}) }
});
},
__approve: function(description) {
LibJs.XWin.openLoading();
$W(this.widgetId).setVariable('approved', 'y');
$W(this.widgetId).setVariable('description1', description);
LibJs.Comutil.buddiesToApprove = LibJs.System.withoutItem(LibJs.Comutil.buddiesToApprove, this.widgetId);
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'approveBuddy',
buddyId: this.widgetId,
description: description,
mailtitle: $S('combuddy', 'appr_eml_title'),
mailmessage: $S('combuddy', 'appr_eml_message', {person: $W(LibJs.Comutil.person).getTitleStr()})
}, transaction);
LibJs.Server.send({type: 'findBuddies', personId: LibJs.Comutil.person}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__afterApprove), null, 'cty/js');
},
__afterApprove: function() {
LibJs.XWin.closeLoading();
LibJs.Comutil.notifyBuddies();
},
decline: function(args) {
LibJs.XWin.openConfirm({
labels: { body: $C('text', { properties: { value: $S('comprofile', 'buddy_msg_decline_confirm', {name: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()})}})},
visitor: { editorId: this.id, onOk: function() { $L(this.editorId).__decline();}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__decline: function() {
LibJs.XWin.openLoading();
LibJs.Comutil.notApprovedBuddies = LibJs.System.withoutItem(LibJs.Comutil.notApprovedBuddies, this.widgetId);
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'declineBuddy',
buddyId: this.widgetId,
mailtitle: $S('combuddy', 'decl_eml_title'),
mailmessage: $S('combuddy', 'decl_eml_message', {person: $W(LibJs.Comutil.person).getTitleStr()})
}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__afterDecline), null, 'cty/js');
},
__afterDecline: function() {
LibJs.XWin.closeLoading();
LibJs.Comutil.notifyBuddies();
},
onCreate: function() {
return [$E('table', { className: 'LibJsComponentComprofileBuddiesPerson', children: [ $E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonPicture', attributes: {rowSpan: '3', vAlign: 'top'}, children: $D(this.labels.icon)}),
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonName', children: [$T($W($W(this.widgetId).getVariable('personid1')).getTitleStr())]})
]}),
$E('tr', { children: [
$E('td', { children: [$T(' (' + $S('combuddy', 'buddy_txt_not_approved') + ')')]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonOptions', children: this.getLabelsDomSet(['view','approve','decline'])})
]}),
]})]})];
}
}

LibJs.Component.Combuddy.AddToBuddy = {
__getOptions: function() {
return { labels: {
description: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
save: $C('hyperlink', { properties: { title: $S('comprofile', 'std_btn_save'), name: 'send'}}),
cancel: $C('hyperlink', { properties: { title: $S('comprofile', 'std_btn_cancel'), name: 'closeComponent'}})
}};
},
send: function() {
$L(this.properties.approveId).__approve($D(this.labels.description)[0].value);
this.callFromAncestors('closeComponent');
},
onCreate: function() {
return [$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comprofile', 'buddy_txt_add_description')]}),
$E('td', { children: $D(this.labels.description)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2' }, children: this.getLabelsDomSet(['save', 'cancel'])})
]})
]})
]})];
}
}

LibJs.Component.Combuddy.Person = {
__getOptions: function() {
return {
labels: {
icon: $C('icon', { properties: {
isAbsolute: true,
src: LibJs.Config.baseDir + 'cty/personimage/' + $W(this.widgetId).getVariable('personid1'),
title: $S('comprofile', 'buddy_ttl_icon')},
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'viewProfile'})]
}),
view: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/profile.png', title: $S('comprofile', 'buddy_btn_view_profile')}}), name: 'viewProfile'}}),
removebuddy: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/remove_buddy.png', title: $S('comprofile', 'buddy_btn_remove')}}), name: 'removeBuddy'}})
},
properties: {
zip: $W($W(this.widgetId).getVariable('personid2')).children.cities.length ? $W($W($W(this.widgetId).getVariable('personid2')).children.cities[0]).getVariable('zip') : '',
place: $W($W(this.widgetId).getVariable('personid2')).children.cities.length ? $W($W($W(this.widgetId).getVariable('personid2')).children.cities[0]).getVariable('place') : ''
}
};
},
viewProfile: function() {
LibJs.XWin.openWindow({
labels: { body: $C('compersonview', { widgetId: $W(this.widgetId).getVariable('personid2') })},
properties: { title: $S('compersonfinder', 'list_ttl_win', {person: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()}) }
});
},
removeBuddy: function() {
LibJs.XWin.openConfirm({
labels: { body: $C('text', { properties: { value: $S('comprofile', 'buddy_msg_delete_confirm', {name: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()})}})},
visitor: { editorId: this.id, onOk: function() { $L(this.editorId).__removeBuddy();}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__removeBuddy: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'removeBuddy',
buddyId: this.widgetId,
mailtitle: $S('combuddy', 'rm_eml_title'),
mailmessage: $S('combuddy', 'rm_eml_message', {person: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()})
}, transaction);
LibJs.Server.send({type: 'findBuddies', personId: LibJs.Comutil.person}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__afterRemoveBuddy), null, 'cty/js');
},
__afterRemoveBuddy: function() {
LibJs.XWin.closeLoading();
LibJs.Comutil.notifyBuddies();
},
onCreate: function() {
var icons = $D(this.labels.view);
if ($W(this.widgetId).getVariable('personid1') == LibJs.Comutil.person)
icons = icons.concat($D(this.labels.removebuddy));
return [$E('table', { className: 'LibJsComponentComprofileBuddiesPerson', children: [ $E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonPicture', attributes: {rowSpan: '3', vAlign: 'top'}, children: $D(this.labels.icon)}),
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonName', children: [$T($W($W(this.widgetId).getVariable('personid2')).getTitleStr())]})
]}),
$E('tr', { children: [
$E('td', { children: $E('td', { children: [
$T($W(this.widgetId).getVariable('personid1') == LibJs.Comutil.person ? $W(this.widgetId).getVariable('description1') : (this.properties.zip + ' ' + this.properties.place))
]})})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonOptions', children: icons})
]})
]})]})];
}
}

LibJs.Component.Combuddy.PersonNotApproved = {
__getOptions: function() {
return {
labels: {
icon: $C('icon', { properties: {
isAbsolute: true,
src: LibJs.Config.baseDir + 'cty/personimage/' + $W(this.widgetId).getVariable('personid1'),
title: $S('combuddy', 'buddy_ttl_icon')},
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'viewProfile'})]
}),
view: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/profile.png', title: $S('comprofile', 'buddy_btn_view_profile')}}), name: 'viewProfile'}}),
decline: $C('hyperlink', {properties: { type: 'link', title: '', element: $C('icon', { properties: { src: 'buttons/decline_buddy.png', title: $S('comprofile', 'buddy_btn_decline')}}), name: 'decline'}})
}
};
},
viewProfile: function() {
LibJs.XWin.openWindow({
labels: { body: $C('compersonview', { widgetId: $W(this.widgetId).getVariable('personid2') })},
properties: { title: $S('combuddy', 'list_ttl_win', {person: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()}) }
});
},
decline: function(args) {
LibJs.XWin.openConfirm({
labels: { body: $C('text', { properties: { value: $S('combuddy', 'buddy_msg_decline_confirm', {name: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()})}})},
visitor: { editorId: this.id, onOk: function() { $L(this.editorId).__decline();}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__decline: function() {
LibJs.XWin.openLoading();
LibJs.Comutil.notApprovedBuddies = LibJs.System.withoutItem(LibJs.Comutil.notApprovedBuddies, this.widgetId);
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'declineBuddy',
buddyId: this.widgetId,
mailtitle: $S('combuddy', 'decl_eml_title'),
mailmessage: $S('combuddy', 'decl_eml_message', {person: $W($W(this.widgetId).getVariable('personid2')).getTitleStr()})
}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__afterDecline), null, 'cty/js');
},
__afterDecline: function() {
LibJs.XWin.closeLoading();
LibJs.Comutil.notifyBuddies();
},
onCreate: function() {
return [$E('table', { className: 'LibJsComponentComprofileBuddiesPerson', children: [ $E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonPicture', attributes: {rowSpan: '3', vAlign: 'top'}, children: $D(this.labels.icon)}),
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonName', children: [$T($W($W(this.widgetId).getVariable('personid2')).getTitleStr())]})
]}),
$E('tr', { children: [
$E('td', { children: [$T($W(this.widgetId).getVariable('description1') + ' (' + $S('combuddy', 'buddy_txt_not_approved') + ')')]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentComprofileBuddiesPersonOptions', children: this.getLabelsDomSet(['view', 'decline'])})
]}),
]})]})];
}
}
LibJs.Lang.__setText('combuddy', {'buddy_txt_not_approved':{de:'Nicht best#228;titgt'},'appr_eml_title':{},'appr_eml_message':{},'decl_eml_title':{},'decl_eml_message':{},'rm_eml_title':{},'rm_eml_message':{},'buddy_ttl_icon':{},'list_ttl_win':{},'buddy_msg_decline_confirm':{}});



LibJs.Component.Comcityfinder = {
getOptions: function() {
return {
labels: {
zip: $C('element', { properties: { name: 'input',  attributes: {
size: '4', type: 'text', value: this.properties.cityId ? $W(this.properties.cityId).getVariable('zip') : ''
}}}),
place: $C('element', { properties: { name: 'input',  attributes: {
type: 'text', value: this.properties.cityId ? $W(this.properties.cityId).getVariable('place') : ''
}}}),
find: $C('hyperlink', { properties: { title: $S('comcityfinder', 'find_btn_find_city'), name: 'findCity'}})
},
states: { selected: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onSelect)})}
};
},
getValue: function() {
return this.properties.cityId + '|' + $D(this.labels.zip)[0].value;
},
setValue: function(id) {
this.properties.cityId = id;
$D(this.labels.zip)[0].value = $W(id).getVariable('zip');
$D(this.labels.place)[0].value = $W(id).getVariable('place');
this.setState('created');
},
findCity: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
this.properties.queryId = LibJs.Comutil.findCity(
$D(this.labels.zip)[0].value ? $D(this.labels.zip)[0].value + '%' : '',
$D(this.labels.place)[0].value ? '%' + $D(this.labels.place)[0].value + '%' : '',
transaction
);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__findCity), null, 'cty/js');
},
__findCity: function() {
LibJs.XWin.closeLoading();
if (LibJs.Comutil.queries[this.properties.queryId].length == 0)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comcityfinder', 'find_msg_no_cities_found')}})}});
else
this.setState('selected');
},
onCreate: function() {
return [$E('div', { children: this.getLabelsDomSet(['zip', 'place', 'find'])})];
},
onSelect: function() {
items = [];
for (var i = 0, list = LibJs.Comutil.queries[this.properties.queryId]; i < list.length; ++i)
items.push((new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.setValue, list[i])})).observe($E('li', {
children: [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/widgets/city.png'}}), $T($W(list[i]).getTitleStr())]
})));
return  [$E('div', { children:
this.getLabelsDomSet(['zip', 'place', 'find']).concat([$E('ul', { className: 'LibJsComponentComcityfinder', children: items })])
})];
}
}
LibJs.Lang.__setText('comcityfinder', {'find_btn_find_city':{de:'Ort suchen'},'find_msg_no_cities_found':{de:'Kein Ort mit diesem Namen gefunden'}});



LibJs.Component.Comdata = {
getOptions: function() {
return { labels: {
firstname: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('firstname') }}}),
lastname: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('lastname') }}}),
nickname: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('nickname') }}}),
gender: $C('extend', { properties: { extend: LibJs.Component.Comdata.Gender, value: $W(this.widgetId).getVariable('gender')}}),
birthyear: $C('extend', { widgetId: this.widgetId, properties: {
extend: LibJs.Comutil.Selectoptions, min: (new Date()).getFullYear(), max: 1900,
selected: $W(this.widgetId).getVariable('birthyear')
}}),
birthmonth: $C('extend', { widgetId: this.widgetId, properties: {
extend: LibJs.Comutil.Selectoptions, min: 1, max: 12,
selected: $W(this.widgetId).getVariable('birthmonth')
}}),
birthday: $C('extend', { widgetId: this.widgetId, properties: {
extend: LibJs.Comutil.Selectoptions, min: 1, max: 31,
selected: $W(this.widgetId).getVariable('birthday')
}}),
skype: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('skype') }}}),
mobile: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('mobile') }}}),
icq: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('icq') }}}),
yahoo: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('yahoo') }}}),
fixnet: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('fixnet') }}}),
fax: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('fax') }}}),
addrline1: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('addrline1') }}}),
addrline2: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('addrline2') }}}),
addrline3: $C('element', { properties: { name: 'input',  attributes: { type: 'text', value: $W(this.widgetId).getVariable('addrline3') }}}),
cityfinder: $C('comcityfinder', {properties: { cityId: $W(this.widgetId).children.cities.length ? $W(this.widgetId).children.cities[0] : null }}),
save: $C('hyperlink', { properties: { title: $S('component', 'form_btn_save'), name: 'save'}})
}};
},
save: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
var properties = ['firstname', 'lastname', 'nickname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'skype',
'mobile', 'icq', 'yahoo', 'fixnet', 'fax', 'addrline1', 'addrline2', 'addrline3'];
for (var i = 0; i < properties.length; ++i)
if ($D(this.labels[properties[i]])[0].value != $W(this.widgetId).getVariable(properties[i]))
LibJs.Server.send({
type: 'setpersonprop',
personId: this.widgetId,
name: properties[i],
value: LibJs.Compiler.toAscii($D(this.labels[properties[i]])[0].value)
}, transaction);
LibJs.Server.send({type: 'setpersoncity', personId: this.widgetId, city: $L(this.labels.cityfinder).getValue()}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__save), LibJs.System.bind(this, this.__error), 'cty/js');
},
__save: function() {
LibJs.XWin.closeLoading();
},
__error: function() {
LibJs.XWin.closeLoading();
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comdata', 'err_msg_wrong_city') }})}});
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comdata', 'udata_ttl_profile')]}),
$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_username')]}),
$E('td', { children: [$E('input', {attributes: { disabled: 'disabled', value:$W(this.widgetId).getVariable('login')}})]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_email')]}),
$E('td', { children: [$E('input', {attributes: { disabled: 'disabled', value: $W(this.widgetId).getVariable('email')}})]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_birthday')]}),
$E('td', { children: this.getLabelsDomSet(['birthday', 'birthmonth', 'birthyear'])})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_gender')]}),
$E('td', { children: $D(this.labels.gender)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children: [$T('-')]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_firstname')]}),
$E('td', { children: $D(this.labels.firstname)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_lastname')]}),
$E('td', { children: $D(this.labels.lastname)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_nickname')]}),
$E('td', { children: $D(this.labels.nickname)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline1')]}),
$E('td', { children: $D(this.labels.addrline1)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline2')]}),
$E('td', { children: $D(this.labels.addrline2)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline3')]}),
$E('td', { children: $D(this.labels.addrline3)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_zip_city')]}),
$E('td', { children: $D(this.labels.cityfinder)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children: [$T('-')]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_fixnet')]}),
$E('td', { children: $D(this.labels.fixnet)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_mobile')]}),
$E('td', { children: $D(this.labels.mobile)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_skype')]}),
$E('td', { children: $D(this.labels.skype)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_icq')]}),
$E('td', { children: $D(this.labels.icq)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_yahoo')]}),
$E('td', { children: $D(this.labels.yahoo)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_fax')]}),
$E('td', { children: $D(this.labels.fax)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children: $D(this.labels.save)})
]})
]})
]})
]})];
}
}

LibJs.Component.Comdata.Gender = {
onCreate: function() {
return [$E('select', { children: [
$E('option', { attributes: (this.properties.value == 'm' ? { selected: 'selected' } : {}), children: [$ST('comutil', 'pers_itm_gender_m')]}),
$E('option', { attributes: (this.properties.value == 'w' ? { selected: 'selected' } : {}), children: [$ST('comutil', 'pers_itm_gender_w')]})
]})];
}
}
LibJs.Lang.__setText('comdata', {'err_msg_wrong_city':{de:'Es muss ein g#252;ltiger Ort in der Schweiz eingegeben werden'},'udata_ttl_profile':{de:[$T(LibJs.Compiler.fromAscii('Benutzerprofil'))]}});


LibJs.Visitor.Comfindperson = {

select: function(widgetId, e) {
LibJs.XWin.openWindow({
labels: { body: $C('compersonview', { widgetId: widgetId })},
properties: { title: $S('compersonfinder', 'list_ttl_win', {person: $W(widgetId).getTitleStr()}) }
});
}
}



LibJs.Component.Comfindperson = {
getOptions: function() {
return { labels: {
name: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
place: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
group: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
find: $C('hyperlink', {properties: { title: $S('comfindperson', 'find_btn_user'), name: 'findPerson'}}),
list: $C('element')
}};
},
findPerson: function() {
if (!$D(this.labels.name)[0].value && !$D(this.labels.place)[0].value && !$D(this.labels.group)[0].value)
return;
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
this.properties.queryId = LibJs.Comutil.findPerson(
($D(this.labels.name)[0].value ? '*' : '') + $D(this.labels.name)[0].value + ($D(this.labels.name)[0].value ? '*' : ''),
$D(this.labels.place)[0].value,
$D(this.labels.group)[0].value || ''
, transaction
);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__findPerson), null, 'cty/js');
},
__findPerson: function() {
LibJs.XWin.closeLoading();
var list = $C('list', {
visitor: LibJs.System.extendObject({ finderId: this.id }, LibJs.Component.Comfindperson.ListVisitor),
properties: { head: [
{ title: $S('comfindperson', 'list_ttl_nickname'), widget: 0, variable: 'nickname'},
{ title: $S('comfindperson', 'list_ttl_firstname'), widget: 0, variable: 'firstname'},
{ title: $S('comfindperson', 'list_ttl_lastname'), widget: 0, variable: 'lastname'},
{ title: $S('comfindperson', 'list_ttl_zip'), widget: 0, callback: function(widgetId) {
if ($W(widgetId).children.cities.length)
return $W($W(widgetId).children.cities[0]).getVariable('zip');
else
return '';
}},
{ title: $S('comfindperson', 'list_ttl_place'), widget: 0, callback: function(widgetId) {
if ($W(widgetId).children.cities.length)
return $W($W(widgetId).children.cities[0]).getVariable('place');
else
return '';
}}
], body: LibJs.Comutil.queries[this.properties.queryId], noExport: true }
});
if (this.properties.truncated)
LibJs.XWin.openWindow({
labels: { body: list},
properties: { title: $S('comfindperson', 'list_ttl_win') }
});
else
this.setLabel('list', list);
this.repaint();
},
onCreate: function() {
if (this.properties.truncated)
return [ $E('div', { className: 'LibJsComponentIdentifierLeft', children: [$ST('comfindperson', 'find_cap_name')].concat($D(this.labels.name)).concat($D(this.labels.find))})];
else
return [ $E('div', { children: [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comfindperson', 'findp_ttl_findperson')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('comfindperson', 'findp_txt_findperson')]}),
$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comfindperson', 'find_cap_name')]}),
$E('td', { children: $D(this.labels.name)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comfindperson', 'find_cap_city')]}),
$E('td', { children: $D(this.labels.place)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comfindperson', 'find_cap_unit')]}),
$E('td', { children: $D(this.labels.group)})
]}),
$E('tr', { children: [
$E('td', { attributes: {colSpan: '2'}, children: $D(this.labels.find)})
]})
]})
]}),
$E('div', { children: $D(this.labels.list) })
]})];
}
}

LibJs.Component.Comfindperson.ListVisitor = {
getEditIcon: function() {
return LibJs.Config.baseDir + 'shr/img/buttons/buddy.png';
},
checkAccess: function(widgetIds) {
return true;
},
clickEvent: function(widgetIds, e) {
$L(this.finderId).visitor.select(widgetIds[0], e);
}
}
LibJs.Lang.__setText('comfindperson', {'find_btn_user':{de:'Pfadi finden'},'find_cap_name':{de:[$T(LibJs.Compiler.fromAscii('Name'))]},'find_cap_unit':{de:[$T(LibJs.Compiler.fromAscii('Abteilung'))]},'list_ttl_place':{de:'Ort'},'list_ttl_win':{de:'Person Suchen'},'find_cap_city':{de:[$T(LibJs.Compiler.fromAscii('Ort'))]},'list_ttl_nickname':{},'list_ttl_firstname':{},'list_ttl_lastname':{},'list_ttl_zip':{},'findp_ttl_findperson':{},'findp_txt_findperson':{},'list_ttl_unit':{},'list_ttl_pos_label':{},'list_ttl_pos_type':{},'list_ttl_pos_end':{},'list_ttl_pos_start':{},'myunits_still_active':{}});



LibJs.Component.Comguestbook = {
getOptions: function() {
return {
states: { fetched: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onFetched)})},
labels: { newmsg: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Comguestbook.NewMessage }})}
};
},
loaded: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Comutil.findMessages(this.widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'cty/js');
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.setState('fetched');
},
deleteMessage: function(msgId) {
LibJs.XWin.openConfirm({
labels: { body: $C('text', { properties: { value: $S('comguestbook', 'gbook_msg_confirm_delete', {name: $W(msgId).getVariable('subject')})}})},
visitor: { editorId: this.id, msgId: msgId, onOk: function() { $L(this.editorId).__deleteMessage(this.msgId);}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__deleteMessage: function(msgId) {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'deleteGuestbookMsg', msgId: msgId}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.afterDeleteMessage, msgId), null, 'cty/js');
},
afterDeleteMessage: function(msgId) {
LibJs.XWin.closeLoading();
LibJs.Comutil.messages[this.widgetId] = LibJs.System.withoutItem(LibJs.Comutil.messages[this.widgetId], msgId);
this.repaint();
},
onCreate: function() {
return [ $E('div', { children: [$ST('component', 'std_msg_loading')]})];
},
onFetched: function() {
for (var i = 0, msgs = []; (!this.properties.truncated || i < 5) && i < LibJs.Comutil.messages[this.widgetId].length; ++i) {
var msgId = LibJs.Comutil.messages[this.widgetId][i];
msgs.push($E('div', { className: 'LibJsComponentComguestbookMessage', children: [
$E('div', { className: 'LibJsComponentComguestbookMessageTitle', children: [
$E('img', { attributes: {src: LibJs.Config.baseDir + 'shr/img/buttons/guestbook_entry.png'}}),
(this.widgetId == LibJs.Comutil.person
? (new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.deleteMessage, msgId)})).observe(
$E('img', { attributes: {src: LibJs.Config.baseDir + 'shr/img/buttons/delete.png'}})
) : $E('span')
),
$T($W(msgId).getVariable('subject'))
]}),
$E('div', { className: 'LibJsComponentComguestbookMessageText', children: [$E('pre', { children: [$T($W(msgId).getVariable('message'))]})]}),
$E('div', { className: 'LibJsComponentComguestbookMessageInfo', children: [$T(
$W($W(msgId).getVariable('fromid')).getTitleStr() + ' ' +
$W(msgId).getVariable('fromday') + '.' +
$W(msgId).getVariable('frommonth') + '.' +
$W(msgId).getVariable('fromyear') + ' ' +
$W(msgId).getVariable('fromhour') + ':' +
$W(msgId).getVariable('fromminute')
)]})
]}));
}
return [
$E('div', { children: (this.properties.truncated ? [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comguestbook', 'gbook_ttl_title_truncated')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('comguestbook', 'gbook_ttl_text_truncated')]})
] : [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comguestbook', 'gbook_cap_title')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('comguestbook', 'gbook_cap_text')]}),
$E('div', { className: 'LibJsComponentComguestbookNewMsg', children: $D(this.labels.newmsg)}),
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('comguestbook', 'gbook_ttl_messages')]})
]).concat([
$E('div', { className: 'LibJsComponentComguestbookMessages', children: msgs})
])})
];
}
}

LibJs.Component.Comguestbook.NewMessage = {
__getOptions: function() {
return {
labels: {
subject: $C('element', { properties: { name: 'input', attributes: { type: 'text' }}}),
message: $C('element', { properties: { name: 'textarea'}}),
send: $C('hyperlink', {properties: { title: $S('comguestbook', 'gbook_btn_newmsg_send'), name: 'send'}})
},
properties: { toId: '' }
}
},
send: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({
type: 'addGuestBookMsg',
widgetId: LibJs.createId(),
fromId: LibJs.Comutil.person,
toId: this.widgetId,
subject: LibJs.Compiler.toAscii($D(this.labels.subject)[0].value),
message: LibJs.Compiler.toAscii($D(this.labels.message)[0].value),
mail_subject: $S('comguestbook', 'gbook_mal_subject'),
mail_message: $S('comguestbook', 'gbook_mal_message', {link: 'http://' + location.host + LibJs.Config.baseDir + LibJs.Config.protocol})
}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__send), null, 'cty/js');
},
__send: function() {
LibJs.XWin.closeLoading();
$D(this.labels.subject)[0].value = '';
$D(this.labels.message)[0].value = '';
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comguestbook', 'gbook_msg_sent') }})}});
$L(this.parent).repaint();
},
onCreate: function() {
return [
$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comguestbook', 'gbook_cap_subject')]}),
$E('td', { children: $D(this.labels.subject)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifierTop', attributes: {vAlign: 'top'}, children: [$ST('comguestbook', 'gbook_cap_message')]}),
$E('td', { children: $D(this.labels.message)})
]}),
$E('tr', { children: [
$E('td', { attributes: {colSpan: '2'}, children: $D(this.labels.send)})
]})
]})
]})
]
}
}
LibJs.Lang.__setText('comguestbook', {'gbook_ttl_title_truncated':{},'gbook_ttl_text_truncated':{},'gbook_cap_title':{},'gbook_cap_text':{},'gbook_ttl_messages':{},'gbook_btn_newmsg_send':{de:'Neuer Eintrag'},'gbook_mal_subject':{de:'Neuer G#228;stebucheintrag'},'gbook_mal_message':{},'gbook_msg_sent':{de:'Der G#228;stebucheintrag wurde erfolgreich abgesendet.'},'gbook_cap_subject':{},'gbook_cap_message':{},'gbook_msg_confirm_delete':{}});



LibJs.Component.Comhome = {
getOptions: function() {
return { labels: {
body: $C('tabarea', { properties: { items: [
{
head: $C('text', {properties: { value: $S('comhome', 'tab_ttl_overview')}}),
body: $C('comoverview', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comhome', 'tab_ttl_pms')}}),
body: $F('pmview', {widgetId: this.widgetId, properties: { newMsgVisitor: LibJs.Comutil.PmNewMsgVisitor}})
}, {
head: $C('text', {properties: { value: $S('comhome', 'tab_ttl_find_person')}}),
body: $C('comfindperson', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comhome', 'tab_ttl_guestbook')}}),
body: $C('comguestbook', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comhome', 'tab_ttl_buddies')}}),
body: $C('combuddy', {widgetId: this.widgetId})
}
]}})
}};
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('comhome', {'find_perons':{},'finder_ttl_win':{de:'Suche'},'tab_ttl_overview':{de:'#220;bersicht'},'tab_ttl_pms':{de:'Nachrichten'},'tab_ttl_find_person':{de:'Benutzer suchen'},'tab_ttl_guestbook':{de:'G#228;stebuch'},'tab_ttl_buddies':{de:'Freunde'}});



LibJs.Component.Comlogin = {
getOptions: function() {
return { labels: {
login: $C('hyperlink', {properties: { type: 'link', title: String.fromCharCode(187) +  ' '+ $S('comlogin', 'login_btn_login'), name: 'login'}}),
register: $C('hyperlink', {properties: { type: 'link', title: String.fromCharCode(187) +  ' '+ $S('comlogin', 'login_btn_register'), name: 'register'}}),
newpasswd: $C('hyperlink', {properties: { type: 'link', title: String.fromCharCode(187) + ' '+ $S('comlogin', 'login_btn_lost_password'), name: 'newPasswd'}})
}}
},
login: function() {
LibJs.XWin.openWindow({
labels: { body: $C('loginwin')},
properties: { title: $S('comlogin', 'win_ttl_login') }
})
},
register: function() {
LibJs.XWin.openWindow({
labels: { body: $C('comregister')},
properties: { title: $S('comlogin', 'win_ttl_register') }
})
},
newPasswd: function() {
LibJs.XWin.openWindow({
labels: { body: $C('newpasswd')},
properties: { title: $S('comlogin', 'win_ttl_set_new_passwd') }
})
},
onCreate: function() {
return [
$E('div', { style: { padding: '0px 15px'}, children: $D($C('help', { properties: {text: $S('comlogin', 'login_txt_regged_users_login')}}))}),
$E('div', { className: 'LibJsComponentComlogin', children: [
$E('div', {
children: $D(this.labels.login).concat($E('div', { children: [$ST('comlogin', 'login_txt_login')]}))
}),
$E('div', {
children: $D(this.labels.register).concat($E('div', { children: [$ST('comlogin', 'login_txt_register')]}))
}),
$E('div', {
children: $D(this.labels.newpasswd).concat($E('div', { children: [$ST('comlogin', 'login_txt_newpasswd')]}))
})
]})];
}}
LibJs.Lang.__setText('comlogin', {'login_btn_login':{de:'Einloggen'},'login_btn_register':{de:'Registrieren'},'login_btn_lost_password':{de:'Passwort vergessen'},'win_ttl_login':{de:'Login'},'win_ttl_register':{de:'Registrieren'},'win_ttl_set_new_passwd':{de:'Neues Passwort anfordern'},'login_txt_login':{de:[$T(LibJs.Compiler.fromAscii('Logge dich ein um dich mit anderen Pfadern auszutauschen'))]},'login_txt_newpasswd':{de:[$T(LibJs.Compiler.fromAscii('Klicke hier um dir ein neues Passwort zusenden zu lassen.'))]},'login_txt_regged_users_login':{de:'Registrierte pfadi.ch Benutzer k#246;nnen sich #252;ber die "Passwort vergessen" Funktion ein Passwort f#252;r die Community zusenden lassen. Die Accounts wurden #252;bernommen, jedoch m#252;ssen sie auf diese Weise noch aktiviert werden. Bei Fragen k#246;nnt ihr euch an community@scout.ch wenden'},'login_txt_register':{de:[$T(LibJs.Compiler.fromAscii('Melde dich hier an und werde Teil der Pfadicommunity'))]}});



LibJs.Component.Comoverview = {
getOptions: function() {
return { labels: {
findPerson: $C('comfindperson', {widgetId: this.widgetId, properties: { truncated: true}}),
newPms: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Comoverview.NewPms }}),
buddies: $C('combuddy', {widgetId: this.widgetId, properties: { truncated: true}}),
guestbook: $C('comguestbook', { widgetId: this.widgetId, properties: { truncated: true }})
}};
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { children: $D(this.labels.findPerson)}),
$E('div', { children: $D(this.labels.newPms)}),
$E('div', { children: $D(this.labels.buddies)}),
$E('div', { children: $D(this.labels.guestbook)})
]})];
}
}

LibJs.Component.Comoverview.NewPms = {
__getOptions: function() {
return { labels: { body: $C('element')}};
},
loaded: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'fetchmessages' }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'pm/js');
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.setLabel('body', $C('pmshowmessages', { properties: { type: 'received', onlyNew: true }}));
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('comoverview', {});



LibJs.Component.Compasswd = {
getOptions: function() {
return {
labels: {
oldPasswd: $C('element', { properties: { name: 'input', attributes: { type: 'password' }}}),
passwd1: $C('element', { properties: { name: 'input', attributes: { type: 'password' }}}),
passwd2: $C('element', { properties: { name: 'input', attributes: { type: 'password' }}}),
save: $C('hyperlink', { properties: { title: $S('component', 'std_btn_save'), name: 'save' }})
}
};
},
save: function() {
if ($D(this.labels.passwd1)[0].value != $D(this.labels.passwd2)[0].value) {
$D(this.labels.passwd1)[0].value = '';
$D(this.labels.passwd2)[0].value = '';
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('compasswd', 'pass_msg_pass_not_equal') }})}});
} else {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
if ($D(this.labels.passwd1)[0].value != '')
LibJs.Server.send({ type: 'changePasswd', oldPasswd: $D(this.labels.oldPasswd)[0].value, newPasswd: $D(this.labels.passwd1)[0].value }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__save));
}
},
__save: function() {
LibJs.XWin.closeLoading();
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('compasswd', 'list_ttl_change_pw')]}),
$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('compasswd', 'list_cap_passwd')]}),
$E('td', { children: $D(this.labels.oldPasswd)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('compasswd', 'list_cap_passwd_new')]}),
$E('td', { children: $D(this.labels.passwd1)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('compasswd', 'list_cap_passwd_new_again')]}),
$E('td', { children: $D(this.labels.passwd2)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children: $D(this.labels.save)})
]})
]})
]})
]})];
}
}
LibJs.Lang.__setText('compasswd', {'pass_msg_pass_not_equal':{de:'Die neuen Passw#246;rter sind nicht gleich.'},'list_ttl_change_pw':{de:[$T(LibJs.Compiler.fromAscii('Passwort #228;ndern'))]},'list_cap_passwd':{de:[$T(LibJs.Compiler.fromAscii('altes Paswort'))]},'list_cap_passwd_new':{de:[$T(LibJs.Compiler.fromAscii('neues Passwort'))]},'list_cap_passwd_new_again':{de:[$T(LibJs.Compiler.fromAscii('neues Passwort wiederholen'))]}});



LibJs.Component.Compersonimage = {
getOptions: function() {
return { labels: {
image: $C('icon', { properties: {
isAbsolute: true,
src: LibJs.Config.baseDir + 'cty/personimage/' + this.widgetId
}}),
upload: $C('upload', {
widgetId: this.widgetId,
visitor: LibJs.System.extendObject({perimgId: this.id}, LibJs.Component.Compersonimage.Uploadvisitor),
properties: { variable: 'file', accept: '*' + '/' + '*'}
}),
submit: $C('hyperlink', { properties: { title: $S('component', 'std_btn_submit'), name: 'submit' }}),

}};
},
submit: function() {
$L(this.labels.upload).submit();
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('compersonimage', 'pers_ttl_profile_image')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('compersonimage', 'pers_txt_profile_image')]}),
$E('div', { className: 'LibJsComponentCompersonimageLabel', children: [$ST('compersonimage', 'pers_cap_current_image'), $T(':')]}),
$E('div', { className: 'LibJsComponentCompersonimageImage', children: $D(this.labels.image)}),
$E('div', { className: 'LibJsComponentCompersonimageLabel', children: [$ST('compersonimage', 'pers_cap_new_image'), $T(':')]}),
$E('div', { children: $D(this.labels.upload)}),
$E('div', { children: $D(this.labels.submit)})
]})];
}
}

LibJs.Component.Compersonimage.Uploadvisitor = {
getAction: function() {
return LibJs.Config.baseDir + 'cty/upl';
},
onComplete: function() {
$L(this.perimgId).setLabel('image', $C('icon', { properties: {
isAbsolute: true,
src: LibJs.Config.baseDir + 'cty/personimage/' + $L(this.perimgId).widgetId + '/' + Math.random()
}}));
$L(this.perimgId).repaint();
}
}
LibJs.Lang.__setText('compersonimage', {'pers_cap_new_image':{de:[$T(LibJs.Compiler.fromAscii('Neues Benutzerbild'))]},'pers_ttl_new_image':{de:[$T(LibJs.Compiler.fromAscii('Benutzerbild'))]},'pers_txt_new_image':{de:[$T(LibJs.Compiler.fromAscii('Hier kannst du ein Benutzerbild hochladen, dieses wird nachher in deinem Profil angezeigt.'))]},'pers_ttl_profile_image':{},'pers_txt_profile_image':{},'pers_cap_current_image':{}});



LibJs.Component.Compersonview = {
getOptions: function() {
return { labels: {
body: $C('tabarea', { properties: { items: [
{
head: $C('text', {properties: { value: $S('compersonview', 'tab_ttl_overview')}}),
body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Compersonview.Profile}})
}, {
head: $C('text', {properties: { value: $S('compersonview', 'tab_ttl_buddies')}}),
body: $C('combuddy', { widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('compersonview', 'tab_ttl_positions')}}),
body: $C('composition', { widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('compersonview', 'tab_ttl_guestbook')}}),
body: $C('comguestbook', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('compersonview', 'tab_ttl_pm')}}),
body: $C('pmnewmsg', {
widgetId: this.widgetId,
visitor: {
onSubmit: function() {this.callFromAncestors('closeComponent');},
getReceiptFinder: function() { return $C('extend', {
widgetId: $L(this.id).widgetId,
properties: { extend: LibJs.Comutil.PmNewMsgVisitor.FixedPerson, toUser: $L(this.id).properties.toUser}
});}
},
properties: { toUser: this.widgetId }
})
}
]}})
}};
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}

LibJs.Component.Compersonview.Profile = {
__getOptions: function() {
if (
this.widgetId != LibJs.Comutil.person &&
LibJs.System.indexOfItem(LibJs.Comutil.buddies, this.widgetId) == -1 &&
LibJs.System.indexOfItem(LibJs.Comutil.notApprovedBuddies, this.widgetId) == -1
)
return { labels: { addtobuddy: $C('hyperlink', { properties: { type: 'button', title: $S('compersonview', 'buddy_btn_add'), name: 'addToBuddy'}})}};
else
return { labels: { addtobuddy: $C('element')}};
},
addToBuddy: function() {
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: this.widgetId, properties: { profileId: this.id, extend: LibJs.Component.Compersonview.Profile.AddToBuddy }})},
properties: { title: $S('compersonview', 'buddy_ttl_add', {username: $W(this.widgetId).getTitleStr()}) }
});
},
__addToBuddy: function() {
this.setLabel('addtobuddy', $C('element'));
this.repaint();
},
onCreate: function() {
var zip = $W(this.widgetId).children.cities.length ? $W($W(this.widgetId).children.cities[0]).getVariable('zip') : '';
var place = $W(this.widgetId).children.cities.length ? $W($W(this.widgetId).children.cities[0]).getVariable('place') : '';
var children = [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_firstname')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('firstname'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_lastname')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('lastname'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_nickname')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('nickname'))]})
]})
];
if ($W(this.widgetId).getVariable('email') != '')
children = children.concat([
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_email')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('email'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_gender')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('gender'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_birthday')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('birthday') + '.' + $W(this.widgetId).getVariable('birthmonth') + '.' + $W(this.widgetId).getVariable('birthyear'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_skype')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('skype'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_mobile')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('mobile'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_icq')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('icq'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_yahoo')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('yahoo'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_fixnet')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('fixnet'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_fax')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('fax'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline1')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('addrline1'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline2')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('addrline2'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_addrline3')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('addrline3'))]})
]})
]);
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentCompersonviewProfileImage', children: [$E('img', { attributes: {src: LibJs.Config.baseDir + 'cty/personimage/' + this.widgetId}})]}),
$E('table', { children: [ $E('tbody', { children: children.concat([
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comutil', 'pers_cap_city')]}),
$E('td', { children: [$T(zip + ' ' + place)]})
]})
])})]}),
$E('div', { children: $D(this.labels.addtobuddy)})
]})];
}
}

LibJs.Component.Compersonview.Profile.AddToBuddy = {
__getOptions: function() {
return { labels: {
description: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
save: $C('hyperlink', { properties: { title: $S('comprofile', 'std_btn_save'), name: 'send'}}),
cancel: $C('hyperlink', { properties: { title: $S('comprofile', 'std_btn_cancel'), name: 'closeComponent'}})
}};
},
send: function() {
if (this.widgetId != LibJs.Comutil.person && LibJs.System.indexOfItem(LibJs.Comutil.buddies, this.widgetId) == -1) {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
var buddyId = LibJs.createId();
LibJs.Server.send({
type: 'addToBuddy',
widgetId: buddyId,
person1: LibJs.Comutil.person,
description1: LibJs.Compiler.toAscii($D(this.labels.description)[0].value),
person2: this.widgetId,
mailtitle: $S('comregister', 'buddy_eml_title'),
mailmessage: $S('comregister', 'buddy_eml_message', {person: $W(LibJs.Comutil.person).getTitleStr()})
}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__send, buddyId), null, 'cty/js');
}
},
__send: function(buddyId) {
LibJs.XWin.closeLoading();
LibJs.Comutil.notApprovedBuddies.push(buddyId);
LibJs.Comutil.notifyBuddies()
$L(this.properties.profileId).__addToBuddy();
this.callFromAncestors('closeComponent');
},
onCreate: function() {
return [$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comprofile', 'buddy_cap_add_desc')]}),
$E('td', { children: $D(this.labels.description)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2' }, children: this.getLabelsDomSet(['save', 'cancel'])})
]})
]})
]})];
}
}

LibJs.Component.Compersonview.Buddies = {
onCreate: function() {
return [$E('div', { children: [$T('buddies')]})];
}
}
LibJs.Lang.__setText('compersonview', {'tab_ttl_overview':{de:'#220;bersicht'},'tab_ttl_buddies':{de:'Freunde'},'tab_ttl_positions':{de:'Abteilungen'},'tab_ttl_guestbook':{de:'G#228;stebuch'},'tab_ttl_pm':{de:'Nachrichten'},'buddy_btn_add':{de:'hinzuf#252;gen'},'buddy_ttl_add':{de:'Hinzf#252;gen'},'buddy_ttl_add_buddy':{de:'Freund hinzuf#252;gen'}});



LibJs.Component.Composition = {
getOptions: function() {
if (this.widgetId == LibJs.Comutil.person)
var connect = $C('hyperlink', {properties: { type: 'link', title: $S('composition', 'pos_btn_new'), name: 'connectPosition'}});
else
var connect = $C('element');
return {
labels: { connect: connect },
states: { fetched: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onFetched)})}
};
},
loaded: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
for (var i = 0, children = $W(this.widgetId).parents; i < children.length; ++i)
LibJs.Factory.useWidget($W(children[i]).parents[0], transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded));
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.refresh();
},
refresh: function() {
for (var i = 0, positions = []; i < $W(this.widgetId).parents.length; ++i)
if ($W($W(this.widgetId).parents[i]).type == 'composition')
positions.push($W(this.widgetId).parents[i]);
this.setLabel('list', $C('list', {
visitor: LibJs.System.extendObject({nodeId: this.id}, LibJs.Component.Composition.ListVisitor),
properties: { head: [
{ title: $S('comfindperson', 'list_ttl_unit'), widget: 0, callback: function(widgetId) {
return $W($W(widgetId).parents[0]).getTitleStr();
}},
{ title: $S('comfindperson', 'list_ttl_pos_label'), widget: 0, variable: 'label'},
{ title: $S('comfindperson', 'list_ttl_pos_type'), widget: 0, variable: 'positiontype'},
{ title: $S('comfindperson', 'list_ttl_pos_end'), widget: 0, type: 'int', callback: function(widgetId) {
return (parseInt($W(widgetId).getVariable('fromday')) < 10 ? '0' : '') + $W(widgetId).getVariable('fromday') + '.'
+ (parseInt($W(widgetId).getVariable('frommonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('frommonth') + '.' + $W(widgetId).getVariable('fromyear');
}, order: function(widgetId) {
return $W(widgetId).getVariable('fromyear') + (parseInt($W(widgetId).getVariable('frommonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('frommonth')
+ (parseInt($W(widgetId).getVariable('fromday')) < 10 ? '0' : '') + $W(widgetId).getVariable('fromday');
}
},
{ title: $S('comfindperson', 'list_ttl_pos_start'), widget: 0, type: 'int', callback: function(widgetId) {
if ($W(widgetId).getVariable('toyear') == 0)
return $S('comfindperson', 'myunits_still_active');
else
return (parseInt($W(widgetId).getVariable('today')) < 10 ? '0' : '') + $W(widgetId).getVariable('today') + '.'
+ (parseInt($W(widgetId).getVariable('tomonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('tomonth') + '.' + $W(widgetId).getVariable('toyear');
}, order: function(widgetId) {
if ($W(widgetId).getVariable('toyear') == 0)
return 0;
else
return $W(widgetId).getVariable('toyear') + (parseInt($W(widgetId).getVariable('tomonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('tomonth')
+ (parseInt($W(widgetId).getVariable('today')) < 10 ? '0' : '') + $W(widgetId).getVariable('today');
}
}
], body: positions, noExport: true }
}));
this.setState('fetched');
},
connectPosition: function() {
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Composition.Connect, nodeId: this.id }})},
properties: { title: $S('composition', 'connect_ttl_win') }
});
},
listEvent: function(persId, posId) {
if(persId == LibJs.Comutil.person)
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Composition.Connect, positionId: posId, nodeId: this.id }})},
properties: { title: $S('composition', 'connect_ttl_win') }
});
else
LibJs.XWin.openWindow({
labels: { body: $C('comunitview', { widgetId: $W(posId).parents[0]})},
properties: { title: $S('composition', 'win_ttl_viewunit') }
});
},
onCreate: function() {
return [$E('div', { children: [$ST('component', 'std_msg_loading')]})];
},
onFetched: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentComTitle', children: [$ST('composition', 'unit_ttl_myunits')]}),
$E('div', { className: 'LibJsComponentComText', children: [$ST('composition', 'unit_txt_myunits')]}),
$E('div', { children: $D(this.labels.connect)}),
$E('div', { children: $D(this.labels.list)})
]})];
}
}

LibJs.Component.Composition.ListVisitor = {
getEditIcon: function() {
if ($L(this.nodeId).widgetId == LibJs.Comutil.person)
return LibJs.Config.baseDir + 'shr/img/buttons/edit.png';
else
return LibJs.Config.baseDir + 'shr/img/buttons/viewunit.png';
},
checkAccess: function(widgetIds) {
return true;
},
clickEvent: function(widgetIds) {
$L(this.nodeId).listEvent($L(this.nodeId).widgetId, widgetIds[0]);
}
}

LibJs.Component.Composition.Connect = {
__getOptions: function() {
var position = $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Composition.Connect.Position, positionId: this.properties.positionId }});
var labels = {
unit: $C('selector', {
visitor: { getSearchButton: function() { return $C('element', {
events: this.getSearchEvents(),
properties: { name: 'input', attributes: { type: 'button', value: 'pos_btn_selector'}}
})}},
properties: LibJs.System.extendObject(
{ store: '.community', selectableTypes: ['comunit', 'comsubunit', 'comactivity'] },
(typeof this.properties.positionId == 'undefined' ? {} : { active: $W(this.properties.positionId).parents[0]})
)
}),
newUnit: $C('hyperlink', { properties: { type: 'link', title: $S('composition', 'pos_btn_add_group'), name: 'newUnit'}}),
addPosition: $C('hyperlink', { properties: { title: $S('composition', 'pos_btn_add_position'), name: 'addPosition'}}),
submit: $C('hyperlink', { properties: { title: $S('component', 'std_btn_save'), name: 'save'}}),
cancel: $C('hyperlink', { properties: { title: $S('component', 'std_btn_cancel'), name: 'closeComponent'}})
};
labels[position] = position;
return {
labels: labels,
properties: { positions: [position] }
};
},
save: function() {
if (typeof $L(this.labels.unit).getValue() == 'undefined')
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('composition', 'unit_err_no_unit_passed') }})}});
else {
var transaction = LibJs.Server.start();
LibJs.XWin.openLoading();
for (var i = 0; i < this.properties.positions.length; ++i) {
if (typeof this.properties.positionId != 'undefined' && $L(this.properties.positions[i]).properties.positionId == this.properties.positionId)
LibJs.Server.send({ type: 'disconnect', positionId: this.properties.positionId}, transaction);
if (
$D($L(this.properties.positions[i]).labels.fromyear)[0].value != '' &&
$D($L(this.properties.positions[i]).labels.frommonth)[0].value != '' &&
$D($L(this.properties.positions[i]).labels.fromday)[0].value != ''
)
LibJs.Server.send({
type: 'connect',
positionId: LibJs.createId(),
unitId: $L(this.labels.unit).getValue(),
personId: this.widgetId,
positiontype: $D($L(this.properties.positions[i]).labels.positiontype)[0].value,
label: $D($L(this.properties.positions[i]).labels.label)[0].value,
fromyear: $D($L(this.properties.positions[i]).labels.fromyear)[0].value,
frommonth: $D($L(this.properties.positions[i]).labels.frommonth)[0].value,
fromday: $D($L(this.properties.positions[i]).labels.fromday)[0].value,
toyear: $D($L(this.properties.positions[i]).labels.stillactive)[0].checked ? 0 : $D($L(this.properties.positions[i]).labels.toyear)[0].value,
tomonth: $D($L(this.properties.positions[i]).labels.tomonth)[0].value,
today: $D($L(this.properties.positions[i]).labels.today)[0].value
}, transaction);
}
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__save), null, 'cty/js');
}
},
__save: function() {
LibJs.XWin.closeLoading();
$L(this.properties.nodeId).refresh();
this.callFromAncestors('closeComponent');
},
newUnit: function(args) {
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Composition.Connect.Newunit }})},
properties: { title: $S('composition', 'unit_ttl_win_new') }
});
},
addPosition: function(args) {
var position = $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Composition.Connect.Position }});
this.setLabel(position, position);
this.properties.positions.push(position);
this.repaint();
},
removePosition: function(args) {
this.properties.positions = LibJs.System.withoutItem(this.properties.positions, args.nodeId);
this.repaint();
},
deletePosition: function() {
LibJs.XWin.openConfirm({
labels: { body: $C('text', { properties: { value: $S('composition', 'pos_msg_confirm_delete', {name: $W($W(this.properties.positionId).parents[0]).getTitleStr()})}})},
visitor: { editorId: this.id, onOk: function() { $L(this.editorId).__deletePosition();}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__deletePosition: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'disconnect', positionId: this.properties.positionId}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__afterDelete), null, 'cty/js');
},
__afterDelete: function() {
LibJs.XWin.closeLoading();
$W(this.widgetId).parents = LibJs.System.withoutItem($W(this.widgetId).parents, this.properties.positionId);
$L(this.properties.nodeId).refresh();
this.callFromAncestors('closeComponent');
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { children: [$ST('composition', 'pos_ttl_namage')]}),
$E('div', { children: [$ST('composition', 'pos_txt_namage')]})
].concat(this.getLabelsDomSet(['unit', 'newUnit'].concat(this.properties.positions))).concat([
$E('div', { children: $D(this.labels.addPosition)})
]).concat(this.getLabelsDomSet(['submit', 'cancel']))})];
}
}

LibJs.Component.Composition.Connect.Newunit = {
__getOptions: function() {
return {
labels: { button: $C('hyperlink', {properties: { title: $S('composition', 'unit_btn_send_new'), name: 'send'}})},
properties: { subject: '', 	message: '', done: '' }
};
},
send: function() {
this.properties.subject = document.getElementById('subject' + this.id).value;
this.properties.message = document.getElementById('message' + this.id).value;
if (!this.properties.subject || !this.properties.message)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('composition', 'unit_msg_no_title_new')}})}});
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'newunit', username: $W(this.widgetId).getTitleStr(), subject: this.properties.subject, message: this.properties.message}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__send), null, 'cty/js');
},
__send: function() {
LibJs.XWin.closeLoading();
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('composition', 'unit_msg_mail_sent_new')}})}});
this.callFromAncestors('closeComponent');
},
onCreate: function() {
var message = (
this.properties.done
? [$E('tr', {
className:'LibJsComponentEtatwrapperFeedbackMessage',
children: [ $E('td', { attributes: { colSpan: '2'}, children: [$T(this.properties.done)]})]
})]
: []
);
return [$E('table', { children: [ $E('tbody', { children: message.concat([
$E('tr', { children: [
$E('td', { children: [$ST('composition', 'unit_cap_from_new'), $T(': ')]}),
$E('td', { children: [$T($W(LibJs.user).getVariable('email'))]})
]}),
$E('tr', { children: [
$E('td', { children: [$ST('composition', 'unit_cap_title_new'), $T(': ')]}),
$E('td', { children: [$E('input', {attributes: { type: 'text', value: this.properties.subject, id: 'subject' + this.id}})]})
]}),
$E('tr', { children: [
$E('td', { children: [$ST('composition', 'unit_cap_body_new'), $T(': ')]}),
$E('td', { children: [$E('textarea', {attributes: { id: 'message' + this.id, rows: '10', cols: '50'}, children: [$T(this.properties.message)]})]})
]}),
$E('tr', { children: [ $E('td'), $E('td', { children: $D(this.labels.button)})]})
])})]})];
}
}

LibJs.Component.Composition.Connect.Position = {
__getOptions: function() {
return { labels: {
remove: $C('hyperlink', { properties: (
typeof this.properties.positionId == 'undefined'
? { title: $S('component', 'std_btn_remove'), type: 'link', name: 'removePosition', arguments: { nodeId: this.id}}
: { title: $S('component', 'std_btn_delete'), type: 'link', name: 'deletePosition'}
)}),
label: $C('element', { properties: { name: 'input',  attributes: LibJs.System.extendObject(
{ type: 'text' },
(typeof this.properties.positionId == 'undefined' ? {} : { value: $W(this.properties.positionId).getVariable('label')})
)}}),
positiontype: $C('extend', { properties: { extend: LibJs.Component.Composition.Connect.Positiontype }}),
fromyear: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{extend: LibJs.Comutil.Selectoptions, min: (new Date()).getFullYear(), max: 1900},
(typeof this.properties.positionId == 'undefined' ? {} : { selected: $W(this.properties.positionId).getVariable('fromyear')})
)}),
frommonth: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{extend: LibJs.Comutil.Selectoptions, min: 1, max: 12},
(typeof this.properties.positionId == 'undefined' ? {} : { selected: $W(this.properties.positionId).getVariable('frommonth')})
)}),
fromday: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{extend: LibJs.Comutil.Selectoptions, min: 1, max: 31},
(typeof this.properties.positionId == 'undefined' ? {} : { selected: $W(this.properties.positionId).getVariable('fromday')})
)}),
toyear: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{ extend: LibJs.Comutil.Selectoptions, min: (new Date()).getFullYear(), max: 1900 },
LibJs.System.extendObject(
(typeof this.properties.positionId != 'undefined' && $W(this.properties.positionId).getVariable('toyear') == 0 ? { disabled: 'disabled' } : { }),
(typeof this.properties.positionId != 'undefined' ? { selected: $W(this.properties.positionId).getVariable('toyear') } : { })
)
)}),
tomonth: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{ extend: LibJs.Comutil.Selectoptions, min: 1, max: 12 },
LibJs.System.extendObject(
(typeof this.properties.positionId != 'undefined' && $W(this.properties.positionId).getVariable('toyear') == 0 ? { disabled: 'disabled' } : { }),
(typeof this.properties.positionId != 'undefined' ? { selected: $W(this.properties.positionId).getVariable('tomonth') } : { })
)
)}),
today: $C('extend', { widgetId: this.widgetId, properties: LibJs.System.extendObject(
{ extend: LibJs.Comutil.Selectoptions, min: 1, max: 31 },
LibJs.System.extendObject(
(typeof this.properties.positionId != 'undefined' && $W(this.properties.positionId).getVariable('toyear') == 0 ? { disabled: 'disabled' } : { }),
(typeof this.properties.positionId != 'undefined' ? { selected: $W(this.properties.positionId).getVariable('today') } : { })
)
)}),
stillactive: $C('element', {
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'setStillActive'})],
properties: { name: 'input',  attributes: LibJs.System.extendObject(
{ type: 'checkbox' },
(typeof this.properties.positionId != 'undefined' && $W(this.properties.positionId).getVariable('toyear') == 0 ? { checked: 'checked' } : {})
)}
})
}};
},
setStillActive: function() {
if ($D(this.labels.stillactive)[0].checked) {
$D(this.labels.toyear)[0].disabled = 'disabled';
$D(this.labels.tomonth)[0].disabled = 'disabled';
$D(this.labels.today)[0].disabled = 'disabled';
} else {
$D(this.labels.toyear)[0].disabled = '';
$D(this.labels.tomonth)[0].disabled = '';
$D(this.labels.today)[0].disabled = '';
}
},
onCreate: function() {
return [$E('table', { attributes: {cellSpacing: '0'}, className: 'LibJsComponentComprofileMyunitsNew', children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('th', { attributes: {colSpan: '2'}, children: [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/add.png'}}), $ST('composition', 'unit_ttl_new_position')]})
]}),
$E('tr', { children: [
$E('td', { attributes: {colSpan: '2'}, children: $D(this.labels.remove)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('composition', 'unit_cap_positiontype')]}),
$E('td', { children: $D(this.labels.positiontype)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('composition', 'unit_cap_label')]}),
$E('td', { children: $D(this.labels.label)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('composition', 'unit_cap_from')]}),
$E('td', { children: this.getLabelsDomSet(['fromday', 'frommonth', 'fromyear'])})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('composition', 'unit_cap_to')]}),
$E('td', { children: this.getLabelsDomSet(['today', 'tomonth', 'toyear'])})
]}),
$E('tr', { children: [
$E('td', { children: [$T(' ')]}),
$E('td', { children: $D(this.labels.stillactive).concat([$ST('composition', 'unit_cap_stillactive')])})
]})
]})
]})];
}
}

LibJs.Component.Composition.Connect.Positiontype = {
onCreate: function() {
return [$E('select', { children: [
$E('option', { attributes: { value: 'member' }, children: [$ST('composition', 'pos_itm_type_member')]}),
$E('option', { attributes: { value: 'lead' }, children: [$ST('composition', 'pos_itm_type_lead')]})
]})];
}
}
LibJs.Lang.__setText('composition', {'pos_btn_new':{de:'Neu'},'connect_ttl_win':{},'win_ttl_viewunit':{},'unit_ttl_myunits':{de:[$T(LibJs.Compiler.fromAscii('Meine Funktionen'))]},'unit_txt_myunits':{},'pos_btn_add_group':{de:'Gruppe hinzuf#252;gen'},'pos_btn_add_position':{de:'Position hinzuf#252;gen'},'unit_err_no_unit_passed':{},'unit_ttl_win_new':{},'pos_msg_confirm_delete':{de:'Bist du sicher, dass du $name l#246;schen m#246;chtest?'},'pos_ttl_namage':{},'pos_txt_namage':{},'unit_btn_send_new':{},'unit_msg_no_title_new':{},'unit_msg_mail_sent_new':{},'unit_cap_from_new':{de:[$T(LibJs.Compiler.fromAscii('Gegr#252;ndet'))]},'unit_cap_title_new':{},'unit_cap_body_new':{},'unit_ttl_new_position':{},'unit_cap_positiontype':{de:[$T(LibJs.Compiler.fromAscii('Funktion'))]},'unit_cap_label':{de:[$T(LibJs.Compiler.fromAscii('Bezeichnung'))]},'unit_cap_from':{},'unit_cap_to':{de:[$T(LibJs.Compiler.fromAscii('Aufgel#246;st'))]},'unit_cap_stillactive':{de:[$T(LibJs.Compiler.fromAscii('Noch aktiv'))]},'pos_itm_type_member':{de:[$T(LibJs.Compiler.fromAscii('Teilnehmer'))]},'pos_itm_type_lead':{de:[$T(LibJs.Compiler.fromAscii('Leiter'))]}});



LibJs.Component.Comprofile = {
getOptions: function() {
return { labels: {
body: $C('tabarea', { properties: { items: [
{
head: $C('text', {properties: { value: $S('comprofile', 'tab_ttl_data')}}),
body: $C('comdata', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comprofile', 'tab_ttl_image')}}),
body: $C('compersonimage', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comprofile', 'tab_ttl_positions')}}),
body: $C('composition', {widgetId: this.widgetId})
}, {
head: $C('text', {properties: { value: $S('comprofile', 'tab_ttl_passwd')}}),
body: $C('compasswd', {widgetId: this.widgetId})
}
]}})
}};
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('comprofile', {'buddy_ttl_list_truncated':{},'buddy_txt_list_truncated':{},'buddy_ttl_list':{de:[$T(LibJs.Compiler.fromAscii('Freunde'))]},'buddy_txt_list':{},'buddy_btn_view_profile':{de:'Profil anschauen'},'buddy_btn_approve':{de:'Freund akzeptieren'},'buddy_btn_decline':{de:'Freund ablehnen'},'buddy_msg_decline_confirm':{de:'Bist du sicher, das du $name nicht als Freund haben willst?'},'std_btn_save':{},'std_btn_cancel':{},'buddy_txt_add_description':{},'buddy_btn_remove':{de:'Freund entfernen'},'buddy_msg_delete_confirm':{de:'Bist du sicher, das du $name nicht mehr als Freund haben willst?'},'buddy_cap_add_desc':{de:[$T(LibJs.Compiler.fromAscii('Beschreibung'))]},'tab_ttl_data':{},'tab_ttl_image':{},'tab_ttl_positions':{},'tab_ttl_passwd':{},'buddy_ttl_icon':{}});



LibJs.Component.Comregister = {
getOptions: function() {
return { labels: {
firstname: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
lastname: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
nickname: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
email: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
email2: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
username: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
passwd: $C('element', { properties: { name: 'input',  attributes: { type: 'password' }}}),
passwd2: $C('element', { properties: { name: 'input',  attributes: { type: 'password' }}}),
agb: $C('element', { properties: { name: 'input',  attributes: { type: 'checkbox' }}}),
spam: $C('element', { properties: { name: 'input',  attributes: { type: 'checkbox' }}}),
data_agree_label: $C('hyperlink', {properties: { type: 'link', title: $S('comregister', 'reg_btn_data_agree'), name: 'show_data_agree'}}),
submit: $C('hyperlink', {properties: { title: $S('comregister', 'reg_btn_register'), name: 'register'}}),
close: $C('hyperlink', {properties: { title: $S('component', 'std_btn_cancel'), name: 'closeComponent'}})
}}
},
register: function() {
if ($D(this.labels.email)[0].value != $D(this.labels.email2)[0].value)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_email_not_match') }})}});
if ($D(this.labels.passwd)[0].value != $D(this.labels.passwd2)[0].value)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_passwd_not_match') }})}});
if (!$D(this.labels.agb)[0].checked)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_agb_not_accepted') }})}});
if (!$D(this.labels.spam)[0].checked)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_spam_not_accepted') }})}});
if (!$D(this.labels.firstname)[0].value || !$D(this.labels.lastname)[0].value || !$D(this.labels.email)[0].value || !$D(this.labels.username)[0].value || !$D(this.labels.passwd)[0].value)
return LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_fn_ln_em_un_pw_required')}})}});
var transaction = LibJs.Server.start();
var userId = LibJs.createId();
LibJs.XWin.openLoading();
LibJs.Server.send({
type: 'register',
userId: userId,
personId: LibJs.createId(),
firstname: $D(this.labels.firstname)[0].value,
lastname: $D(this.labels.lastname)[0].value,
nickname: $D(this.labels.nickname)[0].value,
email: $D(this.labels.email)[0].value,
username: $D(this.labels.username)[0].value,
passwd: $D(this.labels.passwd)[0].value,
agb: $D(this.labels.agb)[0].checked ? 1 : 0,
spam: $D(this.labels.spam)[0].checked ? 1 : 0,
mailtitle: $S('comregister', 'reg_eml_title'),
mailmessage: $S('comregister', 'reg_eml_message', {url: 'http://' + location.host + LibJs.Config.baseDir + LibJs.Config.protocol + '/activate/' + userId + '/|-CHECKID-|'})
}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__register), LibJs.System.bind(this, this.__registerError), 'cty/js');
},
show_data_agree: function() {
LibJs.XWin.openWindow({
labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_txt_agree_body') }})},
properties: { title: $S('comregister', 'reg_ttl_agree') }
});
},
__register: function() {
LibJs.XWin.closeLoading();
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_msg_register_complete')}})}});
this.callFromAncestors('closeComponent');
},
__registerError: function() {
LibJs.XWin.closeLoading();
$D(this.labels.email)[0].value = '';
$D(this.labels.email2)[0].value = '';
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('comregister', 'reg_err_email_exists')}})}});
},
onCreate: function() {
return [$E('table', { children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { children: [ $ST('comregister', 'reg_cap_username'), $T(': ')]}),
$E('td', { children: $D(this.labels.username)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('communityview', 'pers_cap_nickname'), $T(': ')]}),
$E('td', { children: $D(this.labels.nickname)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('communityview', 'pers_cap_firstname'), $T(': ')]}),
$E('td', { children: $D(this.labels.firstname)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('communityview', 'pers_cap_lastname'), $T(': ')]}),
$E('td', { children: $D(this.labels.lastname)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('communityview', 'pers_cap_email'), $T(': ')]}),
$E('td', { children: $D(this.labels.email)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('comregister', 'reg_cap_email_again'), $T(': ')]}),
$E('td', { children: $D(this.labels.email2)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('comregister', 'reg_cap_pass'), $T(': ')]}),
$E('td', { children: $D(this.labels.passwd)})
]}),
$E('tr', { children: [
$E('td', { children: [ $ST('comregister', 'reg_cap_pass_again'), $T(': ')]}),
$E('td', { children: $D(this.labels.passwd2)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children:
$D(this.labels.agb).concat(
[$ST('comregister', 'agb_prefix_text'), $T(' ')]
).concat(
[
$E('a', {
attributes: { href: LibJs.Config.baseDir + 'cty/pdf/agb.pdf', target: '_blank'},
children: [$ST('comregister', 'agb_link')]
}),
$T(' '),
$ST('comregister', 'agb_middle_text'),
$T(' ')
]
).concat(
$D(this.labels.data_agree_label)
).concat(
[$T(' '), $ST('comregister', 'agb_sufix_text')]
)
})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children:
$D(this.labels.spam).concat([$ST('comregister', 'reg_cap_spam_rules')])
})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2'}, children: this.getLabelsDomSet(['submit', 'close'])})
]})
]})
]})];
}
}
LibJs.Lang.__setText('comregister', {'reg_btn_register':{de:'Registrieren'},'reg_err_email_not_match':{de:'Die Emailadresse stimmt nicht #252;berein'},'reg_err_passwd_not_match':{de:'Das Passwort stimmt nicht #252;berein'},'reg_err_agb_not_accepted':{de:'Du musst die AGB und Datenschutzbestimmungen akzeptieren damit Du dich registrieren kannst.',en:'Du musst die AGB und Datenschutzbestimmungen akzeptieren damit Du dich registrieren kannst.'},'reg_err_spam_not_accepted':{de:'Du musst die Spamrichtlinien akzeptieren damit Du dich registrieren kannst.'},'reg_err_fn_ln_em_un_pw_required':{de:'Damit du dich registrieren kannst, musst du alle Felder ausf#252;llen.'},'reg_eml_title':{de:'Anmeldung in der Pfadicommunity.',en:'Anmeldung in der Pfadicommunity.'},'reg_eml_message':{de:'Willkommen in der Pfadicommunity, um deinen Account zu aktivieren klicke auf folgende Adresse: $url . Viel Spass in der Community',en:'Willkommen in der Pfadicommunity, um deinen Account zu aktivieren klicke auf folgende Adresse: $url . Viel Spass in der Community'},'reg_msg_register_complete':{de:'Gratuliere! Du hast dich soeben in der Pfadicommunity registriert.'},'reg_err_email_exists':{de:'Unter dieser Emailadresse hat sich schon ein Benutzer angemeldet'},'reg_cap_email_again':{de:[$T(LibJs.Compiler.fromAscii('Email best#228;tigen'))]},'reg_cap_pass':{de:[$T(LibJs.Compiler.fromAscii('Passwort'))]},'reg_cap_pass_again':{de:[$T(LibJs.Compiler.fromAscii('Passwort best#228;tigen'))]},'reg_cap_username':{de:[$T(LibJs.Compiler.fromAscii('Benutzername'))]},'reg_btn_data_agree':{},'reg_txt_agree_body':{},'reg_ttl_agree':{},'agb_prefix_text':{},'agb_link':{},'agb_middle_text':{},'agb_sufix_text':{},'reg_cap_spam_rules':{},'buddy_eml_title':{},'buddy_eml_message':{}});



LibJs.Component.Comunitview = {
getOptions: function() {
return { labels: {
body: $C('tabarea', { properties: { items: [
{
head: $C('text', {properties: { value: $S('comunitview', 'tab_ttl_view_persons')}}),
body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Comunitview.ShowPersons }})
}, {
head: $C('text', {properties: { value: $S('comunitview', 'tab_ttl_view_unit')}}),
body: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Component.Comunitview.ShowUnit }})
}
]}})
}};
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}

LibJs.Component.Comunitview.ShowPersons = {
__getOptions: function() {
return { labels: { body: $C('text', {properties: { value: $S('component', 'std_msg_loading')}})}};
},
loaded: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Comutil.usePersonByUnit(this.widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'cty/js');
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.setLabel('body', $C('list', {
visitor: LibJs.Component.Comunitview.ShowPersons.ListVisitor,
properties: { head: [
{ title: $S('comutil', 'pers_cap_username'), widget: 0, variable: 'login'},
{ title: $S('comutil', 'pers_cap_nickname'), widget: 0, variable: 'nickname'},
{ title: $S('comutil', 'pers_cap_firstname'), widget: 0, variable: 'firstname'},
{ title: $S('comutil', 'pers_cap_lastname'), widget: 0, variable: 'lastname'}
], body: LibJs.Comutil.units[this.widgetId], noExport: true }
}));
this.repaint();
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}

LibJs.Component.Comunitview.ShowPersons.ListVisitor = {
getEditIcon: function() {
return LibJs.Config.baseDir + 'shr/img/buttons/profile.png';
},
checkAccess: function(widgetIds) {
return true;
},
clickEvent: function(widgetIds) {
LibJs.XWin.openWindow({
labels: { body: $C('compersonview', { widgetId: widgetIds[0] })},
properties: { title: $S('list', 'list_ttl_win', {person: $W(widgetIds[0]).getTitleStr()}) }
});
}
}


LibJs.Component.Comunitview.ShowUnit = {
onCreate: function() {
if (!$W(this.widgetId).getVariable('beginday') && !$W(this.widgetId).getVariable('beginmonth') && !$W(this.widgetId).getVariable('beginday'))
var beginExist = $S('comunitview', 'sunit_err_unknown');
else
var beginExist = (parseInt($W(this.widgetId).getVariable('beginday')) < 10 ? '0' : '') + $W(this.widgetId).getVariable('beginday') + '.'
+ (parseInt($W(this.widgetId).getVariable('beginmonth')) < 10 ? '0' : '') + $W(this.widgetId).getVariable('beginmonth') + '.'
+ $W(this.widgetId).getVariable('beginyear');
if (!$W(this.widgetId).getVariable('beginday') && !$W(this.widgetId).getVariable('beginmonth') && !$W(this.widgetId).getVariable('beginday'))
var endExist = $S('comunitview', 'sunit_err_still_exists');
else
var endExist = (parseInt($W(this.widgetId).getVariable('endday')) < 10 ? '0' : '') + $W(this.widgetId).getVariable('endday') + '.'
+ (parseInt($W(this.widgetId).getVariable('endmonth')) < 10 ? '0' : '') + $W(this.widgetId).getVariable('endmonth') + '.'
+ $W(this.widgetId).getVariable('endyear');
var children = [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_name')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('name'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'snit_cap_begindate')]}),
$E('td', { children: [$T(beginExist)]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_enddate')]}),
$E('td', { children: [$T(endExist)]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_active')]}),
$E('td', { children: [$ST('comunitview', 'subunit_cap_' + $W(this.widgetId).getVariable('active'))]})
]})
];
if ($W(this.widgetId).type == 'comunit')
children = children.concat(
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_pbsid')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('pbsid'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_short')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('short'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_www')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('www'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$ST('comunitview', 'sunit_cap_email')]}),
$E('td', { children: [$T($W(this.widgetId).getVariable('email'))]})
]})
);
return [$E('table', { className: 'LibJsComponentComprofileShowunit', children: [$E('tbody', { children: children })]})];
}
}
LibJs.Lang.__setText('comunitview', {'tab_ttl_view_persons':{},'tab_ttl_view_unit':{},'sunit_err_unknown':{},'sunit_err_still_exists':{},'sunit_cap_name':{},'snit_cap_begindate':{},'sunit_cap_enddate':{},'sunit_cap_active':{},'sunit_cap_pbsid':{},'sunit_cap_short':{},'sunit_cap_www':{},'sunit_cap_email':{}});


LibJs.Visitor.Pmnewmsg = {

onSubmit: function() {},
getReceiptFinder: function() {
return $C('userfinder');
}
}




LibJs.Component.Pmnewmsg = {
getOptions: function() {
return { labels: {
receipt: this.visitor.getReceiptFinder(),
subject: $C('element', { properties: { name: 'input',  attributes: { type: 'text' }}}),
message: $C('element', { properties: { name: 'textarea', attributes: { rows: '8', cols: '50'}}}),
submit: $C('hyperlink', {properties: { title: $S('pmnewmsg', 'submit'), name: 'submit'}})
}};
},
submit: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
this.properties.messageId = LibJs.createId();
LibJs.Server.send({
type: 'createmessge',
messageId: this.properties.messageId,
userId: (this.properties.toUser ? this.properties.toUser : $L(this.labels.receipt).getValue()),
subject: LibJs.Compiler.toAscii($D(this.labels.subject)[0].value),
message: LibJs.Compiler.toAscii($D(this.labels.message)[0].value),
messagetype: 'normal',
mail_subject: $S('pmnewmsg', 'mail_subject'),
mail_message: $S('pmnewmsg', 'mail_message', {link: 'http://' + location.host + LibJs.Config.baseDir + LibJs.Config.protocol})
}, transaction);
LibJs.Server.send({ type: 'fetchmessages' }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__submit), LibJs.System.bind(this, this.__error), 'pm/js');
},
__submit: function() {
LibJs.XWin.closeLoading();
this.visitor.onSubmit();
},
__error: function() {
LibJs.XWin.closeLoading();
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('pmnewmsg', 'new_messages_usrename_not_exists') }})}});
},
onCreate: function() {
if (this.properties.toUser)
var row = $E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', attributes: { vAlign: 'top'}, children: [$T($S('pmnewmsg', 'username'))]}),
$E('td', { children: [$E('input', { attributes: { type: 'text', disabled: 'disabled', value: $W(this.properties.toUser).getTitleStr()}})]})
]});
else
var row = $E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', attributes: { vAlign: 'top'}, children: [$T($S('pmnewmsg', 'username'))]}),
$E('td', { children: $D(this.labels.receipt)})
]});
return [$E('div', { className: 'LibJsComponentPmviewTitle', children: [$T($S('pmnewmsg', 'new_messages'))]}),
$E('table', { children: [
$E('tbody', { children: [
row,
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', attributes: { vAlign: 'top'}, children: [$T($S('pmnewmsg', 'subject'))]}),
$E('td', { children: $D(this.labels.subject)})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifierTop', attributes: { vAlign: 'top'}, children: [$T($S('pmnewmsg', 'message'))]}),
$E('td', { children: $D(this.labels.message)})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2' }, children: $D(this.labels.submit)})
]})
]})
]})
];
}
}
LibJs.Lang.__setText('pmnewmsg', {'submit':{},'mail_subject':{},'mail_message':{},'new_messages_usrename_not_exists':{},'username':{},'new_messages':{},'subject':{},'message':{}});




LibJs.Component.Pmshowmessages = {
getOptions: function() {
return { labels: { body: this.createList()}};
},
createList: function() {
if (this.properties.type == 'sent')
var head = [{ title: $S('pmshowmessages', 'title_to'), widget: 0, variable: 'toname'}];
else
var head = [{ title: $S('pmshowmessages', 'title_from'), widget: 0, variable: 'fromname'}];
head = head.concat([
{ title: $S('pmshowmessages', 'title_subject'), widget: 0, variable: 'subject'},
{ title: $S('pmshowmessages', (this.properties.type == 'sent'?'title_send':'title_received')), widget: 0, type: 'int', callback: function(widgetId) {
return (parseInt($W(widgetId).getVariable('sendday')) < 10 ? '0' : '') + $W(widgetId).getVariable('sendday') + '.'
+ (parseInt($W(widgetId).getVariable('sendmonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('sendmonth') + '.' + $W(widgetId).getVariable('sendyear');
}, order: function(widgetId) {
return $W(widgetId).getVariable('sendyear') + (parseInt($W(widgetId).getVariable('sendmonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('sendmonth')
+ (parseInt($W(widgetId).getVariable('sendyear')) < 10 ? '0' : '') + $W(widgetId).getVariable('sendyear');
}
},
{ title: $S('pmshowmessages', 'title_read'), widget: 0, type: 'int', callback: function(widgetId) {
if (!$W(widgetId).getVariable('readday') && !$W(widgetId).getVariable('readmonth') && !$W(widgetId).getVariable('readyear'))
return $S('pmshowmessages', 'unread');
else
return (parseInt($W(widgetId).getVariable('readday')) < 10 ? '0' : '') + $W(widgetId).getVariable('readday') + '.'
+ (parseInt($W(widgetId).getVariable('readmonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('readmonth') + '.' + $W(widgetId).getVariable('readyear');
}, order: function(widgetId) {
return $W(widgetId).getVariable('readyear') + (parseInt($W(widgetId).getVariable('readmonth')) < 10 ? '0' : '') + $W(widgetId).getVariable('readmonth')
+ (parseInt($W(widgetId).getVariable('readday')) < 10 ? '0' : '') + $W(widgetId).getVariable('readday');
}
}
]);
var body = [];
for (var i = 0; i < LibJs.PMs.messages.length; ++i)
if (
$W(LibJs.PMs.messages[i]).getVariable(this.properties.type == 'sent' ? 'fromid' : 'toid') == LibJs.user
&& (!this.properties.onlyNew || (!$W(LibJs.PMs.messages[i]).getVariable('readday') && !$W(LibJs.PMs.messages[i]).getVariable('readmonth') && !$W(LibJs.PMs.messages[i]).getVariable('readyear')))
)
body.push(LibJs.PMs.messages[i]);
return $C('list', {
visitor: LibJs.System.extendObject({ messageType: this.properties.type }, LibJs.Component.Pmshowmessages.ListVisitor),
properties: {noExport: true,  head: head, body: body }
});
},
loaded: function() {
if (LibJs.System.indexOfItem(LibJs.PMs.notifyInstances, this.id) == -1)
LibJs.PMs.notifyInstances.push(this.id);
},
notify: function(type) {
if (type == 'markRead')
$L(this.labels.body).reloadValues();
else
this.setLabel('body', this.createList());
},
onCreate: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentPmviewTitle', children: [
this.properties.type == 'sent' ? $ST('pmshowmessages', 'pm_ttl_sent_msgs') : $ST('pmshowmessages', 'pm_ttl_received_msgs')
]})
].concat($D(this.labels.body))})];
}
}

LibJs.Component.Pmshowmessages.ListVisitor = {
getEditIcon: function() {
return LibJs.Config.baseDir + 'shr/img/buttons/pm_received.png';
},
checkAccess: function(widgetIds) {
return true;
},
clickEvent: function(widgetIds) {
if ($W(widgetIds[0]).getVariable('toid') == LibJs.user &&
$W(widgetIds[0]).getVariable('readday') == '' &&
$W(widgetIds[0]).getVariable('readmonth') == '' &&
$W(widgetIds[0]).getVariable('readyear') == ''
) {
$W(widgetIds[0]).setVariable('readday', (new Date).getDate());
$W(widgetIds[0]).setVariable('readmonth', (new Date).getMonth());
$W(widgetIds[0]).setVariable('readyear', (new Date).getFullYear());
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'markpmasread', messageId: widgetIds[0] }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(LibJs.PMs, LibJs.PMs.notify, 'markRead'), null, 'pm/js');
}
LibJs.XWin.openWindow({
labels: { body: $C('extend', { widgetId: widgetIds[0], properties: { caller: this.id, type: this.messageType, extend: LibJs.Component.Pmshowmessages.ListVisitor.ShowMessage }})},
properties: { title: $W(widgetIds[0]).getVariable('subject') }
});
}
}

LibJs.Component.Pmshowmessages.ListVisitor.ShowMessage = {
__getOptions: function() {
return {
labels: {
close: $C('hyperlink', {properties: { title: $S('component', 'std_btn_close'), name: 'closeComponent'}}),
deletemsg: $C('hyperlink', {properties: { title: $S('pmshowmessages', 'pm_btn_delete_msg'), name: 'deleteMsg'}})
}
};
},
deleteMsg: function() {
LibJs.XWin.openConfirm({
widgetId: this.widgetId,
labels: { body: $C('text', { properties: { value: $S('pmshowmessages', 'pm_msg_del_confirm', {subject: $W(this.widgetId).getVariable('subject')})}})},
visitor: { editorId: this.id, onOk: function() { $L(this.editorId).__deleteMsg();}},
properties: { ok: $S('component', 'std_btn_yes'), cancel: $S('component', 'std_btn_no')}
});
},
__deleteMsg: function() {
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'deletemessge', messageId: this.widgetId }, transaction);
LibJs.Server.commit(transaction, null, null, 'pm/js');
LibJs.Factory.deleteWidget(this.widgetId);
LibJs.PMs.messages = LibJs.System.withoutItem(LibJs.PMs.messages, this.widgetId);
LibJs.PMs.notify('deleteMsg');
this.callFromAncestors('closeComponent');
},
onCreate: function() {
return [$E('table', { className: 'LibJsComponentPmviewShowMessage', children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', attributes: {width: '40'}, children: [$ST('pmshowmessages', 'pm_cap_sender') + ': ')]}),
$E('td', { className: 'LibJsComponentPmviewShowMessageField', children: [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/widgets/user.png'}}), $T(' ' + $W(this.widgetId).getVariable('fromname'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentIdentifier', children: [$T($S('pmshowmessages', 'pm_cap_recipient') + ': ')]}),
$E('td', { className: 'LibJsComponentPmviewShowMessageField', children: [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/widgets/user.png'}}), $T(' ' + $W(this.widgetId).getVariable('toname'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentPmviewShowMessageSubject', attributes: { colSpan: '2' }, children: [$T($W(this.widgetId).getVariable('subject'))]})
]}),
$E('tr', { children: [
$E('td', { className: 'LibJsComponentPmviewShowMessageMessage', attributes: { colSpan: '2' }, children: [
$E('pre', { children: [$T($W(this.widgetId).getVariable('message'))]})
]})
]}),
$E('tr', { children: [
$E('td', { attributes: { colSpan: '2' }, children: this.getLabelsDomSet(['close', 'deletemsg'])})
]})
]})
]})];
}
}
LibJs.Lang.__setText('pmshowmessages', {'title_to':{},'title_from':{},'title_subject':{},'title_read':{},'unread':{},'showmsg_delete':{},'showmsg_delete_confirm_prefix':{},'showmsg_delete_confirm_suffix':{},'showmsg_from':{},'showmsg_to':{},'pm_ttl_sent_msgs':{},'pm_ttl_received_msgs':{},'pm_btn_delete_msg':{},'pm_msg_del_confirm':{},'pm_cap_sender':{},'pm_cap_recipient':{}});


LibJs.Visitor.Tree = {

loadRoots: function(transaction) {
if ($L(this.id).properties.store)
LibJs.Factory.useRoots($L(this.id).properties.store, transaction);
else if($L(this.id).properties.rootId)
LibJs.Factory.useWidget($L(this.id).properties.rootId, transaction);
else
throw new LibJs.Exception(new Error(), 'No roots passed!', this.id);
},

getRoots: function() {
var children = [];
if ($L(this.id).properties.store) {
for (var i = 0; i < LibJs.Factory.roots[$L(this.id).properties.store].length; i++)
if (!$L(this.id).properties.types || LibJs.System.indexOfItem($L(this.id).properties.types, $W(LibJs.Factory.roots[$L(this.id).properties.store][i]).type) > -1)
children.push(LibJs.Factory.roots[$L(this.id).properties.store][i]);
} else
children.push($L(this.id).properties.rootId);
return children;
},

isRoot: function(widgetId) {
return LibJs.System.indexOfItem(this.getRoots(), widgetId) > -1;
},

loadChildren: function(nodeId) {
var transaction = LibJs.Server.start();
LibJs.Factory.useWidgetChildren($L(nodeId).widgetId, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind($L(nodeId), $L(nodeId).render));
},

rebuildHead: function(nodeId) {
return $C('extend', { widgetId: $L(nodeId).widgetId,  parent: nodeId, properties: { extend: LibJs.Component.Tree.Node.Head, treeId: this.id }});
},

getChildNodesIfBody: function(nodeId) {
if ($L(nodeId).getState() == 'opened')
return $L($L($L(nodeId).labels.body).getChildren()[0]).getChildren();
else
return [];
},

rebuildBody: function(nodeId) {
return $C('element', { children: [
$C('bindchildren', { widgetId: $L(nodeId).widgetId, visitor: {
getCreator: function(widgetId) {
return $C('extend', { widgetId: widgetId, properties: { extend: LibJs.Component.Tree.Node, treeId: $L(this.id).properties.treeId }});
}
}, properties: { treeId: this.id, types: $L(this.id).properties.types }})
], properties: { name: 'ul'}});
},
getOCIcon: function(nodeId) {
return $C('extend', { widgetId: $L(nodeId).widgetId, properties: {
extend: LibJs.Component.Tree.Node.Head.Ocicon, treeId: $L(nodeId).properties.treeId, nodeId: $L(nodeId).parent
}});
},

getHeadLabels: function(nodeId) {
return {
ocicon: this.getOCIcon(nodeId),
icon: $C('icon', {
events: this.getNodeHeadIconEvents(nodeId),
properties: { src: 'widgets/' + $W($L(nodeId).widgetId).type + '.png', width: '16'}
}),
text: $C('text', {
events: this.getNodeHeadTextEvents(nodeId),
properties: { value: $W($L(nodeId).widgetId).getTitleStr() + (LibJs.Config.Debug.tree ? ' (' + $L(nodeId).widgetId + ')' : '') }
})
};
},

getNodeHeadEvents: function(headId) {
return [];
},

getNodeHeadIconEvents: function(headId) {
return this.getNodeHeadEvents(headId);
},

getNodeHeadTextEvents: function(headId) {
return this.getNodeHeadEvents(headId);
}
}



LibJs.Component.Tree = {
loaded: function() {
var transaction = LibJs.Server.start();
this.visitor.loadRoots(transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.render));
},
render: function() {
for (var i = 0, children = this.visitor.getRoots(); i < children.length; i++) {
var child = $C('extend', {widgetId: children[i], properties: { extend: LibJs.Component.Tree.Node, treeId: this.id}});
this.setLabel(child, child);
}
this.repaint();
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentTree', children: [
$E('ul', { className: 'LibJsComponentTreeBody', children: this.getLabelsDomSet(this.getChildren())})
]})];
}
}

LibJs.Component.Tree.Node = {
__getOptions: function() {
return {
labels: { head: $L(this.properties.treeId).visitor.rebuildHead(this.id)},
states: { opened: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onOpen)})}
};
},
loaded: function() {
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.rebuildHead), 'set');
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.notify), 'remove');
LibJs.Notify.observe(this.id, this.widgetId, LibJs.System.bind(this, this.notify), 'add');
},
notify: function() {
if ($W(this.widgetId).getAllChildren().length == 0 && this.getState() == 'opened')
this.toggle();
else if ($W(this.widgetId).getAllChildren().length > 0 && this.getState() == 'created') {
this.setLabel('body', $L(this.properties.treeId).visitor.rebuildBody(this.id));
this.toggle();
}
},
toggle: function() {
if (!this.labels.body)
this.setLabel('body', $L(this.properties.treeId).visitor.rebuildBody(this.id));
this.setState(this.getState() == 'created' ? 'opened' : 'created');
if (LibJs.is(this.labels.head) && typeof $L(this.labels.head).update == 'function')
$L(this.labels.head).update();
},
rebuildHead: function() {
this.setLabel('head', $L(this.properties.treeId).visitor.rebuildHead(this.id));
this.repaint();
},
rebuildBody: function() {
if (this.labels.body) {
LibJs.remove(this.labels.body);
delete this.labels.body;
}
if (this.getState() == 'opened') {
this.setState('created');
this.toggle();
}
},

onCreate: function() {
return [$E('li', { children: $D(this.labels.head)})];
},
onOpen: function() {
return [$E('li', { children: this.getLabelsDomSet(['head', 'body'])})];
}
}

LibJs.Component.Tree.Node.Head = {
__getOptions: function() {
return {labels: $L(this.properties.treeId).visitor.getHeadLabels(this.id) };
},
update: function() {
$L(this.labels.ocicon).__render();
},
onCreate: function() {
return [$E('div', { className: 'LibJsComponentTreeNodeHead', children: this.getLabelsDomSet(['ocicon', 'icon', 'text'])})];
}
}

LibJs.Component.Tree.Node.Head.Ocicon = {
__getOptions: function() {
return {
states: { loading: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onLoad)})},
labels: {
created: $C('element'),
opened: $C('icon', { properties: { src: 'buttons/spacer.gif', width: '9' }})
}
};
},
load: function() {
if ($W(this.widgetId).getAllChildren().length) {
for (var children = $W(this.widgetId).getAllChildren(), hasChildren = false, i = 0; i < children.length; ++i)
if (!LibJs.Factory.widgets[$W(this.widgetId).getAllChildren()[i]]
|| !$L(this.properties.treeId).properties.types
|| LibJs.System.indexOfItem($L(this.properties.treeId).properties.types, $W(children[i]).type) > -1
)
hasChildren = true;
if (hasChildren)
return this.setLabel('created', $C('icon', {
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'loadChildren'})],
properties: { src: 'buttons/plus.gif', width: '9' }
}));
}
this.setLabel('created', $C('icon', { properties: { src: 'buttons/spacer.gif', width: '9' }}));
},
loadChildren: function() {
this.setState('loading');
$L(this.properties.treeId).visitor.loadChildren(this.id);
},
render: function() {
this.callFromAncestors('toggle');
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');
this.setState('created');
this.__render();
},
__render: function() {
for (var children = $W(this.widgetId).getAllChildren(), hasChildren = false, i = 0; i < children.length; ++i)
if (!$L(this.properties.treeId).properties.types || LibJs.System.indexOfItem($L(this.properties.treeId).properties.types, $W(children[i]).type) > -1)
hasChildren = true;
if (hasChildren) {
this.setLabel('opened', $C('icon', {
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'toggle'})],
properties: { src: 'buttons/minus.gif', width: '9' }
}));
this.setLabel('created', $C('icon', {
events: [new LibJs.Event(this.id, {type: 'ancestors', name: 'toggle'})],
properties: { src: 'buttons/plus.gif', width: '9' }
}));
} else {
this.setLabel('opened', $C('icon', { properties: { src: 'buttons/spacer.gif', width: '9' }}));
this.setLabel('created', $C('icon', { properties: { src: 'buttons/spacer.gif', width: '9' }}));
}
this.setState('created');
},
onLoad: function() {
return [$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/treeloader.gif' }})];
},
onCreate: function() {
return [$E('span', { children: $D(this.labels[$L(this.properties.nodeId).getState() || 'created'])})];
}
}
LibJs.Lang.__setText('tree', {});


LibJs.Visitor.Upload = {

getAction: function() {
return LibJs.Config.baseDir + LibJs.Config.protocol + '/upl'
},

getFormContent: function() {
for (var i = 0, children = []; i < this.getInputs().length; i++)
children.push($E('input', { attributes: this.getInputs()[i]}));
return children.concat([
$E('iframe', { attributes: { name: 'iframe' + this.id, id: 'iframe' + this.id }, style: { display: 'none' }})
]);
},

getInputs: function() {
return this.additionalInputs().concat([
{ type: 'hidden', name: 'nodeId', value: this.id },
{ type: 'hidden', name: 'widgetId', value: $L(this.id).widgetId },
{ type: 'hidden', name: 'variable', value: $L(this.id).properties.variable || 'file' },
{ type: 'hidden', name: 'connectionId', value: LibJs.Server.connectionId },
{ type: 'file', name: 'value', maxlength: '2500000', accept: $L(this.id).properties.accept || '*' + '/' + '*', id: 'file' + this.id }
]);
},

isContent: function() {
return document.getElementById('file' + this.id).value != '';
},

additionalInputs: function() {
return [];
},

onComplete: function() {}
}



LibJs.Component.Upload = {
getOptions: function() {
// Der submitbutton wird defaultmaessig nicht gebraucht, doch im Visitor kann er dann mittels getFormChildren eingebunden werden.
return { labels: { submit: $C('hyperlink', {
visitor: { getEvents: function() {
return [new LibJs.Event(this.id, {type: 'call', callback: $L(this.id).properties.callback || function(){}})];
}},
properties: {
title: this.properties.title,
callback: LibJs.System.bind(this, this.submit)
}
})}};
},

submit: function() {
if (this.visitor.isContent()) {
LibJs.XWin.openLoading();
window.frames['iframe' + this.id].name = 'iframe' + this.id;
$D(this.id)[0].submit();
} else
this.visitor.onComplete();
},
__complete: function() {
LibJs.XWin.closeLoading();
this.visitor.onComplete();
},
onCreate: function() {
return [ $E('form', {
attributes: {
method: 'post',
action: this.visitor.getAction(),
enctype: 'multipart/form-data',
target: 'iframe' + this.id
},
children: this.visitor.getFormContent()
})];
}
}
LibJs.Lang.__setText('upload', {'upl_txt_close':{}});


LibJs.Visitor.Selector = {

getSearchButton: function() {
return $C('icon', {
events: this.getSearchEvents(),
properties: { src: 'buttons/search.png' }
});
},

getSearchEvents: function() {
return [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind($L(this.id), $L(this.id).toggle)})];
}
}



LibJs.Component.Selector = {
getOptions: function() {
return {
states: {
opened: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onOpen)})
},
labels: {
search: this.visitor.getSearchButton(),
close: $C('element', {
events: [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.setValue, 'clean')})],
children: [$C('text', { properties: { value: $S('upload', 'upl_txt_close')}})]
}),
tree: $C('tree', {
widgetId: this.widgetId,
visitor: { getNodeHeadEvents: function(headId) {
return [new LibJs.Event(this.id, {
type: 'call', callback: LibJs.System.bind($L($L(this.id).properties.selectorId), $L($L(this.id).properties.selectorId).setValue, $L(headId).widgetId)
})]
}},
properties: { store: this.properties.store, selectorId: this.id, types: this.properties.displayTypes }
}),
input: $C('element', { properties: { name: 'input', attributes: { type: 'text', disabled: 'disabled'}}})
}
};
},
loaded: function() {
if (this.properties.active) {
var transaction = LibJs.Server.start();
LibJs.Factory.useWidget(this.properties.active, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, function() {
$L(this.labels.input).properties.attributes.value = $W(this.properties.active).getTitleStr();
$D(this.labels.input)[0].value = $W(this.properties.active).getTitleStr();
}));
}
},
toggle: function() {
this.setState(this.getState() == 'created' ? 'opened' : 'created');
},
setValue: function(widgetId) {
if (widgetId == 'clean') {
$D(this.labels.input)[0].value = '';
delete this.properties.active;
this.setState('created');
} else if (!this.properties.selectableTypes || LibJs.System.indexOfItem(this.properties.selectableTypes, $W(widgetId).type) > -1) {
$D(this.labels.input)[0].value = $W(widgetId).getTitleStr();
this.properties.active = widgetId;
this.setState('created');
}
},
getValue: function() {
return this.properties.active;
},
onOpen: function() {
return [$E('div', { className: 'LibJsComponentSelector', children: [
$E('div', { className: 'LibJsComponentSelectorOpen', children: this.getLabelsDomSet(['input', 'search'])}),
$E('div', { className: 'LibJsComponentSelectorTree', children: this.getLabelsDomSet(['close', 'tree'])})
]})];
},

onCreate: function() {
return [$E('div', { className: 'LibJsComponentSelector', children: this.getLabelsDomSet(['input', 'search'])})];
}
}
LibJs.Lang.__setText('selector', {});


LibJs.Visitor.List = {

getAction: function() {
return LibJs.Config.baseDir + 'dyn/list/conn';
},

getDefaultExportTypes: function() {
return {excel2003: 'Excel 2003', excel2000: 'Excel 2000', csv: 'CSV'};
},

getExportTypes: function() {
return this.getDefaultExportTypes();
},
getEditIcon: function() {
return LibJs.Config.baseDir + 'shr/img/buttons/edit.png';
},

prepareExport: function(type) {
$L(this.id).sendExport('type="' + type + '"');
},

checkAccess: function(widgetIds) {
return false;
},

clickEvent: function(widgetIds, e) {}
}



LibJs.Component.List = {
getOptions: function() {
return {
labels: { form: $C('extend', {
widgetId: this.widgetId,
properties: { extend: LibJs.Component.List.Form, exportTypes: this.visitor.getExportTypes(), action: this.visitor.getAction() }
})},
properties: { hasEvent: false, hasNotify: [] }
};
},
load: function() {
this.properties = LibJs.System.extendObject({rowsPerPage: 40}, LibJs.System.extendObject(
this.properties, {start: 0, sortDirection: -1, sortIndex: -1}
));
this.reloadValues(true);
},
reloadValues: function(noRepaint) {
this.properties.bodyValues = [];
for (var i = 0; i < this.properties.body.length; i++) {
var body = typeof this.properties.body[i] == 'string' ? [ this.properties.body[i] ] : this.properties.body[i];
for (var j = 0; j < body.length; j++)
if (!this.properties.hasNotify[body[j]]) {
LibJs.Notify.observe(this.id, body[j], LibJs.System.bind(this, function() { this.load(); this.repaint(); }), 'set');
this.properties.hasNotify[body[j]] = true;
}
for (var j = 0, row = []; j < this.properties.head.length; j++) {
if (typeof this.properties.head[j].value != 'undefined')
var item = {value: this.properties.head[j].value};
else if (!body[this.properties.head[j].widget])
item = {value: ''};
else if (this.properties.head[j].variable)
var item = {value: $W(body[this.properties.head[j].widget]).getVariable(this.properties.head[j].variable)};
else
var item = {value: this.properties.head[j].callback(body[this.properties.head[j].widget])};
if (this.properties.head[j].order && body[this.properties.head[j].widget])
item.order = this.properties.head[j].order(body[this.properties.head[j].widget]);
row.push(item);
}
this.properties.hasEvent = this.properties.hasEvent || this.visitor.checkAccess(body);
this.properties.bodyValues.push({ source: body, values: row, hasEvent: this.visitor.checkAccess(body)});
}
if (!noRepaint)
this.repaint();
},
getListedWidgets: function() {
var list = [];
for (var i = 0; i < this.properties.bodyValues.length; i++)
list.push(this.properties.bodyValues[i].source);
return list;
},
getHTML: function() {
var headRow = '';
for (var i = 0; i < this.properties.head.length; i++)
headRow += '<th>' + this.properties.head[i].title + '</th>';
var rows = '<tr>' + headRow + '</tr>';
for (var i = 0; i < this.properties.bodyValues.length; i++) {
var row = '';
for (var j = 0; j < this.properties.bodyValues[i].values.length; j++)
row += '<td valign="top">' + (typeof this.properties.bodyValues[i].values[j].value == 'object' ? '[object]' : this.properties.bodyValues[i].values[j].value) + '</td>';
rows += '<tr>' + row + '</tr>';
}
return '<table class="LibJsComponentList" cellspacing="1"><tbody class="ColorizedList">' + rows + '</tbody></table>';
},
sort: function(index) {
this.properties.sortDirection = (this.properties.sortIndex == index && this.properties.sortDirection > 0) ? -1 : 1;
this.properties.sortIndex = index;
this.properties.bodyValues.sort(LibJs.System.bind(this, function(item1, item2) {
var value1 = item1.values[this.properties.sortIndex].order || String(item1.values[this.properties.sortIndex].value).toLowerCase();
var value2 = item2.values[this.properties.sortIndex].order || String(item2.values[this.properties.sortIndex].value).toLowerCase();
if (value1 == value2)
return 0;
return this.properties.sortDirection * (value1 > value2 ? 1 : -1);
}));
this.repaint();
},
doExport: function() {
this.visitor.prepareExport(document.getElementById('select' + this.labels.form).value);
},
sendExport: function(attributes) {
var xml = '<?xml version="1.0" encoding="utf-8"?><export ' + attributes + '><head>';
for (var i = 0, row = []; i < this.properties.head.length; i++)
xml += '<title type="' + (this.properties.head[i].type || 'unknown') + '">' + this.properties.head[i].title + '</title>';
xml += '</head><body>';
for (var i = 0; i < this.properties.bodyValues.length; i++) {
xml += '<row>'
for (var j = 0; j < this.properties.bodyValues[i].source.length; j++)
xml += '<id>' + this.properties.bodyValues[i].source[j] + '</id>';
for (var j = 0; j < this.properties.bodyValues[i].values.length; j++)
xml += '<col>' + this.properties.bodyValues[i].values[j].value + '</col>';
xml += '</row>';
}
xml += '</body></export>';
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'setcache', data: LibJs.Compiler.toAscii(xml).replace(/</ig, '#lt;').replace(/>/ig, '#gt;')}, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.submitExport));
},
submitExport: function() {
this.setState('created');
$D(this.labels.form)[0].submit();
},
remove: function(index) {
this.properties.bodyValues.splice(index, 1);
this.repaint();
},
onCreate: function() {
var titleRow = [], headRow = [], len = this.properties.bodyValues.length;
titleRow.push($T($S('list', 'entries') + ' ' + (this.properties.start?this.properties.start+1:0) + '-' + Math.min(this.properties.start + this.properties.rowsPerPage, len) + ' ' + $S('list', 'of') + ' ' + len));
if (Math.ceil(len / this.properties.rowsPerPage) > 1) {
titleRow.push($T(', ' + $S('list', 'pages') + ':'));
for (var i = 0; i < Math.ceil(len / this.properties.rowsPerPage); i++) {
titleRow.push($T(' '));
if (i == Math.floor(this.properties.start / this.properties.rowsPerPage))
titleRow.push($T(i + 1));
else
titleRow.push((new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, function(start) {
this.properties.start = start;
this.repaint();
}, i * this.properties.rowsPerPage)})).observe($E('a', {children: [$T(i + 1)]})));
}
}
var rows = [$E('tr', { children: [
$E('td', {
attributes: { colSpan: String(this.properties.head.length + (this.properties.hasEvent ? 1 : 0) + (this.properties.canRemove ? 1 : 0))},
children: (this.properties.noExport ? [] : [$E('div', {className: 'LibJsComponentListExport', children: $D(this.labels.form)})]).concat(
[$E('div', {className: 'LibJsComponentListNavigation', children: titleRow})]
)
})
]})];
if (this.properties.hasEvent)
headRow.push($E('th', {attributes: {width: '16'}}));
for (var i = 0; i < this.properties.head.length; i++) {
children = [$T(this.properties.head[i].title)];
if (this.properties.sortIndex == i)
children.push($E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/' + (this.properties.sortDirection > 0 ? 'less' : 'more') + '.png' }}));
headRow.push((new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.sort, i)})).observe($E('th', { children: children})));
}
if (this.properties.canRemove)
headRow.push($E('th'));
rows.push($E('tr', { children: headRow }));
for (var i = this.properties.start; i < this.properties.start + this.properties.rowsPerPage && i < len; i++) {
var row = [];
if (this.properties.hasEvent)
if (this.properties.bodyValues[i].hasEvent) {
row.push($E('td', { children: [(new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(
this.visitor, this.visitor.clickEvent, this.properties.bodyValues[i].source
)})).observe(
$E('img', { attributes: { src: this.visitor.getEditIcon(), title: $S('list', 'edit_entry')}})
)], attributes: {vAlign: 'top'}}));
} else
row.push($E('td'));
for (var j = 0; j < this.properties.bodyValues[i].values.length; j++) {
var node = $E('td', {
children: (typeof this.properties.bodyValues[i].values[j].value == 'object'
? this.properties.bodyValues[i].values[j].value
: [$T(this.properties.bodyValues[i].values[j].value)]
),
attributes: {vAlign: 'top'}
});
if (this.properties.bodyValues[i].hasEvent)
row.push((new LibJs.Event(this.id, {event: 'dblclick', type: 'call', callback: LibJs.System.bind(
this.visitor, this.visitor.clickEvent, this.properties.bodyValues[i].source
)})).observe(node));
else
row.push(node);
}
if (this.properties.canRemove)
row.push($E('td', { attributes: {vAlign: 'top'}, children: [
(new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.remove, i)})).observe(
$E('img', { attributes: { src: LibJs.Config.baseDir + 'shr/img/buttons/close.png', title: $S('list', 'remove_entry') }})
)
]}));
rows.push($E('tr', { children: row }));
}
if (len <= 0)
rows.push($E('tr', { children: [$E('td', { className: 'LibJsComponentListEmpty', attributes: { colSpan: String(this.properties.head.length + (this.properties.hasEvent ? 1 : 0) + (this.properties.canRemove ? 1 : 0))}, children: [$ST('list', 'no_entries')]})]}));
return [$E('table', { className: 'LibJsComponentList', attributes: {cellSpacing: '1'}, children: [$E('tbody', { className: 'ColorizedList', children: rows})]})];
}
}

LibJs.Component.List.Form = {
__getOptions: function() {
return { labels: { send: $C('hyperlink', { properties: { title: $S('list', 'export'), name: 'doExport' }})}};
},
onCreate: function() {
types = [];
for (index in this.properties.exportTypes)
types.push($E('option', { attributes: { value: index }, children: [ $T(this.properties.exportTypes[index]) ]}));
return [$E('form', {attributes: {
id: 'form' + this.id, action: this.properties.action, method: 'post'
}, children: [
$E('input', {attributes: {type: 'hidden', name: 'conn', value: LibJs.Server.connectionId}}),
$E('select', {attributes: {id: 'select' + this.id}, children: types})
].concat($D(this.labels.send))})];
}
}
LibJs.Lang.__setText('list', {'list_ttl_nickname':{de:'Vulgo'},'list_ttl_firstname':{de:'Vorname'},'list_ttl_lastname':{de:'Nachname'},'list_ttl_zip':{de:'PLZ'},'list_ttl_unit':{de:'Abteilung'},'list_ttl_positiontype':{de:'Funktion'},'list_ttl_from':{de:'Ort'},'list_ttl_pos_type':{},'list_ttl_pos_label':{},'list_ttl_pos_end':{},'list_ttl_pos_start':{},'myunits_still_active':{},'list_ttl_win':{},'entries':{},'of':{},'pages':{},'edit_entry':{},'remove_entry':{},'no_entries':{},'export':{}});



LibJs.Factory.Component.Communitywrapper = {
getOptions: function() {
return { labels: { body: $C('wrapper', { properties: { store: '.community' }})}};
},
onCreate: function() {
return [$E('div', { children: $D(this.labels.body)})];
}
}
LibJs.Lang.__setText('communitywrapper', {});



LibJs.Factory.Component.Communityview = {
getOptions: function() {
if (LibJs.user == 'nobody')
var labels = {
logout: $C('element'),
reload: $C('element'),
body: $C('comlogin')
};
else {
var logout = $C('hyperlink', {properties: {
type: 'link',
title: $S('communityview', 'view_txt_logout', {username: $W(LibJs.user).getTitleStr()}),
element: $C('icon', { properties: { src: 'widgets/user.png'}}),
name: 'logout'
}});
var reload = $C('hyperlink', {properties: {
type: 'link',
title: $S('communityview', 'view_txt_reload'),
element: $C('icon', { properties: { src: 'buttons/reload.png'}}),
name: 'reload'
}});
if (LibJs.user == 'webGod')
var labels = {
logout: logout,
reload: reload,
body: $C('commanage')
};
else
var labels = {
logout: logout,
reload: reload,
body: $C('element')
}
}
return {
states: { fetched: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onFetched)})},
labels: labels
};
},
reload: function() {
LibJs.System.extendObject(LibJs.Comutil, { users: {}, queries: {}, units: {}, messages: {}, buddies: {}, Notify: { buddies: [] }});
delete LibJs.Comutil.notApprovedBuddies;
delete LibJs.Comutil.buddiesToApprove;
LibJs.XWin.reload();
},
loaded: function() {
if (LibJs.user == 'nobody' || LibJs.user == 'webGod')
this.setState('fetched');
else {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Comutil.usePersonByUser(LibJs.user, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'cty/js');
}
},
__loaded: function() {
LibJs.XWin.closeLoading();
LibJs.Comutil.person = LibJs.Comutil.users[LibJs.user];
this.setLabel('body', $C('tabarea', { properties: { className: 'LibJSComponentCommunityviewTabarea', items: [
{
head: $C('text', {properties: { value: $S('communityview', 'tab_ttl_home')}}),
body: $C('comhome', {widgetId: LibJs.Comutil.person})
}, {
head: $C('text', {properties: { value: $S('communityview', 'tab_ttl_profile')}}),
body: $C('comprofile', {widgetId: LibJs.Comutil.person})
}, {
head: $C('text', {properties: { value: $S('communityview', 'tab_ttl_games')}}),
body: $F('minesweeper', {widgetId: this.widgetId})
}
]}}));
this.setState('fetched');
},
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(this, this.reload));
},
onCreate: function() {
return [$E('div')];
},
onFetched: function() {
return [$E('div', { children: [
$E('div', { className: 'LibJsComponentComprofileLogout', children: this.getLabelsDomSet(['reload', 'logout'])}),
$E('div', { children: $D(this.labels.body)})
]})];
}
}
LibJs.Lang.__setText('communityview', {'pers_cap_firstname':{de:[$T(LibJs.Compiler.fromAscii('Vorname'))]},'pers_cap_lastname':{de:[$T(LibJs.Compiler.fromAscii('Nachname'))]},'pers_cap_nickname':{de:[$T(LibJs.Compiler.fromAscii('Vulgo'))]},'pers_cap_email':{de:[$T(LibJs.Compiler.fromAscii('Email'))]},'view_txt_logout':{de:'Logout'},'view_txt_reload':{de:'Seite aktualisieren'},'tab_ttl_home':{de:'Community'},'tab_ttl_profile':{de:'Profil'},'tab_ttl_games':{de:'Spiele'}});




LibJs.Factory.Component.Pmview = {
getOptions: function() {
return {
labels: {
newmessage: $C('hyperlink', {properties: { type: 'link', title: $S('pmview', 'new_message'), element: $C('icon', { properties: { src: 'buttons/pm_new.png'}}), name: 'showNewMessage'}}),
received: $C('hyperlink', {properties: { type: 'link', title: $S('pmview', 'show_received'), element: $C('icon', { properties: { src: 'buttons/pm_received.png'}}), name: 'showReceived'}}),
sent: $C('hyperlink', {properties: { type: 'link', title: $S('pmview', 'show_sent'), element: $C('icon', { properties: { src: 'buttons/pm_sent.png'}}), name: 'showSent'}}),
body: $C('pmnewmsg', { visitor: LibJs.System.extendObject(
LibJs.System.cloneObject(this.properties.newMsgVisitor || {}),
{onSubmit: function() {$L(this.id).callFromAncestors('showSent');}}
)})
},
properties: { isLoaded: false }
};
},
loaded: function() {
LibJs.XWin.openLoading();
var transaction = LibJs.Server.start();
LibJs.Server.send({ type: 'fetchmessages' }, transaction);
LibJs.Server.commit(transaction, LibJs.System.bind(this, this.__loaded), null, 'pm/js');
},
__loaded: function() {
LibJs.XWin.closeLoading();
this.properties.isLoaded = true;
},
showNewMessage: function() {
if (this.properties.isLoaded) {
this.setLabel('body', $C('pmnewmsg', {
visitor: LibJs.System.extendObject(
LibJs.System.cloneObject(this.properties.newMsgVisitor || {}),
{onSubmit: function() {$L(this.id).callFromAncestors('showSent');}}
)}));
this.repaint();
}
},
showSent: function() {
if (this.properties.isLoaded) {
this.setLabel('body', $C('pmshowmessages', { properties: { type: 'sent' }}));
this.repaint();
}
},
showReceived: function() {
if (this.properties.isLoaded) {
this.setLabel('body', $C('pmshowmessages', { properties: { type: 'received' }}));
this.repaint();
}
},
onCreate: function() {
return [$E('table', { className: 'LibJsComponentPmview', attributes: {width: '100%', cellSpacing: '0', cellPadding: '0'}, children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('th', { children: [
$E('table', { className: 'LibJsComponentPmviewMenue', attributes: {cellSpacing: '0', cellPadding: '0'}, children: [
$E('tbody', { children: [
$E('tr', { children: [
$E('td', { children: $D(this.labels.newmessage)}),
$E('td', { children: $D(this.labels.received)}),
$E('td', { children: $D(this.labels.sent)})
]})
]})
]})
]})
]}),
$E('tr', { children: [
$E('td', { children: $D(this.labels.body)})
]})
]})
]})];
}
}
LibJs.Lang.__setText('pmview', {'new_message':{},'show_received':{},'show_sent':{}});



LibJs.Factory.Component.Minesweeper = {
getOptions: function() {
return {
labels: {
gameboard: $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Factory.Component.Minesweeper.Board, x: 9, y: 9, bombs: 10}}),
newgame: $C('hyperlink', {properties: { type: 'link', title: $S('minesweeper', 'newgame'), name: 'newgame'}})
}
};
},
newgame: function() {
LibJs.XWin.openWindow({
labels: { body: $C('extend', {widgetId: this.widgetId, properties: {
callback: LibJs.System.bind(this, this.__newgame),
extend: LibJs.Factory.Component.Minesweeper.Selectgame
}})},
properties: { title: $S('minesweeper', 'select_game') }
});
},
__newgame: function(x, y, bombs) {
this.setLabel('gameboard', $C('extend', { widgetId: this.widgetId, properties: { extend: LibJs.Factory.Component.Minesweeper.Board, x: x, y: y, bombs: bombs}}));
this.repaint();
},
onCreate: function() {
return [
$E('table', { children: [ $E('tbody', { children: [ $E('tr', { children: [
$E('td', { children: [$E('div', { className: 'LibJsComponentMinesweeperNewgame', children: $D(this.labels.newgame)})]}),
$E('td', { children: [$E('div', { className: 'LibJsComponentMinesweeperTime', children: [$E('span', { attributes: {id: 'ms_timebox'+this.widgetId}, children: [$T('0')]})]})]}),
$E('td', { children: [$E('div', { className: 'LibJsComponentMinesweeperBombs', children: [$E('span', { attributes: {id: 'ms_bombsbox'+this.widgetId}, children: [$T('0')]})]})]})
]})]})]}),
$E('div', { className: 'LibJsComponentMinesweeper', children: $D(this.labels.gameboard)})
];
}
}

LibJs.Factory.Component.Minesweeper.Selectgame = {
__getOptions: function() {
return { labels: {
cancel: $C('hyperlink', { properties: { title: $S('component', 'cancel'), name: 'close' }}),
size_small: $C('hyperlink', { properties: { title: $S('minesweeper', 'game_small'), name: 'start_small' }}),
size_medium: $C('hyperlink', { properties: { title: $S('minesweeper', 'game_medium'), name: 'start_medium' }}),
size_big: $C('hyperlink', { properties: { title: $S('minesweeper', 'game_big'), name: 'start_big' }})
}};
},
start_small: function() {
this.properties.callback(9, 9, 10);
this.callFromAncestors('closeComponent');
},
start_medium: function() {
this.properties.callback(16, 16, 40);
this.callFromAncestors('closeComponent');
},
start_big: function() {
this.properties.callback(16, 30, 99);
this.callFromAncestors('closeComponent');
},
close: function() {
this.callFromAncestors('closeComponent');
},
onCreate: function() {
return [$E('table', { children: [ $E('tbody', { children: [
$E('tr', { children: [
$E('td', { children: $D(this.labels.size_small)}),
$E('td', { children: $D(this.labels.size_medium)}),
$E('td', { children: $D(this.labels.size_big)})
]}),
$E('tr', { children: [$E('td', { attributes: {colSpan: '2'}, children: $D(this.labels.cancel)})]})
]})]})];
}
}

LibJs.Factory.Component.Minesweeper.Board = {
bomb_grid: [],
empty_grid: [],
uncovered_grid: [],
marked_grid: [],
game_x: 0,
game_y: 0,
game_bombs: 0,
started: 0,
createGame: function(x,y,bombs){
this.stopClock();
this.game_x = x;
this.game_y = y;
this.game_bombs = bombs;
this.generateGrid(x,y,bombs);
var tr = [];
for (var i = 0; i < x; i++){
var td = [];
for (var j = 0; j < y; j++){
if (this.bomb_grid[i][j] == 1){
td.push((new LibJs.Event(this.id, {event: 'click', type: 'call', callback: LibJs.System.bind(this, this.showField, i, j)})).observe(
(new LibJs.Event(this.id, {event: 'contextmenu', type: 'call', callback: LibJs.System.bind(this, this.markField, i, j)})).observe(
$E('td', { className: 'LibJsComponentMinesweeperBoardCovered', attributes: { id: 'field['+i+']['+j+']'+this.widgetId}, children: [
$E('div', { className: 'LibJsComponentMinesweeperBoardFieldBomb', children: [$T(' ')]})
]})
)
));
}else{
var counter = 0;
if (this.bomb_grid[i][j-1]) counter++;
if (this.bomb_grid[i][j+1]) counter++;
if (this.bomb_grid[i+1]){
if (this.bomb_grid[i+1][j+1]) counter++;
if (this.bomb_grid[i+1][j]) counter++;
if (this.bomb_grid[i+1][j-1]) counter++;
}
if (this.bomb_grid[i-1]){
if (this.bomb_grid[i-1][j+1]) counter++;
if (this.bomb_grid[i-1][j]) counter++;
if (this.bomb_grid[i-1][j-1]) counter++;
}
if (counter){
td.push((new LibJs.Event(this.id, {event: 'click', type: 'call', callback: LibJs.System.bind(this, this.showField, i, j)})).observe(
(new LibJs.Event(this.id, {event: 'contextmenu', type: 'call', callback: LibJs.System.bind(this, this.markField, i, j)})).observe(
$E('td', { className: 'LibJsComponentMinesweeperBoardCovered', attributes: { id: 'field['+i+']['+j+']'+this.widgetId}, children: [
$E('div', { className: 'LibJsComponentMinesweeperBoardFieldColor_'+counter, children: [$T(counter)]})
]})
)
));
}else{
this.empty_grid[i][j] = 1;
td.push((new LibJs.Event(this.id, {event: 'click', type: 'call', callback: LibJs.System.bind(this, this.showField, i, j)})).observe(
(new LibJs.Event(this.id, {event: 'contextmenu', type: 'call', callback: LibJs.System.bind(this, this.markField, i, j)})).observe(
$E('td', { className: 'LibJsComponentMinesweeperBoardCovered', attributes: { id: 'field['+i+']['+j+']'+this.widgetId}, children: [
$E('div', { className: 'LibJsComponentMinesweeperBoardFieldEmpty', children: [$T(' ')]})
]})
)
));
}
}
}
tr.push($E('tr', { children: td}));
}
return [$E('table', { className: 'LibJsComponentMinesweeperBoard', children: [ $E('tbody', { children: tr })]})];
},
generateGrid: function(x,y,bombs) {
var bombplaces = this.generateBombPlaces(x*y,bombs);
var fieldnum = 1;
for (var i = 0; i < x; i++){
this.bomb_grid[i] = new Array();
this.empty_grid[i] = new Array();
this.uncovered_grid[i] = new Array();
this.marked_grid[i] = new Array();
for (var j = 0; j < y; j++){
if (this.in_array(fieldnum,bombplaces)){
this.bomb_grid[i][j] = 1;
}else{
this.bomb_grid[i][j] = 0;
}
this.empty_grid[i][j] = 0;
this.uncovered_grid[i][j] = 0;
this.marked_grid[i][j] = 0;
fieldnum++;
}
}
return true;
},
generateBombPlaces: function(numfields,bombs){
numbers = new Array();
if (numfields < bombs){
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('minesweeper', 'message_more_bombs_than_fields') }})}});
return false;
}
while (numbers.length < bombs){
var a = 0;
a = Math.random();
a *= numfields;
a = Math.ceil(a);
if (!this.in_array(a,numbers)){
numbers.push(a);
this.consolelog('Bombenfeld: '+a);
}
}
return numbers;
},
updateBombField: function() {
document.getElementById('ms_bombsbox'+this.widgetId).innerHTML = (this.game_bombs-this.countFields(this.marked_grid));
},
markField: function(x,y, e) {
e.stop();
if (this.started == 0 && this.countFields(this.uncovered_grid) == 0)
this.startClock();
if (this.uncovered_grid[x][y] == 1)
return false;
if (this.marked_grid[x][y] == 1){
this.consolelog('Entferne Markierung: '+x+'|'+y);
if (document.getElementById('field['+x+']['+y+']'+this.widgetId))
document.getElementById('field['+x+']['+y+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardCovered';
this.marked_grid[x][y] = 0;
}else {
this.consolelog('Markiere Feld: '+x+'|'+y);
if (this.started == 0)
this.startClock();
if (document.getElementById('field['+x+']['+y+']'+this.widgetId))
document.getElementById('field['+x+']['+y+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardMarked';
this.marked_grid[x][y] = 1;
}
if (this.countFields(this.marked_grid) == this.game_bombs){
var counter = 0;
for (var i = 0; i < this.game_x; i++)
for (var j = 0; j < this.game_y; j++)
if (this.marked_grid[i][j] == 1 && this.bomb_grid[i][j] == 1)
counter++;
if (counter == this.game_bombs)
this.won();
}
this.updateBombField();
return true;
},
showField: function(x,y) {
if (this.marked_grid[x][y] != 1 && this.uncovered_grid[x][y] != 1){
if (this.started == 0){
if (this.countFields(this.uncovered_grid) == 0){
this.startClock();
}else{
return false;
}
}
this.consolelog('Angeklickt: '+x+'|'+y);
if (this.bomb_grid[x][y] == 1)
return this.lost();
this.showNeighbours(x,y)

if (((this.game_x*this.game_y)-this.countFields(this.uncovered_grid)) <= this.game_bombs){
return this.won();
}
this.updateBombField();
}
return true;
},
showNeighbours: function(x,y){
this.uncover(x,y);
if (this.empty_grid[x][y] == 1){
this.consolelog('Leeres Feld: '+x+'|'+y);

this.checkEmptyField(x,y-1)
this.checkEmptyField(x,y+1)
if (this.bomb_grid[x+1]){
this.checkEmptyField(x+1,y-1)
this.checkEmptyField(x+1,y)
this.checkEmptyField(x+1,y+1)
}
if (this.bomb_grid[x-1]){
this.checkEmptyField(x-1,y-1)
this.checkEmptyField(x-1,y)
this.checkEmptyField(x-1,y+1)
}
}
},
checkEmptyField: function(x,y){
if (this.empty_grid[x][y] == 1 && this.uncovered_grid[x][y] != 1 ){
this.showNeighbours(x,y);
}else{
this.uncover(x,y);
}
},
uncover: function(x,y){
if (document.getElementById('field['+x+']['+y+']'+this.widgetId))
document.getElementById('field['+x+']['+y+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardUncovered';
this.uncovered_grid[x][y] = 1;
this.marked_grid[x][y] = 0;
},
lost: function(){
this.stopClock();
this.consolelog('Verloren!');
for (var i = 0; i < this.game_x; i++){
for (var j = 0; j < this.game_y; j++){
if (this.uncovered_grid[i][j] != 1){
this.uncover(i,j)
}
if (this.bomb_grid[i][j] == 1){
document.getElementById('field['+i+']['+j+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardShowbombRed';
}
}
}
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('minesweeper', 'message_lost', {seconds: document.getElementById('ms_timebox'+this.widgetId).innerHTML}) }})}});
},
won: function(){
this.stopClock();
this.consolelog('Won!');
for (var i = 0; i < this.game_x; i++){
for (var j = 0; j < this.game_y; j++){
if (this.bomb_grid[i][j] == 1){
document.getElementById('field['+i+']['+j+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardShowbomb';
}else{
document.getElementById('field['+i+']['+j+']'+this.widgetId).className = 'LibJsComponentMinesweeperBoardUncovered';
}
}
}
LibJs.XWin.openMessage({ labels: { body: $C('text', { properties: { value: $S('minesweeper', 'message_won', {seconds: document.getElementById('ms_timebox'+this.widgetId).innerHTML}) }})}});
},
countFields: function(array){
counter = 0;
for (var i = 0; i < this.game_x; i++){
for (var j = 0; j < this.game_y; j++){
if (array[i][j] == 1){
counter++;
}
}
}
return counter;
},
clock: function(){
if (this.started == 1 && this.id == $L(this.parent).labels.gameboard) {
setTimeout(LibJs.System.bind(this, this.clock), 1000);
if (document.getElementById('ms_timebox'+this.widgetId)){
document.getElementById('ms_timebox'+this.widgetId).innerHTML = parseInt(document.getElementById('ms_timebox'+this.widgetId).innerHTML)+1;
this.consolelog('counter up: '+parseInt(document.getElementById('ms_timebox'+this.widgetId).innerHTML));
}
}
},
startClock: function(){
setTimeout(LibJs.System.bind(this, this.clock), 1000);
document.getElementById('ms_timebox'+this.widgetId).innerHTML = 0;
this.started = 1;
},
stopClock: function(){
this.started = 0;
},
in_array: function(item,arr){
for(p=0;p<arr.length;p++) if (item == arr[p]) return true;
return false;
},
consolelog: function(msg){
if (LibJs.Config.Debug.consolelog)
console.log(msg);
},
onCreate: function() {
return [
$E('div', {children: this.createGame(this.properties.x, this.properties.y, this.properties.bombs)})
];
}
}
LibJs.Lang.__setText('minesweeper', {'newgame':{},'select_game':{},'game_small':{},'game_medium':{},'game_big':{},'message_more_bombs_than_fields':{},'message_lost':{},'message_won':{}});



LibJs.XWin.Component.Contextmenuitem = {
getOptions: function() {
return {
events: [new LibJs.Event(this.id, {type: 'call', event: 'mousedown', callback: this.properties.callback})],
labels: {
icon: $C('icon', { properties: { src: this.properties.src }
}),
text: $C('element', {
children: [ $C('text', { properties: { value: this.properties.title }})],
properties: { name: 'span' }
})
}
};
},
onCreate: function() {
return [$E('li', { className: 'LibJsComponentContextMenuItem', children: [
$E('a', { className: 'LibJsComponentContextMenuItemLink', children: this.getLabelsDomSet(['icon', 'text'])})
]})];
}
}
LibJs.Lang.__setText('contextmenuitem', {});



LibJs.XWin.Component.Contextmenu = LibJs.System.extendObject(LibJs.System.cloneObject(LibJs.XWin.Component), {
__getOptions: function() {
for (var i = 0, labels = {}; i < this.properties.items.length; ++i)
labels[this.properties.items[i]] = this.properties.items[i];
return {
fade: 150,
labels: labels,
events: [new LibJs.Event(this.id, {type: 'call', event: 'mousedown', callback: LibJs.System.bind(this, this.closeContextMenu)})],
properties: {
zindex: String(LibJs.XWin.getNextWinZ()),
close: new LibJs.Event(this.id, {type: 'call', event: 'mousedown', callback: LibJs.System.bind(this, this.closeContextMenu)})
}
};
},
loaded: function() {
this.properties.close.observe(document);
},
closeContextMenu: function() {
this.properties.close.stopObserving(document);
this.closeComponent();
},
onCreate: function() {
return [$E('ul', { children: this.getLabelsDomSet(this.getChildren()), className: 'LibJsComponentContextMenu', style: LibJs.System.extendObject({
position: 'absolute', zIndex: this.properties.zindex, left: this.properties.left + 'px', top: this.properties.top + 'px'
}, this.fade && this.opacity < 1 ? { display: 'none' } : {})})];
}
});
LibJs.Lang.__setText('contextmenu', {});


LibJs.Visitor.Window = {

getTitle: function() {
return $C('text', { properties: { value: $L(this.id).properties.title }});
}
}



LibJs.XWin.Component.Window = LibJs.System.extendObject(LibJs.System.cloneObject(LibJs.XWin.Component), {
__getOptions: function() {
return {
fade: 150,
labels: {
title: $C('dnd', {
labels: { body: this.visitor.getTitle() },
visitor: {onDndMove: LibJs.System.bind(this, this.move), onDndStart: LibJs.System.bind(this, this.startMove)},
properties: { name: 'div'}
}),
minimize: $C('icon', {
events: [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.toggle)})],
properties: { src: 'xwin/window_button_minimize.gif' }
}),
maximize: $C('icon', {
events: [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.toggle)})],
properties: { src: 'xwin/window_button_maximize.gif' }
}),
resize: $C('dnd', {
labels: { body: $C('icon', {properties: { src: 'xwin/window_resize.gif' }})},
visitor: {onDndMove: LibJs.System.bind(this, this.resize)}
}),
close: $C('icon', {
events: [new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.closeComponent)})],
properties: { src: 'xwin/window_button_close.gif' }
})
},
states: {
minimized: new LibJs.Event(this.id, {type: 'call', callback: LibJs.System.bind(this, this.onMinimize)})
},
properties: {
zindex: String(LibJs.XWin.getNextWinZ()),
initOffsetTop: LibJs.XWin.getNextWindowInitOffsetTop(),
initOffsetLeft: LibJs.XWin.getNextWindowInitOffsetLeft()
}
};
},
toggle: function() {
this.setState(this.getState() == 'created' ? 'minimized' : 'created');
},
onCreate: function() {
ie6 = (navigator.appVersion.indexOf("MSIE 6.0") != -1);
return [
$E('table', {className: 'LibJsComponentWindow', attributes: {cellPadding: '0', cellSpacing: '0', border: '0'},
style: LibJs.System.extendObject(
{
zIndex: this.properties.zindex,
top: (this.properties.top || (this.properties.scrollOffset + this.properties.initOffsetTop)) + 'px',
left: (this.properties.left || this.properties.initOffsetLeft) + 'px'
},
LibJs.System.extendObject(typeof this.properties.width != 'undefined' ? { width: this.properties.width + 'px' } : {},
LibJs.System.extendObject(typeof this.properties.heigth != 'undefined' ? { heigth: this.properties.heigth + 'px' } : {},
this.fade && this.opacity < 1 ? { display: 'none' } : {}
)
)
),
children: [
$E('tbody', {children: [
$E('tr', {className: 'LibJsComponentWindowHead', style: {height: '20px'}, children: [
$E('td', {children: [
$E('table', {attributes: {cellPadding: '0', cellSpacing: '0', border: '0', width: '100%'}, children: [
$E('tbody', {children: [
$E('tr', {children: [
$E('td', {attributes: {width: '4', vAlign: 'top'}, className: 'LibJsComponentWindowHeadSide', children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/xwin/window_top_left.gif'}, children: []})
]}),
$E('td', {className: 'LibJsComponentWindowHeadTitle', children: $D(this.labels.title)}),
$E('td', {className: 'LibJsComponentWindowHeadButtons', attributes: {vAlign: 'top', width: '30'}, children: this.getLabelsDomSet(['minimize', 'close'])}),
$E('td', {attributes: {vAlign: 'top', width: '4'}, className: 'LibJsComponentWindowHeadSide', children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/xwin/window_top_right.gif'}, children: []})
]})
]})
]})
]})
]}),
$E('td', {attributes: {width: '6', vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_top_right.png')}, children: []})
]})
]}),
$E('tr', {style: {height: '100%'}, children: [
$E('td', {className: 'LibJsComponentWindowBody', children: [
$E('table', {className: 'LibJsComponentWindowBodyTable', attributes: {cellPadding: '0', cellSpacing: '0', border: '0', width: '100%'}, children: [
$E('tbody', {children: [
$E('tr', {children: [
$E('td', {className: 'LibJsComponentWindowBodyContent', attributes: {vAlign: 'top'}, children: $D(this.labels.body)}),
$E('td', {className: 'LibJsComponentWindowBodyResize', children: $D(this.labels.resize)})
]})
]})
]})
]}),
$E('td', {className: (ie6?'':'LibJsComponentXWinShadowRight'), children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/buttons/spacer.gif', width: '6', height: '1'}, children: []})
]})
]}),
$E('tr', {style: {height: '6px'}, children: [
$E('td', {children: [
$E('table', {attributes: {cellPadding: '0', cellSpacing: '0', border: '0', width: '100%'}, children: [
$E('tbody', {children: [
$E('tr', {children: [
$E('td', {attributes: {width: '6', vAlign: 'top'}, children: [
$E('img', {style: {verticalAlign: 'top'}, attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_bottom_left.png')}, children: []})
]}),
$E('td', {className: (ie6?'':'LibJsComponentXWinShadowBottom'), attributes: {vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/buttons/spacer.gif', width: '1', height: '6'}, children: []})
]})
]})
]})
]})
]}),
$E('td', {attributes: {vAlign: 'top'}, children: [
$E('img', {style: {verticalAlign: 'top'}, attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_bottom_right.png')}, children: []})
]})
]})
]})
]})
];
},
onMinimize: function() {
ie6 = (navigator.appVersion.indexOf("MSIE 6.0") != -1);
return [
$E('table', {className: 'LibJsComponentWindowMinimized', attributes: {cellPadding: '0', cellSpacing: '0', border: '0'},
style: LibJs.System.extendObject(
{ zIndex: this.properties.zindex, top: (this.properties.top || (this.properties.scrollOffset + 20)) + 'px'},
LibJs.System.extendObject(typeof this.properties.left != 'undefined' ? { left: this.properties.left + 'px' } : {},
typeof this.properties.width != 'undefined' ? { width: this.properties.width + 'px' } : {}
)
),
children: [
$E('tbody', {children: [
$E('tr', {className: 'LibJsComponentWindowHead', style: {height: '20px'}, children: [
$E('td', {children: [
$E('table', {attributes: {cellPadding: '0', cellSpacing: '0', border: '0', width: '100%'}, children: [
$E('tbody', {children: [
$E('tr', {children: [
$E('td', {attributes: {width: '4', vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/xwin/window_top_left.gif'}, children: []})
]}),
$E('td', {className: 'LibJsComponentWindowHeadTitle', children: $D(this.labels.title)}),
$E('td', {className: 'LibJsComponentWindowHeadButtons', attributes: {vAlign: 'top', width: '30'}, children: this.getLabelsDomSet(['maximize', 'close'])}),
$E('td', {attributes: {vAlign: 'top', width: '4'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/xwin/window_top_right.gif'}, children: []})
]})
]})
]})
]})
]}),
$E('td', {attributes: {width: '6', vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_top_right.png')}, children: []})
]})
]}),
$E('tr', {style: {height: '6px'}, children: [
$E('td', {children: [
$E('table', {attributes: {cellPadding: '0', cellSpacing: '0', border: '0', width: '100%'}, children: [
$E('tbody', {children: [
$E('tr', {children: [
$E('td', {attributes: {width: '6', vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_bottom_left.png')}, children: []})
]}),
$E('td', {className: (ie6?'':'LibJsComponentXWinShadowBottom'), attributes: {vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/buttons/spacer.gif', width: '1', height: '6'}, children: []})
]})
]})
]})
]})
]}),
$E('td', {attributes: {vAlign: 'top'}, children: [
$E('img', {attributes: {src: LibJs.Config.baseDir + 'shr/img/' + (ie6?'buttons/spacer.gif':'xwin/window_shadow_bottom_right.png')}, children: []})
]})
]})
]})
]})
];
}
});
LibJs.Lang.__setText('window', {});
0

