first major round of EMS changes. much more to come late tonight.
This commit is contained in:
parent
f3404c319a
commit
2c60283ba3
27 changed files with 5196 additions and 33 deletions
158
www/extras/wobject/EventManagementSystem/script/button.js
Normal file
158
www/extras/wobject/EventManagementSystem/script/button.js
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
/********************************************************************************************
|
||||
* BlueShoes Framework; This file is part of the php application framework.
|
||||
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto
|
||||
* www.blueshoes.org and register for the free open source *DEVELOPER* version or
|
||||
* buy the commercial version.
|
||||
*
|
||||
* In case you've already got the developer version, then this is one of the few
|
||||
* packages/classes that is only available to *PAYING* customers.
|
||||
* To get it go to www.blueshoes.org and buy a commercial version.
|
||||
*
|
||||
* @copyright www.blueshoes.org
|
||||
* @author Samuel Blume <sam at blueshoes dot org>
|
||||
* @author Andrej Arn <andrej at blueshoes dot org>
|
||||
*/
|
||||
if (!Bs_Objects) {var Bs_Objects = [];};function Bs_Button() {
|
||||
this._id;this._objectId;this.id;this.group;this._status = 1;this.inactiveStyle = 3;this._imgPathDefault = '/_bsImages/buttons/';this.imgPath;this.imgName;this.height;this.width;this.backgroundColor;this.title;this.caption;this.action;this.cssClassDefault = 'bsBtnDefault';this.cssClassMouseOver = 'bsBtnMouseOver';this.cssClassMouseDown = 'bsBtnMouseDown';this._buttonBar;this.actualizeFromChildren = 0;this._childrenButtonBar;this._isDragAction;this._attachedEvents = new Array;this._constructor = function() {
|
||||
this._id = Bs_Objects.length;Bs_Objects[this._id] = this;this._objectId = "Bs_Button_"+this._id;}
|
||||
this.attachEvent = function(fire, e) {
|
||||
if (typeof(e) == 'undefined') e = 'on';if (typeof(this._attachedEvents[e]) == 'undefined') this._attachedEvents[e] = new Array;this._attachedEvents[e][this._attachedEvents[e].length] = fire;}
|
||||
this.attachFireOff = function(param) {
|
||||
}
|
||||
this.render = function() {
|
||||
var isGecko = this._isGecko();var out = new Array;var containerStyle = new Array;out[out.length] = '<div style="display:inline; white-space:nowrap;">';var tagType = 'div';out[out.length] = '<' + tagType;out[out.length] = ' id="' + this._getId() + '"';if (typeof(this.title) != 'undefined') {
|
||||
out[out.length] = ' title="' + this.title + '"';}
|
||||
out[out.length] = ' unselectable="on"';captionType = typeof(this.caption);if (captionType != 'undefined') {
|
||||
containerStyle[containerStyle.length] = 'width:auto';} else {
|
||||
if (typeof(this.width) != 'undefined') containerStyle[containerStyle.length] = 'width:' + this.width + 'px';if (typeof(this.height) != 'undefined') containerStyle[containerStyle.length] = 'height:' + this.height + 'px';}
|
||||
if (typeof(this.backgroundColor) != 'undefined') containerStyle[containerStyle.length] = 'background-color:' + this.backgroundColor;switch (this._status) {
|
||||
case 0:
|
||||
var filter = this._getInactiveStyleFilter();if (typeof(filter) == 'string') {
|
||||
containerStyle[containerStyle.length] = 'filter:' + filter;}
|
||||
case 1:
|
||||
out[out.length] = ' class="' + this.cssClassDefault + '"';break;case 2:
|
||||
out[out.length] = ' class="' + this.cssClassMouseDown + '"';break;}
|
||||
out[out.length] = ' style="' + containerStyle.join(';') + '"';out[out.length] = ' onMouseOver="Bs_Objects['+this._id+'].mouseOver(this);"';out[out.length] = ' onMouseOut="Bs_Objects['+this._id+'].mouseOut(this);"';out[out.length] = ' onMouseDown="Bs_Objects['+this._id+'].mouseDown(this);"';out[out.length] = ' onMouseUp="Bs_Objects['+this._id+'].mouseUp(this);"';out[out.length] = '>';if (typeof(this.imgName) != 'undefined') {
|
||||
var imgFullPath = '';imgFullPath += this._getImgPath();imgFullPath += this.imgName;if (this.imgName.substr(this.imgName.length -4) != '.gif') imgFullPath += '.gif';out[out.length] = '<img id="' + this._getId() + '_icon" src="' + imgFullPath + '"';if ((typeof(this.height) == 'undefined') || (this.height > 18)) out[out.length] = ' style="vertical-align:top;"';out[out.length] = '>';}
|
||||
captionType = typeof(this.caption);if (captionType != 'undefined') {
|
||||
if (captionType == 'string') {
|
||||
out[out.length] = this.caption;} else {
|
||||
out[out.length] = this.title;}
|
||||
if (!isGecko) out[out.length] = ' ';}
|
||||
if ((typeof(this._childrenButtonBar) != 'undefined') && (this.numberOfAttachedEvents('on') == 0)) {
|
||||
this.group = this._objectId + '_pseudoGroup';var imgFullPath = '';if (this.imgPath) imgFullPath += this._getImgPath();imgFullPath += 'small_black_arrow_down.gif';out[out.length] = ' <img src="' + imgFullPath + '" style="vertical-align:middle;"> ';var subBarString = this._childrenButtonBar.render();subBarString = '<div id="' + this._objectId + '_childBar" class="bsBtnMouseOver" style="width:auto; height:auto; display:none; position:absolute; left:50px; top:50px;">' + subBarString + '</div>';out[out.length] = subBarString;}
|
||||
out[out.length] = '</' + tagType + '>';out[out.length] = '</div>';return out.join('');}
|
||||
this.drawOut = function() {
|
||||
document.writeln(this.render());}
|
||||
this.drawInto = function(elm) {
|
||||
if (typeof(elm) == 'string') {
|
||||
elm = document.getElementById(elm);}
|
||||
if (elm != null) {
|
||||
var x = this.render(); //x = x.replace(/<nobr>/, '');
|
||||
//x = x.replace(/<\/nobr>/, '');
|
||||
x = x.replace(/<nobr>/, '<span style="white-space: nowrap">');
|
||||
x = x.replace(/<\/nobr>/, '<\/span>');
|
||||
elm.innerHTML = x;}
|
||||
}
|
||||
this.mouseOver = function(div) {
|
||||
if (this._status == 2) return;if (this._status == 0) return;if (!this._isGecko()) {
|
||||
div.className = this.cssClassMouseOver;}
|
||||
this._fireEvent('over');}
|
||||
this.mouseOut = function(div) {
|
||||
if (this._status == 2) return;if (this._status == 0) return;if (!this._isGecko()) {
|
||||
div.className = this.cssClassDefault;}
|
||||
this._fireEvent('out');}
|
||||
this.mouseDown = function(div) {
|
||||
if (this._status == 0) return;this._isDragAction = false;div.className = this.cssClassMouseDown;}
|
||||
this.mouseUp = function(div) {
|
||||
if (this._status == 0) return;var doFireOn = true;var doFireOff = false;if (this._isGecko()) {
|
||||
div.className = this.cssClassDefault;} else {
|
||||
div.className = this.cssClassMouseOver;}
|
||||
if (typeof(this.group) != 'undefined') {
|
||||
if (this._status == 2) {
|
||||
this._status = 1;doFireOn = false;doFireOff = true;} else {
|
||||
div.className = this.cssClassMouseDown;this._status = 2;this._deactivateOtherGroupButtons();}
|
||||
}
|
||||
if (this._isDragAction) doFireOn = false;if (doFireOn) {
|
||||
this._fireEvent('on');} else if (doFireOff) {
|
||||
this._fireEvent('off');}
|
||||
}
|
||||
this.dragStart = function(div) {
|
||||
if (this._status == 0) return false;this._isDragAction = true;div.className = this.cssClassMouseOver;return false;}
|
||||
this._deactivateOtherGroupButtons = function() {
|
||||
if (typeof(this._buttonBar) == 'undefined') return;for (var i=0; i<this._buttonBar._buttons.length; i++) {
|
||||
var btnObj = this._buttonBar._buttons[i][0];if (typeof(btnObj) != 'object') continue;if ((btnObj.group == this.group)) {
|
||||
if (btnObj._objectId == this._objectId) continue;btnObj._status = 1;btnDiv = document.getElementById(btnObj._getId());btnDiv.className = btnObj.cssClassDefault;}
|
||||
}
|
||||
}
|
||||
this.setStatus = function(status) {
|
||||
if (this._status == status) return;var oldStatus = this._status;this._status = status;var btnDiv = document.getElementById(this._getId());if (btnDiv != null) {
|
||||
switch (status) {
|
||||
case 0:
|
||||
var filter = this._getInactiveStyleFilter();if (typeof(filter) == 'string') {
|
||||
btnDiv.style.filter = filter;}
|
||||
break;case 1:
|
||||
btnDiv.className = this.cssClassDefault;break;case 2:
|
||||
if (this._isGecko()) {
|
||||
btnDiv.className = this.cssClassDefault;} else {
|
||||
btnDiv.className = this.cssClassMouseDown;}
|
||||
if (typeof(this.group) != 'undefined') {
|
||||
this._deactivateOtherGroupButtons();}
|
||||
break;}
|
||||
}
|
||||
if ((oldStatus == 0) && (this.inactiveStyle != 0)) {
|
||||
btnDiv.style.filter = "";}
|
||||
}
|
||||
this.getStatus = function() {
|
||||
return this._status;}
|
||||
this.setTitle = function(title) {
|
||||
var elm = document.getElementById(this._getId());if (elm != null) elm.title = title;this.title = title;}
|
||||
this.setChildrenButtonBar = function(bar) {
|
||||
bar._parentButton = this;this._childrenButtonBar = bar;}
|
||||
this._isGecko = function() {
|
||||
if (navigator.appName == "Microsoft Internet Explorer") return false; var x = navigator.userAgent.match(/gecko/i);
|
||||
return (x);return false;}
|
||||
this._fireEvent = function(e) {
|
||||
if ((e == 'on') && (typeof(this._buttonBar) != 'undefined') && (typeof(this._buttonBar._parentButton) != 'undefined')) {
|
||||
this._buttonBar._parentButton._fireEvent('off');if ((this._buttonBar._parentButton.actualizeFromChildren == 1) || (this._buttonBar._parentButton.actualizeFromChildren == 3)) {
|
||||
var elm = document.getElementById(this._buttonBar._parentButton._getId() + '_icon');var imgFullPath = '';if (this.imgPath) imgFullPath += this.imgPath;imgFullPath += this.imgName;if (this.imgName.substr(this.imgName.length -4) != '.gif') imgFullPath += '.gif';elm.src = imgFullPath;}
|
||||
}
|
||||
if (((e == 'on') || (e == 'off')) && (typeof(this._childrenButtonBar) != 'undefined') && (this.numberOfAttachedEvents('on') == 0)) {
|
||||
var elm = document.getElementById(this._objectId + '_childBar');if (elm != null) {
|
||||
if (e == 'on') {
|
||||
this._buttonBar.ignoreEvents = true;var pos = getAbsolutePos(document.getElementById(this._getId()));var plusPixel = (typeof(this.height) != 'undefined') ? parseInt(this.height) : 22;elm.style.top = (pos.y + plusPixel) + 'px';elm.style.left = pos.x + 'px';elm.style.display = 'block';} else {
|
||||
this._buttonBar.ignoreEvents = false;elm.style.display = 'none';}
|
||||
}
|
||||
} else {
|
||||
if (!this._attachedEvents[e]) return;for (var i=0; i<this._attachedEvents[e].length; i++) {
|
||||
switch (typeof(this._attachedEvents[e][i])) {
|
||||
case 'function':
|
||||
this._attachedEvents[e][i](this);break;case 'string':
|
||||
//var ev = this._attachedEvents[e][i].replace(/__THIS__/, this);
|
||||
eval(this._attachedEvents[e][i]);break;default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.numberOfAttachedEvents = function(e) {
|
||||
try {
|
||||
return this._attachedEvents[e].length;} catch (ex) {
|
||||
return 0;}
|
||||
}
|
||||
this._getId = function() {
|
||||
if (typeof(this.id) != 'undefined') return this.id;return this._objectId + "_container";}
|
||||
this._getInactiveStyleFilter = function() {
|
||||
switch (this.inactiveStyle) {
|
||||
case 0:
|
||||
return false;break;case 1:
|
||||
return 'progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)';break;case 2:
|
||||
return 'progid:DXImageTransform.Microsoft.BasicImage(opacity=.3)';break;default:
|
||||
return 'progid:DXImageTransform.Microsoft.BasicImage(grayScale=1) progid:DXImageTransform.Microsoft.BasicImage(opacity=.3)';}
|
||||
}
|
||||
this._getImgPath = function() {
|
||||
if (typeof(this.imgPath) != 'undefined') {
|
||||
return this.imgPath;} else if (typeof(this._buttonBar) != 'undefined') {
|
||||
return this._buttonBar.imgPath;} else {
|
||||
return this._imgPathDefault;}
|
||||
}
|
||||
this._constructor();}
|
||||
98
www/extras/wobject/EventManagementSystem/script/buttonbar.js
Normal file
98
www/extras/wobject/EventManagementSystem/script/buttonbar.js
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/********************************************************************************************
|
||||
* BlueShoes Framework; This file is part of the php application framework.
|
||||
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto
|
||||
* www.blueshoes.org and register for the free open source *DEVELOPER* version or
|
||||
* buy the commercial version.
|
||||
*
|
||||
* In case you've already got the developer version, then this is one of the few
|
||||
* packages/classes that is only available to *PAYING* customers.
|
||||
* To get it go to www.blueshoes.org and buy a commercial version.
|
||||
*
|
||||
* @copyright www.blueshoes.org
|
||||
* @author Samuel Blume <sam at blueshoes dot org>
|
||||
* @author Andrej Arn <andrej at blueshoes dot org>
|
||||
*/
|
||||
if (!Bs_Objects) {var Bs_Objects = [];};
|
||||
|
||||
function Bs_ButtonBar() {
|
||||
this._id;
|
||||
this._objectId;
|
||||
this.imgPath = '/_bsImages/buttons/';
|
||||
this.useHelpBar;
|
||||
this.alignment = 'hor';
|
||||
this.ignoreEvents = false;
|
||||
this.helpBarStyle = "font-family:arial; font-size:11px; height:16px;";
|
||||
this._buttons = new Array;
|
||||
this._parentButton;
|
||||
this._constructor = function() {
|
||||
this._id = Bs_Objects.length;
|
||||
Bs_Objects[this._id] = this;
|
||||
this._objectId = "Bs_ButtonBar_"+this._id;
|
||||
}
|
||||
|
||||
this.addButton = function(btn, helpBarText) {
|
||||
btn._buttonBar = this;
|
||||
this._buttons[this._buttons.length] = new Array(btn, helpBarText);
|
||||
}
|
||||
|
||||
this.newGroup = function() {
|
||||
this._buttons[this._buttons.length] = '|';
|
||||
}
|
||||
|
||||
this.render = function() {
|
||||
var out = new Array;
|
||||
if (this._isGecko()) {
|
||||
out[out.length] = '<div style="background-color: menu; padding: 2px">';
|
||||
} else {
|
||||
out[out.length] = '<div style="background-color:menu;">';
|
||||
}
|
||||
out[out.length] = '<div>';
|
||||
for (var i=0; i<this._buttons.length; i++) {
|
||||
if (this.alignment != 'hor') {
|
||||
out[out.length] = '<div>';
|
||||
}
|
||||
if (this._buttons[i] == '|') {
|
||||
out[out.length] = '<span class="' + ((this.alignment == 'hor') ? 'separatorForHorizontal' : 'separatorForVertical') + '"></span>';
|
||||
} else {
|
||||
var btn = this._buttons[i][0];
|
||||
var helpBarDiv = false;
|
||||
if (typeof(this.useHelpBar) == 'string') {
|
||||
var helpBarDiv = this.useHelpBar;
|
||||
} else if (this.useHelpBar) {
|
||||
var helpBarDiv = this._objectId + '_helpBarDiv';
|
||||
}
|
||||
if (helpBarDiv != false) {
|
||||
btn.attachEvent("document.getElementById('" + helpBarDiv + "').innerHTML = \"" + this._buttons[i][1] + "\";", 'over');
|
||||
btn.attachEvent("document.getElementById('" + helpBarDiv + "').innerHTML = \"\";", 'out');
|
||||
}
|
||||
out[out.length] = btn.render();
|
||||
}
|
||||
if (this.alignment != 'hor') {
|
||||
out[out.length] = '</div>';
|
||||
}
|
||||
}
|
||||
out[out.length] = '</div>';
|
||||
if (this.useHelpBar) {
|
||||
if (this.useHelpBar == 2) {
|
||||
out[out.length] = '<div style="' + this.helpBarStyle + '">';
|
||||
out[out.length] = '<img align="middle" src="' + this.imgPath + 'bs_info.gif" border="0" onMouseOver="document.getElementById(\'' + helpBarDiv + '\').innerHTML = \'Move your mouse over the buttons to see the description here.\';" onMouseOut="document.getElementById(\'' + helpBarDiv + '\').innerHTML = \'\';"> ';
|
||||
out[out.length] = '<span id="' + helpBarDiv + '"></span></div>';
|
||||
} else if (this.useHelpBar == true) {
|
||||
out[out.length] = '<div id="' + helpBarDiv + '" style="' + this.helpBarStyle + '"></div>';
|
||||
}
|
||||
}
|
||||
out[out.length] = '</div>';
|
||||
return out.join('');
|
||||
}
|
||||
this.drawOut = function() {
|
||||
document.writeln(this.render());}
|
||||
this.drawInto = function(elm) {
|
||||
if (typeof(elm) == 'string') {
|
||||
elm = document.getElementById(elm);}
|
||||
if (elm) {
|
||||
elm.innerHTML = this.render();}
|
||||
}
|
||||
this._isGecko = function() {
|
||||
if (navigator.appName == "Microsoft Internet Explorer") return false; var x = navigator.userAgent.match(/gecko/i);
|
||||
return (x);return false;}
|
||||
this._constructor();}
|
||||
230
www/extras/wobject/EventManagementSystem/script/dynamicForms.js
Normal file
230
www/extras/wobject/EventManagementSystem/script/dynamicForms.js
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
var textCompareList = {
|
||||
"eq":"equals",
|
||||
"like":"contains",
|
||||
"ne":"is not",
|
||||
"notlike":"not like",
|
||||
"starts":"starts with",
|
||||
"ends":"ends with"
|
||||
};
|
||||
|
||||
var numericCompareList = {
|
||||
"eq":"=",
|
||||
"ne":"is not",
|
||||
"gt":">",
|
||||
"lt":"<",
|
||||
"gte":">=",
|
||||
"lte":"<="
|
||||
};
|
||||
var booleanCompareList = {
|
||||
"eq":"is",
|
||||
"ne":"is not"
|
||||
};
|
||||
function addField() {
|
||||
var tb = document.getElementById('filterbody');
|
||||
filterCount++;
|
||||
|
||||
var newtr = document.createElement('tr');
|
||||
newtr.setAttribute("id","cfilter_id"+filterCount);
|
||||
//Create right table data
|
||||
var newtd1 = document.createElement('td');
|
||||
newtd1.className="searchDisplay";
|
||||
//Add fields to choose from
|
||||
var newDD = newtd1.appendChild(addFilterSelect());
|
||||
|
||||
//Create left table data
|
||||
var newtd2 = document.createElement('td');
|
||||
newtd2.className="searchDisplay";
|
||||
newtd2.setAttribute("id","cfilter_td_"+filterCount);
|
||||
//Add default compare select list
|
||||
var compareSelect = addSelectList('cfilter_c'+filterCount,textCompareList);
|
||||
compareSelect.className="compare-select";
|
||||
newtd2.appendChild(compareSelect);
|
||||
//Add default filter field
|
||||
var filterText = addTextField('cfilter_t'+filterCount);
|
||||
filterText.className="filter-text";
|
||||
newtd2.appendChild(filterText);
|
||||
//Add remove button
|
||||
var filterButton = addButton('cbutton_'+filterCount,'-');
|
||||
filterButton.className="button";
|
||||
filterButton.onclick = removeField;
|
||||
newtd2.appendChild(filterButton);
|
||||
//Add tds to trs
|
||||
newtr.appendChild(newtd1);
|
||||
newtr.appendChild(newtd2);
|
||||
//Add trs to tbody
|
||||
tb.appendChild(newtr);
|
||||
return newDD;
|
||||
}
|
||||
|
||||
|
||||
function getTarget(e) {
|
||||
var targ;
|
||||
if (!e) var e = window.event;
|
||||
if (e.target) targ = e.target;
|
||||
else if (e.srcElement) targ = e.srcElement;
|
||||
if (targ.nodeType == 3) // defeat Safari bug
|
||||
targ = targ.parentNode;
|
||||
return targ
|
||||
}
|
||||
|
||||
function getFilterId(button) {
|
||||
if(button == null) return;
|
||||
var name = button.name;
|
||||
var strs = name.split("_");
|
||||
var end = strs[1];
|
||||
if(isNaN(end)) {
|
||||
end = end.substring(1,end.length);
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
function removeField (event) {
|
||||
var button = getTarget(event);
|
||||
var filterId = getFilterId(button);
|
||||
var idName = "cfilter_id"+filterId;
|
||||
removeElement('filterbody',idName);
|
||||
}
|
||||
|
||||
function changeField (event) {
|
||||
var button = getTarget(event);
|
||||
var filterId = getFilterId(button);
|
||||
var idName = 'cfilter_s'+filterId+'_id';
|
||||
var sel = document.getElementById(idName);
|
||||
|
||||
var field = sel.options[sel.selectedIndex].value;
|
||||
changeToType(field,filterId);
|
||||
}
|
||||
|
||||
function changeToType(field,filterId) {
|
||||
var fieldType = filterList[field]["type"];
|
||||
var fieldCompare = filterList[field]["compare"];
|
||||
var tr = document.getElementById("cfilter_id"+filterId);
|
||||
var td = document.getElementById("cfilter_td_"+filterId);
|
||||
//Remove old td
|
||||
tr.removeChild(td);
|
||||
//Create new td
|
||||
var newtd = document.createElement('td');
|
||||
newtd.className="searchDisplay";
|
||||
newtd.setAttribute("id","cfilter_td_"+filterId);
|
||||
|
||||
//Add default compare select list
|
||||
var arr;
|
||||
if(fieldCompare == "text") {
|
||||
arr = textCompareList;
|
||||
} else if(fieldCompare == "numeric") {
|
||||
arr = numericCompareList;
|
||||
} else if(fieldCompare == "boolean") {
|
||||
arr = booleanCompareList;
|
||||
}
|
||||
var compareSelect = addSelectList('cfilter_c'+filterId,arr);
|
||||
compareSelect.className="compare-select";
|
||||
newtd.appendChild(compareSelect);
|
||||
|
||||
var filterFieldName = 'cfilter_t'+filterId;
|
||||
|
||||
if(fieldType == "text") {
|
||||
var filterField = addTextField(filterFieldName);
|
||||
filterField.className="filter-text";
|
||||
newtd.appendChild(filterField);
|
||||
} else if(fieldType == "select") {
|
||||
var filterField = addSelectList(filterFieldName,filterList[field]["list"]);
|
||||
filterField.className="filter-text";
|
||||
newtd.appendChild(filterField);
|
||||
} else if(fieldType == "date") {
|
||||
var filterField = addTextField(filterFieldName);
|
||||
//filterField.setAttribute("id",dateFieldId);
|
||||
filterField.className="filter-text";
|
||||
newtd.appendChild(filterField);
|
||||
} else if(fieldType == "dateTime") {
|
||||
var filterField = addTextField(filterFieldName);
|
||||
//filterField.setAttribute("id",dateFieldId);
|
||||
filterField.className="filter-text";
|
||||
newtd.appendChild(filterField);
|
||||
}
|
||||
|
||||
//Add remove button
|
||||
var filterButton = addButton('cbutton_'+filterId,'-');
|
||||
filterButton.className="button";
|
||||
filterButton.onclick = removeField;
|
||||
newtd.appendChild(filterButton);
|
||||
|
||||
//Add new td to tr
|
||||
tr.appendChild(newtd);
|
||||
if(fieldType == "date") {
|
||||
var dateFieldId = filterFieldName+"_id";
|
||||
Calendar.setup({
|
||||
"inputField":dateFieldId,
|
||||
"ifFormat": "%Y-%m-%d",
|
||||
"showsTime": false,
|
||||
"timeFormat": "12",
|
||||
"mondayFirst": false
|
||||
});
|
||||
}
|
||||
if(fieldType == "dateTime") {
|
||||
var dateFieldId = filterFieldName+"_id";
|
||||
Calendar.setup({
|
||||
"inputField":dateFieldId,
|
||||
"ifFormat": "%Y-%m-%d %H:%M:%S",
|
||||
"showsTime": true,
|
||||
"step": 1,
|
||||
"timeFormat": "12",
|
||||
"mondayFirst": false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function addFilterSelect() {
|
||||
var sel = document.createElement("select");
|
||||
sel.setAttribute('name','cfilter_s'+filterCount);
|
||||
sel.setAttribute('id','cfilter_s'+filterCount+'_id');
|
||||
sel.className="filter-select";
|
||||
sel.onchange=changeField;
|
||||
//one way to write a function... you have to write it yourself!
|
||||
//myOnChange = new Function("e", "location.href=myselect.options[myselect.selectedIndex].value");
|
||||
//first option
|
||||
for (var word in filterList) {
|
||||
//listString += items[word] + ", ";
|
||||
var opt = document.createElement("option");
|
||||
opt.setAttribute("value",word);
|
||||
opt.appendChild(document.createTextNode(filterList[word]["name"]));
|
||||
sel.appendChild(opt);
|
||||
}
|
||||
return sel;
|
||||
}
|
||||
|
||||
function addSelectList(fieldName,array) {
|
||||
var sel = document.createElement("select");
|
||||
sel.setAttribute('name',fieldName);
|
||||
sel.setAttribute("id",fieldName+"_id");
|
||||
for (var word in array) {
|
||||
var opt = document.createElement("option");
|
||||
opt.setAttribute("value",word);
|
||||
opt.appendChild(document.createTextNode(array[word]));
|
||||
sel.appendChild(opt);
|
||||
}
|
||||
return sel;
|
||||
}
|
||||
|
||||
function addTextField(fieldName) {
|
||||
var text = document.createElement("input");
|
||||
text.setAttribute('type','text');
|
||||
text.setAttribute('name',fieldName);
|
||||
text.setAttribute("id",fieldName+"_id");
|
||||
return text;
|
||||
}
|
||||
|
||||
function addButton(name,value) {
|
||||
var button = document.createElement('input');
|
||||
button.setAttribute('type','button');
|
||||
button.setAttribute('value',value);
|
||||
button.setAttribute('name',name);
|
||||
return button;
|
||||
}
|
||||
|
||||
function removeElement(parent,child) {
|
||||
var p = document.getElementById(parent);
|
||||
var c = document.getElementById(child);
|
||||
p.removeChild(c);
|
||||
}
|
||||
1243
www/extras/wobject/EventManagementSystem/script/jsdomenu.js
Normal file
1243
www/extras/wobject/EventManagementSystem/script/jsdomenu.js
Normal file
File diff suppressed because it is too large
Load diff
32
www/extras/wobject/EventManagementSystem/script/locale_EN.js
Normal file
32
www/extras/wobject/EventManagementSystem/script/locale_EN.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*****************************************************************
|
||||
Page : locale_EN.js
|
||||
Description : text for english version
|
||||
Date : 20/04/05
|
||||
Authors:Alessandro Viganò (avigano@Movinfo.it) / Filippo Zanardo (fzanardo@MOViNFO.it)
|
||||
Copyright (C) 2005-2006 MOViNFO
|
||||
|
||||
MovTable is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
MovTable is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
******************************************************************/
|
||||
|
||||
var getTextStrings= new Array()
|
||||
getTextStrings["Nascondi Colonna"]="Hide Column"
|
||||
getTextStrings["Mostra Colonne"]="Show Columns"
|
||||
getTextStrings["Tutte"]="All"
|
||||
getTextStrings["Filtro in base a selezione"]="Filter by selection"
|
||||
getTextStrings["Filtro ad esclusione selezione"]="Filter out selection"
|
||||
getTextStrings["Rimuovi filtro"]="Remove Filter"
|
||||
getTextStrings["Ordinamento crescente"]="Ascending Order"
|
||||
getTextStrings["Ordinamento decrescente"]="Descending order"
|
||||
getTextStrings["Copia"]="Copy"
|
||||
1127
www/extras/wobject/EventManagementSystem/script/movtableInc.js
Normal file
1127
www/extras/wobject/EventManagementSystem/script/movtableInc.js
Normal file
File diff suppressed because it is too large
Load diff
115
www/extras/wobject/EventManagementSystem/script/tab.js
Normal file
115
www/extras/wobject/EventManagementSystem/script/tab.js
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
if (!Bs_Objects) {
|
||||
var Bs_Objects = [];
|
||||
};
|
||||
|
||||
function Bs_TabSet(outerElmId) {
|
||||
var a = arguments;
|
||||
this._outerElmId = (a.length>1) ? a[1] : a[0];
|
||||
this._id;
|
||||
this._objectId;
|
||||
this.tabs = new Array;
|
||||
this._activeTabIdx = 0;
|
||||
this._onTabSelectEvent;
|
||||
this._constructor = function(button) {
|
||||
this._id = Bs_Objects.length;
|
||||
Bs_Objects[this._id] = this;
|
||||
this._objectId = "Bs_TabSet_"+this._id;
|
||||
this._button = button;
|
||||
}
|
||||
|
||||
this.addTab = function(caption, container) {
|
||||
if (typeof(caption) == 'object') {
|
||||
var o = caption;
|
||||
} else {
|
||||
var o = new Object;
|
||||
o.caption = caption;
|
||||
o.container = container;
|
||||
}
|
||||
o.tabIdx = this.tabs.length;this.tabs[o.tabIdx] = o;
|
||||
}
|
||||
|
||||
this.render = function() {
|
||||
var ret = new Array;
|
||||
ret[ret.length] = '<div class="tabsetTabsDiv">';
|
||||
ret[ret.length] = '<div style="width:2px; min-width:2px; display:inline;"></div>';
|
||||
for (var i=0; i<this.tabs.length; i++) {
|
||||
if (i == this._activeTabIdx) {
|
||||
var cls = 'bsTabsetActive';
|
||||
} else {
|
||||
var cls = 'bsTabsetInactive';
|
||||
if (this.tabs[i].container) this.tabs[i].container.style.display = 'none';
|
||||
}
|
||||
ret[ret.length] = '<div unselectable="On" id="' + this._objectId + '_tabCap_' + i + '" class="bsTabset ' + cls + '" style="display:inline;" onclick="Bs_Objects['+this._id+'].switchTo(' + i + ');">' + this.tabs[i].caption + '</div>';
|
||||
}
|
||||
ret[ret.length] = '<div style="width:50px; min-width:50px; display:inline;"></div>';
|
||||
ret[ret.length] = '<div unselectable="On" style="display:inline;"><input type="submit" value="Save" class="tabButton"></div>'
|
||||
ret[ret.length] = '</div>';
|
||||
return ret.join('');
|
||||
}
|
||||
|
||||
this.draw = function() {
|
||||
var elem = document.getElementById(this._outerElmId + '_tabs');
|
||||
if (elem) elem.innerHTML = this.render();
|
||||
}
|
||||
|
||||
this.switchTo = function(theReg) {
|
||||
newRegIdx = -1;
|
||||
if (theReg=='') theReg = '0';
|
||||
if (isNaN(parseInt(theReg))) {
|
||||
for (var i=0; i<this.tabs.length; i++) {
|
||||
if (this.tabs[i].caption == theReg) (newRegIdx = i);
|
||||
}
|
||||
} else {
|
||||
newRegIdx = theReg;
|
||||
}
|
||||
if (newRegIdx<0) return;
|
||||
for (var i=0; i<this.tabs.length; i++) {
|
||||
var elem = document.getElementById(this._objectId + '_tabCap_' + i);
|
||||
if (!elem) continue;if (newRegIdx == i) {
|
||||
this._activeTabIdx = i;
|
||||
elem.className = 'bsTabset bsTabsetActive';
|
||||
this.tabs[i].container.style.display = 'block';
|
||||
if (typeof(this.tabs[i].onFocus) != 'undefined') {
|
||||
this._triggerFunction(this.tabs[i].onFocus);
|
||||
}
|
||||
this.fireOnTabSelect();
|
||||
} else {
|
||||
elem.className = 'bsTabset bsTabsetInactive';
|
||||
this.tabs[i].container.style.display = 'none';
|
||||
if (typeof(this.tabs[i].onBlur) != 'undefined') {
|
||||
this._triggerFunction(this.tabs[i].onBlur);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.getActiveTab = function() {
|
||||
return this.tabs[this._activeTabIdx];
|
||||
}
|
||||
|
||||
this.onTabSelect = function(yourEvent) {
|
||||
this._onTabSelectEvent = yourEvent;
|
||||
}
|
||||
|
||||
this.fireOnTabSelect = function() {
|
||||
if (this._onTabSelectEvent) {
|
||||
func = this._onTabSelectEvent;
|
||||
if (this._onTabSelectEvent == 'string') {
|
||||
eval(func);
|
||||
} else {
|
||||
func(this);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
this._triggerFunction = function(func) {
|
||||
if (typeof(func) == 'function') {
|
||||
func();
|
||||
} else if (typeof(func) == 'string') {
|
||||
eval(func);
|
||||
}
|
||||
}
|
||||
|
||||
this._constructor();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue