Browse Source

Changed Commands Queue

master
Evgeny Gagua 5 years ago
parent
commit
e2e16483c7
  1. 3
      lib/ajax_asm.php
  2. 134
      lib/controller/AddCameraNode.php
  3. 46
      lib/controller/addDetectionProfile.php
  4. 52
      lib/controller/addNetworkNode.php
  5. 38
      lib/controller/camMakeMove.php
  6. 22
      lib/controller/camStop.php
  7. 43
      lib/controller/dash/node_0.js
  8. 28
      lib/controller/dash/node_10.js
  9. 78
      lib/controller/dash/node_13.js
  10. 7
      lib/controller/dash/node_3.js
  11. 36
      lib/controller/doDeviceOperation.php
  12. 47
      lib/controller/getDashBoardItems.php
  13. 30
      lib/controller/getDetectionProfile.php
  14. 348
      lib/controller/getDeviceDraw.php
  15. 53
      lib/controller/getNetwork.php
  16. 201
      lib/controller/getNetworkServerProps.php
  17. 33
      lib/controller/getNodeAdvancedNfo.php
  18. 31
      lib/controller/getNodeBasicNfo.php
  19. 31
      lib/controller/getResourceInfo.php
  20. 16
      lib/controller/getSiteStatus.php
  21. 140
      lib/controller/getStatus.php
  22. 9
      lib/controller/listServerLog.php
  23. 42
      lib/controller/props/0_node_prop.js
  24. 137
      lib/controller/resetAllSettings.php
  25. 37
      lib/controller/validateNode.php
  26. 45
      lib/defines.php
  27. 2
      lib/javascript/howler/howler.core.min.js
  28. 3242
      lib/javascript/howler/howler.js
  29. 4
      lib/javascript/howler/howler.min.js
  30. 2
      lib/javascript/howler/howler.spatial.min.js
  31. 144
      lib/javascript/jsapi_dynamic/rgoose_camera_editor.js
  32. 632
      lib/javascript/jsapi_dynamic/rgoose_dashboard.js
  33. 371
      lib/javascript/jsapi_dynamic/rgoose_devices_module.js
  34. 36
      lib/javascript/jsapi_dynamic/rgoose_logs.js
  35. 154
      lib/javascript/jsapi_dynamic/rgoose_main.js
  36. 75
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  37. 36
      lib/javascript/jsapi_dynamic/rgoose_timeline.js
  38. 0
      lib/javascript/leaflet/images/layers-2x.png
  39. 0
      lib/javascript/leaflet/images/layers.png
  40. 0
      lib/javascript/leaflet/images/marker-icon-2x.png
  41. 0
      lib/javascript/leaflet/images/marker-icon.png
  42. 0
      lib/javascript/leaflet/images/marker-shadow.png
  43. 13
      lib/javascript/pnotyfy/Angeler.css
  44. 13
      lib/javascript/pnotyfy/BrightTheme.css
  45. 1
      lib/javascript/pnotyfy/Material.css
  46. 1
      lib/javascript/pnotyfy/PNotify.css
  47. 5269
      lib/javascript/pnotyfy/PNotify.js
  48. 612
      lib/javascript/pnotyfy/PNotifyAnimate.js
  49. 1
      lib/javascript/pnotyfy/PNotifyBootstrap4.css
  50. 471
      lib/javascript/pnotyfy/PNotifyBootstrap4.js
  51. 1
      lib/javascript/pnotyfy/PNotifyConfirm.css
  52. 1306
      lib/javascript/pnotyfy/PNotifyConfirm.js
  53. 1
      lib/javascript/pnotyfy/PNotifyCountdown.css
  54. 74
      lib/javascript/pnotyfy/PNotifyCountdown.js
  55. 1
      lib/javascript/pnotyfy/PNotifyDesktop.css
  56. 700
      lib/javascript/pnotyfy/PNotifyDesktop.js
  57. 471
      lib/javascript/pnotyfy/PNotifyFontAwesome5.js
  58. 548
      lib/javascript/pnotyfy/PNotifyFontAwesome5Fix.js
  59. 1
      lib/javascript/pnotyfy/PNotifyMobile.css
  60. 657
      lib/javascript/pnotyfy/PNotifyMobile.js
  61. 1
      lib/javascript/pnotyfy/PNotifyPaginate.css
  62. 89
      lib/javascript/pnotyfy/PNotifyPaginate.js
  63. 1
      lib/javascript/pnotyfy/PNotifyReference.css
  64. 75
      lib/javascript/pnotyfy/PNotifyReference.js
  65. 57
      lib/php/argus/argus.php
  66. 14
      lib/php/onvif/test_v11.php
  67. 16
      lib/php/onvif/toto.php
  68. 28
      lib/php/ui/UI_functions.php
  69. BIN
      style/assets/audio/beep-07a.mp3
  70. BIN
      style/assets/audio/beep-07a.wav
  71. BIN
      style/assets/audio/beep-08b.mp3
  72. BIN
      style/assets/audio/beep-08b.wav
  73. BIN
      style/assets/audio/beep-09.mp3
  74. BIN
      style/assets/audio/beep-09.wav
  75. BIN
      style/assets/audio/beep-10.mp3
  76. BIN
      style/assets/audio/beep-10.wav
  77. BIN
      style/assets/audio/beep-21.mp3
  78. BIN
      style/assets/audio/beep-21.wav
  79. BIN
      style/assets/audio/beep-23.mp3
  80. BIN
      style/assets/audio/beep-23.wav
  81. BIN
      style/assets/audio/beep-24.mp3
  82. BIN
      style/assets/audio/beep-24.wav
  83. BIN
      style/assets/audio/beep-25.mp3
  84. BIN
      style/assets/audio/beep-25.wav
  85. BIN
      style/assets/audio/beep-26.mp3
  86. BIN
      style/assets/audio/beep-26.wav
  87. BIN
      style/assets/audio/beep-28.mp3
  88. BIN
      style/assets/audio/beep-28.wav
  89. BIN
      style/assets/audio/beep-29.mp3
  90. BIN
      style/assets/audio/beep-29.wav
  91. BIN
      style/assets/audio/beep-30b.mp3
  92. BIN
      style/assets/audio/beep-30b.wav
  93. BIN
      style/assets/audio/button-15.mp3
  94. BIN
      style/assets/audio/button-15.wav
  95. BIN
      style/assets/audio/button-16.mp3
  96. BIN
      style/assets/audio/button-16.wav
  97. BIN
      style/assets/audio/button-17.mp3
  98. BIN
      style/assets/audio/button-17.wav
  99. BIN
      style/assets/audio/button-38.mp3
  100. BIN
      style/assets/audio/button-38.wav

3
lib/ajax_asm.php

@ -24,8 +24,7 @@ require_once('php/db/user_class.php');
require_once('php/auth/web.php');
require_once('php/db/language_class.php');
require_once('php/sys/r-goose_sys.php');
//require_once('php/ui/UI_functions.php');
//require_once('php/web/WEB_functions.php');
require_once('php/argus/argus.php');

134
lib/controller/AddCameraNode.php

@ -1,60 +1,90 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SiteID = intval($_POST['NID']);
$CamID = intval($_POST['CID']);
$PTZ = intval($_POST['PTZ']);
$UART = intval($_POST['UART']);
$FMIN = floatval($_POST['FMIN']);
$FMAX = floatval($_POST['FMAX']);
$IMSIZE = intval($_POST['IMSIZE']);
$TILTMODE = intval($_POST['TILTMODE']);
$PANMODE = intval($_POST['PANMODE']);
$PANANG = floatval( $_POST['PANANG']);
$TILTANG = floatval( $_POST['TILTANG']);
$PROTOID = intval( $_POST['PROTOID'] );
$Data = array();
if( $CamID ){
if( $PTZ > 0 ){
if( isset( $_POST['LAB'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['LAB'] );
} else {
$CAM_NAM = 'New PTZ IP Camera';
};
$CCTYPE = ARGUS_IP_PTZ_CAMERA;
} else {
if( isset( $_POST['LAB'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['LAB'] );
} else {
$CAM_NAM = 'New IP Camera';
};
$CCTYPE = ARGUS_IP_STATIC_CAMERA;
};
$QS = "INSERT INTO nodes SET site_id={$SiteID},type={$CCTYPE},aux_id={$CamID},name='{$CAM_NAM}'";
$DATABASE->Query( $QS, false );
$NodeID = $DATABASE->getLastInsertID();
if( $NodeID > 0 ){
$QS = "SELECT * FROM media_streams WHERE source_id={$CamID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
foreach( $result as $r ){
$MD5 = md5( $NodeID . "_" . $r['id'] . "_DM" );
$QS = "INSERT INTO sockets SET node_id={$NodeID}, aux_id={$r['id']}, `type`=6, md5='{$MD5}', multidrop=0, mode=2, binded=0, `name`='IPV [{$r['img_width']}x{$r['img_height']}]'";
$DATABASE->Query( $QS, false );
};
};
if( intval($_POST['PTZ']) > 0 ){
$MD5 = md5( $NodeID . "_" . $CamID . "_CTRL" );
switch( $_POST['PTZ'] ){
case 3: $TY = ARGUS_NODE_SOCK_TYPE_NETWORK; break;
default: $TY = ARGUS_NODE_SOCK_TYPE_SERIAL_PORT; break;
if( $CUser->Data['access'] > 5 ){
$Data = array();
if(isset($_POST['SITEID'])) $SiteID = intval($_POST['SITEID']); else $SiteID = 0;
if(isset($_POST['CID'])) $CamID = intval($_POST['CID']); else $CamID = 0;
if(isset($_POST['CTYPE'])) $CCTYPE = intval($_POST['CTYPE']); else $CCTYPE = 0;
if(isset($_POST['STREAM'])) $CSTR = intval($_POST['STREAM']); else $CSTR = 0;
if(isset($_POST['PTZ'])) $PTZ = intval($_POST['PTZ']); else $PTZ = 0;
if(isset($_POST['UART'])) $UART = intval($_POST['UART']); else $UART = 0;
if(isset($_POST['FMIN'])) $FMIN = floatval($_POST['FMIN']); else $FMIN = 0;
if(isset($_POST['FMAX'])) $FMAX = floatval($_POST['FMAX']); else $FMAX = 0;
if(isset($_POST['IMSIZE'])) $IMSIZE = intval($_POST['IMSIZE']); else $IMSIZE = 2;
if(isset($_POST['TILTMODE'])) $TILTMODE = intval($_POST['TILTMODE']); else $TILTMODE = 0;
if(isset($_POST['PANMODE'])) $PANMODE = intval($_POST['PANMODE']); else $PANMODE = 0;
if(isset($_POST['PANANG'])) $PANANG = floatval( $_POST['PANANG']); else $PANANG = 360.0;
if(isset($_POST['TILTANG'])) $TILTANG = floatval( $_POST['TILTANG']); else $TILTANG = 90.0;
if(isset($_POST['PROTOID'])) $PROTOID = intval( $_POST['PROTOID'] ); else $PROTOID = 0;
if( $CSTR && ( $CCTYPE == ARGUS_ANALOG_STATIC_CAMERA || $CCTYPE == ARGUS_ANALOG_PTZ_CAMERA || $CCTYPE == ARGUS_IP_STATIC_CAMERA || $CCTYPE == ARGUS_IP_PTZ_CAMERA ) ){
$QS = "SELECT * FROM `media_streams` WHERE `id`={$CSTR}";
$T = $DATABASE->Query( $QS, false );
$QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SiteID} AND `type`=0 LIMIT 1";
$CC = $DATABASE->Query( $QS, false );
$ServerNODE = $CC[0]['id'];
if( count( $T ) ){
$STREAM = $T[0];
if( $CCTYPE == ARGUS_ANALOG_STATIC_CAMERA || $CCTYPE == ARGUS_ANALOG_PTZ_CAMERA ){
$CAMUUID = md5( $SiteID.$CUser->Data['selected_site'].$STRRAM['mrl'] );
// Create Camera Object Based On Stream
$QS = "INSERT INTO `cameras` SET `site_id`={$SiteID}, `node_id`=0, `online`=1, `type`={$CCTYPE}, `hardware`='Local_Grabber', `status`=0, uuid='{$CAMUUID}'";
$DATABASE->Query( $QS, false );
$CamID = $DATABASE->getLastInsertID();
};
if( $CamID != 0 ){
if(isset($_POST['LAB'])) $CAM_NAM = $DATABASE->escape( $_POST['LAB'] ); else $CAM_NAME = 'CAM_' . $CamID;
$QS = "INSERT INTO nodes SET site_id={$SiteID}, type={$CCTYPE}, aux_id={$CamID}, aux_parameter={$STREAM['id']}, name='{$CAM_NAM}'";
$DATABASE->Query( $QS, false );
$NodeID = $DATABASE->getLastInsertID();
if( $NodeID > 0 ){
$QS = "UPDATE cameras SET protocol_aux='{$PROTOID}', tilt_angles={$TILTANG}, tilt_model={$TILTMODE}, pan_angles={$PANANG}, pan_model={$PANMODE}, node_id={$NodeID}, type={$CCTYPE}, protocol={$PTZ}, uart_id={$UART}, imager_type={$IMSIZE}, min_f={$FMIN}, max_f={$FMAX}, status=2 WHERE id={$CamID}";
$DATABASE->Query( $QS, false );
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$CUser->Data['id']}, `cmd`=13, `dataset`='{$LOG_DATA}'";
$DATABASE->Query( $QS, false );
if( $CCTYPE == ARGUS_ANALOG_STATIC_CAMERA || $CCTYPE == ARGUS_ANALOG_PTZ_CAMERA ){
$RMD5 = md5( $CamID.' 30 '.$SiteID );
$QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=30, `md5`='{$RMD5}', `aux_id`={$CamID}, `device`='Analog Video'";
$DATABASE->Query( $QS, false );
$AV_out_pin = $DATABASE->getLastInsertID();
$QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NodeID}, `from_aux`={$AV_out_pin}, `to`={$ServerNODE}, `to_aux`=0, `type`=4";
$DATABASE->Query( $QS, false );
} else {
$RMD5 = md5( $CamID.' 130 '.$SiteID );
$QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=130, `md5`='{$RMD5}', `aux_id`={$CamID}, `device`='IP Video'";
$DATABASE->Query( $QS, false );
$DV_out_pin = $DATABASE->getLastInsertID();
$RMD5 = md5( $CamID.' 100 '.$SiteID );
$QS = "SELECT `ip` FROM `cameras` WHERE `id`={$CamID}";
$CC = $DATABASE->Query( $QS, false );
$IP = $CC[0]['ip'];
$QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=100, `md5`='{$RMD5}', `aux_id`={$CamID}, `device`='{$IP}'";
$DATABASE->Query( $QS, false );
$NET_pin = $DATABASE->getLastInsertID();
$QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NodeID}, `from_aux`={$DV_out_pin}, `to`={$ServerNODE}, `to_aux`=0, `type`=6";
$DATABASE->Query( $QS, false );
};
if( $CCTYPE == ARGUS_ANALOG_PTZ_CAMERA || $CCTYPE == ARGUS_IP_PTZ_CAMERA ){
if( $PTZ > 0 && $PTZ < 3 ){
$RMD5 = md5( $CamID.' 1 '.$SiteID );
$QS = "INSERT INTO `resources` SET`node_id`={$NodeID}, `type`=1, `md5`='{$RMD5}', `aux_id`={$CamID}, `device`='PTZ Uart'";
$DATABASE->Query( $QS, false );
$SERIAL_out_pin = $DATABASE->getLastInsertID();
$QS = "SELECT `re`.`node_id` as `node`, `re`.`id` as `aux` FROM `cameras` `ca` LEFT JOIN `uart_settings` `us` ON `us`.`id`=`ca`.`uart_id` LEFT JOIN `resources` `re` ON `us`.`resource_id`=`re`.`id` WHERE `ca`.`id`={$CamID}";
$CC = $DATABASE->Query( $QS, false );
$SERIAL_in_NODE = $CC[0]['node'];
$SERIAL_in_PIN = $CC[0]['aux'];
$QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NodeID}, `from_aux`={$AV_out_pin}, `to`={$SERIAL_in_NODE}, `to_aux`={$SERIAL_in_PIN}, `type`=1";
$DATABASE->Query( $QS, false );
} else {
$QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NodeID}, `from_aux`={$NET_pin}, `to`={$ServerNODE}, `to_aux`=0, `type`=2";
$DATABASE->Query( $QS, false );
};
};
};
};
$MO = COM_MODE_INOUT;
$QS = "INSERT INTO sockets SET node_id={$NodeID}, aux_id={$CamID}, type={$TY}, mode={$MO}, md5='{$MD5}', name='PTZ Control'";
$DATABASE->Query( $QS, false );
};
$QS = "UPDATE cameras SET protocol_aux='{$PROTOID}', tilt_angles={$TILTANG}, tilt_model={$TILTMODE}, pan_angles={$PANANG}, pan_model={$PANMODE}, node_id={$NodeID}, type={$CCTYPE}, protocol={$PTZ}, uart_id={$UART}, imager_type={$IMSIZE}, min_f={$FMIN}, max_f={$FMAX}, status=2 WHERE id={$CamID}";
$DATABASE->Query( $QS, false );
};
};
} else {

46
lib/controller/addDetectionProfile.php

@ -0,0 +1,46 @@
<?php
require_once('../ajax_asm.php');
$UID = intval($CUser->Data['id'] );
$ACCESS = intval($CUser->Data['access'] );
if( $UID > 1 && $ACCESS > 4 ){
$Z = $_POST['NID'];
if( $Z != '' ){
$TArr = explode( ':', $Z );
$NodeID = intval( $TArr[0] );
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = intval( $T['aux_id'] );
$QS = "SELECT `profile_id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} ORDER BY `profile_id`";
$result = $DATABASE->Query( $QS, false );
if( count($result) ) {
$LP = 0;
foreach( $result as $R ){
$LP=intval($R['profile_id']);
};
if( $LP < 3 ){
$LP++;
$QS="INSERT INTO `lrf_detection_profiles` SET `aux_id`={$AID}, `master`=1, `profile_id`={$LP}";
$DATABASE->Query( $QS );
if( $T['type'] == 1 || $T['type'] == 5 ){
$QS="INSERT INTO `lrf_detection_profiles` SET `aux_id`={$AID}, `master`=0, `profile_id`={$LP}";
$DATABASE->Query( $QS );
};
};
} else {
$QS="INSERT INTO `lrf_detection_profiles` SET `aux_id`={$AID}, `master`=1, `profile_id`=0";
$DATABASE->Query( $QS );
if( $T['type'] == 1 || $T['type'] == 5 ){
$QS="INSERT INTO `lrf_detection_profiles` SET `aux_id`={$AID}, `master`=0, `profile_id`=0";
$DATABASE->Query( $QS );
};
};
$QS="INSERT INTO `access_log` SET ts=NOW(), `user_id`={$UID}, `cmd`=12, `dataset`='{}'";
$DATABASE->Query( $QS );
};
exit();
};
};
header('location: /');
?>

52
lib/controller/addNetworkNode.php

@ -8,7 +8,7 @@
switch( $NodeType ){
case 1://Als
case 2://Lfs
case 3://Pls
case 3://Pls
case 4://pls
$QS = "INSERT INTO `lrf_sensors` SET `type_id`={$NodeType}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
@ -37,26 +37,36 @@
$Data['success'] = true;
break;
case 20://IpUart
$SPD = intval( $_POST['UART_SPEED'] );
$BITS = intval( $_POST['UART_BITS'] );
$STOP = floatval( $_POST['UART_STOP'] );
$PAR = strtoupper( substr($_POST['UART_PAR'],0,1) );
$MODE = intval( $_POST['UART_MODE'] );
$IP = $DATABASE->escape( $_POST['UART_IP'] );
$PORT = intval( $_POST['UART_PORT'] );
$QS = "INSERT INTO uart_settings SET `type`=2, `socket_id`=0, `mode`={$MODE}, `bit`={$BITS}, `parity`='{$PAR}', `stop_bit`={$STOP}, `port`={$PORT}, `path`='{$IP}'";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
$QS = "INSERT INTO nodes SET `type`={$NodeType}, `aux_id`={$DevID}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
$NODEID = $DATABASE->getLastInsertID();
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
$DATABASE->Query( $QS, false );
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='UART Connection'";
$DATABASE->Query( $QS, false );
$Data['success'] = true;
$SPD = intval( $_POST['UART_SPEED'] );
$BITS = intval( $_POST['UART_BITS'] );
$STOP = floatval( $_POST['UART_STOP'] );
$PAR = strtoupper( substr($_POST['UART_PAR'],0,1) );
$MODE = intval( $_POST['UART_MODE'] );
$IP = $DATABASE->escape( $_POST['UART_IP'] );
$PORT = intval( $_POST['UART_PORT'] );
$QS = "INSERT INTO `uart_settings` SET `type`=2, `resource_id`=0, `mode`={$MODE}, `bit`={$BITS}, `parity`='{$PAR}', `stop_bit`={$STOP}, `port`={$PORT}, `path`='{$IP}'";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
$QS = "INSERT INTO nodes SET `type`={$NodeType}, `aux_id`={$DevID}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
$NODEID = $DATABASE->getLastInsertID();
$DevICE = $IP .':'.$PORT;
$MM = md5( $DevICE );
$QS = "INSERT INTO resources SET `type`=1, `site_id`={$SiteID}, `node_id`={$NODEID}, `aux_id`={$DevID}, `md5`='{$MM}', `device`='{$DevICE}'";
$DATABASE->Query( $QS, false );
$RES_UART = $DATABASE->getLastInsertID();
$DevICE = $IP;
$MM = md5( $DevICE );
$QS = "INSERT INTO resources SET `type`=100, `site_id`={$SiteID}, `node_id`={$NODEID}, `aux_id`={$DevID}, `md5`='{$MM}', `device`='{$DevICE}'";
$DATABASE->Query( $QS, false );
$RES_NET = $DATABASE->getLastInsertID();
$QS = "UPDATE `uart_settings` SET `resource_id`={$RES_UART} WHERE `id`={$DevID}";
$DATABASE->Query( $QS, false );
$Server_NODE = 147;
$QS = "INSERT INTO connections SET `site_id`={$SiteID}, `from`={$NODEID}, `from_aux`={$RES_NET}, `to`={$Server_NODE}, `to_aux`=0, `type`=".COM_TYPE_TCP;
$DATABASE->Query( $QS, false );
$Data['success'] = true;
break;
};
};

38
lib/controller/camMakeMove.php

@ -0,0 +1,38 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$CMD = '';
if(isset( $_POST['CMD'] )){
$CMD = $_POST['CMD'];
} else {
$CMD = $_GET['CMD'];
};
$TArr = explode( '_', $CMD );
$CID = intval($TArr[3]);
$CCC = intval($TArr[2]);
if( $CID ){
//$QS = "SELECT `aux_id` FROM `nodes` WHERE `id`={$CID}";
//$RR = $DATABASE->Query( $QS );
//$CID = intval( $RR[0]['aux_id'] );
//if( $CID == 0 ) exit();
$ACMD = 0;
switch( $CCC ){
case 10: $ACMD = 0x21; break; //Zoom In
case 11: $ACMD = 0x41; break; //Zoom Out
case 27: $ACMD = 0x03; break; // Right
case 28: $ACMD = 0x13; break; // RD
case 29: $ACMD = 0x11; break; // Down
case 30: $ACMD = 0x15; break; // LD
case 31: $ACMD = 0x05; break; // Left
case 32: $ACMD = 0x0d; break; // LU
case 33: $ACMD = 0x09; break; // Up
case 34: $ACMD = 0x0B; break; // RU
};
echo $CID . " -> " .$ACMD;
if( $ACMD ){
$QS = "INSERT `nodes_qcq` SET `cmd`={$ACMD}, `node_id`={$CID}, `status`=0";
$DATABASE->Query( $QS );
};
};
};
?>

22
lib/controller/camStop.php

@ -0,0 +1,22 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$CMD = '';
if(isset( $_POST['CMD'] )){
$CMD = $_POST['CMD'];
} else {
$CMD = $_GET['CMD'];
};
$TArr = explode( '_', $CMD );
$CID = intval($TArr[3]);
if( $CID ){
//$QS = "SELECT `aux_id` FROM `nodes` WHERE `id`={$CID}";
//$RR = $DATABASE->Query( $QS );
//$CID = intval( $RR[0]['aux_id'] );
//if( $CID == 0 ) exit();
$QS = "INSERT `nodes_qcq` SET `cmd`=1, `node_id`={$CID}, `status`=0";
$DATABASE->Query( $QS );
};
};
?>

