Welcome to your Web Application JavaScript file!
You can set FoxInCloud options below, and/or add your own JavaScript code (Prototype.js or jQuery flavors are welcome)
You share this file between tutoTest and tutoProd:
e.g. edit ...\site\tutoTest\tuto.js and, once tested OK, copy to ...\site\tutoProd\tuto.js
/!\ This file is UTF-8 encoded; use a text editor that supports UTF-8 such as Sublime Text, NotePad++ or PSpad
*****************************************************************/
jQuery.extend(FoxInCloud, {
CGI: 'tuto',
requestTimeoutDev: 600,
requestTimeoutProd: 30,
requestWaitPic: true,
requestWaitPicDelay: .1,
requestFormOpacity: .8,
autoBlurDelay: -1,
inputAlwaysBlur: true,
inputAlwaysBlurOnReturn: true,
inputTextDateSelector: 'input.awDate',
dateFormat: 'day/month', // 'day/month' || 'month/day'
centuryRollover: 20,
inputTextBackColor:false,
gridRowChangeDelay: 0.5,
gridColChangeDelay: 0.5,
gridDateEmpty: '/ /',
gridDateTimeEmpty: '/ / ::',
pageEffectUser: false,
pageEffectServer: false,
visibleEffect: true, // V 2.10
imgSrcEffect: true, // V 2.10
effectDuration: .5, // V 2.10
onKeyLabels: "ctrl+H, ctrl+F, ctrl+O, ctrl+S", // V 2.10
AttribSet_: function (ebx, tcAttrib, tuVal){
var $ebx = jQuery(ebx);
if ($ebx.hasClass('editbox') && $ebx.hasClass('ficebxevent') && tcAttrib === 'value'){
if (!tuVal) ebx.value = '';
else {
var iFirst = tuVal.indexOf('\n')
, iLast = indexOfOcc(tuVal, '\n', (tuVal.match(/\n/g) || []).length - (ebx.value.match(/\n/g) || []).length)
;
ebx.value = ''
+ tuVal.substr(0, iFirst)
+ ' (' + (new Date() - this.dRequest) + 'ms' + ') '
+ tuVal.substr(iFirst, iLast-iFirst+1)
+ ebx.value
;
}
ebx.scrollTop = 0;
return true; // return true skips the FoxInCloud default method
}
},
AjaxComplete_: function (jqXHR) {
var time = this.ExeTimeDisplay();
jQuery('.lblTime').html(time);
window.console && console.log(time); // FoxInCloud.cEvent + ': ' +
},
junk: 'junk'
});
function indexOfOcc (string, char, iOcc) {
var first_index = string.indexOf(char);
if (iOcc <= 1) return first_index;
else {
var length_up_to_first_index = first_index + 1
, next_occurrence = indexOfOcc(string.slice(length_up_to_first_index), char, iOcc - 1);
return (next_occurrence === -1)
? -1
: (length_up_to_first_index + next_occurrence)
;
}
}
function srceCodeDisplay(event, trgtID, srceID, code){
if (event.shiftKey || event.eventPhase !== 2) return;
trgtID = jQuery('#' + trgtID);
trgtID
.html(FoxInCloud.abLocalized(code)) // FoxInCloud.abLocalized(): see FoxInCloud.js
.off('scroll')
.on('scroll', function(e){jQuery(this).data(srceID, jQuery(this).scrollTop());}) // reminds scrollTop for each source element
.scrollTop(trgtID.data(srceID)||0)
;
event.stopPropagation();
};
var myCount = 1, Object_ = "";
function InsertEventCount(event, myEvent, myObject) {
var ebx = jQuery('#event_scx-tutoinfoboxclient');
if(ebx.length && !FoxInCloud.lRequest){
var myStr = ebx.val()
, brack = myStr.indexOf('[')
, line1 = myStr.split(((brack > 0 && brack < myStr.indexOf('\n')) ? '[' : '\n'), 1)[0]
;
if (myEvent === line1){
myCount++;
myStr = line1 + '[' + myCount +']' + myStr.substr(myStr.indexOf('\n'));
} else {
myCount = 1;
myStr = myEvent + '\n' + (Object_ === myObject ? '':'\n') + myStr;
}
ebx.val(myStr);
Object_ = myObject;
}
};
function srceCodeWindow(event, html, srceFile) {
html = html || jQuery(event.currentTarget).html();
if (html && html.indexOf('awVFPcode') > -1){
srceFile = "'" + (srceFile || '*.?cx') + "'";
var title = (false ? ''
: (FoxInCloud.lang === 'fr' ? 'Ce code source a été lu du fichier ' + srceFile + ', colorisé et localisé' // copy-paste this line to add another language support
: (FoxInCloud.lang === 'es' ? 'Este código fuente se leyó desde ' + srceFile + ', coloreada y localizada' // copy-paste this line to add another language support
: (FoxInCloud.lang === 'it' ? 'Questo codice sorgente è stato letto da ' + srceFile + ', colorato e localizzato' // copy-paste this line to add another language support
: 'This source code was read from ' + srceFile + ', colorized and localized' // default: English
))));
if (event.ctrlKey || event.metaKey) {
var win = window.open('', title);
jQuery(win.document.head).html(jQuery('<base href="' + window.location.href.substr(0, window.location.href.lastIndexOf('/')+1) + '">').add(jQuery('link[type="text/css"]').clone()));
jQuery(win.document.body).html(html);
}
else if (jQuery('body.bootstrap').length) {
var modalID = "modal-srceCodeWindow", modalEl, modalBS;
html = ''
+ '<div class="modal fade" id="' + modalID + '" tabindex="-1" role="dialog" aria-hidden="true" aria-labelledby="srceCodeWindow_title">'
+ '<div class="modal-dialog modal-lg shadow-lg" role="document">'
+ '<div class="modal-content">'
+ '<div class="modal-header">'
+ '<h5 class="modal-title" id="srceCodeWindow_title">' + title + '</h5>'
+ '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" aria-hidden="true"></button>'
+ '</div>'
+ '<div class="modal-body">'
+ html
+ '</div>'
+ '</div>'
+ '</div>'
+ '</div>';
jQuery(document.body).append(html);
modalEl = document.getElementById(modalID);
modalBS = new bootstrap.Modal(modalEl, {keyboard: true, backdrop:true});
modalBS && modalBS.show();
jQuery(modalEl).on('hidden.bs.modal', function () { // http://stackoverflow.com/questions/13177426/how-to-destroy-bootstrap-modal-window-completely
modalBS.dispose();
jQuery(modalEl).remove();
});
} // else if (this.jQueryUIdialog) {}
else {
jQuery(html).dialog({
title: title
, minWidth: 800
, minHeight: 500
, maxHeight: jQuery(window).innerHeight() * .8
, show: true
, hide: true
, close: function(event, ui){jQuery(this).dialog('destroy');}
});
}
}
};
jQuery(document).ready(
function(){
jQuery('body:not(.bootstrap) #menubar-_msysmenu').menu(
'option' // http://api.jqueryui.com/menu/#method-option
, 'position'
, {my: "left top", at: "right top"} // http://api.jqueryui.com/menu/#option-position
);
});
window.comboValues = {};
function comboValueCollect(id, value){
window.comboValues[id] = value;
};
window.spinnerValues = {};
function spinnerValueCollect(id, value){
window.spinnerValues[id] = value;
};