Add JS files
This commit is contained in:
70
include/ECM/EcmDeleteDocument/EcmDeleteDocument.js
Executable file
70
include/ECM/EcmDeleteDocument/EcmDeleteDocument.js
Executable file
@@ -0,0 +1,70 @@
|
||||
var deleteDocumentAjax = function(container) {
|
||||
|
||||
var params = new Array;
|
||||
var r = confirm('Czy na pewno chcesz usunąć ten dokument?');
|
||||
if (r == true) {
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDeleteDocument',
|
||||
job : 'deleteDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Usunięte!');
|
||||
$('#sendreturn').show();
|
||||
window.location = 'index.php?module='+params[0]+'&action=ListView';
|
||||
} else {
|
||||
$('#sendreturn').html('Błąd');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
// $('#div_send').hide();
|
||||
}
|
||||
var cancelDocumentAjax = function(container) {
|
||||
|
||||
var params = new Array;
|
||||
var r = confirm('Czy na pewno chcesz anulować ten dokument?');
|
||||
if (r == true) {
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDeleteDocument',
|
||||
job : 'cancelDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Anulowane!');
|
||||
$('#sendreturn').show();
|
||||
window.location = 'index.php?module='+params[0]+'&action=ListView';
|
||||
} else {
|
||||
$('#sendreturn').html('Błąd');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
// $('#div_send').hide();
|
||||
}
|
||||
124
include/ECM/EcmDocumentNumberGenerator/EcmDocumentNumberGenerator.js
Executable file
124
include/ECM/EcmDocumentNumberGenerator/EcmDocumentNumberGenerator.js
Executable file
@@ -0,0 +1,124 @@
|
||||
var EcmDocumentNumberGenerator_getNumberTemplate = function(field_name, module) {
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
console.log('t');
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNumberTemplate',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
if (response == "") {
|
||||
$('#'+field_name).attr('readonly', false);
|
||||
} else {
|
||||
$('#'+field_name).attr('readonly', 'readonly');
|
||||
$('#'+field_name).css('background-color', '#888888');
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getNormalNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNormalNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getCorrectNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getCorrectNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function utf8_to_b64( str ) {
|
||||
return window.btoa(unescape(encodeURIComponent( str )));
|
||||
}
|
||||
|
||||
function b64_to_utf8( str ) {
|
||||
return decodeURIComponent(escape(window.atob( str )));
|
||||
}
|
||||
|
||||
|
||||
var cl = function(m) {
|
||||
console.log(m);
|
||||
}
|
||||
205
include/ECM/EcmDropdownEditor/EcmDropdownEditor.js
Executable file
205
include/ECM/EcmDropdownEditor/EcmDropdownEditor.js
Executable file
@@ -0,0 +1,205 @@
|
||||
var EcmDropdownEditor_show = function(container) {
|
||||
|
||||
var div = $('[name='+container+']');
|
||||
var module = $('form[name=EditView]').find('input[name=module]').val();
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = container;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'getEditView',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
div.html(response[0]);
|
||||
div.show();
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
|
||||
div.show();
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_addOption = function(key) {
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'getOptionTemplate',
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var optDiv = jQuery.parseHTML(response[0]);
|
||||
jQuery(response[0]).insertBefore(
|
||||
jQuery('[name=' + key + ']').find('span'));
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_save = function(dom, container) {
|
||||
if (!EcmDropdownEditor_validate(dom)) {
|
||||
return false;
|
||||
}
|
||||
var doms = EcmDropdownEditor_parseArrays(dom);
|
||||
var params = new Array;
|
||||
params[0] = dom; //name of list
|
||||
params[1] = doms;//list of values
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'saveDom',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var div = $('[name='+container+']');
|
||||
div.hide();
|
||||
EcmDropdownEditor_refreshField(container);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_refreshField = function(container) {
|
||||
|
||||
var module = $('form[name=EditView]').find('input[name=module]').val();
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;//list of values
|
||||
params[1] = container;//list of values
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'refreshField',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var tmp = container.split("___");
|
||||
$('form[name=EditView]').find('select[name='+tmp[0]+']').html(response[0]);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_cancel = function(container) {
|
||||
var div = $('[name='+container+']');
|
||||
div.html('');
|
||||
div.hide();
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_parseArrays = function(dom) {
|
||||
var normal = {};
|
||||
var options = jQuery('[name=' + dom + ']').children('div');
|
||||
jQuery.each(options, function(key, val) {
|
||||
//check normal inputs
|
||||
var optionKey = jQuery(val).attr('name');
|
||||
console.log(val);
|
||||
var values = jQuery(val).children('input:not([name$=ext])');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
name = jQuery(val2).attr('name');
|
||||
if (!normal[name])
|
||||
normal[name] = {};
|
||||
normal[name][optionKey] = jQuery(val2).val();
|
||||
});
|
||||
});
|
||||
return normal;
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_validate = function(dom) {
|
||||
var error = false;
|
||||
// get all options in DIV name = dom
|
||||
var options = jQuery('[name=' + dom + ']').children('div');
|
||||
// loop throw options looking for errors
|
||||
jQuery.each(options, function(key, val) {
|
||||
// check empty options
|
||||
var empty = true;
|
||||
var values = jQuery(val).children('input');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
valInput = jQuery(val2).val();
|
||||
valInput = valInput.trim();
|
||||
if (valInput.length != 0)
|
||||
empty = false;
|
||||
});
|
||||
if (empty)
|
||||
jQuery(val).remove(); // delete empty option
|
||||
values = null;
|
||||
//check normal inputs
|
||||
values = jQuery(val).children('input:not([name$=ext])');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
valInput = jQuery(val2).val();
|
||||
valInput = valInput.trim();
|
||||
if (valInput.length == 0) {
|
||||
jQuery(val2).addClass('dropdowneditor_error');
|
||||
error = true;
|
||||
} else
|
||||
jQuery(val2).removeClass('dropdowneditor_error');
|
||||
});
|
||||
});
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_moveElementUp = function(el) {
|
||||
var parent = jQuery(el).parent();
|
||||
var prev = parent.prev();
|
||||
if (prev.length == 0)
|
||||
return;
|
||||
parent.insertBefore(prev);
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_moveElementDown = function(el) {
|
||||
var parent = jQuery(el).parent();
|
||||
var next = parent.next();
|
||||
if (next.length == 0)
|
||||
return;
|
||||
parent.insertAfter(next);
|
||||
}
|
||||
|
||||
//helper
|
||||
function utf8_to_b64( str ) {
|
||||
return window.btoa(unescape(encodeURIComponent( str )));
|
||||
}
|
||||
|
||||
function b64_to_utf8( str ) {
|
||||
return decodeURIComponent(escape(window.atob( str )));
|
||||
}
|
||||
|
||||
|
||||
var cl = function(m) {
|
||||
console.log(m);
|
||||
}
|
||||
32
include/ECM/EcmMultiPdf/EcmMultiPdf.js
Executable file
32
include/ECM/EcmMultiPdf/EcmMultiPdf.js
Executable file
@@ -0,0 +1,32 @@
|
||||
var EcmMultiPdf_create = function(documents, outputName) {
|
||||
// fill params
|
||||
var params = new Array();
|
||||
params[0] = documents;
|
||||
|
||||
if (!(typeof outputName === 'undefined')) {
|
||||
if ((outputName.toUpperCase().substring((outputName.length) - 4,
|
||||
outputName.length)) != '.PDF')
|
||||
outputName += '.pdf';
|
||||
params[2] = outputName;
|
||||
}
|
||||
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmMultiPdf',
|
||||
job : 'create',
|
||||
params : btoa(JSON.stringify(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
success : function(response) {
|
||||
$.unblockUI();
|
||||
if (Number.isInteger(response[0]))
|
||||
alert('ERROR '+response[0]);
|
||||
else
|
||||
window.open(response[0]);
|
||||
},
|
||||
});
|
||||
}
|
||||
295
include/ECM/EcmNotifications/EcmNotifications.js
Executable file
295
include/ECM/EcmNotifications/EcmNotifications.js
Executable file
@@ -0,0 +1,295 @@
|
||||
// where our WebSockets logic will go later
|
||||
var socket, host;
|
||||
var notification_count = 0;
|
||||
var notification_array=new Array();
|
||||
var ajaxnotifications_url = "index.php?module=Schedulers&action=EcmNotificationAjax&to_pdf=1";
|
||||
var audiotypes = {
|
||||
"mp3" : "audio/mpeg",
|
||||
"mp4" : "audio/mp4",
|
||||
"ogg" : "audio/ogg",
|
||||
"wav" : "audio/wav"
|
||||
}
|
||||
|
||||
function ss_soundbits(sound) {
|
||||
var audio_element = document.createElement('audio')
|
||||
if (audio_element.canPlayType) {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var source_element = document.createElement('source')
|
||||
source_element.setAttribute('src', arguments[i])
|
||||
if (arguments[i].match(/\.(\w+)$/i))
|
||||
source_element.setAttribute('type', audiotypes[RegExp.$1])
|
||||
audio_element.appendChild(source_element)
|
||||
}
|
||||
audio_element.load()
|
||||
audio_element.playclip = function() {
|
||||
audio_element.pause()
|
||||
audio_element.currentTime = 0
|
||||
audio_element.play()
|
||||
}
|
||||
return audio_element
|
||||
}
|
||||
}
|
||||
var clicksound = ss_soundbits(
|
||||
'include/ECM/EcmNotifications/sounds/bell_ring.ogg',
|
||||
"include/ECM/EcmNotifications/sounds/bell_ring.mp3")
|
||||
host = "wss://system.saas-systems.pl:444";
|
||||
function connect() {
|
||||
try {
|
||||
socket = new WebSocket(host);
|
||||
|
||||
addMessage("Socket State: " + socket.readyState);
|
||||
|
||||
socket.onopen = function() {
|
||||
addMessage("Socket Status: " + socket.readyState + " (open)");
|
||||
}
|
||||
|
||||
socket.onclose = function() {
|
||||
socket.close();
|
||||
}
|
||||
|
||||
socket.onmessage = function(msg) {
|
||||
|
||||
DrawMessage(msg.data);
|
||||
}
|
||||
} catch (exception) {
|
||||
addMessage("Error: " + exception);
|
||||
}
|
||||
}
|
||||
|
||||
function addMessage(msg) {
|
||||
$("#chat-log").append("<p>" + msg + "</p>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function DrawNotificationDiv(){
|
||||
var html='';
|
||||
|
||||
var toggle="if($('#notification_list').css('display')=='none'){$('#notification_list').show();}else{$('#notification_list').hide();}";
|
||||
if(notification_array.length>1){
|
||||
html='<a href="#" onclick="'+toggle+'">Masz <span style="color:red;">'+notification_array.length+'</span> nowe przypomnienia!</a>';
|
||||
}
|
||||
if(notification_array.length==0){
|
||||
html='<p>Brak nowych przypomnień.</p>';
|
||||
}
|
||||
if(notification_array.length==1) {
|
||||
html='<a href="#" onclick="'+toggle+'">Masz <span style="color:red;">1</span> nowe przypomnienie!</a>';
|
||||
}
|
||||
var div_header='<div id="notification_list" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;">';
|
||||
for(var i=0;i<notification_array.length;i++){
|
||||
div_header+='<p><a href="#" onclick="createDialog(\''+i+'\');$(\'#notification_list\').hide();">Temat: '+notification_array[i].name+'</a></p><br>';
|
||||
}
|
||||
div_header+='</div>';
|
||||
$("#notification-Div").html(html+div_header);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function makeid()
|
||||
{
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for( var i=0; i < 5; i++ )
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function leaveSelect(id){
|
||||
var html='<select id="leaveSel_'+id+'">';
|
||||
html+='<option value="1">5 minut</option>';
|
||||
html+='<option value="2">10 minut</option>';
|
||||
html+='<option value="3">15 minut</option>';
|
||||
html+='<option value="4">1 godzinię</option>';
|
||||
html+='<option value="5">2 godziny</option>';
|
||||
html+='<option value="6">3 godziny</option>';
|
||||
html+='<option value="7">1 dzien</option>';
|
||||
html+='<option value="8">2 dni</option>';
|
||||
html+='<option value="9">3 dni</option>';
|
||||
html+='</select>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function dialogContent(obj,id){
|
||||
if(obj.date_start === null){
|
||||
obj.date_start='brak';
|
||||
}
|
||||
var toggle="if($('#leave_"+obj.id+"').css('display')=='none'){$('#leave_"+obj.id+"').show();}else{$('#leave_"+obj.id+"').hide();}";
|
||||
var html='<table><tr><td>Temat:</td><td><b>'+obj.name+'</b></td></tr>';
|
||||
html+='<tr><td>Data rozpoczęcia:</td><td><b>'+obj.date_start.substr(0,16)+'</b></td></tr>';
|
||||
html+='<tr><td>Opis:</td><td>'+obj.description+'</td></tr></table>';
|
||||
html+='<input type="button" value="Odłóż" name="button1" onclick="'+toggle+'" class="button" title="Odłóż"><br>';
|
||||
html+='<div id="leave_'+obj.id+'" style="display:none;"><table><tr><td>Na:</td><td>'+leaveSelect(obj.id)+'</td></tr></table>';
|
||||
html+='<br><input type="button" value="Zapisz" name="button1" onclick="saveNotification(\''+obj.id+'\',\''+id+'\');" class="button" title="Zapisz"></div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function saveNotification(id,index){
|
||||
var params = {
|
||||
job : 'changeNotificationDate',
|
||||
id : id,
|
||||
flag : $('#leaveSel_'+id+' :selected').val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
|
||||
$( "#dialog_"+id ).dialog( "close" );
|
||||
|
||||
notification_array.splice(index, 1);
|
||||
send(id);
|
||||
DrawNotificationDiv();
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
function showLeavedNotifications(data){
|
||||
for( var i=0; i < data.length; i++ ){
|
||||
createDialog(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function getLeaveadNotifications(){
|
||||
|
||||
var params = {
|
||||
job : 'getLeaveadNotifications',
|
||||
user_id : $('#current_user_id').val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1'){
|
||||
notification_array=data;
|
||||
DrawNotificationDiv();
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function createDialog(obj){
|
||||
var id=obj;
|
||||
var obj=notification_array[obj];
|
||||
var div_id=makeid();
|
||||
|
||||
$( "#notification-Dialog" ).html('<div id="dialog_'+obj.id+'"></div>');
|
||||
$( "#dialog_"+obj.id).html(dialogContent(obj,id));
|
||||
$( "#dialog_"+obj.id).dialog({
|
||||
title: "Nowe przypomnienie o: "+obj.name.substr(0,15)+'...',
|
||||
open: function() { // open event handler
|
||||
$(this) // the element being dialogged
|
||||
.parent() // get the dialog widget element
|
||||
.find(".ui-dialog-titlebar-close") // find the close button for this dialog
|
||||
.hide(); // hide it
|
||||
},
|
||||
modal: true,
|
||||
buttons: {
|
||||
'Przyjąłem': function() {
|
||||
$( this ).dialog( "close" );
|
||||
},
|
||||
},
|
||||
beforeClose: function( event, ui ) {
|
||||
var params = {
|
||||
job : 'updateNotificationStatus',
|
||||
id : obj.id,
|
||||
flag : '2',
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
console.log(data);
|
||||
notification_array.splice(id, 1);
|
||||
send(obj.id);
|
||||
DrawNotificationDiv();
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function srt(desc) {
|
||||
return function(a,b){
|
||||
return desc ? ~~(a < b) : ~~(a > b);
|
||||
};
|
||||
}
|
||||
|
||||
function checkExist(id){
|
||||
for(i=0;i<notification_array.length;i++){
|
||||
if(notification_array[i].id==id){
|
||||
notification_array.splice(i, 1);
|
||||
$( "#dialog_"+id ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DrawMessage(msg) {
|
||||
|
||||
if (msg != '') {
|
||||
if(msg.length==36){
|
||||
// usuwanie nieaktualnych
|
||||
checkExist(msg);
|
||||
|
||||
DrawNotificationDiv();
|
||||
}
|
||||
var obj = JSON.parse(msg);
|
||||
|
||||
if (obj.assigned_user_id == $('#current_user_id').val()) {
|
||||
// dodawanie nowych
|
||||
clicksound.playclip();
|
||||
|
||||
checkExist(obj.id);
|
||||
|
||||
notification_array.unshift(obj);
|
||||
|
||||
// notification_array.push(obj);
|
||||
|
||||
DrawNotificationDiv();
|
||||
//createDialog(obj);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// if(obj.)
|
||||
}
|
||||
function send(id) {
|
||||
var text = $("#message").val();
|
||||
if (text == '') {
|
||||
addMessage("Please Enter a Message");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
socket.send(id);
|
||||
addMessage("Sent: " + text)
|
||||
} catch (exception) {
|
||||
addMessage("Failed To Send")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#message').keypress(function(event) {
|
||||
if (event.keyCode == '13') {
|
||||
send();
|
||||
}
|
||||
});
|
||||
|
||||
$("#disconnect").click(function() {
|
||||
socket.close()
|
||||
});
|
||||
$( document ).ready(function() {
|
||||
connect();
|
||||
getLeaveadNotifications();
|
||||
|
||||
});
|
||||
196
include/ECM/EcmNumberFunctions.js
Executable file
196
include/ECM/EcmNumberFunctions.js
Executable file
@@ -0,0 +1,196 @@
|
||||
function UnformatNumber(number) {
|
||||
if (!number)
|
||||
number = 0;
|
||||
// make string..
|
||||
number = number + '';
|
||||
// remove 1000 sep
|
||||
while (number.indexOf('.') != -1)
|
||||
number = number.replace('.', '');
|
||||
// change ',' to '.'
|
||||
number = number.replace(',', '.');
|
||||
return parseFloat(number);
|
||||
}
|
||||
|
||||
function FormatNumber(number, precision) {
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0,00';
|
||||
if (number == 'Infinity') return '0,00';
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '.';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function FormatNumber2(number, precision) {
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0,00';
|
||||
if (number == 'Infinity') return '0,00';
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function QuantityFormat(number,precision){
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0.000000';
|
||||
if (number == 'Infinity') return '0.000000';
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + '.' + tmp[1];
|
||||
}
|
||||
|
||||
function toFixed(value, precision) {
|
||||
var X = String(value);
|
||||
var precyzja = typeof precision !== 'undefined' ? parseInt(precision) : 2;
|
||||
precyzja = isNaN(precyzja) ? 2 : precyzja;
|
||||
var wynik = null;
|
||||
if (X.indexOf('.') >= 0) {
|
||||
var tab = X.split('.');
|
||||
if (tab[1].length >= (precyzja + 1)) {
|
||||
if (parseInt(tab[1][precyzja]) < 5) {
|
||||
tab[1] = tab[1].slice(0, precyzja);
|
||||
} else {
|
||||
tab[1] = tab[1].slice(0, precyzja);
|
||||
var tmp = parseInt(tab[1]);
|
||||
tmp = tmp + 1;
|
||||
tab[1] = String(tmp);
|
||||
if (tab[1].length > precyzja) {
|
||||
tmp = '';
|
||||
while (tmp.length < precyzja) {
|
||||
tmp += '0';
|
||||
}
|
||||
tab[1] = tmp;
|
||||
tmp = parseInt(tab[0]);
|
||||
tmp = tmp + 1;
|
||||
tab[0] = String(tmp);
|
||||
}
|
||||
|
||||
if (tab[1].length < precyzja) {
|
||||
tmp = '';
|
||||
while (tmp.length < precyzja - 1) {
|
||||
tmp += '0';
|
||||
}
|
||||
tab[1] = String(tmp) + String(tab[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
wynik = parseFloat(tab[0] + '.' + tab[1]).toFixed(precyzja);
|
||||
} else {
|
||||
wynik = parseFloat(X).toFixed(precyzja);
|
||||
}
|
||||
|
||||
return wynik;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
this is not number function !!@#$%^
|
||||
*/
|
||||
function checkIsTheSameContractor(){
|
||||
var error=false;
|
||||
var val='';
|
||||
$("input:checkbox[name='mass[]']:checked").each(function() {
|
||||
|
||||
if(val==''){
|
||||
|
||||
val=$("#mass_"+$(this).val()).val();
|
||||
if($("#mass_inv_"+$(this).val()).val()!=''){
|
||||
error=true;
|
||||
}
|
||||
} else {
|
||||
if( $("#mass_"+$(this).val()).val()!=val){
|
||||
error=true;
|
||||
}
|
||||
val=$("#mass_"+$(this).val()).val();
|
||||
if($("#mass_inv_"+$(this).val()).val()!=''){
|
||||
error=true;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return error;
|
||||
|
||||
}
|
||||
|
||||
function gotoInvoice(){
|
||||
var error=false;
|
||||
var val='';
|
||||
var ids=new Array();
|
||||
$("input:checkbox[name='mass[]']:checked").each(function() {
|
||||
$(this).val();
|
||||
ids.push( $(this).val());
|
||||
|
||||
});
|
||||
|
||||
window.open("index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&record="+ids.join('@'));
|
||||
}
|
||||
82
include/ECM/EcmPreviewPDF/EcmPreviewPDF.js
Executable file
82
include/ECM/EcmPreviewPDF/EcmPreviewPDF.js
Executable file
@@ -0,0 +1,82 @@
|
||||
// JavaScript Document
|
||||
|
||||
var pDivName = 'PreviewPDF_div';
|
||||
function EcmPreviewPDF(link,options) {
|
||||
if(typeof(options)!="object") options = new Object();
|
||||
if(!options.zoom) options.zoom = 100;
|
||||
if(!options.toolbar) options.toolbar = 0;
|
||||
|
||||
var div = document.getElementById(pDivName);
|
||||
if(!div) {
|
||||
div = document.createElement('div');
|
||||
div_tmp = '<div id=\'PreviewPDF_div\' style="display:none;position:absolute;left:0;top:0;background-color:#000000;width:100%;z-index:999;height:100%;background-image: url(\'include/ECM/EcmPreviewPDF/template/bar_pdf.gif\');background-repeat: repeat-x"><div style="height:23px;font-size:25px;color:white;"><div style="position:absolute;left:5;top:3;"></div><img style="position:absolute;right:2;top:0;cursor:pointer;" src="include/ECM/EcmPreviewPDF/template/x_pdf1.gif" onMouseOver="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf2.gif\';" onMouseOut="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf1.gif\';" onmousedown="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf3.gif\';" onmouseup="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf1.gif\';" onClick="HidePDF();" /></div><div id=\'PreviewPDF_div_pdf\'></div></div>';
|
||||
div.innerHTML = div_tmp;
|
||||
div = div.firstChild;
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
if(div) {
|
||||
DisplayOther(false);
|
||||
div.style.display = '';
|
||||
var div_pdf = document.getElementById('PreviewPDF_div_pdf');
|
||||
var h_pdf = (div.offsetHeight-div.firstChild.offsetHeight);
|
||||
if(div_pdf) {
|
||||
div_pdf.innerHTML = "<iframe id=\"PreviewPDF_iframe_pdf\" name=\"PreviewPDF_iframe_pdf\" style='overflow-x: hidden;border:none;width:100%;height:"+h_pdf+"px;' frameborder='no' src='"+link+"#toolbar="+options.toolbar+"&zoom="+options.zoom+"'>Yours browser not accept iframes!</iframe>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HidePDF() {
|
||||
var div = document.getElementById(pDivName);
|
||||
if(div) {
|
||||
DisplayOther(true);
|
||||
div.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function HidePDFIframe() {
|
||||
var div = parent.document.getElementById(pDivName);
|
||||
if(div) {
|
||||
DisplayOtherIframe(true);
|
||||
div.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DisplayOther(disp) {
|
||||
if(disp) display = ''; else display = 'none';
|
||||
for(var i = 0; i < document.body.childNodes.length; i++) {
|
||||
var node = document.body.childNodes[i];
|
||||
if(node && node.style) {
|
||||
if(disp) {
|
||||
if(node.setOldDisplay_pdf) {
|
||||
node.style.display = node.oldDisplay_pdf;
|
||||
node.setOldDisplay_pdf = false;
|
||||
}
|
||||
} else {
|
||||
node.oldDisplay_pdf = node.style.display;
|
||||
node.setOldDisplay_pdf = true;
|
||||
node.style.display = display;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function DisplayOtherIframe(disp) {
|
||||
if(disp) display = ''; else display = 'none';
|
||||
for(var i = 0; i < parent.document.body.childNodes.length; i++) {
|
||||
var node = parent.document.body.childNodes[i];
|
||||
if(node && node.style) {
|
||||
if(disp) {
|
||||
if(node.setOldDisplay_pdf) {
|
||||
node.style.display = node.oldDisplay_pdf;
|
||||
node.setOldDisplay_pdf = false;
|
||||
}
|
||||
} else {
|
||||
node.oldDisplay_pdf = node.style.display;
|
||||
node.setOldDisplay_pdf = true;
|
||||
node.style.display = display;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function HideMenu(){
|
||||
}
|
||||
82
include/ECM/EcmSendPdfButton/EcmSendPdfButton.js
Executable file
82
include/ECM/EcmSendPdfButton/EcmSendPdfButton.js
Executable file
@@ -0,0 +1,82 @@
|
||||
$(document).ready(function() {
|
||||
$('#addr_email').scombobox({
|
||||
fullMatch : false,
|
||||
invalidAsValue: true
|
||||
// when fullMatch is true
|
||||
// then highligh is also true by default
|
||||
});
|
||||
$('#addr_email').css('width','250px');
|
||||
$('.scombobox-display').css('width','250px');
|
||||
|
||||
});
|
||||
|
||||
var sendMailAjax = function(pdf_opt) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
params[2] = $(".scombobox-display").val();
|
||||
params[3] = $("#textarea").val();
|
||||
params[4] = pdf_opt;
|
||||
$(".loading_panel").css("display", "block");
|
||||
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmSendPdfButton',
|
||||
job : 'sendEmailAjaxWithDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
console.log(response);
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Wiadomość email została wysłana!');
|
||||
$('#sendreturn').show();
|
||||
} else {
|
||||
$('#sendreturn').html('<p style="color:red;">Wiadomość email NIE została wysłana!</p>');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
$(".loading_panel").css("display", "none");
|
||||
$('#div_send').hide();
|
||||
}
|
||||
/*
|
||||
function sendMailAjax() {
|
||||
var ajax_url = "index.php?module=EcmSales&action=javahelper&to_pdf=1";
|
||||
$(".loading_panel").css("display", "block");
|
||||
var params = {
|
||||
job : 'SendMail',
|
||||
id : id,
|
||||
modulee : modulee,
|
||||
parent_id : parent_id,
|
||||
};
|
||||
$
|
||||
.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data != '-1') {
|
||||
|
||||
$("#sendreturn").text(
|
||||
'Email z dokumentem został wysłany!');
|
||||
$("#sendreturn").show();
|
||||
} else {
|
||||
$("#sendreturn").text(
|
||||
'Email z dokumentem nie został wysłany!');
|
||||
$("#sendreturn").show();
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
$(".loading_panel").css("display", "none");
|
||||
}*/
|
||||
1118
include/ECM/SearchProductTable.js
Normal file
1118
include/ECM/SearchProductTable.js
Normal file
File diff suppressed because it is too large
Load Diff
1361
include/ECM/comboselectbox.js
Executable file
1361
include/ECM/comboselectbox.js
Executable file
File diff suppressed because it is too large
Load Diff
8
include/ECM/loadEcmJsFiles.js
Executable file
8
include/ECM/loadEcmJsFiles.js
Executable file
@@ -0,0 +1,8 @@
|
||||
var scripts = new Array();
|
||||
var jsPath = 'include/ECM/';
|
||||
scripts.push('EcmMultiPdf/EcmMultiPdf.js');
|
||||
scripts.push('EcmDropdownEditor/EcmDropdownEditor.js');
|
||||
|
||||
$.each(scripts, function(k,v) {
|
||||
$.getScript(jsPath+v, function(){});
|
||||
} );
|
||||
233
include/ECM/open_flash_chart/js/swfobject.js
Executable file
233
include/ECM/open_flash_chart/js/swfobject.js
Executable file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
|
||||
*
|
||||
* SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
*/
|
||||
if(typeof deconcept == "undefined") var deconcept = new Object();
|
||||
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
|
||||
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
|
||||
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
|
||||
if (!document.getElementById) { return; }
|
||||
this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
|
||||
this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
|
||||
this.params = new Object();
|
||||
this.variables = new Object();
|
||||
this.attributes = new Array();
|
||||
if(swf) { this.setAttribute('swf', swf); }
|
||||
if(id) { this.setAttribute('id', id); }
|
||||
if(w) { this.setAttribute('width', w); }
|
||||
if(h) { this.setAttribute('height', h); }
|
||||
if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
|
||||
this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
|
||||
if (!window.opera && document.all && this.installedVer.major > 7) {
|
||||
// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
|
||||
deconcept.SWFObject.doPrepUnload = true;
|
||||
}
|
||||
if(c) { this.addParam('bgcolor', c); }
|
||||
var q = quality ? quality : 'high';
|
||||
this.addParam('quality', q);
|
||||
this.setAttribute('useExpressInstall', false);
|
||||
this.setAttribute('doExpressInstall', false);
|
||||
var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
|
||||
this.setAttribute('xiRedirectUrl', xir);
|
||||
this.setAttribute('redirectUrl', '');
|
||||
if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
|
||||
}
|
||||
deconcept.SWFObject.prototype = {
|
||||
useExpressInstall: function(path) {
|
||||
this.xiSWFPath = !path ? "expressinstall.swf" : path;
|
||||
this.setAttribute('useExpressInstall', true);
|
||||
},
|
||||
setAttribute: function(name, value){
|
||||
this.attributes[name] = value;
|
||||
},
|
||||
getAttribute: function(name){
|
||||
return this.attributes[name];
|
||||
},
|
||||
addParam: function(name, value){
|
||||
this.params[name] = value;
|
||||
},
|
||||
getParams: function(){
|
||||
return this.params;
|
||||
},
|
||||
addVariable: function(name, value){
|
||||
this.variables[name] = value;
|
||||
},
|
||||
getVariable: function(name){
|
||||
return this.variables[name];
|
||||
},
|
||||
getVariables: function(){
|
||||
return this.variables;
|
||||
},
|
||||
getVariablePairs: function(){
|
||||
var variablePairs = new Array();
|
||||
var key;
|
||||
var variables = this.getVariables();
|
||||
for(key in variables){
|
||||
variablePairs[variablePairs.length] = key +"="+ variables[key];
|
||||
}
|
||||
return variablePairs;
|
||||
},
|
||||
getSWFHTML: function() {
|
||||
var swfNode = "";
|
||||
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
|
||||
if (this.getAttribute("doExpressInstall")) {
|
||||
this.addVariable("MMplayerType", "PlugIn");
|
||||
this.setAttribute('swf', this.xiSWFPath);
|
||||
}
|
||||
swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
|
||||
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
|
||||
var params = this.getParams();
|
||||
for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
|
||||
var pairs = this.getVariablePairs().join("&");
|
||||
if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
|
||||
swfNode += '/>';
|
||||
} else { // PC IE
|
||||
if (this.getAttribute("doExpressInstall")) {
|
||||
this.addVariable("MMplayerType", "ActiveX");
|
||||
this.setAttribute('swf', this.xiSWFPath);
|
||||
}
|
||||
swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
|
||||
swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
|
||||
var params = this.getParams();
|
||||
for(var key in params) {
|
||||
swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
|
||||
}
|
||||
var pairs = this.getVariablePairs().join("&");
|
||||
if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
|
||||
swfNode += "</object>";
|
||||
}
|
||||
return swfNode;
|
||||
},
|
||||
write: function(elementId){
|
||||
if(this.getAttribute('useExpressInstall')) {
|
||||
// check to see if we need to do an express install
|
||||
var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
|
||||
if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
|
||||
this.setAttribute('doExpressInstall', true);
|
||||
this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
|
||||
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
|
||||
this.addVariable("MMdoctitle", document.title);
|
||||
}
|
||||
}
|
||||
if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
|
||||
var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
|
||||
n.innerHTML = this.getSWFHTML();
|
||||
return true;
|
||||
}else{
|
||||
if(this.getAttribute('redirectUrl') != "") {
|
||||
document.location.replace(this.getAttribute('redirectUrl'));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- detection functions ---- */
|
||||
deconcept.SWFObjectUtil.getPlayerVersion = function(){
|
||||
var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
|
||||
if(navigator.plugins && navigator.mimeTypes.length){
|
||||
var x = navigator.plugins["Shockwave Flash"];
|
||||
if(x && x.description) {
|
||||
PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
|
||||
}
|
||||
}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
|
||||
var axo = 1;
|
||||
var counter = 3;
|
||||
while(axo) {
|
||||
try {
|
||||
counter++;
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
|
||||
// document.write("player v: "+ counter);
|
||||
PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
|
||||
} catch (e) {
|
||||
axo = null;
|
||||
}
|
||||
}
|
||||
} else { // Win IE (non mobile)
|
||||
// do minor version lookup in IE, but avoid fp6 crashing issues
|
||||
// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
|
||||
try{
|
||||
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
}catch(e){
|
||||
try {
|
||||
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
|
||||
axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
|
||||
} catch(e) {
|
||||
if (PlayerVersion.major == 6) {
|
||||
return PlayerVersion;
|
||||
}
|
||||
}
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
} catch(e) {}
|
||||
}
|
||||
if (axo != null) {
|
||||
PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
|
||||
}
|
||||
}
|
||||
return PlayerVersion;
|
||||
}
|
||||
deconcept.PlayerVersion = function(arrVersion){
|
||||
this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
|
||||
this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
|
||||
this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
|
||||
}
|
||||
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
|
||||
if(this.major < fv.major) return false;
|
||||
if(this.major > fv.major) return true;
|
||||
if(this.minor < fv.minor) return false;
|
||||
if(this.minor > fv.minor) return true;
|
||||
if(this.rev < fv.rev) return false;
|
||||
return true;
|
||||
}
|
||||
/* ---- get value of query string param ---- */
|
||||
deconcept.util = {
|
||||
getRequestParameter: function(param) {
|
||||
var q = document.location.search || document.location.hash;
|
||||
if (param == null) { return q; }
|
||||
if(q) {
|
||||
var pairs = q.substring(1).split("&");
|
||||
for (var i=0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return pairs[i].substring((pairs[i].indexOf("=")+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
/* fix for video streaming bug */
|
||||
deconcept.SWFObjectUtil.cleanupSWFs = function() {
|
||||
var objects = document.getElementsByTagName("OBJECT");
|
||||
for (var i = objects.length - 1; i >= 0; i--) {
|
||||
objects[i].style.display = 'none';
|
||||
for (var x in objects[i]) {
|
||||
if (typeof objects[i][x] == 'function') {
|
||||
objects[i][x] = function(){};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
|
||||
if (deconcept.SWFObject.doPrepUnload) {
|
||||
if (!deconcept.unloadSet) {
|
||||
deconcept.SWFObjectUtil.prepUnload = function() {
|
||||
__flash_unloadHandler = function(){};
|
||||
__flash_savedUnloadHandler = function(){};
|
||||
window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
|
||||
}
|
||||
window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
|
||||
deconcept.unloadSet = true;
|
||||
}
|
||||
}
|
||||
/* add document.getElementById if needed (mobile IE < 5) */
|
||||
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
|
||||
|
||||
/* add some aliases for ease of use/backwards compatibility */
|
||||
var getQueryParamValue = deconcept.util.getRequestParameter;
|
||||
var FlashObject = deconcept.SWFObject; // for legacy support
|
||||
var SWFObject = deconcept.SWFObject;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
38
include/ECM/open_flash_chart2/js-ofc-library/ofc.js
Executable file
38
include/ECM/open_flash_chart2/js-ofc-library/ofc.js
Executable file
@@ -0,0 +1,38 @@
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param index as integer.
|
||||
*
|
||||
* Returns a CLONE of the chart with one of the elements removed
|
||||
*/
|
||||
function chart_remove_element(chart, index)
|
||||
{
|
||||
|
||||
// global_showing_old_data = !global_showing_old_data;
|
||||
|
||||
// clone the chart
|
||||
var modified_chart = {};
|
||||
jQuery.extend(modified_chart, chart);
|
||||
|
||||
// remove the old data from the chart:
|
||||
var element = modified_chart.elements[1];
|
||||
var elements = new Array();
|
||||
var c=0;
|
||||
for(i=0; i<modified_chart.elements.length; i++)
|
||||
{
|
||||
if(i!=index)
|
||||
{
|
||||
elements[c] = modified_chart.elements[i];
|
||||
c++;
|
||||
}
|
||||
}
|
||||
modified_chart.elements = elements;
|
||||
return modified_chart;
|
||||
}
|
||||
271
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.js
Executable file
271
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.js
Executable file
@@ -0,0 +1,271 @@
|
||||
function ofc_chart() {
|
||||
this.elements = [];
|
||||
|
||||
this.set_title = function(title) {
|
||||
this.title = title;
|
||||
};
|
||||
this.add_element = function(new_element) {
|
||||
this.elements.push(new_element);
|
||||
};
|
||||
|
||||
this.set_x_axis = function(axis) {
|
||||
this.x_axis = axis;
|
||||
};
|
||||
|
||||
this.set_y_axis = function(axis) {
|
||||
this.y_axis = axis;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_element(type) {
|
||||
this.type = type;
|
||||
this.values = [];
|
||||
|
||||
this.set_values = function(values) {
|
||||
this.values = values;
|
||||
};
|
||||
|
||||
this.set_key = function(text, size) {
|
||||
this.text = text;
|
||||
this['font-size'] = size;
|
||||
};
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_line() {
|
||||
ofc_element.apply(this, ['line']);
|
||||
}
|
||||
ofc_line.prototype = new ofc_element();
|
||||
|
||||
function ofc_bar() {
|
||||
ofc_element.apply(this, ['bar']);
|
||||
}
|
||||
ofc_bar.prototype = new ofc_element();
|
||||
|
||||
function ofc_scatter(colour) {
|
||||
ofc_element.apply(this, ['scatter']);
|
||||
this.set_colour(colour);
|
||||
|
||||
this.set_default_dot_style = function(dot_style) {
|
||||
this['dot-style'] = dot_style;
|
||||
};
|
||||
}
|
||||
ofc_scatter.prototype = new ofc_element();
|
||||
|
||||
function ofc_scatter_line(colour) {
|
||||
ofc_element.apply(this, ['scatter_line']);
|
||||
this.set_colour(colour);
|
||||
|
||||
this.set_default_dot_style = function(dot_style) {
|
||||
this['dot-style'] = dot_style;
|
||||
};
|
||||
|
||||
this.set_step_horizontal = function() {
|
||||
this.stepgraph = 'horizontal';
|
||||
};
|
||||
|
||||
this.set_step_vertical = function() {
|
||||
this.stepgraph = 'vertical';
|
||||
};
|
||||
}
|
||||
ofc_scatter_line.prototype = new ofc_element();
|
||||
|
||||
function ofc_title(text, style) {
|
||||
this.text = text;
|
||||
this.style = style;
|
||||
}
|
||||
|
||||
function ofc_axis() {
|
||||
this.set_range = function(min, max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
};
|
||||
|
||||
this.set_steps = function(steps) {
|
||||
this.steps = steps;
|
||||
};
|
||||
|
||||
this.set_stroke = function(stroke) {
|
||||
this.stroke = stroke;
|
||||
};
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
|
||||
this.set_grid_colour = function(grid_colour) {
|
||||
this['grid-colour'] = grid_colour;
|
||||
};
|
||||
|
||||
this.set_offset = function(offset) {
|
||||
this.offset = offset;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_x_axis() {
|
||||
this.set_tick_height = function(tick_height) {
|
||||
this['tick-height'] = tick_height;
|
||||
};
|
||||
|
||||
this.set_3d = function(threeD) {
|
||||
this['3d'] = threeD;
|
||||
};
|
||||
}
|
||||
ofc_x_axis.prototype = new ofc_axis();
|
||||
|
||||
function ofc_y_axis() {
|
||||
this.set_tick_length = function(tick_length) {
|
||||
this['tick-length'] = tick_length;
|
||||
};
|
||||
|
||||
this.set_grid_visible = function(grid_visible) {
|
||||
this['grid-visible'] = grid_visible;
|
||||
};
|
||||
|
||||
this.set_visible = function(visible) {
|
||||
this.visible = visible;
|
||||
};
|
||||
}
|
||||
ofc_y_axis.prototype = new ofc_axis();
|
||||
|
||||
function ofc_scatter_value(xVal, yVal, dot_size) {
|
||||
this.x = xVal || 0;
|
||||
this.y = yVal || 0;
|
||||
this['dot-size'] = dot_size;
|
||||
}
|
||||
|
||||
function ofc_dot_base(type, value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
|
||||
this.position = function position(xVal, yVal) {
|
||||
this.x = xVal;
|
||||
this.y = yVal;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_dot(value) {
|
||||
ofc_dot_base.apply(this, ['dot', value]);
|
||||
}
|
||||
ofc_dot.prototype = new ofc_dot();
|
||||
|
||||
function ofc_hollow_dot(value) {
|
||||
ofc_dot_base.apply(this, ['hollow-dot', value]);
|
||||
}
|
||||
ofc_hollow_dot.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_solid_dot(value) {
|
||||
ofc_dot_base.apply(this, ['solid-dot', value]);
|
||||
}
|
||||
ofc_solid_dot.prototype = new ofc_dot();
|
||||
|
||||
function ofc_star(value) {
|
||||
ofc_dot_base.apply(this, ['star', value]);
|
||||
}
|
||||
ofc_star.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_bow(value) {
|
||||
ofc_dot_base.apply(this, ['bow', value]);
|
||||
}
|
||||
ofc_bow.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_anchor(value) {
|
||||
ofc_dot_base.apply(this, ['anchor', value]);
|
||||
}
|
||||
ofc_anchor.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_pie() {
|
||||
ofc_element.apply(this, ['pie']);
|
||||
|
||||
this.add_animation = function(animation) {
|
||||
if (!this.animate) {
|
||||
this.animate = [];
|
||||
}
|
||||
this.animate.push(animation);
|
||||
};
|
||||
|
||||
this.set_alpha = function(alpha) {
|
||||
this.alpha = alpha;
|
||||
};
|
||||
|
||||
this.set_colours = function(colours) {
|
||||
this.colours = colours;
|
||||
};
|
||||
|
||||
this.set_start_angle = function(start_angle) {
|
||||
this['start-angle'] = start_angle;
|
||||
};
|
||||
|
||||
this.set_tooltip = function(tip) {
|
||||
this.tip = tip;
|
||||
};
|
||||
|
||||
this.set_gradient_fill = function() {
|
||||
this['gradient-fill'] = true;
|
||||
};
|
||||
|
||||
this.set_label_colour = function (label_colour) {
|
||||
this['label-colour'] = label_colour;
|
||||
};
|
||||
|
||||
this.set_no_labels = function() {
|
||||
this['no-labels'] = true;
|
||||
};
|
||||
|
||||
this.on_click = function(event) {
|
||||
this['on-click'] = event;
|
||||
};
|
||||
|
||||
this.radius = function(radius) {
|
||||
this.radius = radius;
|
||||
};
|
||||
}
|
||||
ofc_pie.prototype = new ofc_element();
|
||||
|
||||
function ofc_pie_value(value, label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
|
||||
this.set_label = function(label, label_colour, font_size) {
|
||||
this.label = label;
|
||||
this['label-colour'] = label_colour;
|
||||
this['font-size'] = font_size;
|
||||
};
|
||||
|
||||
this.set_tooltip = function(tip) {
|
||||
this.tip = tip;
|
||||
};
|
||||
|
||||
this.on_click = function(event) {
|
||||
this['on-click'] = event;
|
||||
};
|
||||
|
||||
this.add_animation = function(animation) {
|
||||
if (!this.animate) {
|
||||
this.animate = [];
|
||||
}
|
||||
this.animate.push(animation);
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_base_pie_animation(type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
function ofc_pie_fade() {
|
||||
ofc_base_pie_animation.apply(this, ['fade']);
|
||||
}
|
||||
ofc_pie_fade.prototype = new ofc_base_pie_animation();
|
||||
|
||||
function ofc_pie_bounce(distance) {
|
||||
ofc_base_pie_animation.apply(this, ['bounce']);
|
||||
this.distance = distance;
|
||||
}
|
||||
ofc_pie_bounce.prototype = new ofc_base_pie_animation();
|
||||
1
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.min.js
vendored
Executable file
1
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
function ofc_chart(){this.elements=[];this.set_title=function(a){this.title=a};this.add_element=function(a){this.elements.push(a)};this.set_x_axis=function(a){this.x_axis=a};this.set_y_axis=function(a){this.y_axis=a}}function ofc_element(a){this.type=a;this.values=[];this.set_values=function(b){this.values=b};this.set_key=function(c,b){this.text=c;this["font-size"]=b};this.set_colour=function(b){this.colour=b}}function ofc_line(){ofc_element.apply(this,["line"])}ofc_line.prototype=new ofc_element();function ofc_bar(){ofc_element.apply(this,["bar"])}ofc_bar.prototype=new ofc_element();function ofc_scatter(a){ofc_element.apply(this,["scatter"]);this.set_colour(a);this.set_default_dot_style=function(b){this["dot-style"]=b}}ofc_scatter.prototype=new ofc_element();function ofc_scatter_line(a){ofc_element.apply(this,["scatter_line"]);this.set_colour(a);this.set_default_dot_style=function(b){this["dot-style"]=b};this.set_step_horizontal=function(){this.stepgraph="horizontal"};this.set_step_vertical=function(){this.stepgraph="vertical"}}ofc_scatter_line.prototype=new ofc_element();function ofc_title(b,a){this.text=b;this.style=a}function ofc_axis(){this.set_range=function(b,a){this.min=b;this.max=a};this.set_steps=function(a){this.steps=a};this.set_stroke=function(a){this.stroke=a};this.set_colour=function(a){this.colour=a};this.set_grid_colour=function(a){this["grid-colour"]=a};this.set_offset=function(a){this.offset=a}}function ofc_x_axis(){this.set_tick_height=function(a){this["tick-height"]=a};this.set_3d=function(a){this["3d"]=a}}ofc_x_axis.prototype=new ofc_axis();function ofc_y_axis(){this.set_tick_length=function(a){this["tick-length"]=a};this.set_grid_visible=function(a){this["grid-visible"]=a};this.set_visible=function(a){this.visible=a}}ofc_y_axis.prototype=new ofc_axis();function ofc_scatter_value(b,a,c){this.x=b||0;this.y=a||0;this["dot-size"]=c}function ofc_dot_base(b,c){this.type=b;this.value=c;this.position=function a(e,d){this.x=e;this.y=d}}function ofc_dot(a){ofc_dot_base.apply(this,["dot",a])}ofc_dot.prototype=new ofc_dot();function ofc_hollow_dot(a){ofc_dot_base.apply(this,["hollow-dot",a])}ofc_hollow_dot.prototype=new ofc_dot_base();function ofc_solid_dot(a){ofc_dot_base.apply(this,["solid-dot",a])}ofc_solid_dot.prototype=new ofc_dot();function ofc_star(a){ofc_dot_base.apply(this,["star",a])}ofc_star.prototype=new ofc_dot_base();function ofc_bow(a){ofc_dot_base.apply(this,["bow",a])}ofc_bow.prototype=new ofc_dot_base();function ofc_anchor(a){ofc_dot_base.apply(this,["anchor",a])}ofc_anchor.prototype=new ofc_dot_base();function ofc_pie(){ofc_element.apply(this,["pie"]);this.add_animation=function(a){if(!this.animate){this.animate=[]}this.animate.push(a)};this.set_alpha=function(a){this.alpha=a};this.set_colours=function(a){this.colours=a};this.set_start_angle=function(a){this["start-angle"]=a};this.set_tooltip=function(a){this.tip=a};this.set_gradient_fill=function(){this["gradient-fill"]=true};this.set_label_colour=function(a){this["label-colour"]=a};this.set_no_labels=function(){this["no-labels"]=true};this.on_click=function(a){this["on-click"]=a};this.radius=function(a){this.radius=a}}ofc_pie.prototype=new ofc_element();function ofc_pie_value(b,a){this.value=b;this.label=a;this.set_colour=function(c){this.colour=c};this.set_label=function(e,d,c){this.label=e;this["label-colour"]=d;this["font-size"]=c};this.set_tooltip=function(c){this.tip=c};this.on_click=function(c){this["on-click"]=c};this.add_animation=function(c){if(!this.animate){this.animate=[]}this.animate.push(c)}}function ofc_base_pie_animation(a){this.type=a}function ofc_pie_fade(){ofc_base_pie_animation.apply(this,["fade"])}ofc_pie_fade.prototype=new ofc_base_pie_animation();function ofc_pie_bounce(a){ofc_base_pie_animation.apply(this,["bounce"]);this.distance=a}ofc_pie_bounce.prototype=new ofc_base_pie_animation();
|
||||
461
include/ECM/open_flash_chart2/js/json/json2.js
Executable file
461
include/ECM/open_flash_chart2/js/json/json2.js
Executable file
@@ -0,0 +1,461 @@
|
||||
/*
|
||||
http://www.JSON.org/json2.js
|
||||
2008-03-24
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
This file creates a global JSON object containing three methods: stringify,
|
||||
parse, and quote.
|
||||
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects without a toJSON
|
||||
method. It can be a function or an array.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t'), it contains the
|
||||
characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method will
|
||||
be passed the key associated with the value, and this will be bound
|
||||
to the object holding the key.
|
||||
|
||||
This is the toJSON method added to Dates:
|
||||
|
||||
function toJSON(key) {
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
}
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If no replacer parameter is provided, then a default replacer
|
||||
will be used:
|
||||
|
||||
function replacer(key, value) {
|
||||
return Object.hasOwnProperty.call(this, key) ?
|
||||
value : undefined;
|
||||
}
|
||||
|
||||
The default replacer is passed the key and value for each item in
|
||||
the structure. It excludes inherited members.
|
||||
|
||||
If the replacer parameter is an array, then it will be used to
|
||||
select the members to be serialized. It filters the results such
|
||||
that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representaions, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the value
|
||||
that is filled with line breaks and indentation to make it easier to
|
||||
read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
then indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
JSON.quote(text)
|
||||
This method wraps a string in quotes, escaping some characters
|
||||
as needed.
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
|
||||
CODE INTO YOUR PAGES.
|
||||
*/
|
||||
|
||||
/*jslint regexp: true, forin: true, evil: true */
|
||||
|
||||
/*global JSON */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
|
||||
parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
|
||||
test, toJSON, toString
|
||||
*/
|
||||
|
||||
if (!this.JSON) {
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// object in a closure to avoid global variables.
|
||||
|
||||
JSON = function () {
|
||||
|
||||
function f(n) { // Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
// Eventually, this method will be based on the date.toISOString method.
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
|
||||
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
return escapeable.test(string) ?
|
||||
'"' + string.replace(escapeable, function (a) {
|
||||
var c = meta[a];
|
||||
if (typeof c === 'string') {
|
||||
return c;
|
||||
}
|
||||
c = a.charCodeAt();
|
||||
return '\\u00' + Math.floor(c / 16).toString(16) +
|
||||
(c % 16).toString(16);
|
||||
}) + '"' :
|
||||
'"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// If the object has a dontEnum length property, we'll treat it as an array.
|
||||
|
||||
if (typeof value.length === 'number' &&
|
||||
!(value.propertyIsEnumerable('length'))) {
|
||||
|
||||
// The object is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0 ? '[]' :
|
||||
gap ? '[\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + ']' :
|
||||
'[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
k = rep[i];
|
||||
if (typeof k === 'string') {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0 ? '{}' :
|
||||
gap ? '{\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + '}' :
|
||||
'{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return the JSON object containing the stringify, parse, and quote methods.
|
||||
|
||||
return {
|
||||
stringify: function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (space) {
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no replacer parameter, use the default replacer.
|
||||
|
||||
if (!replacer) {
|
||||
rep = function (key, value) {
|
||||
if (!Object.hasOwnProperty.call(this, key)) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
// The replacer can be a function or an array. Otherwise, throw an error.
|
||||
|
||||
} else if (typeof replacer === 'function' ||
|
||||
(typeof replacer === 'object' &&
|
||||
typeof replacer.length === 'number')) {
|
||||
rep = replacer;
|
||||
} else {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
},
|
||||
|
||||
|
||||
parse: function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in three stages. In the first stage, we run the text against
|
||||
// regular expressions that look for non-JSON patterns. We are especially
|
||||
// concerned with '()' and 'new' because they can cause invocation, and '='
|
||||
// because it can cause mutation. But just to be safe, we want to reject all
|
||||
// unexpected forms.
|
||||
|
||||
// We split the first stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the second stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional third stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function' ?
|
||||
walk({'': j}, '') : j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
},
|
||||
|
||||
quote: quote
|
||||
};
|
||||
}();
|
||||
}
|
||||
5
include/ECM/open_flash_chart2/js/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/js/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
32
include/ECM/open_flash_chart2/perl-ofc-library/jquery-1.2.6.min.js
vendored
Executable file
32
include/ECM/open_flash_chart2/perl-ofc-library/jquery-1.2.6.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
461
include/ECM/open_flash_chart2/perl-ofc-library/json/json2.js
Executable file
461
include/ECM/open_flash_chart2/perl-ofc-library/json/json2.js
Executable file
@@ -0,0 +1,461 @@
|
||||
/*
|
||||
http://www.JSON.org/json2.js
|
||||
2008-03-24
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
This file creates a global JSON object containing three methods: stringify,
|
||||
parse, and quote.
|
||||
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects without a toJSON
|
||||
method. It can be a function or an array.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t'), it contains the
|
||||
characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method will
|
||||
be passed the key associated with the value, and this will be bound
|
||||
to the object holding the key.
|
||||
|
||||
This is the toJSON method added to Dates:
|
||||
|
||||
function toJSON(key) {
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
}
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If no replacer parameter is provided, then a default replacer
|
||||
will be used:
|
||||
|
||||
function replacer(key, value) {
|
||||
return Object.hasOwnProperty.call(this, key) ?
|
||||
value : undefined;
|
||||
}
|
||||
|
||||
The default replacer is passed the key and value for each item in
|
||||
the structure. It excludes inherited members.
|
||||
|
||||
If the replacer parameter is an array, then it will be used to
|
||||
select the members to be serialized. It filters the results such
|
||||
that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representaions, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the value
|
||||
that is filled with line breaks and indentation to make it easier to
|
||||
read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
then indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
JSON.quote(text)
|
||||
This method wraps a string in quotes, escaping some characters
|
||||
as needed.
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
|
||||
CODE INTO YOUR PAGES.
|
||||
*/
|
||||
|
||||
/*jslint regexp: true, forin: true, evil: true */
|
||||
|
||||
/*global JSON */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
|
||||
parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
|
||||
test, toJSON, toString
|
||||
*/
|
||||
|
||||
if (!this.JSON) {
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// object in a closure to avoid global variables.
|
||||
|
||||
JSON = function () {
|
||||
|
||||
function f(n) { // Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
// Eventually, this method will be based on the date.toISOString method.
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
|
||||
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
return escapeable.test(string) ?
|
||||
'"' + string.replace(escapeable, function (a) {
|
||||
var c = meta[a];
|
||||
if (typeof c === 'string') {
|
||||
return c;
|
||||
}
|
||||
c = a.charCodeAt();
|
||||
return '\\u00' + Math.floor(c / 16).toString(16) +
|
||||
(c % 16).toString(16);
|
||||
}) + '"' :
|
||||
'"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// If the object has a dontEnum length property, we'll treat it as an array.
|
||||
|
||||
if (typeof value.length === 'number' &&
|
||||
!(value.propertyIsEnumerable('length'))) {
|
||||
|
||||
// The object is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0 ? '[]' :
|
||||
gap ? '[\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + ']' :
|
||||
'[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
k = rep[i];
|
||||
if (typeof k === 'string') {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0 ? '{}' :
|
||||
gap ? '{\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + '}' :
|
||||
'{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return the JSON object containing the stringify, parse, and quote methods.
|
||||
|
||||
return {
|
||||
stringify: function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (space) {
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no replacer parameter, use the default replacer.
|
||||
|
||||
if (!replacer) {
|
||||
rep = function (key, value) {
|
||||
if (!Object.hasOwnProperty.call(this, key)) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
// The replacer can be a function or an array. Otherwise, throw an error.
|
||||
|
||||
} else if (typeof replacer === 'function' ||
|
||||
(typeof replacer === 'object' &&
|
||||
typeof replacer.length === 'number')) {
|
||||
rep = replacer;
|
||||
} else {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
},
|
||||
|
||||
|
||||
parse: function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in three stages. In the first stage, we run the text against
|
||||
// regular expressions that look for non-JSON patterns. We are especially
|
||||
// concerned with '()' and 'new' because they can cause invocation, and '='
|
||||
// because it can cause mutation. But just to be safe, we want to reject all
|
||||
// unexpected forms.
|
||||
|
||||
// We split the first stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the second stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional third stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function' ?
|
||||
walk({'': j}, '') : j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
},
|
||||
|
||||
quote: quote
|
||||
};
|
||||
}();
|
||||
}
|
||||
5
include/ECM/open_flash_chart2/perl-ofc-library/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/perl-ofc-library/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
5
include/ECM/open_flash_chart2/python-ofc-library/static/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/python-ofc-library/static/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
9
include/ECM/stopEnter.js
Executable file
9
include/ECM/stopEnter.js
Executable file
@@ -0,0 +1,9 @@
|
||||
//MZ 2013-02-23
|
||||
//disable ENTER on EditView forms
|
||||
function stopRKey(evt) {
|
||||
var evt = (evt) ? evt : ((event) ? event : null);
|
||||
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
|
||||
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
|
||||
}
|
||||
console.log('chce');
|
||||
document.onkeypress = stopRKey;
|
||||
73
include/ECM/tablenavigator.js
Executable file
73
include/ECM/tablenavigator.js
Executable file
@@ -0,0 +1,73 @@
|
||||
(function ($) {
|
||||
$.fn.enableCellNavigation = function () {
|
||||
|
||||
var arrow = { left: 37, up: 38, right: 39, down: 40 };
|
||||
|
||||
// select all on focus
|
||||
this.find('input').keydown(function (e) {
|
||||
|
||||
// shortcut for key other than arrow keys
|
||||
if ($.inArray(e.which, [arrow.left, arrow.up, arrow.right, arrow.down]) < 0) { return; }
|
||||
|
||||
var input = e.target;
|
||||
var td = $(e.target).closest('td');
|
||||
var moveTo = null;
|
||||
|
||||
switch (e.which) {
|
||||
|
||||
case arrow.left: {
|
||||
if (input.selectionStart == 0) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveTo = td.prev('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case arrow.right: {
|
||||
if (input.selectionEnd == input.value.length) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveTo = td.next('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case arrow.up:
|
||||
case arrow.down: {
|
||||
|
||||
var tr = td.closest('tr');
|
||||
var pos = td[0].cellIndex;
|
||||
|
||||
var moveToRow = null;
|
||||
if (e.which == arrow.down) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveToRow = tr.next('tr');
|
||||
}
|
||||
else if (e.which == arrow.up) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveToRow = tr.prev('tr');
|
||||
}
|
||||
|
||||
if (moveToRow.length) {
|
||||
moveTo = $(moveToRow[0].cells[pos]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
//sprawdza czy wyswietla sie pole autocomplete, jeśli tak to blokuje poruszanie po tabelce
|
||||
if (moveTo && moveTo.length && $myDiv.css('display') != 'block') {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
moveTo.find('input,textarea').each(function (i, input) {
|
||||
input.focus();
|
||||
input.select();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user