43
lib/controller/dash/node_0.js

@ -1,11 +1,34 @@
{
id: 'db_node_%%%NODEID%%%',
frame: false,
width: 258,
height: 200,
border: true,
title: 'R-Goose Server',
items:[{
html: '<p>Server</p>'
}]
{
id: 'db_node_%%%NODEID%%%',
tools: [{
id:'gear',
handler: function(){
//Ext.Msg.alert('Message', 'The Settings tool was clicked.');
showServerToolBox(%%%NODEID%%%);
}
},{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}],
frame: true,
width: 258,
height: 240,
border: false,
title: '%%%SYSSERVERNAME%%%',
items: [{
xtype: 'panel',
html: '<table width="100%"><tr><td><p id="ser_status_txt">%%%SERVERSTATUS%%%</p></td><td width="16px"><img id="serv_status_img" src="/style/icons/icons/%%%SERVERSTATUSIMG%%%"></td></tr></table>'
},{
xtype: 'panel',
html: '<table width="100%" border=0><tr><td><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><!-- circle class="donut-hole" cx="21" cy="21" r="15.91549430918954" fill="#fff"></circle --><!-- GREEN --><circle id="donut-segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- BLUE --><circle id="donut-segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- PURPLE --><circle id="donut-segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="totalValue">0</text><text x="50%" y="50%" class="chart-label">CPU</text></g></svg></td><td><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><!-- circle class="donut-hole" cx="21" cy="21" r="15.91549430918954" fill="#fff"></circle --><!-- GREEN --><circle id="donut1-segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- BLUE --><circle id="donut1-segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- PURPLE --><circle id="donut1-segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="totalValue1">0</text><text x="50%" y="50%" class="chart-label">MEM</text></g></svg></td><td><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><!-- circle class="donut-hole" cx="21" cy="21" r="15.91549430918954" fill="#fff"></circle --><!-- GREEN --><circle id="donut2-segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- BLUE --><circle id="donut2-segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><!-- PURPLE --><circle id="donut2-segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="totalValue2">0</text><text x="50%" y="50%" class="chart-label">DISK</text></g></svg></td></tr></table>'
},{
xtype: 'panel',
height: 80,
frame: true,
border: false,
autoScroll: true,
items: %%%MODULES%%%
}]
}

28
lib/controller/dash/node_10.js

@ -0,0 +1,28 @@
{
id: 'db_node_%%%NODEID%%%',
//xxtype: 'panel',
xtype: 'portlet',
//columnWidth:.33,
//layout: 'fit',
width: 258,
height: 240,
tools: [{
id:'gear',
handler: function(){
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
}
},{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}],
frame: true,
bodyStyle: 'padding: 0px;',
plr: null,
title: '%%%NODENAME%%%',
items:[{
//html: '<video id="hls-%%%NODEID%%%" class="video-js vjs-default-skin" width="244" height="200"></video>',
html: '<img data-enlargeable000 ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" id="img-%%%NODEID%%%" src="%%%SELURL%%%" width="244" height="200" />',
}]
}

78
lib/controller/dash/node_13.js

@ -5,7 +5,7 @@
//columnWidth:.33,
//layout: 'fit',
width: 258,
height: 270,
height: 268,
tools: [{
id:'gear',
handler: function(){
@ -22,44 +22,57 @@
plr: null,
title: '%%%NODENAME%%%',
items:[{
html: '<video id="hls-%%%NODEID%%%" class="video-js vjs-default-skin" width="244" height="200"></video>',
html: '<img onmouseover="ptzCtrl(\'img-%%%NODEID%%%\');" ondblclick="fullScreen(\'img-%%%NODEID%%%\');" style="cursor: zoom-in" id="img-%%%NODEID%%%" src="%%%SELURL%%%" width="244" height="200" />',
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
id: 'src_combo_%%%NODEID%%%',
typeAhead: false,
width: 244,
triggerAction: 'all',
listEmptyText: 'No Video Sources',
lazyRender:true,
mode: 'local',
%%%SELID%%%
listeners:{
'select': function( t, r, i ){
var p = Ext.getCmp('db_node_%%%NODEID%%%');
if( p != null ){
if( p.plr!= null ){
p.plr.src({type: 'application/x-mpegURL', src: r.data.src });
};
};
}
},
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'id',
'label',
'src'
],
data: %%%URLS%%%
}),
valueField: 'id',
displayField: 'label'
xtype: 'button',
id: 'ptz_btn_%%%NODEID%%%',
width: '100%',
text: 'PTZ Control',
enableToggle: true,
handler: function(){
var t = Ext.getCmp('db_node_%%%NODEID%%%');
if( Ext.getCmp('ptz_btn_%%%NODEID%%%').pressed ){
t.setSize( 258, 362 );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_010_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_011_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_027_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_028_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_029_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_030_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_031_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_032_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_033_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mouseup', makePtzStop );
document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove );
document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop );
} else {
t.setSize( 258, 268 );
//Ext.Msg.alert('Message', 'The 270 tool was clicked.');
};
t.doLayout();
}
},{
xtype: 'spacer',
height: 3
},{
html: '<table width="100%" border=0><tr><td width="24"><img id="img_btn_010_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td>&nbsp;</td></tr><tr><td><img id="img_btn_011_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><img id="img_btn_030_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_%%%NODEID%%%" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td>&nbsp;</td></tr></table>',
height: 90
}],
listeners:{
afterrender: function( t ){
/*
t.plr = videojs.getPlayer('hls-%%%NODEID%%%');
if( t.plr == null ){
t.plr = videojs('hls-%%%NODEID%%%',{
@ -73,6 +86,7 @@
});
};
t.plr.src({type: 'application/x-mpegURL', src: '%%%SELURL%%%'});
*/
return true;
},
destroy: function( t ){

7
lib/controller/dash/node_3.js

@ -3,6 +3,13 @@
width: 258,
height: 320,
title: '%%%NODENAME%%%',
tools: [{
id:'gear',
handler: function(){
//Ext.Msg.alert('Message', 'The Settings tool was clicked.');
showDetectionProfile( %%%NODEID%%% );
}
}],
listeners:{
afterrender: function(){
cleanupDraw( %%%NODEID%%% );

36
lib/controller/doDeviceOperation.php

@ -0,0 +1,36 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NodeID = intval($_POST['NID']);
$SiteID = intval($_POST['SITE']);
$OPID = intval( $_POST['CMD'] );
$PARAM = $_POST['PARAM'];
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$Data = array();
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$TYP = intval( $T['type'] );
$AID = intval( $T['aux_id'] );
switch( $TYP ){
case ARGUS_ALS_SENSOR:
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:
case ARGUS_3D_SENSOR:
case ARGUS_NET_PLS_200:{
//$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
//$result = $DATABASE->Query( $QS, false );
//if( count($result)) {
//
//};
$QS = "UPDATE `lrf_sensors` SET `pushed_cmd`={$OPID} WHERE id={$AID}";
$DATABASE->Query( $QS );
};
};
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

47
lib/controller/getDashBoardItems.php

@ -39,6 +39,35 @@
$TPL[$index] = str_replace('%%%NODENAME%%%', ''.$R['name'] , $TPL[$index] );
switch( $R['type'] ){
case ARGUS_SERVER:{
$TPL[$index] = str_replace('%%%SYSSERVERNAME%%%', $Labels->getLabel( 'SYS_SERVNAME' ), $TPL[$index] );
if( $R['online']== 1 ){
$TPL[$index] = str_replace('%%%SERVERSTATUS%%%', $Labels->getLabel('SRV_STATUS_ON') , $TPL[$index]);
$TPL[$index] = str_replace('%%%SERVERSTATUSIMG%%%', 'accept.png' , $TPL[$index]);
} else {
$TPL[$index] = str_replace('%%%SERVERSTATUS%%%', $Labels->getLabel('SRV_STATUS_OFF') , $TPL[$index]);
$TPL[$index] = str_replace('%%%SERVERSTATUSIMG%%%', 'stop.png' , $TPL[$index]);
};
$QS="SELECT * FROM `server_modules` WHERE `server_id`={$R['aux_id']}";
$Z=$DATABASE->Query($QS);
$MODULES = array();
if(count($Z)){
foreach( $Z as $mod ){
$QS="SELECT * FROM server_module_types WHERE id={$mod['type']}";
$mtt=$DATABASE->Query( $QS );
$CM['xtype'] = 'panel';
if( $mod['enabled'] == 1 ){
$CM['html'] = '<table width="100%"><tr><td><p class="super_small">'.$Labels->getLabel( $mtt[0]['name'] ).'</p></td><td width="16px"><img title="'.$Labels->getLabel( '__ENABLED__' ).'" src="/style/icons/icons/plugin_add.png"></td></tr></table>';
} else {
$CM['html'] = '<table width="100%"><tr><td><p class="super_small">'.$Labels->getLabel( $mtt[0]['name'] ).'</p></td><td width="16px"><img title="'.$Labels->getLabel( '__DISABLED__' ).'" src="/style/icons/icons/plugin_delete.png"></td></tr></table>';
};
$CM['height'] = 25;
$MODULES[] = $CM;
};
} else {
$MODULES[] = '[{ html: \'No Modules Defined\'}]';
};
$MODULES_CNT = json_encode( $MODULES );
$TPL[$index] = str_replace('%%%MODULES%%%', ''.$MODULES_CNT , $TPL[$index] );
break;
};
case ARGUS_LFS_SENSOR:
@ -49,12 +78,25 @@
case ARGUS_3D_SENSOR:{
break;
};
case 10:
case 11:
case 12:
case ARGUS_IP_PTZ_CAMERA:{
$QS="SELECT * FROM cameras WHERE node_id={$R['id']}";
//$QS="SELECT * FROM cameras WHERE node_id={$R['id']}";
$QS="SELECT * FROM `nodes` WHERE `id`={$R['id']}";
$Z=$DATABASE->Query( $QS );
$QS="SELECT mss.*, ms.name, ms.img_width, ms.img_height FROM media_server_streams mss LEFT JOIN media_streams ms ON ( mss.media_stream_id = ms.id ) WHERE ms.source_id={$Z[0]['id']} AND mss.valid=1 AND mss.online=1";
$QS="SELECT * FROM `module_embed_video_settings` WHERE `id`=1";
$S=$DATABASE->Query( $QS );
$TPL[$index] = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL[$index] );
$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $S[0]['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
$CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
$TPL[$index] = str_replace( '%%%URLS%%%', '[' . $CS . ']' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%', $FU, $TPL[$index] );
/*
$QS="SELECT mss.*, ms.name, ms.img_width, ms.img_height FROM media_server_streams mss LEFT JOIN media_streams ms ON ( mss.media_stream_id = ms.id ) WHERE ms.source_id={$Z[0]['id']} AND mss.valid=1 AND mss.online=1";
$S=$DATABASE->Query( $QS );
if( count( $S ) ){
$CS = array();
$FID = 0;
@ -85,6 +127,7 @@
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: \'No Video Sources\',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%','', $TPL[$index] );
};
*/
break;
};
};

30
lib/controller/getDetectionProfile.php

@ -0,0 +1,30 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NodeID = intval($_POST['NID']);
$SiteID = intval($_POST['SITE']);
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$Data = array();
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = $T['aux_id'];
$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
$result = $DATABASE->Query( $QS, false );
if( count($result)) {
$R = $result[0];
$K['name'] = $T['name'];
$K['data_status'] = intval( $R['data_status'] );
$K['online'] = intval($T['online']);
$K['profile_id'] = intval($R['detection_profile_id']);
$K['profiles'] = array();
$QS = "SELECT DISTINCT `profile_id` as `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} ORDER BY `profile_id`";
foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']);
$Data = $K;
};
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

348
lib/controller/getDeviceDraw.php

@ -1,5 +1,8 @@
<?php
require_once('../ajax_asm.php');
$SAVE_AS_PICTURE = false;
if( $CUser->Data['id'] > 1 ){
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
@ -19,15 +22,196 @@
$QS = "SELECT * FROM lrf_draw WHERE node_id={$NID} ORDER BY ts DESC LIMIT 1";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
if( $Result[0]['rendered'] == 'Y' ){
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
if( $SAVE_AS_PICTURE ){
if( $Result[0]['rendered'] == 'Y' ){
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
};
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
$FF = "data/device_draws/{$Result[0]['md5']}.raw";
$FN = "ddd";
if( file_exists( $FF ) ) {
$FD = fopen( $FF, "rb" );
if( $FD ){
$CL = fread( $FD, 4 );
$size = unpack( "V", $CL );
$pts = array();
$as = $size[1];
for($i=0; $i< $as; $i++ ){
$CL = fread( $FD, 4 );
$T = unpack( "V", $CL );
//print_r( $T );
$pts[] = $T[1] >> 16;
};
fclose( $FD );
$QS = "SELECT ls.base_shift, ls.max_range FROM nodes ns LEFT JOIN lrf_sensors ls ON ( ls.id=ns.aux_id ) WHERE ns.id={$NID}";
$PP = $DATABASE->Query( $QS );
$stp = 2.0 * ( M_PI / $as );
$MR = intval( $PP[0]['max_range'] );
$S = ( M_PI / 3000.0 ) * intval( $PP[0]['base_shift'] );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$rst = $maxR / 1025.0;
$x0 = 100;
$y0 = 100;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_100.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 2 ) . "m.", $black );
$rst = $maxR / 513.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 513 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_50.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 4 ) . "m.", $black );
$rst = $maxR / 257.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 256 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_25.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 8 ) . "m.", $black );
$rst = $maxR / 129.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 128 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_12.png" );
imagedestroy( $IM );
$QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}";
$DATABASE->Query( $QS );
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
};
};
} else {
echo "No Res"; exit();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
};
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
} else {
//! $SAVE_AS_PICTURE
$FF = "data/device_draws/{$Result[0]['md5']}.raw";
$FN = "ddd";
if( file_exists( $FF ) ) {
$FD = fopen( $FF, "rb" );
if( $FD ){
@ -38,7 +222,6 @@
for($i=0; $i< $as; $i++ ){
$CL = fread( $FD, 4 );
$T = unpack( "V", $CL );
//print_r( $T );
$pts[] = $T[1] >> 16;
};
fclose( $FD );
@ -47,125 +230,50 @@
$stp = 2.0 * ( M_PI / $as );
$MR = intval( $PP[0]['max_range'] );
$S = ( M_PI / 3000.0 ) * intval( $PP[0]['base_shift'] );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$rst = $maxR / 1025.0;
$x0 = 100;
$y0 = 100;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
switch( $AUX ){
case 12: {
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
$RR = 129.0;
$MR = $MR / 8;
$MD = 128;
break;
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_100.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 2 ) . "m.", $black );
$rst = $maxR / 513.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 513 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
case 25: {
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
$RR = 257.0;
$MR = $MR / 4;
$MD = 256;
break;
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_50.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 4 ) . "m.", $black );
$rst = $maxR / 257.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 256 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
case 50: {
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
$RR = 513.0;
$MR = $MR / 2;
$MD = 512;
break;
};
default:{
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
$RR = 1025.0;
$MD = 1025;
break;
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_25.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 8 ) . "m.", $black );
$rst = $maxR / 129.0;
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$x0 = 100;
$y0 = 100;
$rst = $maxR / $RR;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 128 ){
if( $pts[$i] > 0 && $pts[$i] < $MD ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
@ -184,27 +292,27 @@
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_12.png" );
imagepng( $IM );
imagedestroy( $IM );
$QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}";
$DATABASE->Query( $QS );
} else {
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
};
} else {
echo "No Res"; exit();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
};
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
} else {
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";

53
lib/controller/getNetwork.php

@ -30,7 +30,7 @@
$index++;
switch( $CD['type'] ){
case ARGUS_SERVER:
$cnode['label'] = 'R-Goose Server';
$cnode['label'] = 'Argus Server';
$cnode['image'] = '/style/assets/0_node.png';
$cnode['role'] = 'server';
break;
@ -100,30 +100,35 @@
$cedge['id'] = $CD['id'];
$cedge['from'] = $CD['from'];
$cedge['to'] = $CD['to'];
$cedge['arrows'] = 'to';
$cedge['arrows'] = 'to';
switch( $CD['type'] ){
case COM_TYPE_UART:
$COL['color'] = '#00ff00';
$COL['opacity']= 0.9;
$COL['highlight'] = '#00ffff';
case COM_TYPE_TCP:
$COL['color'] = '#ff0000';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ff00ff';
case COM_TYPE_DC_CTRL:
$COL['color'] = '#ffff00';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ffffff';
case COM_TYPE_ANALOG_VIDEO:
case COM_TYPE_ANALOG_AUDIO:
$COL['color'] = '#00ffff';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ffffff';
case COM_TYPE_DIGITAL_MEDIA:
$COL['color'] = '#ff00ff';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ffffff';
break;
case COM_TYPE_UART:
$COL['color'] = '#e0e000';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ffff00';
break;
case COM_TYPE_TCP:
$cedge['arrows'] = 'to, from';
$COL['color'] = '#0000e0';
$COL['opacity']= 0.9;
$COL['highlight'] = '#0000ff';
break;
case COM_TYPE_DC_CTRL:
$COL['color'] = '#00e000';
$COL['opacity']= 0.9;
$COL['highlight'] = '#00ff00';
break;
case COM_TYPE_ANALOG_VIDEO:
case COM_TYPE_ANALOG_AUDIO:
$COL['color'] = '#00e0e0';
$COL['opacity']= 0.9;
$COL['highlight'] = '#00ffff';
break;
case COM_TYPE_DIGITAL_MEDIA:
$COL['color'] = '#e000e0';
$COL['opacity']= 0.9;
$COL['highlight'] = '#ff00ff';
break;
};
$cedge['color'] = $COL;
$Data['edges'][] = $cedge;

201
lib/controller/getNetworkServerProps.php

@ -1,107 +1,118 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Node = intval( $_POST['NODE'] );
$QS = "SELECT * FROM nodes WHERE id = {$Node}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$Props = $Result[0];
$QS = "SELECT * FROM servers WHERE id = {$Props['aux_id']}";
$Result = $DATABASE->Query( $QS, false );
$Server = $Result[0];
$Node = intval( $_POST['NODE'] );
$QS = "SELECT * FROM nodes WHERE id = {$Node}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$Props = $Result[0];
$QS = "SELECT * FROM servers WHERE id = {$Props['aux_id']}";
$Result = $DATABASE->Query( $QS, false );
$Server = $Result[0];
$TName = 'props/0_node_prop.js';
$Data = file_get_contents( $TName );
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
//Info
$InfoData = '';
$InfoParts = array();
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
if($Props['online']){
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Online</div>\'}';
}else{
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}';
};
$InfoData = implode( ',', $InfoParts );
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
// Get Sockets
$SocketsData = '';
$SockDataParts = array();
$QS = "SELECT * FROM sockets WHERE `node_id`={$Node}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
foreach( $Result as $R ){
switch( $R['type'] ){
case ARGUS_NODE_SOCK_TYPE_SERIAL_PORT:
//Uart
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="UART_'.(($R['state']==0)?'N':'O').'_'.(($R['binded']==0)?'N':'B').'">'.$R['name'].'</div>\'}';
break;
case ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER:
//Video Grabber
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="VIDEO_'.(($R['state']==0)?'N':'O').'_'.(($R['binded']==0)?'N':'B').'">'.$R['name'].'</div>\'}';
break;
case ARGUS_NODE_SOCK_TYPE_NETWORK:
//Network Interface
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="NET_'.(($R['state']==0)?'N':'O').'">'.$R['name'].'</div>\'}';
break;
default:
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['name'].'</div>\'}';
};
};
$SocketsData = implode( ',', $SockDataParts );
};
$Data = str_replace('%%%SOCKETS%%%', $SocketsData, $Data );
//Get Modules
$QS = "SELECT * FROM `server_modules` WHERE `server_id`={$Props['aux_id']}";
$MDAT = $DATABASE->Query( $QS );
if(count($MDAT)){
$MODITEMS = array();
foreach( $MDAT as $M ){
switch( $M['type'] ){
case 1:{
//ZLMedia
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Media Server\'}';
break;
};
case 2:{
//DCB_USB
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Dry Contacts\'}';
break;
};
case 3:{
//Kafka
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Kafka Proxy\'}';
break;
$TName = 'props/0_node_prop.js';
$Data = file_get_contents( $TName );
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
//Info
$InfoData = '';
$InfoParts = array();
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
if($Props['online']){
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Online</div>\'}';
}else{
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}';
};
case 4:{
//GPS
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'GPS Anchor\'}';
break;
$InfoData = implode( ',', $InfoParts );
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
// Get Sockets
$SocketsData = '';
$SockDataParts = array();
$QS = "SELECT * FROM resources WHERE `node_id`={$Node}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
foreach( $Result as $R ){
switch( $R['type'] ){
case 1:
//Uart
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="UART_'.(($R['active']==0)?'N':'O').'"><a onclick="showResourceInfo('.$R['id'].');">'.'UART Line'.'</a></div>\'}';
break;
case 31:
//Video Grabber
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'">'.'Analog Video'.'</div>\'}';
break;
case 100:
//Network Interface IPV4
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'">'.'Network IPV4'.'</div>\'}';
break;
case 101:
//Network Interface IPV6
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'">'.'Network IPV6'.'</div>\'}';
break;
//Media Encoder Sink
case 132: // Audio
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Audio Sink'.'</div>\'}';
break;
case 131: // Vide
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Video Sink'.'</div>\'}';
break;
default:
$SockDataParts[] = '{ xtype: \'panel\', html: \'<div align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].'</div>\'}';
};
};
case 5:{
//Netvork
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Network Proxy\'}';
break;
$SocketsData = implode( ',', $SockDataParts );
};
case 6:{
//FlyHunter
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Fly Hunter\', handler: function(){ module_prop_FlyHunter('.$M['id'].'); } }';
break;
$Data = str_replace('%%%SOCKETS%%%', $SocketsData, $Data );
//Get Modules
$QS = "SELECT * FROM `server_modules` WHERE `server_id`={$Props['aux_id']}";
$MDAT = $DATABASE->Query( $QS );
if(count($MDAT)){
$MODITEMS = array();
foreach( $MDAT as $M ){
switch( $M['type'] ){
case 1:{
//ZLMedia
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Media Server\'}';
break;
};
case 2:{
//DCB_USB
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Dry Contacts\'}';
break;
};
case 3:{
//Kafka
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Kafka Proxy\'}';
break;
};
case 4:{
//GPS
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'GPS Anchor\'}';
break;
};
case 5:{
//Netvork
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Network Proxy\'}';
break;
};
case 6:{
//FlyHunter
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Fly Hunter\', handler: function(){ module_prop_FlyHunter('.$M['id'].'); } }';
break;
};
};
};
$IMPL = implode( ',', $MODITEMS );
$ModulesData = "{ items: [{$IMPL}]}";
$Data = str_replace('%%%MODULES%%%', $ModulesData, $Data );
} else {
$Data = str_replace('%%%MODULES%%%', '', $Data );
};
};
echo $Data;
} else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
$IMPL = implode( ',', $MODITEMS );
$ModulesData = "{ items: [{$IMPL}]}";
$Data = str_replace('%%%MODULES%%%', $ModulesData, $Data );
} else {
$Data = str_replace('%%%MODULES%%%', '', $Data );
};
echo $Data;
} else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
header('location: /');
};
?>

33
lib/controller/getNodeAdvancedNfo.php

@ -0,0 +1,33 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Z = $_POST['NID'];
if( $Z != '' ){
$TArr = explode( ':', $Z );
$NodeID = intval( $TArr[0] );
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$Data = array();
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = intval( $T['aux_id'] );
$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
$result = $DATABASE->Query( $QS, false );
if( count($result)) {
$R = $result[0];
$K['name'] = $T['name'];
$K['dev_id'] = $AID;
//$K['data_status'] = intval( $R['data_status'] );
$K['type'] = intval( $R['type_id'] );
$K['range'] = floatval( $R['max_range'] );
$QS="SELECT `profile_id` as `id`, `master`, `order`, `offset`, `delta`, `flip`, `width`, `sst`, `sun`, `gp`, `spikes` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} ORDER BY `profile_id`";
$K['profiles'] = $DATABASE->Query( $QS, false );
$Data = $K;
};
};
echo json_encode( $Data );
exit();
};
};
header('location: /');
?>

31
lib/controller/getNodeBasicNfo.php

@ -0,0 +1,31 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Z = $_POST['NID'];
if( $Z != '' ){
$TArr = explode( ':', $Z );
$NodeID = intval( $TArr[0] );
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$Data = array();
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = intval( $T['aux_id'] );
$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
$result = $DATABASE->Query( $QS, false );
if( count($result)) {
$R = $result[0];
$K['name'] = $T['name'];
$K['dev_id'] = $AID;
//$K['data_status'] = intval( $R['data_status'] );
$K['type'] = intval( $R['type_id'] );
$K['range'] = floatval( $R['max_range'] );
$Data = $K;
};
};
echo json_encode( $Data );
exit();
};
};
header('location: /');
?>

31
lib/controller/getResourceInfo.php

@ -0,0 +1,31 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['RID'] );
$QS = "SELECT * FROM resources WHERE id = {$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CR = $Result[0];
switch( $CR['type'] ){
case 1: //https://bufferwall.com/posts/330881001ji1a/
$QS = "SELECT * FROM uart_settings WHERE id={$CR['aux_id']}";
$Result = $DATABASE->Query( $QS );
$Z = $Result[0];
$R_name = 'UART connected to a Server Appliance';
$R_dev = $CR['device'];
$R_nfo = 'Speed: ' . $Z['speed'] . ', Bits: ' . $Z['bit'] . ', Parity: ' . $Z['parity'] . ', Stop Bit: '. $Z['stop_bit'];
break;
};
echo "{ xtype: 'panel', html: '<table width=\"100%\" border=0><tr><td rowspan=3 width=\"256px\">";
echo "<img id=\"res_info_image\" src=\"/style/assets/unnamed.png\"></td>";
echo "<td>{$R_name}</td></tr>";
echo "<tr><td>{$R_dev}</td></tr>";
echo "<tr><td>{$R_nfo}</td></tr>";
echo "</table>'}";
} else {
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
};
?>

16
lib/controller/getSiteStatus.php

@ -1,16 +0,0 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data['status'] = 'OK';
$GID = intval($_POST['NID']);
$QS = "SELECT * FROM nodes WHERE site_id ={$GID}";
$Result = $DATABASE->Query( $QS, false );
foreach( $Result as $CD ){
$cnode['id'] = $CD['id'];
$Data['nodes'][] = $cnode;
};
} else {
$Data['status']='LOGOUT';
};
echo json_encode( $Data );
?>

140
lib/controller/getStatus.php

@ -0,0 +1,140 @@
<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( $UID > 1 ){
$SiteID = intval( $_POST['SITE'] );
$LastNID = intval( $_POST['LNID'] );
$LastServerPID = intval( $_POST['SPID'] );
$Data = array();
$ServerWasHuped = false;
$ServerIsOnLine = true;
$Data['status'] = 'OK';
$CTS = time();
$Data['nodes'] = array();
$QS = "SELECT * FROM nodes WHERE site_id = {$SiteID} ORDER BY `type`";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) > 0 ){
foreach( $result as $R ){
$CN = array();
$CN['id'] = $R['id'];
$CN['type'] = intval($R['type']);
if( $ServerIsOnLine ){
$CN['status'] = intval($R['online']);
} else {
$CN['status'] = 0;
};
if( $CN['status'] == 1 || $ServerIsOnLine ){
switch( $R['type'] ){
case ARGUS_SERVER:{
$QS="SELECT * FROM `servers` WHERE `id`={$R['aux_id']}";
$zult = $DATABASE->Query( $QS );
if( $zult[0]['online'] == 1 ){
$STS = intval( $zult[0]['ts'] );
$CN['CTS'] = $CTS;
$CN['STS'] = $STS;
if( ( $CTS - $STS ) > 1 ){ //3 seconds offline
$ServerIsOnLine = false;
$CN['status'] = 0;
} else {
$CN['status'] = 1;
};
} else {
$ServerIsOnLine = false;
$CN['status'] = 0;
};
$CN['cpu1'] = intval( $zult[0]['stat_cpu1'] * 2.5 );
$CN['cpu5'] = intval( $zult[0]['stat_cpu5'] );
$CN['cpu15'] = intval( $zult[0]['stat_cpu15'] * 2.5 );
$CN['mem'] = intval( $zult[0]['stat_mem']*100 );
$CN['disk']= intval( $zult[0]['stat_disk']*100 );
break;
};
case ARGUS_ALS_SENSOR:
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:
case ARGUS_NET_PLS_200:{
// check Targets
$CN['targets'] = array();
$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) AND (UNIX_TIMESTAMP(NOW())-ts)<60 ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY ts, ts_ms DESC LIMIT 32";
//echo $QS . "\n\n";
$zult = $DATABASE->Query( $QS );
if( count( $zult ) ){
$CN['status'] = 4; // Alarmed
$CT = array();
foreach( $zult as $Z ){
$CT['digital'] = $Z['range_digital'];
$CT['az'] = $Z['azimuth'];
$CN['targets'][] = $CT;
};
};
break;
};
case ARGUS_3D_SENSOR:{
break;
};
case ARGUS_ANALOG_STATIC_CAMERA:
case ARGUS_ANALOG_PTZ_CAMERA:
case ARGUS_IP_STATIC_CAMERA:
case ARGUS_IP_PTZ_CAMERA:{
if( $ServerIsOnLine ){
$QS="SELECT * FROM `media_streams` WHERE `id`={$R['aux_parameter']}";
$SR=$DATABASE->Query( $QS );
if( count( $SR ) ) {
$ST = $SR[0];
if( $ST['valid'] == 1 ){
$CN['valid'] = true;
$QS="SELECT * FROM `module_embed_video_settings` WHERE `id`=1";
$S=$DATABASE->Query( $QS );
$CN['src'] = 'http://' . $_SERVER['SERVER_ADDR'].':' . $S[0]['web_port'] .'/stream?id='. $R['aux_parameter'];
break;
};
};
};
$CN['valid'] = false;
$CN['src'] = "/style/assets/no-signal.png";
break;
};
};
};
$Data['nodes'][] = $CN;
};
};
// Notifications
$Data['notifications'] = array();
$QS = "SELECT * FROM `notifications` WHERE `status`='A' AND `site_id`={$SiteID} AND `id` > {$LastNID}";
$result = $DATABASE->Query( $QS );
if( count( $result ) ){
foreach( $result as $R ){
$cn['id'] = intval( $R['id'] );
$cn['react'] = false;
$cn['hide'] = true;
$cn['action']= '';
switch( intval( $R['type'] ) ){
case 0:{
$cn['type']= 'info';
$cn['msg'] = $Labels->GetLabel('SYS_WELCOME_MSG');
break;
};
case 1:{
$cn['type']= 'error';
$QS="SELECT `name` FROM `nodes` WHERE `id`={$R['obj_id']}";
$RR = $DATABASE->Query( $QS );
$cn['msg'] = $Labels->GetLabel('SYS_MSG_DEVINV') . ' <b>' . $RR[0]['name'] .'</b>';
$cn['hide'] = false;
$cn['react'] = true;
$cn['action'] = $R['obj_id'].':'.$cn['id'];
};
};
$Data['notifications'][] = $cn;
};
};
} else {
$Data['notifications'] = array();
$Data['status']='LOGOUT';
};
echo json_encode( $Data );
?>

9
lib/controller/listServerLog.php

@ -12,10 +12,11 @@
$cnode['id'] = $AID;
$TArr = explode( ' ', $line );
if( count( $TArr ) > 2 ){
$cnode['ts'] = $TArr[0] . ' ' . $TArr[1];
$cnode['ptr'] = $TArr[2];
$cnode['module'] = str_replace(':','', $TArr[3]);
$cnode['msg'] = substr( $line, strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 4 );
$cnode['type']= $TArr[0];
$cnode['ts'] = $TArr[1] . ' ' . $TArr[2];
$cnode['ptr'] = $TArr[3];
$cnode['module'] = str_replace(':','', $TArr[4]);
$cnode['msg'] = substr( $line, strlen($TArr[0]) + strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 5 );
if( $LID < 40 ) {
$LID++;
} else {

42
lib/controller/props/0_node_prop.js

@ -8,14 +8,21 @@
//width: 190
//},
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/0_node.png"><br/>%%%NODENAME%%%<br/></p>'
},{
xtype:'fieldset',
title: 'Information',
collapsible: true,
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/0_node.png"><br/>%%%NODENAME%%%<br/></p>'
},{
xtype: 'button',
text: 'Settings',
width: '100%',
handler: function(){
alert('Settings');
}
},{
xtype:'fieldset',
title: 'Information',
collapsible: true,
autoHeight: true,
defaults: {
width: '100%'
@ -23,7 +30,7 @@
items :[ %%%INFO%%% ]
},{
xtype:'fieldset',
title: 'Sockets',
title: 'Resources',
collapsible: true,
autoHeight:true,
defaults: {
@ -39,18 +46,11 @@
width: '100%'
},
items :[ %%%MODULES%%%,{
xtype: 'button',
text: 'Add Module',
handler: function(){
xtype: 'button',
text: 'Add Module',
handler: function(){
}
}]
}],
buttons: [{
text: 'Refresh',
handler: function(){
loadServerProperties(%%%NODEID%%%);
}
}
}]
}]
}

137
lib/controller/resetAllSettings.php

@ -0,0 +1,137 @@
<?php
require_once('../ajax_asm.php');
function deleteNode( $NodeID ){
global $DATABASE;
$QS = "SELECT * FROM `nodes` WHERE `id`={$NodeID}";
$Result = $DATABASE->Query( $QS );
if( count( $Result ) ){
$ND = $Result[0];
switch( $ND['type'] ){
// Server
case 0:{
// Clear Resources
$QS = "SELECT * FROM `resources` WHERE `node_id`={$NodeID}";
$RES = $DATABASE->Query( $QS );
foreach( $RES as $R ){
switch( $R['type'] ){
// Handle UARTS
case 1:{
$QS = "DELETE FROM `uart_settings` WHERE `id`={$R['aux_id']}";
$DATABASE->Query( $QS );
break;
};
// Handle Analog Video Grabber
case 31:{
$QS = "DELETE FROM `media_streams` WHERE `id`={$R['aux_id']}";
$DATABASE->Query( $QS );
break;
};
};
$QS = "DELETE FROM `resources` WHERE `id`={$R['id']}";
$DATABASE->Query( $QS );
};
break;
};
// Sensors
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:{
$QS = "DELETE FROM `lrf_sensors` WHERE `id`={$ND['aux_id']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `lrf_detection_profiles` WHERE `aux_id`={$ND['aux_id']}";
$DATABASE->Query( $QS );
$QS = "SELECT * FROM `lrf_draw` WHERE `node_id`={$ND['id']}";
$DR = $DATABASE->Query( $QS );
if( count( $DR ) ){
foreach( $DR as $R ){
$FF = "data/device_draws/{$R['md5']}.raw";
unlink($FF);
if( $R['rendered'] == 'Y' ){
$FF = "data/device_draws/{$R['md5']}_100.png";
unlink($FF);
$FF = "data/device_draws/{$R['md5']}_50.png";
unlink($FF);
$FF = "data/device_draws/{$R['md5']}_25.png";
unlink($FF);
$FF = "data/device_draws/{$R['md5']}_12.png";
unlink($FF);
};
};
$QS = "DELETE FROM `lrf_draw` WHERE `node_id`={$ND['id']}";
$DATABASE->Query( $QS );
};
break;
};
// Cameras
case 10:
case 11:
case 12:
case 13:{
$QS = "DELETE FROM `media_streams` WHERE `source_id`={$ND['aux_id']} OR `id`={$ND['aux_parameter']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `cameras` WHERE `id`={$ND['aux_id']}";
$DATABASE->Query( $QS );
break;
};
// IP UART
case 20:{
break;
};
default:{
};
};
$QS = "DELETE FROM `connections` WHERE `from`={$ND['id']} OR `to`={$ND['id']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `resources` WHERE `node_id`={$ND['id']}";
$DATABASE->Query( $QS );
if( $ND['type'] != 0 ){
$QS = "DELETE FROM `nodes` WHERE `id`={$ND['id']}";
$DATABASE->Query( $QS );
};
};
};
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( isset( $_POST['SAID'] ) ){
$SITE = intval( $_POST['SAID'] );
} else $SITE = 0;
if( $UID > 1 ){
if( $SITE == $CUser->Data['selected_site'] ){
if( $ACCESS > 5 ){
$QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SITE}";
$Nodes = $DATABASE->Query( $QS );
foreach( $Nodes as $Node ) deleteNode( $Node['id'] );
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$UID}, `cmd`=255";
$DATABASE->Query( $QS );
// Restart Setver(s)
$QS = "SELECT * FROM `nodes` WHERE `site_id`={$SITE} AND `type`=0";
$SR = $DATABASE->Query( $QS );
foreach( $SR as $S ){
$QS = "INSERT INTO `servers_queue` SET `server_id`={$S['aux_id']}, `ts`=NOW(), `cmd`=251";
$DATABASE->Query( $QS );
};
} else {
// Log Security Treat!
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$UID}, `cmd`=13, `dataset`='{\"action\":255}'";
$DATABASE->Query( $QS );
$Data['notifications'] = array();
$Data['status']='ACCESS';
};
} else {
$Data['notifications'] = array();
$Data['status']='LOGOUT';
};
} else {
$Data['notifications'] = array();
$Data['status']='LOGOUT';
};
echo json_encode( $Data );
?>

37
lib/controller/validateNode.php

@ -0,0 +1,37 @@
<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( $UID > 1 && $ACCESS > 1 ){
$INFO = $_POST['NID'];
if( $INFO != '' ){
$TArr = explode( ':', $INFO );
$NodeID = intval( $TArr[0]);
$NoteID = intval( $TArr[1]);
$METHOD = intval( $_POST['MET'] );
$Data = array();
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$result = $DATABASE->Query( $QS );
if( count( $result ) ){
$DevID = intval( $result[0]['aux_id'] );
switch( $METHOD ){
case 1:{
$QS = "UPDATE lrf_sensors SET data_status = 1 WHERE id={$result[0]['aux_id']}";
$DATABASE->Query( $QS );
$QS = "UPDATE notifications SET status='D' WHERE id={$NoteID}";
$DATABASE->Query( $QS );
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$UID},`cmd`=10, `dataset`='{\"node\":{$NodeID},\"note\":{$NoteID},\"method\":1}'";
$DATABASE->Query( $QS );
break;
};
};
$Data['status'] = 'OK';
} else {
$Data['status'] = 'NONODE';
};
};
} else {
$Data['status']='NOACCESS';
};
echo json_encode( $Data );
?>

45
lib/defines.php

@ -12,51 +12,6 @@ $DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);

2
lib/javascript/howler/howler.core.min.js
File diff suppressed because it is too large
View File

3242
lib/javascript/howler/howler.js
File diff suppressed because it is too large
View File

4
lib/javascript/howler/howler.min.js
File diff suppressed because it is too large
View File

2
lib/javascript/howler/howler.spatial.min.js
File diff suppressed because it is too large
View File

144
lib/javascript/jsapi_dynamic/rgoose_camera_editor.js

@ -3,7 +3,7 @@
var SelectedCam = 0;
var SelectedSource = 0;
var SelectedCamPTZ = false;
var SelectedCamTYPE = 0;
var connectCamDialog = null;
var addIpCamDialog = null;
@ -193,6 +193,7 @@ function loadCameraSettings( SC ){
};
function preloadOnvifCredentials( SC ){
showCamPropDialog();
Ext.Ajax.request({
url: '/lib/controller/getOnvifCredentials.php',
params: {
@ -201,7 +202,7 @@ function preloadOnvifCredentials( SC ){
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var data = Ext.decode( response.responseText );
if( data.success ){
Ext.getCmp('cam_login').setValue( data.login );
Ext.getCmp('cam_password').setValue( data.password );
@ -213,6 +214,8 @@ function preloadOnvifCredentials( SC ){
Ext.getCmp('loc_tab').enable();
Ext.getCmp('coc_tabs').setActiveTab( 1 );
sourceListStore.loadData( data, false );
var tpic = document.getElementById('pic_prev');
if( tpic != null ) tpic.src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
//document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
} else {
Ext.getCmp('cam_login').setValue('');
@ -264,9 +267,18 @@ function discoverOnvifProfiles( CamID, camUser, camPasswd ){
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
Ext.getCmp('cac_tab').getEl().unmask();
if( data['success'] == true ){
Ext.getCmp('acm_btn').enable();
Ext.getCmp('cac_tab').disable();
Ext.getCmp('lens_tab').enable();
Ext.getCmp('str_tab').enable();
Ext.getCmp('ptz_tab').enable();
Ext.getCmp('loc_tab').enable();
Ext.getCmp('coc_tabs').setActiveTab( 1 );
sourceListStore.loadData( data, false );
document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
var tpic = document.getElementById('pic_prev');
if( tpic != null ) tpic.src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
} else {
Ext.Msg.show({
title:'<?=$Labels->GetLabel('Error_Message');?>',
@ -278,7 +290,6 @@ function discoverOnvifProfiles( CamID, camUser, camPasswd ){
icon: Ext.MessageBox.ERROR //QUESTION
});
};
Ext.getCmp('cac_tab').getEl().unmask();
},
failure: failureAJAXFunction
});
@ -582,17 +593,19 @@ function showCamPropDialog(){
disabled: true,
store: new Ext.data.ArrayStore({
fields: ['uart','uart_txt'],
data: [
<?php
$QS="SELECT sc.aux_id, CONCAT( nd.name, \":\", sc.name ) as name FROM sockets sc LEFT JOIN nodes nd ON ( sc.node_id = nd.id ) WHERE sc.type = {$SiteID} AND nd.site_id = 1 AND ( nd.type = 0 OR nd.type = 20 )";
$R = $DATABASE->Query( $QS );
$P = array();
foreach( $R as $RR ){
$P[] = "[{$RR['aux_id']}, '{$RR['name']}']";
data: [<?php
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 ) AND site_id={$SiteID} ";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
};
echo implode( ",", $P );
?>
]
echo implode( ',', $RE );
} else {
echo "[0, 'No UARTS DEFINED']";
};
?>]
}),
valueField: 'uart',
displayField: 'uart_txt'
@ -725,14 +738,66 @@ function showCamPropDialog(){
var CIMAGER = Ext.getCmp('sens_size').getValue();
var CMINF = Ext.getCmp('min_foc').getValue();
var CMAXF = Ext.getCmp('max_foc').getValue();
if( CLAB != '' ){
var AllOK = true;
if( CLAB == '' ) {
AllOK = false;
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide Camera Name!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
return;
};
if( SelectedSource == 0 ){
AllOK = false;
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Select Image Source!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
return;
};
if( ( SelectedCamTYPE == 11 || SelectedCamTYPE == 13 ) && CPTZP == 0 ){
AllOK = false;
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide PTZ Protocol type!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
return;
};
if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZU == 0 ){
AllOK = false;
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide UART Port!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
return;
};
if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZID == 0 ){
AllOK = false;
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide Camera ID!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
return;
};
if( AllOK ){
Ext.Ajax.request({
url: '/lib/controller/AddCameraNode.php',
params: {
NID: <?=$SiteID;?>,
SITEID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CID: SelectedCam,
STREAM: SelectedSource,
LAB: CLAB,
UART: CPTZU,
PROTOID: CPTZID,
@ -743,7 +808,8 @@ function showCamPropDialog(){
IMSIZE: CIMAGER,
FMIN: CMINF,
FMAX: CMAXF,
PTZ: CPTZP
PTZ: CPTZP,
CTYPE: SelectedCamTYPE
},
success: function( response, opts ){
addIpCamDialog.close();
@ -753,13 +819,6 @@ function showCamPropDialog(){
},
failure: failureAJAXFunction
});
} else {
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide Camera Name!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
};
}
}]
@ -773,13 +832,12 @@ function showCamPropDialog(){
function connectToSeleced(){
CamPropType = 1;
if( SelectedCam > 0 ){
showCamPropDialog();
preloadOnvifCredentials( SelectedCam );
//loadCameraSettings( SelectedCam );
};
};
function addIpCam(){
function addIpCam(){
if( addIpCamDialog == null ){
addIpCamDialog = new Ext.Window({
modal: true,
@ -813,6 +871,40 @@ function addIpCam(){
addIpCamDialog.show();
cameraListStore.load({params:{start:0, limit:50}});
};
var addAnalogCamDialog = null;
function addAnalogCam(){
if( addAnalogCamDialog == null ){
addAnalogCamDialog = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel('_DET_IP_CAMERA_LST_');?>',
width: 800,
height: 600,
layout: 'fit',
closeAction: 'hide',
items:[{
xtype: 'grid',
ds: cameraListStore,
cm: cameraListColModel,
sm: cameraListSelModel,
viewConfig: {
forceFit: true
}
}],
bbar: [{
text: '<?=$Labels->GetLabel('_CANCEL_');?>',
handler: function(){
addIpCamDialog.hide();
}
},'->',{
id: 'con_to_src',
text: '<?=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
disabled: ( SelectedCam == 0 ),
handler: connectToSeleced
}]
});
};
addAnalogCamDialog.show();
};
function addEthernet2Uart(){
if( addE2UDialog == null ){

632
lib/javascript/jsapi_dynamic/rgoose_dashboard.js

@ -1,6 +1,203 @@
//<?php require_once('../../js_asm.php'); ?>
function Pie(cx, cy, radius, data) {
var decimals = 4;
var total = 0;
var offset = 0;
var offset2;
var arr = [];
var x;
var y;
var la;
var radians;
for (var i = 0; i < data.length; i++)
total += data[i].value;
for (var i = 0; i < data.length; i++) {
var item = data[i];
var tmp = {};
tmp.index = i;
tmp.value = item.value;
radians = ((((item.value / total) * 360) * Math.PI) / 180).floor(decimals);
offset2 = ((offset / total) * 360).floor(decimals);
tmp.data = item;
x = (cx + Math.sin(radians) * radius).floor(decimals);
y = (cy - Math.cos(radians) * radius).floor(decimals);
la = radians > Math.PI ? 1 : 0;
// Arc
tmp.d = 'M{0} {1},L{0} {2},A{3} {3},0 {4} 1,{5} {6}Z'.format(cx, cy, cy - radius, radius, la, x, y);
tmp.transform = 'rotate({0}, {1}, {2})'.format(offset2, cx, cy);
// Text
x = (cx + Math.sin(radians / 2) * radius / 2).floor(decimals);
y = (cy - Math.cos(radians / 2) * radius / 2).floor(decimals);
tmp.text = 'x="{0}" y="{1}" transform="rotate({2},{0},{1})"'.format(x, y, -offset2);
offset += item.value;
arr.push(tmp);
}
return arr;
}
function Donut(cx, cy, radius, data) {
function arcradius(cx, cy, radius, degrees) {
var radians = (degrees - 90) * Math.PI / 180.0;
return { x: cx + (radius * Math.cos(radians)), y: cy + (radius * Math.sin(radians)) };
}
var decimals = 4;
var total = 0;
var arr = [];
var beg = 0;
var end = 0;
var count = 0;
var half = radius / 2;
var midpoint = radius / 2.4;
for (var i = 0; i < data.length; i++)
total += data[i].value;
for (var i = 0; i < data.length; i++) {
var item = data[i];
var tmp = {};
//var p = (((item.value + 1) / total) * 100).floor( 2 );
var p = Math.floor(((item.value + 1) / total) * 100);
count += p;
if (i === length - 1 && count < 100)
p = p + (100 - count);
end = beg + ((360 / 100) * p);
tmp.index = i;
tmp.value = item.value;
tmp.data = item;
var b = arcradius(cx, cy, radius, end);
var e = arcradius(cx, cy, radius, beg);
var la = (end - beg) <= 180 ? 0 : 1;
tmp.d = ['M', Math.floor( b.x ), Math.floor( b.y ), 'A', radius, radius, 0, la, 0, Math.floor( e.x ), Math.floor( e.y ) ].join(' ');
arr.push(tmp);
beg = end;
}
return arr;
}
//Pie Chart Usage
/*
var svg = $('#yoursvgelement');
var data = [{ value: 33 }, { value: 20 }, { value: 80 }, { value: 48 }];
var centerX = 300;
var centerY = 300;
var radius = 250;
var color = ['#F6BB42', '#8CC152', '#3BAFDA', '#967ADC', '#DA4453'];
var arr = Pie(centerX, centerY, radius, data);
for (var i = 0; i < arr.length; i++) {
var item = arr[i];
svg.asvg('<g transform="{0}"><path d="{1}" fill="{4}" /><text fill="white" font-size="25" {2}>{3}</text></g>'.format(item.transform, item.d, item.text, item.value, color[i]));
}
*/
// Donut Chart Usage
/*
var svg = $('#yoursvgelement');
var data = [{ value: 33 }, { value: 20 }, { value: 80 }, { value: 48 }];
var centerX = 300;
var centerY = 300;
var radius = 250;
var color = ['#F6BB42', '#8CC152', '#3BAFDA', '#967ADC', '#DA4453'];
var arr = Donut(centerX, centerY, radius, data);
for (var i = 0; i < arr.length; i++) {
var item = arr[i];
svg.asvg('<g><path d="{0}" stroke="{1}" fill="none" stroke-width="50" /></g>'.format(item.d, color[i]));
}
*/
function makePtzMove( me ){
var name = me.target.id;
Ext.Ajax.request({
url: '/lib/controller/camMakeMove.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CMD: name
},
//success: function( response, opts ){
//},
failure: failureAJAXFunction
});
};
function ptzCtrl( a ){
};
function makePtzStop( me ){
var name = me.target.id;
Ext.Ajax.request({
url: '/lib/controller/camStop.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CMD: name
},
//success: function( response, opts ){
//},
failure: failureAJAXFunction
});
};
function fullScreen( id ){
// if already full screen; exit
// else go fullscreen
if(
document.fullscreenElement ||
document.webkitFullscreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement
){
if( document.exitFullscreen ){
document.exitFullscreen();
}else if( document.mozCancelFullScreen ){
document.mozCancelFullScreen();
}else if( document.webkitExitFullscreen ){
document.webkitExitFullscreen();
}else if( document.msExitFullscreen ){
document.msExitFullscreen();
};
}else{
//element = $('#container').get(0);
var element = document.getElementById( id ); //Ext.getCmp( id );
if( element.requestFullscreen ){
element.requestFullscreen();
}else if( element.mozRequestFullScreen ){
element.mozRequestFullScreen();
}else if( element.webkitRequestFullscreen ){
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}else if( element.msRequestFullscreen ){
element.msRequestFullscreen();
};
};
};
function updateDashBoardItemLayout( id, x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateDashBoardItems.php',
@ -46,9 +243,10 @@ function DrawTargets( k, b ){
case 12:{
if( b[i].digital < 256 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.fillStyle = "#" + cc.toString(16) + "0000";
ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
//ctx.strokeStyle = "#FF0000";
var r = (196 * b[i].digital)/ 256;
var r = (196 * b[i].digital)/ 512;
var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r;
@ -59,9 +257,10 @@ function DrawTargets( k, b ){
case 25:{
if( b[i].digital < 512 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.fillStyle = "#" + cc.toString(16) + "0000";
ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
//ctx.strokeStyle = "#FF0000";
var r = (196 * b[i].digital)/ 512;
var r = (196 * b[i].digital)/ 1024;
var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r;
@ -72,9 +271,10 @@ function DrawTargets( k, b ){
case 50:{
if( b[i].digital < 1024 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.fillStyle = "#" + cc.toString(16) + "0000";
ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
//ctx.strokeStyle = "#FF0000";
var r = (196 * b[i].digital) / 1024;
var r = (196 * b[i].digital) / 2048;
var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r;
@ -84,9 +284,10 @@ function DrawTargets( k, b ){
};
case 100:{
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.fillStyle = "#" + cc.toString(16) + "0000";
ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
//ctx.strokeStyle = "#FF0000";
var r = (196 * b[i].digital)/ 2048;
var r = (196 * b[i].digital)/ 4096;
var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r;
@ -97,18 +298,98 @@ function DrawTargets( k, b ){
};
};
var lastNotificationID = 0;
function setDonatStatus( id , value ){
var val1D = document.getElementById('donut'+id+'-segment1');
var val2D = document.getElementById('donut'+id+'-segment2');
var val3D = document.getElementById('donut'+id+'-segment3');
var val1 = (value>-1)?value:0;
var val2 = (value>-1)?100 - val1:0;//data.nodes[i].cpu5 * 100;
var val3 = (value>-1)?0:100;//data.nodes[i].cpu15 * 100;
var totalValue = document.getElementById('totalValue'+id);
var total = val1+val2+val3;
var per1 = val1/total*100;
var per2 = val2/total*100;
var per3 = val3/total*100;
var offset = 25;
if( ( val1 != undefined ) && ( value > -1 ) ){
totalValue.textContent = val1+'%';
} else {
totalValue.textContent = 'No Data';
};
val1D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
val1D.style.strokeDasharray = per1+" "+(100-per1);
val1D.style.strokeDashoffset = offset;
val2D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
val2D.style.strokeDasharray = per2+" "+(100-per2);
val2D.style.strokeDashoffset = 100-per1+offset;
val3D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
val3D.style.strokeDasharray = per3+" "+(100-per3);
val3D.style.strokeDashoffset = 100-(per1+per2)+offset;
};
function fetchSiteStatus(){
Ext.Ajax.request({
url: '/lib/controller/getDashBoardStatus.php',
url: '/lib/controller/getStatus.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
SITE: <?=$SiteID;?>,
LNID: lastNotificationID,
SPID: ServerPID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.nodes.length > 0 ){
for( i=0; i < data.nodes.length; i++ ){
if( data.nodes[i].type == 0 ){
//Handle Server Status
if ( data.nodes[i].status ){
setDonatStatus( '' , data.nodes[i].cpu5 );
setDonatStatus( '1' , data.nodes[i].mem );
setDonatStatus( '2' , data.nodes[i].disk );
} else {
setDonatStatus( '' , -1 );
setDonatStatus( '1' , -1 );
setDonatStatus( '2' , -1 );
};
};
if( data.nodes[i].type > 9 && data.nodes[i].type < 14 ){
var iel = document.getElementById('img-'+data.nodes[i].id );
if( !data.nodes[i].valid ){
if( iel.src != "/style/assets/no-signal.png" ) iel.src = "/style/assets/no-signal.png";
} else {
if( data.nodes[i].src != iel.src ) iel.src = data.nodes[i].src;
};//else {
//https://man7.org/linux/man-pages/man2/getrusage.2.html
//https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode
//https://stackoverflow.com/questions/13465073/how-to-catch-an-exception-from-image-onload
//if( data.nodes[i].valid && ServerIsOnline ){
//iel.src = "/style/assets/no-signal.png";
/*
iel.onerror = function(){
//alert("IMG onerror!");
iel.troubled = true;
};
iel.decode()
.then(() => {
//document.body.appendChild(img);
})
.catch((encodingError) => {
//alert('Stream Ended!');
iel.troubled = true;
})
*/
//};
//};
};
var tt = Ext.getCmp('status_'+data.nodes[i].id );
if( tt != undefined ){
switch( data.nodes[i].status ){
@ -123,14 +404,87 @@ function fetchSiteStatus(){
break;
};
case 2:{
cleanupDraw( data.nodes[i].id );
tt.update('<table style="background-color:#008000; color:#ffff00;" border="0" width="100%"><tr><td>Initializing</td><td width="16"><img width="16px" src="/style/assets/online.gif"></td></tr></table>');
break;
};
case 3:{
cleanupDraw( data.nodes[i].id );
tt.update('<table style="background-color:#800000; color:#ffff00;" border="0" width="100%"><tr><td>Trouble</td><td width="16"><img width="16px" src="/style/assets/offline.png"></td></tr></table>');
break;
};
case 4:{
DrawTargets( data.nodes[i].id, data.nodes[i].targets );
tt.update('<table style="background-color:#ff0000; color:#ffff00;" border="0" width="100%"><tr><td>Alarm</td><td width="16"><img width="16px" src="/style/assets/online.gif"></td></tr></table>');
break;
};
};
};
};
};
if( data.notifications.length > 0 ){
sndExcl.play();
for( i=0; i < data.notifications.length; i++ ){
/*const not = PNotify.alert({
title: 'You Will Receive a Side',
text: 'You have no choice.',
icon: 'fas fa-info-circle',
hide: false,
closer: false,
sticker: false,
destroy: true,
modules: new Map([
...PNotify.defaultModules,
[PNotifyConfirm, {
confirm: true,
buttons: [{
text: 'Ok',
primary: true,
click: notice => notice.close()
}]
}]
])
});
*/
const l = PNotify.alert({
type: data.notifications[i].type,
text: data.notifications[i].msg,
textTrusted: true,
stack: NotificationStack,
title: data.notifications[i].action,
hide: data.notifications[i].hide,
closer: data.notifications[i].hide,
sticker: data.notifications[i].hide,
destroy: true,
modules: (data.notifications[i].react )? new Map([
...PNotify.defaultModules,
[PNotifyConfirm, {
confirm: true,
buttons: [{
text: 'Ok',
primary: true,
click: ( notice, value, evt ) => {
notice.close();
if( notice.title!='' ){
resolveDeviceMistmatch( notice.title );
};
}
}]
}]
]): null
});
/*
if( data.notifications[i].react ){
l.on('click', (notice, value) => {
notice.close();
resolveDeviceMistmatch( notice.title );
});
};
*/
lastNotificationID = data.notifications[i].id;
};
};
},
failure: failureAJAXFunction
});
@ -142,6 +496,7 @@ function loadDashBoard(){
tlInterval = null;
timelineObj = null;
};
Ext.Ajax.request({
url: '/lib/controller/getDashBoardItems.php',
params: {
@ -151,18 +506,257 @@ function loadDashBoard(){
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>' );
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll(true);
for( i=0; i < data.length; i++) tPanel.add( data[i] );
tPanel.doLayout();
$('img[data-enlargeable]').addClass('img-enlargeable').click(function() {
var src = $(this).attr('src');
var modal;
function removeModal() {
modal.remove();
$('body').off('keyup.modal-close');
}
modal = $('<div>').css({
background: 'RGBA(0,0,0,.5) url(' + src + ') no-repeat center',
backgroundSize: 'contain',
width: '100%',
height: '100%',
position: 'fixed',
zIndex: '10000',
top: '0',
left: '0',
cursor: 'zoom-out'
}).click(function() {
removeModal();
}).appendTo('body');
//handling ESC
$('body').on('keyup.modal-close', function(e) {
if (e.key === 'Escape') {
removeModal();
}
});
});
tlInterval = window.setInterval( fetchSiteStatus, 333, selectedSite );
},
failure: function( response, opts ) {
var tPanel = Ext.getCmp('main_portal');
tPanel.remove(0);
tPanel.add( { html: 'Failed to load dashboard!' } );
tPanel.doLayout();
}
});
failure: failureAJAXFunction
});
};
var serverToolBox = null;
function showServerToolBox( ServerNodeId ){
if( serverToolBox == null ){
serverToolBox = new Ext.Window({
title: '<?=$Labels->GetLabel('_SERV_CTLPANEL_SHRT_');?>',
modal: true,
width: 400,
height: 328,
closeAction: 'hide',
items:[{
xtype: 'button',
text: 'Restart',
width: '100%',
textAlign: 'left',
iconCls: 'server_btn_restart',
scale: 'large',
iconAlign: 'left'
},{
xtype: 'button',
text: 'Clear Site',
width: '100%',
textAlign: 'left',
iconCls: 'server_btn_restart',
scale: 'large',
iconAlign: 'left'
}]
});
};
serverToolBox.show();
};
var detectionProfileWindow = null;
var deviceCtrlNode = '';
function showDetectionProfile( NodeID ){
deviceCtrlNode = NodeID + ':0';
<?php if( $CUser->Data['access']>4 ) $ColSpan = 4; else $ColSpan = 3; ?>
if( detectionProfileWindow == null ){
detectionProfileWindow = new Ext.Window({
title: '<?=$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>',
modal: true,
width: <?=$ColSpan*80+16;?>,
height: 328,
closeAction: 'hide',
items:[]
});
};
Ext.Ajax.request({
url: '/lib/controller/getDetectionProfile.php',
params: {
SITE: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NID: NodeID
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
detectionProfileWindow.setTitle( '['+data.name + '] <?=$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>');
detectionProfileWindow.removeAll( true );
if( data.data_status == 3 ){
detectionProfileWindow.add({
xtype: 'panel',
layout: 'table',
layoutConfig: {
columns: <?=$ColSpan;?>
},
items:[{
xtype: 'spacer',
height: 30,
style: {
marginTop: '13px'
},
html: '<center><?=$Labels->GetLabel('_DET_SENSITIVITY_');?></center>',
colspan: <?=$ColSpan;?>
},<?php
if( $CUser->Data['access']>4 ){
?>{
xtype: 'button',
text: 'Factory',
id: 'DDSPBTN0',
width: 80,
iconCls: 'detection_btn_factory',
enableToggle: true,
toggleGroup: 'det_sens_btn_grp',
disabled: true,
scale: 'large',
iconAlign: 'top'
},<?php
};
?>{
xtype: 'button',
text: 'Low',
id: 'DDSPBTN1',
width: 80,
iconCls: 'detection_btn_low',
enableToggle: true,
toggleGroup: 'det_sens_btn_grp',
disabled: true,
scale: 'large',
iconAlign: 'top'
},{
xtype: 'button',
text: 'Meduim',
id: 'DDSPBTN2',
width: 80,
iconCls: 'detection_btn_medium',
enableToggle: true,
toggleGroup: 'det_sens_btn_grp',
disabled: true,
scale: 'large',
iconAlign: 'top'
},{
xtype: 'button',
text: 'High',
id: 'DDSPBTN3',
width: 80,
iconCls: 'detection_btn_high',
enableToggle: true,
toggleGroup: 'det_sens_btn_grp',
disabled: true,
scale: 'large',
iconAlign: 'top'
}]
});
for( i=0; i < data.profiles.length; i++ ){
Ext.getCmp('DDSPBTN'+data.profiles[i] ).enable();
if( i == data.profile_id ) Ext.getCmp('DDSPBTN'+data.profiles[i] ).toggle();
};
} else if( data.data_status == 4 ){
detectionProfileWindow.add({
xtype: 'panel',
//layout: 'fit',
//layoutConfig: {
// columns: 3
//},
items:[{
xtype: 'spacer',
height: 40,
//colspan: 3,
style: {
marginTop: '20px'
},
html: '<center><?=$Labels->GetLabel('_DET_SENSITIVITY_');?></center>',
}<?php
if( $CUser->Data['access']>4 ){
?>,{
xtype: 'button',
text: 'Resolve Trouble',
width: '100%',
//colspan: 3,
iconCls: 'ctrl_panel_cog',
scale: 'large',
iconAlign: 'left',
handler: function(){
detectionProfileWindow.hide();
resolveDeviceMistmatch( deviceCtrlNode );
}
}<?php
};
?>]
});
};
detectionProfileWindow.add({
xtype: 'spacer',
height: 30,
style: {
marginTop: '13px'
},
html: '<center><?=$Labels->GetLabel('_DET_GENWORKS_');?></center>',
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Clear Alarm',
scale: 'large',
iconCls: 'ctrl_panel_clean',
iconAlign: 'left'
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Draw Background',
scale: 'large',
iconCls: 'ctrl_panel_drawscan',
iconAlign: 'left',
handler: function(){
doDeviceOperation( deviceCtrlNode, 3 );
}
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
text: 'Force Study Background',
scale: 'large',
iconCls: 'ctrl_panel_study',
iconAlign: 'left'
});
detectionProfileWindow.add({
xtype: 'button',
width: '100%',
buttonAlign: 'left',
//text: '<table width="100%" border=1><tr><td style="text-align:left">Button 1</td></tr></table>',
text: 'Force Reset Sensor',
scale: 'large',
iconCls: 'ctrl_panel_reset',
iconAlign: 'left',
handler: function(){
doDeviceOperation( deviceCtrlNode, 1 );
}
});
detectionProfileWindow.show();
},
failure: failureAJAXFunction
});
};

371
lib/javascript/jsapi_dynamic/rgoose_devices_module.js

@ -39,6 +39,23 @@ var LRF1D2_st_win = null;
var LRF2D2_st_win = null;
var LRF16D3_st_win = null;
function doDeviceOperation( NodeID, OpCode ){
Ext.Ajax.request({
url: '/lib/controller/doDeviceOperation.php',
params: {
NID: NodeID,
UID: '<?=$CUser->Data['id'];?>',
CMD: OpCode,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
},
failure: failureAJAXFunction
});
};
function loadFullLRF1D2Data( NodeID ){
if( LRF1D2_st_win == null ) return;
@ -479,3 +496,357 @@ function LRF2D2_settings(){
function LRF16D3_settings(){
};
var currentResolveDeviceNode = 0;
var ResolveDeviceNodeWin = null;
function resolveDeviceMistmatch( NodeID ){
currentResolveDeviceNode = NodeID;
if( ResolveDeviceNodeWin == null ){
ResolveDeviceNodeWin = new Ext.Window({
title: '<?=$Labels->GetLabel('_WDEV_MISTMATCH_');?>',
modal: true,
width: 500,
height: 200,
closeAction: 'hide',
items:[{
xtype: 'spacer',
style: {
marginTop: '13px'
},
html: '<center><?=$Labels->GetLabel('_DEV_MISTMATT1_');?></center>',
height: 30
},{
xtype: 'button',
width: '100%',
text: 'Apply Existing Detection Profiles to Newly Connected Device',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/validateNode.php',
params: {
NID: currentResolveDeviceNode,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>',
MET: 1
},
success: function( response, opts ){
ResolveDeviceNodeWin.hide();
},
failure: failureAJAXFunction
});
}
},{
xtype: 'button',
width: '100%',
text: 'Discard old Detection Profiles and Start Device Setup Wizard',
handler: function(){
ResolveDeviceNodeWin.hide();
startDeviceDetectionWizard( currentResolveDeviceNode );
}
},{
xtype: 'button',
width: '100%',
text: 'Discard old Detection Profiles and Load Factory Settings from Device'
},{
xtype: 'button',
width: '100%',
text: 'Discard this Connection for NOW'
}]
});
};
ResolveDeviceNodeWin.show();
};
var DeviceDetectionWizardWnd = null;
var DDWizardActiveDevice = '';
var RangeSetBlocker = false;
function startDeviceDetectionWizard( NodeID ){
DDWizardActiveDevice = NodeID
if( DeviceDetectionWizardWnd == null ){
DeviceDetectionWizardWnd = new Ext.Window({
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
modal: true,
width: 500,
height: 208,
closeAction: 'hide',
items:[{
xtype: 'tabpanel',
activeTab: 1,
items: [{
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ0_');?>',
frame: false,
xtype: 'form',
items:[{
xtype: 'spacer',
height: 20
},{
xtype: 'combo',
id: 'DDWizST',
fieldLabel: '<?=$Labels->GetLabel('_DEV_TYPE_FLD_');?>',
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'dtId',
'dtText'
],
data: [
[1, '<?=$Labels->GetLabel('_DEV_TYPE_ALS_');?>'],
[2, '<?=$Labels->GetLabel('_DEV_TYPE_LFS_');?>'],
[3, '<?=$Labels->GetLabel('_DEV_TYPE_PLS200_');?>'],
[4, '<?=$Labels->GetLabel('_DEV_TYPE_PLS360_');?>'],
[5, '<?=$Labels->GetLabel('_DEV_TYPE_3D_');?>'],
[6, '<?=$Labels->GetLabel('_DEV_TYPE_NPLS200_');?>']
]
}),
valueField: 'dtId',
displayField: 'dtText'
},{
xtype: 'numberfield',
id: 'DDWizSR',
fieldLabel: '<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
minValue: 15.0,
maxValue: 300.0,
listeners:{
change: function( m, nv, ov ){
if( RangeSetBlocker ) return;
RangeSetBlocker = true;
Ext.getCmp('DDWizSRS').setValue( nv );
RangeSetBlocker = false;
}
}
},{
xtype: 'slider',
id: 'DDWizSRS',
fieldLabel: '<?=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
minValue: 15.0,
maxValue: 300.0,
listeners:{
change: function( m, nv, ov ){
if( RangeSetBlocker ) return;
RangeSetBlocker = true;
Ext.getCmp('DDWizSR').setValue( nv );
RangeSetBlocker = false;
}
}
},{
xtype: 'spacer',
height: 10
}]
},{
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ1_');?>',
frame: false,
xtype: 'form',
labelWidth: 120,
items:[{
xtype: 'spacer',
height: 20
},{
xtype: 'combo',
id: 'DDWizIT',
fieldLabel: '<?=$Labels->GetLabel('_DEV_ITYPE_FLD_');?>',
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
value: 1,
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'dpId',
'dpText'
],
data: [
[1, '<?=$Labels->GetLabel('_DEV_PL_HORI_');?>'],
[2, '<?=$Labels->GetLabel('_DEV_PL_VERT_');?>'],
[3, '<?=$Labels->GetLabel('_DEV_PL_ANG_');?>']
]
}),
valueField: 'dpId',
displayField: 'dpText'
}]
},{
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ2_');?>',
html: 'Another one'
},{
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZ3_');?>',
html: 'Another one'
}]
}],
bbar:[{
text: 'Create Profiles And Finish',
handler: function(){
DeviceDetectionWizardWnd.hide();
}
},{
text: 'Advanced Config',
handler: function(){
DeviceDetectionWizardWnd.hide();
startAdvancedDeviceDetection( DDWizardActiveDevice );
}
}]
});
};
Ext.Ajax.request({
url: '/lib/controller/getNodeBasicNfo.php',
params: {
NID: DDWizardActiveDevice,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
DeviceDetectionWizardWnd.setTitle( '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
Ext.getCmp('DDWizST').setValue( data.type );
RangeSetBlocker = true;
Ext.getCmp('DDWizSR').setValue( data.range );
Ext.getCmp('DDWizSRS').setValue( data.range );
RangeSetBlocker = false;
DeviceDetectionWizardWnd.show();
},
failure: failureAJAXFunction
});
};
var DeviceDetectionAdvancedWnd = null;
var DeviceDetectionProfileNames = ['factory default', 'low sens', 'medium sens', 'high sens'];
function loadAdvancedDeviceDetectionSettings(){
Ext.getCmp('ADD_TP').removeAll( false );
Ext.Ajax.request({
url: '/lib/controller/getNodeAdvancedNfo.php',
params: {
NID: DDWizardActiveDevice,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
DeviceDetectionAdvancedWnd.setTitle( '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
if( data.profiles.length > 0 ){
if( data.profiles.length > 3 ) Ext.getCmp('ADD_PADD_BTN').disable();
switch( data.type ){
case 1:
case 5:{
for( i = 0; i < data.profiles.length / 2; i++){
};
break;
};
case 2:
case 3:
case 4:
case 6:{
for( i = 0; i < data.profiles.length; i++){
Ext.getCmp('ADD_TP').add({
title: DeviceDetectionProfileNames[ data.profiles[i].id ],
xtype: 'form',
frame: false,
items:[{xtype: 'spacer', height: 10 },{
xtype: 'numberfield',
id: 'OFFSET_P'+data.profiles[i].id,
fieldLabel: 'OFFSET',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].offset
},{
xtype: 'numberfield',
id: 'DELTA_P'+data.profiles[i].id,
fieldLabel: 'DELTA',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].delta
},{
xtype: 'numberfield',
id: 'WIDTH_P'+data.profiles[i].id,
fieldLabel: 'WIDTH',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].width
},{
xtype: 'numberfield',
id: 'SST_P'+data.profiles[i].id,
fieldLabel: 'SST',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].sst
},{
xtype: 'numberfield',
id: 'FLIP_P'+data.profiles[i].id,
fieldLabel: 'FLIP',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].flip
},{
xtype: 'numberfield',
id: 'SUN_P'+data.profiles[i].id,
fieldLabel: 'SUN',
minValue: 15.0,
maxValue: 300.0,
value: data.profiles[i].sun
}]
});
};
break;
};
};
//
} else {
Ext.getCmp('ADD_TP').add({
title: 'Error!',
html: 'No Profiles Defined'
});
};
DeviceDetectionAdvancedWnd.show();
},
failure: failureAJAXFunction
});
};
function startAdvancedDeviceDetection( NodeID ){
DDWizardActiveDevice = NodeID;
if( DeviceDetectionAdvancedWnd == null ){
DeviceDetectionAdvancedWnd = new Ext.Window({
title: '<?=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
modal: true,
width: 500,
height: 300,
closeAction: 'hide',
items:[{
xtype: 'tabpanel',
id: 'ADD_TP',
frame: false,
border: false,
activeTab: 0,
items: []
}],
bbar:[{
id: 'ADD_PADD_BTN',
text: 'Add Detection Profile',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/addDetectionProfile.php',
params: {
NID: DDWizardActiveDevice,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>'
},
success: function( response, opts ){
loadAdvancedDeviceDetectionSettings();
},
failure: failureAJAXFunction
});
}
},{
text: 'Apply And Finish'
},{
text: 'Use Wizard'
}]
});
};
loadAdvancedDeviceDetectionSettings();
};

36
lib/javascript/jsapi_dynamic/rgoose_logs.js

@ -10,6 +10,9 @@ var um_server_log_store = new Ext.data.JsonStore({
fields: [{
name: 'id',
type: 'int'
},{
name: 'type',
type: 'string'
},{
name: 'ts',
type: 'string'
@ -36,7 +39,7 @@ var um_server_log_store = new Ext.data.JsonStore({
var um_server_log_col_model_opt = {
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_POINTER_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'ptr' },
{header: "<?=$Labels->GetLabel("_MODULE_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'module' },
@ -95,6 +98,7 @@ var um_access_log_store = new Ext.data.JsonStore({
function um_action_renderer( val ){
switch( val ){
case 1: return 'login';
case 13: return 'Access Denied';
case 145: return 'resize screen';
};
return 'unknown action';
@ -102,7 +106,7 @@ function um_action_renderer( val ){
var um_access_log_col_model_opt = {
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_USER_");?>",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'user' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_ACTION_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: um_action_renderer, dataIndex: 'cmd' },
@ -131,7 +135,7 @@ function loadAccessLog(){
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_ACCESS_LOG_");?>' );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_ACC_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
@ -153,7 +157,17 @@ function loadAccessLog(){
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('cmd') ){
case 1: return 'row-level01';
case 2: return 'row-level02';
case 3: return 'row-level03';
case 4: return 'row-level04';
case 145: return 'row-level05';
};
return '';
}
},
ds: um_access_log_store,
cm: new Ext.grid.ColumnModel( um_access_log_col_model_opt ),
@ -181,7 +195,7 @@ function loadServerLog(){
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_SERVER_LOG_");?>' );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_SERV_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
@ -203,7 +217,17 @@ function loadServerLog(){
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('type') ){
case '01': return 'row-level01';
case '02': return 'row-level02';
case '03': return 'row-level03';
case '04': return 'row-level04';
case '05': return 'row-level05';
};
return '';
}
},
ds: um_server_log_store,
cm: new Ext.grid.ColumnModel( um_server_log_col_model_opt ),

154
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -1,29 +1,81 @@
//<?php require_once('../../js_asm.php'); ?>
var winW = <?=0+$CUser->Data['width'];?>;
var winH = <?=0+$CUser->Data['height'];?>;
var winW = <?=intval($CUser->Data['width']);?>;
var winH = <?=intval($CUser->Data['height']);?>;
var PanelH = winH-90;
var SelectedSite = <?=$SiteID;?>;
var SettingsLidar3D = null;
var SelectedNodeID = 0;
var ServerPID = -1;
var SoundEnable = <?=intval($CUser->Data['sound_enable']);?>;
var sndBeep = new Howl({
src: [
'/style/assets/audio/beep-07a.mp3',
'/style/assets/audio/beep-07a.wav'
],
loop: false,
volume: 0.99,
onend: function() {
console.log('Finished!');
}
});
var sndExcl = new Howl({
src: [
'/style/assets/audio/button-42.mp3',
'/style/assets/audio/button-42.wav'
],
loop: false,
volume: 0.99
});
function playSound( t ){
if( SoundEnable ){
switch( t ){
case 1:{
sndBeep.play();
break;
};
default:{
sndExcl.play();
};
};
};
};
function Refresh(){
function doRefresh(){
window.location="/?t="+123;
};
function doLogout(){
//window.location = '/login.php?UID=1';
};
//https://www.javascripttutorial.net/web-apis/javascript-notification/
//https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web
function failureAJAXFunction( responce, opts ){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
//timelineObj = null;
};
playSound();
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
doLogout();
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: <?=$SiteID;?>,
SAID: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
@ -31,42 +83,54 @@ function updateUserScreenResolution( x, y ){
HEI: y
},
success: function( response, opts ){
Refresh();
doRefresh();
},
failure: failureAJAXFunction
});
};
function CheckWindowSize(delay){
function removeAllFromSite(){
Ext.Ajax.request({
url: '/lib/controller/resetAllSettings.php',
params: {
SAID: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
doRefresh();
},
failure: failureAJAXFunction
});
};
function doCheckWindowSize(){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
if ( winH2<700 ) winH2=700;
};
};
//alert(winW2+':'+winW+' '+winH2+':'+winH);
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
updateUserScreenResolution( winW2, winH2 );
};
};
Ext.onReady(function(){
//Check Screen Size
//alert( winW + 'x' + winH );
CheckWindowSize();
var NotificationStack = null;
Ext.onReady(function(){
doCheckWindowSize();
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
//window.onresize = doCheckWindowSize;
Ext.QuickTips.init();
var viewport = new Ext.Viewport({
id: 'main_viewport',
layout:'border',
@ -77,16 +141,16 @@ Ext.onReady(function(){
height: 50,
items:[{
xtype: 'panel',
id:'top',
id:'top',
baseCls: 'x-plain',
html: '<p style="padding:10px;color:#556677;font-size:11px;"><img src="/style/img/logo32.png">&nbsp;R-Goose Security System</p>'
html: '<p style="padding:10px;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
}]
},{
xtype: 'panel',
id:'btns',
region:'west',
bsaseCls:'x-plain',
title: 'R-Goose System',
title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
collapsible: true,
split:true,
width:150,
@ -99,7 +163,7 @@ Ext.onReady(function(){
animate:true
},
items: [{
title: 'Dashboard',
title: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
layout: 'vbox',
height: 120,
pack: 'center',
@ -108,7 +172,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'go_home',
text: 'Go Home',
text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
handler: function( b, e ){
loadDashBoard();
}
@ -116,7 +180,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'go_monitor',
text: 'Monitor Events',
text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
handler: function( b, e ){
loadTimeLine();
}
@ -124,13 +188,11 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'go_out',
text: 'Logout',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
handler: doLogout
}]
},{
title: 'System Settings',
title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
layout: 'vbox',
height: 120,
pack: 'center',
@ -139,7 +201,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'sys_edit',
text: 'Edit Connections',
text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
handler: function( b, e ){
loadSystemEditor();
}
@ -147,7 +209,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'map_edit',
text: 'Edit Locations',
text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
handler: function( b, e ){
loadLocationEditor();
}
@ -155,19 +217,17 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'logout',
text: 'Logout',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
text: '<?=$Labels->GetLabel('_CLEAR_SITE_');?>',
handler: removeAllFromSite
}]
},{
title: 'Profile Settings',
title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
html: '<p>Panel content!</p>'
}
<?php
if( $CUser->Data['access'] > 5 ){
?>,{
title: 'Admin Settings',
title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
items:[{
xtype: 'button',
width: '100%',
@ -180,7 +240,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'adm_acclog',
text: 'Access Log',
text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
handler: function( b, e ){
loadAccessLog();
}
@ -188,7 +248,7 @@ Ext.onReady(function(){
xtype: 'button',
width: '100%',
id:'adm_servlog',
text: 'Server Log',
text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
handler: function( b, e ){
loadServerLog();
}
@ -203,7 +263,7 @@ Ext.onReady(function(){
region:'center',
margins: '5 5 5 0',
id: 'main_content',
title: 'System Dashboard',
title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
items:[{
xtype: 'portal',
id: 'main_portal',
@ -214,7 +274,7 @@ Ext.onReady(function(){
},
listeners:{
drop: function( a ){
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
}
}
}]

75
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -1,9 +1,42 @@
//<?php require_once('../../js_asm.php'); ?>
var selectedSite = <?=$SiteID;?>;
var SettingsLidar3D = null;
var SelectedNodeID = 0;
var resourceInfoWindow = null;
function showResourceInfo( rid ){
Ext.Ajax.request({
url: '/lib/controller/getResourceInfo.php',
params: {
RID: rid,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
if( resourceInfoWindow == null ){
resourceInfoWindow = new Ext.Window({
title: 'Resource Info',
modal: true,
width: 800,
height: 400,
layout: 'fit',
closeAction: 'hide',
items: [],
buttons:[{
text: `close`
}]
});
};
resourceInfoWindow.removeAll( true );
resourceInfoWindow.add( data );
resourceInfoWindow.show();
},
failure: failureAJAXFunction
});
};
function loadSettingsLidar3D( NodeID, Master ){
SelectedNodeID = NodeID;
Ext.Ajax.request({
@ -197,7 +230,7 @@ function reloadNetworkData(){
Ext.Ajax.request({
url: '/lib/controller/getNetwork.php',
params: {
NID: <?=$SiteID;?>,
NID: SelectedSite,//<?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
@ -413,12 +446,12 @@ function module_prop_FlyHunter( module_id ){
id: 0,
fields: ['myId', 'displayText' ],
data: [ <?php
$QS="SELECT so.id, so.name FROM nodes no LEFT JOIN sockets so ON( so.node_id = no.id ) WHERE ( no.type=0 OR no.type=20 ) AND no.site_id={$SiteID} AND so.type=1";
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 ) AND site_id={$SiteID} ";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['id']}, '{$R['name']}']";
$RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
};
echo implode( ',', $RE );
} else {
@ -493,7 +526,7 @@ function loadSystemEditor(){
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( 'System Map' );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SYS_MAP_');?>' );
tPanel.add({
columnWidth: 0.83,
frame: false,
@ -516,7 +549,7 @@ function loadSystemEditor(){
},
tbar: [{
xtype: 'splitbutton',
text: 'Add Laser Sensor',
text: '<?=$Labels->GetLabel('_SMM_ADD_LSEN_');?>',
split: true,
enableToggle : undefined,
menu : {
@ -554,28 +587,34 @@ function loadSystemEditor(){
}
},{
xtype: 'splitbutton',
text: 'Add Additional Equipment',
text: '<?=$Labels->GetLabel('_SMM_ADD_ADDIT_');?>',
split: true,
enableToggle : true,
menu : {
items: [{
text:'Static Analog Camera',
icon: '/style/assets/11_node.png'
icon: '/style/assets/11_node.png',
handler: function(){
SelectedCamTYPE = 10;
}
},{
text:'PTZ Analog Camera',
icon: '/style/assets/12_node.png'
icon: '/style/assets/12_node.png',
handler: function(){
SelectedCamTYPE = 11;
}
},{
text:'Static IP Camera',
icon: '/style/assets/11_node.png',
handler: function(){
SelectedCamPTZ = false;
SelectedCamTYPE = 12;
addIpCam();
}
},{
text:'PTZ IP Camera',
icon: '/style/assets/12_node.png',
handler: function(){
SelectedCamPTZ = true;
SelectedCamTYPE = 13;
addIpCam();
}
},{
@ -598,10 +637,10 @@ function loadSystemEditor(){
icon: '/style/assets/adam-1.png',
}]
}
},{
},/*{
xtype: 'button',
id: 'connectstarterbutton',
text: 'Add Connection',
text: '<?=$Labels->GetLabel('_ADD_CONNECTION_');?>',
enableToggle : undefined,
handler: function(){
if( InConnectEditMode ){
@ -614,7 +653,7 @@ function loadSystemEditor(){
startCreateConnection();
};
}
},{
}, */ {
xtype: 'button',
id: 'deletecomponentbutton',
text: 'Remove Component',
@ -632,7 +671,7 @@ function loadSystemEditor(){
}]
});
tPanel.add({
title: 'Properties',
title: '<?=$Labels->GetLabel('_PROPERTIES_');?>',
xtype: 'panel',
flex: 1,
height: 700,
@ -650,7 +689,7 @@ function loadSystemEditor(){
Ext.Ajax.request({
url: '/lib/controller/getNetwork.php',
params: {
NID: selectedSite,
NID: SelectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},

36
lib/javascript/jsapi_dynamic/rgoose_timeline.js

@ -139,9 +139,9 @@ function loadTimeLineGroups( NID ){
Ext.Ajax.request({
url: '/lib/controller/getTimeLineGroups.php',
params: {
NID: NID,
NID: NID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
SID: '<?=$Session;?>'
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
@ -149,9 +149,9 @@ function loadTimeLineGroups( NID ){
//for(var i = 0; i < data.length; i++) {
//tlGroups.add(data[i]);
//};
tlGroups.update( data );
loadTimeLineItems( selectedSite );
tlInterval = window.setInterval( loadTimeLineItems, 333, selectedSite );
tlGroups.update( data );
loadTimeLineItems( SelectedSite );
tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite );
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
@ -207,8 +207,8 @@ function loadMapZones( SID ){
};
//tlGroups.update( data );
//loadTimeLineItems( selectedSite );
LoadMapEvents( selectedSite );
tlInterval = window.setInterval( LoadMapEvents, 333, selectedSite );
LoadMapEvents( SelectedSite );
tlInterval = window.setInterval( LoadMapEvents, 333, SelectedSite );
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
@ -222,10 +222,10 @@ function loadTimeLineItems( NID ){
Ext.Ajax.request({
url: '/lib/controller/getTimeLineEvents.php',
params: {
NID: NID,
NID: NID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
LTS: tlLastTS
SID: '<?=$Session;?>',
LTS: tlLastTS
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
@ -326,18 +326,18 @@ function loadEventProperties( EventID ){
Ext.Ajax.request({
url: '/lib/controller/getEventProps.php',
params: {
NID: <?=$SiteID;?>,
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
EVENT: EventID
SID: '<?=$Session;?>',
EVENT: EventID
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
@ -545,7 +545,7 @@ function loadTimeLine(){
maxZoom: 24,
}).addTo(map); */
//loadTimeLineGroups( selectedSite );
loadMapZones( selectedSite );
loadMapZones( SelectedSite );
eventsListStore.load({params:{start:0, limit:50}});
};

style/images/layers-2x.png → lib/javascript/leaflet/images/layers-2x.png

style/images/layers.png → lib/javascript/leaflet/images/layers.png

style/images/marker-icon-2x.png → lib/javascript/leaflet/images/marker-icon-2x.png

style/images/marker-icon.png → lib/javascript/leaflet/images/marker-icon.png

style/images/marker-shadow.png → lib/javascript/leaflet/images/marker-shadow.png

13
lib/javascript/pnotyfy/Angeler.css
File diff suppressed because it is too large
View File

13
lib/javascript/pnotyfy/BrightTheme.css
File diff suppressed because it is too large
View File

1
lib/javascript/pnotyfy/Material.css
File diff suppressed because it is too large
View File

1
lib/javascript/pnotyfy/PNotify.css

@ -0,0 +1 @@
body>.pnotify.pnotify-positioned{position:fixed;z-index:100040}body>.pnotify.pnotify-modal{z-index:100042}.pnotify{height:auto;display:none;transition:opacity .1s linear;opacity:0}.pnotify.pnotify-positioned{position:absolute;z-index:1}.pnotify.pnotify-modal{z-index:3}.pnotify.pnotify-in{display:block;opacity:1}.pnotify.pnotify-initial{display:block}.pnotify-hidden{visibility:hidden}.pnotify.pnotify-move{transition:left .4s ease,top .4s ease,right .4s ease,bottom .4s ease}.pnotify.pnotify-fade-slow{transition:opacity .4s linear;opacity:0}.pnotify.pnotify-fade-slow.pnotify.pnotify-move{transition:opacity .4s linear,left .4s ease,top .4s ease,right .4s ease,bottom .4s ease}.pnotify.pnotify-fade-normal{transition:opacity .25s linear;opacity:0}.pnotify.pnotify-fade-normal.pnotify.pnotify-move{transition:opacity .25s linear,left .4s ease,top .4s ease,right .4s ease,bottom .4s ease}.pnotify.pnotify-fade-fast{transition:opacity .1s linear;opacity:0}.pnotify.pnotify-fade-fast.pnotify.pnotify-move{transition:opacity .1s linear,left .4s ease,top .4s ease,right .4s ease,bottom .4s ease}.pnotify.pnotify-masking{display:block;-webkit-mask-image:linear-gradient( to bottom,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) );mask-image:linear-gradient( to bottom,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) )}.pnotify.pnotify-masking.pnotify-stack-up{-webkit-mask-image:linear-gradient( to top,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) );mask-image:linear-gradient( to top,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) )}.pnotify.pnotify-masking.pnotify-stack-left{-webkit-mask-image:linear-gradient( to left,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) );mask-image:linear-gradient( to left,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) )}.pnotify.pnotify-masking.pnotify-stack-right{-webkit-mask-image:linear-gradient( to right,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) );mask-image:linear-gradient( to right,rgba(0,0,0,0.8),rgba(0,0,0,0) 30px,rgba(0,0,0,0) )}.pnotify.pnotify-fade-in,.pnotify.pnotify-masking-in{opacity:1}.pnotify .pnotify-shadow{-webkit-box-shadow:0 6px 28px 0 rgba(0,0,0,.1);-moz-box-shadow:0 6px 28px 0 rgba(0,0,0,.1);box-shadow:0 6px 28px 0 rgba(0,0,0,.1)}.pnotify-container{position:relative;background-position:0 0;padding:.8em;height:100%;margin:0}.pnotify-container:after{content:' ';visibility:hidden;display:block;height:0;clear:both}.pnotify-closer,.pnotify-sticker{float:right;margin-left:.5em;cursor:pointer}[dir=rtl] .pnotify-closer,[dir=rtl] .pnotify-sticker{float:left;margin-right:.5em;margin-left:0}.pnotify-title{display:block;white-space:pre-line;margin-bottom:.4em;margin-top:0}.pnotify-text-with-max-height{overflow-y:auto;overscroll-behavior:contain;padding-bottom:.03em}.pnotify.pnotify-with-icon .pnotify-content{margin-left:24px}[dir=rtl] .pnotify.pnotify-with-icon .pnotify-content{margin-right:24px;margin-left:0}.pnotify-pre-line{white-space:pre-line}.pnotify-icon,.pnotify-icon span{display:block;float:left}[dir=rtl] .pnotify-icon,[dir=rtl] .pnotify-icon span{float:right}.pnotify-modal-overlay{background-color:rgba(0,0,0,.6);top:0;left:0;position:absolute;height:100%;width:100%;z-index:2;transition:opacity .25s linear;opacity:0;padding:0;display:flex;justify-content:center;align-items:flex-end}.pnotify-modal-overlay-up{align-items:flex-start}.pnotify-modal-overlay-left{justify-content:flex-start;align-items:center}.pnotify-modal-overlay-right{justify-content:flex-end;align-items:center}.pnotify-modal-overlay.pnotify-modal-overlay-in{opacity:1}.pnotify-modal-overlay-closes:after{content:'×';font-family:Arial;font-size:3rem;color:#fff;text-shadow:0 0 .4rem #fff}body>.pnotify-modal-overlay{position:fixed;z-index:100041}

5269
lib/javascript/pnotyfy/PNotify.js
File diff suppressed because it is too large
View File

612
lib/javascript/pnotyfy/PNotifyAnimate.js

@ -0,0 +1,612 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyAnimate = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component) throw new Error('Function called outside component initialization');
return current_component;
}
function onDestroy(fn) {
get_current_component().$$.on_destroy.push(fn);
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var position = "PrependContainer";
var defaults = {
inClass: null,
outClass: null
};
function instance($$self, $$props, $$invalidate) {
var _$$props$self = $$props.self,
self = _$$props$self === void 0 ? null : _$$props$self;
var _$$props$inClass = $$props.inClass,
inClass = _$$props$inClass === void 0 ? defaults.inClass : _$$props$inClass;
var _$$props$outClass = $$props.outClass,
outClass = _$$props$outClass === void 0 ? defaults.outClass : _$$props$outClass;
var _animation = self.animation;
var _animateIn = self.animateIn;
var _animateOut = self.animateOut;
onDestroy(function () {
self.$set({
animation: _animation,
animateIn: _animateIn,
animateOut: _animateOut
});
});
self.on("pnotify:update", function () {
if (self.refs.elem) {
var animSpeed = 250;
if (self.animateSpeed === "slow") {
animSpeed = 400;
} else if (self.animateSpeed === "fast") {
animSpeed = 100;
} else if (self.animateSpeed > 0) {
animSpeed = self.animateSpeed;
}
animSpeed = animSpeed / 1000;
if (self.refs.elem.style.animationDuration !== "".concat(animSpeed, "s")) {
$$invalidate(0, self.refs.elem.style.animationDuration = "".concat(animSpeed, "s"), self);
}
}
});
function animateIn(callback, immediate) {
// Declare that the notice is animating in.
self.setAnimating("in");
var off;
var finished = function finished(event) {
if (event && self.refs.elem && event.target !== self.refs.elem) {
return;
}
off();
self.setAnimatingClass("pnotify-in animated");
if (callback) {
callback.call();
} // Declare that the notice has completed animating.
self.setAnimating(false);
};
off = self.on("animationend", finished);
if (immediate) {
finished();
} else {
self.setAnimatingClass("pnotify-in animated ".concat(inClass || outClass));
}
}
function animateOut(callback, immediate) {
// Declare that the notice is animating out.
self.setAnimating("out");
var off;
var finished = function finished(event) {
if (event && self.refs.elem && event.target !== self.refs.elem) {
return;
}
off();
self.setAnimatingClass("animated");
if (callback) {
callback.call();
} // Declare that the notice has completed animating.
if (self.setAnimating) {
self.setAnimating(false);
}
};
off = self.on("animationend", finished);
if (immediate) {
finished();
} else {
self.setAnimatingClass("pnotify-in animated ".concat(outClass || inClass));
}
}
self.attention = function (aniClass, callback) {
var off;
var cb = function cb() {
off();
self.removeModuleClass("container", "animated", aniClass);
if (callback) {
callback.call(self);
}
};
off = self.on("animationend", cb);
self.addModuleClass("container", "animated", aniClass);
};
$$self.$$set = function ($$props) {
if ("self" in $$props) $$invalidate(0, self = $$props.self);
if ("inClass" in $$props) $$invalidate(1, inClass = $$props.inClass);
if ("outClass" in $$props) $$invalidate(2, outClass = $$props.outClass);
};
$$self.$$.update = function () {
if ($$self.$$.dirty &
/*inClass, outClass, self*/
7) {
if (inClass || outClass) {
self.$set({
animation: "none",
animateIn: animateIn,
animateOut: animateOut
});
} else {
self.$set({
animation: _animation,
animateIn: _animateIn,
animateOut: _animateOut
});
}
}
};
return [self, inClass, outClass];
}
var Animate = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Animate, _SvelteComponent);
var _super = _createSuper(Animate);
function Animate(options) {
var _this;
_classCallCheck(this, Animate);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, instance, null, safe_not_equal, {
self: 0,
inClass: 1,
outClass: 2
});
return _this;
}
return Animate;
}(SvelteComponent);
exports.default = Animate;
exports.defaults = defaults;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

1
lib/javascript/pnotyfy/PNotifyBootstrap4.css

@ -0,0 +1 @@
.pnotify .bootstrap4-title{font-size:1.2rem}.pnotify .bootstrap4-icon>*{position:relative;line-height:1.2rem}.pnotify.pnotify-with-icon .bootstrap4-ml{margin-left:24px}[dir=rtl] .pnotify.pnotify-with-icon .bootstrap4-ml{margin-right:24px;margin-left:0}

471
lib/javascript/pnotyfy/PNotifyBootstrap4.js

@ -0,0 +1,471 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyBootstrap4 = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var position = "PrependContainer";
var defaults = {};
function init$1(eventDetail) {
eventDetail.defaults.styling = {
prefix: "bootstrap4",
container: "alert",
notice: "alert-warning",
info: "alert-info",
success: "alert-success",
error: "alert-danger",
// Confirm Module
"action-bar": "bootstrap4-ml",
"prompt-bar": "bootstrap4-ml",
btn: "btn mx-1",
"btn-primary": "btn-primary",
"btn-secondary": "btn-secondary",
input: "form-control"
};
}
var Bootstrap4 = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Bootstrap4, _SvelteComponent);
var _super = _createSuper(Bootstrap4);
function Bootstrap4(options) {
var _this;
_classCallCheck(this, Bootstrap4);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, null, null, safe_not_equal, {});
return _this;
}
return Bootstrap4;
}(SvelteComponent);
exports.default = Bootstrap4;
exports.defaults = defaults;
exports.init = init$1;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

1
lib/javascript/pnotyfy/PNotifyConfirm.css

@ -0,0 +1 @@
.pnotify-action-bar,.pnotify-prompt-bar{margin-top:5px;clear:both}.pnotify-action-bar{display:flex;flex-wrap:wrap;justify-content:flex-end}.pnotify-prompt-input{margin-bottom:5px;display:block;width:100%}

1306
lib/javascript/pnotyfy/PNotifyConfirm.js
File diff suppressed because it is too large
View File

1
lib/javascript/pnotyfy/PNotifyCountdown.css

@ -0,0 +1 @@
.pnotify-countdown{position:absolute;top:100%;left:0;width:100%;height:.5em;display:flex;justify-content:center;align-items:center}.pnotify-countdown-top{top:auto;bottom:100%}.pnotify-countdown-left{top:0;right:100%;left:auto;height:100%;width:.5em}.pnotify-countdown-right{top:0;left:100%;height:100%;width:.5em}.pnotify-countdown-bar{position:absolute;top:0;left:0;transition:width .1s linear}.pnotify-countdown-reverse .pnotify-countdown-bar{top:auto;left:auto;right:0;bottom:0}

74
lib/javascript/pnotyfy/PNotifyCountdown.js

@ -0,0 +1,74 @@
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.PNotifyCountdown={}));}(this,(function(exports){'use strict';function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function(obj){return typeof obj;};}else{_typeof=function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}
return _typeof(obj);}
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
return self;}
function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}
return _assertThisInitialized(self);}
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}
return _possibleConstructorReturn(this,result);};}
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}
function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}
function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}
function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}
function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter);}
function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}
return _arr;}
function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}
function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function noop(){}
function run(fn){return fn();}
function blank_object(){return Object.create(null);}
function run_all(fns){fns.forEach(run);}
function is_function(thing){return typeof thing==='function';}
function safe_not_equal(a,b){return a!=a?b==b:a!==b||a&&_typeof(a)==='object'||typeof a==='function';}
function is_empty(obj){return Object.keys(obj).length===0;}
function append(target,node){target.appendChild(node);}
function insert(target,node,anchor){target.insertBefore(node,anchor||null);}
function detach(node){node.parentNode.removeChild(node);}
function element(name){return document.createElement(name);}
function text(data){return document.createTextNode(data);}
function empty(){return text('');}
function attr(node,attribute,value){if(value==null)node.removeAttribute(attribute);else if(node.getAttribute(attribute)!==value)node.setAttribute(attribute,value);}
function children(element){return Array.from(element.childNodes);}
var current_component;function set_current_component(component){current_component=component;}
function get_current_component(){if(!current_component)throw new Error('Function called outside component initialization');return current_component;}
function onMount(fn){get_current_component().$$.on_mount.push(fn);}
function onDestroy(fn){get_current_component().$$.on_destroy.push(fn);}
var dirty_components=[];var binding_callbacks=[];var render_callbacks=[];var flush_callbacks=[];var resolved_promise=Promise.resolve();var update_scheduled=false;function schedule_update(){if(!update_scheduled){update_scheduled=true;resolved_promise.then(flush);}}
function add_render_callback(fn){render_callbacks.push(fn);}
var flushing=false;var seen_callbacks=new Set();function flush(){if(flushing)return;flushing=true;do{for(var i=0;i<dirty_components.length;i+=1){var component=dirty_components[i];set_current_component(component);update(component.$$);}
set_current_component(null);dirty_components.length=0;while(binding_callbacks.length){binding_callbacks.pop()();}
for(var _i=0;_i<render_callbacks.length;_i+=1){var callback=render_callbacks[_i];if(!seen_callbacks.has(callback)){seen_callbacks.add(callback);callback();}}
render_callbacks.length=0;}while(dirty_components.length);while(flush_callbacks.length){flush_callbacks.pop()();}
update_scheduled=false;flushing=false;seen_callbacks.clear();}
function update($$){if($$.fragment!==null){$$.update();run_all($$.before_update);var dirty=$$.dirty;$$.dirty=[-1];$$.fragment&&$$.fragment.p($$.ctx,dirty);$$.after_update.forEach(add_render_callback);}}
var outroing=new Set();function transition_in(block,local){if(block&&block.i){outroing["delete"](block);block.i(local);}}
function mount_component(component,target,anchor){var _component$$$=component.$$,fragment=_component$$$.fragment,on_mount=_component$$$.on_mount,on_destroy=_component$$$.on_destroy,after_update=_component$$$.after_update;fragment&&fragment.m(target,anchor);add_render_callback(function(){var new_on_destroy=on_mount.map(run).filter(is_function);if(on_destroy){on_destroy.push.apply(on_destroy,_toConsumableArray(new_on_destroy));}else{run_all(new_on_destroy);}
component.$$.on_mount=[];});after_update.forEach(add_render_callback);}
function destroy_component(component,detaching){var $$=component.$$;if($$.fragment!==null){run_all($$.on_destroy);$$.fragment&&$$.fragment.d(detaching);$$.on_destroy=$$.fragment=null;$$.ctx=[];}}
function make_dirty(component,i){if(component.$$.dirty[0]===-1){dirty_components.push(component);schedule_update();component.$$.dirty.fill(0);}
component.$$.dirty[i/31|0]|=1<<i%31;}
function init(component,options,instance,create_fragment,not_equal,props){var dirty=arguments.length>6&&arguments[6]!==undefined?arguments[6]:[-1];var parent_component=current_component;set_current_component(component);var prop_values=options.props||{};var $$=component.$$={fragment:null,ctx:null,props:props,update:noop,not_equal:not_equal,bound:blank_object(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(parent_component?parent_component.$$.context:[]),callbacks:blank_object(),dirty:dirty,skip_bound:false};var ready=false;$$.ctx=instance?instance(component,prop_values,function(i,ret){var value=(arguments.length<=2?0:arguments.length-2)?arguments.length<=2?undefined:arguments[2]:ret;if($$.ctx&&not_equal($$.ctx[i],$$.ctx[i]=value)){if(!$$.skip_bound&&$$.bound[i])$$.bound[i](value);if(ready)make_dirty(component,i);}
return ret;}):[];$$.update();ready=true;run_all($$.before_update);$$.fragment=create_fragment?create_fragment($$.ctx):false;if(options.target){if(options.hydrate){var nodes=children(options.target);$$.fragment&&$$.fragment.l(nodes);nodes.forEach(detach);}else{$$.fragment&&$$.fragment.c();}
if(options.intro)transition_in(component.$$.fragment);mount_component(component,options.target,options.anchor);flush();}
set_current_component(parent_component);}
var SvelteComponent=function(){function SvelteComponent(){_classCallCheck(this,SvelteComponent);}
_createClass(SvelteComponent,[{key:"$destroy",value:function $destroy(){destroy_component(this,1);this.$destroy=noop;}},{key:"$on",value:function $on(type,callback){var callbacks=this.$$.callbacks[type]||(this.$$.callbacks[type]=[]);callbacks.push(callback);return function(){var index=callbacks.indexOf(callback);if(index!==-1)callbacks.splice(index,1);};}},{key:"$set",value:function $set($$props){if(this.$$set&&!is_empty($$props)){this.$$.skip_bound=true;this.$$set($$props);this.$$.skip_bound=false;}}}]);return SvelteComponent;}();function create_if_block(ctx){var div1;var div0;var div0_class_value;var div0_style_value;var div1_class_value;return{c:function c(){div1=element("div");div0=element("div");attr(div0,"class",div0_class_value="pnotify-countdown-bar ".concat(ctx[0].getStyle("countdown-bar")));attr(div0,"style",div0_style_value="height: ".concat(ctx[1]==="right"||ctx[1]==="left"?ctx[3]:"100","%; width: ").concat(ctx[1]==="top"||ctx[1]==="bottom"?ctx[3]:"100","%;"));attr(div1,"class",div1_class_value="pnotify-countdown pnotify-countdown-".concat(ctx[1]," ").concat(ctx[2]?"pnotify-countdown-reverse":""," ").concat(ctx[0].getStyle("countdown")));},m:function m(target,anchor){insert(target,div1,anchor);append(div1,div0);},p:function p(ctx,dirty){if(dirty&1&&div0_class_value!==(div0_class_value="pnotify-countdown-bar ".concat(ctx[0].getStyle("countdown-bar")))){attr(div0,"class",div0_class_value);}
if(dirty&10&&div0_style_value!==(div0_style_value="height: ".concat(ctx[1]==="right"||ctx[1]==="left"?ctx[3]:"100","%; width: ").concat(ctx[1]==="top"||ctx[1]==="bottom"?ctx[3]:"100","%;"))){attr(div0,"style",div0_style_value);}
if(dirty&7&&div1_class_value!==(div1_class_value="pnotify-countdown pnotify-countdown-".concat(ctx[1]," ").concat(ctx[2]?"pnotify-countdown-reverse":""," ").concat(ctx[0].getStyle("countdown")))){attr(div1,"class",div1_class_value);}},d:function d(detaching){if(detaching)detach(div1);}};}
function create_fragment(ctx){var if_block_anchor;var if_block=ctx[4]&&create_if_block(ctx);return{c:function c(){if(if_block)if_block.c();if_block_anchor=empty();},m:function m(target,anchor){if(if_block)if_block.m(target,anchor);insert(target,if_block_anchor,anchor);},p:function p(ctx,_ref){var _ref2=_slicedToArray(_ref,1),dirty=_ref2[0];if(ctx[4]){if(if_block){if_block.p(ctx,dirty);}else{if_block=create_if_block(ctx);if_block.c();if_block.m(if_block_anchor.parentNode,if_block_anchor);}}else if(if_block){if_block.d(1);if_block=null;}},i:noop,o:noop,d:function d(detaching){if(if_block)if_block.d(detaching);if(detaching)detach(if_block_anchor);}};}
var position="AppendContainer";var defaults={anchor:"bottom",reverse:false};function instance($$self,$$props,$$invalidate){var _$$props$self=$$props.self,self=_$$props$self===void 0?null:_$$props$self;var _$$props$anchor=$$props.anchor,anchor=_$$props$anchor===void 0?defaults.anchor:_$$props$anchor;var _$$props$reverse=$$props.reverse,reverse=_$$props$reverse===void 0?defaults.reverse:_$$props$reverse;var _state=self.getState();var _timer=self.getTimer();var _msLeft=0;var _percent=100;var ival;var offUpdate;var offAfterOpen;var getValues=function getValues(){$$invalidate(5,_state=self.getState());$$invalidate(6,_timer=self.getTimer());};onMount(function(){offUpdate=self.on("pnotify:update",getValues);offAfterOpen=self.on("pnotify:afterOpen",getValues);ival=setInterval(function(){if(showCountdown){if(timeStart){_msLeft=self.delay-(new Date()-timeStart);$$invalidate(3,_percent=_msLeft/self.delay*100);}else{$$invalidate(3,_percent=_state==="closing"?0:100);}}},100);});onDestroy(function(){offUpdate&&offUpdate();offAfterOpen&&offAfterOpen();clearInterval(ival);});$$self.$$set=function($$props){if("self"in $$props)$$invalidate(0,self=$$props.self);if("anchor"in $$props)$$invalidate(1,anchor=$$props.anchor);if("reverse"in $$props)$$invalidate(2,reverse=$$props.reverse);};var showCountdown;var timeStart;$$self.$$.update=function(){if($$self.$$.dirty&33){$$invalidate(4,showCountdown=["opening","open","closing"].indexOf(_state)!==-1&&self.hide&&self.delay!==Infinity);}
if($$self.$$.dirty&80){timeStart=showCountdown&&_timer&&_timer!=="prevented"?new Date():null;}
if($$self.$$.dirty&19){{self.removeModuleClass("elem","pnotify-with-countdown","pnotify-with-countdown-bottom","pnotify-with-countdown-top","pnotify-with-countdown-left","pnotify-with-countdown-right");if(showCountdown){self.addModuleClass("elem","pnotify-with-countdown","pnotify-with-countdown-".concat(anchor));}}}};return[self,anchor,reverse,_percent,showCountdown];}
var Countdown=function(_SvelteComponent){_inherits(Countdown,_SvelteComponent);var _super=_createSuper(Countdown);function Countdown(options){var _this;_classCallCheck(this,Countdown);_this=_super.call(this);init(_assertThisInitialized(_this),options,instance,create_fragment,safe_not_equal,{self:0,anchor:1,reverse:2});return _this;}
return Countdown;}(SvelteComponent);exports.default=Countdown;exports.defaults=defaults;exports.position=position;Object.defineProperty(exports,'__esModule',{value:true});})));

1
lib/javascript/pnotyfy/PNotifyDesktop.css

@ -0,0 +1 @@
[data-pnotify].pnotify-desktop-hide{left:-10000px!important;display:none!important}

700
lib/javascript/pnotyfy/PNotifyDesktop.js

@ -0,0 +1,700 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyDesktop = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var position = "PrependContainer";
var defaults = {
fallback: true,
icon: null,
tag: null,
title: null,
text: null,
options: {}
};
function requestPermission() {
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
Notification.requestPermission();
} else if ("webkitNotifications" in window) {
window.webkitNotifications.requestPermission();
}
}
var Notification = window.Notification;
var _notify = function notify(title, options, onclick, onclose) {
// Memoize based on feature detection.
if ("Notification" in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = new Notification(title, options);
if ("NotificationEvent" in window) {
notice.addEventListener("notificationclick", onclick);
notice.addEventListener("close", onclose);
} else if ("addEventListener" in notice) {
notice.addEventListener("click", onclick);
notice.addEventListener("close", onclose);
} else {
notice.onclick = onclick;
notice.onclose = onclose;
}
return notice;
};
} else if ("mozNotification" in navigator) {
_notify = function notify(title, options, onclick, onclose) {
// Gecko < 22
var notice = navigator.mozNotification.createNotification(title, options.body, options.icon).show();
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else if ("webkitNotifications" in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = window.webkitNotifications.createNotification(options.icon, title, options.body);
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else {
_notify = function notify(title, options, onclick, onclose) {
return null;
};
}
return _notify(title, options, onclick, onclose);
};
function checkPermission() {
if (typeof Notification !== "undefined" && "permission" in Notification) {
return Notification.permission === "granted";
} else if ("webkitNotifications" in window) {
return window.webkitNotifications.checkPermission() == 0;
}
return false;
}
var _permission = checkPermission();
function instance($$self, $$props, $$invalidate) {
var _$$props$self = $$props.self,
self = _$$props$self === void 0 ? null : _$$props$self;
var _$$props$fallback = $$props.fallback,
fallback = _$$props$fallback === void 0 ? defaults.fallback : _$$props$fallback;
var _$$props$icon = $$props.icon,
icon = _$$props$icon === void 0 ? defaults.icon : _$$props$icon;
var _$$props$tag = $$props.tag,
tag = _$$props$tag === void 0 ? defaults.tag : _$$props$tag;
var _$$props$title = $$props.title,
title = _$$props$title === void 0 ? defaults.title : _$$props$title;
var _$$props$text = $$props.text,
text = _$$props$text === void 0 ? defaults.text : _$$props$text;
var _$$props$options = $$props.options,
options = _$$props$options === void 0 ? defaults.options : _$$props$options;
var _desktop; // Animation should always be 'none' for desktop notices, but remember
// the old animation so it can be recovered.
var _oldAnimation = "none";
var _icon;
var _tag;
self.on("pnotify:beforeOpen", function () {
if (!_permission) {
requestPermission();
return;
}
if (_desktop && "show" in _desktop) {
self.setModuleOpen(true);
_desktop.show();
}
});
self.on("pnotify:beforeClose", function () {
if (!_permission) {
return;
}
if (_desktop && "close" in _desktop) {
_desktop.close();
self.setModuleOpen(false);
}
});
_permission = checkPermission();
if (_permission) {
self.addModuleClass("elem", "pnotify-desktop-hide");
self.animation = "none";
genNotice();
} else if (!fallback) {
// Keep the notice from opening if fallback is false.
self.autoOpen = false;
}
function genNotice() {
if (icon === null) {
switch (self.type) {
case "error":
_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQg7e6HvQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABr0lEQVRYw8WXu0oDQRSGv7hRSFYrLTTWKihaqUgUJO+gphBLL1jYpPSCVcAggpWthYhC7Ows9An0IbSPkMRCw8ZmFuI6yczs9cAPuzNz5v92brtrESxGARtokkCcAg2hk7jNl4G2R/m4zFPAiwTgWdRFHnmJuaulOAAaPQDqUZvv9DB3tR0lwIcGwHtU5uca5q4qYZvngJbHpAZ8CtU8dS1gLEyAisegBGTFKWiL65KnzVlY5uOSId6VtNuTtMupOu/TAHiQlNmSskHNXCOAGWBeUp7VhFoApoMAXAOWJoCszBJ9+ALY6vL0JiPgjsKmKUAaOOoBZwIAcNxlJLsCrAOTIQJMAWu62y4LOIqT7lGS96TIcYCMDkBZ46h1gB+PHI28ssq8X/G6DaqG8Piz2DrjVjGXbtSBy46F5QAHwJAizwZugKKscs7gSaqS/KpB/qxsFxwafhf6Odb/eblJi8BGwJdW26BtURxQpMU83hmaDQsNiPtvYMSwj3tgAqDgYzU7wJdHjo9+CgBvEW47lV5Tgj5DMtG0xIfESkIAF+522gdWxTzGEX3i9+6KpOMXF5UBt0NKJCAAAAAASUVORK5CYII=";
break;
case "success":
_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQPRj+65AAAAdBJREFUWMPtlzsvRFEQx3+7HmEjoiYKolVJJDRqnS8ggvVIVEQhCIUsEYJGCEH2E4h4FPREaLTbEo1IEJXHrmY2GTf33nPuY7ud5OTenTMz//89Z86ZWShLWf5LB3AOfACFiOMF2AkC3qOc88BXxFEAxlX8ftGdaNCEen8H6oFHYBR4FocwkpTngzzHgF01fwL0aYcp9fVtMW/rsMcWXWijK1Hexgye9smRT6CxaHgjytMYwccNSXqoja9FeVbiZS+OVaeDiUBLAPAJA/i2m5MXgRSQk7llC/DBMOBeBGqAe0eAjQhfvurH3EmgQk6EW6CVEHt+ZFo6J4EU8OoTcF35jhnAl2wSx20LFgyB1yyOWtY2c72ScMAAkPeZy6g4zUBdGAIAcyEq4Z7y7xbdTFgCACMBwPVJqVDHeNqvaplkH5i0sNuUwmaNkQxww20ZSOy7gFvX7SAk0i76jPQQlJoAwAEwq35ngfmwVatSdUMArZZ+K9JQ1Bp6iGqgSt7f/AIOqSzujLEn6AV+JG6zm4HuCZ+AJuAbWAQu5aIJu7JDck0ngDugC/j1c2qPqR13jpxuvWyS8liY/kQcean/lX6ACQ99DdAQYe+Lf0zylMUgf7qDKgzv284QAAAAAElFTkSuQmCC";
break;
case "info":
_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQ09zRTwAAAAdxJREFUWMPtl88rRFEUxz8zBolRCgsrpOym8TMSO2WplLKwUrKi/B0W7JSFmhVLNlhSlLKx8CtRGpEsJpofpZk3Nkc9b968e++8mdlw6vTeu/edc773nl/3wl+ngOH/zUAf0AN0AmEgB7wCD8AtcFMJoM3ADpAHLHk62RIwL8B0uQwHgXVRnDfkS2DSj/EW4K0Ew05eLMV4O/CuUJwEUvJUgdgwMd4IpBUKl13kVG6aL+ZjJ20DDQqQXy5jKYVMDBhVrb5f069LLrKfGnInqh040HRTvsTAHgei9oGQ7X0YaNNUNCdFKChgQvKtQ1vAkNvEahlSToez9oXad2BCA30ceHZxRxMQMShuvZLmv+hOA32/h+KUwS7MugVhqwb6Go+5nEEwht0ABDUEzyXdFsrQYwqMJjTbdxio9Qkg6QbgvkpnkLw0uQIAZ1UCYNkXawdw4qPCmVBcuADAMZCpAoCVYr3AKtYyHZSWauakjMx50TWwrzJw6lFARjQOt3se8jM6W9TloSCqIb9bRHbN5Fg+KkEZcow/Ak+KFBsD6h3jR8CUabAMlqn7xfxEbAdwWKLhhO3sGPCbOsNSvSyF0Z/5TaCuEleziLhmAOiWG1NWrmZXwIVU1A/+SZO+AcgLC4wt0zD3AAAAAElFTkSuQmCC";
break;
case "notice":
default:
_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATM4scOJLAAAAcxJREFUWMPtljtLA0EQx3+J0QRfnYqCiCA+MERBrIwgFtoFbMTOR61i5QcQBdEihZWNoEWwsNAvkMJeBLHRQtHC0iIP4utOmw2cx97d7l2SRgcGbufmv/Pf2dmdhb8uIR+YJqAPaBff30AeeAHuxLgqMgRkgS/AAEybGuLfEdBcycCTwKVYmY5mgO6gwdd8BLaqAST9Bs8EDG7VTd3gex4TbgEjwKjQOHDugZlRDb7sMZEJpCS4bYVMJOygsG1cB+wqHN0Gib1RYXFpLwL74nx7Sb3EFlXATQNjTgRagA3FbZIRiCliT5wITGgUaRACA0CPjMC4xtUcDUAgDAzLCCQ0MhALQCAE9MoIdGkQCJIBgE4ZgWiNMvDL10qgUMMMFGQEnjQmkLXbVg38s8y4qtFcTCAnHiJ5oKiJnSoHjVgIXAmHkGIl5yy+YcWruIy9dvqpupIDCfZWEXvh1gsWFVfxIbG9a3RbRwJnYiuqJYfAqxsBgBWFiQyJzfTAlIB1uzEicbwBFoBTl8lSwINoSuXKjrv4F4FBh61zlKUKvgn7/e5ZEngMEDgLdFSieHaAT42LpgTMVbqC24B54Bi4twV9E6cnDcw6PFj+RSo/l6rlSlldhx4AAAAASUVORK5CYII=";
break;
}
} else if (icon === false) {
_icon = null;
} else {
_icon = icon;
}
if (!_tag || tag !== null) {
_tag = tag === null ? "PNotify-".concat(Math.round(Math.random() * 1000000)) : tag;
}
var desktopOptions = {
body: text || self.text,
tag: _tag
};
if (!self.hide) {
desktopOptions.requireInteraction = true;
}
if (_icon !== null) {
desktopOptions.icon = _icon;
}
Object.apply(desktopOptions, options);
_desktop = _notify(title || self.title, desktopOptions, function () {
self.fire && self.fire("click", {
target: _desktop
});
}, function () {
self.close && self.close();
});
if (!("close" in _desktop) && "cancel" in _desktop) {
_desktop.close = function () {
_desktop.cancel();
};
}
}
$$self.$$set = function ($$props) {
if ("self" in $$props) $$invalidate(0, self = $$props.self);
if ("fallback" in $$props) $$invalidate(1, fallback = $$props.fallback);
if ("icon" in $$props) $$invalidate(2, icon = $$props.icon);
if ("tag" in $$props) $$invalidate(3, tag = $$props.tag);
if ("title" in $$props) $$invalidate(4, title = $$props.title);
if ("text" in $$props) $$invalidate(5, text = $$props.text);
if ("options" in $$props) $$invalidate(6, options = $$props.options);
};
$$self.$$.update = function () {
if ($$self.$$.dirty &
/*self, _permission, _oldAnimation*/
257) {
{
if (self.animation !== "none") {
$$invalidate(8, _oldAnimation = self.animation);
} // This is necessary so desktop notices don't cause spacing problems
// when positioning.
if (self.getAnimatingClass() !== "" && _permission) {
self.setAnimatingClass("");
}
if (!_permission && self.hasModuleClass("elem", "pnotify-desktop-hide")) {
self.removeModuleClass("elem", "pnotify-desktop-hide");
$$invalidate(0, self.animation = _oldAnimation, self);
} else if (_permission && !self.hasModuleClass("elem", "pnotify-desktop-hide")) {
self.addModuleClass("elem", "pnotify-desktop-hide");
$$invalidate(0, self.animation = "none", self);
genNotice();
}
}
}
if ($$self.$$.dirty &
/*self, _permission*/
1) {
{
self.setModuleHandled(_permission);
}
}
};
return [self, fallback, icon, tag, title, text, options];
}
var Desktop = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Desktop, _SvelteComponent);
var _super = _createSuper(Desktop);
function Desktop(options) {
var _this;
_classCallCheck(this, Desktop);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, instance, null, safe_not_equal, {
self: 0,
fallback: 1,
icon: 2,
tag: 3,
title: 4,
text: 5,
options: 6
});
return _this;
}
return Desktop;
}(SvelteComponent);
exports.default = Desktop;
exports.defaults = defaults;
exports.permission = requestPermission;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

471
lib/javascript/pnotyfy/PNotifyFontAwesome5.js

@ -0,0 +1,471 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyFontAwesome5 = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var position = "PrependContainer";
var defaults = {};
function init$1(eventDetail) {
// You must have Font Awesome v5.0+
eventDetail.defaults.icons = {
prefix: "fontawesome5",
notice: "fas fa-exclamation-circle",
info: "fas fa-info-circle",
success: "fas fa-check-circle",
error: "fas fa-exclamation-triangle",
// Buttons Module
closer: "fas fa-times",
sticker: "fas",
stuck: "fa-play",
unstuck: "fa-pause",
// Reference Module (Useful for other modules.)
refresh: "fas fa-sync"
};
}
var Font_awesome5 = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Font_awesome5, _SvelteComponent);
var _super = _createSuper(Font_awesome5);
function Font_awesome5(options) {
var _this;
_classCallCheck(this, Font_awesome5);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, null, null, safe_not_equal, {});
return _this;
}
return Font_awesome5;
}(SvelteComponent);
exports.default = Font_awesome5;
exports.defaults = defaults;
exports.init = init$1;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

548
lib/javascript/pnotyfy/PNotifyFontAwesome5Fix.js

@ -0,0 +1,548 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyFontAwesome5Fix = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component) throw new Error('Function called outside component initialization');
return current_component;
}
function onDestroy(fn) {
get_current_component().$$.on_destroy.push(fn);
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function tick() {
schedule_update();
return resolved_promise;
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var position = "PrependContainer";
var defaults = {};
function instance($$self, $$props, $$invalidate) {
var _$$props$self = $$props.self,
self = _$$props$self === void 0 ? null : _$$props$self; // This keeps the beforeUpdate handler from going into a loop when we're
// taming Font Awesome's magic.
var _updatingIcon = false;
var _updatingSticker = false; // Save the old value of icon, so we can do our magic.
var _oldIconProp = self.icon;
var _oldIconValue = self.icon === true ? self.getIcon(self.type) : self.icon;
var _oldSticker = "".concat(self.getIcon("sticker"), " ").concat(self.hide ? self.getIcon("unstuck") : self.getIcon("stuck"));
var newIconProp;
var newIconValue;
var newSticker;
var removeIconHandler = self.on("pnotify:update", function () {
if (_updatingIcon) {
return;
} // Font Awesome 5 uses dark magic by replacing the icon element with an SVG.
// In order to make it play nice with Svelte, we have to clear the element
// and make it again.
newIconProp = self.icon;
newIconValue = self.icon === true ? self.getIcon(self.type) : self.icon;
if (newIconValue !== _oldIconValue && (typeof newIconValue === "string" && newIconValue.match(/(^| )fa[srlb]($| )/) || typeof _oldIconValue === "string" && _oldIconValue.match(/(^| )fa[srlb]($| )/))) {
$$invalidate(0, self.icon = false, self);
_updatingIcon = true;
tick().then(function () {
$$invalidate(0, self.icon = newIconProp, self);
_updatingIcon = false; // Update seved icon.
_oldIconProp = newIconProp;
_oldIconValue = newIconValue;
});
} else {
// Update seved icon.
_oldIconProp = newIconProp;
_oldIconValue = newIconValue;
}
});
var removeStickerHandler = self.on("pnotify:update", function () {
if (_updatingSticker) {
return;
} // Font Awesome 5 uses dark magic by replacing the icon element with an SVG.
// In order to make it play nice with Svelte, we have to clear the element
// and make it again.
newSticker = "".concat(self.getIcon("sticker"), " ").concat(self.hide ? self.getIcon("unstuck") : self.getIcon("stuck"));
if (self.sticker && newSticker !== _oldSticker && typeof newSticker === "string" && newSticker.match(/(^| )fa[srlb]($| )/)) {
$$invalidate(0, self.sticker = false, self);
_updatingSticker = true;
tick().then(function () {
$$invalidate(0, self.sticker = true, self);
_updatingSticker = false; // Update seved icon.
_oldSticker = newSticker;
});
} else {
// Update seved icon.
_oldSticker = newSticker;
}
});
onDestroy(function () {
removeIconHandler && removeIconHandler();
removeStickerHandler && removeStickerHandler();
});
$$self.$$set = function ($$props) {
if ("self" in $$props) $$invalidate(0, self = $$props.self);
};
return [self];
}
var Font_awesome5_fix = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Font_awesome5_fix, _SvelteComponent);
var _super = _createSuper(Font_awesome5_fix);
function Font_awesome5_fix(options) {
var _this;
_classCallCheck(this, Font_awesome5_fix);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, instance, null, safe_not_equal, {
self: 0
});
return _this;
}
return Font_awesome5_fix;
}(SvelteComponent);
exports.default = Font_awesome5_fix;
exports.defaults = defaults;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

1
lib/javascript/pnotyfy/PNotifyMobile.css

@ -0,0 +1 @@
[data-pnotify] .pnotify-container{position:relative}[data-pnotify] .pnotify-mobile-animate-left{transition:left .1s ease}[data-pnotify] .pnotify-mobile-animate-top{transition:top .1s ease}@media(max-width:480px){[data-pnotify].pnotify{font-size:1.2em;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;font-smoothing:antialiased}body>[data-pnotify].pnotify{position:fixed}[data-pnotify].pnotify.pnotify-stack-down,[data-pnotify].pnotify.pnotify-stack-up{width:100%!important}[data-pnotify].pnotify.pnotify-stack-right,[data-pnotify].pnotify.pnotify-stack-left{height:100%!important}[data-pnotify].pnotify .pnotify-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}[data-pnotify].pnotify.pnotify-stack-down .pnotify-shadow{border-bottom-width:5px}[data-pnotify].pnotify.pnotify-stack-up .pnotify-shadow{border-top-width:5px}[data-pnotify].pnotify.pnotify-stack-right .pnotify-shadow{border-right-width:5px}[data-pnotify].pnotify.pnotify-stack-left .pnotify-shadow{border-left-width:5px}[data-pnotify].pnotify .pnotify-container{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}[data-pnotify].pnotify.pnotify-stack-down .pnotify-container,[data-pnotify].pnotify.pnotify-stack-up .pnotify-container{width:auto!important}[data-pnotify].pnotify.pnotify-stack-right .pnotify-container,[data-pnotify].pnotify.pnotify-stack-left .pnotify-container{height:100%!important}}

657
lib/javascript/pnotyfy/PNotifyMobile.js

@ -0,0 +1,657 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PNotifyMobile = {}));
}(this, (function (exports) { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function noop() {}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && _typeof(a) === 'object' || typeof a === 'function';
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function detach(node) {
node.parentNode.removeChild(node);
}
function listen(node, event, handler, options) {
node.addEventListener(event, handler, options);
return function () {
return node.removeEventListener(event, handler, options);
};
}
function children(element) {
return Array.from(element.childNodes);
}
var current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component) throw new Error('Function called outside component initialization');
return current_component;
}
function onMount(fn) {
get_current_component().$$.on_mount.push(fn);
}
function onDestroy(fn) {
get_current_component().$$.on_destroy.push(fn);
}
var dirty_components = [];
var binding_callbacks = [];
var render_callbacks = [];
var flush_callbacks = [];
var resolved_promise = Promise.resolve();
var update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
var flushing = false;
var seen_callbacks = new Set();
function flush() {
if (flushing) return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (var i = 0; i < dirty_components.length; i += 1) {
var component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length) {
binding_callbacks.pop()();
} // then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (var _i = 0; _i < render_callbacks.length; _i += 1) {
var callback = render_callbacks[_i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
var dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
var outroing = new Set();
function transition_in(block, local) {
if (block && block.i) {
outroing["delete"](block);
block.i(local);
}
}
var globals = typeof window !== 'undefined' ? window : typeof globalThis !== 'undefined' ? globalThis : global;
function mount_component(component, target, anchor) {
var _component$$$ = component.$$,
fragment = _component$$$.fragment,
on_mount = _component$$$.on_mount,
on_destroy = _component$$$.on_destroy,
after_update = _component$$$.after_update;
fragment && fragment.m(target, anchor); // onMount happens before the initial afterUpdate
add_render_callback(function () {
var new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push.apply(on_destroy, _toConsumableArray(new_on_destroy));
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
var $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
}
function init(component, options, instance, create_fragment, not_equal, props) {
var dirty = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [-1];
var parent_component = current_component;
set_current_component(component);
var prop_values = options.props || {};
var $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: props,
update: noop,
not_equal: not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: dirty,
skip_bound: false
};
var ready = false;
$$.ctx = instance ? instance(component, prop_values, function (i, ret) {
var value = (arguments.length <= 2 ? 0 : arguments.length - 2) ? arguments.length <= 2 ? undefined : arguments[2] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
if (ready) make_dirty(component, i);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update); // `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
var nodes = children(options.target); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
var SvelteComponent = /*#__PURE__*/function () {
function SvelteComponent() {
_classCallCheck(this, SvelteComponent);
}
_createClass(SvelteComponent, [{
key: "$destroy",
value: function $destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
}, {
key: "$on",
value: function $on(type, callback) {
var callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
callbacks.push(callback);
return function () {
var index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
}, {
key: "$set",
value: function $set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}]);
return SvelteComponent;
}();
var window_1 = globals.window;
function create_fragment(ctx) {
var mounted;
var dispose;
return {
c: noop,
m: function m(target, anchor) {
if (!mounted) {
dispose = listen(window_1, "resize",
/*resize_handler*/
ctx[3]);
mounted = true;
}
},
p: noop,
i: noop,
o: noop,
d: function d(detaching) {
mounted = false;
dispose();
}
};
}
var position = "PrependContainer";
var defaults = {
swipeDismiss: true
};
function instance($$self, $$props, $$invalidate) {
var _$$props$self = $$props.self,
self = _$$props$self === void 0 ? null : _$$props$self;
var _$$props$swipeDismiss = $$props.swipeDismiss,
swipeDismiss = _$$props$swipeDismiss === void 0 ? defaults.swipeDismiss : _$$props$swipeDismiss;
var origXY = null;
var diffXY = null;
var noticeWidthHeight = null;
var noticeOpacity = null;
var csspos = "left";
var direction = "X";
var span = "Width";
var windowInnerWidth = window.innerWidth;
var offs = [];
onMount(function () {
offs = [self.on("touchstart", function (e) {
if (!swipeDismiss) {
return;
}
var stack = self.stack;
if (stack) {
switch (stack.dir1) {
case "up":
case "down":
csspos = "left";
direction = "X";
span = "Width";
break;
case "left":
case "right":
csspos = "top";
direction = "Y";
span = "Height";
break;
}
}
origXY = e.touches[0]["screen".concat(direction)];
noticeWidthHeight = self.refs.elem["scroll".concat(span)];
noticeOpacity = window.getComputedStyle(self.refs.elem)["opacity"];
$$invalidate(1, self.refs.container.style[csspos] = 0, self);
}), self.on("touchmove", function (e) {
if (!origXY || !swipeDismiss) {
return;
}
var curXY = e.touches[0]["screen".concat(direction)];
diffXY = curXY - origXY;
var opacity = (1 - Math.abs(diffXY) / noticeWidthHeight) * noticeOpacity;
$$invalidate(1, self.refs.elem.style.opacity = opacity, self);
$$invalidate(1, self.refs.container.style[csspos] = "".concat(diffXY, "px"), self);
}), self.on("touchend", function () {
if (!origXY || !swipeDismiss) {
return;
}
self.refs.container.classList.add("pnotify-mobile-animate-left");
if (Math.abs(diffXY) > 40) {
var goLeft = diffXY < 0 ? noticeWidthHeight * -2 : noticeWidthHeight * 2;
$$invalidate(1, self.refs.elem.style.opacity = 0, self);
$$invalidate(1, self.refs.container.style[csspos] = "".concat(goLeft, "px"), self);
self.close();
} else {
self.refs.elem.style.removeProperty("opacity");
self.refs.container.style.removeProperty(csspos);
}
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
}), self.on("touchcancel", function () {
if (!origXY || !swipeDismiss) {
return;
}
self.refs.elem.style.removeProperty("opacity");
self.refs.container.style.removeProperty(csspos);
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
}), self.on("pnotify:afterClose", function () {
// Remove any styling we added to close it.
if (!swipeDismiss) {
return;
}
self.refs.elem.style.removeProperty("opacity");
self.refs.container.style.removeProperty("left");
self.refs.container.style.removeProperty("top");
})];
});
onDestroy(function () {
offs.forEach(function (off) {
return off();
});
});
var resize_handler = function resize_handler() {
return $$invalidate(0, windowInnerWidth = window.innerWidth);
};
$$self.$$set = function ($$props) {
if ("self" in $$props) $$invalidate(1, self = $$props.self);
if ("swipeDismiss" in $$props) $$invalidate(2, swipeDismiss = $$props.swipeDismiss);
};
$$self.$$.update = function () {
if ($$self.$$.dirty &
/*self, windowInnerWidth*/
3) {
{
var stack = self.stack;
if (stack) {
if (windowInnerWidth <= 480) {
if (!("_m_spacing1" in stack)) {
stack._m_spacing1 = stack.spacing1;
stack._m_firstpos1 = stack.firstpos1;
stack._m_spacing2 = stack.spacing2;
stack._m_firstpos2 = stack.firstpos2;
stack.spacing1 = 0;
stack.firstpos1 = 0;
stack.spacing2 = 0;
stack.firstpos2 = 0;
stack.queuePosition();
}
} else {
if ("_m_spacing1" in stack) {
stack.spacing1 = stack._m_spacing1;
delete stack._m_spacing1;
stack.firstpos1 = stack._m_firstpos1;
delete stack._m_firstpos1;
stack.spacing2 = stack._m_spacing2;
delete stack._m_spacing2;
stack.firstpos2 = stack._m_firstpos2;
delete stack._m_firstpos2;
stack.queuePosition();
}
}
}
}
}
};
return [windowInnerWidth, self, swipeDismiss, resize_handler];
}
var Mobile = /*#__PURE__*/function (_SvelteComponent) {
_inherits(Mobile, _SvelteComponent);
var _super = _createSuper(Mobile);
function Mobile(options) {
var _this;
_classCallCheck(this, Mobile);
_this = _super.call(this);
init(_assertThisInitialized(_this), options, instance, create_fragment, safe_not_equal, {
self: 1,
swipeDismiss: 2
});
return _this;
}
return Mobile;
}(SvelteComponent);
exports.default = Mobile;
exports.defaults = defaults;
exports.position = position;
Object.defineProperty(exports, '__esModule', { value: true });
})));

1
lib/javascript/pnotyfy/PNotifyPaginate.css

@ -0,0 +1 @@
.pnotify-paginate{float:right;display:flex;align-items:center;justify-content:center}.pnotify-paginate-buttons{display:flex}.pnotify-paginate-button{display:inline-block;margin:0 .5em;cursor:pointer}.pnotify-paginate-button:disabled,.pnotify-paginate-button[aria-disabled=true]{cursor:initial}.pnotify-paginate-count{font-size:.9em}

89
lib/javascript/pnotyfy/PNotifyPaginate.js

@ -0,0 +1,89 @@
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.PNotifyPaginate={}));}(this,(function(exports){'use strict';function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function(obj){return typeof obj;};}else{_typeof=function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}
return _typeof(obj);}
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
return self;}
function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}
return _assertThisInitialized(self);}
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}
return _possibleConstructorReturn(this,result);};}
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}
function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}
function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}
function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}
function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter);}
function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}
return _arr;}
function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}
function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function noop(){}
function run(fn){return fn();}
function blank_object(){return Object.create(null);}
function run_all(fns){fns.forEach(run);}
function is_function(thing){return typeof thing==='function';}
function safe_not_equal(a,b){return a!=a?b==b:a!==b||a&&_typeof(a)==='object'||typeof a==='function';}
function is_empty(obj){return Object.keys(obj).length===0;}
function append(target,node){target.appendChild(node);}
function insert(target,node,anchor){target.insertBefore(node,anchor||null);}
function detach(node){node.parentNode.removeChild(node);}
function element(name){return document.createElement(name);}
function text(data){return document.createTextNode(data);}
function space(){return text(' ');}
function listen(node,event,handler,options){node.addEventListener(event,handler,options);return function(){return node.removeEventListener(event,handler,options);};}
function attr(node,attribute,value){if(value==null)node.removeAttribute(attribute);else if(node.getAttribute(attribute)!==value)node.setAttribute(attribute,value);}
function children(element){return Array.from(element.childNodes);}
function set_data(text,data){data=''+data;if(text.wholeText!==data)text.data=data;}
var current_component;function set_current_component(component){current_component=component;}
function get_current_component(){if(!current_component)throw new Error('Function called outside component initialization');return current_component;}
function onMount(fn){get_current_component().$$.on_mount.push(fn);}
function onDestroy(fn){get_current_component().$$.on_destroy.push(fn);}
var dirty_components=[];var binding_callbacks=[];var render_callbacks=[];var flush_callbacks=[];var resolved_promise=Promise.resolve();var update_scheduled=false;function schedule_update(){if(!update_scheduled){update_scheduled=true;resolved_promise.then(flush);}}
function add_render_callback(fn){render_callbacks.push(fn);}
var flushing=false;var seen_callbacks=new Set();function flush(){if(flushing)return;flushing=true;do{for(var i=0;i<dirty_components.length;i+=1){var component=dirty_components[i];set_current_component(component);update(component.$$);}
set_current_component(null);dirty_components.length=0;while(binding_callbacks.length){binding_callbacks.pop()();}
for(var _i=0;_i<render_callbacks.length;_i+=1){var callback=render_callbacks[_i];if(!seen_callbacks.has(callback)){seen_callbacks.add(callback);callback();}}
render_callbacks.length=0;}while(dirty_components.length);while(flush_callbacks.length){flush_callbacks.pop()();}
update_scheduled=false;flushing=false;seen_callbacks.clear();}
function update($$){if($$.fragment!==null){$$.update();run_all($$.before_update);var dirty=$$.dirty;$$.dirty=[-1];$$.fragment&&$$.fragment.p($$.ctx,dirty);$$.after_update.forEach(add_render_callback);}}
var outroing=new Set();function transition_in(block,local){if(block&&block.i){outroing["delete"](block);block.i(local);}}
function mount_component(component,target,anchor){var _component$$$=component.$$,fragment=_component$$$.fragment,on_mount=_component$$$.on_mount,on_destroy=_component$$$.on_destroy,after_update=_component$$$.after_update;fragment&&fragment.m(target,anchor);add_render_callback(function(){var new_on_destroy=on_mount.map(run).filter(is_function);if(on_destroy){on_destroy.push.apply(on_destroy,_toConsumableArray(new_on_destroy));}else{run_all(new_on_destroy);}
component.$$.on_mount=[];});after_update.forEach(add_render_callback);}
function destroy_component(component,detaching){var $$=component.$$;if($$.fragment!==null){run_all($$.on_destroy);$$.fragment&&$$.fragment.d(detaching);$$.on_destroy=$$.fragment=null;$$.ctx=[];}}
function make_dirty(component,i){if(component.$$.dirty[0]===-1){dirty_components.push(component);schedule_update();component.$$.dirty.fill(0);}
component.$$.dirty[i/31|0]|=1<<i%31;}
function init(component,options,instance,create_fragment,not_equal,props){var dirty=arguments.length>6&&arguments[6]!==undefined?arguments[6]:[-1];var parent_component=current_component;set_current_component(component);var prop_values=options.props||{};var $$=component.$$={fragment:null,ctx:null,props:props,update:noop,not_equal:not_equal,bound:blank_object(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(parent_component?parent_component.$$.context:[]),callbacks:blank_object(),dirty:dirty,skip_bound:false};var ready=false;$$.ctx=instance?instance(component,prop_values,function(i,ret){var value=(arguments.length<=2?0:arguments.length-2)?arguments.length<=2?undefined:arguments[2]:ret;if($$.ctx&&not_equal($$.ctx[i],$$.ctx[i]=value)){if(!$$.skip_bound&&$$.bound[i])$$.bound[i](value);if(ready)make_dirty(component,i);}
return ret;}):[];$$.update();ready=true;run_all($$.before_update);$$.fragment=create_fragment?create_fragment($$.ctx):false;if(options.target){if(options.hydrate){var nodes=children(options.target);$$.fragment&&$$.fragment.l(nodes);nodes.forEach(detach);}else{$$.fragment&&$$.fragment.c();}
if(options.intro)transition_in(component.$$.fragment);mount_component(component,options.target,options.anchor);flush();}
set_current_component(parent_component);}
var SvelteComponent=function(){function SvelteComponent(){_classCallCheck(this,SvelteComponent);}
_createClass(SvelteComponent,[{key:"$destroy",value:function $destroy(){destroy_component(this,1);this.$destroy=noop;}},{key:"$on",value:function $on(type,callback){var callbacks=this.$$.callbacks[type]||(this.$$.callbacks[type]=[]);callbacks.push(callback);return function(){var index=callbacks.indexOf(callback);if(index!==-1)callbacks.splice(index,1);};}},{key:"$set",value:function $set($$props){if(this.$$set&&!is_empty($$props)){this.$$.skip_bound=true;this.$$set($$props);this.$$.skip_bound=false;}}}]);return SvelteComponent;}();function create_if_block_1(ctx){var div2;var div0;var div0_tabindex_value;var div0_aria_disabled_value;var div0_class_value;var div0_title_value;var t;var div1;var div1_tabindex_value;var div1_aria_disabled_value;var div1_class_value;var div1_title_value;var div2_class_value;var mounted;var dispose;return{c:function c(){div2=element("div");div0=element("div");t=space();div1=element("div");attr(div0,"role","button");attr(div0,"tabindex",div0_tabindex_value=ctx[4]===1?"-1":"0");attr(div0,"aria-disabled",div0_aria_disabled_value=ctx[4]===1);attr(div0,"class",div0_class_value="pnotify-paginate-button ".concat(ctx[0].getStyle("paginate-btn")," ").concat(ctx[0].getStyle("paginate-previous")));attr(div0,"title",div0_title_value=ctx[3].previous);attr(div1,"role","button");attr(div1,"tabindex",div1_tabindex_value=ctx[4]===ctx[5]?"-1":"0");attr(div1,"aria-disabled",div1_aria_disabled_value=ctx[4]===ctx[5]);attr(div1,"class",div1_class_value="pnotify-paginate-button ".concat(ctx[0].getStyle("paginate-btn")," ").concat(ctx[0].getStyle("paginate-next")));attr(div1,"title",div1_title_value=ctx[3].next);attr(div2,"class",div2_class_value="pnotify-paginate-buttons ".concat(ctx[0].getStyle("paginate-buttons")));},m:function m(target,anchor){insert(target,div2,anchor);append(div2,div0);append(div2,t);append(div2,div1);if(!mounted){dispose=[listen(div0,"click",ctx[10]),listen(div1,"click",ctx[11])];mounted=true;}},p:function p(ctx,dirty){if(dirty&16&&div0_tabindex_value!==(div0_tabindex_value=ctx[4]===1?"-1":"0")){attr(div0,"tabindex",div0_tabindex_value);}
if(dirty&16&&div0_aria_disabled_value!==(div0_aria_disabled_value=ctx[4]===1)){attr(div0,"aria-disabled",div0_aria_disabled_value);}
if(dirty&1&&div0_class_value!==(div0_class_value="pnotify-paginate-button ".concat(ctx[0].getStyle("paginate-btn")," ").concat(ctx[0].getStyle("paginate-previous")))){attr(div0,"class",div0_class_value);}
if(dirty&8&&div0_title_value!==(div0_title_value=ctx[3].previous)){attr(div0,"title",div0_title_value);}
if(dirty&48&&div1_tabindex_value!==(div1_tabindex_value=ctx[4]===ctx[5]?"-1":"0")){attr(div1,"tabindex",div1_tabindex_value);}
if(dirty&48&&div1_aria_disabled_value!==(div1_aria_disabled_value=ctx[4]===ctx[5])){attr(div1,"aria-disabled",div1_aria_disabled_value);}
if(dirty&1&&div1_class_value!==(div1_class_value="pnotify-paginate-button ".concat(ctx[0].getStyle("paginate-btn")," ").concat(ctx[0].getStyle("paginate-next")))){attr(div1,"class",div1_class_value);}
if(dirty&8&&div1_title_value!==(div1_title_value=ctx[3].next)){attr(div1,"title",div1_title_value);}
if(dirty&1&&div2_class_value!==(div2_class_value="pnotify-paginate-buttons ".concat(ctx[0].getStyle("paginate-buttons")))){attr(div2,"class",div2_class_value);}},d:function d(detaching){if(detaching)detach(div2);mounted=false;run_all(dispose);}};}
function create_if_block(ctx){var div;var span0;var t0;var span0_class_value;var t1;var span1;var t2_value=ctx[3].of+"";var t2;var span1_class_value;var t3;var span2;var t4;var span2_class_value;var div_class_value;return{c:function c(){div=element("div");span0=element("span");t0=text(ctx[4]);t1=space();span1=element("span");t2=text(t2_value);t3=space();span2=element("span");t4=text(ctx[5]);attr(span0,"class",span0_class_value="pnotify-paginate-count-current ".concat(ctx[0].getStyle("paginate-count-current")));attr(span1,"class",span1_class_value="pnotify-paginate-count-of ".concat(ctx[0].getStyle("paginate-count-of")));attr(span2,"class",span2_class_value="pnotify-paginate-count-total ".concat(ctx[0].getStyle("paginate-count-total")));attr(div,"class",div_class_value="pnotify-paginate-count ".concat(ctx[0].getStyle("paginate-count")));},m:function m(target,anchor){insert(target,div,anchor);append(div,span0);append(span0,t0);append(div,t1);append(div,span1);append(span1,t2);append(div,t3);append(div,span2);append(span2,t4);},p:function p(ctx,dirty){if(dirty&16)set_data(t0,ctx[4]);if(dirty&1&&span0_class_value!==(span0_class_value="pnotify-paginate-count-current ".concat(ctx[0].getStyle("paginate-count-current")))){attr(span0,"class",span0_class_value);}
if(dirty&8&&t2_value!==(t2_value=ctx[3].of+""))set_data(t2,t2_value);if(dirty&1&&span1_class_value!==(span1_class_value="pnotify-paginate-count-of ".concat(ctx[0].getStyle("paginate-count-of")))){attr(span1,"class",span1_class_value);}
if(dirty&32)set_data(t4,ctx[5]);if(dirty&1&&span2_class_value!==(span2_class_value="pnotify-paginate-count-total ".concat(ctx[0].getStyle("paginate-count-total")))){attr(span2,"class",span2_class_value);}
if(dirty&1&&div_class_value!==(div_class_value="pnotify-paginate-count ".concat(ctx[0].getStyle("paginate-count")))){attr(div,"class",div_class_value);}},d:function d(detaching){if(detaching)detach(div);}};}
function create_fragment(ctx){var div;var t;var div_class_value;var if_block0=ctx[1]&&create_if_block_1(ctx);var if_block1=ctx[2]&&create_if_block(ctx);return{c:function c(){div=element("div");if(if_block0)if_block0.c();t=space();if(if_block1)if_block1.c();attr(div,"class",div_class_value="pnotify-paginate ".concat(ctx[0].getStyle("paginate")));},m:function m(target,anchor){insert(target,div,anchor);if(if_block0)if_block0.m(div,null);append(div,t);if(if_block1)if_block1.m(div,null);},p:function p(ctx,_ref){var _ref2=_slicedToArray(_ref,1),dirty=_ref2[0];if(ctx[1]){if(if_block0){if_block0.p(ctx,dirty);}else{if_block0=create_if_block_1(ctx);if_block0.c();if_block0.m(div,t);}}else if(if_block0){if_block0.d(1);if_block0=null;}
if(ctx[2]){if(if_block1){if_block1.p(ctx,dirty);}else{if_block1=create_if_block(ctx);if_block1.c();if_block1.m(div,null);}}else if(if_block1){if_block1.d(1);if_block1=null;}
if(dirty&1&&div_class_value!==(div_class_value="pnotify-paginate ".concat(ctx[0].getStyle("paginate")))){attr(div,"class",div_class_value);}},i:noop,o:noop,d:function d(detaching){if(detaching)detach(div);if(if_block0)if_block0.d();if(if_block1)if_block1.d();}};}
var position="PrependContainer";var defaults={buttons:true,count:true,immediateTransition:true,waiting:true,labels:{previous:"Previous",next:"Next",of:"of"}};function instance($$self,$$props,$$invalidate){var _$$props$self=$$props.self,self=_$$props$self===void 0?null:_$$props$self;var _$$props$buttons=$$props.buttons,buttons=_$$props$buttons===void 0?defaults.buttons:_$$props$buttons;var _$$props$count=$$props.count,count=_$$props$count===void 0?defaults.count:_$$props$count;var _$$props$immediateTra=$$props.immediateTransition,immediateTransition=_$$props$immediateTra===void 0?defaults.immediateTransition:_$$props$immediateTra;var _$$props$waiting=$$props.waiting,waiting=_$$props$waiting===void 0?defaults.waiting:_$$props$waiting;var _$$props$labels=$$props.labels,labels=_$$props$labels===void 0?defaults.labels:_$$props$labels;var currentIndex;var stackLength;var handlerCallback=function handlerCallback(){$$invalidate(4,currentIndex=0);try{self.stack.forEach(function(notice){return $$invalidate(4,currentIndex++,currentIndex);},{start:self,dir:"prev"});}catch(e){if(e.message!=="Invalid start param."){throw e;}}
$$invalidate(5,stackLength=self.stack.length);};var addHandlerOff;var removeHandlerOff;var beforeOpenHandlerOff;onMount(function(){handlerCallback();addHandlerOff=self.stack.on("afterAddNotice",handlerCallback);removeHandlerOff=self.stack.on("afterRemoveNotice",handlerCallback);beforeOpenHandlerOff=self.on("beforeOpen",handlerCallback);});onDestroy(function(){addHandlerOff();removeHandlerOff();beforeOpenHandlerOff();});function handleNext(){self.stack.forEach(function(notice){if(notice!==self&&(notice.getState()==="waiting"||!waiting&&notice.getState()==="closed")){self.stack.swap(self,notice,immediateTransition,waiting);return false;}},{start:self,dir:"next"});}
function handlePrevious(){self.stack.forEach(function(notice){if(notice!==self&&notice.getState()==="waiting"){self.stack.swap(self,notice,immediateTransition,true);return false;}},{start:self,dir:"prev"});}
var click_handler=function click_handler(event){return handlePrevious();};var click_handler_1=function click_handler_1(event){return handleNext();};$$self.$$set=function($$props){if("self"in $$props)$$invalidate(0,self=$$props.self);if("buttons"in $$props)$$invalidate(1,buttons=$$props.buttons);if("count"in $$props)$$invalidate(2,count=$$props.count);if("immediateTransition"in $$props)$$invalidate(8,immediateTransition=$$props.immediateTransition);if("waiting"in $$props)$$invalidate(9,waiting=$$props.waiting);if("labels"in $$props)$$invalidate(3,labels=$$props.labels);};return[self,buttons,count,labels,currentIndex,stackLength,handleNext,handlePrevious,immediateTransition,waiting,click_handler,click_handler_1];}
var Paginate=function(_SvelteComponent){_inherits(Paginate,_SvelteComponent);var _super=_createSuper(Paginate);function Paginate(options){var _this;_classCallCheck(this,Paginate);_this=_super.call(this);init(_assertThisInitialized(_this),options,instance,create_fragment,safe_not_equal,{self:0,buttons:1,count:2,immediateTransition:8,waiting:9,labels:3});return _this;}
return Paginate;}(SvelteComponent);exports.default=Paginate;exports.defaults=defaults;exports.position=position;Object.defineProperty(exports,'__esModule',{value:true});})));

1
lib/javascript/pnotyfy/PNotifyReference.css

@ -0,0 +1 @@
.pnotify-reference-button.svelte-1tn3i34{float:right;margin-top:1em}.pnotify-reference-clearing.svelte-1tn3i34{clear:right;line-height:0}

75
lib/javascript/pnotyfy/PNotifyReference.js

@ -0,0 +1,75 @@
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.PNotifyReference={}));}(this,(function(exports){'use strict';function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function(obj){return typeof obj;};}else{_typeof=function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}
return _typeof(obj);}
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
return self;}
function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}
return _assertThisInitialized(self);}
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}
return _possibleConstructorReturn(this,result);};}
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}
function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}
function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}
function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}
function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter);}
function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}
return _arr;}
function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}
function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function noop(){}
function run(fn){return fn();}
function blank_object(){return Object.create(null);}
function run_all(fns){fns.forEach(run);}
function is_function(thing){return typeof thing==='function';}
function safe_not_equal(a,b){return a!=a?b==b:a!==b||a&&_typeof(a)==='object'||typeof a==='function';}
function is_empty(obj){return Object.keys(obj).length===0;}
function null_to_empty(value){return value==null?'':value;}
function append(target,node){target.appendChild(node);}
function insert(target,node,anchor){target.insertBefore(node,anchor||null);}
function detach(node){node.parentNode.removeChild(node);}
function element(name){return document.createElement(name);}
function text(data){return document.createTextNode(data);}
function space(){return text(' ');}
function listen(node,event,handler,options){node.addEventListener(event,handler,options);return function(){return node.removeEventListener(event,handler,options);};}
function attr(node,attribute,value){if(value==null)node.removeAttribute(attribute);else if(node.getAttribute(attribute)!==value)node.setAttribute(attribute,value);}
function children(element){return Array.from(element.childNodes);}
function set_data(text,data){data=''+data;if(text.wholeText!==data)text.data=data;}
var current_component;function set_current_component(component){current_component=component;}
function get_current_component(){if(!current_component)throw new Error('Function called outside component initialization');return current_component;}
function onDestroy(fn){get_current_component().$$.on_destroy.push(fn);}
var dirty_components=[];var binding_callbacks=[];var render_callbacks=[];var flush_callbacks=[];var resolved_promise=Promise.resolve();var update_scheduled=false;function schedule_update(){if(!update_scheduled){update_scheduled=true;resolved_promise.then(flush);}}
function add_render_callback(fn){render_callbacks.push(fn);}
var flushing=false;var seen_callbacks=new Set();function flush(){if(flushing)return;flushing=true;do{for(var i=0;i<dirty_components.length;i+=1){var component=dirty_components[i];set_current_component(component);update(component.$$);}
set_current_component(null);dirty_components.length=0;while(binding_callbacks.length){binding_callbacks.pop()();}
for(var _i=0;_i<render_callbacks.length;_i+=1){var callback=render_callbacks[_i];if(!seen_callbacks.has(callback)){seen_callbacks.add(callback);callback();}}
render_callbacks.length=0;}while(dirty_components.length);while(flush_callbacks.length){flush_callbacks.pop()();}
update_scheduled=false;flushing=false;seen_callbacks.clear();}
function update($$){if($$.fragment!==null){$$.update();run_all($$.before_update);var dirty=$$.dirty;$$.dirty=[-1];$$.fragment&&$$.fragment.p($$.ctx,dirty);$$.after_update.forEach(add_render_callback);}}
var outroing=new Set();function transition_in(block,local){if(block&&block.i){outroing["delete"](block);block.i(local);}}
function mount_component(component,target,anchor){var _component$$$=component.$$,fragment=_component$$$.fragment,on_mount=_component$$$.on_mount,on_destroy=_component$$$.on_destroy,after_update=_component$$$.after_update;fragment&&fragment.m(target,anchor);add_render_callback(function(){var new_on_destroy=on_mount.map(run).filter(is_function);if(on_destroy){on_destroy.push.apply(on_destroy,_toConsumableArray(new_on_destroy));}else{run_all(new_on_destroy);}
component.$$.on_mount=[];});after_update.forEach(add_render_callback);}
function destroy_component(component,detaching){var $$=component.$$;if($$.fragment!==null){run_all($$.on_destroy);$$.fragment&&$$.fragment.d(detaching);$$.on_destroy=$$.fragment=null;$$.ctx=[];}}
function make_dirty(component,i){if(component.$$.dirty[0]===-1){dirty_components.push(component);schedule_update();component.$$.dirty.fill(0);}
component.$$.dirty[i/31|0]|=1<<i%31;}
function init(component,options,instance,create_fragment,not_equal,props){var dirty=arguments.length>6&&arguments[6]!==undefined?arguments[6]:[-1];var parent_component=current_component;set_current_component(component);var prop_values=options.props||{};var $$=component.$$={fragment:null,ctx:null,props:props,update:noop,not_equal:not_equal,bound:blank_object(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(parent_component?parent_component.$$.context:[]),callbacks:blank_object(),dirty:dirty,skip_bound:false};var ready=false;$$.ctx=instance?instance(component,prop_values,function(i,ret){var value=(arguments.length<=2?0:arguments.length-2)?arguments.length<=2?undefined:arguments[2]:ret;if($$.ctx&&not_equal($$.ctx[i],$$.ctx[i]=value)){if(!$$.skip_bound&&$$.bound[i])$$.bound[i](value);if(ready)make_dirty(component,i);}
return ret;}):[];$$.update();ready=true;run_all($$.before_update);$$.fragment=create_fragment?create_fragment($$.ctx):false;if(options.target){if(options.hydrate){var nodes=children(options.target);$$.fragment&&$$.fragment.l(nodes);nodes.forEach(detach);}else{$$.fragment&&$$.fragment.c();}
if(options.intro)transition_in(component.$$.fragment);mount_component(component,options.target,options.anchor);flush();}
set_current_component(parent_component);}
var SvelteComponent=function(){function SvelteComponent(){_classCallCheck(this,SvelteComponent);}
_createClass(SvelteComponent,[{key:"$destroy",value:function $destroy(){destroy_component(this,1);this.$destroy=noop;}},{key:"$on",value:function $on(type,callback){var callbacks=this.$$.callbacks[type]||(this.$$.callbacks[type]=[]);callbacks.push(callback);return function(){var index=callbacks.indexOf(callback);if(index!==-1)callbacks.splice(index,1);};}},{key:"$set",value:function $set($$props){if(this.$$set&&!is_empty($$props)){this.$$.skip_bound=true;this.$$set($$props);this.$$.skip_bound=false;}}}]);return SvelteComponent;}();function create_fragment(ctx){var button;var i;var i_class_value;var t0;var t1_value=ctx[1].text+"";var t1;var button_class_value;var button_disabled_value;var t2;var div;var mounted;var dispose;return{c:function c(){button=element("button");i=element("i");t0=text("\n  ");t1=text(t1_value);t2=space();div=element("div");attr(i,"class",i_class_value=""+(null_to_empty(ctx[0].getIcon("refresh"))+" svelte-1tn3i34"));attr(button,"class",button_class_value=""+(null_to_empty("pnotify-action-button pnotify-reference-button ".concat(ctx[0].getStyle("btn")," ").concat(ctx[0].getStyle("btn-secondary")))+" svelte-1tn3i34"));attr(button,"type","button");button.disabled=button_disabled_value=!ctx[2];attr(div,"class","pnotify-reference-clearing svelte-1tn3i34");},m:function m(target,anchor){insert(target,button,anchor);append(button,i);append(button,t0);append(button,t1);insert(target,t2,anchor);insert(target,div,anchor);if(!mounted){dispose=listen(button,"click",ctx[3]);mounted=true;}},p:function p(ctx,_ref){var _ref2=_slicedToArray(_ref,1),dirty=_ref2[0];if(dirty&1&&i_class_value!==(i_class_value=""+(null_to_empty(ctx[0].getIcon("refresh"))+" svelte-1tn3i34"))){attr(i,"class",i_class_value);}
if(dirty&2&&t1_value!==(t1_value=ctx[1].text+""))set_data(t1,t1_value);if(dirty&1&&button_class_value!==(button_class_value=""+(null_to_empty("pnotify-action-button pnotify-reference-button ".concat(ctx[0].getStyle("btn")," ").concat(ctx[0].getStyle("btn-secondary")))+" svelte-1tn3i34"))){attr(button,"class",button_class_value);}
if(dirty&4&&button_disabled_value!==(button_disabled_value=!ctx[2])){button.disabled=button_disabled_value;}},i:noop,o:noop,d:function d(detaching){if(detaching)detach(button);if(detaching)detach(t2);if(detaching)detach(div);mounted=false;dispose();}};}
var position="AppendContent";var defaults={labels:{text:"Spin Around"}};function instance($$self,$$props,$$invalidate){var _$$props$self=$$props.self,self=_$$props$self===void 0?null:_$$props$self;var _$$props$labels=$$props.labels,labels=_$$props$labels===void 0?defaults.labels:_$$props$labels;var mouseIsIn=false;var removeMouseEnter=self.on("mouseenter",function(){return $$invalidate(2,mouseIsIn=true);});var removeMouseLeave=self.on("mouseleave",function(){return $$invalidate(2,mouseIsIn=false);});onDestroy(function(){removeMouseEnter&&removeMouseEnter();removeMouseLeave&&removeMouseLeave();});function doSomething(){var curAngle=0;var timer=setInterval(function(){curAngle+=10;if(curAngle===360){curAngle=0;clearInterval(timer);}
$$invalidate(0,self.refs.elem.style.transform="rotate(".concat(curAngle,"deg)"),self);},20);}
$$self.$$set=function($$props){if("self"in $$props)$$invalidate(0,self=$$props.self);if("labels"in $$props)$$invalidate(1,labels=$$props.labels);};return[self,labels,mouseIsIn,doSomething];}
var Reference=function(_SvelteComponent){_inherits(Reference,_SvelteComponent);var _super=_createSuper(Reference);function Reference(options){var _this;_classCallCheck(this,Reference);_this=_super.call(this);init(_assertThisInitialized(_this),options,instance,create_fragment,safe_not_equal,{self:0,labels:1});return _this;}
return Reference;}(SvelteComponent);exports.default=Reference;exports.defaults=defaults;exports.position=position;Object.defineProperty(exports,'__esModule',{value:true});})));

57
lib/php/argus/argus.php

@ -0,0 +1,57 @@
<?php
/*****************************************************************
* Argus PHP functions *
* *
* *
* *
*****************************************************************/
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function addConnection( $SiteID, $FromNodeID, $FromAuxID, $ToNodeID, $ToAuxID, $Type ){
global $DATABASE;
$QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$FromNodeID}, `from_aux`={$FromAuxID}, `to`={$ToNodeID}, `to_aux`={$ToAuxID}, `type`={$Type}";
$DATABASE->Query( $QS, false );
};
?>

14
lib/php/onvif/test_v11.php

@ -7,10 +7,11 @@
//var_dump($result);
//exit();
$test=new ponvif();
$test->setUsername('gagua');
$test->setPassword('4GetMyID');
$test->setIPAddress('192.168.0.109');
//$test->setUsername('gagua');
$test->setUsername('admin');
$test->setPassword('4GetMyID');//109
//$test->setIPAddress('192.168.0.109');
$test->setIPAddress('192.168.200.106');
try {
$test->initialize();
@ -21,8 +22,9 @@
//echo "Media: " . $test->media_GetStreamUri($profileToken) . "\n\n";
//echo "Snapshot: " . $test->media_GetSnapshotUri('Profile_2') . "\n\n";
//$PAPA = $test->media_GetVideoSources();
$test->ptz_AbsoluteMove( "Profile_1", 1, -1, 0);
$test->ptz_GetStatus("Profile_1");
//$test->ptz_AbsoluteMove($profileToken, -1, -1, 0);
//$PAPA = $test->ptz_GetStatus($profileToken);
$test->ptz_ContinuousMove( $profileToken, -0.2, 0 );
//var_dump( $PAPA );
} catch (Exception $e) {

16
lib/php/onvif/toto.php

@ -554,8 +554,8 @@ class Ponvif {
$velocity_pantilt_x,
$velocity_pantilt_y),
$post_string);
if ($this->isFault($this->_send_request($this->ptzuri,$post_string))) {
if ($this->intransingent) throw new Exception('ContinuousMove: Communication error');
if ( $this->isFault($this->_send_request($this->ptzuri,$post_string))) {
if( $this->intransingent ) throw new Exception('ContinuousMove: Communication error');
}
}
@ -721,19 +721,25 @@ class Ponvif {
if ($this->proxyusername!='' && $this->proxypassword!='')
curl_setopt($soap_do, CURLOPT_PROXYUSERPWD, $this->proxyusername.':'.$this->proxypassword);
}
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 2 );
curl_setopt($soap_do, CURLOPT_TIMEOUT, 2 );
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_VERBOSE, true);
//curl_setopt($soap_do, CURLOPT_DEBUG, true);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true );
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($post_string) ));
curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Expect:', 'Content-Type: application/soap+xml; charset=utf-8', 'Content-Length: '.strlen($post_string) ));
curl_setopt($soap_do, CURLOPT_USERPWD, $this->username . ":" . $this->password); // HTTP authentication
if ( ($result = curl_exec($soap_do)) === false) {
$err = curl_error($soap_do);
$this->lastresponse=array("Fault"=>$err);
} else {
//echo "QU: {$url}\n";
//echo "\n------------------\n";
//var_dump( $post_string );
//echo "\n~~~~~~~~~~~~~~~~~~\n";
//var_dump( $result );
$this->lastresponse=$this->_xml2array($result);
}

28
lib/php/ui/UI_functions.php

@ -173,7 +173,6 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<base href="<?=$WEBPath;?>">
<meta name="robots" content="index, follow"/>
<meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="style/style.css"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
@ -218,7 +217,31 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<link rel="stylesheet" type="text/css" href="lib/javascript/leaflet/leaflet.css"/>
<script type="text/javascript" src="lib/javascript/leaflet/leaflet.js"></script>
<script type="text/javascript" src="lib/javascript/leaflet/Leaflet.ImageOverlay.Rotated.js"></script>
<script type="text/javascript" src="lib/javascript/howler/howler.min.js"></script>
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotify.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/BrightTheme.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/Material.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/Angeler.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyBootstrap4.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyMobile.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyDesktop.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyConfirm.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyCountdown.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyPaginate.css" />
<link rel="stylesheet" type="text/css" href="lib/javascript/pnotyfy/PNotifyReference.css" />
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotify.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyBootstrap4.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyFontAwesome5Fix.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyFontAwesome5.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyAnimate.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyMobile.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyDesktop.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyConfirm.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyCountdown.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyPaginate.js"></script>
<script type="text/javascript" src="lib/javascript/pnotyfy/PNotifyReference.js"></script>
<!-- ENDLIBS -->
@ -293,6 +316,7 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
};
};
?>
<link rel="stylesheet" type="text/css" href="style/style.css"/>
</head>
<body><?php
};

BIN
style/assets/audio/beep-07a.mp3

Binary file not shown.

BIN
style/assets/audio/beep-07a.wav

Binary file not shown.

BIN
style/assets/audio/beep-08b.mp3

Binary file not shown.

BIN
style/assets/audio/beep-08b.wav

Binary file not shown.

BIN
style/assets/audio/beep-09.mp3

Binary file not shown.

BIN
style/assets/audio/beep-09.wav

Binary file not shown.

BIN
style/assets/audio/beep-10.mp3

Binary file not shown.

BIN
style/assets/audio/beep-10.wav

Binary file not shown.

BIN
style/assets/audio/beep-21.mp3

Binary file not shown.

BIN
style/assets/audio/beep-21.wav

Binary file not shown.

BIN
style/assets/audio/beep-23.mp3

Binary file not shown.

BIN
style/assets/audio/beep-23.wav

Binary file not shown.

BIN
style/assets/audio/beep-24.mp3

Binary file not shown.

BIN
style/assets/audio/beep-24.wav

Binary file not shown.

BIN
style/assets/audio/beep-25.mp3

Binary file not shown.

BIN
style/assets/audio/beep-25.wav

Binary file not shown.

BIN
style/assets/audio/beep-26.mp3

Binary file not shown.

BIN
style/assets/audio/beep-26.wav

Binary file not shown.

BIN
style/assets/audio/beep-28.mp3

Binary file not shown.

BIN
style/assets/audio/beep-28.wav

Binary file not shown.

BIN
style/assets/audio/beep-29.mp3

Binary file not shown.

BIN
style/assets/audio/beep-29.wav

Binary file not shown.

BIN
style/assets/audio/beep-30b.mp3

Binary file not shown.

BIN
style/assets/audio/beep-30b.wav

Binary file not shown.

BIN
style/assets/audio/button-15.mp3

Binary file not shown.

BIN
style/assets/audio/button-15.wav

Binary file not shown.

BIN
style/assets/audio/button-16.mp3

Binary file not shown.

BIN
style/assets/audio/button-16.wav

Binary file not shown.

BIN
style/assets/audio/button-17.mp3

Binary file not shown.

BIN
style/assets/audio/button-17.wav

Binary file not shown.

BIN
style/assets/audio/button-38.mp3

Binary file not shown.

BIN
style/assets/audio/button-38.wav

Binary file not shown.

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save