From 42d5295109038e9ca0112e276306e0b1bea416ef Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Sun, 17 Jul 2022 22:19:24 +0100 Subject: [PATCH] Some Preparation to Japan Preview Version --- index.php | 30 +- lib/assembler.php | 11 + lib/controller/checkDeviceOperation.php | 24 + lib/controller/dash/node_0.js | 14 +- lib/controller/dash/node_1.js | 96 + lib/controller/dash/node_10.js | 22 +- lib/controller/dash/node_11.js | 7 +- lib/controller/dash/node_12.js | 18 + lib/controller/dash/node_13.js | 8 +- lib/controller/dash/node_3.js | 66 +- lib/controller/dash/node_4.js | 95 + lib/controller/doDeviceOperation.php | 1 + lib/controller/getDashBoardItems.php | 11 +- lib/controller/getDetectionProfile.php | 18 +- lib/controller/getDeviceDraw.php | 370 +- lib/controller/getEventRecords.php | 32 +- lib/controller/getGeoZones.php | 7 +- lib/controller/getNetworkNodeProps.php | 2 +- lib/controller/getPicture.php | 34 +- lib/controller/getStatus.php | 4 +- lib/controller/props/0_node_prop.js | 21 +- lib/controller/props/5_node_prop.js | 2 +- lib/controller/removeNode.php | 52 +- lib/controller/resetAllSettings.php | 2 +- lib/controller/uploadAsset.php | 6 + lib/defines.php | 2 + .../jsapi_dynamic/rgoose_dashboard.js | 101 +- .../jsapi_dynamic/rgoose_devices.js | 104 +- lib/javascript/jsapi_dynamic/rgoose_main.js | 72 +- lib/javascript/jsapi_dynamic/rgoose_map.js | 0 .../rgoose_mediaserver_module.js | 30 - .../jsapi_dynamic/rgoose_modules.js | 511 + .../{rgoose_timeline.js => rgoose_reports.js} | 88 +- .../jsapi_dynamic/rgoose_swupgrade.js | 506 + .../jsapi_dynamic/rgoose_sysmap_editor.js | 333 +- lib/javascript/plupload/SECURITY.md | 1 + lib/javascript/plupload/bower.json | 27 + lib/javascript/plupload/examples/custom.html | 85 + lib/javascript/plupload/examples/dump.php | 34 + lib/javascript/plupload/examples/events.html | 217 + .../examples/jquery/all_runtimes.html | 139 + .../examples/jquery/jquery_ui_widget.html | 113 + .../examples/jquery/queue_widget.html | 66 + .../plupload/examples/jquery/s3.php | 131 + lib/javascript/plupload/examples/upload.php | 126 + lib/javascript/plupload/js/Moxie.swf | Bin 0 -> 27640 bytes lib/javascript/plupload/js/Moxie.xap | Bin 0 -> 65757 bytes lib/javascript/plupload/js/i18n/ar.js | 2 + lib/javascript/plupload/js/i18n/az.js | 2 + lib/javascript/plupload/js/i18n/bg.js | 2 + lib/javascript/plupload/js/i18n/bs.js | 2 + lib/javascript/plupload/js/i18n/ca.js | 2 + lib/javascript/plupload/js/i18n/cs.js | 2 + lib/javascript/plupload/js/i18n/cy.js | 2 + lib/javascript/plupload/js/i18n/da.js | 2 + lib/javascript/plupload/js/i18n/de.js | 2 + lib/javascript/plupload/js/i18n/el.js | 2 + lib/javascript/plupload/js/i18n/en.js | 2 + lib/javascript/plupload/js/i18n/es.js | 2 + lib/javascript/plupload/js/i18n/et.js | 2 + lib/javascript/plupload/js/i18n/fa.js | 2 + lib/javascript/plupload/js/i18n/fi.js | 2 + lib/javascript/plupload/js/i18n/fr.js | 2 + lib/javascript/plupload/js/i18n/he.js | 2 + lib/javascript/plupload/js/i18n/hr.js | 2 + lib/javascript/plupload/js/i18n/hu.js | 2 + lib/javascript/plupload/js/i18n/hy.js | 2 + lib/javascript/plupload/js/i18n/id.js | 2 + lib/javascript/plupload/js/i18n/it.js | 2 + lib/javascript/plupload/js/i18n/ja.js | 2 + lib/javascript/plupload/js/i18n/ka.js | 2 + lib/javascript/plupload/js/i18n/kk.js | 2 + lib/javascript/plupload/js/i18n/km.js | 2 + lib/javascript/plupload/js/i18n/ko.js | 2 + lib/javascript/plupload/js/i18n/ku_IQ.js | 2 + lib/javascript/plupload/js/i18n/lt.js | 2 + lib/javascript/plupload/js/i18n/lv.js | 2 + lib/javascript/plupload/js/i18n/ms.js | 2 + lib/javascript/plupload/js/i18n/nl.js | 2 + lib/javascript/plupload/js/i18n/pl.js | 2 + lib/javascript/plupload/js/i18n/pt.js | 2 + lib/javascript/plupload/js/i18n/pt_BR.js | 2 + lib/javascript/plupload/js/i18n/ro.js | 2 + lib/javascript/plupload/js/i18n/ru.js | 2 + lib/javascript/plupload/js/i18n/sk.js | 2 + lib/javascript/plupload/js/i18n/sl.js | 2 + lib/javascript/plupload/js/i18n/sq.js | 2 + lib/javascript/plupload/js/i18n/sr.js | 2 + lib/javascript/plupload/js/i18n/sv.js | 2 + lib/javascript/plupload/js/i18n/th_TH.js | 2 + lib/javascript/plupload/js/i18n/tr.js | 2 + lib/javascript/plupload/js/i18n/uk_UA.js | 2 + lib/javascript/plupload/js/i18n/vi.js | 2 + lib/javascript/plupload/js/i18n/zh_CN.js | 2 + lib/javascript/plupload/js/i18n/zh_TW.js | 2 + .../css/jquery.plupload.queue.css | 185 + .../jquery.plupload.queue/img/backgrounds.gif | Bin 0 -> 2977 bytes .../img/buttons-disabled.png | Bin 0 -> 1026 bytes .../js/jquery.plupload.queue/img/buttons.png | Bin 0 -> 1078 bytes .../js/jquery.plupload.queue/img/delete.gif | Bin 0 -> 180 bytes .../js/jquery.plupload.queue/img/done.gif | Bin 0 -> 1024 bytes .../js/jquery.plupload.queue/img/error.gif | Bin 0 -> 994 bytes .../js/jquery.plupload.queue/img/throbber.gif | Bin 0 -> 1922 bytes .../js/jquery.plupload.queue/img/transp50.png | Bin 0 -> 111 bytes .../jquery.plupload.queue.js | 433 + .../jquery.plupload.queue.min.js | 1 + .../css/jquery.ui.plupload.css | 379 + .../js/jquery.ui.plupload/img/loading.gif | Bin 0 -> 4023 bytes .../js/jquery.ui.plupload/img/plupload.png | Bin 0 -> 5741 bytes .../jquery.ui.plupload/jquery.ui.plupload.js | 1358 ++ .../jquery.ui.plupload.min.js | 1 + lib/javascript/plupload/js/moxie.js | 11714 ++++++++++++++++ lib/javascript/plupload/js/moxie.min.js | 16 + lib/javascript/plupload/js/plupload.dev.js | 2497 ++++ .../plupload/js/plupload.full.min.js | 29 + lib/javascript/plupload/js/plupload.min.js | 13 + lib/javascript/plupload/license.txt | 661 + lib/javascript/plupload/readme.md | 140 + lib/php/argus/argus.php | 1188 +- lib/php/argus/upload.php | 43 + lib/php/db/MySQL_class.php | 2 +- lib/php/db/MySQLi_class.php | 29 +- lib/php/setup_toolkit/cleanNewTask.php | 13 + lib/php/setup_toolkit/createNewTask.php | 66 + lib/php/setup_toolkit/getTaskStatus.php | 52 + lib/php/setup_toolkit/list_vault.php | 39 + lib/php/setup_toolkit/upload.php | 54 + lib/php/setup_toolkit/vault | 1 + lib/php/sys/r-goose_sys.php | 35 - lib/php/ui/UI_functions.php | 15 +- lib/settings.php.bbk | 10 + setup/index.php | 110 +- setup/install.php | 2 +- style/assets/access.png | Bin 0 -> 18861 bytes style/assets/blinker-1.psd | Bin 0 -> 29100 bytes style/assets/cursor.png | Bin 0 -> 714 bytes style/assets/green_1.gif | Bin 0 -> 1331 bytes style/assets/green_2.gif | Bin 0 -> 1331 bytes style/assets/red_1.gif | Bin 0 -> 1331 bytes style/assets/red_2.gif | Bin 0 -> 1331 bytes 140 files changed, 21327 insertions(+), 1494 deletions(-) create mode 100644 lib/controller/checkDeviceOperation.php create mode 100644 lib/controller/dash/node_1.js create mode 100644 lib/controller/dash/node_12.js create mode 100644 lib/controller/dash/node_4.js create mode 100644 lib/controller/uploadAsset.php create mode 100644 lib/javascript/jsapi_dynamic/rgoose_map.js delete mode 100644 lib/javascript/jsapi_dynamic/rgoose_mediaserver_module.js create mode 100644 lib/javascript/jsapi_dynamic/rgoose_modules.js rename lib/javascript/jsapi_dynamic/{rgoose_timeline.js => rgoose_reports.js} (95%) create mode 100644 lib/javascript/jsapi_dynamic/rgoose_swupgrade.js create mode 100644 lib/javascript/plupload/SECURITY.md create mode 100644 lib/javascript/plupload/bower.json create mode 100644 lib/javascript/plupload/examples/custom.html create mode 100644 lib/javascript/plupload/examples/dump.php create mode 100644 lib/javascript/plupload/examples/events.html create mode 100644 lib/javascript/plupload/examples/jquery/all_runtimes.html create mode 100644 lib/javascript/plupload/examples/jquery/jquery_ui_widget.html create mode 100644 lib/javascript/plupload/examples/jquery/queue_widget.html create mode 100644 lib/javascript/plupload/examples/jquery/s3.php create mode 100644 lib/javascript/plupload/examples/upload.php create mode 100644 lib/javascript/plupload/js/Moxie.swf create mode 100644 lib/javascript/plupload/js/Moxie.xap create mode 100644 lib/javascript/plupload/js/i18n/ar.js create mode 100644 lib/javascript/plupload/js/i18n/az.js create mode 100644 lib/javascript/plupload/js/i18n/bg.js create mode 100644 lib/javascript/plupload/js/i18n/bs.js create mode 100644 lib/javascript/plupload/js/i18n/ca.js create mode 100644 lib/javascript/plupload/js/i18n/cs.js create mode 100644 lib/javascript/plupload/js/i18n/cy.js create mode 100644 lib/javascript/plupload/js/i18n/da.js create mode 100644 lib/javascript/plupload/js/i18n/de.js create mode 100644 lib/javascript/plupload/js/i18n/el.js create mode 100644 lib/javascript/plupload/js/i18n/en.js create mode 100644 lib/javascript/plupload/js/i18n/es.js create mode 100644 lib/javascript/plupload/js/i18n/et.js create mode 100644 lib/javascript/plupload/js/i18n/fa.js create mode 100644 lib/javascript/plupload/js/i18n/fi.js create mode 100644 lib/javascript/plupload/js/i18n/fr.js create mode 100644 lib/javascript/plupload/js/i18n/he.js create mode 100644 lib/javascript/plupload/js/i18n/hr.js create mode 100644 lib/javascript/plupload/js/i18n/hu.js create mode 100644 lib/javascript/plupload/js/i18n/hy.js create mode 100644 lib/javascript/plupload/js/i18n/id.js create mode 100644 lib/javascript/plupload/js/i18n/it.js create mode 100644 lib/javascript/plupload/js/i18n/ja.js create mode 100644 lib/javascript/plupload/js/i18n/ka.js create mode 100644 lib/javascript/plupload/js/i18n/kk.js create mode 100644 lib/javascript/plupload/js/i18n/km.js create mode 100644 lib/javascript/plupload/js/i18n/ko.js create mode 100644 lib/javascript/plupload/js/i18n/ku_IQ.js create mode 100644 lib/javascript/plupload/js/i18n/lt.js create mode 100644 lib/javascript/plupload/js/i18n/lv.js create mode 100644 lib/javascript/plupload/js/i18n/ms.js create mode 100644 lib/javascript/plupload/js/i18n/nl.js create mode 100644 lib/javascript/plupload/js/i18n/pl.js create mode 100644 lib/javascript/plupload/js/i18n/pt.js create mode 100644 lib/javascript/plupload/js/i18n/pt_BR.js create mode 100644 lib/javascript/plupload/js/i18n/ro.js create mode 100644 lib/javascript/plupload/js/i18n/ru.js create mode 100644 lib/javascript/plupload/js/i18n/sk.js create mode 100644 lib/javascript/plupload/js/i18n/sl.js create mode 100644 lib/javascript/plupload/js/i18n/sq.js create mode 100644 lib/javascript/plupload/js/i18n/sr.js create mode 100644 lib/javascript/plupload/js/i18n/sv.js create mode 100644 lib/javascript/plupload/js/i18n/th_TH.js create mode 100644 lib/javascript/plupload/js/i18n/tr.js create mode 100644 lib/javascript/plupload/js/i18n/uk_UA.js create mode 100644 lib/javascript/plupload/js/i18n/vi.js create mode 100644 lib/javascript/plupload/js/i18n/zh_CN.js create mode 100644 lib/javascript/plupload/js/i18n/zh_TW.js create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/backgrounds.gif create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/buttons-disabled.png create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/buttons.png create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/delete.gif create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/done.gif create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/error.gif create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/throbber.gif create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/img/transp50.png create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js create mode 100644 lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.min.js create mode 100644 lib/javascript/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css create mode 100644 lib/javascript/plupload/js/jquery.ui.plupload/img/loading.gif create mode 100644 lib/javascript/plupload/js/jquery.ui.plupload/img/plupload.png create mode 100644 lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js create mode 100644 lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.min.js create mode 100644 lib/javascript/plupload/js/moxie.js create mode 100644 lib/javascript/plupload/js/moxie.min.js create mode 100644 lib/javascript/plupload/js/plupload.dev.js create mode 100644 lib/javascript/plupload/js/plupload.full.min.js create mode 100644 lib/javascript/plupload/js/plupload.min.js create mode 100644 lib/javascript/plupload/license.txt create mode 100644 lib/javascript/plupload/readme.md create mode 100644 lib/php/argus/upload.php create mode 100644 lib/php/setup_toolkit/cleanNewTask.php create mode 100644 lib/php/setup_toolkit/createNewTask.php create mode 100644 lib/php/setup_toolkit/getTaskStatus.php create mode 100644 lib/php/setup_toolkit/list_vault.php create mode 100644 lib/php/setup_toolkit/upload.php create mode 120000 lib/php/setup_toolkit/vault create mode 100644 lib/settings.php.bbk create mode 100644 style/assets/access.png create mode 100644 style/assets/blinker-1.psd create mode 100644 style/assets/cursor.png create mode 100644 style/assets/green_1.gif create mode 100644 style/assets/green_2.gif create mode 100644 style/assets/red_1.gif create mode 100644 style/assets/red_2.gif diff --git a/index.php b/index.php index 09e09d0..931158c 100644 --- a/index.php +++ b/index.php @@ -4,22 +4,30 @@ if( $CUser->Data['access'] > 5 ){ UI_PageHeaderExt( 'rgoose_general.js', - array( 'rgoose_timeline.js', - 'rgoose_devices.js', - 'rgoose_cameras.js', - 'rgoose_mediaserver_module.js', - 'rgoose_sysmap_editor.js', - 'rgoose_location_editor.js', - 'rgoose_dashboard.js', - 'rgoose_users.js', - 'rgoose_logs.js', - 'rgoose_main.js' + array( + 'rgoose_swupgrade.js', + 'rgoose_map.js', + 'rgoose_reports.js', + 'rgoose_devices.js', + 'rgoose_cameras.js', + 'rgoose_modules.js', + 'rgoose_sysmap_editor.js', + 'rgoose_location_editor.js', + 'rgoose_dashboard.js', + 'rgoose_users.js', + 'rgoose_logs.js', + 'rgoose_main.js' ) ); } else { UI_PageHeaderExt( 'rgoose_general.js', - array('rgoose_timeline.js', 'rgoose_dashboard.js','rgoose_main.js' ) + array( + 'rgoose_map.js', + 'rgoose_reports.js', + 'rgoose_dashboard.js', + 'rgoose_main.js' + ) ); }; UI_PageBottomExt(); diff --git a/lib/assembler.php b/lib/assembler.php index 0cfd428..9e4f9bf 100644 --- a/lib/assembler.php +++ b/lib/assembler.php @@ -15,6 +15,17 @@ if( $TT_123[0] == '4' ){ exit(); }; +$str = @file_get_contents('/proc/uptime'); +$num = floatval($str); +$secs = fmod($num, 60); $num = (int)($num / 60); +$mins = $num % 60; $num = (int)($num / 60); +$hours = $num % 24; $num = (int)($num / 24); +$days = $num; + +if( !$DATABASE->isConnected && $secs > 120 ) { + header( 'location: /setup/'); + exit(); +}; //$DATABASE->SetCacheDir( $DBCacheDir ); session_start(); diff --git a/lib/controller/checkDeviceOperation.php b/lib/controller/checkDeviceOperation.php new file mode 100644 index 0000000..ceb7c97 --- /dev/null +++ b/lib/controller/checkDeviceOperation.php @@ -0,0 +1,24 @@ +Data['id'] > 1 ){ + $Data = array(); + $Data['success'] = false; + if( isset( $_POST['OID'] ) ) { + $OpID = intval($_POST['OID']); + } else $OpID = 0; + + if( $OpID > 0 ){ + $QS = "SELECT `status` FROM `nodes_qcq` WHERE `id`={$OpID}"; + $RV = $DATABASE->Query( $QS, false ); + if( count( $RV ) ){ + $Data['success'] = true; + $Data['code'] = intval( $RV[0]['status'] ); + }; + } else { + $Data['msg']='Wrong Parameters'; + }; + echo json_encode( $Data ); + exit(); + }; + header('location: /'); +?> \ No newline at end of file diff --git a/lib/controller/dash/node_0.js b/lib/controller/dash/node_0.js index 3e76431..3ef5559 100644 --- a/lib/controller/dash/node_0.js +++ b/lib/controller/dash/node_0.js @@ -3,15 +3,9 @@ tools: [{ id:'gear', handler: function(){ - //Ext.Msg.alert('Message', 'The Settings tool was clicked.'); - showServerToolBox(%%%NODEID%%%); + showServerToolBox(%%%NODEID%%%); } - }/*,{ - id:'close', - handler: function(e, target, panel){ - panel.ownerCt.remove(panel, true); - } - }*/], + }], frame: true, width: 258, height: 240, @@ -19,10 +13,10 @@ title: '%%%SYSSERVERNAME%%%', items: [{ xtype: 'panel', - html: '

%%%SERVERSTATUS%%%

' + html: '

%%%SERVERSTATUS%%%

' },{ xtype: 'panel', - html: '
0CPU0MEM0DISK
' + html: '
0CPU0MEM0DISK
' },{ xtype: 'panel', height: 80, diff --git a/lib/controller/dash/node_1.js b/lib/controller/dash/node_1.js new file mode 100644 index 0000000..d93f46c --- /dev/null +++ b/lib/controller/dash/node_1.js @@ -0,0 +1,96 @@ +{ + id: 'db_node_%%%NODEID%%%', + width: 258, + height: 320, + title: '%%%NODENAME%%%', + tools: [{ + id:'gear', + handler: function(){ + //Ext.Msg.alert('Message', 'The Settings tool was clicked.'); + showSensorToolBox( %%%NODEID%%% ); + } + }], + listeners:{ + afterrender: function(){ + cleanup2DDraw( %%%NODEID%%% ); + drawZoomLevels[%%%NODEID%%%]=100; + //Deffer + } + }, + items:[{ + html: '
', + height: '260px' + },{ + id: 'status_%%%NODEID%%%', + border: true, + frame: true, + height: 36, + html: '' + }], + bbar:[{ + xtype: 'button', + text: '12.5%', + enableToggle: true, + id: 'zoom_bt12_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=12; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '25%', + enableToggle: true, + id: 'zoom_bt25_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=25; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '50%', + enableToggle: true, + id: 'zoom_bt50_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=50; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '100%', + pressed: true, + enableToggle: true, + id: 'zoom_bt100_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=100; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + }] +} \ No newline at end of file diff --git a/lib/controller/dash/node_10.js b/lib/controller/dash/node_10.js index 0bbb1d1..686568d 100644 --- a/lib/controller/dash/node_10.js +++ b/lib/controller/dash/node_10.js @@ -1,28 +1,18 @@ { id: 'db_node_%%%NODEID%%%', - //xxtype: 'panel', xtype: 'portlet', - //columnWidth:.33, - //layout: 'fit', width: 258, - height: 240, + height: %%%HEIGHT%%%+40, tools: [{ id:'gear', - handler: function(){ - editAnalogStream( %%%STREAMID%%%, 1 ); - } - }/*,{ - id:'close', - handler: function(e, target, panel){ - panel.ownerCt.remove(panel, true); - } - }*/], + handler: function(){ + editAnalogStream( %%%STREAMID%%%, 1 ); + } + }], frame: true, bodyStyle: 'padding: 0px;', - plr: null, title: '%%%NODENAME%%%', items:[{ - //html: '', - html: '', + html: '', }] } \ No newline at end of file diff --git a/lib/controller/dash/node_11.js b/lib/controller/dash/node_11.js index 3e878ae..01dc401 100644 --- a/lib/controller/dash/node_11.js +++ b/lib/controller/dash/node_11.js @@ -5,7 +5,7 @@ //columnWidth:.33, //layout: 'fit', width: 258, - height: 268, + height: %%%HEIGHT%%%+68, tools: [{ id:'gear', handler: function(){ @@ -22,7 +22,7 @@ plr: null, title: '%%%NODENAME%%%', items:[{ - html: '', + html: '', },{ xtype: 'spacer', height: 5 @@ -35,7 +35,6 @@ 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 ); @@ -58,7 +57,7 @@ document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove ); document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop ); } else { - t.setSize( 258, 268 ); + t.setSize( 258, %%%HEIGHT%%%+68 ); //Ext.Msg.alert('Message', 'The 270 tool was clicked.'); }; t.doLayout(); diff --git a/lib/controller/dash/node_12.js b/lib/controller/dash/node_12.js new file mode 100644 index 0000000..686568d --- /dev/null +++ b/lib/controller/dash/node_12.js @@ -0,0 +1,18 @@ +{ + id: 'db_node_%%%NODEID%%%', + xtype: 'portlet', + width: 258, + height: %%%HEIGHT%%%+40, + tools: [{ + id:'gear', + handler: function(){ + editAnalogStream( %%%STREAMID%%%, 1 ); + } + }], + frame: true, + bodyStyle: 'padding: 0px;', + title: '%%%NODENAME%%%', + items:[{ + html: '', + }] +} \ No newline at end of file diff --git a/lib/controller/dash/node_13.js b/lib/controller/dash/node_13.js index 4b011ad..ebfd6e0 100644 --- a/lib/controller/dash/node_13.js +++ b/lib/controller/dash/node_13.js @@ -5,7 +5,7 @@ //columnWidth:.33, //layout: 'fit', width: 258, - height: 268, + height: %%%HEIGHT%%%+68, tools: [{ id:'gear', handler: function(){ @@ -22,7 +22,7 @@ plr: null, title: '%%%NODENAME%%%', items:[{ - html: '', + html: '', },{ xtype: 'spacer', height: 5 @@ -35,7 +35,7 @@ handler: function(){ var t = Ext.getCmp('db_node_%%%NODEID%%%'); if( Ext.getCmp('ptz_btn_%%%NODEID%%%').pressed ){ - t.setSize( 258, 362 ); + t.setSize( 258, %%%HEIGHT%%%+162 ); 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 ); @@ -58,7 +58,7 @@ document.getElementById('img_btn_034_%%%NODEID%%%').addEventListener( 'mousedown', makePtzMove ); document.getElementById('img_btn_020_%%%NODEID%%%').addEventListener( 'mousedown', makePtzStop ); } else { - t.setSize( 258, 268 ); + t.setSize( 258, %%%HEIGHT%%%+68 ); //Ext.Msg.alert('Message', 'The 270 tool was clicked.'); }; t.doLayout(); diff --git a/lib/controller/dash/node_3.js b/lib/controller/dash/node_3.js index fd8ac9c..e40820f 100644 --- a/lib/controller/dash/node_3.js +++ b/lib/controller/dash/node_3.js @@ -17,7 +17,7 @@ } }, items:[{ - html: '
', + html: '
', height: '260px' },{ id: 'status_%%%NODEID%%%', @@ -33,14 +33,14 @@ id: 'zoom_bt12_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=12; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + drawZoomLevels[%%%NODEID%%%]=12; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; } },{ xtype: 'button', @@ -49,14 +49,14 @@ id: 'zoom_bt25_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=25; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + drawZoomLevels[%%%NODEID%%%]=25; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; } },{ xtype: 'button', @@ -65,14 +65,14 @@ id: 'zoom_bt50_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=50; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + drawZoomLevels[%%%NODEID%%%]=50; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; } },{ xtype: 'button', @@ -82,14 +82,14 @@ id: 'zoom_bt100_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=100; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + drawZoomLevels[%%%NODEID%%%]=100; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; } }] } \ No newline at end of file diff --git a/lib/controller/dash/node_4.js b/lib/controller/dash/node_4.js new file mode 100644 index 0000000..fd8ac9c --- /dev/null +++ b/lib/controller/dash/node_4.js @@ -0,0 +1,95 @@ +{ + id: 'db_node_%%%NODEID%%%', + width: 258, + height: 320, + title: '%%%NODENAME%%%', + tools: [{ + id:'gear', + handler: function(){ + //Ext.Msg.alert('Message', 'The Settings tool was clicked.'); + showSensorToolBox( %%%NODEID%%% ); + } + }], + listeners:{ + afterrender: function(){ + cleanup2DDraw( %%%NODEID%%% ); + drawZoomLevels[%%%NODEID%%%]=100; + } + }, + items:[{ + html: '
', + height: '260px' + },{ + id: 'status_%%%NODEID%%%', + border: true, + frame: true, + height: 36, + html: '' + }], + bbar:[{ + xtype: 'button', + text: '12.5%', + enableToggle: true, + id: 'zoom_bt12_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=12; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '25%', + enableToggle: true, + id: 'zoom_bt25_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=25; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '50%', + enableToggle: true, + id: 'zoom_bt50_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=50; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + },{ + xtype: 'button', + text: '100%', + pressed: true, + enableToggle: true, + id: 'zoom_bt100_%%%NODEID%%%', + toggleGroup: 'zoom_tg_%%%NODEID%%%', + toggleHandler: function( bt, st ){ + if( st ){ + drawZoomLevels[%%%NODEID%%%]=100; + var img = document.getElementById('draw_img_%%%NODEID%%%'); + img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"; + img.onload = function(){ + cleanup2DDraw( %%%NODEID%%% ); + }; + }; + } + }] +} \ No newline at end of file diff --git a/lib/controller/doDeviceOperation.php b/lib/controller/doDeviceOperation.php index 92a9ba0..ab5f6c6 100644 --- a/lib/controller/doDeviceOperation.php +++ b/lib/controller/doDeviceOperation.php @@ -21,6 +21,7 @@ $QS = "INSERT INTO `nodes_qcq` SET `node_id`={$NodeID}, `cmd`={$CMD}, `status`=0, `parameter`='{$PARAM}'"; $Data['query'] = $QS; $DATABASE->Query( $QS, false ); + $Data['operation_id'] = intval( $DATABASE->getLastInsertID() ); } else { $Data['msg']='Wrong Parameters'; }; diff --git a/lib/controller/getDashBoardItems.php b/lib/controller/getDashBoardItems.php index 812ef60..6396614 100644 --- a/lib/controller/getDashBoardItems.php +++ b/lib/controller/getDashBoardItems.php @@ -63,10 +63,10 @@ $CM['height'] = 25; $MODULES[] = $CM; }; + $MODULES_CNT = json_encode( $MODULES ); } else { - $MODULES[] = '[{ html: \'No Modules Defined\'}]'; + $MODULES_CNT = '[{ html: \'No Modules Defined\'}]'; }; - $MODULES_CNT = json_encode( $MODULES ); $TPL[$index] = str_replace('%%%MODULES%%%', ''.$MODULES_CNT , $TPL[$index] ); break; }; @@ -87,13 +87,18 @@ $Z=$DATABASE->Query( $QS ); $QS="SELECT * FROM `module_embed_video_settings` WHERE `id`=1"; $S=$DATABASE->Query( $QS ); + $MODULE_DATA = $S[0]; $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']; + $FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter']; $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']'; $TPL[$index] = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL[$index] ); $TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL[$index] ); $TPL[$index] = str_replace( '%%%SELURL%%%', $FU, $TPL[$index] ); $TPL[$index] = str_replace( '%%%STREAMID%%%', $R['aux_parameter'], $TPL[$index] ); + $W = 244; + $H = $W * ( $MODULE_DATA['height'] /$MODULE_DATA['width'] ); + $TPL[$index] = str_replace( '%%%WIDTH%%%', $W, $TPL[$index] ); + $TPL[$index] = str_replace( '%%%HEIGHT%%%', $H, $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 ); diff --git a/lib/controller/getDetectionProfile.php b/lib/controller/getDetectionProfile.php index 988636b..0ca6947 100644 --- a/lib/controller/getDetectionProfile.php +++ b/lib/controller/getDetectionProfile.php @@ -17,7 +17,10 @@ $K['data_status'] = intval( $CS['data_status'] ); $K['online'] = intval( $T['online']); switch( intval( $CS['type_id'] ) ){ - case 3:{ + case 1: + case 2: + case 3: + case 4:{ $K['profile_id'] = intval( $CS['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`"; @@ -26,8 +29,17 @@ { xtype: 'panel', title: 'kaka-panel', - height: 40, - frame: true + height: 120, + frame: true, + items:[{ + xtype: 'button', + text: 'Mask Editor', + id: 'DMED', + width: '100%', + handler: function(){ + showMaskEditor( true, 0, deviceCtrlNode ); + } + }] } KAKA; break; diff --git a/lib/controller/getDeviceDraw.php b/lib/controller/getDeviceDraw.php index aae6e5e..a6464cc 100644 --- a/lib/controller/getDeviceDraw.php +++ b/lib/controller/getDeviceDraw.php @@ -17,365 +17,27 @@ $AUX = intval($_POST['AUX']); } elseif( isset($_GET['AUX']) ) { $AUX = intval($_GET['AUX']); - } else $AUX = 0; + } else $AUX = 30; if( isset( $_POST['MAP'] ) ){ - $TYPE = 2; + $TYPE = 1; } elseif( isset($_GET['MAP']) ) { - $TYPE = 2; - } else $TYPE = 1; - - $QS = "SELECT * FROM lrf_draw WHERE node_id={$NID} ORDER BY ts DESC LIMIT 1"; + $TYPE = 1; + } else { + switch( $AUX ){ + case 100: $TYPE = 3; break; + case 50: $TYPE = 4; break; + case 30: $TYPE = 2; break; + case 25: $TYPE = 5; break; + case 12: $TYPE = 6; break; + }; + }; + + $QS = "SELECT `data` FROM `lrf_draw` WHERE `node_id`={$NID} AND `type`={$TYPE} LIMIT 1"; $Result = $DATABASE->Query( $QS, false ); if( count( $Result ) ){ - if( $SAVE_AS_PICTURE ){ - if( $Result[0]['rendered'] == 'Y' ){ - if( $TYPE == 1 ){ - 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']}_map.png"; - }; - } else { - $FF = "data/device_draws/{$Result[0]['md5']}.raw"; - $FN = "ddd"; - if( file_exists( $FF ) ) { - $FD = fopen( $FF, "rb" ); - if( $FD ){ - if( $Result[0]['type'] == 1 ){ - //$IM = imagecreatefrompng("../../style/assets/3d_draw_empty_100.png"); - $IM = imagecreatefromjpeg("../../style/assets/3d_draw_empty_100.jpg"); - 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, "LIBERMANDA", $black ); - imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_100.png" ); - imagedestroy( $IM ); - $QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}"; - $DATABASE->Query( $QS ); - $FN = "data/device_draws/{$Result[0]['md5']}_100.png"; - } else { - $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 = imagecolorallocatealpha( $IM, 0, 64, 0, 64 ); - $gray = imagecolorallocatealpha( $IM, 99, 111, 135, 0 ); - 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(); - $nnA = array(); - $nnB = 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 ); - - $nnA[] = $x0; - $nnA[] = $y0; - $nnB[] = $x0 + $maxR * cos( $ca ); - $nnB[] = $y0 + $maxR * sin( $ca ); - }; - }; - $ppB[] = $ppA[count($ppA)-2]; - $ppB[] = $ppA[count($ppA)-1]; - $popo = array_merge( $ppA, $ppB ); - $nodra = array_merge( $nnA, $nnB ); - imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green ); - imagefilledpolygon( $IM, $nodra, count( $nodra ) / 2, $gray ); - 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 = imagecolorallocatealpha( $IM, 0, 64, 0, 64 ); - $gray = imagecolorallocatealpha( $IM, 99, 111, 135, 0 ); - imagefilledrectangle( $IM, 5, 5, 36, 18, $bg ); - $NMR = sprintf( "%.2f", ( $MR / 2 ) ); - imagestring( $IM, 2, 6, 5, $NMR . "m.", $black ); - $rst = $maxR / 513.0; - $ppA = array(); - $ppB = array(); - $nnA = array(); - $nnB = 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 ); - $nnA[] = $x0; - $nnA[] = $y0; - $nnB[] = $x0 + $maxR * cos( $ca ); - $nnB[] = $y0 + $maxR * sin( $ca ); - }; - }; - $ppB[] = $ppA[count($ppA)-2]; - $ppB[] = $ppA[count($ppA)-1]; - $popo = array_merge( $ppA, $ppB ); - $nodra = array_merge( $nnA, $nnB ); - imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green ); - imagefilledpolygon( $IM, $nodra, count( $nodra ) / 2, $gray ); - 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 = imagecolorallocatealpha( $IM, 0, 64, 0, 64 ); - $gray = imagecolorallocatealpha( $IM, 99, 111, 135, 0 ); - imagefilledrectangle( $IM, 5, 5, 36, 18, $bg ); - $NMR = sprintf( "%.2f", ( $MR / 4 ) ); - imagestring( $IM, 2, 6, 5, $NMR . "m.", $black ); - $rst = $maxR / 257.0; - $ppA = array(); - $ppB = array(); - $nnA = array(); - $nnB = 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 ); - $nnA[] = $x0; - $nnA[] = $y0; - $nnB[] = $x0 + $maxR * cos( $ca ); - $nnB[] = $y0 + $maxR * sin( $ca ); - }; - }; - $ppB[] = $ppA[count($ppA)-2]; - $ppB[] = $ppA[count($ppA)-1]; - $popo = array_merge( $ppA, $ppB ); - $nodra = array_merge( $nnA, $nnB ); - imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green ); - imagefilledpolygon( $IM, $nodra, count( $nodra ) / 2, $gray ); - 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 = imagecolorallocatealpha( $IM, 0, 64, 0, 64 ); - $gray = imagecolorallocatealpha( $IM, 99, 111, 135, 0 ); - imagefilledrectangle( $IM, 5, 5, 36, 18, $bg ); - $NMR = sprintf( "%.2f", ( $MR / 8 ) ); - imagestring( $IM, 2, 6, 5, $NMR . "m.", $black ); - $rst = $maxR / 129.0; - $ppA = array(); - $ppB = array(); - $nnA = array(); - $nnB = 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 ); - $nnA[] = $x0; - $nnA[] = $y0; - $nnB[] = $x0 + $maxR * cos( $ca ); - $nnB[] = $y0 + $maxR * sin( $ca ); - }; - }; - $ppB[] = $ppA[count($ppA)-2]; - $ppB[] = $ppA[count($ppA)-1]; - $popo = array_merge( $ppA, $ppB ); - $nodra = array_merge( $nnA, $nnB ); - imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green ); - imagefilledpolygon( $IM, $nodra, count( $nodra ) / 2, $gray ); - 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"; - 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 ); - $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'] ); - switch( $AUX ){ - case 12: { - $IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png"); - $RR = 129.0; - $MR = $MR / 8; - $MD = 128; - break; - }; - case 25: { - $IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png"); - $RR = 257.0; - $MR = $MR / 4; - $MD = 256; - break; - }; - 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; - }; - }; - 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; - $x0 = 100; - $y0 = 100; - $rst = $maxR / $RR; - $ppA = array(); - $ppB = array(); - for( $i=0; $i< $as; $i++ ){ - if( $pts[$i] > 0 && $pts[$i] < $MD ){ - $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 ); - imagedestroy( $IM ); - } else { - 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 { - 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 ); - }; - }; + echo $Result[0]['data']; + exit(); } else { if( $AUX ){ $FN = "../../style/assets/lfs_draw_empty_{$AUX}.png"; diff --git a/lib/controller/getEventRecords.php b/lib/controller/getEventRecords.php index 51aad4d..fb9466a 100644 --- a/lib/controller/getEventRecords.php +++ b/lib/controller/getEventRecords.php @@ -1,25 +1,26 @@ Query( $QS ); if( count( $RV ) ){ - return $RV[0]['name']; + return $RV[0]; }; - return '-NoName-'; + return array( 'name'=>'-NoName-', 'type'=>'0'); } else { - return 'Argus Server'; + return array( 'name'=>'-NoName-', 'type'=>'0'); }; }; function getEventImages( $eid ){ global $DATABASE; - $QS = "SELECT pic.md5 AS md5 FROM events_2_pictures ep LEFT JOIN pictures pic ON ( pic.id = ep.picture_id ) WHERE ep.evt_id={$eid}"; + //$QS = "SELECT pic.md5 AS md5 FROM events_2_pictures ep LEFT JOIN pictures pic ON ( pic.id = ep.picture_id ) WHERE ep.evt_id={$eid}"; + $QS = "SELECT picture_id FROM events_2_pictures WHERE evt_id={$eid}"; $r = $DATABASE->Query( $QS ); $rv = array(); - foreach( $r as $t ) $rv[] = $r['md5']; + foreach( $r as $t ) $rv[] = $t['picture_id']; return $rv; }; @@ -31,9 +32,9 @@ if( isset( $_POST['FIL'] ) ) $FIL = intval( $_POST['FIL'] ); else $FIL = 0; if( $Mode ){ if( $FIL ){ - $QS = "SELECT * FROM events_cloud WHERE node_id={$FIL} ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ec.* FROM events_cloud ec WHERE ec.node_id={$FIL} ORDER BY ec.id DESC LIMIT 20"; } else { - $QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ec.* FROM events_cloud ec ORDER BY ec.id DESC LIMIT 20"; }; } else { if( isset( $_POST['SDA'] ) ) $SDA = intval( $_POST['SDA'] ); else $SDA = 0; @@ -53,15 +54,15 @@ $ETS = $CTS + 86400; }; if( $FIL ){ - $QS = "SELECT * FROM events_archive WHERE node_id={$FIL} AND ts >= {$STS} AND ts <= {$ETS} ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ea.* FROM events_archive ea WHERE ea.node_id={$FIL} AND ea.ts >= {$STS} AND ea.ts <= {$ETS} ORDER BY ea.id DESC LIMIT 20"; } else { - $QS = "SELECT * FROM events_archive WHERE ts >= {$STS} AND ts <= {$ETS} ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ea.* FROM events_archive ea WHERE ea.ts >= {$STS} AND ea.ts <= {$ETS} ORDER BY ea.id DESC LIMIT 20"; }; } else { if( $FIL ){ - $QS = "SELECT * FROM events_archive WHERE node_id={$FIL} ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ea.* FROM events_archive ea WHERE ea.node_id={$FIL} ORDER BY ea.id DESC LIMIT 20"; } else { - $QS = "SELECT * FROM events_archive ORDER BY id DESC LIMIT 20"; + $QS = "SELECT ea.* FROM events_archive ea ORDER BY ea.id DESC LIMIT 20"; }; }; }; @@ -102,6 +103,7 @@ $cnode['data'] = sprintf("AZ: %0.2f El: %0.2f R: %0.2f", floatval($CD['azimuth']), floatval($CD['elevation']), floatval($CD['range'])); $cnode['has_target'] = true; $cnode['has_geo'] = true; + $cnode['geo'] = array( 'lat'=>floatval( $CD['lat'] ),'lon'=>floatval( $CD['lon'] ),'alt'=>floatval( $CD['alt'] ) ); break; case 15:// Capture Start case 16:// Capture End @@ -130,7 +132,9 @@ $uts = intval($CD['ts']); $cnode['date'] = date( "m.d.y", $uts ); $cnode['time'] = date( "H:m:s", $uts ); - $cnode['device'] = getNodeName( $CD['node_id'] ); + $NIFO = getNodeInfo( $CD['node_id'] ); + $cnode['device'] = $NIFO['name']; + $cnode['dev_type'] = intval( $NIFO['type'] ); $Data[] = $cnode; }; $RA['log']=$Data; diff --git a/lib/controller/getGeoZones.php b/lib/controller/getGeoZones.php index bd36782..983bd28 100644 --- a/lib/controller/getGeoZones.php +++ b/lib/controller/getGeoZones.php @@ -111,7 +111,7 @@ function ToLL($north, $east, $utmZone){ foreach( $Result as $R ){ $Zone = array(); switch( $R['type'] ){ - case 2:{ + case 122:{ break; // Lfs - MND $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range FROM lrf_sensors WHERE id={$R['aux_id']}"; @@ -222,7 +222,10 @@ function ToLL($north, $east, $utmZone){ }; break; }; - case 3:{ + case 1: + case 2: + case 3: + case 4:{ // PLS 200 $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range, base_shift FROM lrf_sensors WHERE id={$R['aux_id']}"; $D = $DATABASE->Query( $QS, false ); diff --git a/lib/controller/getNetworkNodeProps.php b/lib/controller/getNetworkNodeProps.php index 307c8c2..abf717c 100644 --- a/lib/controller/getNetworkNodeProps.php +++ b/lib/controller/getNetworkNodeProps.php @@ -125,7 +125,7 @@ $ModulesData = "{ items: [{$IMPL}]}"; $Data = str_replace('%%%MODULES%%%', $ModulesData, $Data ); } else { - $Data = str_replace('%%%MODULES%%%', '', $Data ); + $Data = str_replace('%%%MODULES%%%', '{}', $Data ); }; break; case ARGUS_ALS_SENSOR: diff --git a/lib/controller/getPicture.php b/lib/controller/getPicture.php index a28c6ce..b736889 100644 --- a/lib/controller/getPicture.php +++ b/lib/controller/getPicture.php @@ -1,22 +1,24 @@ 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); - header("Pragma: no-cache"); - if(isset( $_POST['PID'] )){ - $PID = intval($_POST['PID']); - } else { - $PID = intval($_GET['PID']); - }; - $QS = "SELECT * FROM pictures WHERE id={$PID}"; - $Result = $DATABASE->Query( $QS, false ); - if( count( $Result ) ){ - loadPicture( $Result[0] ); - } else { - loadNotPicture(); - }; + header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + if( isset( $_POST['PID'] )){ + $PID = intval($_POST['PID']); + } else { + $PID = intval($_GET['PID']); + }; + if( $PID ){ + loadPicture( $PID ); + } else { + loadNotPicture(); + }; } else { - header('location: /'); + header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + header("Content-Type: image/png"); + echo file_get_contents( $SYSPath . '/style/assets/access.png' ); }; ?> \ No newline at end of file diff --git a/lib/controller/getStatus.php b/lib/controller/getStatus.php index f3f780a..4aa36a6 100644 --- a/lib/controller/getStatus.php +++ b/lib/controller/getStatus.php @@ -35,13 +35,13 @@ $CN['CTS'] = $Data['CTS']; $CN['STS'] = $STS; if( ( $CN['CTS'] - $STS ) > 1 ){ //3 seconds offline - $ServerIsOnLine = false; + //$ServerIsOnLine = false; $CN['status'] = 0; } else { $CN['status'] = 1; }; } else { - $ServerIsOnLine = false; + //$ServerIsOnLine = false; $CN['status'] = 0; }; $CN['cpu1'] = intval( $zult[0]['stat_cpu1'] * 2.5 ); diff --git a/lib/controller/props/0_node_prop.js b/lib/controller/props/0_node_prop.js index 7b998d5..bf88fd8 100644 --- a/lib/controller/props/0_node_prop.js +++ b/lib/controller/props/0_node_prop.js @@ -1,14 +1,7 @@ { - xtype: 'form', - labelWidth: 75, // label settings here cascade unless overridden border: false, frame: false, bodyStyle:'padding:5px 5px 0', - //width: 190, - //defaults: { - //width: 190 - //}, - defaultType: 'textfield', items: [{ xtype: 'panel', height: 100, @@ -25,11 +18,11 @@ },{ xtype:'fieldset', title: 'Information', - collapsible: true, + collapsible: false, autoHeight: true, defaults: { - width: '100%' - }, + width: '100%' + }, items :[ %%%INFO%%% ] },{ xtype:'fieldset', @@ -37,8 +30,8 @@ collapsible: true, autoHeight:true, defaults: { - width: '100%' - }, + width: '100%' + }, items :[ %%%SOCKETS%%% ] },{ xtype:'fieldset', @@ -46,8 +39,8 @@ collapsible: true, autoHeight:true, defaults: { - width: '100%' - }, + width: '100%' + }, items :[ %%%MODULES%%%,{ xtype: 'button', text: 'Add Module', diff --git a/lib/controller/props/5_node_prop.js b/lib/controller/props/5_node_prop.js index e4ab9f7..63f8897 100644 --- a/lib/controller/props/5_node_prop.js +++ b/lib/controller/props/5_node_prop.js @@ -64,7 +64,7 @@ },{ fieldLabel: 'Port', value: 2222, - readOnly: true, + readOnly: false, id: 'ued_port' }] }], diff --git a/lib/controller/removeNode.php b/lib/controller/removeNode.php index a6b2852..f1c73c1 100644 --- a/lib/controller/removeNode.php +++ b/lib/controller/removeNode.php @@ -1,5 +1,6 @@ Data['id'] > 1 ){ $NID = intval($_POST['NID']); $Data = array(); @@ -7,54 +8,7 @@ $QS = "SELECT * FROM nodes WHERE id={$NID}"; $result = $DATABASE->Query( $QS, false ); if( count( $result ) ){ - $T = $result[0]; - $AID = intval( $T['aux_id'] ); - $TYP = intval( $T['type'] ); - $QS = "DELETE FROM `sockets` WHERE `node_id`={$NID}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `connections` WHERE `from`={$NID} OR `to`={$NID}"; - $DATABASE->Query( $QS ); - switch( $TYP ){ - case 1: - case 2: - case 3: - case 4: - case 5:{ - // Sensor - $QS = "DELETE FROM `lrf_sensors` WHERE `id`={$AID}"; - $DATABASE->Query( $QS ); - break; - }; - case 13:{ - // Camera - $QS = "SELECT * FROM `media_streams` WHERE `source_id`={$AID}"; - $RR = $DATABASE->Query( $QS ); - if( count( $RR ) ){ - foreach( $RR as $R ){ - $QS = "DELETE FROM `media_server_streams` WHERE `media_stream_id`={$R['id']}"; - $DATABASE->Query( $QS ); - }; - $QS = "DELETE FROM `media_streams` WHERE `source_id`={$AID}"; - $DATABASE->Query( $QS ); - }; - $QS = "UPDATE `cameras` SET `status`=0, `node_id`=0 WHERE `id`={$AID}"; - $DATABASE->Query( $QS ); - break; - }; - case 20:{ - // EthernetUART - $QS = "DELETE FROM `uart_settings` WHERE `id`={$AID}"; - $DATABASE->Query( $QS ); - $QS = "UPDATE `cameras` SET `uart_id`=0 WHERE `uart_id`={$AID}"; - $DATABASE->Query( $QS ); - $QS = "UPDATE `lrf_sensors` SET `uart_id`=0 WHERE `uart_id`={$AID}"; - $DATABASE->Query( $QS ); - break; - }; - }; - $QS = "DELETE FROM `nodes` WHERE `id`={$NID}"; - $DATABASE->Query( $QS ); - $Data['success'] = true; + $Data['success'] = deleteNode( $NID ); } else { $Data['error'] = 'Unknown Node ID Provided!'; }; diff --git a/lib/controller/resetAllSettings.php b/lib/controller/resetAllSettings.php index d594bcc..39a80ad 100644 --- a/lib/controller/resetAllSettings.php +++ b/lib/controller/resetAllSettings.php @@ -12,7 +12,7 @@ if( $ACCESS > 5 ){ $QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SITE}"; $Nodes = $DATABASE->Query( $QS ); - //foreach( $Nodes as $Node ) deleteNode( $Node['id'] ); + 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) diff --git a/lib/controller/uploadAsset.php b/lib/controller/uploadAsset.php new file mode 100644 index 0000000..54212ad --- /dev/null +++ b/lib/controller/uploadAsset.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/lib/defines.php b/lib/defines.php index 091e35e..c796685 100644 --- a/lib/defines.php +++ b/lib/defines.php @@ -1,5 +1,7 @@ 1024 ) r = 1024; + break; + }; + case 50:{ + var r = Math.round( 512.0 / 98 * Math.sqrt( x*x + y*y ) ); + if( r > 512 ) r = 512; + break; + }; + case 25:{ + var r = Math.round( 256.0 / 98 * Math.sqrt( x*x + y*y ) ); + if( r > 256 ) r = 256; + break; + }; + case 12:{ + var r = Math.round( 128.0 / 98 * Math.sqrt( x*x + y*y ) ); + if( r > 128 ) r = 128; + break; + }; + default:{ + var r = -1; + break; + }; + }; + if( r > -1 ){ + var z = Math.round( -1.0 * Math.atan2(y, x) * 3000 / Math.PI ); + if( z < 0 ) z += 6000 ; + doDeviceOperation( id, 42, r+':'+z, true ); + }; +}; + function Draw3DTargets( k, b ){ cleanup3DDraw( k ); for( var z = 0; z < b.length; z++ ){ @@ -442,11 +478,13 @@ var drawZoomLevels = Array(); function cleanup2DDraw( a ){ var canvas = document.getElementById('targ_canvas_'+a ); - var ctx = canvas.getContext('2d'); var img = document.getElementById('draw_img_'+a ); - ctx.drawImage( img, 0, 0 ); - canvas.style='display: block;'; - img.style='display: none;'; + if( canvas != 'undefined' ){ + canvas.style='display: block; cursor: crosshair;'; //cursor: auto; + img.style='display: none;'; + var ctx = canvas.getContext('2d'); + ctx.drawImage( img, 0, 0 ); + }; }; function Draw2DTargets( k, b ){ @@ -518,15 +556,15 @@ function Draw2DTargets( 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'); +function setDonatStatus( node_id, param_id, value ){ + var val1D = document.getElementById('status_'+node_id+'_donut'+param_id+'_segment1'); + var val2D = document.getElementById('status_'+node_id+'_donut'+param_id+'_segment2'); + var val3D = document.getElementById('status_'+node_id+'_donut'+param_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 totalValue = document.getElementById('status_'+node_id+'_totalValue'+param_id); var total = val1+val2+val3; @@ -572,13 +610,13 @@ function fetchSiteStatus(){ 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 ); + setDonatStatus( data.nodes[i].id, 0, data.nodes[i].cpu5 ); + setDonatStatus( data.nodes[i].id, 1, data.nodes[i].mem ); + setDonatStatus( data.nodes[i].id, 2, data.nodes[i].disk ); } else { - setDonatStatus( '' , -1 ); - setDonatStatus( '1' , -1 ); - setDonatStatus( '2' , -1 ); + setDonatStatus( data.nodes[i].id, 0, -1 ); + setDonatStatus( data.nodes[i].id, 1, -1 ); + setDonatStatus( data.nodes[i].id, 2, -1 ); }; }; // Sesors @@ -599,32 +637,10 @@ function fetchSiteStatus(){ }; }; - //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 ){ - if( data.nodes[i].type == 3 ){ + if( data.nodes[i].type < 5 && data.nodes[i].type > 0 ){ if( data.nodes[i].status == 4 ){ Draw2DTargets( data.nodes[i].id, data.nodes[i].targets ); } else { @@ -782,22 +798,22 @@ function fetchSiteStatus(){ }; case 1:{ if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id ); - tt.update('
Online
'); + tt.update('
Online
'); break; }; case 2:{ if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id ); - tt.update('
Initializing
'); + tt.update('
Initializing
'); break; }; case 3:{ if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id ); - tt.update('
Trouble
'); + tt.update('
Trouble
'); break; }; case 4:{ if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id, data.nodes[i].targets ); - tt.update('
Alarm
'); + tt.update('
Alarm
'); break; }; @@ -892,6 +908,7 @@ function loadDashBoard(){ Ext.getCmp('main_content').setTitle( 'GetLabel('_SYS_DASHBOARD_');?>' ); var tPanel = Ext.getCmp('main_portal'); tPanel.removeAll(true); + nodeDashboardStatuses = new Array(); for( i=0; i < data.length; i++) tPanel.add( data[i] ); tPanel.doLayout(); $('img[data-enlargeable]').addClass('img-enlargeable').click(function() { diff --git a/lib/javascript/jsapi_dynamic/rgoose_devices.js b/lib/javascript/jsapi_dynamic/rgoose_devices.js index 568beb3..4b5bece 100644 --- a/lib/javascript/jsapi_dynamic/rgoose_devices.js +++ b/lib/javascript/jsapi_dynamic/rgoose_devices.js @@ -111,8 +111,8 @@ function saveSettingsLidar3D( ){ var data = Ext.decode(response.responseText); if( data.success == true ) { Ext.Msg.show({ - title:'Info Message', - msg: 'Settings are sucessfully saved.', + title:'GetLabel("_INFO_MSG_");?>', + msg: 'GetLabel("_SETTING_SAVE_OK_");?>', buttons: Ext.Msg.OK,//YESNOCANCEL, fn: function(){ SettingsLidar3D.hide(); @@ -122,7 +122,7 @@ function saveSettingsLidar3D( ){ }); } else { Ext.Msg.show({ - title:'Error Message', + title:'GetLabel("_ERROR_MSG_");?>', msg: data['error'], buttons: Ext.Msg.OK,//YESNOCANCEL, fn: function(){ @@ -277,8 +277,76 @@ var LRF1D2_st_win = null; var LRF2D2_st_win = null; var LRF16D3_st_win = null; +var currentDeviceOperatioId = 0; +var currentOperationTO = 0; +var currentOperationTimer = null; +var lastOperationCode = 0; +function checkDeviceOperationStatus(){ + if( currentOperationTO ){ + currentOperationTO--; + Ext.Ajax.request({ + url: '/lib/controller/checkDeviceOperation.php', + params: { + OID: currentDeviceOperatioId, + UID: 'Data['id'];?>', + SID: '' + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + if( !data.success ){ + Ext.MessageBox.hide(); + Ext.Msg.show({ + title:'Node Command Status', + msg: data.msg, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + } else { + if( lastOperationCode != data.code || data.code == 0 ){ + lastOperationCode = data.code; + currentOperationTO = 20; + }; + if( data.code < 100 ){ + currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 ); + } else { + Ext.MessageBox.hide(); + switch( data.code ){ + case 120: + case 100: + default: + Ext.Msg.show({ + title:'Node Command Status', + msg: 'Operation Complete', + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.INFO + }); + }; + }; + }; + }, + failure: failureAJAXFunction + }); + } else { + Ext.MessageBox.hide(); + Ext.Msg.show({ + title:'Node Command Status', + msg: 'Operation Status - Time Out!', + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }; +}; -function doDeviceOperation( NodeID, OpCode, Param='' ){ +function doDeviceOperation( NodeID, OpCode, Param='', nowait=false ){ + if( !nowait ){ + Ext.MessageBox.wait("GetLabel('_Loading_Calo_');?>","GetLabel('_Please_Wait_');?>",{ + width: '100%', + hidden: true, + progress: true, + closable: false + }); + }; + Ext.Ajax.request({ url: '/lib/controller/doDeviceOperation.php', params: { @@ -291,23 +359,20 @@ function doDeviceOperation( NodeID, OpCode, Param='' ){ success: function( response, opts ){ var data = Ext.decode(response.responseText); if( !data.success ){ + if( !nowait ) Ext.MessageBox.hide(); Ext.Msg.show({ title:'Node Command Status', msg: data.msg, buttons: Ext.Msg.OK, - //fn: processResult, - //animEl: 'upddiBTN', icon: Ext.MessageBox.ERROR }); } else { - Ext.Msg.show({ - title:'Node Command Status', - msg: data.query, - buttons: Ext.Msg.OK, - //fn: processResult, - //animEl: 'upddiBTN', - icon: Ext.MessageBox.INFO - }); + if( !nowait ){ + currentDeviceOperatioId = data.operation_id; + currentOperationTO = 20; + lastOperationCode = 0; + currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 ); + }; }; }, failure: failureAJAXFunction @@ -1235,7 +1300,7 @@ function onMouseDrag(event) { // path.position += event.delta; //} } -var absDrawMapSizes = [[0,0],[2304,288]]; +var absDrawMapSizes = [[2000,2000],[2304,288]]; var deviceMapScaling = 1.0; var deviceMapTopShift = 100; var deviceMapLeftShift = 100; @@ -1245,7 +1310,11 @@ var cMapCanvasWidth = 0; var cMapCanvasHeight = 0; function showMaskEditor( fromDevTool, DevType, NodeID ){ //alert( "DevType: "+DevType + " Dev Map size: "+ absDrawMapSizes[DevType][0]+"x"+absDrawMapSizes[DevType][1] ); - deviceMapScaling = ( window.screen.height * window.devicePixelRatio - 130 - ( deviceMapTopShift * 2 )) / absDrawMapSizes[DevType][1]; + if( DevType == 1 ){ + deviceMapScaling = ( window.screen.height * window.devicePixelRatio - 130 - ( deviceMapTopShift * 2 )) / absDrawMapSizes[DevType][1]; + } else { + deviceMapScaling = ( window.screen.width * window.devicePixelRatio - 30 - ( deviceMapLeftShift * 2 )) / absDrawMapSizes[DevType][0]; + }; cMapImageHeight = deviceMapScaling * absDrawMapSizes[DevType][1]; cMapImageWidth = deviceMapScaling * absDrawMapSizes[DevType][0]; cMapCanvasWidth = cMapImageWidth + (deviceMapLeftShift * 2); @@ -1313,7 +1382,7 @@ function showMaskEditor( fromDevTool, DevType, NodeID ){ id: 'me_b_delm', handler: function(){ if( MaskProject!= null ){ - alert( 'ClearMask' ); + //alert( 'ClearMask' ); }; } }], @@ -1336,6 +1405,7 @@ function showMaskEditor( fromDevTool, DevType, NodeID ){ LID: 0, MDTA: serial, MIH: cMapImageHeight, + MIW: cMapImageWidth, //MSF: deviceMapScaling, MSHX: deviceMapLeftShift, MSHY: deviceMapTopShift diff --git a/lib/javascript/jsapi_dynamic/rgoose_main.js b/lib/javascript/jsapi_dynamic/rgoose_main.js index fcd54e1..89bcef3 100644 --- a/lib/javascript/jsapi_dynamic/rgoose_main.js +++ b/lib/javascript/jsapi_dynamic/rgoose_main.js @@ -24,7 +24,7 @@ var sndBeep = new Howl({ loop: false, volume: 0.99, onend: function() { - console.log('Finished!'); + //console.log('Finished!'); } }); var sndExcl = new Howl({ @@ -55,17 +55,13 @@ function doRefresh(){ }; function doLogout(){ - //window.location = '/login.php?UID=1'; + 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({ @@ -107,31 +103,6 @@ function setUserContent( c_id ){ }); }; -function removeAllFromSite(){ - Ext.Msg.show({ - title:'GetLabel('_CLEAR_SITE_');?>', - msg: 'GetLabel('_SITE_DEL_ALL_ABO_');?>', - buttons: Ext.Msg.YESNO, - icon: Ext.MessageBox.WARNING, - fn: function(btn, text){ - if (btn == 'yes'){ - Ext.Ajax.request({ - url: '/lib/controller/resetAllSettings.php', - params: { - SAID: SelectedSite, - UID: , - SID: '' - }, - success: function( response, opts ){ - doRefresh(); - }, - failure: failureAJAXFunction - }); - }; - } - }); -}; - function doCheckWindowSize(){ if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { @@ -204,25 +175,19 @@ Ext.onReady(function(){ id:'go_home', text: 'GetLabel('_GO_HOME_');?>', toggled: (initView == 0 ), - handler: function( b, e ){ - loadDashBoard(); - } + handler: loadDashBoard },{ xtype: 'button', width: '100%', id:'go_monitor', text: 'GetLabel('_EVT_MONITOR_');?>', - handler: function( b, e ){ - loadMonitoring(); - } + handler: loadMonitoring },{ xtype: 'button', width: '100%', id:'go_archive', text: 'GetLabel('_EVT_ARCHIVE_');?>', - handler: function( b, e ){ - loadArchive(); - } + handler: loadArchive },{ xtype: 'button', width: '100%', @@ -242,23 +207,19 @@ Ext.onReady(function(){ width: '100%', id:'sys_edit', text: 'GetLabel('_EDT_CONNECTIONS_');?>', - handler: function( b, e ){ - loadSystemEditor(); - } + handler: loadSystemEditor },{ xtype: 'button', width: '100%', id:'map_edit', text: 'GetLabel('_EDT_LOCATIONS_');?>', - handler: function( b, e ){ - loadLocationEditor(); - } + handler: loadLocationEditor },{ xtype: 'button', width: '100%', - id:'logout', - text: 'GetLabel('_CLEAR_SITE_');?>', - handler: removeAllFromSite + id:'soft_update', + text: 'GetLabel('_UPGRADE_MNGMNT_');?>', + handler: loadUpgradeManagmenet }] },{ title: 'GetLabel('_PROF_SETTINGS_');?>', @@ -272,7 +233,7 @@ Ext.onReady(function(){ xtype: 'button', width: '100%', id:'adm_acc', - text: 'GetLabel("_USERS_MNGMT_");?>', + text: 'GetLabel('_USERS_MNGMT_');?>', handler: function( b, e ){ loadUserEditor(); } @@ -310,7 +271,7 @@ Ext.onReady(function(){ frame: false, border: false, items:{ - html: '

' + html: '' }, listeners:{ drop: function( a ){ @@ -320,5 +281,12 @@ Ext.onReady(function(){ }] }] }); - loadDashBoard(); + switch( Data['last_content_view']);?> ){ + case 0: loadDashBoard(); break; + case 1: loadMonitoring(); break; + case 2: loadArchive(); break; + case 5: loadUpgradeManagmenet(); break; + default: + loadDashBoard(); + }; }); \ No newline at end of file diff --git a/lib/javascript/jsapi_dynamic/rgoose_map.js b/lib/javascript/jsapi_dynamic/rgoose_map.js new file mode 100644 index 0000000..e69de29 diff --git a/lib/javascript/jsapi_dynamic/rgoose_mediaserver_module.js b/lib/javascript/jsapi_dynamic/rgoose_mediaserver_module.js deleted file mode 100644 index 58d3a19..0000000 --- a/lib/javascript/jsapi_dynamic/rgoose_mediaserver_module.js +++ /dev/null @@ -1,30 +0,0 @@ -// - -var addMediaServerDialog = null; -function addMediaServer(){ - if( addMediaServerDialog == null ){ - addMediaServerDialog = new Ext.Window({ - modal: true, - title: 'GetLabel("_ADD_MEDIA_SERVER_");?>', - width: 800, - height: 600, - layout: 'fit', - closeAction: 'hide', - items:{ - xtype: 'panel', - html: 'KOKO' - },bbar: [{ - text: 'GetLabel("_CANCEL_");?>', - handler: function(){ - addMediaServerDialog.hide(); - } - },{ - id: 'con_to_src', - text: 'GetLabel("_ADD_");?>', - disabled: false, - handler: connectToSeleced - }] - }); - }; - addMediaServerDialog.show(); -}; diff --git a/lib/javascript/jsapi_dynamic/rgoose_modules.js b/lib/javascript/jsapi_dynamic/rgoose_modules.js new file mode 100644 index 0000000..3dca610 --- /dev/null +++ b/lib/javascript/jsapi_dynamic/rgoose_modules.js @@ -0,0 +1,511 @@ +// + +var addMediaServerDialog = null; +function addMediaServer(){ + if( addMediaServerDialog == null ){ + addMediaServerDialog = new Ext.Window({ + modal: true, + title: 'GetLabel("_ADD_MEDIA_SERVER_");?>', + width: 800, + height: 600, + layout: 'fit', + closeAction: 'hide', + items:{ + xtype: 'panel', + html: 'KOKO' + },bbar: [{ + text: 'GetLabel("_CANCEL_");?>', + handler: function(){ + addMediaServerDialog.hide(); + } + },{ + id: 'con_to_src', + text: 'GetLabel("_ADD_");?>', + disabled: false, + handler: connectToSeleced + }] + }); + }; + addMediaServerDialog.show(); +}; + +var embedVideoEncoderSettingsWindow = null; +var embedVideoEncoderId = 0; +function updateFramePreview(){ + var canvas = document.getElementById("eve_frame_preview"); + if( canvas != null ){ + var ctx = canvas.getContext("2d"); + + ctx.beginPath(); + ctx.fillStyle = "#eeeeee"; + ctx.rect( 0, 0, 760, 400 ); + ctx.fill(); + ctx.closePath(); + var f_w = 320; + var f_h = 240; + var f_p = 0; + var fsid = Ext.getCmp('FRM_SIZE').getValue(); + switch( fsid ){ + case 1: f_w = 640; f_h = 480; f_p = 0; break; + case 2: f_w = 800; f_h = 600; f_p = 0; break; + case 3: f_w = 1280; f_h = 720; f_p = 1; break; + case 4: f_w = 1024; f_h = 768; f_p = 0; break; + case 5: f_w = 1920; f_h = 1080; f_p = 1; break; + }; + ctx.beginPath(); + ctx.fillStyle = "#000000"; + ctx.font = "20px Arial"; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.fillText( f_w+'x'+f_h, 380, 10 ); + ctx.fill(); + ctx.fillStyle = "#0000FF"; + if( f_p ){ + var t_w = 16 * ( 360 / 9 ); + ctx.rect( (760-t_w)/2, 20, t_w, 360 ); + } else { + var t_w = 4 * ( 360 / 3 ); + ctx.rect( (760-t_w)/2, 20, t_w, 360 ); + }; + ctx.fill(); + ctx.closePath(); + if( Ext.getCmp('eve_show_logo').getValue() ){ + var image = document.getElementById('eve_logo_img'); + if( image.complete && image.naturalHeight !== 0 ){ + var i_w = Ext.getCmp('LOGO_WIDTH').getValue(); + var i_h = Ext.getCmp('LOGO_HEIGHT').getValue(); + ctx.drawImage( image, 120, 120, i_w, i_h ); + }; + }; + + }; +}; +async function uploadFile() { + let formData = new FormData(); + formData.append("file", fileupload.files[0]); + await fetch( '/upload.php', { + method: "POST", + body: formData + }); + alert('The file has been uploaded successfully.'); +} + +function uploadEveLogo(){ + if( embedVideoEncoderId > -1 ){ + var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."}); + llMask.show(); + var formData = new FormData(); + var img_upload = document.getElementById('eve_logo_upload'); + formData.append("file", img_upload.files[0]); + formData.append("type", 'eve_logo'); + formData.append("id", embedVideoEncoderId ); + $.ajax({ + type: 'POST', + url: '/lib/controller/uploadAsset.php', + data: formData, + cache: false, + contentType: false, + processData: false, + success: function( data ){ + llMask.hide(); + console.log("success"); + console.log( data ); + }, + error: function( data ){ + llMask.hide(); + console.log("error"); + console.log(data); + } + }); + /* + Ext.Ajax.request({ + url: SITE_URL+'upload/', + headers: {'Content-type':'multipart/form-data'}, + form: filefield.up('form').getForm(), + isUpload: true, + success: function(response, options) { console.log(arguments); }, + failure: function(response, options) { console.log(arguments); } + }); + */ + + }; +}; + +function embedVideoEncoderSettings( ModuleID ){ + if( embedVideoEncoderSettingsWindow == null ){ + embedVideoEncoderSettingsWindow = new Ext.Window({ + modal: true, + title: 'GetLabel('_EMBED_VIDEO_ENCODER_');?>', + width: 792, + height: 700, + layout: 'fit', + closeAction: 'hide', + resizable: false, + items:[{ + layout: 'table', + border: false, + frame: false, + autoScroll: true, + defaults: { + bodyStyle:'padding: 0px', + border: false, + }, + layoutConfig: { + columns: 4 + }, + items:[{ + id: 'eve_frm_prev', + html: '', + height: 400, + width: 760, + border: true, + colspan: 4 + },{ + html: '

GetLabel('_OUTPUT_FRAME_SIZE_');?>:

' + },{ + xtype: 'combo', + id: 'FRM_SIZE', + width: 120, + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + mode: 'local', + store: new Ext.data.ArrayStore({ + id: 0, + fields: [ 'szId', 'szText' ], + data: [ + [0, '320x240'], + [1, '640x480'], + [2, '800x600'], + [3, '1280x720'], + [4, '1024x768'], + [5, '1920x1080'] + ] + }), + valueField: 'szId', + displayField: 'szText', + value: 0, + listeners:{ + beforeselect: updateFramePreview, + //blur: updateFramePreview, + change: updateFramePreview + } + },{ + html: '

GetLabel('_EVE_COMPRESS_QUA_');?>:

' + },{ + xtype: 'slider', + id: 'COMP_QUAL', + width: 120, + minValue: 0, + maxValue: 100, + value: 70 + },{ + html: '

GetLabel('_EVE_SHOW_TS_');?>:

' + },{ + xtype: 'checkbox', + id: 'eve_show_ts', + value: 0, + handler: updateFramePreview + },{ + html: '

GetLabel('_EVE_TS_POSX_');?>:

' + },{ + xtype: 'slider', + id: 'TS_POSX', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_TS_POSY_');?>:

' + },{ + xtype: 'slider', + id: 'TS_POSY', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_TRANSO_TS_');?>:

' + },{ + xtype: 'checkbox', + id: 'eve_transp_ts', + value: 0 + },{ + html: '

GetLabel('_EVE_FONT_TS_');?>:

' + },{ + xtype: 'combo', + id: 'TS_FONT', + width: 120, + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + mode: 'local', + store: new Ext.data.ArrayStore({ + id: 0, + fields: [ 'szId', 'szText' ], + data: [ + [0, 'SIMPLEX'], + [1, 'PLAIN'], + [2, 'DUPLEX'], + [3, 'COMPLEX'], + [4, 'TRIPLEX'], + [5, 'COMPLEX_SMALL'], + [6, 'SCRIPT_SIMPLEX'], + [7, 'SCRIPT_COMPLEX'] + ] + }), + valueField: 'szId', + displayField: 'szText', + value: 0 + },{ + html: '

GetLabel('_EVE_TS_FSCALE_');?>:

' + },{ + xtype: 'slider', + id: 'TS_FSCALE', + width: 120, + minValue: 0.0, + maxValue: 4.0, + value: 1.0 + },{ + html: '

GetLabel('_EVE_TS_FTHICK_');?>:

' + },{ + xtype: 'slider', + id: 'TS_FTHICK', + width: 120, + minValue: 1, + maxValue: 8.0, + value: 1.0 + },{ + html: '

GetLabel('_EVE_TS_LINE_T_');?>:

' + },{ + xtype: 'combo', + id: 'TS_LINET', + width: 120, + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + mode: 'local', + store: new Ext.data.ArrayStore({ + id: 0, + fields: [ 'szId', 'szText' ], + data: [ + [0, 'THIN'], + [1, 'ANTIALIAZED'], + [2, 'THICK'] + ] + }), + valueField: 'szId', + displayField: 'szText', + value: 0 + },{ + html: '

GetLabel('_EVE_SHOW_LBL_');?>:

' + },{ + xtype: 'checkbox', + id: 'eve_show_lbl', + value: 0, + handler: updateFramePreview + },{ + html: '

GetLabel('_EVE_LBL_POSX_');?>:

' + },{ + xtype: 'slider', + id: 'LBL_POSX', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LBL_POSY_');?>:

' + },{ + xtype: 'slider', + id: 'LBL_POSY', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_TRANSO_LBL_');?>:

' + },{ + xtype: 'checkbox', + id: 'eve_transp_lbl', + value: 0 + },{ + html: '

GetLabel('_EVE_FONT_LBL_');?>:

' + },{ + xtype: 'combo', + id: 'LBL_FONT', + width: 120, + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + mode: 'local', + store: new Ext.data.ArrayStore({ + id: 0, + fields: [ 'szId', 'szText' ], + data: [ + [0, 'SIMPLEX'], + [1, 'PLAIN'], + [2, 'DUPLEX'], + [3, 'COMPLEX'], + [4, 'TRIPLEX'], + [5, 'COMPLEX_SMALL'], + [6, 'SCRIPT_SIMPLEX'], + [7, 'SCRIPT_COMPLEX'] + ] + }), + valueField: 'szId', + displayField: 'szText', + value: 0 + },{ + html: '

GetLabel('_EVE_LBL_FSCALE_');?>:

' + },{ + xtype: 'slider', + id: 'LBL_FSCALE', + width: 120, + minValue: 0.0, + maxValue: 4.0, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LBL_FTHICK_');?>:

' + },{ + xtype: 'slider', + id: 'LBL_FTHICK', + width: 120, + minValue: 1, + maxValue: 8.0, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LBL_LINE_T_');?>:

' + },{ + xtype: 'combo', + id: 'LBL_LINET', + width: 120, + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + mode: 'local', + store: new Ext.data.ArrayStore({ + id: 0, + fields: [ 'szId', 'szText' ], + data: [ + [0, 'THIN'], + [1, 'ANTIALIAZED'], + [2, 'THICK'] + ] + }), + valueField: 'szId', + displayField: 'szText', + value: 0 + },{ + html: '

GetLabel('_EVE_SHOW_LOGO_');?>:

' + },{ + xtype: 'checkbox', + id: 'eve_show_logo', + value: 0, + handler: updateFramePreview + },{ + html: '

GetLabel('_EVE_LOGO_POSX_');?>:

' + },{ + xtype: 'slider', + id: 'LOGO_POSX', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LOGO_POSY_');?>:

' + },{ + xtype: 'slider', + id: 'LOGO_POSY', + width: 120, + minValue: 0, + maxValue: 100, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LOGO_WIDTH_');?>:

' + },{ + xtype: 'numberfield', + id: 'LOGO_WIDTH', + width: 120, + minValue: 0, + maxValue: 256, + value: 1.0 + },{ + html: '

GetLabel('_EVE_LOGO_HEIGHT_');?>:

' + },{ + xtype: 'numberfield', + id: 'LOGO_HEIGHT', + width: 120, + minValue: 0, + maxValue: 256, + value: 1.0 + },{ + id: 'eve_logo_ph', + html: '
' + },{ + html: '' + },{ + html: '

GetLabel('_EVE_PORT_');?>:

' + },{ + xtype: 'numberfield', + id: 'WA_PORT', + width: 120, + minValue: 1000, + maxValue: 65535, + value: 8080 + }] + }], + bbar: [{ + text: 'GetLabel("_CANCEL_");?>', + handler: function(){ + embedVideoEncoderSettingsWindow.hide(); + } + },{ + id: 'con_to_src', + text: 'GetLabel("_OK_");?>', + disabled: false, + handler: function(){ + + } + }] + }); + }; + embedVideoEncoderSettingsWindow.show(); + updateFramePreview(); + /* + Ext.Ajax.request({ + url: '/lib/controller/getModuleSettings.php', + params: { + MID: ModuleID, + UID: , + SID: '', + }, + success: function( response, opts ){ + var data = Ext.decode( response.responseText ); + if( data.error = false ){ + embedVideoEncoderSettingsWindow.show(); + Ext.getCmp('setting_master_ip').setValue( data.ip_address ); + Ext.getCmp('setting_master_port').setValue( data.port ); + Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address ); + Ext.getCmp('setting_slave_port').setValue( data.aux_port ); + Ext.getCmp('setting_lat').setValue( data.lat ); + Ext.getCmp('setting_lon').setValue( data.lon ); + Ext.getCmp('setting_alt').setValue( data.alt ); + Ext.getCmp('setting_roll').setValue( data.roll ); + Ext.getCmp('setting_pitch').setValue( data.pitch ); + Ext.getCmp('setting_yaw').setValue( data.yaw ); + } else { + Ext.Msg.show({ + title:'GetLabel("_ERROR_MSG_");?>', + msg: data.error_message, + buttons: Ext.Msg.OK, + fn: function(){ + //SettingsLidar3D.hide(); + }, + icon: Ext.MessageBox.ERROR + }); + }; + }, + failure: failureAJAXFunction + }); + */ +}; \ No newline at end of file diff --git a/lib/javascript/jsapi_dynamic/rgoose_timeline.js b/lib/javascript/jsapi_dynamic/rgoose_reports.js similarity index 95% rename from lib/javascript/jsapi_dynamic/rgoose_timeline.js rename to lib/javascript/jsapi_dynamic/rgoose_reports.js index ec6c40b..38491d3 100644 --- a/lib/javascript/jsapi_dynamic/rgoose_timeline.js +++ b/lib/javascript/jsapi_dynamic/rgoose_reports.js @@ -8,7 +8,7 @@ var SiteLon=; var SiteAlt=; var map = null; - +var selectedMarker = null; var timelineObj = null; var tlGroups = new vis.DataSet(); var tlItems = new vis.DataSet(); @@ -319,7 +319,19 @@ var eventsListStore = new Ext.data.JsonStore({ },{ name: 'has_geo', type: 'boolean' - }] /*, + },{ + name: 'has_images', + type: 'boolean' + },{ + name: 'images', + type: 'Array' + },{ + name: 'dev_type', + type: 'int' + },{ + name: 'geo', + type: 'object' + }] /*, proxy : new Ext.data.HttpProxy({ method: 'POST', prettyUrls: false, @@ -399,7 +411,7 @@ var eventsListColModel_ops = { {header: "Event", width: 80, sortable: false, dataIndex: 'event' }, {header: "Info", width: 200, sortable: false, dataindex: 'data' }, {header: "", width: 25, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer }, - {header: "", width: 25, sortable: false, dataIndex: 'has_pic', renderer: PicRenderer } + {header: "", width: 25, sortable: false, dataIndex: 'has_images', renderer: PicRenderer } ], defaults: { sortable: true, @@ -416,12 +428,12 @@ var eventsListColModel_ops = { var eventsListSelModel_ops = { singleSelect: true, listeners: { - rowselect: function(sm, row, rec) { - loadEventProperties( rec.data.id ); + rowselect: function(sm, row, rec ) { + loadEventProperties( rec.data ); //SelectedEvent = rec.data.id; - //alert( SelectedEvent ); - //var CB = Ext.getCmp('con_to_src'); - //CB.enable(); + //alert( SelectedEvent ); + //var CB = Ext.getCmp('con_to_src'); + //CB.enable(); } } }; @@ -616,15 +628,16 @@ function loadMapZones( SID ){ var cevt = Array(); var coz = Array(); -function LoadMapEventsZ( SID ){ +function LoadMapEventsZ( Mode ){ if( tlLoadLocker ) return; tlLoadLocker = true; Ext.Ajax.request({ url: '/lib/controller/getGeoAlerts.php', params: { - SITE: SID, + SITE: , UID: , - SID: '' + SID: '', + MODE: Mode }, success: function( response, opts ){ if( cevt.length ){ @@ -673,15 +686,43 @@ function LoadMapEventsZ( SID ){ }); }; -function loadEventProperties( EventID ){ +function loadEventProperties( EventRec ){ + //alert( 'Node: ' + NodeID ); + + var tPanel = Ext.getCmp('prop_content'); + tPanel.removeAll();// remove( 0 ); + var tt = '' + map.removeLayer( selectedMarker ); + if( EventRec.has_geo ){ + tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon; + selectedMarker.setLatLng([EventRec.geo.lat, EventRec.geo.lon]); + selectedMarker.addTo( map ); + }; + tPanel.add( { + title: 'Event Details', + html: '

' + EventRec.device+'

'+tt+'
' + } ); + + + if( EventRec.has_images ){ + for( var i=0; i < EventRec.images.length; i++ ){ + tPanel.add( { + frame: false, + html: '' + }); + }; + }; + tPanel.doLayout(); + + /* Ext.Ajax.request({ url: '/lib/controller/getEventProps.php', params: { NID: , UID: , SID: '', - EVENT: EventID + EVENT: EventRec.id }, success: function( response, opts ){ // If the response is JSON, you have to decode it @@ -695,6 +736,7 @@ function loadEventProperties( EventID ){ //Ext.fly('some_div').update('Fail!'); } }); + */ }; function getData( Mode ){ @@ -718,7 +760,7 @@ function getData( Mode ){ tlLoadLocker = false; var data = Ext.decode(response.responseText); eventsListStore.loadData( data, false ); - + LoadMapEventsZ( Mode ); }, failure: failureAJAXFunction }); @@ -731,7 +773,7 @@ function loadArchive(){ tlInterval = null; timelineObj = null; }; - setUserContent( 1 ); + setUserContent( 2 ); var tPanel = Ext.getCmp('main_portal'); tPanel.removeAll( true ); Ext.getCmp('main_content').setTitle( 'Events Archive' ); @@ -838,6 +880,17 @@ function loadArchive(){ keyboard: false }).setView([SiteLat, SiteLon], 17); //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("GetLabel('_SYS_ANCHORT_LBL_');?>"); + var selectedMarkerIcon = L.icon({ + iconUrl: '/style/assets/cursor.png', + iconSize: [32, 32], + iconAnchor: [16, 16]//, + //popupAnchor: [-3, -76], + //shadowUrl: 'my-icon-shadow.png', + //shadowSize: [68, 95], + //shadowAnchor: [22, 94] + }); + + selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } ); var mapLayers = []; @@ -1102,10 +1155,9 @@ function loadMonitoring(){ maxNativeZoom: 18, maxZoom: 24, }).addTo(map); */ - //loadTimeLineGroups( selectedSite ); + loadMapZones( SelectedSite ); - getData( 'live' ); - //eventsListStore.load({params:{start:0, limit:50}}); + tlInterval = window.setInterval( getData, 333, 'live' ); }; diff --git a/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js b/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js new file mode 100644 index 0000000..6d67120 --- /dev/null +++ b/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js @@ -0,0 +1,506 @@ +// + + + + +var muploader = null; + +var uploads_store_id = 0; +var uploads_store = new Ext.data.ArrayStore({ + autoDestroy: false, + storeId: 'up_store', + idIndex: 0, + fields: [ + {name: 'id', type: 'int' }, + {name: 'file_name', type: 'string'}, + {name: 'file_id', type: 'string'}, + {name: 'size', type: 'string'}, + {name: 'progress', type: 'int'}, + {name: 'status', type: 'string' } + ] +}); + +function progressRenderer( value, meta, record ){ + Ext.defer( function( id ){ + var p = new Ext.ProgressBar({ + id: 'progress_'+id, + renderTo: 'div_'+id, + animate: false, + width: '100%', + value: 0, + text: 'Upload Pending', + }); + }, 50, undefined, [ record.data.file_id ] ); + return '
'; +}; + +var fileUploadsColModel_ops = { + columns: [ + {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' }, + {header: "File Name", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' }, + {header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' }, + {header: "Progress", width: 150, renderer: progressRenderer, dataIndex: 'progress' }, + {header: " ", width: 50, dataIndex: 'status3' } + ], + defaults: { + sortable: false, + fixed: true, + menuDisabled: true, + width: 100 + } +}; + +var fileUploadsSelModel_ops = { + singleSelect: false +}; + +function archiveTypeRenderer( value, meta, record ){ + var alt_txt = ''; + var img_src = ''; + if( record.data.bk_type == 3 ){ + alt_txt = 'Full System Snapeshot'; + img_src = '/style/icons/icons/rosette.png'; + } else { + alt_txt = 'Database Backup'; + img_src = '/style/icons/icons/database.png'; + }; + return '
'+alt_txt+'
'; +}; + +var taskIsArmed = false; + +var archives_store = new Ext.data.JsonStore({ + root: 'backups', + totalProperty: 'totalCount', + idProperty: 'id', + //remoteSort: true, + autoLoad: true, + //url: '/lib/php/setup_toolkit/list_vault.php', + storeId: 'a_store', + fields: [{ + name: 'id', + type: 'int' + },{ + name: 'bk_type', + type: 'int' + },{ + name: 'file_name', + type: 'string' + },{ + name: 'base_version', + type: 'string' + },{ + name: 'ts', + type: 'string' + },{ + name: 'size', + type: 'string' + }], + proxy : new Ext.data.HttpProxy({ + method: 'POST', + prettyUrls: false, + url: '/lib/php/setup_toolkit/list_vault.php', + headers: { + UID: , + SID: '' + } + }) +}); + + +var archivesColModel_ops = { + columns: [ + {header: "Type", width: 50, align: 'center', css: 'vertical-align: middle;', renderer: archiveTypeRenderer, dataIndex: 'bk_type' }, + {header: "Version", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'base_version' }, + {header: "Name", width: 280, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' }, + {header: "Date", width: 120, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' }, + {header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' } + ], + defaults: { + sortable: false, + fixed: true, + menuDisabled: true, + width: 100 + } +}; + +var selectedArchiveRecord = null; + +var archivesSelModel_ops = { + singleSelect: true, + listeners: { + rowselect: function(sm, row, rec ) { + //loadEventProperties( rec.data ); + //SelectedEvent = rec.data.id; + //alert( SelectedEvent ); + //var CB = Ext.getCmp('con_to_src'); + //CB.enable(); + selectedArchiveRecord = rec; + if( rec.data.bk_type!=3 ){ + + } else { + + }; + } + } +}; + +var initial_md5 = ''; + +function updateTaskStatus(){ + Ext.Ajax.request({ + url: '/lib/php/setup_toolkit/getTaskStatus.php', + params: { + UID: , + SID: '', + IMD: initial_md5 + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + switch( data.status ){ + case 0:{ + Ext.getCmp('ch_ta_btn').disable(); + if( taskIsArmed ){ + taskIsArmed = false; + archives_store.reload(); + }; + break; + }; + case 1:{ + Ext.getCmp('ch_ta_btn').enable(); + taskIsArmed = true; + break; + }; + case 2:{ + Ext.getCmp('ch_ta_btn').disable(); + break; + }; + }; + Ext.getCmp('ctask_status').update( '

'+data.msg +': ' + data.status_desc+'

' ); + if( initial_md5 != data.log_md5 ){ + initial_md5 = data.log_md5; + Ext.getCmp('task_log').setRawValue( data.status_log ); + }; + }, + failure: failureAJAXFunction + }); +}; + +function createNewTask( task_id, param = '' ){ + Ext.Ajax.request({ + url: '/lib/php/setup_toolkit/createNewTask.php', + params: { + UID: , + SID: '', + TID: task_id, + PRM: param + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + if( data.status == 0 ){ + Ext.Msg.show({ + title:'Error', + msg: data.error, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }; + }, + failure: failureAJAXFunction + }); +}; + +function deleteNewTask(){ + Ext.Ajax.request({ + url: '/lib/php/setup_toolkit/cleanNewTask.php', + params: { + UID: , + SID: '' + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + if( data.status == 0 ){ + Ext.Msg.show({ + title:'Error', + msg: data.error, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }; + }, + failure: failureAJAXFunction + }); +}; + +function loadUpgradeManagmenet(){ + if( tlInterval!= null ){ + window.clearInterval( tlInterval ); + tlInterval = null; + timelineObj = null; + }; + setUserContent( 5 ); + initial_md5 = ''; + Ext.getCmp('main_content').setTitle( 'GetLabel('_SWU_DASHBOARD_');?>' ); + var tPanel = Ext.getCmp('main_portal'); + tPanel.removeAll(true); + tPanel.add({ + columnWidth: 1.0, + frame: false, + border: false, + items: [{ + frame: false, + border: false, + collapsible: false, + draggable: false, + layout: 'vbox', + //layoutConfig: { + // align : 'stretch', + // pack : 'start', + //}, + height: PanelH, + items:[{ + title: 'getLabel('_MAP_MONITORING_');?>', + xtype: 'panel', + height: PanelH-300, + //flex: 1, + frame: true, + width: '100%', + border: false, + layout: { + type: 'table', + columns: 2, + tableAttrs: { + valign: 'top', + style: 'valign:top;width:100%;' + } + }, + defaults: { + frame: true, + border: false, + height: ( PanelH-400 ) / 2, + style: 'margin: 5px;width:400px;display:block;' + }, + items:[{ + title: 'Current System Info', + width: '100%', + //flex: 1, + html: '

Current Web Version:

' + },{ + title: 'Tasks', + //width: 400, + layout: 'vbox', + items:[{ + xtype: 'button', + width: '100%', + text: 'Create Database Backup', + handler: function(){ + createNewTask( 2 ); + } + },{ + xtype: 'button', + width: '100%', + text: 'Create Full Snapeshot', + handler: function(){ + createNewTask( 255 ); + } + }] + },{ + title: 'Archives', + height: 250, + width: '100%', + tbar:[{ + text: 'Restore', + id: 'ar_restore_btn', + handler: function(){ + createNewTask(1, selectedArchiveRecord.data.file_name ); + } + },{ + text: 'Download', + id: 'ar_download_btn', + handler: function(){ + if( selectedArchiveRecord!= null ){ + window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name ); + }; + } + },{ + text: 'Delete', + id: 'ar_delete_btn', + handler: function(){ + createNewTask(100, selectedArchiveRecord.data.file_name ); + } + }], + items:[{ + xtype: 'grid', + id: 'archives_grid', + border: false, + frame: false, + autoScroll: true, + //width: '100%', + lazyRender: true, + height: 210, + ds: archives_store, + cm: new Ext.grid.ColumnModel( archivesColModel_ops ), + sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ), + viewConfig: { + // forceFit: true + }, + }] + },{ + title: 'Task Status', + height: 250, + //flex: 1, + items:[{ + xtype: 'spacer', + height: 4 + },{ + id: 'ctask_status', + border: true, + html: '' + },{ + xtype: 'spacer', + height: 4 + },{ + xtype: 'textarea', + id: 'task_log', + height: ( PanelH-320 ) / 2 - 120, + style: 'font-size:9px;width:100%;margin-bottom:4px;', + readOnly: true, + autoScroll: true, + value: '' + },{ + xtype: 'progress', + id: 'task_progress', + value: 1.0, + text: 'idle', + disabled: true + }], + tbar:[{ + text: 'Cancel Task', + id: 'ch_ta_btn', + disabled: true, + handler: deleteNewTask + }] + }] + + },{ + title: 'getLabel('_UPLOAD_PACKAGE_');?>', + xtype: 'panel', + height: 300, + //flex: 1, + frame: true, + border: false, + //layout: 'vbox', + items:[{ + xtype:'button', + id: 'pickfiles', + width: '100%', + text: 'Choose File' + },{ + height: 200, + xtype: 'grid', + id: 'upload_grid', + border: false, + frame: false, + mode: 'local', + lazyRender: true, + width: '100%', + autoScroll: true, + ds: uploads_store, + cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ), + sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), + viewConfig: { + forceFit: true + }, + bbar: [{ + text: 'Clear', + width: '100%', + handler: function(){ + muploader.splice(); + uploads_store.removeAll(); + } + }] + },{ + xtype:'button', + id: 'umpalumpa', + width: '100%', + disabled: true, + text: 'Upload', + handler: function(){ + if( muploader!= null ){ + muploader.start(); + }; + } + }], + listeners:{ + afterrender: function(){ + muploader = new plupload.Uploader({ + runtimes : 'html5,html4', + browse_button : Ext.getDom('pickfiles'), // you can pass in id... + //container: document.getElementById('upupu'), // ... or DOM Element itself + max_file_size : '1000mb', + chunk_size: '200kb', + max_retries: 3, + multi_selection: false, + max_file_count: 1, + // Fake server response here + url: '/lib/php/setup_toolkit/upload.php', + //url: "/echo/json", + + //flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf', + //silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap', + filters : [ + //{title : "Image files", extensions : "jpg,gif,png"}, + {title : "Archive files", extensions : "rar,zip,gz,bz2"} + ], + + init: { + PostInit: function() { + //$('filelist').innerHTML = ''; + + //$('uploadfiles').onclick = function() { + // uploader.start(); + // return false; + //}; + }, + + FilesAdded: function( up, files ) { + Ext.getCmp('umpalumpa').enable(); + plupload.each( files, function(file) { + uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true ); + uploads_store_id++; + Ext.getCmp('upload_grid').doLayout(); + }); + }, + + UploadProgress: function(up, file) { + var pb = Ext.getCmp( 'progress_'+file.id ); + if( file.percent < 100 ){ + pb.updateProgress( file.percent / 100, file.percent + '%', false ); + } else { + pb.updateProgress( 1.0, 'Uploaded', false ); + }; + }, + + Error: function(up, err) { + Ext.Msg.show({ + title:'Upload Status', + msg: "Error #" + err.code + ": " + err.message, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + } + } + }); + muploader.init(); + } + } + }] + }] + }); + muploader = null; + uploads_store.removeAll(); + tPanel.doLayout(); + archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }}); + updateTaskStatus(); + tlInterval = window.setInterval( updateTaskStatus, 333 ); +}; \ No newline at end of file diff --git a/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js b/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js index 0787c8d..8b3e90a 100644 --- a/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js +++ b/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js @@ -3,6 +3,32 @@ var resourceInfoWindow = null; + +function removeAllFromSite(){ + Ext.Msg.show({ + title:'GetLabel('_CLEAR_SITE_');?>', + msg: 'GetLabel('_SITE_DEL_ALL_ABO_');?>', + buttons: Ext.Msg.YESNO, + icon: Ext.MessageBox.WARNING, + fn: function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: '/lib/controller/resetAllSettings.php', + params: { + SAID: SelectedSite, + UID: , + SID: '' + }, + success: function( response, opts ){ + doRefresh(); + }, + failure: failureAJAXFunction + }); + }; + } + }); +}; + function showResourceInfo( rid ){ Ext.Ajax.request({ url: '/lib/controller/getResourceInfo.php', @@ -15,7 +41,7 @@ function showResourceInfo( rid ){ var data = Ext.decode(response.responseText); if( resourceInfoWindow == null ){ resourceInfoWindow = new Ext.Window({ - title: 'Resource Info', + title: 'GetLabel('_RES_INFO_');?>', modal: true, width: 800, height: 400, @@ -51,7 +77,7 @@ function showSettings( nid ){ var data = Ext.decode( response.responseText ); if( settingsWindow == null ){ settingsWindow = new Ext.Window({ - title: 'Settings', + title: 'GetLabel('_SETTINGS_');?>', modal: true, width: 800, height: 400, @@ -109,129 +135,141 @@ function createNode( STYPE ){ }); }; -var addPLS200_window = null; -function addSensor_PLS200(){ - if( addPLS200_window == null ){ - addPLS200_window = new Ext.Window({ - modal: true, - title: 'GetLabel("_DLG_ADD_PLS200_");?>', - width: 400, - height: 400, - layout: 'fit', - closeAction: 'hide', +var addSensor_window = null; +function addSerialSensor( sensorType ){ + if( addSensor_window!= null ){ + addSensor_window.hide(); + addSensor_window.destroy(); + addSensor_window = null; + }; + var TTL = ''; + var IMG = ''; + switch( sensorType ){ + case 1: TTL = 'GetLabel("_DLG_ADD_ALS_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzrm9.png'; break; + case 2: TTL = 'GetLabel("_DLG_ADD_LFS_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqb2.png'; break; + case 3: TTL = 'GetLabel("_DLG_ADD_PLS200_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqh3.png'; break; + case 4: TTL = 'GetLabel("_DLG_ADD_PLS360_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqx6.png'; break; + }; + addSensor_window = new Ext.Window({ + modal: true, + title: TTL, + width: 400, + height: 400, + layout: 'fit', + closeAction: 'hide', + items:[{ + xtype: 'form', + frame: false, + border: false, + hideLabels: false, + labelAlign: 'right', // or 'right' or 'top' + //labelSeparator: '>>', // takes precedence over layoutConfig value + labelWidth: 160, // defaults to 100 + labelPad: 8, // defaults to 5, must specify labelWidth to be honored items:[{ - xtype: 'form', + xtype:'panel', frame: false, border: false, - hideLabels: false, - labelAlign: 'right', // or 'right' or 'top' - //labelSeparator: '>>', // takes precedence over layoutConfig value - labelWidth: 160, // defaults to 100 - labelPad: 8, // defaults to 5, must specify labelWidth to be honored - items:[{ - xtype:'panel', - frame: false, - border: false, - html: '
', - height: '200px' - },{ - html: ' ', - frame: false, - border: false, - },{ - fieldLabel: 'GetLabel('_DEVICE_NAME_');?>', - xtype: 'textfield', - width: 200, - id: 'p200_dev_name', - allowBlank: false - },{ - xtype: 'combo', - fieldLabel: 'GetLabel('_SENSOR_MAX_RANGE_');?>', - lazyRender: true, - id: 'p200_range', - width: 200, - mode: 'local', - disabled: false, - forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['range','range_txt'], - data: [[35,'35'],[60,'60']] - }), - valueField: 'range', - displayField: 'range_txt' - },{ - xtype: 'combo', - fieldLabel: 'GetLabel('_UART_PORT_');?>', - lazyRender: true, - id: 'p200_uart_id', - width: 200, - disabled: false, - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: UartListStore, - valueField: 'uart_id', - displayField: 'uart_name' - },{ - fieldLabel: 'GetLabel('_PROTO_DEVICE_ID_');?>', - xtype: 'numberfield', - id: 'p200_dev_id', - width: 200, - allowBlank: false, - allowNegative: false, - minValue: 0, - maxValue: 255 - }], - bbar:[ '->',{ - text: 'GetLabel('_CANCEL_');?>', - handler: function(){ - addPLS200_window.hide(); - } - },{ - text: 'GetLabel('_ADD_');?>', - handler: function(){ - var uart_id_val = Ext.getCmp('p200_uart_id').getValue(); - var dev_id_val = Ext.getCmp('p200_dev_id').getValue(); - var sname = Ext.getCmp('p200_dev_name').getValue(); - var range = parseInt( Ext.getCmp('p200_range').getValue()); - if( sname != '' && uart_id_val != '' && range > 0 ){ - var uart_id = parseInt( uart_id_val ); - var dev_id = parseInt( dev_id_val ); - Ext.Ajax.request({ - url: '/lib/controller/addNetworkNode.php', - params: { - SITEID: , - UID: , - SID: '', - TYPE: 3, - SNAME: sname, - RANGE: range, - UART: uart_id, - DEVID: dev_id - }, - success: function( response, opts ){ - addPLS200_window.hide(); - // If the response is JSON, you have to decode it - reloadNetworkData( ); - }, - failure: failureAJAXFunction - }); - } else { - playSound(); - Ext.Msg.show({ - title:'GetLabel('_WRO_VALUES_');?>', - msg: 'GetLabel('_WRO_VAL_MSG_');?>', - buttons: Ext.Msg.OK, - icon: Ext.MessageBox.INFO - }); - }; - } - }] + html: '
', + height: '200px' + },{ + html: ' ', + frame: false, + border: false, + },{ + fieldLabel: 'GetLabel('_DEVICE_NAME_');?>', + xtype: 'textfield', + width: 200, + id: 'p200_dev_name', + allowBlank: false + },{ + xtype: 'combo', + fieldLabel: 'GetLabel('_SENSOR_MAX_RANGE_');?>', + lazyRender: true, + id: 'p200_range', + width: 200, + mode: 'local', + disabled: false, + forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['range','range_txt'], + data: [[35,'35'],[60,'60'],[120,'120'],[150,'150'],[160,'160'],[200,'200'],[300,'300']] + }), + valueField: 'range', + displayField: 'range_txt' + },{ + xtype: 'combo', + fieldLabel: 'GetLabel('_UART_PORT_');?>', + lazyRender: true, + id: 'p200_uart_id', + width: 200, + disabled: false, + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: UartListStore, + valueField: 'uart_id', + displayField: 'uart_name' + },{ + fieldLabel: 'GetLabel('_PROTO_DEVICE_ID_');?>', + xtype: 'numberfield', + id: 'p200_dev_id', + width: 200, + allowBlank: false, + allowNegative: false, + minValue: 0, + maxValue: 255 + }], + bbar:[ '->',{ + text: 'GetLabel('_CANCEL_');?>', + handler: function(){ + addSensor_window.hide(); + } + },{ + text: 'GetLabel('_ADD_');?>', + handler: function(){ + var uart_id_val = Ext.getCmp('p200_uart_id').getValue(); + var dev_id_val = Ext.getCmp('p200_dev_id').getValue(); + var sname = Ext.getCmp('p200_dev_name').getValue(); + var range = parseInt( Ext.getCmp('p200_range').getValue()); + if( sname != '' && uart_id_val != '' && range > 0 ){ + var uart_id = parseInt( uart_id_val ); + var dev_id = parseInt( dev_id_val ); + Ext.Ajax.request({ + url: '/lib/controller/addNetworkNode.php', + params: { + SITEID: , + UID: , + SID: '', + TYPE: sensorType, + SNAME: sname, + RANGE: range, + UART: uart_id, + DEVID: dev_id + }, + success: function( response, opts ){ + addSensor_window.hide(); + reloadNetworkData( ); + }, + failure: failureAJAXFunction + }); + } else { + playSound(); + Ext.Msg.show({ + title:'GetLabel('_WRO_VALUES_');?>', + msg: 'GetLabel('_WRO_VAL_MSG_');?>', + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.INFO + }); + }; + } }] - }); + }] + }); + if( addSensor_window != null ){ + addSensor_window.show(); }; - addPLS200_window.show(); }; var add3D_window = null; @@ -271,7 +309,7 @@ function addSensor_3D(){ allowBlank: false },{ xtype: 'combo', - fieldLabel: 'GetLabel('_SEVER_NODE_');?>', + fieldLabel: 'GetLabel('_DLG_CON_SEVER_NODE_');?>', lazyRender: true, id: 's3d_server', width: 200, @@ -365,7 +403,7 @@ function loadNodeSockets( NID, store ){ store.loadData( data, false ); } else { Ext.Msg.show({ - title:'Error Message', + title: 'GetLabel('_ERROR_MSG_TITLE_');?>', msg: data['error'], buttons: Ext.Msg.OK,//YESNOCANCEL, //fn: processResult, @@ -383,7 +421,7 @@ function createConnection( SID, EID, CTY ){ if( addConnectionDialog == null ){ addConnectionDialog = new Ext.Window({ modal: true, - title: 'GetLabel("_ADD_CONNECTION_");?>', + title: 'GetLabel('_ADD_CONNECTION_');?>', width: 773, height: 600, layout: 'hbox', @@ -441,12 +479,7 @@ function createConnection( SID, EID, CTY ){ }; Ext.getCmp('connectstarterbutton').toggle( false, false ); }, - failure: function( response, opts ) { - //Ext.fly('some_div').update('Fail!'); - }/*, - callback: function(options,success,response){ - // use this if you need to perform your own success/failure checking - }*/ + failure: failureAJAXFunction }); }; } @@ -485,7 +518,7 @@ function module_prop_FlyHunter( module_id ){ if( mp_FlyHunterWindow == null ){ mp_FlyHunterWindow = new Ext.Window({ modal: true, - title: 'GetLabel("_FHM_PROPS_");?>', + title: 'GetLabel('_FHM_PROPS_');?>', width: 773, height: 600, layout: 'table', @@ -520,7 +553,7 @@ function module_prop_FlyHunter( module_id ){ }; echo implode( ',', $RE ); } else { - echo "[0, 'No UARTS DEFINED']"; + echo "[0, '".$Labels->GetLabel('_NO_UARTS_DEF_')."']"; }; ?>] }), @@ -548,7 +581,7 @@ function module_prop_FlyHunter( module_id ){ }; echo implode( ',', $RE ); } else { - echo "[0, 'No DCB Connected']"; + echo "[0, '".$Labels->GetLabel('_NO_DCB_DEF_')."']"; }; ?>] }), @@ -578,8 +611,7 @@ function module_prop_FlyHunter( module_id ){ tPanel.add( data ); tPanel.doLayout(); }, - failure: function( response, opts ) { - } + failure: failureAJAXFunction }); }; @@ -623,26 +655,25 @@ function loadSystemEditor(){ text:'ALS', icon: '/style/assets/!cid_ii_jvmzuzrq10.png', handler: function(){ - createNode( 1 ); + addSerialSensor( 1 ); } },{ text:'LFS', icon: '/style/assets/!cid_ii_jvmzuzpt0.png', handler: function(){ - createNode( 2 ); + addSerialSensor( 2 ); } },{ text:'PLS-200', icon: '/style/assets/!cid_ii_jvmzuzql4.png', handler: function(){ - //createNode( 3 ); - addSensor_PLS200(); + addSerialSensor( 3 ); } },{ text:'PLS-360', icon: '/style/assets/!cid_ii_jvmzuzr87.png', handler: function(){ - //createNode( 4 ); + addSerialSensor( 4 ); } },{ text:'3DLIDAR', @@ -712,12 +743,13 @@ function loadSystemEditor(){ icon: '/style/assets/adam-1.png', }] } - },/*{ + },{ xtype: 'button', id: 'connectstarterbutton', text: 'GetLabel('_ADD_CONNECTION_');?>', - enableToggle : undefined, + enableToggle : false, handler: function(){ + /* if( InConnectEditMode ){ Ext.getCmp('connectstarterbutton').toggle( false, false ); InConnectEditMode = false; @@ -726,9 +758,10 @@ function loadSystemEditor(){ Ext.getCmp('connectstarterbutton').toggle( true, true ); InConnectEditMode = true; startCreateConnection(); - }; + };*/ + embedVideoEncoderSettings(0); } - }, */ { + },{ xtype: 'button', id: 'deletecomponentbutton', text: 'Remove Component', @@ -742,6 +775,11 @@ function loadSystemEditor(){ InComponentRemoveMode = true; }; } + },{ + xtype: 'button', + id:'deleteallcomponents', + text: 'GetLabel('_CLEAR_SITE_');?>', + handler: removeAllFromSite }] }] }); @@ -824,14 +862,7 @@ function loadSystemEditor(){ loadSystemEditor(); }; }, - failure: function( response, opts ) { - Ext.Msg.show({ - title:'Request Failure!', - msg: 'Ajax Request failed!', - buttons: Ext.Msg.OK, - icon: Ext.MessageBox.INFO - }); - } + failure: failureAJAXFunction }); }; }, diff --git a/lib/javascript/plupload/SECURITY.md b/lib/javascript/plupload/SECURITY.md new file mode 100644 index 0000000..be9489c --- /dev/null +++ b/lib/javascript/plupload/SECURITY.md @@ -0,0 +1 @@ +Tiny values the work of security researchers in improving the security of technology products worldwide. We welcome researchers who wish to responsibly disclose vulnerabilities in our products or systems. Note that we do not offer any “bug bounty” program or any form of payment for disclosed vulnerabilities. If you would like to report a vulnerability, please email infosec@tiny.cloud. \ No newline at end of file diff --git a/lib/javascript/plupload/bower.json b/lib/javascript/plupload/bower.json new file mode 100644 index 0000000..fe0b67b --- /dev/null +++ b/lib/javascript/plupload/bower.json @@ -0,0 +1,27 @@ +{ + "name": "plupload", + "license": "AGPLv3", + "authors": [ + "Davit Barbakadze " + ], + "homepage": "http://plupload.com", + "repository": { + "type": "git", + "url": "https://github.com/moxiecode/plupload.git" + }, + "main": [ + "./js/plupload.full.min.js" + ], + "ignore": [ + "tests/", + "src/", + "build/", + "examples/", + "Jakefile.js", + "package.json", + "bower.json", + "composer.json", + "README.md", + ".*" + ] +} \ No newline at end of file diff --git a/lib/javascript/plupload/examples/custom.html b/lib/javascript/plupload/examples/custom.html new file mode 100644 index 0000000..3850ade --- /dev/null +++ b/lib/javascript/plupload/examples/custom.html @@ -0,0 +1,85 @@ + + + + + +Plupload - Custom example + + + + + + + + + + +

Custom example

+ +

Shows you how to use the core plupload API.

+ +
Your browser doesn't have Flash, Silverlight or HTML5 support.
+
+ + + +
+

+
+
+
+
+
diff --git a/lib/javascript/plupload/examples/dump.php b/lib/javascript/plupload/examples/dump.php
new file mode 100644
index 0000000..6fb4649
--- /dev/null
+++ b/lib/javascript/plupload/examples/dump.php
@@ -0,0 +1,34 @@
+
+
+
+
+
+Plupload - Form dump
+
+
+	
+

Post dump

+ +

Shows the form items posted.

+ + + + + + + $value) { ?> + + + + + +
NameValue
+ + + diff --git a/lib/javascript/plupload/examples/events.html b/lib/javascript/plupload/examples/events.html new file mode 100644 index 0000000..dd05e75 --- /dev/null +++ b/lib/javascript/plupload/examples/events.html @@ -0,0 +1,217 @@ + + + + + +Plupload - Events example + + + + + + + + + + +

Events example

+ + + +
+

+ 
+
+
+
\ No newline at end of file
diff --git a/lib/javascript/plupload/examples/jquery/all_runtimes.html b/lib/javascript/plupload/examples/jquery/all_runtimes.html
new file mode 100644
index 0000000..ea44a9b
--- /dev/null
+++ b/lib/javascript/plupload/examples/jquery/all_runtimes.html
@@ -0,0 +1,139 @@
+
+
+
+
+
+Plupload - Queue widget example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Queue widget example

+ +

Shows the jQuery Plupload Queue widget and under different runtimes.

+ +
+

Flash runtime

+
Your browser doesn't have Flash installed.
+ +

Silverlight runtime

+
Your browser doesn't have Silverlight installed.
+
+ +
+

HTML 4 runtime

+
Your browser doesn't have HTML 4 support.
+ +

HTML 5 runtime

+
Your browser doesn't support native upload.
+
+ +
+ + +
+ + + + + diff --git a/lib/javascript/plupload/examples/jquery/jquery_ui_widget.html b/lib/javascript/plupload/examples/jquery/jquery_ui_widget.html new file mode 100644 index 0000000..1beb6c1 --- /dev/null +++ b/lib/javascript/plupload/examples/jquery/jquery_ui_widget.html @@ -0,0 +1,113 @@ + + + + + +Plupload - jQuery UI Widget + + + + + + + + + + + + + + + + +

jQuery UI Widget

+ +

You can see this example with different themes on the www.plupload.com website.

+ +
+
+

Your browser doesn't have Flash, Silverlight or HTML5 support.

+
+
+ +
+ + + + diff --git a/lib/javascript/plupload/examples/jquery/queue_widget.html b/lib/javascript/plupload/examples/jquery/queue_widget.html new file mode 100644 index 0000000..4855287 --- /dev/null +++ b/lib/javascript/plupload/examples/jquery/queue_widget.html @@ -0,0 +1,66 @@ + + + + + +Plupload - Queue widget example + + + + + + + + + + + + + + + +
+
+

Your browser doesn't have Flash, Silverlight or HTML5 support.

+
+ +
+ + + + + diff --git a/lib/javascript/plupload/examples/jquery/s3.php b/lib/javascript/plupload/examples/jquery/s3.php new file mode 100644 index 0000000..e29a4a8 --- /dev/null +++ b/lib/javascript/plupload/examples/jquery/s3.php @@ -0,0 +1,131 @@ + + + + + + +In our tests SilverLight didn't require anything special and worked with this configuration just fine. It may fail back +to the same crossdomain.xml as last resort. + +!!!Important!!! Plupload UI Widget here, is used only for demo purposes and is not required for uploading to S3. +*/ + +// important variables that will be used throughout this example +$bucket = 'BUCKET'; + +// these can be found on your Account page, under Security Credentials > Access Keys +$accessKeyId = 'ACCESS_KEY_ID'; +$secret = 'SECRET_ACCESS_KEY'; + +// prepare policy +$policy = base64_encode(json_encode(array( + // ISO 8601 - date('c'); generates uncompatible date, so better do it manually + 'expiration' => date('Y-m-d\TH:i:s.000\Z', strtotime('+1 day')), + 'conditions' => array( + array('bucket' => $bucket), + array('acl' => 'public-read'), + array('starts-with', '$key', ''), + // for demo purposes we are accepting only images + array('starts-with', '$Content-Type', 'image/'), + // Plupload internally adds name field, so we need to mention it here + array('starts-with', '$name', ''), + // One more field to take into account: Filename - gets silently sent by FileReference.upload() in Flash + // http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTFlash.html + array('starts-with', '$Filename', ''), + ) +))); + +// sign policy +$signature = base64_encode(hash_hmac('sha1', $policy, $secret, true)); + +?> + + + + + +Plupload to Amazon S3 Example + + + + + + + + + + + + + + + + + + +

Plupload to Amazon S3 Example

+ +
+

Your browser doesn't have Flash, Silverlight or HTML5 support.

+
+ + + + + diff --git a/lib/javascript/plupload/examples/upload.php b/lib/javascript/plupload/examples/upload.php new file mode 100644 index 0000000..9e5baeb --- /dev/null +++ b/lib/javascript/plupload/examples/upload.php @@ -0,0 +1,126 @@ +=PxovcHL%J!8tg!o7wR?ZKa7mCGK>F+Z0R_N{a2@u>S5sErYJ@l|W2QUgW4>XY$+&gB*tv1~wSWBe(|bBOSl*%H ze6dunbehGb@;CWoV$^+%W4xoT6s}f7ma6=DFlM z{~fVhiva6sl=#P}6a>rJ;%_Uv>w9M4DEQ{3Ri%n!gXDA{{-`l`CbTK;K5d!`%cFRt zUInkqNM3QBRb9uZRdEjeP`xJP?d2u+I%(Y}oZl48u02JPz+w)ChtU-jPxp}~g2pz| z(tF4cYIB7|XL5tqLUTK9HSM*aZxh#^9jxu2){o5qMroQdP$HYf%`z>51(cHe9 zP$EB;mFgZ`sF?wTzGhZi6MVIS#|akcGWBg_?ax^yHuFIfyc^Q_-lOrS z%-7)g(IZ(>qxx-0oSpr8d5!g?cfPI@UnD>HvuIh(L=-<{<$ZNN1cegHUo%?py+(Il$**F2>e;`u zzUEz@53M!;cXl_?y?Wm|o`<)oKTX~DFO$8U_&-6w@xJdnuOG+!Ms}ZH54r8^-#%|I zPlvOd2ybTB{{=L@jO^0?aQ-jM0L_OlD)jSLpKuSeUiGd^r%#Lyf9M5og{~!kn>o&O z0ez?yzqw{ES%}u(H{vGzg*eBfL1Z^au!HmJ7r_pSVTX6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plQppjB(D`=%uhF}4& zv>;Pjn5kLhmLXhmg#1c@2E2F;6i7%Ef}|?W`x=l6dw7}lA5E&lE}$%!tS;$V(mLQE zAo>iz6CPFYOl3KS9&@~mo0bA~n!YxvI})D+lgtB7=J%d6xc4TGi!Dbsr68YiJ^H?P z#(&ZuT4hG_%{N{Aqnnz3IrXX=rnTIB%P)Q~ZThrdO>Mg6XU$F1ryAyv@@t`N>a8u; nPM!A4Smfqb7mg2ur@1vUtyvcv#x*zpX4+I^GNk?&hDc!~X{vHx literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/Moxie.xap b/lib/javascript/plupload/js/Moxie.xap new file mode 100644 index 0000000000000000000000000000000000000000..70ef069dad67effad3032a5537a3746fa09ebb4b GIT binary patch literal 65757 zcmY(qV~{XRtTi~cZQHhO+xE;ewr$(CZQHhOo8No4YWLe)U8(NBshsYdlcW`-fk99J z03aX$zDz2`=0U;crT_o{WB~yH5dPZ*?d@d^?JUhqot)|14Q*{g;$*Fc7!btXLUsku z0TLl(wPb7|ilhe213g_=gq|3kNf-|Enj+FY2br6>CZL!H1$uacZYY$iZ65i-tZ4YF7co5 zv_DE0ACH#y)v2zoxiq)S=OrXPSFm2aPFeFKG`a4|7xcv%H~K`pz&l$KcUz=i9@u2y z$d*;~e`CcrT6aI?YpX4r?LB%iSsIizhS~n1w-gtQm*8h^epyv(Ex))`*hlw?v)8pg z^V~S%aVW#*v+co7?&7Xi)_4sQz`MM!YnNd*wPQt3*UY5*X+CJc17%Ih2LCd2&A@FA zZ7?6$-(?wmNcTP&$!xJ+JBwU}*LRofq_fS&sDXH_M)4|`CZq~wji}$Bf%sylfhFJT z)H@$&SAg8bv6mE!6YZHxYv2)o`Qv}zvwj=fdvv|K|8#-F1;WYXUa4i#P6JE-eRDlR zZNcZ1v?_6X4}NkeBw^$vxl<2gysRxav)xb+FGmlsyss!*v;wSG+x#8}X>A>^bD0l9 zMA$OBlARmE1jWJZx@Cjg#kGpIH;v$?vkhTN0NR(M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cUjQTXV}#EE{X= zo=2S%r;=atwiTfKisqRsthe6ZwMpq#On z8_V>t)M0=JNRrHY-pUkyw7vW0+qn=c#8<0Vnr*SB&2ct%hvoJuxpjNC)$!h3QXyO! z0g{Vs8U>*k0_mCK66?{AIjKtHPvgx!{r7Pr&Z!AI)u~*i^uu0C+|@39`y2lh4ZOV3 z|JWWc#j%s2;J6c;qPfITgbMF5Ahb=rE`5d`eGj+sJv@jq#@{8Oui0YPH|~|yxZGO2 zn+WEbyi1P~CA3@{K7($D)plYqUwjDf9%sfm*_y}N;p_5ViG z;-!ilEyiwbK>`7>AOis*{0H>yCnqW?Want2Eg>mJ@9ggUf3bQzhi7x3KtLux`2WO$ zK>rU`Qb6MW!_KNkN#_0Z!vG8j2<1QO{f7G=th9xZiLH~#|A%h_ZfpSh!9V@f|I_sU zm1YqC2d^k1AS@&Df8lf}SQ5!5JoCS=eo$~AKtFB$U+L@TYch837AEw@)<2^K4)Nb* Q5I>Lg&-iM6|99@c0D=zP_5c6? literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/i18n/ar.js b/lib/javascript/plupload/js/i18n/ar.js new file mode 100644 index 0000000..ac2ff38 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ar.js @@ -0,0 +1,2 @@ +// Arabic (ar) +plupload.addI18n({"Stop Upload":"أيقاف التحميل","Upload URL might be wrong or doesn't exist.":"عنوان التحميل ربما يكون خاطئ أو غير متوفر","tb":"تيرابايت","Size":"الحجم","Close":"أغلاق","You must specify either browse_button or drop_element.":"","Init error.":"خطأ في تهيئة","Add files to the upload queue and click the start button.":"أضف ملفات إلى القائمة إنتظار التحميل ثم أضغط على زر البداية","List":"","Filename":"أسم الملف","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"صيغة الصورة أما خطاء أو غير مدعومه","Status":"الحالة","HTTP Error.":"خطأ في برتوكول نقل الملفات","Start Upload":"أبدا التحميل","Error: File too large:":" خطاء : حجم الملف كبير :","kb":"كيلوبايت","Duplicate file error.":"خطاء في تكرار الملف","File size error.":"خطأ في حجم الملف","N/A":"لا شي","gb":"جيجابايت","Error: Invalid file extension:":"خطاء : أمتداد الملف غير صالح :","Select files":"أختر الملفات","%s already present in the queue.":"%s الملف موجود بالفعل في قائمة الانتظار","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"ملف: %s","b":"بايت","Uploaded %d/%d files":"تحميل %d/%d ملف","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"العناصر المقبوله لتحميل هي %d ملف في هذا الوقت. الملفات الاضافية أزيلة.","%d files queued":"%d الملفات في قائمة الانتظار","File: %s, size: %d, max file size: %d":"ملف: %s, أقصى حجم للملف: %d, حجم: %d","Thumbnails":"","Drag files here.":"سحب الملف هنا","Runtime ran out of available memory.":"الذاكرة المتوفره أنتهت لمدة التشغيل","File count error.":"خطاء في عد الملفات","File extension error.":"خطأ في أمتداد الملف","mb":"ميجابايت","Add Files":"أضف ملفات"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/az.js b/lib/javascript/plupload/js/i18n/az.js new file mode 100644 index 0000000..b665321 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/az.js @@ -0,0 +1,2 @@ +// Azerbaijani (az) +plupload.addI18n({"Stop Upload":"Yükləməni saxla","Upload URL might be wrong or doesn't exist.":"Yükləmə ünvanı səhvdir və ya mövcud deyil","tb":"tb","Size":"Həcm","Close":"Bağla","You must specify either browse_button or drop_element.":"","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Faylları əlavə edin və yüklə düyməsinə klikləyin.","List":"","Filename":"Faylın adı","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Şəklin formatı uyğun deyil və ya dəstəklənmir.","Status":"Status","HTTP Error.":"HTTP xətası.","Start Upload":"Yüklə","Error: File too large:":"Xəta:Fayl həcmi çox böyükdür.","kb":"kb","Duplicate file error.":"Bu fayl artıq növbədə var.","File size error.":"Fayl həcmi xətası.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Xəta: Yanlış fayl uzantısı:","Select files":"Faylları seçin","%s already present in the queue.":"%s artıq növbədə var.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fayl: %s","b":"b","Uploaded %d/%d files":"%d/%d fayl yüklənib","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"Növbədə %d fayl var","File: %s, size: %d, max file size: %d":"Fayl: %s, həcm: %d, max fayl həcmi: %d","Thumbnails":"","Drag files here.":"Faylları bura çəkin.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Fayl sayı çox böyükdür.","File extension error.":"Fayl uzantısı xətası.","mb":"mb","Add Files":"Fayl əlavə et"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/bg.js b/lib/javascript/plupload/js/i18n/bg.js new file mode 100644 index 0000000..171f612 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/bg.js @@ -0,0 +1,2 @@ +// Bulgarian (bg) +plupload.addI18n({"Stop Upload":"Спрете качването","Upload URL might be wrong or doesn't exist.":"URL за качване може да е грешен или да не съществува.","tb":"tb","Size":"Размер","Close":"Затвори","You must specify either browse_button or drop_element.":"","Init error.":"Грешка: инициализиране.","Add files to the upload queue and click the start button.":"Добавете файлове в опашката за качване, и щракнете бутона старт.","List":"","Filename":"Име на файла","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Формата на изображението или е объркан, или не се поддържа.","Status":"Статус","HTTP Error.":"Грешка: HTTP .","Start Upload":"Започнете качването","Error: File too large:":"Грешка: Файла е твърде голям:","kb":"kb","Duplicate file error.":"Грешка: файла е вече качен на сървъра.","File size error.":"Грешка: размер на файла.","N/A":"не приложимо","gb":"gb","Error: Invalid file extension:":"Грешка: Невалидно разширение на файл:","Select files":"Изберете файлове","%s already present in the queue.":"%s вече го има в опашката.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Файл: %s","b":"b","Uploaded %d/%d files":"Качени %d/%d файла","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Елемента за качване приема само %d файл(а) наведнъж. Допълнителните файлове бяха отстранени.","%d files queued":"%d файла в опашката","File: %s, size: %d, max file size: %d":"Файл: %s, размер: %d, максимален размер: %d","Thumbnails":"","Drag files here.":"Довлечете файловете тук.","Runtime ran out of available memory.":"Недостатъчна свободна памет.","File count error.":"Грешка в броя на файловете.","File extension error.":"Грешка: разширение на файла.","mb":"mb","Add Files":"Добавете файлове"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/bs.js b/lib/javascript/plupload/js/i18n/bs.js new file mode 100644 index 0000000..6576bb6 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/bs.js @@ -0,0 +1,2 @@ +// Bosnian (bs) +plupload.addI18n({"Stop Upload":"Prekini dodavanje","Upload URL might be wrong or doesn't exist.":"URL za dodavanje je neispravan ili ne postoji.","tb":"tb","Size":"Veličina","Close":"Zatvori","You must specify either browse_button or drop_element.":"","Init error.":"Inicijalizacijska greška.","Add files to the upload queue and click the start button.":"Dodajte datoteke u red i kliknite na dugme za pokretanje.","List":"","Filename":"Naziv datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format slike je neispravan ili nije podržan.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Započni dodavanje","Error: File too large:":"Greška! Datoteka je prevelika:","kb":"kb","Duplicate file error.":"Dupla datoteka.","File size error.":"Greška u veličini datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Greška! Neispravan ekstenzija datoteke:","Select files":"Odaberite datoteke","%s already present in the queue.":"%s se već nalazi u redu.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Dodano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Dodavanje trenutno dozvoljava samo %d datoteka istovremeno. Dodatne datoteke su uklonjene.","%d files queued":"%d datoteka čeka","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Thumbnails":"","Drag files here.":"Dovucite datoteke ovdje.","Runtime ran out of available memory.":"Nema više dostupne memorije.","File count error.":"Greška u brojanju datoeka.","File extension error.":"Greška u ekstenziji datoteke.","mb":"mb","Add Files":"Dodaj datoteke"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ca.js b/lib/javascript/plupload/js/i18n/ca.js new file mode 100644 index 0000000..11abb4f --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ca.js @@ -0,0 +1,2 @@ +// Catalan (ca) +plupload.addI18n({"Stop Upload":"Parar pujada","Upload URL might be wrong or doesn't exist.":"La URL de càrrega no és correcte o bé no existeix.","tb":"Tb","Size":"Tamany","Close":"Tancar","You must specify either browse_button or drop_element.":"Has d'especificar o bé el botó de selecció de fitxers `browse_button` o bé l'àrea per arrosegar els fitxers `drop_element`.","Init error.":"Error d´inicialització.","Add files to the upload queue and click the start button.":"Afegeixi els fitxers a la cua de pujada i cliqui el botó Iniciar","List":"Llistat","Filename":"Nom de fitxer","%s specified, but cannot be found.":"%s especificat, però no es pot trobar.","Image format either wrong or not supported.":"Format d'imatge incorrecte o no suportat.","Status":"Estat","HTTP Error.":"Error HTTP.","Start Upload":"Començar pujada","Error: File too large:":"Error: Fitxer massa gran:","kb":"Kb","Duplicate file error.":"Error per duplicitat de fitxer.","File size error.":"Error en la mida del fitxer.","N/A":"N/D","gb":"Gb","Error: Invalid file extension:":"Error: Extensió de fitxer no vàlida:","Select files":"Seleccionar fitxers","%s already present in the queue.":"%s ja existeix a la cua.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resolució de la imatge massa gran! El pujador %s suporta mides d'imatge fins a %wx%hpx.","File: %s":"Fitxer: %s","b":"b","Uploaded %d/%d files":"Pujats %d/%d fitxers","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"La càrrega d'elements tan sols accepta %d fitxer(s) alhora. Els fitxers sobrants seran descartats.","%d files queued":"%d fitxers en cua","File: %s, size: %d, max file size: %d":"Fitxer: %s, mida: %d, mida màxima de fitxer: %d","Thumbnails":"Miniatures","Drag files here.":"Arrossegui fitxers aquí","Runtime ran out of available memory.":"L'execució ha arribat al límit de memòria.","File count error.":"Error en el recompte de fitxers","File extension error.":"Error en l´extensió del fitxer.","mb":"Mb","Add Files":"Afegir fitxers"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/cs.js b/lib/javascript/plupload/js/i18n/cs.js new file mode 100644 index 0000000..d8ae3c0 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/cs.js @@ -0,0 +1,2 @@ +// Czech (cs) +plupload.addI18n({"Stop Upload":"Zastavit nahrávání","Upload URL might be wrong or doesn't exist.":"URL uploadu je možná špatně, nebo neexistuje.","tb":"tb","Size":"Velikost","Close":"Zavřít","You must specify either browse_button or drop_element.":"Musíte specifikovat browse_button či drop_element.","Init error.":"Chyba inicializace.","Add files to the upload queue and click the start button.":"Přidejte soubory do fronty a pak spusťte nahrávání.","List":"Seznam","Filename":"Název souboru","%s specified, but cannot be found.":"%s bylo specifikováno, ale nebylo nalezeno.","Image format either wrong or not supported.":"Špatný, nebo nepodporovaný formát obrázku.","Status":"Stav","HTTP Error.":"Chyba HTTP.","Start Upload":"Spustit nahrávání","Error: File too large:":"Chyba: Soubor je příliš veliký:","kb":"kb","Duplicate file error.":"Chyba - duplikovaný soubor.","File size error.":"Chyba velikosti souboru.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Chyba: Neplatná koncovka souboru:","Select files":"Vyberte soubory","%s already present in the queue.":"%s je již zařazen ve frontě.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Rozlišení je mimo rozmezí! %s runtime podporuje obrázky pouze do %wx%hpx.","File: %s":"Soubor: %s","b":"b","Uploaded %d/%d files":"Nahráno %d/%d souborů","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload akceptuje pouze %d soubor(ů) najednou. Další soubory byly odstraněny.","%d files queued":"%d souborů ve frontě","File: %s, size: %d, max file size: %d":"Soubor: %s, velikost: %d, maximální velikost souboru: %d","Thumbnails":"Náhledy","Drag files here.":"Sem přetáhněte soubory.","Runtime ran out of available memory.":"Běh skriptu přesáhl dostupnou paměť.","File count error.":"Chyba v počtu souborů.","File extension error.":"Chyba přípony souboru.","mb":"mb","Add Files":"Přidat soubory"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/cy.js b/lib/javascript/plupload/js/i18n/cy.js new file mode 100644 index 0000000..8873ec6 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/cy.js @@ -0,0 +1,2 @@ +// Welsh (cy) +plupload.addI18n({"Stop Upload":"Atal Lanlwytho","Upload URL might be wrong or doesn't exist.":"URL y lanlwythiad ynb anghywir neu ddim yn bodoli.","tb":"tb","Size":"Maint","Close":"Cau","You must specify either browse_button or drop_element.":"","Init error.":"Gwall cych.","Add files to the upload queue and click the start button.":"Ychwanegwch ffeiliau i'r ciw lanlwytho a chlicio'r botwm dechrau.","List":"","Filename":"Enw'r ffeil","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Fformat delwedd yn anghywir neu heb ei gynnal.","Status":"Statws","HTTP Error.":"Gwall HTTP.","Start Upload":"Dechrau Lanlwytho","Error: File too large:":"Gwall: Ffeil yn rhy fawr:","kb":"kb","Duplicate file error.":"Gwall ffeil ddyblyg.","File size error.":"Gwall maint ffeil.","N/A":"Dd/A","gb":"gb","Error: Invalid file extension:":"Gwall: estyniad ffeil annilys:","Select files":"Dewis ffeiliau","%s already present in the queue.":"%s yn y ciw yn barod.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Ffeil: %s","b":"b","Uploaded %d/%d files":"Lanlwythwyd %d/%d ffeil","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Mae'r elfen lanlwytho yn derbyn %d ffeil ar y tro. Caiff ffeiliau ychwanegol eu tynnu.","%d files queued":"%d ffeil mewn ciw","File: %s, size: %d, max file size: %d":"Ffeil: %s, maint: %d, maint mwyaf ffeil: %d","Thumbnails":"","Drag files here.":"Llusgwch ffeiliau yma.","Runtime ran out of available memory.":"Allan o gof.","File count error.":"Gwall cyfri ffeiliau.","File extension error.":"Gwall estyniad ffeil.","mb":"mb","Add Files":"Ychwanegu Ffeiliau"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/da.js b/lib/javascript/plupload/js/i18n/da.js new file mode 100644 index 0000000..577e712 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/da.js @@ -0,0 +1,2 @@ +// Danish (da) +plupload.addI18n({"Stop Upload":"Stop upload","Upload URL might be wrong or doesn't exist.":"Upload URL kan være forkert eller ikke eksisterende.","tb":"tb","Size":"Størrelse","Close":"Luk","You must specify either browse_button or drop_element.":"","Init error.":"Opstarts fejl.","Add files to the upload queue and click the start button.":"Tilføj filer til køen og klik Start upload knappen.","List":"","Filename":"Filnavn","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Billede format er enten forkert eller ikke understøttet.","Status":"Status","HTTP Error.":"HTTP fejl.","Start Upload":"Start upload","Error: File too large:":"Fejl: Filen er for stor:","kb":"kb","Duplicate file error.":"Filen findes allerede.","File size error.":"Filstørrelse fejl.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Fejl: Ugyldigt fil format:","Select files":"Vælg filer","%s already present in the queue.":"%s findes allerede i køen.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fil: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d filer","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload accepterer kun %d fil(er) af gangen. Ekstra filer blev skippet.","%d files queued":"%d filer i kø","File: %s, size: %d, max file size: %d":"Fil: %s, størrelse: %d, maks. filstørrelse: %d","Thumbnails":"","Drag files here.":"Træk filer her.","Runtime ran out of available memory.":"Runtime mangler tilgængelige hukommelse.","File count error.":"Fil antal fejl.","File extension error.":"Fil format fejl.","mb":"mb","Add Files":"Tilføj filer"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/de.js b/lib/javascript/plupload/js/i18n/de.js new file mode 100644 index 0000000..c35b157 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/de.js @@ -0,0 +1,2 @@ +// German (de) +plupload.addI18n({"Stop Upload":"Hochladen abbrechen","Upload URL might be wrong or doesn't exist.":"Upload-URL ist falsch oder existiert nicht.","tb":"TB","Size":"Größe","Close":"Schließen","You must specify either browse_button or drop_element.":"","Init error.":"Initialisierungsfehler","Add files to the upload queue and click the start button.":"Dateien hinzufügen und auf 'Hochladen' klicken.","List":"Liste","Filename":"Dateiname","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Bildformat falsch oder nicht unterstützt.","Status":"Status","HTTP Error.":"HTTP-Fehler","Start Upload":"Hochladen beginnen","Error: File too large:":"Fehler: Datei zu groß:","kb":"KB","Duplicate file error.":"Datei bereits hochgeladen","File size error.":"Fehler bei Dateigröße","N/A":"Nicht verfügbar","gb":"GB","Error: Invalid file extension:":"Fehler: Ungültige Dateiendung:","Select files":"Dateien auswählen","%s already present in the queue.":"%s ist bereits in der Warteschlange","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Datei: %s","b":"B","Uploaded %d/%d files":"%d/%d Dateien wurden hochgeladen","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Pro Durchgang können nur %d Datei(en) akzeptiert werden. Überzählige Dateien wurden ignoriert.","%d files queued":"%d Dateien in der Warteschlange","File: %s, size: %d, max file size: %d":"Datei: %s, Größe: %d, maximale Dateigröße: %d","Thumbnails":"Vorschaubilder","Drag files here.":"Dateien auf diese Fläche bewegen.","Runtime ran out of available memory.":"Nicht genügend Speicher verfügbar.","File count error.":"Fehlerhafte Dateianzahl.","File extension error.":"Fehler bei Dateiendung","mb":"MB","Add Files":"Dateien hinzufügen"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/el.js b/lib/javascript/plupload/js/i18n/el.js new file mode 100644 index 0000000..3fa29ea --- /dev/null +++ b/lib/javascript/plupload/js/i18n/el.js @@ -0,0 +1,2 @@ +// Greek (el) +plupload.addI18n({"Stop Upload":"Ακύρωση Μεταφόρτωσης","Upload URL might be wrong or doesn't exist.":"Το URL μεταφόρτωσης είναι λάθος ή δεν υπάρχει.","tb":"tb","Size":"Μέγεθος","Close":"Κλείσιμο","You must specify either browse_button or drop_element.":"","Init error.":"Σφάλμα αρχικοποίησης.","Add files to the upload queue and click the start button.":"Προσθέστε αρχεία στην ουρά μεταφόρτωσης και πατήστε το κουμπί εκκίνησης.","List":"Λίστα","Filename":"Όνομα Αρχείου","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Ο τύπος εικόνας είναι λάθος ή δεν υποστηρίζεται.","Status":"Κατάσταση","HTTP Error.":"Σφάλμα HTTP.","Start Upload":"Εκκίνηση Μεταφόρτωσης","Error: File too large:":"Σφάλμα: Πολύ μεγάλο αρχείο:","kb":"kb","Duplicate file error.":"Το αρχείο έχει ξαναπροστεθεί.","File size error.":"Σφάλμα με το μέγεθος του αρχείου.","N/A":"Δεν ισχύει","gb":"gb","Error: Invalid file extension:":"Σφάλμα: Μη έγκυρος τύπος αρχείου:","Select files":"Επιλέξτε Αρχεία","%s already present in the queue.":"Το «%s» βρίσκεται ήδη στην ουρά.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Αρχείο: %s","b":"b","Uploaded %d/%d files":"Μεταφορτώθηκαν %d/%d αρχεία","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Μπορείτε να μεταφορτώσετε μεχρι και %d αρχείο/α κάθε φορά. Τα επιπλέον αρχεία αφαιρέθηκαν.","%d files queued":"%d αρχεία στην ουρά","File: %s, size: %d, max file size: %d":"Αρχείο: %s, μέγεθος: %d, μέγιστο μέγεθος αρχείου: %d","Thumbnails":"Μικρογραφίες","Drag files here.":"Σύρετε αρχεία εδώ","Runtime ran out of available memory.":"Δεν υπάρχει αρκετή διαθέσιμη μνήμη.","File count error.":"Σφάλμα με τον αριθμό αρχείων.","File extension error.":"Σφάλμα με τον τύπο αρχείου.","mb":"mb","Add Files":"Προσθέστε Αρχεία"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/en.js b/lib/javascript/plupload/js/i18n/en.js new file mode 100644 index 0000000..a0a2042 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/en.js @@ -0,0 +1,2 @@ +// English (en) +plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Size","Close":"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.","List":"List","Filename":"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d","Thumbnails":"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"mb","Add Files":"Add Files"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/es.js b/lib/javascript/plupload/js/i18n/es.js new file mode 100644 index 0000000..dfc7548 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/es.js @@ -0,0 +1,2 @@ +// Spanish (es) +plupload.addI18n({"Stop Upload":"Detener Subida.","Upload URL might be wrong or doesn't exist.":"URL de carga inexistente.","tb":"TB","Size":"Tamaño","Close":"Cerrar","You must specify either browse_button or drop_element.":"Debe especificar el browse_button o el drop_element","Init error.":"Error de inicialización.","Add files to the upload queue and click the start button.":"Agregue archivos a la lista de subida y pulse clic en el botón de Iniciar carga","List":"Lista","Filename":"Nombre de archivo","%s specified, but cannot be found.":"%s especificado, pero no se puede encontrar","Image format either wrong or not supported.":"Formato de imagen no soportada.","Status":"Estado","HTTP Error.":"Error de HTTP.","Start Upload":"Iniciar carga","Error: File too large:":"Error: archivo demasiado grande:","kb":"KB","Duplicate file error.":"Error, archivo duplicado","File size error.":"Error de tamaño de archivo.","N/A":"No disponible","gb":"GB","Error: Invalid file extension:":"Error: Extensión de archivo inválida:","Select files":"Elija archivos","%s already present in the queue.":"%s ya se encuentra en la lista.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resolución fuera de límites! El tiempo de ejecución %s sólo admite imágenes hasta %wx%hpx","File: %s":"Archivo: %s","b":"B","Uploaded %d/%d files":"Subidos %d/%d archivos","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Se aceptan sólo %d archivo(s) al tiempo. Más, no se tienen en cuenta.","%d files queued":"%d archivos en cola.","File: %s, size: %d, max file size: %d":"Archivo: %s, tamaño: %d, tamaño máximo de archivo: %d","Thumbnails":"Miniaturas","Drag files here.":"Arrastre archivos aquí","Runtime ran out of available memory.":"No hay memoria disponible.","File count error.":"Error en contador de archivos.","File extension error.":"Error de extensión de archivo.","mb":"MB","Add Files":"Agregar archivos"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/et.js b/lib/javascript/plupload/js/i18n/et.js new file mode 100644 index 0000000..5e838b7 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/et.js @@ -0,0 +1,2 @@ +// Estonian (et) +plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Üleslaadimise URL võib olla vale või seda pole.","tb":"","Size":"Suurus","Close":"Sulge","You must specify either browse_button or drop_element.":"","Init error.":"Lähtestamise viga.","Add files to the upload queue and click the start button.":"Lisa failid üleslaadimise järjekorda ja klõpsa alustamise nupule.","List":"","Filename":"Failinimi","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Olek","HTTP Error.":"HTTP ühenduse viga.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"","Duplicate file error.":"","File size error.":"Failisuuruse viga.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vali faile","%s already present in the queue.":"","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fail: %s","b":"","Uploaded %d/%d files":"Üles laaditud %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Üleslaadimise element saab vastu võtta ainult %d faili ühe korraga. Ülejäänud failid jäetakse laadimata.","%d files queued":"Järjekorras on %d faili","File: %s, size: %d, max file size: %d":"","Thumbnails":"","Drag files here.":"Lohista failid siia.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Failide arvu viga.","File extension error.":"Faililaiendi viga.","mb":"","Add Files":"Add Files"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/fa.js b/lib/javascript/plupload/js/i18n/fa.js new file mode 100644 index 0000000..9cce3fe --- /dev/null +++ b/lib/javascript/plupload/js/i18n/fa.js @@ -0,0 +1,2 @@ +// Persian (fa) +plupload.addI18n({"Stop Upload":"توقف انتقال","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"ترابایت","Size":"سایز","Close":"بستن","You must specify either browse_button or drop_element.":"","Init error.":"خطا در استارت اسکریپت","Add files to the upload queue and click the start button.":"اضافه کنید فایل ها را به صف آپلود و دکمه شروع را کلیک کنید.","List":"","Filename":"نام فایل","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"وضعیت","HTTP Error.":"HTTP خطای","Start Upload":"شروع انتقال","Error: File too large:":"Error: File too large:","kb":"کیلوبایت","Duplicate file error.":"خطای فایل تکراری","File size error.":"خطای سایز فایل","N/A":"N/A","gb":"گیگابایت","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"انتخاب فایل","%s already present in the queue.":"%s در لیست آپلود وجود دارد.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":" فایل ها : %s","b":"بایت","Uploaded %d/%d files":"منتقل شد %d/%d از فایلها","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"عنصر بارگذار فقط %d فایل رو در یک زمان می پذیرد. سایر فایل ها مجرد از این موضوع هستند.","%d files queued":"%d فایل در صف","File: %s, size: %d, max file size: %d":"فایل: %s, اندازه: %d, محدودیت اندازه فایل: %d","Thumbnails":"","Drag files here.":"بکشید فایل ها رو به اینجا","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"خطای تعداد فایل","File extension error.":"خطا پیشوند فایل","mb":"مگابایت","Add Files":"افزودن فایل"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/fi.js b/lib/javascript/plupload/js/i18n/fi.js new file mode 100644 index 0000000..272df1b --- /dev/null +++ b/lib/javascript/plupload/js/i18n/fi.js @@ -0,0 +1,2 @@ +// Finnish (fi) +plupload.addI18n({"Stop Upload":"Pysäytä lähetys","Upload URL might be wrong or doesn't exist.":"Lähetyksen URL-osoite saattaa olla väärä tai sitä ei ole olemassa.","tb":"TB","Size":"Koko","Close":"Sulje","You must specify either browse_button or drop_element.":"","Init error.":"Init virhe.","Add files to the upload queue and click the start button.":"Lisää tiedostoja lähetysjonoon ja klikkaa aloita-nappia.","List":"","Filename":"Tiedostonimi","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Kuvaformaatti on joko väärä tai ei tuettu.","Status":"Tila","HTTP Error.":"HTTP-virhe.","Start Upload":"Aloita lähetys","Error: File too large:":"Virhe: Liian suuri tiedosto:","kb":"kB","Duplicate file error.":"Tuplatiedostovirhe.","File size error.":"Tiedostokokovirhe.","N/A":"N/A","gb":"GB","Error: Invalid file extension:":"Virhe: Virheellinen tiedostopääte:","Select files":"Valitse tiedostoja","%s already present in the queue.":"%s on jo jonossa.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Tiedosto: %s","b":"B","Uploaded %d/%d files":"Lähetetty %d/%d tiedostoa","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Vain %d tiedosto(a) voidaan lähettää kerralla. Ylimääräiset tiedostot ohitettiin.","%d files queued":"%d tiedostoa jonossa","File: %s, size: %d, max file size: %d":"Tiedosto: %s, koko: %d, suurin sallittu tiedostokoko: %d","Thumbnails":"","Drag files here.":"Raahaa tiedostot tähän.","Runtime ran out of available memory.":"Toiminnon käytettävissä oleva muisti loppui kesken.","File count error.":"Tiedostolaskentavirhe.","File extension error.":"Tiedostopäätevirhe.","mb":"MB","Add Files":"Lisää tiedostoja"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/fr.js b/lib/javascript/plupload/js/i18n/fr.js new file mode 100644 index 0000000..2a8203f --- /dev/null +++ b/lib/javascript/plupload/js/i18n/fr.js @@ -0,0 +1,2 @@ +// French (fr) +plupload.addI18n({"Stop Upload":"Arrêter l'envoi.","Upload URL might be wrong or doesn't exist.":"L'URL d'envoi est soit erronée soit n'existe pas.","tb":"To","Size":"Taille","Close":"Fermer","You must specify either browse_button or drop_element.":"Vous devez spécifier browse_button ou drop_element.","Init error.":"Erreur d'initialisation.","Add files to the upload queue and click the start button.":"Ajoutez des fichiers à la file d'attente de téléchargement et appuyez sur le bouton 'Démarrer l'envoi'","List":"Liste","Filename":"Nom du fichier","%s specified, but cannot be found.":"%s spécifié, mais ne peut pas être trouvé.","Image format either wrong or not supported.":"Le format d'image est soit erroné soit pas géré.","Status":"État","HTTP Error.":"Erreur HTTP.","Start Upload":"Démarrer l'envoi","Error: File too large:":"Erreur: Fichier trop volumineux:","kb":"Ko","Duplicate file error.":"Erreur: Fichier déjà sélectionné.","File size error.":"Erreur de taille de fichier.","N/A":"Non applicable","gb":"Go","Error: Invalid file extension:":"Erreur: Extension de fichier non valide:","Select files":"Sélectionnez les fichiers","%s already present in the queue.":"%s déjà présent dans la file d'attente.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Résolution sur les frontières ! L'exécution de %s supporte seulement les images de %wx%hpx","File: %s":"Fichier: %s","b":"o","Uploaded %d/%d files":"%d fichiers sur %d ont été envoyés","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Que %d fichier(s) peuvent être envoyé(s) à la fois. Les fichiers supplémentaires ont été ignorés.","%d files queued":"%d fichiers en attente","File: %s, size: %d, max file size: %d":"Fichier: %s, taille: %d, taille max. d'un fichier: %d","Thumbnails":"Miniatures","Drag files here.":"Déposez les fichiers ici.","Runtime ran out of available memory.":"Le traitement a manqué de mémoire disponible.","File count error.":"Erreur: Nombre de fichiers.","File extension error.":"Erreur d'extension de fichier","mb":"Mo","Add Files":"Ajouter des fichiers"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/he.js b/lib/javascript/plupload/js/i18n/he.js new file mode 100644 index 0000000..7c819c7 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/he.js @@ -0,0 +1,2 @@ +// Hebrew (he) +plupload.addI18n({"Stop Upload":"בטל העלאה","Upload URL might be wrong or doesn't exist.":"כתובת URL שגויה או לא קיימת.","tb":"tb","Size":"גודל","Close":"סגור","You must specify either browse_button or drop_element.":"יש לציין או browse_button או drop_element.","Init error.":"שגיאת איתחול","Add files to the upload queue and click the start button.":"הוסף קבצים לרשימה ולחץ על כפתור שליחה להתחלת פעולות העלאה","List":"רשימה","Filename":"שם קובץ","%s specified, but cannot be found.":"%s צויין, אך לא נמצא.","Image format either wrong or not supported.":"תמונה פגומה או סוג תמונה לא נתמך","Status":"אחוז","HTTP Error.":"שגיאת פרוטוקול","Start Upload":"שליחה","Error: File too large:":"שגיאה: קובץ חורג מהגודל המותר:","kb":"KB","Duplicate file error.":"קובץ כפול","File size error.":"גודל קובץ חורג מהמותר","N/A":"שגיאה","gb":"GB","Error: Invalid file extension:":"שגיאה: סוג קובץ לא נתמך:","Select files":"בחר קבצים","%s already present in the queue.":"%sקובץ נמצא כבר ברשימת הקבצים.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"הרזולוציה גבוהה מדי! %s הפלטפורמה תומכת בתמונות עד גודל px.","File: %s":"קובץ: %s","b":"B","Uploaded %d/%d files":"מעלה: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"אלמנטי ההעלאה מקבלים רק %d קובץ(ים) בפעם אחת. קבצים נוספים הוסרו.","%d files queued":"%d קבצים נותרו","File: %s, size: %d, max file size: %d":"קובץ: %s, גודל: %d, גודל מקסימלי: %d","Thumbnails":"תמונות ממוזערות","Drag files here.":"גרור קבצים לכאן","Runtime ran out of available memory.":"שגיאת מחסור בזיכרון","File count error.":"שגיאת מספר קבצים","File extension error.":"קובץ זה לא נתמך","mb":"MB","Add Files":"הוסף קבצים"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/hr.js b/lib/javascript/plupload/js/i18n/hr.js new file mode 100644 index 0000000..25143f4 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/hr.js @@ -0,0 +1,2 @@ +// Croatian (hr) +plupload.addI18n({"Stop Upload":"Zaustavi upload.","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Veličina","Close":"Zatvori","You must specify either browse_button or drop_element.":"","Init error.":"Greška inicijalizacije.","Add files to the upload queue and click the start button.":"Dodajte datoteke u listu i kliknite Upload.","List":"","Filename":"Ime datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Pokreni upload.","Error: File too large:":"Pogreška: Datoteka je prevelika:","kb":"kb","Duplicate file error.":"Pogreška dvostruke datoteke.","File size error.":"Greška veličine datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Pogreška: Nevažeći nastavak datoteke:","Select files":"Odaberite datoteke:","%s already present in the queue.":"%s je već prisutan u listi čekanja.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Uploadano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d datoteka na čekanju.","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Thumbnails":"","Drag files here.":"Dovucite datoteke ovdje","Runtime ran out of available memory.":"Runtime aplikaciji je ponestalo memorije.","File count error.":"Pogreška u broju datoteka.","File extension error.":"Pogreška u nastavku datoteke.","mb":"mb","Add Files":"Dodaj datoteke"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/hu.js b/lib/javascript/plupload/js/i18n/hu.js new file mode 100644 index 0000000..a445fd6 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/hu.js @@ -0,0 +1,2 @@ +// Hungarian (hu) +plupload.addI18n({"Stop Upload":"Feltöltés leállítása","Upload URL might be wrong or doesn't exist.":"A feltöltő URL hibás vagy nem létezik.","tb":"TB","Size":"Méret","Close":"Bezárás","You must specify either browse_button or drop_element.":"","Init error.":"Init hiba.","Add files to the upload queue and click the start button.":"A fájlok feltöltési sorhoz való hozzáadása után az Indítás gombra kell kattintani.","List":"","Filename":"Fájlnév","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Rossz vagy nem támogatott képformátum.","Status":"Állapot","HTTP Error.":"HTTP-hiba.","Start Upload":"Feltöltés indítása","Error: File too large:":"Hiba: a fájl túl nagy:","kb":"kB","Duplicate file error.":"Duplikáltfájl-hiba.","File size error.":"Hibás fájlméret.","N/A":"Nem elérhető","gb":"GB","Error: Invalid file extension:":"Hiba: érvénytelen fájlkiterjesztés:","Select files":"Fájlok kiválasztása","%s already present in the queue.":"%s már szerepel a listában.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fájl: %s","b":"b","Uploaded %d/%d files":"Feltöltött fájlok: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"A feltöltés egyszerre csak %d fájlt fogad el, a többi fájl nem lesz feltöltve.","%d files queued":"%d fájl sorbaállítva","File: %s, size: %d, max file size: %d":"Fájl: %s, méret: %d, legnagyobb fájlméret: %d","Thumbnails":"","Drag files here.":"Ide lehet húzni a fájlokat.","Runtime ran out of available memory.":"Futásidőben elfogyott a rendelkezésre álló memória.","File count error.":"A fájlok számával kapcsolatos hiba.","File extension error.":"Hibás fájlkiterjesztés.","mb":"MB","Add Files":"Fájlok hozzáadása"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/hy.js b/lib/javascript/plupload/js/i18n/hy.js new file mode 100644 index 0000000..067d028 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/hy.js @@ -0,0 +1,2 @@ +// Armenian (hy) +plupload.addI18n({"Stop Upload":"Կանգնեցնել","Upload URL might be wrong or doesn't exist.":"Ավեցաված URL-ը սխալ է կամ գոյություն չունի։","tb":"տբ","Size":"Չափ","Close":"Փակել","You must specify either browse_button or drop_element.":"","Init error.":"Ստեղծման սխալ","Add files to the upload queue and click the start button.":"Ավելացրեք ֆայլեր ցուցակում և սեղմեք \"Վերբեռնել\"։","List":"","Filename":"Ֆայլի անուն","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Նկարի ֆորմատը սխալ է կամ չի ընդունվում։","Status":"Կարգավիճակ","HTTP Error.":"HTTP սխալ","Start Upload":"Վերբեռնել","Error: File too large:":"Սխալ։ Ֆայլի չափը մեծ է։","kb":"կբ","Duplicate file error.":"Ֆայլի կրկնման սխալ","File size error.":"Ֆայլի չափի սխալ","N/A":"N/A","gb":"գբ","Error: Invalid file extension:":"Սխալ։ Ֆայլի ընդլայնումը սխալ է։","Select files":"Ընտրեք ֆայլերը","%s already present in the queue.":"%s ֆայլը արդեն ավելացված է ցուցակում.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Ֆայլ: %s","b":"բ","Uploaded %d/%d files":"Վերբեռնվել են %d/%d ֆայլերը","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Վերբեռնիչը միանգամից ըդունում է միայն %d ֆայլ(եր). Ավելորդ ֆայլերը հեռացվել են.","%d files queued":"ցուցակում կա %d ֆայլ","File: %s, size: %d, max file size: %d":"Ֆայլ: %s, չափ: %d, ֆայլի մաքսիմում չափ: %d","Thumbnails":"","Drag files here.":"Տեղափոխեք ֆայլերը այստեղ","Runtime ran out of available memory.":"Օպերատիվ հիշողության անբավարարուտյուն.","File count error.":"Ֆայլերի քանակի սխալ","File extension error.":"Ֆայլի ընդլայնման սխալ","mb":"մբ","Add Files":"Ավելացնել ֆայլեր"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/id.js b/lib/javascript/plupload/js/i18n/id.js new file mode 100644 index 0000000..f043805 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/id.js @@ -0,0 +1,2 @@ +// Indonesian (id) +plupload.addI18n({"Stop Upload":"Hentikan Upload","Upload URL might be wrong or doesn't exist.":"Alamat URL untuk upload tidak benar atau tidak ada","tb":"tb","Size":"Ukuran","Close":"Tutup","You must specify either browse_button or drop_element.":"","Init error.":"Kesalahan pada Init","Add files to the upload queue and click the start button.":"Tambahkan file kedalam antrian upload dan klik tombol Mulai","List":"","Filename":"Nama File","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Kesalahan pada jenis gambar atau jenis file tidak didukung","Status":"Status","HTTP Error.":"HTTP Bermasalah","Start Upload":"Mulai Upload","Error: File too large:":"Kesalahan: File terlalu besar","kb":"kb","Duplicate file error.":"Terjadi duplikasi file","File size error.":"Kesalahan pada ukuran file","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Kesalahan: Ekstensi file tidak dikenal","Select files":"Pilih file","%s already present in the queue.":"%s sudah ada dalam daftar antrian","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"File terupload %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Tempat untuk upload hanya menerima %d file(s) dalam setiap upload. File lainnya tidak akan disertakan","%d files queued":"%d file dalam antrian","File: %s, size: %d, max file size: %d":"File: %s, ukuran: %d, maksimum ukuran file: %d","Thumbnails":"","Drag files here.":"Tarik file kesini","Runtime ran out of available memory.":"Tidak cukup memori","File count error.":"Kesalahan pada jumlah file","File extension error.":"Kesalahan pada ekstensi file","mb":"mb","Add Files":"Tambah File"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/it.js b/lib/javascript/plupload/js/i18n/it.js new file mode 100644 index 0000000..ee771d4 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/it.js @@ -0,0 +1,2 @@ +// Italian (it) +plupload.addI18n({"Stop Upload":"Ferma Upload","Upload URL might be wrong or doesn't exist.":"URL di Upload errata o non esistente","tb":"tb","Size":"Dimensione","Close":"Chiudi","You must specify either browse_button or drop_element.":"Devi indicare almeno uno tra browse_button o drop_element.","Init error.":"Errore inizializzazione.","Add files to the upload queue and click the start button.":"Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.","List":"Lista","Filename":"Nome file","%s specified, but cannot be found.":"%s specificato, ma non è stato possibile trovarlo.","Image format either wrong or not supported.":"Formato immagine errato o non supportato.","Status":"Stato","HTTP Error.":"Errore HTTP.","Start Upload":"Inizia Upload","Error: File too large:":"Errore: File troppo grande:","kb":"kb","Duplicate file error.":"Errore file duplicato.","File size error.":"Errore dimensione file.","N/A":"N/D","gb":"gb","Error: Invalid file extension:":"Errore: Estensione file non valida:","Select files":"Seleziona i files","%s already present in the queue.":"%s già presente nella coda.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Risoluzione oltre i limiti! %s runtime supporta immagini fino a %wx%hpx.","File: %s":"File: %s","b":"byte","Uploaded %d/%d files":"Caricati %d/%d file","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d file in coda","File: %s, size: %d, max file size: %d":"File: %s, dimensione: %d, dimensione max file: %d","Thumbnails":"Anteprime","Drag files here.":"Trascina i files qui.","Runtime ran out of available memory.":"Runtime ha esaurito la memoria disponibile.","File count error.":"File count error.","File extension error.":"Errore estensione file.","mb":"mb","Add Files":"Aggiungi file"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ja.js b/lib/javascript/plupload/js/i18n/ja.js new file mode 100644 index 0000000..0379144 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ja.js @@ -0,0 +1,2 @@ +// Japanese (ja) +plupload.addI18n({"Stop Upload":"アップロード停止","Upload URL might be wrong or doesn't exist.":"アップロード先の URL が存在しません","tb":"TB","Size":"サイズ","Close":"閉じる","You must specify either browse_button or drop_element.":"ブラウザのボタンで または ファイルをドロップするか いずれかの方法で指定する必要があります。","Init error.":"イニシャライズエラー","Add files to the upload queue and click the start button.":"ファイルをアップロードキューに追加してスタートボタンをクリックしてください","List":"リスト","Filename":"ファイル名","%s specified, but cannot be found.":"指定された %s は見つかりません。","Image format either wrong or not supported.":"画像形式が間違っているかサポートされていません","Status":"ステータス","HTTP Error.":"HTTP エラー","Start Upload":"アップロード開始","Error: File too large:":"エラー: ファイルが大きすぎます:","kb":"KB","Duplicate file error.":"重複ファイルエラー","File size error.":"ファイルサイズエラー","N/A":"N/A","gb":"GB","Error: Invalid file extension:":"エラー: ファイルの拡張子が無効です:","Select files":"ファイル選択","%s already present in the queue.":"%s 既にキューに存在しています","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"解像度がしきい値を超えています! ランタイム %s は縦 %h px 横 %w px までをサポートします","File: %s":"ファイル: %s","b":"B","Uploaded %d/%d files":"アップロード中 %d/%d ファイル","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"アップロード可能なファイル数は %d です 余分なファイルは削除されました","%d files queued":"%d ファイルが追加されました","File: %s, size: %d, max file size: %d":"ファイル: %s, サイズ: %d, 最大ファイルサイズ: %d","Thumbnails":"サムネイル","Drag files here.":"ここにファイルをドラッグ","Runtime ran out of available memory.":"ランタイムが使用するメモリが不足しました","File count error.":"ファイル数エラー","File extension error.":"ファイル拡張子エラー","mb":"MB","Add Files":"ファイルを追加"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ka.js b/lib/javascript/plupload/js/i18n/ka.js new file mode 100644 index 0000000..ed24ec4 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ka.js @@ -0,0 +1,2 @@ +// Georgian (ka) +plupload.addI18n({"Stop Upload":"ატვირთვის შეჩერება","Upload URL might be wrong or doesn't exist.":"ატვირთვის მისამართი არასწორია ან არ არსებობს.","tb":"ტბ","Size":"ზომა","Close":"დავხუროთ","You must specify either browse_button or drop_element.":"თქვენ უნდა მიუთითოთ browse_button ან drop_element.","Init error.":"ინიციალიზაციის შეცდომა.","Add files to the upload queue and click the start button.":"დაამატეთ ფაილები და დააჭირეთ ღილაკს - ატვირთვა.","List":"","Filename":"ფაილის სახელი","%s specified, but cannot be found.":"%s მითითებულია, მაგრამ ვერ მოიძებნა.","Image format either wrong or not supported.":"ფაილის ფორმატი არ არის მხარდაჭერილი ან არასწორია.","Status":"სტატუსი","HTTP Error.":"HTTP შეცდომა.","Start Upload":"ატვირთვა","Error: File too large:":"შეცდომა: ფაილი ზედმეტად დიდია.","kb":"კბ","Duplicate file error.":"ესეთი ფაილი უკვე დამატებულია.","File size error.":"ფაილის ზომა დაშვებულზე დიდია.","N/A":"N/A","gb":"გბ","Error: Invalid file extension:":"შეცდომა: ფაილს აქვს არასწორი გაფართოება.","Select files":"ფაილების მონიშვნა","%s already present in the queue.":"%s უკვე დამატებულია.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"სურათის გარჩევადობა აღემატება %s გარემოს მიერ მხარდაჭერილ მქსიმუმებს - %wx%hpx.","File: %s":"ფაილი: %s","b":"ბ","Uploaded %d/%d files":"ატვირთულია %d/%d ფაილი","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"ერთდროულად დაშვებულია მხოლოდ %d ფაილის დამატება.","%d files queued":"რიგშია %d ფაილი","File: %s, size: %d, max file size: %d":"ფაილი: %s, ზომა: %d, მაქსიმალური დაშვებული ზომა: %d","Thumbnails":"","Drag files here.":"ჩააგდეთ ფაილები აქ.","Runtime ran out of available memory.":"ხელმისაწვდომი მეხსიერება გადაივსო.","File count error.":"აღმოჩენილია ზედმეტი ფაილები.","File extension error.":"ფაილის ფორმატი დაშვებული არ არის.","mb":"მბ","Add Files":"დაამატეთ ფაილები"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/kk.js b/lib/javascript/plupload/js/i18n/kk.js new file mode 100644 index 0000000..feade11 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/kk.js @@ -0,0 +1,2 @@ +// Kazakh (kk) +plupload.addI18n({"Stop Upload":"Жүктеуді тоқтату","Upload URL might be wrong or doesn't exist.":"Жүктеуді қабылдаушы URL қате не мүлдем көрсетілмеген.","tb":"тб","Size":"Өлшемі","Close":"Жабу","You must specify either browse_button or drop_element.":"","Init error.":"Инициализация қатесі.","Add files to the upload queue and click the start button.":"Жүктеу кезегіне файлдар қосып, Бастау кнопкасын басыңыз.","List":"","Filename":"Файл аты","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Сурет форматы қате немесе оның қолдауы жоқ.","Status":"Күйі","HTTP Error.":"HTTP қатесі.","Start Upload":"Жүктеуді бастау","Error: File too large:":"Қате: Файл мөлшері тым үлкен:","kb":"кб","Duplicate file error.":"Файл қайталамасының қатесі.","File size error.":"Файл өлшемінің қатесі.","N/A":"Қ/Ж","gb":"гб","Error: Invalid file extension:":"Қате: Файл кеңейтілуі қате:","Select files":"Файлдар таңдаңыз","%s already present in the queue.":"%s файлы кезекте бұрыннан бар.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Жүктелген: %d/%d файл","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Жүктеу элементі бір кезде %d файл ғана жүктей алады. Артық файлдар жүктелмейді.","%d files queued":"%d файл кезекке қойылды","File: %s, size: %d, max file size: %d":"Файл: %s, өлшемі: %d, макс. файл өлшемі: %d","Thumbnails":"","Drag files here.":"Файлдарды мына жерге тастаңыз.","Runtime ran out of available memory.":"Орындау кезінде жады жетпей қалды.","File count error.":"Файл санының қатесі.","File extension error.":"Файл кеңейтілуінің қатесі.","mb":"мб","Add Files":"Файл қосу"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/km.js b/lib/javascript/plupload/js/i18n/km.js new file mode 100644 index 0000000..503fde3 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/km.js @@ -0,0 +1,2 @@ +// Khmer (km) +plupload.addI18n({"Stop Upload":"បញ្ឈប់​ការ​ផ្ទុក​ឡើង","Upload URL might be wrong or doesn't exist.":"URL ផ្ទុក​ឡើង​អាច​ខុស ឬ​ក៏​គ្មាន។","tb":"tb","Size":"ទំហំ","Close":"បិទ","You must specify either browse_button or drop_element.":"","Init error.":"កំហុស Init។","Add files to the upload queue and click the start button.":"បន្ថែម​ឯកសារ​ទៅ​ក្នុង​ជួរ​លំដាប់​ផ្ទុក​ឡើង ហើយ​ចុច​ប៊ូតុង​ចាប់​ផ្ដើម។","List":"","Filename":"ឈ្មោះ​ឯកសារ","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"ទ្រង់​ទ្រាយ​រូបភាព​អាច​ខុស ឬ​ក៏​មិន​ស្គាល់​តែ​ម្ដង។","Status":"ស្ថានភាព","HTTP Error.":"កំហុស HTTP ។","Start Upload":"ចាប់​ផ្ដើម​ផ្ទុក​ឡើង","Error: File too large:":"កំហុស៖ ឯកសារ​ធំ​ពេក៖","kb":"kb","Duplicate file error.":"កំហុស​ឯកសារ​ស្ទួន​គ្នា។","File size error.":"កំហុស​ទំហំ​ឯកសារ។","N/A":"គ្មាន","gb":"gb","Error: Invalid file extension:":"កំហុស៖ កន្ទុយ​ឯកសារ​មិន​ត្រឹម​ត្រូវ៖","Select files":"ជ្រើស​ឯកសារ","%s already present in the queue.":"មាន %s នៅ​ក្នុង​ជួរ​លំដាប់​ហើយ។","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"ឯកសារ៖ %s","b":"b","Uploaded %d/%d files":"បាន​ផ្ទុក​ឡើង​ឯកសារ %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"ការ​ផ្ទុក​ឡើង​ទទួល​ឯកសារ​បាន​តែ %d ប៉ុណ្ណោះ​ក្នុង​ពេល​តែ​មួយ។ ឯកសារ​ផ្សេង​ទៀត​នឹង​ត្រូវ​ដក​ចេញ។","%d files queued":"បាន​ដាក់​ឯកសារ %d បន្ត​គ្នា","File: %s, size: %d, max file size: %d":"ឯកសារ៖ %s, size: %d, ទំហំ​ឯកសារ​អតិបរមា៖ %d","Thumbnails":"","Drag files here.":"អូស​ឯកសារ​មក​ទីនេះ។","Runtime ran out of available memory.":"ពេល​ដំណើរ​ការ​អស់​អង្គ​ចងចាំ​ទំនេរ​ហើយ។","File count error.":"កំហុស​ការ​រាប់​ឯកសារ។","File extension error.":"កំហុស​កន្ទុយ​ឯកសារ។","mb":"mb","Add Files":"បន្ថែម​ឯកសារ"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ko.js b/lib/javascript/plupload/js/i18n/ko.js new file mode 100644 index 0000000..f578990 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ko.js @@ -0,0 +1,2 @@ +// Korean (ko) +plupload.addI18n({"Stop Upload":"업로드 중지","Upload URL might be wrong or doesn't exist.":"업로드할 URL이 존재하지 않습니다.","tb":"tb","Size":"크기","Close":"닫기","You must specify either browse_button or drop_element.":"browse_button 이나 drop_element 둘 중 하나를 지정해 주세요.","Init error.":"초기화 오류.","Add files to the upload queue and click the start button.":"파일을 업로드 큐에 추가한 후 시작 버튼을 클릭하십시오.","List":"목록","Filename":"파일명","%s specified, but cannot be found.":"%s 가 지정됐지만, 찾을 수 없습니다.","Image format either wrong or not supported.":"지원되지 않는 이미지 형식입니다.","Status":"상태","HTTP Error.":"HTTP 오류.","Start Upload":"업로드 시작","Error: File too large:":"오류: 파일 크기가 너무 큽니다.","kb":"kb","Duplicate file error.":"파일 중복 오류.","File size error.":"파일 크기 오류.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"오류: 허용되지 않은 확장자입니다.","Select files":"파일 선택","%s already present in the queue.":"%s 파일이 이미 대기열에 존재합니다.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"해상도 지원 범위를 초과했습니다! %s 런타임은 %wx%hpx 이상의 이미지를 지원합니다.","File: %s":"파일: %s","b":"b","Uploaded %d/%d files":"%d / %d 파일 업로드 완료","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"업로드 가능한 파일의 수는 %d 입니다. 불필요한 파일은 삭제되었습니다.","%d files queued":"%d 파일이 추가됨","File: %s, size: %d, max file size: %d":"파일: %s, 크기: %d, 최대 파일 크기: %d","Thumbnails":"미리보기","Drag files here.":"이곳에 파일을 드래그 하세요.","Runtime ran out of available memory.":"런타임 메모리가 부족합니다.","File count error.":"파일 갯수 오류.","File extension error.":"파일 확장자 오류.","mb":"mb","Add Files":"파일 추가"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ku_IQ.js b/lib/javascript/plupload/js/i18n/ku_IQ.js new file mode 100644 index 0000000..8e80b7d --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ku_IQ.js @@ -0,0 +1,2 @@ +// Kurdish (Iraq) (ku_IQ) +plupload.addI18n({"Stop Upload":"وەستانی بارکردن","Upload URL might be wrong or doesn't exist.":".بەستەری بارکراو نادروستە یان بەردەست نییە","tb":"تێرابایت","Size":"قەبارە","Close":"داخستن","You must specify either browse_button or drop_element.":"","Init error.":".هەڵەی ئامادەکردن","Add files to the upload queue and click the start button.":".زیادکردنی پەڕگەکان بۆ ڕیزی بارکردن و کرتەکردن لە دوگمەی دەستپێکردن","List":"","Filename":"ناوی پەڕگە","%s specified, but cannot be found.":"","Image format either wrong or not supported.":".شێوازی وێنە هەڵەیە یان پاڵپشتی ناکرێت","Status":"ڕەوش","HTTP Error.":".HTTP هەڵەی","Start Upload":"دەستپێکردنی بارکردن","Error: File too large:":":هەڵە: پەڕگەکە زۆر گەورەیە","kb":"کیلۆبایت","Duplicate file error.":".هەڵەی پەڕگەی دوبارە","File size error.":".هەڵەی قەبارەی پەڕگە","N/A":"بەردەست نییە","gb":"گێگابایت","Error: Invalid file extension:":":هەڵە: پاشگری پەڕگەی نادروست","Select files":"دیاریکردنی پەڕگەکان","%s already present in the queue.":".ئامادەیی هەیە لە ڕیز %s","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"%s :پەڕگە","b":"بایت","Uploaded %d/%d files":"پەڕگە بارکران %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"بەشی بارکردن تەنها %d پەڕگە(کان) وەردەگرێت لەیەک کاتدا. پەڕگە زیادەکان .جیادەکرێنەوە","%d files queued":"پەڕگە ڕیزکران %d","File: %s, size: %d, max file size: %d":"پەڕگە: %s، قەبارە: %d، گەورەترین قەبارەی پەڕگە: %d","Thumbnails":"","Drag files here.":".پەڕگەکان ڕاکێشە بۆ ئێرە","Runtime ran out of available memory.":"هەڵەی دەرچوون لە بیرگەی بەردەست.","File count error.":".هەڵەی ژماردنی پەڕگە","File extension error.":".هەڵەی پاشگری پەڕگە","mb":"مێگابایت","Add Files":"زیادکردنی پەڕگەکان"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/lt.js b/lib/javascript/plupload/js/i18n/lt.js new file mode 100644 index 0000000..1f86120 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/lt.js @@ -0,0 +1,2 @@ +// Lithuanian (lt) +plupload.addI18n({"Stop Upload":"Stabdyti įkėlimą","Upload URL might be wrong or doesn't exist.":"Klaidinga arba neegzistuojanti įkėlimo nuoroda.","tb":"tb","Size":"Dydis","Close":"Uždaryti","You must specify either browse_button or drop_element.":"","Init error.":"Įkrovimo klaida.","Add files to the upload queue and click the start button.":"Pridėkite bylas į įkėlimo eilę ir paspauskite starto mygtuką.","List":"","Filename":"Bylos pavadinimas","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Paveiksliuko formatas klaidingas arba nebepalaikomas.","Status":"Statusas","HTTP Error.":"HTTP klaida.","Start Upload":"Pradėti įkėlimą","Error: File too large:":"Klaida: Byla per didelė:","kb":"kb","Duplicate file error.":"Pasikartojanti byla.","File size error.":"Netinkamas bylos dydis.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Klaida: Netinkamas bylos plėtinys:","Select files":"Žymėti bylas","%s already present in the queue.":"%s jau yra eilėje.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Byla: %s","b":"b","Uploaded %d/%d files":"Įkelta bylų: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Vienu metu galima įkelti tik %d bylas(ų). Papildomos bylos buvo pašalintos.","%d files queued":"%d bylų eilėje","File: %s, size: %d, max file size: %d":"Byla: %s, dydis: %d, galimas dydis: %d","Thumbnails":"","Drag files here.":"Padėti bylas čia.","Runtime ran out of available memory.":"Išeikvota darbinė atmintis.","File count error.":"Netinkamas bylų kiekis.","File extension error.":"Netinkamas pletinys.","mb":"mb","Add Files":"Pridėti bylas"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/lv.js b/lib/javascript/plupload/js/i18n/lv.js new file mode 100644 index 0000000..dc4bb67 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/lv.js @@ -0,0 +1,2 @@ +// Latvian (lv) +plupload.addI18n({"Stop Upload":"Apturēt augšupielādi","Upload URL might be wrong or doesn't exist.":"Augšupielādes saite neeksistē vai ir nepareiza.","tb":"terabaiti","Size":"Izmērs","Close":"Aizvērt","You must specify either browse_button or drop_element.":"Jums ir jānorāda vainu browse_button vai drop_element.","Init error.":"Inicializācijas kļūda.","Add files to the upload queue and click the start button.":"Pievienojiet failus rindai un klikšķiniet uz pogas \"Sākt augšupielādi\".","List":"Saraksts","Filename":"Faila nosaukums","%s specified, but cannot be found.":"%s norādīts, bet nevar tikt atrasts.","Image format either wrong or not supported.":"Attēla formāts ir nepareizs vai arī netiek atbalstīts.","Status":"Statuss","HTTP Error.":"HTTP kļūda.","Start Upload":"Sākt augšupielādi","Error: File too large:":"Kļūda: Fails pārāk liels:","kb":"kilobaiti","Duplicate file error.":"Atkārtota faila kļūda","File size error.":"Faila izmēra kļūda.","N/A":"N/A","gb":"gigabaiti","Error: Invalid file extension:":"Kļūda: Nepareizs faila paplašinājums:","Select files":"Izvēlieties failus","%s already present in the queue.":"%s jau ir atrodams rindā.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Izšķirtspēja ārpus robežām! %s atbalsta attēlus tikai līdz %wx%hpx","File: %s":"Fails: %s","b":"baiti","Uploaded %d/%d files":"Augšupielādēti %d/%d faili","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Iespējams ielādēt tikai %d failus vienā reizē. Atlikušie faili netika pievienoti","%d files queued":"%d faili pievienoti rindai","File: %s, size: %d, max file size: %d":"Fails: %s, izmērs: %d, max faila izmērs: %d","Thumbnails":"Ikonas","Drag files here.":"Ievelciet failus šeit","Runtime ran out of available memory.":"Pietrūkst izmantojamās atmiņas.","File count error.":"Failu skaita kļūda","File extension error.":"Faila paplašinājuma kļūda.","mb":"megabaiti","Add Files":"Pievienot failus"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ms.js b/lib/javascript/plupload/js/i18n/ms.js new file mode 100644 index 0000000..01b6ab3 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ms.js @@ -0,0 +1,2 @@ +// Malay (ms) +plupload.addI18n({"Stop Upload":"Berhenti Muat naik","Upload URL might be wrong or doesn't exist.":"URL muat naik mungkin salah atau tidak wujud.","tb":"tb","Size":"saiz","Close":"Tutup","You must specify either browse_button or drop_element.":"","Init error.":"Ralat perlaksanaan.","Add files to the upload queue and click the start button.":"Tambah fail ke dalam giliran muat naik dan klik butang Muat Naik.","List":"","Filename":"Nama fail","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format imej sama ada salah atau tidak disokong.","Status":"Status","HTTP Error.":"Ralat HTTP.","Start Upload":"Muat Naik","Error: File too large:":"Ralat: Fail terlalu bersar:","kb":"kb","Duplicate file error.":"Ralat menggandakan fail.","File size error.":"Ralat saiz fail.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Ralat: Sambungan fail tidak sah:","Select files":"Pilih fail","%s already present in the queue.":"%s telah ada dalam barisan.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fail: %s","b":"b","Uploaded %d/%d files":"%d/%d telah dimuat naik","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Element muat naik hanya menerima %d fail(-fail) pada satu masa. Fail tambahan telah digugurkan.","%d files queued":"%d fail dalam barisan","File: %s, size: %d, max file size: %d":"Fail: %s, saiz: %d, saiz maks fail: %d","Thumbnails":"","Drag files here.":"Seret fail ke sini.","Runtime ran out of available memory.":"Ruang ingatan masa larian tidak mencukupi.","File count error.":"Ralat bilangan fail.","File extension error.":"Ralat sambungan fail.","mb":"mb","Add Files":"Tambah Fail"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/nl.js b/lib/javascript/plupload/js/i18n/nl.js new file mode 100644 index 0000000..62c5e96 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/nl.js @@ -0,0 +1,2 @@ +// Dutch (nl) +plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL is verkeerd of bestaat niet.","tb":"tb","Size":"Grootte","Close":"Sluiten","You must specify either browse_button or drop_element.":"","Init error.":"Initialisatie error.","Add files to the upload queue and click the start button.":"Voeg bestanden toe aan de wachtrij en druk op 'Start'.","List":"","Filename":"Bestandsnaam","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"bestandsextensie is verkeerd of niet ondersteund.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: Bestand te groot:","kb":"kb","Duplicate file error.":"Bestand bestaat al.","File size error.":"Bestandsgrootte error.","N/A":"Niet beschikbaar","gb":"gb","Error: Invalid file extension:":"Error: Ongeldige bestandsextensie:","Select files":"Selecteer bestand(en):","%s already present in the queue.":"%s is al aan de wachtrij toegevoegd.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Bestand: %s","b":"b","Uploaded %d/%d files":"%d/%d bestanden ge-upload","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload accepteert alleen %d bestand(en) tegelijk. Extra bestanden zijn verwijderd.","%d files queued":"%d bestand(en) in de wachtrij","File: %s, size: %d, max file size: %d":"Bestand: %s, grootte: %d, maximale bestandsgrootte: %d","Thumbnails":"","Drag files here.":"Sleep bestanden hierheen.","Runtime ran out of available memory.":"Het maximum bruikbare geheugen is overschreden.","File count error.":"Teveel bestand(en) error.","File extension error.":"Ongeldig bestandsextensie.","mb":"mb","Add Files":"Bestand(en) toevoegen"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/pl.js b/lib/javascript/plupload/js/i18n/pl.js new file mode 100644 index 0000000..c3ec94a --- /dev/null +++ b/lib/javascript/plupload/js/i18n/pl.js @@ -0,0 +1,2 @@ +// Polish (pl) +plupload.addI18n({"Stop Upload":"Przerwij transfer.","Upload URL might be wrong or doesn't exist.":"Adres URL może być nieprawidłowy lub może nie istnieć","tb":"tb","Size":"Rozmiar","Close":"Zamknij","You must specify either browse_button or drop_element.":"Musisz określić browse_button albo drop_element.","Init error.":"Błąd inicjalizacji.","Add files to the upload queue and click the start button.":"Dodaj pliki i kliknij 'Rozpocznij transfer'.","List":"Lista","Filename":"Nazwa pliku","%s specified, but cannot be found.":"%s określony ale nie można znaleźć.","Image format either wrong or not supported.":"Format zdjęcia jest zły lub nieobsługiwany","Status":"Status","HTTP Error.":"Błąd HTTP.","Start Upload":"Wyślij","Error: File too large:":"Błąd: Plik za duży:","kb":"kb","Duplicate file error.":"Błąd: duplikacja pliku.","File size error.":"Plik jest zbyt duży.","N/A":"Nie dostępne","gb":"gb","Error: Invalid file extension:":"Błąd: Nieprawidłowe rozszerzenie pliku:","Select files":"Wybierz pliki:","%s already present in the queue.":"%s już występuje w kolejce.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Za duża rozdzielczość! %s maksymalna rozdzielczość to: %wx%hpx.","File: %s":"Plik: %s","b":"b","Uploaded %d/%d files":"Wysłano %d/%d plików","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Można jednocześnie dodać %d plików. Dodatkowe pliki zostały usunięte.","%d files queued":"%d plików w kolejce.","File: %s, size: %d, max file size: %d":"Plik: %s, rozmiar: %d, maksymalny rozmiar pliku: %d","Thumbnails":"Miniatury","Drag files here.":"Przeciągnij tu pliki","Runtime ran out of available memory.":"Wyczerpano pamięć RAM.","File count error.":"Błąd liczenia pliku.","File extension error.":"Nie obsługiwany format pliku.","mb":"mb","Add Files":"Dodaj pliki"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/pt.js b/lib/javascript/plupload/js/i18n/pt.js new file mode 100644 index 0000000..609b4e0 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/pt.js @@ -0,0 +1,2 @@ +// Portuguese (pt) +plupload.addI18n({"Stop Upload":"Parar envio","Upload URL might be wrong or doesn't exist.":"O URL para carregar os ficheiros pode estar errado ou não existir.","tb":"tb","Size":"Tamanho","Close":"Fechar","You must specify either browse_button or drop_element.":"Deve especificar ou o botão de navegação browse_button ou o elemento de recolha drop_element.","Init error.":"Erro ao iniciar.","Add files to the upload queue and click the start button.":"Adicione ficheiros à fila e clique no botão iniciar.","List":"Lista","Filename":"Nome do ficheiro","%s specified, but cannot be found.":"%s definido mas não foi encontrado.","Image format either wrong or not supported.":"Formato da imagem errado ou não é suportado.","Status":"Estado","HTTP Error.":"Erro HTTP.","Start Upload":"Começar envio","Error: File too large:":"Erro: Ficheiro demasiado grande:","kb":"kb","Duplicate file error.":"Erro: ficheiro duplicado.","File size error.":"Tamanho do ficheiro errado.","N/A":"N/D","gb":"gb","Error: Invalid file extension:":"Erro: Extensão de ficheiro inválida:","Select files":"Seleccione ficheiros","%s already present in the queue.":"%s já se encontra em fila.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resolução excede os limites! %s suporta imagens até %wx%hpx.","File: %s":"Ficheiro: %s","b":"b","Uploaded %d/%d files":"Carregados %d/%d ficheiros","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Só é possível enviar %d ficheiro(s) de cada vez. Os restantes ficheiros foram excluídos.","%d files queued":"%d ficheiros em fila","File: %s, size: %d, max file size: %d":"Ficheiro: %s, tamanho: %d, tamanho máximo do ficheiro: %d","Thumbnails":"Miniaturas","Drag files here.":"Largar ficheiros aqui.","Runtime ran out of available memory.":"A execução esgotou a memória disponível.","File count error.":"Erro: contagem de ficheiros.","File extension error.":"Error de extensão do ficheiro.","mb":"mb","Add Files":"Adicionar ficheiros"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/pt_BR.js b/lib/javascript/plupload/js/i18n/pt_BR.js new file mode 100644 index 0000000..ee7a4b9 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/pt_BR.js @@ -0,0 +1,2 @@ +// Portuguese (Brazil) (pt_BR) +plupload.addI18n({"Stop Upload":"Parar o envio","Upload URL might be wrong or doesn't exist.":"URL de envio incorreta ou inexistente","tb":"TB","Size":"Tamanho","Close":"Fechar","You must specify either browse_button or drop_element.":"Você deve especificar o botão para escolher(browse_button) os arquivos ou o elemento para arrastar(drop_element).","Init error.":"Erro ao iniciar.","Add files to the upload queue and click the start button.":"Adicione os arquivos à fila e clique no botão \"Iniciar o envio\".","List":"Listagem","Filename":"Nome do arquivo","%s specified, but cannot be found.":"Método de envio %s especificado, mas não pôde ser encontrado.","Image format either wrong or not supported.":"Imagem em formato desconhecido ou não permitido.","Status":"Status","HTTP Error.":"Erro HTTP.","Start Upload":"Iniciar o envio","Error: File too large:":"Erro: Arquivo muito grande:","kb":"KB","Duplicate file error.":"Erro: Arquivo duplicado.","File size error.":"Tamanho de arquivo não permitido.","N/A":"N/D","gb":"GB","Error: Invalid file extension:":"Erro: Extensão de arquivo inválida:","Select files":"Selecione os arquivos","%s already present in the queue.":"%s já presentes na fila.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resolução fora de tamanho. O método de envio %s suporta imagens com no máximo %wx%hpx.","File: %s":"Arquivo: %s","b":"Bytes","Uploaded %d/%d files":"%d\\/%d arquivo(s) enviados(s)","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Só são aceitos %d arquivos por vez. O que passou disso foi descartado.","%d files queued":"%d arquivo(s)","File: %s, size: %d, max file size: %d":"Arquivo: %s, Tamanho: %d , Tamanho Máximo do Arquivo: %d","Thumbnails":"Miniaturas","Drag files here.":"Arraste os arquivos pra cá","Runtime ran out of available memory.":"Método de envio ficou sem mem\\u00f3ria.","File count error.":"Erro na contagem dos arquivos","File extension error.":"Tipo de arquivo não permitido.","mb":"MB","Add Files":"Adicionar arquivo(s)"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ro.js b/lib/javascript/plupload/js/i18n/ro.js new file mode 100644 index 0000000..c810367 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ro.js @@ -0,0 +1,2 @@ +// Romanian (ro) +plupload.addI18n({"Stop Upload":"Oprește încărcarea","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Mărime","Close":"Închide","You must specify either browse_button or drop_element.":"","Init error.":"Eroare inițializare.","Add files to the upload queue and click the start button.":"Adaugă fișiere în lista apoi apasă butonul \"Începe încărcarea\".","List":"","Filename":"Nume fișier","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formatul de imagine ori este greșit ori nu este suportat.","Status":"Stare","HTTP Error.":"Eroare HTTP","Start Upload":"Începe încărcarea","Error: File too large:":"Eroare: Fișierul este prea mare:","kb":"kb","Duplicate file error.":"Eroare duplicat fișier.","File size error.":"Eroare dimensiune fișier.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Eroare: Extensia fișierului este invalidă:","Select files":"Selectează fișierele","%s already present in the queue.":"%s există deja în lista de așteptare.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Fișier: %s","b":"b","Uploaded %d/%d files":"Fișiere încărcate %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d fișiere listate","File: %s, size: %d, max file size: %d":"Fișier: %s, mărime: %d, mărime maximă: %d","Thumbnails":"","Drag files here.":"Trage aici fișierele.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Eroare numărare fișiere.","File extension error.":"Eroare extensie fișier.","mb":"mb","Add Files":"Adaugă fișiere"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/ru.js b/lib/javascript/plupload/js/i18n/ru.js new file mode 100644 index 0000000..c948650 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/ru.js @@ -0,0 +1,2 @@ +// Russian (ru) +plupload.addI18n({"Stop Upload":"Остановить Загрузку","Upload URL might be wrong or doesn't exist.":"Адрес заргузки неправильный или он не существует.","tb":"тб","Size":"Размер","Close":"Закрыть","You must specify either browse_button or drop_element.":"Вы должны указать browse_button или drop_element.","Init error.":"Ошибка инициализации.","Add files to the upload queue and click the start button.":"Добавьте файлы в очередь и нажмите кнопку \"Загрузить файлы\".","List":"Список","Filename":"Имя файла","%s specified, but cannot be found.":"%s существует, но не может быть найден.","Image format either wrong or not supported.":"Формат картинки неправильный или он не поддерживается.","Status":"Статус","HTTP Error.":"Ошибка HTTP.","Start Upload":"Начать загрузку","Error: File too large:":"Ошибка: Файл слишком большой:","kb":"кб","Duplicate file error.":"Такой файл уже присутствует в очереди.","File size error.":"Неправильный размер файла.","N/A":"N/A","gb":"гб","Error: Invalid file extension:":"Ошибка: У файла неправильное расширение:","Select files":"Выберите файлы","%s already present in the queue.":"%s уже присутствует в очереди.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Слишком большое разрешение! %s поддерживаются изображения с размером не более %wx%hpx","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Загружено %d/%d файлов","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Загрузочный элемент за раз принимает только %d файл(ов). Лишние файлы были отброшены.","%d files queued":"В очереди %d файл(ов)","File: %s, size: %d, max file size: %d":"Файл: %s, размер: %d, макс. размер файла: %d","Thumbnails":"Миниатюра","Drag files here.":"Перетащите файлы сюда.","Runtime ran out of available memory.":"Рабочая среда превысила лимит достуной памяти.","File count error.":"Слишком много файлов.","File extension error.":"Неправильное расширение файла.","mb":"мб","Add Files":"Добавьте файлы"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/sk.js b/lib/javascript/plupload/js/i18n/sk.js new file mode 100644 index 0000000..6fa1f08 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/sk.js @@ -0,0 +1,2 @@ +// Slovak (sk) +plupload.addI18n({"Stop Upload":"Zastaviť nahrávanie","Upload URL might be wrong or doesn't exist.":"URL pre nahratie nie je správna alebo neexistuje.","tb":"tb","Size":"Veľkosť","Close":"Zatvoriť","You must specify either browse_button or drop_element.":"","Init error.":"Chyba inicializácie.","Add files to the upload queue and click the start button.":"Pridajte súbory do zoznamu a potom spustite nahrávanie.","List":"","Filename":"Názov súboru","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formát obrázku je nesprávny alebo nie je podporovaný.","Status":"Stav","HTTP Error.":"HTTP Chyba.","Start Upload":"Spustiť nahrávanie","Error: File too large:":"Chyba: Súbor je príliš veľký:","kb":"kb","Duplicate file error.":"Duplicitný súbor.","File size error.":"Súbor je príliš veľký.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Nesprávny typ súboru:","Select files":"Vyberte súbory","%s already present in the queue.":"%s sa už nachádza v zozname.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Súbor: %s","b":"b","Uploaded %d/%d files":"Nahraných %d/%d súborov","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d súborov pridaných do zoznamu","File: %s, size: %d, max file size: %d":"Súbor: %s, veľkosť: %d, max. veľkosť súboru: %d","Thumbnails":"","Drag files here.":"Sem pretiahnite súbory.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Nesprávny počet súborov.","File extension error.":"Chybný typ súboru.","mb":"mb","Add Files":"Pridať súbory"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/sl.js b/lib/javascript/plupload/js/i18n/sl.js new file mode 100644 index 0000000..21185df --- /dev/null +++ b/lib/javascript/plupload/js/i18n/sl.js @@ -0,0 +1,2 @@ +// Slovenian (sl) +plupload.addI18n({"Stop Upload":"Ustavi prenos","Upload URL might be wrong or doesn't exist.":"URL za nalaganje je napačen ali ne obstaja.","tb":"tb","Size":"Velikost","Close":"Zapri","You must specify either browse_button or drop_element.":"","Init error.":"Napaka pri inicializaciji.","Add files to the upload queue and click the start button.":"Dodaj datoteke na seznam in klikni na gumb začni","List":"Seznam","Filename":"Ime datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format slike je napačen ali ni podrpt.","Status":"Status","HTTP Error.":"Neznana HTTP napaka.","Start Upload":"Začni prenos","Error: File too large:":"Napaka: datoteka je prevelika:","kb":"kb","Duplicate file error.":"Datoteka je že na seznamu.","File size error.":"Datoteka je prevelika.","N/A":"Ni na voljo","gb":"gb","Error: Invalid file extension:":"Napaka: napačen tip datoteke:","Select files":"Izberi datoteke","%s already present in the queue.":"%s je že na seznamu.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Naloženo %d/%d datotek","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Nalagalnik sprejme samo %d datotek na enkrat. Višek datotek je odstranjen iz seznama.","%d files queued":"%d datotek na seznamu","File: %s, size: %d, max file size: %d":"Datoteka: %s, velikost: %d, največja dovoljena velikost: %d","Thumbnails":"Sličice","Drag files here.":"Potegni datoteke sem.","Runtime ran out of available memory.":"Zmanjkalo je pomnilnika.","File count error.":"Napačno število datotek.","File extension error.":"Napačen tip datoteke.","mb":"mb","Add Files":"Dodaj datoteke"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/sq.js b/lib/javascript/plupload/js/i18n/sq.js new file mode 100644 index 0000000..9a67c57 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/sq.js @@ -0,0 +1,2 @@ +// Albanian (sq) +plupload.addI18n({"Stop Upload":"Ndalimi i ngarkimit","Upload URL might be wrong or doesn't exist.":"Ngarkimi i URL-s është i gabuar ose nuk ekziston.","tb":"TB","Size":"Madhësia","Close":"Mbyll","You must specify either browse_button or drop_element.":"","Init error.":"Init gabim.","Add files to the upload queue and click the start button.":"Mbas ngarkimit të dosjeve sipas rradhës duhet të klikoni butonin Start.","List":"","Filename":"Emri i dosjes","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formati i fotove është i keq ose nuk është i pranueshëm.","Status":"Statusi","HTTP Error.":"HTTP Gabim.","Start Upload":"Nisja e ngarkimit","Error: File too large:":"Gabim: dosja është shumë e madhe:","kb":"KB","Duplicate file error.":"Gabim i dublikimit të dosjes.","File size error.":"Gabim i madhësisë së dosjes.","N/A":"Nuk është në dispozicion","gb":"GB","Error: Invalid file extension:":"Gabim: përhapja e llojit të dosjes është e pavlefshme:","Select files":"Zhgjidhni dosjet","%s already present in the queue.":"%s tashmë ekziston në list.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"Dosje: %s","b":"B","Uploaded %d/%d files":"Dosjet e ngarkuara: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Ngarkimi pranon njëherësh vetëm %d dosje, dosjet e tjera nuk do të jenë të ngarkuara.","%d files queued":"Dosja %d e vendosur në rradhë","File: %s, size: %d, max file size: %d":"Dosje: %s, madhësia: %d, madhësia maximale e dosjes: %d","Thumbnails":"","Drag files here.":"Këtu mund të tërhiqni dosjet","Runtime ran out of available memory.":"Memoria që ishte në dispozicion ka mbaruar.","File count error.":"Gabim në lidhje me numrin e dosjeve.","File extension error.":"Gabim i zgjerimit të dosjes.","mb":"MB","Add Files":"Shtoni dosjet"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/sr.js b/lib/javascript/plupload/js/i18n/sr.js new file mode 100644 index 0000000..5fc8ad1 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/sr.js @@ -0,0 +1,2 @@ +// Serbian (sr) +plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Veličina","Close":"Close","You must specify either browse_button or drop_element.":"","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Dodajte fajlove u listu i kliknite na dugme Start.","List":"","Filename":"Naziv fajla","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Počni upload","Error: File too large:":"Error: File too large:","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Izaberite fajlove","%s already present in the queue.":"","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Snimljeno %d/%d fajlova","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Thumbnails":"","Drag files here.":"Prevucite fajlove ovde.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"","Add Files":"Dodaj fajlove"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/sv.js b/lib/javascript/plupload/js/i18n/sv.js new file mode 100644 index 0000000..50c2732 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/sv.js @@ -0,0 +1,2 @@ +// Swedish (sv) +plupload.addI18n({"Stop Upload":"Avbryt","Upload URL might be wrong or doesn't exist.":"URL:en va fel eller existerar inte.","tb":"tb","Size":"Storlek","Close":"Stäng","You must specify either browse_button or drop_element.":"Du behöver specificera browse_button eller drop_element.","Init error.":"Problem vid initialisering.","Add files to the upload queue and click the start button.":"Lägg till filer till kön och tryck på start.","List":"Lista","Filename":"Filnamn","%s specified, but cannot be found.":"%s specificerad, men hittades inte.","Image format either wrong or not supported.":"Bildformatet är fel eller så finns inte stöd för det.","Status":"Status","HTTP Error.":"HTTP problem.","Start Upload":"Starta","Error: File too large:":"Fel: Filen är för stor:","kb":"kb","Duplicate file error.":"Problem med dubbla filer.","File size error.":"Problem med filstorlek.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Fel: Ej godkänd filändelse.","Select files":"Välj filer","%s already present in the queue.":"%s är redan tillagd.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Upplösning utanför gränserna! %s bara bilder upp till %wx%hpx stöds.","File: %s":"Fil: %s","b":"b","Uploaded %d/%d files":"Laddade upp %d/%d filer","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Det går bara lägga till %d filer åt gången, allt utöver detta togs bort.","%d files queued":"%d filer i kö","File: %s, size: %d, max file size: %d":"Fil: %s, storlek: %d, max storlek: %d","Thumbnails":"Miniatyrer","Drag files here.":"Dra filer hit","Runtime ran out of available memory.":"Slut på minne.","File count error.":"Räknefel.","File extension error.":"Problem med filändelse.","mb":"mb","Add Files":"Lägg till"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/th_TH.js b/lib/javascript/plupload/js/i18n/th_TH.js new file mode 100644 index 0000000..560e3fb --- /dev/null +++ b/lib/javascript/plupload/js/i18n/th_TH.js @@ -0,0 +1,2 @@ +// Thai (Thailand) (th_TH) +plupload.addI18n({"Stop Upload":"หยุดอัพโหลด","Upload URL might be wrong or doesn't exist.":"URL ของการอัพโหลดอาจจะผิดหรือไม่มีอยู่","tb":"เทราไบต์","Size":"ขนาด","Close":"ปิด","You must specify either browse_button or drop_element.":"","Init error.":"Init เกิดข้อผิดพลาด","Add files to the upload queue and click the start button.":"เพิ่มไฟล์ไปยังคิวอัพโหลดและคลิกที่ปุ่มเริ่ม","List":"","Filename":"ชื่อไฟล์","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"รูปแบบรูปภาพทั้งสองผิดหรือไม่รองรับ","Status":"สถานะ","HTTP Error.":"HTTP เกิดข้อผิดพลาด","Start Upload":"เริ่มอัพโหลด","Error: File too large:":"ข้อผิดพลาด: ไฟล์ใหญ่เกินไป:","kb":"กิโลไบต์","Duplicate file error.":"ไฟล์ที่ซ้ำกันเกิดข้อผิดพลาด","File size error.":"ขนาดไฟล์เกิดข้อผิดพลาด","N/A":"N/A","gb":"กิกะไบต์","Error: Invalid file extension:":"ข้อผิดพลาด: นามสกุลไฟล์ไม่ถูกต้อง:","Select files":"เลือกไฟล์","%s already present in the queue.":"%s อยู่ในคิวแล้ว","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"","File: %s":"ไฟล์: %s","b":"ไบต์","Uploaded %d/%d files":"อัพโหลดแล้ว %d/%d ไฟล์","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"การอัพโหลดจะยอมรับเฉพาะ %d ไฟล์(s) ในช่วงเวลาเดียวกัน เมื่อไฟล์พิเศษถูกปลดออก","%d files queued":"%d ไฟล์ที่อยู่ในคิว","File: %s, size: %d, max file size: %d":"ไฟล์: %s, ขนาด: %d, ขนาดไฟล์สูงสุด: %d","Thumbnails":"","Drag files here.":"ลากไฟล์มาที่นี่","Runtime ran out of available memory.":"รันไทม์วิ่งออกมาจากหน่วยความจำ","File count error.":"การนับไฟล์เกิดข้อผิดพลาด","File extension error.":"นามสกุลไฟล์เกิดข้อผิดพลาด","mb":"เมกะไบต์","Add Files":"เพิ่มไฟล์"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/tr.js b/lib/javascript/plupload/js/i18n/tr.js new file mode 100644 index 0000000..a3c0ac8 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/tr.js @@ -0,0 +1,2 @@ +// Turkish (tr) +plupload.addI18n({"Stop Upload":"Yüklemeyi durdur","Upload URL might be wrong or doesn't exist.":"URL yok ya da hatalı olabilir.","tb":"tb","Size":"Boyut","Close":"Kapat","You must specify either browse_button or drop_element.":"browse_button veya drop_element değişkenlerini belirlemelisiniz.","Init error.":"Başlangıç hatası.","Add files to the upload queue and click the start button.":"Dosyaları kuyruğa ekleyin ve başlatma butonuna tıklayın.","List":"Liste","Filename":"Dosya adı","%s specified, but cannot be found.":"%s tanımlandı fakat bulunamadı.","Image format either wrong or not supported.":"Resim formatı yanlış ya da desteklenmiyor.","Status":"Durum","HTTP Error.":"HTTP hatası.","Start Upload":"Yüklemeyi başlat","Error: File too large:":"Hata: Dosya çok büyük:","kb":"kb","Duplicate file error.":"Yinelenen dosya hatası.","File size error.":"Dosya boyutu hatası.","N/A":"-","gb":"gb","Error: Invalid file extension:":"Hata: Geçersiz dosya uzantısı:","Select files":"Dosyaları seç","%s already present in the queue.":"%s kuyrukta zaten mevcut.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Çözünürlük sınırların dışındadır! %s modu en fazla %wx%hpx desteklemektedir.","File: %s":"Dosya: %s","b":"bayt","Uploaded %d/%d files":"%d/%d dosya yüklendi","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Yükleme elemanı aynı anda %d dosya kabul eder. Ekstra dosyalar işleme konulmaz.","%d files queued":"Kuyrukta %d dosya var.","File: %s, size: %d, max file size: %d":"Dosya: %s, boyut: %d, maksimum dosya boyutu: %d","Thumbnails":"Önizlemeler","Drag files here.":"Dosyaları buraya bırakın.","Runtime ran out of available memory.":"İşlem için yeterli bellek yok.","File count error.":"Dosya sayım hatası.","File extension error.":"Dosya uzantısı hatası.","mb":"mb","Add Files":"Dosya ekle"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/uk_UA.js b/lib/javascript/plupload/js/i18n/uk_UA.js new file mode 100644 index 0000000..f07d0e7 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/uk_UA.js @@ -0,0 +1,2 @@ +// Ukrainian (Ukraine) (uk_UA) +plupload.addI18n({"Stop Upload":"Зупинити завантаження","Upload URL might be wrong or doesn't exist.":"Адреса завантаження неправильна або не існує.","tb":"тб","Size":"Розмір","Close":"Закрити","You must specify either browse_button or drop_element.":"Ви маєте вказати або browse_button, або drop_element.","Init error.":"Помилка ініціалізації.","Add files to the upload queue and click the start button.":"Додайте файли в чергу та натисніть кнопку \"Завантажити файли\".","List":"Список","Filename":"Назва файлу","%s specified, but cannot be found.":"%s вказано, але не може бути знайдено.","Image format either wrong or not supported.":"Формат картинки не правильний або не підтримується.","Status":"Статус","HTTP Error.":"Помилка HTTP.","Start Upload":"Почати завантаження","Error: File too large:":"Помилка: Файл занадто великий:","kb":"кб","Duplicate file error.":"Такий файл вже присутній в черзі.","File size error.":"Неправильний розмір файлу.","N/A":"Н/Д","gb":"гб","Error: Invalid file extension:":"Помилка: У файлу неправильне розширення:","Select files":"Оберіть файли","%s already present in the queue.":"%s вже присутній у черзі.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Роздільна здатність поза межами! Робоче середовище %s підтримує зображення лише до %wx%hpx.","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Завантажено %d/%d файлів","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Завантажувальний елемент приймає лише %d файл(ів) одночасно. Зайві файли було відкинуто.","%d files queued":"В черзі %d файл(ів)","File: %s, size: %d, max file size: %d":"Файл: %s, розмір: %d, макс. розмір файлу: %d","Thumbnails":"Мініатюри","Drag files here.":"Перетягніть файли сюди.","Runtime ran out of available memory.":"Робоче середовище перевищило ліміт доступної пам'яті.","File count error.":"Занадто багато файлів.","File extension error.":"Неправильне розширення файлу.","mb":"мб","Add Files":"Додати файли"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/vi.js b/lib/javascript/plupload/js/i18n/vi.js new file mode 100644 index 0000000..e11a688 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/vi.js @@ -0,0 +1,2 @@ +// Vietnamese (vi) +plupload.addI18n({"Stop Upload":"Dừng","Upload URL might be wrong or doesn't exist.":"Đường dẫn URL tải lên không đúng hoặc không tồn tại.","tb":"TB","Size":"Dung lượng","Close":"Đóng","You must specify either browse_button or drop_element.":"","Init error.":"Lỗi khởi tạo","Add files to the upload queue and click the start button.":"Thêm tập tin để tải lên và bấm vào nút bắt đầu","List":"Danh sách","Filename":"Tên tập tin","%s specified, but cannot be found.":"%s đã chỉ định nhưng không thể tìm thấy.","Image format either wrong or not supported.":"Định dạng hình ảnh không đúng hoặc không được hỗ trợ.","Status":"Trạng thái","HTTP Error.":"Lỗi HTTP","Start Upload":"Bắt đầu","Error: File too large:":"Lỗi: Dung lượng tập tin quá lớn:","kb":"KB","Duplicate file error.":"Tập tin đã tồn tại","File size error.":"Lỗi dung lượng tập tin","N/A":"Chưa có thông tin","gb":"GB","Error: Invalid file extension:":"Lỗi: Định dạng tập tin không xác định:","Select files":"Chọn tập tin","%s already present in the queue.":"%s đã có trong danh sách chờ tải lên","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Độ phân giải quá lớn! %s chỉ hỗ trợ kích thước tối đa %wx%hpx.","File: %s":"Tập tin: %s","b":"B","Uploaded %d/%d files":"Đã tải lên %d/%d tập tin","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Chỉ có thể tải lên (%d) tập tin cùng một lúc. Những tập tin còn lại đã bị huỷ bỏ.","%d files queued":"%d tập tin trong danh sách chờ","File: %s, size: %d, max file size: %d":"Tập tin: %s, dung lượng %d, dung lượng tối đa: %d","Thumbnails":"Ảnh thu nhỏ","Drag files here.":"Thả tập tin vào đây","Runtime ran out of available memory.":"Thời gian chạy vượt quá giới hạn bộ nhớ cho phép.","File count error.":"Lỗi đếm tập tin","File extension error.":"Lỗi định dạng tập tin","mb":"MB","Add Files":"Thêm tập tin"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/zh_CN.js b/lib/javascript/plupload/js/i18n/zh_CN.js new file mode 100644 index 0000000..608d41e --- /dev/null +++ b/lib/javascript/plupload/js/i18n/zh_CN.js @@ -0,0 +1,2 @@ +// Chinese (China) (zh_CN) +plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","List":"列表","Filename":"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:","kb":"kb","Duplicate file error.":"重复文件错误。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"超限。%s 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Thumbnails":"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","mb":"mb","Add Files":"增加文件"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/i18n/zh_TW.js b/lib/javascript/plupload/js/i18n/zh_TW.js new file mode 100644 index 0000000..a976cb6 --- /dev/null +++ b/lib/javascript/plupload/js/i18n/zh_TW.js @@ -0,0 +1,2 @@ +// Chinese (Taiwan) (zh_TW) +plupload.addI18n({"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。","tb":"tb","Size":"大小","Close":"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。","List":"清單","Filename":"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。","Status":"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:","kb":"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! %s 最高只支援到 %wx%hpx。","File: %s":"檔案: %s","b":"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d","Thumbnails":"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。","mb":"mb","Add Files":"增加檔案"}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css b/lib/javascript/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css new file mode 100644 index 0000000..6bfe0e5 --- /dev/null +++ b/lib/javascript/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css @@ -0,0 +1,185 @@ +/* + Plupload +------------------------------------------------------------------- */ + +.plupload_wrapper * { + box-sizing: content-box; +} + +.plupload_button { + display: -moz-inline-box; /* FF < 3*/ + display: inline-block; + font: normal 12px sans-serif; + text-decoration: none; + color: #42454a; + border: 1px solid #bababa; + padding: 2px 8px 3px 20px; + margin-right: 4px; + background: #f3f3f3 url('../img/buttons.png') no-repeat 0 center; + outline: 0; + + /* Optional rounded corners for browsers that support it */ + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.plupload_button:hover { + color: #000; + text-decoration: none; +} + +.plupload_disabled, a.plupload_disabled:hover { + color: #737373; + border-color: #c5c5c5; + background: #ededed url('../img/buttons-disabled.png') no-repeat 0 center; + cursor: default; +} + +.plupload_add { + background-position: -181px center; +} + +.plupload_wrapper { + font: normal 11px Verdana,sans-serif; + width: 100%; +} + +.plupload_container { + padding: 8px; + background: url('../img/transp50.png'); + /*-moz-border-radius: 5px;*/ +} + +.plupload_container input { + border: 1px solid #DDD; + font: normal 11px Verdana,sans-serif; + width: 98%; +} + +.plupload_header {background: #2A2C2E url('../img/backgrounds.gif') repeat-x;} +.plupload_header_content { + background: url('../img/backgrounds.gif') no-repeat 0 -317px; + min-height: 56px; + padding-left: 60px; + color: #FFF; +} +.plupload_header_title { + font: normal 18px sans-serif; + padding: 6px 0 3px; +} +.plupload_header_text { + font: normal 12px sans-serif; +} + +.plupload_filelist { + margin: 0; + padding: 0; + list-style: none; +} + +.plupload_scroll .plupload_filelist { + height: 185px; + background: #F5F5F5; + overflow-y: scroll; +} + +.plupload_filelist li { + padding: 10px 8px; + background: #F5F5F5 url('../img/backgrounds.gif') repeat-x 0 -156px; + border-bottom: 1px solid #DDD; +} + +.plupload_filelist_header, .plupload_filelist_footer { + background: #DFDFDF; + padding: 8px 8px; + color: #42454A; +} +.plupload_filelist_header { + border-top: 1px solid #EEE; + border-bottom: 1px solid #CDCDCD; +} + +.plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;} +.plupload_file_name {float: left; overflow: hidden} +.plupload_file_status {color: #777;} +.plupload_file_status span {color: #42454A;} +.plupload_file_size, .plupload_file_status, .plupload_progress { + float: right; + width: 80px; +} +.plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;} + +.plupload_filelist .plupload_file_name { + width: 205px; + white-space: nowrap; + text-overflow: ellipsis; +} + +.plupload_file_action { + float: right; + width: 16px; + height: 16px; + margin-left: 15px; +} + +.plupload_file_action * { + display: none; + width: 16px; + height: 16px; +} + +li.plupload_uploading {background: #ECF3DC url('../img/backgrounds.gif') repeat-x 0 -238px;} +li.plupload_done {color:#AAA} + +li.plupload_delete a { + background: url('../img/delete.gif'); +} + +li.plupload_failed a { + background: url('../img/error.gif'); + cursor: default; +} + +li.plupload_done a { + background: url('../img/done.gif'); + cursor: default; +} + +.plupload_progress, .plupload_upload_status { + display: none; +} + +.plupload_progress_container { + margin-top: 3px; + border: 1px solid #CCC; + background: #FFF; + padding: 1px; +} +.plupload_progress_bar { + width: 0px; + height: 7px; + background: #CDEB8B; +} + +.plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action { + margin-right: 17px; +} + +/* Floats */ + +.plupload_clear,.plupload_clearer {clear: both;} +.plupload_clearer, .plupload_progress_bar { + display: block; + font-size: 0; + line-height: 0; +} + +li.plupload_droptext { + background: transparent; + text-align: center; + vertical-align: middle; + border: 0; + line-height: 165px; +} diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/img/backgrounds.gif b/lib/javascript/plupload/js/jquery.plupload.queue/img/backgrounds.gif new file mode 100644 index 0000000000000000000000000000000000000000..39e33ebc02114ebea6bb33dee2fb76af3a6dd4dc GIT binary patch literal 2977 zcmdUu`#Tc~1II^hosi0dq?7P6w^9i&)fvJz8*&{RhTJ9Zdro+CGnWyPC?vVFx!;*f zwGhKxa!+DIj18M@Hka9Z&Y$sqpU=;q=kv?g24ZdUZyyK10});iz~_F@@$vEA-kwk> zWUv>uxr;|fM|?hCAQ0^D?{m4_!^1<~@jCbD7n4UhI5^ni{N(X?EIxH-Z^_Wu)X2ol z*z~rE*&WkcAhSE>w?TJr{b6~>-0BYtYxBEc3oEF(6+}nx3g>Wj_h4mDuy)tRmM^63 z9j{-xc7uPs!8!WHK3u(V(`0vlnSHRr6|5Otzp1NlaLv$I|LS!sFwD~0mM5fn`S^SL z224&(`}hT-eFHpw?t7yBP+q?7C~u^v4+81wfkL~vqg)Y47dMZI$th=7gf-M|Zti<} zMppFWX9%SCi|=rDf$WQq#?D zgPh%vgpRJ6*|~V^i^V0%>aR8G@(PVc1H&99{uWKoK;ZYjO-xQqOxioSZEtUXpa1b= z;U}F=FDWfYdikw;y?A6o;>FZf!&R1ropX!0hj#(0-1t9=3LlPOcu# zuI^4Q2(YcauYa)FZF6^|w}X?b4HOP@aGsu-wFX1)2Zq`?I6Jwx-?f1`IJw+&MmV}4 z?Cv?;G%>Zu$?>SjoLvDjCEv�TRS%oFI%_+CO)aErq(YYgtoB}8U3WF zxU8kMZGbe0!&i27eay}KP+e2IvAG!)^VB~m%-b(8^G!}b@PnP5otP)jqaQ#2O#HIA zv{Y7sfBY2F+4a%W#~#DtRV2e0sMdN^1he| z0MG-_`zQaOPXMHZfcTRt;D(|v@lxk>P^5<9-XuA7Xg;{HoMYfOln-gH78R4*5CMT0L8j?)9oQZ>#y<95h+wIowu@Y`U~O^ue~h?q^ptd-LZ7#e}8L zu_sRb4kI*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}BpL0)g#m*`>RVLM2d7y+%KO3t!2z2n`d3rrfuB=AyQ913J`ZXe{HLQFSE-FVY+Uu03Bt zoS&()kc$vhgJz%-AB7e(rwCk8`N&};@W|rK)7nsjnR$0o6O|B#i2H9&HOd8$Q&V~| zJa{Ztk}O&zGxwlZvF%V?FM77CF(cHYYe<|f3XrCW$1BWqd3nXUo~#4vDwe(1)<~G{ z^d;3RRS}nt3w&h(vR3Zpu?g^tJ>3AQ__$tlqJ$YjJ~BB%ixQIz-xvAfM`9|~5vj6| zmt|EYBv68e%3+UL8DONPf@}A(BT4PF0ahIKu0h*WHCo2RD_$isE#+QDi7aSaJZu=6 z1pgUV?@7XB=H$n_^-%{Q$xUy{7g7j|XeSfU^{kxkRABV?lW5r+x$s6e6}0;>a#TcZ z8DyqI*cXlz6@Aqj>el|ze{(R{^-rC@sQy>SdK6lLjJG%a{n*#fe<1*`#hrfOr5u`a z#x%L5ObfmNHl|L%@hufvBgt^Ck7SW-E8a#X1ZIqx!Ye$wWHc>h;=rA5NWbaw5)`UV zI+&@)TB;jyF*Xa7S)y!P!$XHqb?L)7;NgX zz#PgCiflV!7_@yo`EY@X?ejHCJP(!Ykz}T~cmMi;jluaW^3#nk12OO5?=pVk$YG2%!@ek{6A(fmDJ+~!0gA49US+s%A`w3_&A z928;1Re?FHNg2HAAP3s9-?@pN8~g4YCGq9OW&Y7R=yd1!^U)XPe+4=*I>c0yiJS^E z!G^tL-@oRXwFP13=bi)OX4*%&b&Ax}d2?~kjNTUMYxJD80e8*M7DU==_?|jBFOSuD dje#jyoPHgVpsrRdX?b7mL?&^(OjHzL_CKvd+)Mxf literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/img/buttons-disabled.png b/lib/javascript/plupload/js/jquery.plupload.queue/img/buttons-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c759e402fb75a5cf581e82dea62145d73b9ef83a GIT binary patch literal 1026 zcmV+d1pWJoP)*qO>>#*qD-jKQ zsT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j-CkkZZ+PIz&iq4(r6)4xUz)J}=GOefiTPV2bGL_Yxw$lNYefFmh~ndE zIY+&>-d_`Q*w(b(@Zp<>wcFFSKin|$Y?u8^o3fLc-6tyEet(^I)N{&-{-V>Nn&qme z-|XLbclqX#$!XmLDils2^$_i=Vfo6|K!7s z$3S&5b~>3_CysS9Ff(!pa1CI4JIO94&@9fw!C(yl Dux)$+ literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/img/error.gif b/lib/javascript/plupload/js/jquery.plupload.queue/img/error.gif new file mode 100644 index 0000000000000000000000000000000000000000..4682b63007c89fae09f6640e1a968a073d98b90d GIT binary patch literal 994 zcmZ?wbhEHb6krfw_};*9b)oIQ-*5l@e)sRs`)iBszTS%X_xshqKVQDwin+ST?*G5P zzrQ^G_xt_f9Jc2NYJa}F{`Gdu&zDm^T?_qix&OnZo-emz|NVaR_t)1i*Zuzedh_v0 z>zAA1pKtV@Ea!c=%JBE6!+*Zrczrtj)3uOqx1+w?ivDyh;``H`|9*XZd!q2y`>j8o zPq{fm`Na;auQ!6uw~GD$_w&u+sDHnnzd8{2bbrVDb8TPluY7%O^{INT7l+$F-w1!O zT=&{!g-_QbzC1qg{l($GKi~d(fA!P#uus>+|9rjj_t&$3f4+Tvyzkqcn7=>n{r&m; z>&=i$lU?pF(SEVZ_4lV+Z%tCF$iDo6LW`p7(5<$N&HT8Aidtg@EEu7Dfh!1_m9F6F_-_fnz@dBd3hV zh6RoeTpun37Hm*p=S}!xB2%GsN>(9zl@H4iweC3*!Wlj#haUN`*h|{jWN<7##?Qpk zmawqs0!x>8vXF{_aD)HsCf8Xtia|ir6_cteb~+gFu`;I!>|qpOVG?4uVAFdM{QR&W zONNt2z@nss^K_X~eLR`cSvVIfMeSfTbmmr&58_**5um`{FC={>;XzVD=Tv()J_7-T ogaZvn8JQwxBtJeTEbH?rX5;20cPa5$D~HSgwKHzbjEoG{0NEsHRR910 literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/img/throbber.gif b/lib/javascript/plupload/js/jquery.plupload.queue/img/throbber.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ae8b16a5a474c3da1e426afc20d2167ebd360f1 GIT binary patch literal 1922 zcma)-eM}Q~9LBG`Uf-_0UZFJTFt*nsTO5ueC8MQCX?YP5d8q^!#7gUiuF(Vv0y0uv zMJsO=7zu_gofyX-W+{m?E;Ac+grVzRB*kTp0b7W13o~jO6PL#Adz^qwjJtm>_sjk9 z`#jI{eZINdbKXqbPa-7ZMiBKT^}xA-;P=6WKNl)0E2eKxhaZKneR-`QzrcOMJvKfT zx)lmP4A1{QA9)h7lvsMZdqb029JH3~(nv`^VO`dQxDnc;-1oz!sEu0QJXhB~$nrssc=;5d6bWb>~J{i+O9hUE>s zy$3K&J8PlS3s zuf&l@@FJcg=@u`pfhDq)R}nk`!N({wk0c0{S65>YWU5;9TUls-qL>gRi_rR);{wgY zMVdw2=B8#K29K9L3s zc2K-aUfk?E&kByZwEo`KQU%&(ulDp;Rd2jF$4C4_mBa4FtT?M{W386p329VQR0mG+mdz;^%6}=b+X&!0PAJghY6b|U<(&T>?OpL^EQ|Dg8v(US+(!5}gNN>68C zjIJsuuSa13hEay{0=HqHA>PcGLdSs$kl{5DmyWOoKy3@Be5XpZZB{~bv-Rt+_KBtg z?I&+!J&28PB^xhXaT!{!c-ZpmN=~tqb8%>d`}1|A?BGOz>Q{U7drQo%qk+Jq)wF|Bjbw4$i)(?^O-2qNn1c<7SK zeh64nT!z?PU-wbRweq{O<*Cxk-%v+|o7P1Kr$(&P;`Dngu`P{NC&`fTITT02B_YRx zMm@NDi25Ks=~!vhsbn#_65^=UAs+Z>fLS&$h+rtQa@x?&qIF}sS{QcM$9 zyj8I_JtbX`?QWmL>a)qPxTV4W0{AhtaEw8J%zHgmpSG<=!@1xzkcC#tDkpClZTQ9T{9{ XMrH}sh*f7CD@Dcca7lI@6tMnZ`e4## literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/img/transp50.png b/lib/javascript/plupload/js/jquery.plupload.queue/img/transp50.png new file mode 100644 index 0000000000000000000000000000000000000000..61e6b217c426c4c7b4e1d5249ff298425a5127c4 GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^(?FP!8A!67f4mS#F$egBxc>kDfB6yV6F@FwNswP~ z!`irLHy}sK)5S5Qg7NJ^Mn(n(7G{IL!QG7a!x$J2RPl1}U|`f(v%MCmiow&>&t;uc GLK6TMZ5}WH literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js b/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js new file mode 100644 index 0000000..8c3b62b --- /dev/null +++ b/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js @@ -0,0 +1,433 @@ +/** + * jquery.plupload.queue.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/* global jQuery:true, alert:true */ + +/** +jQuery based implementation of the Plupload API - multi-runtime file uploading API. + +To use the widget you must include _jQuery_. It is not meant to be extended in any way and is provided to be +used as it is. + +@example + +
+

Your browser doesn't have Flash, Silverlight or HTML5 support.

+
+ + + +@example + // Retrieving a reference to plupload.Uploader object + var uploader = $('#uploader').pluploadQueue(); + + uploader.bind('FilesAdded', function() { + + // Autostart + setTimeout(uploader.start, 1); // "detach" from the main thread + }); + +@class pluploadQueue +@constructor +@param {Object} settings For detailed information about each option check documentation. + @param {String} settings.url URL of the server-side upload handler. + @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. + @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. + @param {Array} [settings.filters=[]] Set of file type filters, each one defined by hash of title and extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` + @param {String} [settings.flash_swf_url] URL of the Flash swf. + @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. + @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. + @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. + @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. + @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. + @param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. + @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` + @param {Number} [settings.resize.width] If image is bigger, it will be resized. + @param {Number} [settings.resize.height] If image is bigger, it will be resized. + @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). + @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. + @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. + @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. + @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. + + @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop. + @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue. + @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure. +*/ +;(function($, plupload) { + var uploaders = {}; + + function _(str) { + return plupload.translate(str) || str; + } + + function renderUI(id, target) { + // Remove all existing non plupload items + target.contents().each(function(i, node) { + node = $(node); + + if (!node.is('.plupload')) { + node.remove(); + } + }); + + target.prepend( + '
' + ); + } + + $.fn.pluploadQueue = function(settings) { + if (settings) { + this.each(function() { + var uploader, target, id, contents_bak; + + target = $(this); + id = target.attr('id'); + + if (!id) { + id = plupload.guid(); + target.attr('id', id); + } + + contents_bak = target.html(); + renderUI(id, target); + + settings = $.extend({ + dragdrop : true, + browse_button : id + '_browse', + container : id + }, settings); + + // Enable drag/drop (see PostInit handler as well) + if (settings.dragdrop) { + settings.drop_element = id + '_filelist'; + } + + uploader = new plupload.Uploader(settings); + + uploaders[id] = uploader; + + function handleStatus(file) { + var actionClass; + + if (file.status == plupload.DONE) { + actionClass = 'plupload_done'; + } + + if (file.status == plupload.FAILED) { + actionClass = 'plupload_failed'; + } + + if (file.status == plupload.QUEUED) { + actionClass = 'plupload_delete'; + } + + if (file.status == plupload.UPLOADING) { + actionClass = 'plupload_uploading'; + } + + var icon = $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block'); + if (file.hint) { + icon.attr('title', file.hint); + } + } + + function updateTotalProgress() { + $('span.plupload_total_status', target).html(uploader.total.percent + '%'); + $('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%'); + $('span.plupload_upload_status', target).html( + plupload.sprintf(_('Uploaded %d/%d files'), uploader.total.uploaded, uploader.files.length) + ); + } + + function updateList() { + var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML; + + $.each(uploader.files, function(i, file) { + inputHTML = ''; + + if (file.status == plupload.DONE) { + if (file.target_name) { + inputHTML += ''; + } + + inputHTML += ''; + inputHTML += ''; + + inputCount++; + + $('#' + id + '_count').val(inputCount); + } + + fileList.append( + '
  • ' + + '
    ' + plupload.xmlEncode(file.name) + '
    ' + + '
    ' + + '
    ' + file.percent + '%
    ' + + '
    ' + plupload.formatSize(file.size) + '
    ' + + '
     
    ' + + inputHTML + + '
  • ' + ); + + handleStatus(file); + + $('#' + file.id + '.plupload_delete a').click(function(e) { + $('#' + file.id).remove(); + uploader.removeFile(file); + + e.preventDefault(); + }); + }); + + $('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size)); + + if (uploader.total.queued === 0) { + $('span.plupload_add_text', target).html(_('Add Files')); + } else { + $('span.plupload_add_text', target).html(plupload.sprintf(_('%d files queued'), uploader.total.queued)); + } + + $('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed)); + + // Scroll to end of file list + fileList[0].scrollTop = fileList[0].scrollHeight; + + updateTotalProgress(); + + // Re-add drag message if there is no files + if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) { + $('#' + id + '_filelist').append('
  • ' + _("Drag files here.") + '
  • '); + } + } + + function destroy() { + delete uploaders[id]; + uploader.destroy(); + target.html(contents_bak); + uploader = target = contents_bak = null; + } + + uploader.bind("UploadFile", function(up, file) { + $('#' + file.id).addClass('plupload_current_file'); + }); + + uploader.bind('Init', function(up, res) { + // Enable rename support + if (!settings.unique_names && settings.rename) { + target.on('click', '#' + id + '_filelist div.plupload_file_name span', function(e) { + var targetSpan = $(e.target), file, parts, name, ext = ""; + var fileContainer = targetSpan.closest('li'); + + if (!fileContainer.hasClass('plupload_delete')) { + return; + } + + // Get file name and split out name and extension + file = up.getFile(targetSpan.parents('li')[0].id); + name = file.name; + parts = /^(.+)(\.[^.]+)$/.exec(name); + if (parts) { + name = parts[1]; + ext = parts[2]; + } + + // Display input element + targetSpan.hide().after(''); + targetSpan.next().val(name).focus().blur(function() { + targetSpan.show().next().remove(); + }).keydown(function(e) { + var targetInput = $(this); + + if (e.keyCode == 13) { + e.preventDefault(); + + // Rename file and glue extension back on + file.name = targetInput.val() + ext; + targetSpan.text(file.name); + targetInput.blur(); + } + }); + }); + } + + $('#' + id + '_container').attr('title', 'Using runtime: ' + res.runtime); + + $('a.plupload_start', target).click(function(e) { + if (!$(this).hasClass('plupload_disabled')) { + uploader.start(); + } + + e.preventDefault(); + }); + + $('a.plupload_stop', target).click(function(e) { + e.preventDefault(); + uploader.stop(); + }); + + $('a.plupload_start', target).addClass('plupload_disabled'); + }); + + uploader.bind("Error", function(up, err) { + var file = err.file, message; + + if (file) { + message = err.message; + + if (err.details) { + message += " (" + err.details + ")"; + } + + if (err.code == plupload.FILE_SIZE_ERROR) { + alert(_("Error: File too large:") + " " + file.name); + } + + if (err.code == plupload.FILE_EXTENSION_ERROR) { + alert(_("Error: Invalid file extension:") + " " + file.name); + } + + file.hint = message; + $('#' + file.id).attr('class', 'plupload_failed').find('a').css('display', 'block').attr('title', message); + } + + if (err.code === plupload.INIT_ERROR) { + setTimeout(function() { + destroy(); + }, 1); + } + }); + + uploader.bind("PostInit", function(up) { + // features are populated only after input components are fully instantiated + if (up.settings.dragdrop && up.features.dragdrop) { + $('#' + id + '_filelist').append('
  • ' + _("Drag files here.") + '
  • '); + } + }); + + uploader.init(); + + uploader.bind('StateChanged', function() { + if (uploader.state === plupload.STARTED) { + $('li.plupload_delete a,div.plupload_buttons', target).hide(); + uploader.disableBrowse(true); + + $('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block'); + $('span.plupload_upload_status', target).html('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files'); + + if (settings.multiple_queues) { + $('span.plupload_total_status,span.plupload_total_file_size', target).show(); + } + } else { + updateList(); + $('a.plupload_stop,div.plupload_progress', target).hide(); + $('a.plupload_delete', target).css('display', 'block'); + + if (settings.multiple_queues && uploader.total.uploaded + uploader.total.failed == uploader.files.length) { + $(".plupload_buttons,.plupload_upload_status", target).css("display", "inline"); + uploader.disableBrowse(false); + + $(".plupload_start", target).addClass("plupload_disabled"); + $('span.plupload_total_status,span.plupload_total_file_size', target).hide(); + } + } + }); + + uploader.bind('FilesAdded', updateList); + + uploader.bind('FilesRemoved', function() { + // since the whole file list is redrawn for every change in the queue + // we need to scroll back to the file removal point to avoid annoying + // scrolling to the bottom bug (see #926) + var scrollTop = $('#' + id + '_filelist').scrollTop(); + updateList(); + $('#' + id + '_filelist').scrollTop(scrollTop); + }); + + uploader.bind('FileUploaded', function(up, file) { + handleStatus(file); + }); + + uploader.bind("UploadProgress", function(up, file) { + // Set file specific progress + $('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%'); + + handleStatus(file); + updateTotalProgress(); + }); + + // Call setup function + if (settings.setup) { + settings.setup(uploader); + } + }); + + return this; + } else { + // Get uploader instance for specified element + return uploaders[$(this[0]).attr('id')]; + } + }; +})(jQuery, plupload); diff --git a/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.min.js b/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.min.js new file mode 100644 index 0000000..e6aacd5 --- /dev/null +++ b/lib/javascript/plupload/js/jquery.plupload.queue/jquery.plupload.queue.min.js @@ -0,0 +1 @@ +!function (e, t) { function i(e) { return t.translate(e) || e } function s(t, s) { s.contents().each(function (t, i) { i = e(i), i.is(".plupload") || i.remove() }), s.prepend('
    ' + '
    ' + '
    ' + '
    ' + '
    ' + i("Select files") + "
    " + '
    ' + i("Add files to the upload queue and click the start button.") + "
    " + "
    " + "
    " + '
    ' + '
    ' + '
    ' + i("Filename") + "
    " + '
     
    ' + '
    ' + i("Status") + "
    " + '
    ' + i("Size") + "
    " + '
     
    ' + "
    " + '
      ' + '" + "
      " + "
      " + "
      " + '' + "
      ") } var l = {}; e.fn.pluploadQueue = function (a) { return a ? (this.each(function () { function n(i) { var s; i.status == t.DONE && (s = "plupload_done"), i.status == t.FAILED && (s = "plupload_failed"), i.status == t.QUEUED && (s = "plupload_delete"), i.status == t.UPLOADING && (s = "plupload_uploading"); var l = e("#" + i.id).attr("class", s).find("a").css("display", "block"); i.hint && l.attr("title", i.hint) } function o() { e("span.plupload_total_status", p).html(u.total.percent + "%"), e("div.plupload_progress_bar", p).css("width", u.total.percent + "%"), e("span.plupload_upload_status", p).html(t.sprintf(i("Uploaded %d/%d files"), u.total.uploaded, u.files.length)) } function r() { var s, l = e("ul.plupload_filelist", p).html(""), a = 0; e.each(u.files, function (i, o) { s = "", o.status == t.DONE && (o.target_name && (s += ''), s += '', s += '', a++, e("#" + c + "_count").val(a)), l.append('
    • ' + '
      ' + t.xmlEncode(o.name) + "
      " + '
      ' + '
      ' + o.percent + "%
      " + '
      ' + t.formatSize(o.size) + "
      " + '
       
      ' + s + "
    • "), n(o), e("#" + o.id + ".plupload_delete a").click(function (t) { e("#" + o.id).remove(), u.removeFile(o), t.preventDefault() }) }), e("span.plupload_total_file_size", p).html(t.formatSize(u.total.size)), 0 === u.total.queued ? e("span.plupload_add_text", p).html(i("Add Files")) : e("span.plupload_add_text", p).html(t.sprintf(i("%d files queued"), u.total.queued)), e("a.plupload_start", p).toggleClass("plupload_disabled", u.files.length == u.total.uploaded + u.total.failed), l[0].scrollTop = l[0].scrollHeight, o(), !u.files.length && u.features.dragdrop && u.settings.dragdrop && e("#" + c + "_filelist").append('
    • ' + i("Drag files here.") + "
    • ") } function d() { delete l[c], u.destroy(), p.html(_), u = p = _ = null } var u, p, c, _; p = e(this), c = p.attr("id"), c || (c = t.guid(), p.attr("id", c)), _ = p.html(), s(c, p), a = e.extend({ dragdrop: !0, browse_button: c + "_browse", container: c }, a), a.dragdrop && (a.drop_element = c + "_filelist"), u = new t.Uploader(a), l[c] = u, u.bind("UploadFile", function (t, i) { e("#" + i.id).addClass("plupload_current_file") }), u.bind("Init", function (t, i) { !a.unique_names && a.rename && p.on("click", "#" + c + "_filelist div.plupload_file_name span", function (i) { var s, l, a, n = e(i.target), o = "", r = n.closest("li"); r.hasClass("plupload_delete") && (s = t.getFile(n.parents("li")[0].id), a = s.name, l = /^(.+)(\.[^.]+)$/.exec(a), l && (a = l[1], o = l[2]), n.hide().after(''), n.next().val(a).focus().blur(function () { n.show().next().remove() }).keydown(function (t) { var i = e(this); 13 == t.keyCode && (t.preventDefault(), s.name = i.val() + o, n.text(s.name), i.blur()) })) }), e("#" + c + "_container").attr("title", "Using runtime: " + i.runtime), e("a.plupload_start", p).click(function (t) { e(this).hasClass("plupload_disabled") || u.start(), t.preventDefault() }), e("a.plupload_stop", p).click(function (e) { e.preventDefault(), u.stop() }), e("a.plupload_start", p).addClass("plupload_disabled") }), u.bind("Error", function (s, l) { var a, n = l.file; n && (a = l.message, l.details && (a += " (" + l.details + ")"), l.code == t.FILE_SIZE_ERROR && alert(i("Error: File too large:") + " " + n.name), l.code == t.FILE_EXTENSION_ERROR && alert(i("Error: Invalid file extension:") + " " + n.name), n.hint = a, e("#" + n.id).attr("class", "plupload_failed").find("a").css("display", "block").attr("title", a)), l.code === t.INIT_ERROR && setTimeout(function () { d() }, 1) }), u.bind("PostInit", function (t) { t.settings.dragdrop && t.features.dragdrop && e("#" + c + "_filelist").append('
    • ' + i("Drag files here.") + "
    • ") }), u.init(), u.bind("StateChanged", function () { u.state === t.STARTED ? (e("li.plupload_delete a,div.plupload_buttons", p).hide(), u.disableBrowse(!0), e("span.plupload_upload_status,div.plupload_progress,a.plupload_stop", p).css("display", "block"), e("span.plupload_upload_status", p).html("Uploaded " + u.total.uploaded + "/" + u.files.length + " files"), a.multiple_queues && e("span.plupload_total_status,span.plupload_total_file_size", p).show()) : (r(), e("a.plupload_stop,div.plupload_progress", p).hide(), e("a.plupload_delete", p).css("display", "block"), a.multiple_queues && u.total.uploaded + u.total.failed == u.files.length && (e(".plupload_buttons,.plupload_upload_status", p).css("display", "inline"), u.disableBrowse(!1), e(".plupload_start", p).addClass("plupload_disabled"), e("span.plupload_total_status,span.plupload_total_file_size", p).hide())) }), u.bind("FilesAdded", r), u.bind("FilesRemoved", function () { var t = e("#" + c + "_filelist").scrollTop(); r(), e("#" + c + "_filelist").scrollTop(t) }), u.bind("FileUploaded", function (e, t) { n(t) }), u.bind("UploadProgress", function (t, i) { e("#" + i.id + " div.plupload_file_status", p).html(i.percent + "%"), n(i), o() }), a.setup && a.setup(u) }), this) : l[e(this[0]).attr("id")] } }(jQuery, plupload); \ No newline at end of file diff --git a/lib/javascript/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css b/lib/javascript/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css new file mode 100644 index 0000000..820a65f --- /dev/null +++ b/lib/javascript/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css @@ -0,0 +1,379 @@ +/* + Plupload +------------------------------------------------------------------- */ + +.plupload_wrapper * { + box-sizing: content-box; +} + +.plupload_button { + cursor: pointer; + outline: none; +} + +.plupload_wrapper { + font: normal 11px Verdana,sans-serif; + width: 100%; + min-width: 520px; + line-height: 12px; +} + +.plupload_container { + _height: 300px; + min-height: 300px; + position: relative; +} + +.plupload_filelist_footer {border-width: 1px 0 0 0} +.plupload_file {border-width: 0 0 1px 0} +.plupload_container .plupload_header {border-width: 0 0 1px 0; position: relative;} + +.plupload_delete .ui-icon, +.plupload_done .ui-icon, +.plupload_failed .ui-icon { + cursor:pointer; +} + +.plupload_header_content { + height: 56px; + padding: 0 160px 0 60px; + position: relative; +} + +.plupload_logo { + width: 40px; + height: 40px; + background: url('../img/plupload.png') no-repeat 0 0; + position: absolute; + top: 8px; + left: 8px; +} + +.plupload_header_content_bw .plupload_logo { + background-position: -40px 0; +} + +.plupload_header_title { + font: normal 18px sans-serif; + line-height: 19px; + padding: 6px 0 3px; +} + +.plupload_header_text { + font: normal 12px sans-serif; +} + +.plupload_view_switch { + position: absolute; + right: 16px; + bottom: 8px; + margin: 0; + display: none; +} + +.plupload_view_switch .ui-button { + margin-right: -0.31em; +} + +.plupload_content { + position: absolute; + top: 86px; + bottom: 44px; + left: 0; + right: 0; + overflow-y: auto; + width: 100%; +} + +.plupload_filelist { + border-collapse: collapse; + border-left: none; + border-right: none; + margin: 0; + padding: 0; + width: 100%; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +.plupload_filelist_content { + padding: 0; + margin: 0; +} + +.plupload_cell {padding: 8px 6px;} + +.plupload_file { + list-style: none; + display: block; + position: relative; + overflow: hidden; + line-height: 12px; +} + +.plupload_file_thumb { + position: relative; + background-image: none; + background-color: #eee; +} + +.plupload_thumb_loading { + background: #eee url(../img/loading.gif) center no-repeat; +} + +.plupload_thumb_loading .plupload_file_dummy, +.plupload_thumb_embedded .plupload_file_dummy { + display: none; +} + +.plupload_file_name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.plupload_filelist_header { + border-top: none; +} + +.plupload_filelist_footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; +} + +.plupload_buttons { + position: relative; +} + +/* list view */ +.plupload_view_list .plupload_file { + border-left: none; + border-right: none; + border-top: none; + height: 29px; + width: 100% !important; + /* fix IE6 vertical white-space bug */ + _float: left; + _clear: left; +} + +.plupload_view_list div.plupload_file_size, +.plupload_view_list div.plupload_file_status, +.plupload_view_list div.plupload_file_action { + padding: 8px 6px; + position: absolute; + top: 0; + right: 0; +} + +.plupload_view_list div.plupload_file_name { + margin-right: 156px; + padding: 8px 6px; + _width: 75%; +} + +.plupload_view_list div.plupload_file_size { + right: 28px; +} + +.plupload_view_list div.plupload_file_status { + right: 82px; +} + +.plupload_view_list .plupload_file_rename { + margin-left: -2px; +} + +.plupload_view_list .plupload_file_size, +.plupload_view_list .plupload_file_status, +.plupload_filelist_footer .plupload_file_size, +.plupload_filelist_footer .plupload_file_status { + text-align: right; + width: 52px; +} + +.plupload_view_list .plupload_file_thumb { + position: absolute; + top: -999px; +} + +.plupload_view_list .plupload_file_progress { + display: none; +} + + +/* thumbs view */ +.plupload_view_thumbs .plupload_content { + top: 57px; +} + +.plupload_view_thumbs .plupload_filelist_header { + display: none; +} + +.plupload_view_thumbs .plupload_file { + padding: 6px; + margin: 10px; + border: 1px solid #fff; + float: left; +} + +.plupload_view_thumbs .plupload_file_thumb, +.plupload_view_thumbs .plupload_file_dummy { + text-align: center; + overflow: hidden; +} + +.plupload_view_thumbs .plupload_file_dummy { + font-size: 21px; + font-weight: bold; + text-transform: lowercase; + overflow: hidden; + border: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.plupload_view_thumbs div.plupload_file_action { + position: absolute; + top: 0; + right: 0; +} + +.plupload_view_thumbs div.plupload_file_name { + padding: 0; + font-weight: bold; +} + +.plupload_view_thumbs .plupload_file_rename { + padding: 1px 0; + width: 100% !important; +} + +.plupload_view_thumbs div.plupload_file_size { + font-size: 0.8em; + font-weight: normal; +} + +.plupload_view_thumbs div.plupload_file_status { + position: relative; + height: 3px; + overflow: hidden; + text-indent: -999px; + margin-bottom: 3px; +} + +.plupload_view_thumbs div.plupload_file_progress { + border: none; + height: 100%; +} + +.plupload .ui-sortable-helper, +.plupload .ui-sortable .plupload_file { + cursor:move; +} + +.plupload_file_action {width: 16px;} +.plupload_file_name { + overflow: hidden; + padding-left: 10px; +} + +.plupload_file_rename { + border: none; + font: normal 11px Verdana, sans-serif; + padding: 1px 2px; + line-height: 11px; + height: 11px; +} + +.plupload_progress {width: 60px;} +.plupload_progress_container {padding: 1px;} + + +/* Floats */ + +.plupload_right {float: right;} +.plupload_left {float: left;} +.plupload_clear,.plupload_clearer {clear: both;} +.plupload_clearer, .plupload_progress_bar { + display: block; + font-size: 0; + line-height: 0; +} +.plupload_clearer {height: 0;} + +/* Misc */ +.plupload_hidden {display: none !important;} + +.plupload_droptext { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: transparent; + text-align: center; + vertical-align: middle; + border: 0; + line-height: 160px; + display: none; +} + +.plupload_dropbox .plupload_droptext { + display: block; +} + +.plupload_files_queued .plupload_droptext { + display: none; +} + +.plupload_buttons, .plupload_upload_status {float: left} + +.plupload_message { + position: absolute; + top: -1px; + left: -1px; + height: 100%; + width: 100%; +} + +.plupload_message p { + padding:0.7em; + margin:0; +} + +.plupload_message strong { + font-weight: bold; +} + +.plupload_message i { + font-style: italic; +} + +.plupload_message p span.ui-icon { + float: left; + margin-right: 0.3em; +} + +.plupload_header_content .ui-state-error, +.plupload_header_content .ui-state-highlight { + border:none; +} + +.plupload_message_close { + position:absolute; + top:5px; + right:5px; + cursor:pointer; +} + +.plupload .ui-sortable-placeholder { + height:35px; +} diff --git a/lib/javascript/plupload/js/jquery.ui.plupload/img/loading.gif b/lib/javascript/plupload/js/jquery.ui.plupload/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..f0109d1706f7e1f26bbe6563a45e4146e5f02c45 GIT binary patch literal 4023 zcmc(ic~BE~8^?E-Y?9p#n`AeeWJ8wG9E3zfg&?4IgcL*$6$BKp9>^(PKq)FkjRIB9 z64X{LatKN|JW!NBo?;E6I>p1W9kIuaRW%jQ;pWpX* z9v|NsZtjs%Kni36z=~BXPJVH+=ewTblHyApmxg{GsykSh`B7%e`IfXoZQzYaAVX~@gTyVQ1R@X=shOsF7B=}v=KyN3mfw~?Aq4=qzf4n5`T5G2 z2)j(XgrNSMb9HH0>~RtZQ219RlIn?^%q@4wwdkJ6plCM_0{Y&Ij4>ZZx>#Quy$OSM zWn)>O3ZHYYY~nSVX?LDA6fd(9p;R)s!BLzRxKJgdP>~hpn!9c>i%+|XdE)g-8G<8| zgI(5B1jq-8Oz&ku>#D)pgTeKAvI=~kH{7iKQtqKE7B?wyjG~gxA4yY@m$4*Sscp%v zBa7NDLy>Ugtwn3S;I*G@=pS?rniI7CX6p>cT$j9HS^2+yev)8+?9SeMJ)-HV-h6Iq zp;uML*jIxyuLsW@rN8}??IZLpC|}dJ@O?=?B{gN_0aB7vM$lVc>ksrVpJW8R<+c8d z-a;3?yF^nEEeW%L^|!OTaW@qyGFOzj9ZX@0X3qf2dKcwn2PFcj3gF_yXT|YE(fon)#cC0?MfIa_M|C|a>JhA#w;2)jFxel5$*z&d zL?{e)vA%t&^d@r!DR49d;j#;5r@w+W_4T_>TIlE+wWZkqQy^&`fsiaA0g;rn% z?oc_;Rl+npfnIX3N{87rG>BpDA#U9a@zG;gu~`M5)6z|1x7K>4_*k0`?o^+$X@k2I z;+xGK4Om_G=_clA->H+e1C2}r(`|F|@nyw*x}m1m{Orc#=l|*Vr8NrML+{TmG~E<9 zgubK28g6sJKkWKe)xOS*n%9}}=fJQiayT2_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/plupload/js/jquery.ui.plupload/img/plupload.png b/lib/javascript/plupload/js/jquery.ui.plupload/img/plupload.png new file mode 100644 index 0000000000000000000000000000000000000000..6b629d012481357525e32bfc02e766221de7ecdc GIT binary patch literal 5741 zcmV-z7Lw_SP)0B+|e82jJyCpUx;{#kWHQ52i9EL*R2BO<88dw<$mds55Wk|cS|{WE|3$A8Qt zjR*ex%`>Ci{MRhw*}mo1uD^VeE$t1g_p6z4GbH3V`l=p_%ZCYzIla>ZPTsqSmHh1F zG+&;cmgfOS_%Xz{-~6XD3hBS9o~=;UZrZeo>FH_4#>Qf)?c{lm!sO)1ll1$278Vv_ zT_K-sx7%MG#a6*+5toafL^c1nKNgYot@1mCnw*hAnW~m>;U)u>AQB%<;Ba^?%345 zxqUO^HYJlDxvU_JfIfy5)iRbP+PQ)&4BY}cIkba942Bktwy}gk;Qo7-xc7m%-bI(l zzXkpck3IO-2mWHWy60t=UV3Tw^2;yBdtbrQ_BuR6$oRn)>iIR_0+Ww z+duRBzyJFe9lhSXSEsFD9jmwh z*4WQ83`@+11#;;}_Z19E_YERIr?Rqw%MC>ixk^hyfyz=8fm|$B0@i5h0;?uG8*f<4 z-Fxk>Q?m=Vty(8f2j(A<>puPW(-6L{uG_w2$BqbYFc?%$Q+N@QmX)*}1y%tp;Z>px z*@$L!yIEnOJ2zHWAI-2N+Lx3Hw(hAb<@l?X1Q zhscN!;f=5=Cqr66C^A(JQb5Q-B1mm3421-8EY1Y7%wn8iZQ#Z$RP9+F8_~+08+7?;~ zoEm;Mg0zKzDu_WsAP0;QY%Ua5<>1Ckr|_e&{n(j>j|0zv2M-bXxF(6pd9}n4LDeDE zhp5hv)Z6y#+0&d0>qEI}Q$FYvfwpbeB-894UcbTW;`DP5zhboMvRywt@l=*%iRB1S zT_-~d$q;g&DB*!c2tb12mexPu6L4)+fKShVjRbIjC$?b)Oc08YQ4q*2#8>q2_-$)3 zd&90XVeu8f>$pJNdGPtKSiO33*EQE%6XBJvt5kPXGoJRer`6r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?B6 z_wPUO>x`L5PrwN{0mlTKfD>>6jsxJ=~d^0AyjS z2mpc>K~2CH&z`G-006d%rQHAm39TA`@AbABg-0GedemZNkwQQC4L-pQ0 f|5h^!Pr&glMlK7sW@$ej00000NkvXXu0mjf!x9OV literal 0 HcmV?d00001 diff --git a/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js b/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js new file mode 100644 index 0000000..3a4f6b9 --- /dev/null +++ b/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js @@ -0,0 +1,1358 @@ +/** + * jquery.ui.plupload.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.progressbar.js + * + * Optionally: + * jquery.ui.sortable.js + */ + + /* global jQuery:true */ + +/** +jQuery UI based implementation of the Plupload API - multi-runtime file uploading API. + +To use the widget you must include _jQuery_ and _jQuery UI_ bundle (including `ui.core`, `ui.widget`, `ui.button`, +`ui.progressbar` and `ui.sortable`). + +In general the widget is designed the way that you do not usually need to do anything to it after you instantiate it. +But! You still can intervenue, to some extent, in case you need to. Although, due to the fact that widget is based on +_jQuery UI_ widget factory, there are some specifics. See examples below for more details. + +@example + +
      +

      Your browser doesn't have Flash, Silverlight or HTML5 support.

      +
      + + + +@example + // Invoking methods: + $('#uploader').plupload(options); + + // Display welcome message in the notification area + $('#uploader').plupload('notify', 'info', "This might be obvious, but you need to click 'Add Files' to add some files."); + +@example + // Subscribing to the events... + // ... on initialization: + $('#uploader').plupload({ + ... + viewchanged: function(event, args) { + // stuff ... + } + }); + // ... or after initialization + $('#uploader').on("viewchanged", function(event, args) { + // stuff ... + }); + +@class UI.Plupload +@constructor +@param {Object} settings For detailed information about each option check documentation. + @param {String} settings.url URL of the server-side upload handler. + @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. + @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. + @param {Object} [settings.filters={}] Set of file type filters. + @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` + @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {Number} [settings.filters.max_file_count=0] Limit the number of files that can reside in the queue at the same time (default is 0 - no limit). + @param {String} [settings.flash_swf_url] URL of the Flash swf. + @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. + @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. + @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. + @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. + @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. + @param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. + @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` + @param {Number} [settings.resize.width] If image is bigger, it will be resized. + @param {Number} [settings.resize.height] If image is bigger, it will be resized. + @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). + @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. + @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. + @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. + @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. + + @param {Boolean} [settings.autostart=false] Whether to auto start uploading right after file selection. + @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop. + @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue. + @param {Boolean} [settings.sortable=false] Enable ability to sort files in the queue, changing their uploading priority. + @param {Object} [settings.buttons] Control the visibility of functional buttons. + @param {Boolean} [settings.buttons.browse=true] Display browse button. + @param {Boolean} [settings.buttons.start=true] Display start button. + @param {Boolean} [settings.buttons.stop=true] Display stop button. + @param {Object} [settings.views] Control various views of the file queue. + @param {Boolean} [settings.views.list=true] Enable list view. + @param {Boolean} [settings.views.thumbs=false] Enable thumbs view. + @param {String} [settings.views.default='list'] Default view. + @param {Boolean} [settings.views.remember=true] Whether to remember the current view (requires jQuery Cookie plugin). + @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure. +*/ +;(function(window, document, plupload, o, $) { + +/** +Dispatched when the widget is initialized and ready. + +@event ready +@param {plupload.Uploader} uploader Uploader instance sending the event. +*/ + +/** +Dispatched when file dialog is closed. + +@event selected +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {Array} files Array of selected files represented by plupload.File objects +*/ + +/** +Dispatched when file dialog is closed. + +@event removed +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {Array} files Array of removed files represented by plupload.File objects +*/ + +/** +Dispatched when upload is started. + +@event started +@param {plupload.Uploader} uploader Uploader instance sending the event. +*/ + +/** +Dispatched when upload is stopped. + +@event stopped +@param {plupload.Uploader} uploader Uploader instance sending the event. +*/ + +/** +Dispatched during the upload process. + +@event progress +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {plupload.File} file File that is being uploaded (includes loaded and percent properties among others). + @param {Number} size Total file size in bytes. + @param {Number} loaded Number of bytes uploaded of the files total size. + @param {Number} percent Number of percentage uploaded of the file. +*/ + +/** +Dispatched when file is uploaded. + +@event uploaded +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {plupload.File} file File that was uploaded. + @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. +*/ + +/** +Dispatched when upload of the whole queue is complete. + +@event complete +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {Array} files Array of uploaded files represented by plupload.File objects +*/ + +/** +Dispatched when the view is changed, e.g. from `list` to `thumbs` or vice versa. + +@event viewchanged +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {String} type Current view type. +*/ + +/** +Dispatched when error of some kind is detected. + +@event error +@param {plupload.Uploader} uploader Uploader instance sending the event. +@param {String} error Error message. +@param {plupload.File} file File that was uploaded. + @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. +*/ + +var uploaders = {}; + +function _(str) { + return plupload.translate(str) || str; +} + +function renderUI(obj) { + obj.id = obj.attr('id'); + + obj.html( + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + _("Select files") + '
      ' + + '
      ' + _("Add files to the upload queue and click the start button.") + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
      ' + _('Filename') + '' + _('Status') + '' + _('Size') + ' 
      ' + + + '
      ' + + '
      ' + _("Drag files here.") + '
      ' + + '
      ' + + '
       
      ' + + '
      ' + + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + + '
      ' + + '' + + '
      ' + ); +} + + +$.widget("ui.plupload", { + + widgetEventPrefix: '', + + contents_bak: '', + + options: { + browse_button_hover: 'ui-state-hover', + browse_button_active: 'ui-state-active', + + filters: {}, + + // widget specific + buttons: { + browse: true, + start: true, + stop: true + }, + + views: { + list: true, + thumbs: false, + active: 'list', + remember: true // requires: https://github.com/carhartl/jquery-cookie, otherwise disabled even if set to true + }, + + thumb_width: 100, + thumb_height: 60, + + multiple_queues: true, // re-use widget by default + dragdrop : true, + autostart: false, + sortable: false, + rename: false + }, + + FILE_COUNT_ERROR: -9001, + + _create: function() { + var id = this.element.attr('id'); + if (!id) { + id = plupload.guid(); + this.element.attr('id', id); + } + this.id = id; + + // backup the elements initial state + this.contents_bak = this.element.html(); + renderUI(this.element); + + // container, just in case + this.container = $('.plupload_container', this.element).attr('id', id + '_container'); + + this.content = $('.plupload_content', this.element); + + if ($.fn.resizable) { + this.container.resizable({ + handles: 's', + minHeight: 300 + }); + } + + // list of files, may become sortable + this.filelist = $('.plupload_filelist_content', this.container) + .attr({ + id: id + '_filelist', + unselectable: 'on' + }); + + + // buttons + this.browse_button = $('.plupload_add', this.container).attr('id', id + '_browse'); + this.start_button = $('.plupload_start', this.container).attr('id', id + '_start'); + this.stop_button = $('.plupload_stop', this.container).attr('id', id + '_stop'); + this.thumbs_switcher = $('#' + id + '_view_thumbs'); + this.list_switcher = $('#' + id + '_view_list'); + + if ($.ui.button) { + this.browse_button.button({ + icons: { primary: 'ui-icon-circle-plus' }, + disabled: true + }); + + this.start_button.button({ + icons: { primary: 'ui-icon-circle-arrow-e' }, + disabled: true + }); + + this.stop_button.button({ + icons: { primary: 'ui-icon-circle-close' } + }); + + this.list_switcher.button({ + text: false, + icons: { secondary: "ui-icon-grip-dotted-horizontal" } + }); + + this.thumbs_switcher.button({ + text: false, + icons: { secondary: "ui-icon-image" } + }); + } + + // progressbar + this.progressbar = $('.plupload_progress_container', this.container); + + if ($.ui.progressbar) { + this.progressbar.progressbar(); + } + + // counter + this.counter = $('.plupload_count', this.element) + .attr({ + id: id + '_count', + name: id + '_count' + }); + + // initialize uploader instance + this._initUploader(); + }, + + _initUploader: function() { + var self = this + , id = this.id + , uploader + , options = { + container: id + '_buttons', + browse_button: id + '_browse' + } + ; + + $('.plupload_buttons', this.element).attr('id', id + '_buttons'); + + if (self.options.dragdrop) { + this.filelist.parent().attr('id', this.id + '_dropbox'); + options.drop_element = this.id + '_dropbox'; + } + + this.filelist.on('click', function(e) { + var me = $(e.target), fileContainer; + if (me.hasClass('plupload_action_icon')) { + fileContainer = me.closest('.plupload_file'); + if (fileContainer.hasClass('plupload_delete')) { + self.removeFile(fileContainer.attr('id')); + e.preventDefault(); + } + } + }); + + uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend(this.options, options)); + + // retrieve full normalized set of options + this.options = uploader.getOption(); + + if (self.options.views.thumbs) { + uploader.settings.required_features.display_media = true; + } + + // for backward compatibility + if (self.options.max_file_count) { + plupload.extend(uploader.getOption('filters'), { + max_file_count: self.options.max_file_count + }); + } + + plupload.addFileFilter('max_file_count', function(maxCount, file, cb) { + if (maxCount <= this.files.length - (this.total.uploaded + this.total.failed)) { + self.browse_button.button('disable'); + this.disableBrowse(); + + this.trigger('Error', { + code : self.FILE_COUNT_ERROR, + message : _("File count error."), + file : file + }); + cb(false); + } else { + cb(true); + } + }); + + + uploader.bind('Error', function(up, err) { + var message, details = ""; + + message = '' + err.message + ''; + + switch (err.code) { + case plupload.FILE_EXTENSION_ERROR: + details = plupload.sprintf(_("File: %s"), err.file.name); + break; + + case plupload.FILE_SIZE_ERROR: + details = plupload.sprintf(_("File: %s, size: %d, max file size: %d"), err.file.name, plupload.formatSize(err.file.size), plupload.formatSize(plupload.parseSize(up.getOption('filters').max_file_size))); + break; + + case plupload.FILE_DUPLICATE_ERROR: + details = plupload.sprintf(_("%s already present in the queue."), err.file.name); + break; + + case self.FILE_COUNT_ERROR: + details = plupload.sprintf(_("Upload element accepts only %d file(s) at a time. Extra files were stripped."), up.getOption('filters').max_file_count || 0); + break; + + case plupload.IMAGE_FORMAT_ERROR : + details = _("Image format either wrong or not supported."); + break; + + case plupload.IMAGE_MEMORY_ERROR : + details = _("Runtime ran out of available memory."); + break; + + /* // This needs a review + case plupload.IMAGE_DIMENSIONS_ERROR : + details = plupload.sprintf(_('Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.'), up.runtime, up.features.maxWidth, up.features.maxHeight); + break; */ + + case plupload.HTTP_ERROR: + details = _("Upload URL might be wrong or doesn't exist."); + break; + } + + message += "
      " + plupload.xmlEncode(details) + ""; + + self._trigger('error', null, { up: up, error: err } ); + + // do not show UI if no runtime can be initialized + if (err.code === plupload.INIT_ERROR) { + setTimeout(function() { + self.destroy(); + }, 1); + } else { + self.notify('error', message); + } + }); + + + uploader.bind('PostInit', function(up) { + // all buttons are optional, so they can be disabled and hidden + if (!self.options.buttons.browse) { + self.browse_button.button('disable').hide(); + up.disableBrowse(true); + } else { + self.browse_button.button('enable'); + } + + if (!self.options.buttons.start) { + self.start_button.button('disable').hide(); + } + + if (!self.options.buttons.stop) { + self.stop_button.button('disable').hide(); + } + + if (!self.options.unique_names && self.options.rename) { + self._enableRenaming(); + } + + if (self.options.dragdrop && up.features.dragdrop) { + self.filelist.parent().addClass('plupload_dropbox'); + } + + self._enableViewSwitcher(); + + self.start_button.click(function(e) { + if (!$(this).button('option', 'disabled')) { + self.start(); + } + e.preventDefault(); + }); + + self.stop_button.click(function(e) { + self.stop(); + e.preventDefault(); + }); + + self._trigger('ready', null, { up: up }); + }); + + // uploader internal events must run first + uploader.init(); + + uploader.bind('FileFiltered', function(up, file) { + self._addFiles(file); + }); + + uploader.bind('FilesAdded', function(up, files) { + self._trigger('selected', null, { up: up, files: files } ); + + // re-enable sortable + if (self.options.sortable && $.ui.sortable) { + self._enableSortingList(); + } + + self._trigger('updatelist', null, { filelist: self.filelist }); + + if (self.options.autostart) { + // set a little delay to make sure that QueueChanged triggered by the core has time to complete + setTimeout(function() { + self.start(); + }, 10); + } + }); + + uploader.bind('FilesRemoved', function(up, files) { + // destroy sortable if enabled + if ($.ui.sortable && self.options.sortable) { + $('tbody', self.filelist).sortable('destroy'); + } + + $.each(files, function(i, file) { + $('#' + file.id).toggle("highlight", function() { + $(this).remove(); + }); + }); + + if (up.files.length) { + // re-initialize sortable + if (self.options.sortable && $.ui.sortable) { + self._enableSortingList(); + } + } + + self._trigger('updatelist', null, { filelist: self.filelist }); + self._trigger('removed', null, { up: up, files: files } ); + }); + + uploader.bind('QueueChanged', function() { + self._handleState(); + }); + + uploader.bind('StateChanged', function(up) { + self._handleState(); + if (plupload.STARTED === up.state) { + self._trigger('started', null, { up: this.uploader }); + } else if (plupload.STOPPED === up.state) { + self._trigger('stopped', null, { up: this.uploader }); + } + }); + + uploader.bind('UploadFile', function(up, file) { + self._handleFileStatus(file); + }); + + uploader.bind('FileUploaded', function(up, file, result) { + self._handleFileStatus(file); + self._trigger('uploaded', null, { up: up, file: file, result: result } ); + }); + + uploader.bind('UploadProgress', function(up, file) { + self._handleFileStatus(file); + self._updateTotalProgress(); + self._trigger('progress', null, { up: up, file: file } ); + }); + + uploader.bind('UploadComplete', function(up, files) { + self._addFormFields(); + self._trigger('complete', null, { up: up, files: files } ); + }); + }, + + + _setOption: function(key, value) { + var self = this; + + if (key == 'buttons' && typeof(value) == 'object') { + value = $.extend(self.options.buttons, value); + + if (!value.browse) { + self.browse_button.button('disable').hide(); + self.uploader.disableBrowse(true); + } else { + self.browse_button.button('enable').show(); + self.uploader.disableBrowse(false); + } + + if (!value.start) { + self.start_button.button('disable').hide(); + } else { + self.start_button.button('enable').show(); + } + + if (!value.stop) { + self.stop_button.button('disable').hide(); + } else { + self.start_button.button('enable').show(); + } + } + + self.uploader.setOption(key, value); + }, + + + /** + Start upload. Triggers `start` event. + + @method start + */ + start: function() { + this.uploader.start(); + }, + + + /** + Stop upload. Triggers `stop` event. + + @method stop + */ + stop: function() { + this.uploader.stop(); + }, + + + /** + Enable browse button. + + @method enable + */ + enable: function() { + this.browse_button.button('enable'); + this.uploader.disableBrowse(false); + }, + + + /** + Disable browse button. + + @method disable + */ + disable: function() { + this.browse_button.button('disable'); + this.uploader.disableBrowse(true); + }, + + + /** + Retrieve file by its unique id. + + @method getFile + @param {String} id Unique id of the file + @return {plupload.File} + */ + getFile: function(id) { + var file; + + if (typeof id === 'number') { + file = this.uploader.files[id]; + } else { + file = this.uploader.getFile(id); + } + return file; + }, + + /** + Return array of files currently in the queue. + + @method getFiles + @return {Array} Array of files in the queue represented by plupload.File objects + */ + getFiles: function() { + return this.uploader.files; + }, + + + /** + Remove the file from the queue. + + @method removeFile + @param {plupload.File|String} file File to remove, might be specified directly or by its unique id + */ + removeFile: function(file) { + if (plupload.typeOf(file) === 'string') { + file = this.getFile(file); + } + this.uploader.removeFile(file); + }, + + + /** + Clear the file queue. + + @method clearQueue + */ + clearQueue: function() { + this.uploader.splice(); + }, + + + /** + Retrieve internal plupload.Uploader object (usually not required). + + @method getUploader + @return {plupload.Uploader} + */ + getUploader: function() { + return this.uploader; + }, + + + /** + Trigger refresh procedure, specifically browse_button re-measure and re-position operations. + Might get handy, when UI Widget is placed within the popup, that is constantly hidden and shown + again - without calling this method after each show operation, dialog trigger might get displaced + and disfunctional. + + @method refresh + */ + refresh: function() { + this.uploader.refresh(); + }, + + + /** + Display a message in notification area. + + @method notify + @param {Enum} type Type of the message, either `error` or `info` + @param {String} message The text message to display. + */ + notify: function(type, message) { + var popup = $( + '
      ' + + '' + + '

      ' + message + '

      ' + + '
      ' + ); + + popup + .addClass('ui-state-' + (type === 'error' ? 'error' : 'highlight')) + .find('p .ui-icon') + .addClass('ui-icon-' + (type === 'error' ? 'alert' : 'info')) + .end() + .find('.plupload_message_close') + .click(function() { + popup.remove(); + }) + .end(); + + $('.plupload_header', this.container).append(popup); + }, + + + /** + Destroy the widget, the uploader, free associated resources and bring back original html. + + @method destroy + */ + destroy: function() { + // destroy uploader instance + this.uploader.destroy(); + + // unbind all button events + $('.plupload_button', this.element).unbind(); + + // destroy buttons + if ($.ui.button) { + $('.plupload_add, .plupload_start, .plupload_stop', this.container) + .button('destroy'); + } + + // destroy progressbar + if ($.ui.progressbar) { + this.progressbar.progressbar('destroy'); + } + + // destroy sortable behavior + if ($.ui.sortable && this.options.sortable) { + $('tbody', this.filelist).sortable('destroy'); + } + + // restore the elements initial state + this.element + .empty() + .html(this.contents_bak); + this.contents_bak = ''; + + $.Widget.prototype.destroy.apply(this); + }, + + + _handleState: function() { + var up = this.uploader + , filesPending = up.files.length - (up.total.uploaded + up.total.failed) + , maxCount = up.getOption('filters').max_file_count || 0 + ; + + if (plupload.STARTED === up.state) { + $([]) + .add(this.stop_button) + .add('.plupload_started') + .removeClass('plupload_hidden'); + + this.start_button.button('disable'); + + if (!this.options.multiple_queues) { + this.browse_button.button('disable'); + up.disableBrowse(); + } + + $('.plupload_upload_status', this.element).html(plupload.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length)); + $('.plupload_header_content', this.element).addClass('plupload_header_content_bw'); + } + else if (plupload.STOPPED === up.state) { + $([]) + .add(this.stop_button) + .add('.plupload_started') + .addClass('plupload_hidden'); + + if (filesPending) { + this.start_button.button('enable'); + } else { + this.start_button.button('disable'); + } + + if (this.options.multiple_queues) { + $('.plupload_header_content', this.element).removeClass('plupload_header_content_bw'); + } + + // if max_file_count defined, only that many files can be queued at once + if (this.options.multiple_queues && maxCount && maxCount > filesPending) { + this.browse_button.button('enable'); + up.disableBrowse(false); + } + + this._updateTotalProgress(); + } + + if (up.total.queued === 0) { + $('.ui-button-text', this.browse_button).html(_('Add Files')); + } else { + $('.ui-button-text', this.browse_button).html(plupload.sprintf(_('%d files queued'), up.total.queued)); + } + + // have a helper class on a container expressing whether it has files queued or not + this.container.toggleClass('plupload_files_queued', up.files.length); + + up.refresh(); + }, + + + _handleFileStatus: function(file) { + var $file = $('#' + file.id), actionClass, iconClass; + + // since this method might be called asynchronously, file row might not yet be rendered + if (!$file.length) { + return; + } + + switch (file.status) { + case plupload.DONE: + actionClass = 'plupload_done'; + iconClass = 'plupload_action_icon ui-icon ui-icon-circle-check'; + break; + + case plupload.FAILED: + actionClass = 'ui-state-error plupload_failed'; + iconClass = 'plupload_action_icon ui-icon ui-icon-alert'; + break; + + case plupload.QUEUED: + actionClass = 'plupload_delete'; + iconClass = 'plupload_action_icon ui-icon ui-icon-circle-minus'; + break; + + case plupload.UPLOADING: + actionClass = 'ui-state-highlight plupload_uploading'; + iconClass = 'plupload_action_icon ui-icon ui-icon-circle-arrow-w'; + + // scroll uploading file into the view if its bottom boundary is out of it + var scroller = $('.plupload_scroll', this.container) + , scrollTop = scroller.scrollTop() + , scrollerHeight = scroller.height() + , rowOffset = $file.position().top + $file.height() + ; + + if (scrollerHeight < rowOffset) { + scroller.scrollTop(scrollTop + rowOffset - scrollerHeight); + } + + // Set file specific progress + $file + .find('.plupload_file_percent') + .html(file.percent + '%') + .end() + .find('.plupload_file_progress') + .css('width', file.percent + '%') + .end() + .find('.plupload_file_size') + .html(plupload.formatSize(file.size)); + break; + } + actionClass += ' ui-state-default plupload_file'; + + $file + .attr('class', actionClass) + .find('.plupload_action_icon') + .attr('class', iconClass); + }, + + + _updateTotalProgress: function() { + var up = this.uploader; + + // Scroll to end of file list + this.filelist[0].scrollTop = this.filelist[0].scrollHeight; + + this.progressbar.progressbar('value', up.total.percent); + + this.element + .find('.plupload_total_status') + .html(up.total.percent + '%') + .end() + .find('.plupload_total_file_size') + .html(plupload.formatSize(up.total.size)) + .end() + .find('.plupload_upload_status') + .html(plupload.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length)); + }, + + + _displayThumbs: function() { + var self = this + , tw, th // thumb width/height + , cols + , num = 0 // number of simultaneously visible thumbs + , thumbs = [] // array of thumbs to preload at any given moment + , loading = false + ; + + if (!this.options.views.thumbs) { + return; + } + + + function onLast(el, eventName, cb) { + var timer; + + el.on(eventName, function() { + clearTimeout(timer); + timer = setTimeout(function() { + clearTimeout(timer); + cb(); + }, 300); + }); + } + + + // calculate number of simultaneously visible thumbs + function measure() { + if (!tw || !th) { + var wrapper = $('.plupload_file:eq(0)', self.filelist); + tw = wrapper.outerWidth(true); + th = wrapper.outerHeight(true); + } + + var aw = self.content.width(), ah = self.content.height(); + cols = Math.floor(aw / tw); + num = cols * (Math.ceil(ah / th) + 1); + } + + + function pickThumbsToLoad() { + // calculate index of virst visible thumb + var startIdx = Math.floor(self.content.scrollTop() / th) * cols; + // get potentially visible thumbs that are not yet visible + thumbs = $('.plupload_file .plupload_file_thumb', self.filelist) + .slice(startIdx, startIdx + num) + .filter('.plupload_thumb_toload') + .get(); + } + + + function init() { + function mpl() { // measure, pick, load + if (self.view_mode !== 'thumbs') { + return; + } + measure(); + pickThumbsToLoad(); + lazyLoad(); + } + + if ($.fn.resizable) { + onLast(self.container, 'resize', mpl); + } + + onLast(self.window, 'resize', mpl); + onLast(self.content, 'scroll', mpl); + + self.element.on('viewchanged selected', mpl); + + mpl(); + } + + + function preloadThumb(file, cb) { + var img = new o.image.Image(); + var resolveUrl = o.core.utils.Url.resolveUrl; + + img.onload = function() { + var thumb = $('#' + file.id + ' .plupload_file_thumb', self.filelist); + this.embed(thumb[0], { + width: self.options.thumb_width, + height: self.options.thumb_height, + crop: true, + fit: true, + preserveHeaders: false, + swf_url: resolveUrl(self.options.flash_swf_url), + xap_url: resolveUrl(self.options.silverlight_xap_url) + }); + }; + + img.bind("embedded error", function(e) { + $('#' + file.id, self.filelist) + .find('.plupload_file_thumb') + .removeClass('plupload_thumb_loading') + .addClass('plupload_thumb_' + e.type) + ; + this.destroy(); + setTimeout(cb, 1); // detach, otherwise ui might hang (in SilverLight for example) + }); + + $('#' + file.id, self.filelist) + .find('.plupload_file_thumb') + .removeClass('plupload_thumb_toload') + .addClass('plupload_thumb_loading') + ; + img.load(file.getSource()); + } + + + function lazyLoad() { + if (self.view_mode !== 'thumbs' || loading) { + return; + } + + pickThumbsToLoad(); + if (!thumbs.length) { + return; + } + + loading = true; + + preloadThumb(self.getFile($(thumbs.shift()).closest('.plupload_file').attr('id')), function() { + loading = false; + lazyLoad(); + }); + } + + // this has to run only once to measure structures and bind listeners + this.element.on('selected', function onselected() { + self.element.off('selected', onselected); + init(); + }); + }, + + + _addFiles: function(files) { + var self = this, file_html, html = ''; + + file_html = '
    • ' + + '
      ' + + '
      {ext}
      ' + + '
      ' + + '
      ' + + '
      ' + + '{percent} ' + + '
      ' + + '
      ' + + '{name} ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {size}
      ' + + '
      ' + + '
    • '; + + if (plupload.typeOf(files) !== 'array') { + files = [files]; + } + + $.each(files, function(i, file) { + var ext = o.core.utils.Mime.getFileExtension(file.name) || 'none'; + + html += file_html.replace(/\{(\w+)\}/g, function($0, $1) { + switch ($1) { + case 'thumb_width': + case 'thumb_height': + return self.options[$1]; + + case 'size': + return plupload.formatSize(file.size); + + case 'ext': + return ext; + + default: + return plupload.xmlEncode(file[$1] || ''); + } + }); + }); + + self.filelist.append(html); + }, + + + _addFormFields: function() { + var self = this; + + // re-add from fresh + $('.plupload_file_fields', this.filelist).html(''); + + plupload.each(this.uploader.files, function(file, count) { + var fields = '' + , id = self.id + '_' + count + ; + + if (file.target_name) { + fields += ''; + } + fields += ''; + fields += ''; + + $('#' + file.id).find('.plupload_file_fields').html(fields); + }); + + this.counter.val(this.uploader.files.length); + }, + + + _viewChanged: function(view) { + // update or write a new cookie + if (this.options.views.remember && $.cookie) { + $.cookie('plupload_ui_view', view, { expires: 7, path: '/' }); + } + + // ugly fix for IE6 - make content area stretchable + if (plupload.ua.browser === 'IE' && plupload.ua.version < 7) { + this.content.attr('style', 'height:expression(document.getElementById("' + this.id + '_container' + '").clientHeight - ' + (view === 'list' ? 132 : 102) + ')'); + } + + this.container.removeClass('plupload_view_list plupload_view_thumbs').addClass('plupload_view_' + view); + this.view_mode = view; + this._trigger('viewchanged', null, { view: view }); + }, + + + _enableViewSwitcher: function() { + var self = this + , view + , switcher = $('.plupload_view_switch', this.container) + , buttons + , button + ; + + plupload.each(['list', 'thumbs'], function(view) { + if (!self.options.views[view]) { + switcher.find('[for="' + self.id + '_view_' + view + '"], #'+ self.id +'_view_' + view).remove(); + } + }); + + // check if any visible left + buttons = switcher.find('.plupload_button'); + + if (buttons.length === 1) { + switcher.hide(); + view = buttons.eq(0).data('view'); + this._viewChanged(view); + } else if ($.ui.button && buttons.length > 1) { + if (this.options.views.remember && $.cookie) { + view = $.cookie('plupload_ui_view'); + } + + // if wierd case, bail out to default + if (!~plupload.inArray(view, ['list', 'thumbs'])) { + view = this.options.views.active; + } + + switcher + .show() + .buttonset() + .find('.ui-button') + .click(function(e) { + view = $(this).data('view'); + self._viewChanged(view); + e.preventDefault(); // avoid auto scrolling to widget in IE and FF (see #850) + }); + + // if view not active - happens when switcher wasn't clicked manually + button = switcher.find('[for="' + self.id + '_view_'+view+'"]'); + if (button.length) { + button.trigger('click'); + } + } else { + switcher.show(); + this._viewChanged(this.options.views.active); + } + + // initialize thumb viewer if requested + if (this.options.views.thumbs) { + this._displayThumbs(); + } + }, + + + _enableRenaming: function() { + var self = this; + + this.filelist.dblclick(function(e) { + var nameInput, fileContainer, file, parts, name, ext = ""; + var nameSpan = $(e.target); + + if (!nameSpan.hasClass('plupload_file_name_wrapper')) { + return; + } + + fileContainer = nameSpan.closest('.plupload_file'); + if (!fileContainer.hasClass('plupload_delete')) { + return; + } + + // Get file name and split out name and extension + file = self.uploader.getFile(fileContainer[0].id); + name = file.name; + parts = /^(.+)(\.[^.]+)$/.exec(name); + if (parts) { + name = parts[1]; + ext = parts[2]; + } + + // Display input element + nameInput = $('').width(nameSpan.width()).insertAfter(nameSpan.hide()); + nameInput.val(name).blur(function() { + nameSpan.show().parent().scrollLeft(0).end().next().remove(); + }).keydown(function(e) { + var nameInput = $(this); + + if ($.inArray(e.keyCode, [13, 27]) !== -1) { + e.preventDefault(); + + // Rename file and glue extension back on + if (e.keyCode === 13) { + file.name = nameInput.val() + ext; + nameSpan.text(file.name); + } + nameInput.blur(); + } + })[0].focus(); + }); + }, + + + _enableSortingList: function() { + var self = this; + + if ($('.plupload_file', this.filelist).length < 2) { + return; + } + + // destroy sortable if enabled + $('tbody', this.filelist).sortable('destroy'); + + // enable + this.filelist.sortable({ + items: '.plupload_delete', + + cancel: 'object, .plupload_clearer', + + stop: function() { + var files = []; + + $.each($(this).sortable('toArray'), function(i, id) { + files[files.length] = self.uploader.getFile(id); + }); + + files.unshift(files.length); + files.unshift(0); + + // re-populate files array + Array.prototype.splice.apply(self.uploader.files, files); + } + }); + } +}); + +} (window, document, plupload, moxie, jQuery)); diff --git a/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.min.js b/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.min.js new file mode 100644 index 0000000..0fa5d66 --- /dev/null +++ b/lib/javascript/plupload/js/jquery.ui.plupload/jquery.ui.plupload.min.js @@ -0,0 +1 @@ +!function(e,t,i,s,n){function l(e){return i.translate(e)||e}function o(e){e.id=e.attr("id"),e.html('
      '+l("Select files")+"
      "+'
      '+l("Add files to the upload queue and click the start button.")+"
      "+'
      '+'"+'"+"
      "+"
      "+"
      "+''+""+'"+'"+'"+''+""+"
      '+l("Filename")+"'+l("Status")+"'+l("Size")+" 
      "+'
      '+'
      '+l("Drag files here.")+"
      "+'
      '+'
       
      '+"
      "+''+""+'"+''+''+''+""+""+"
      "+''+"
      ")}var a={};n.widget("ui.plupload",{widgetEventPrefix:"",contents_bak:"",options:{browse_button_hover:"ui-state-hover",browse_button_active:"ui-state-active",filters:{},buttons:{browse:!0,start:!0,stop:!0},views:{list:!0,thumbs:!1,active:"list",remember:!0},thumb_width:100,thumb_height:60,multiple_queues:!0,dragdrop:!0,autostart:!1,sortable:!1,rename:!1},FILE_COUNT_ERROR:-9001,_create:function(){var e=this.element.attr("id");e||(e=i.guid(),this.element.attr("id",e)),this.id=e,this.contents_bak=this.element.html(),o(this.element),this.container=n(".plupload_container",this.element).attr("id",e+"_container"),this.content=n(".plupload_content",this.element),n.fn.resizable&&this.container.resizable({handles:"s",minHeight:300}),this.filelist=n(".plupload_filelist_content",this.container).attr({id:e+"_filelist",unselectable:"on"}),this.browse_button=n(".plupload_add",this.container).attr("id",e+"_browse"),this.start_button=n(".plupload_start",this.container).attr("id",e+"_start"),this.stop_button=n(".plupload_stop",this.container).attr("id",e+"_stop"),this.thumbs_switcher=n("#"+e+"_view_thumbs"),this.list_switcher=n("#"+e+"_view_list"),n.ui.button&&(this.browse_button.button({icons:{primary:"ui-icon-circle-plus"},disabled:!0}),this.start_button.button({icons:{primary:"ui-icon-circle-arrow-e"},disabled:!0}),this.stop_button.button({icons:{primary:"ui-icon-circle-close"}}),this.list_switcher.button({text:!1,icons:{secondary:"ui-icon-grip-dotted-horizontal"}}),this.thumbs_switcher.button({text:!1,icons:{secondary:"ui-icon-image"}})),this.progressbar=n(".plupload_progress_container",this.container),n.ui.progressbar&&this.progressbar.progressbar(),this.counter=n(".plupload_count",this.element).attr({id:e+"_count",name:e+"_count"}),this._initUploader()},_initUploader:function(){var e,t=this,s=this.id,o={container:s+"_buttons",browse_button:s+"_browse"};n(".plupload_buttons",this.element).attr("id",s+"_buttons"),t.options.dragdrop&&(this.filelist.parent().attr("id",this.id+"_dropbox"),o.drop_element=this.id+"_dropbox"),this.filelist.on("click",function(e){var i,s=n(e.target);s.hasClass("plupload_action_icon")&&(i=s.closest(".plupload_file"),i.hasClass("plupload_delete")&&(t.removeFile(i.attr("id")),e.preventDefault()))}),e=this.uploader=a[s]=new i.Uploader(n.extend(this.options,o)),this.options=e.getOption(),t.options.views.thumbs&&(e.settings.required_features.display_media=!0),t.options.max_file_count&&i.extend(e.getOption("filters"),{max_file_count:t.options.max_file_count}),i.addFileFilter("max_file_count",function(e,i,s){e<=this.files.length-(this.total.uploaded+this.total.failed)?(t.browse_button.button("disable"),this.disableBrowse(),this.trigger("Error",{code:t.FILE_COUNT_ERROR,message:l("File count error."),file:i}),s(!1)):s(!0)}),e.bind("Error",function(e,s){var n,o="";switch(n=""+s.message+"",s.code){case i.FILE_EXTENSION_ERROR:o=i.sprintf(l("File: %s"),s.file.name);break;case i.FILE_SIZE_ERROR:o=i.sprintf(l("File: %s, size: %d, max file size: %d"),s.file.name,i.formatSize(s.file.size),i.formatSize(i.parseSize(e.getOption("filters").max_file_size)));break;case i.FILE_DUPLICATE_ERROR:o=i.sprintf(l("%s already present in the queue."),s.file.name);break;case t.FILE_COUNT_ERROR:o=i.sprintf(l("Upload element accepts only %d file(s) at a time. Extra files were stripped."),e.getOption("filters").max_file_count||0);break;case i.IMAGE_FORMAT_ERROR:o=l("Image format either wrong or not supported.");break;case i.IMAGE_MEMORY_ERROR:o=l("Runtime ran out of available memory.");break;case i.HTTP_ERROR:o=l("Upload URL might be wrong or doesn't exist.")}n+="
      "+i.xmlEncode(details)+"",t._trigger("error",null,{up:e,error:s}),s.code===i.INIT_ERROR?setTimeout(function(){t.destroy()},1):t.notify("error",n)}),e.bind("PostInit",function(e){t.options.buttons.browse?t.browse_button.button("enable"):(t.browse_button.button("disable").hide(),e.disableBrowse(!0)),t.options.buttons.start||t.start_button.button("disable").hide(),t.options.buttons.stop||t.stop_button.button("disable").hide(),!t.options.unique_names&&t.options.rename&&t._enableRenaming(),t.options.dragdrop&&e.features.dragdrop&&t.filelist.parent().addClass("plupload_dropbox"),t._enableViewSwitcher(),t.start_button.click(function(e){n(this).button("option","disabled")||t.start(),e.preventDefault()}),t.stop_button.click(function(e){t.stop(),e.preventDefault()}),t._trigger("ready",null,{up:e})}),e.init(),e.bind("FileFiltered",function(e,i){t._addFiles(i)}),e.bind("FilesAdded",function(e,i){t._trigger("selected",null,{up:e,files:i}),t.options.sortable&&n.ui.sortable&&t._enableSortingList(),t._trigger("updatelist",null,{filelist:t.filelist}),t.options.autostart&&setTimeout(function(){t.start()},10)}),e.bind("FilesRemoved",function(e,i){n.ui.sortable&&t.options.sortable&&n("tbody",t.filelist).sortable("destroy"),n.each(i,function(e,t){n("#"+t.id).toggle("highlight",function(){n(this).remove()})}),e.files.length&&t.options.sortable&&n.ui.sortable&&t._enableSortingList(),t._trigger("updatelist",null,{filelist:t.filelist}),t._trigger("removed",null,{up:e,files:i})}),e.bind("QueueChanged",function(){t._handleState()}),e.bind("StateChanged",function(e){t._handleState(),i.STARTED===e.state?t._trigger("started",null,{up:this.uploader}):i.STOPPED===e.state&&t._trigger("stopped",null,{up:this.uploader})}),e.bind("UploadFile",function(e,i){t._handleFileStatus(i)}),e.bind("FileUploaded",function(e,i,s){t._handleFileStatus(i),t._trigger("uploaded",null,{up:e,file:i,result:s})}),e.bind("UploadProgress",function(e,i){t._handleFileStatus(i),t._updateTotalProgress(),t._trigger("progress",null,{up:e,file:i})}),e.bind("UploadComplete",function(e,i){t._addFormFields(),t._trigger("complete",null,{up:e,files:i})})},_setOption:function(e,t){var i=this;"buttons"==e&&"object"==typeof t&&(t=n.extend(i.options.buttons,t),t.browse?(i.browse_button.button("enable").show(),i.uploader.disableBrowse(!1)):(i.browse_button.button("disable").hide(),i.uploader.disableBrowse(!0)),t.start?i.start_button.button("enable").show():i.start_button.button("disable").hide(),t.stop?i.start_button.button("enable").show():i.stop_button.button("disable").hide()),i.uploader.setOption(e,t)},start:function(){this.uploader.start()},stop:function(){this.uploader.stop()},enable:function(){this.browse_button.button("enable"),this.uploader.disableBrowse(!1)},disable:function(){this.browse_button.button("disable"),this.uploader.disableBrowse(!0)},getFile:function(e){var t;return t="number"==typeof e?this.uploader.files[e]:this.uploader.getFile(e)},getFiles:function(){return this.uploader.files},removeFile:function(e){"string"===i.typeOf(e)&&(e=this.getFile(e)),this.uploader.removeFile(e)},clearQueue:function(){this.uploader.splice()},getUploader:function(){return this.uploader},refresh:function(){this.uploader.refresh()},notify:function(e,t){var i=n('
      '+'

      '+t+"

      "+"
      ");i.addClass("ui-state-"+("error"===e?"error":"highlight")).find("p .ui-icon").addClass("ui-icon-"+("error"===e?"alert":"info")).end().find(".plupload_message_close").click(function(){i.remove()}).end(),n(".plupload_header",this.container).append(i)},destroy:function(){this.uploader.destroy(),n(".plupload_button",this.element).unbind(),n.ui.button&&n(".plupload_add, .plupload_start, .plupload_stop",this.container).button("destroy"),n.ui.progressbar&&this.progressbar.progressbar("destroy"),n.ui.sortable&&this.options.sortable&&n("tbody",this.filelist).sortable("destroy"),this.element.empty().html(this.contents_bak),this.contents_bak="",n.Widget.prototype.destroy.apply(this)},_handleState:function(){var e=this.uploader,t=e.files.length-(e.total.uploaded+e.total.failed),s=e.getOption("filters").max_file_count||0;i.STARTED===e.state?(n([]).add(this.stop_button).add(".plupload_started").removeClass("plupload_hidden"),this.start_button.button("disable"),this.options.multiple_queues||(this.browse_button.button("disable"),e.disableBrowse()),n(".plupload_upload_status",this.element).html(i.sprintf(l("Uploaded %d/%d files"),e.total.uploaded,e.files.length)),n(".plupload_header_content",this.element).addClass("plupload_header_content_bw")):i.STOPPED===e.state&&(n([]).add(this.stop_button).add(".plupload_started").addClass("plupload_hidden"),t?this.start_button.button("enable"):this.start_button.button("disable"),this.options.multiple_queues&&n(".plupload_header_content",this.element).removeClass("plupload_header_content_bw"),this.options.multiple_queues&&s&&s>t&&(this.browse_button.button("enable"),e.disableBrowse(!1)),this._updateTotalProgress()),0===e.total.queued?n(".ui-button-text",this.browse_button).html(l("Add Files")):n(".ui-button-text",this.browse_button).html(i.sprintf(l("%d files queued"),e.total.queued)),this.container.toggleClass("plupload_files_queued",e.files.length),e.refresh()},_handleFileStatus:function(e){var t,s,l=n("#"+e.id);if(l.length){switch(e.status){case i.DONE:t="plupload_done",s="plupload_action_icon ui-icon ui-icon-circle-check";break;case i.FAILED:t="ui-state-error plupload_failed",s="plupload_action_icon ui-icon ui-icon-alert";break;case i.QUEUED:t="plupload_delete",s="plupload_action_icon ui-icon ui-icon-circle-minus";break;case i.UPLOADING:t="ui-state-highlight plupload_uploading",s="plupload_action_icon ui-icon ui-icon-circle-arrow-w";var o=n(".plupload_scroll",this.container),a=o.scrollTop(),r=o.height(),d=l.position().top+l.height();d>r&&o.scrollTop(a+d-r),l.find(".plupload_file_percent").html(e.percent+"%").end().find(".plupload_file_progress").css("width",e.percent+"%").end().find(".plupload_file_size").html(i.formatSize(e.size))}t+=" ui-state-default plupload_file",l.attr("class",t).find(".plupload_action_icon").attr("class",s)}},_updateTotalProgress:function(){var e=this.uploader;this.filelist[0].scrollTop=this.filelist[0].scrollHeight,this.progressbar.progressbar("value",e.total.percent),this.element.find(".plupload_total_status").html(e.total.percent+"%").end().find(".plupload_total_file_size").html(i.formatSize(e.total.size)).end().find(".plupload_upload_status").html(i.sprintf(l("Uploaded %d/%d files"),e.total.uploaded,e.files.length))},_displayThumbs:function(){function e(e,t,i){var s;e.on(t,function(){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),i()},300)})}function t(){if(!r||!d){var e=n(".plupload_file:eq(0)",p.filelist);r=e.outerWidth(!0),d=e.outerHeight(!0)}var t=p.content.width(),i=p.content.height();u=Math.floor(t/r),c=u*(Math.ceil(i/d)+1)}function i(){var e=Math.floor(p.content.scrollTop()/d)*u;_=n(".plupload_file .plupload_file_thumb",p.filelist).slice(e,e+c).filter(".plupload_thumb_toload").get()}function l(){function s(){"thumbs"===p.view_mode&&(t(),i(),a())}n.fn.resizable&&e(p.container,"resize",s),e(p.window,"resize",s),e(p.content,"scroll",s),p.element.on("viewchanged selected",s),s()}function o(e,t){var i=new s.image.Image,l=s.core.utils.Url.resolveUrl;i.onload=function(){var t=n("#"+e.id+" .plupload_file_thumb",p.filelist);this.embed(t[0],{width:p.options.thumb_width,height:p.options.thumb_height,crop:!0,fit:!0,preserveHeaders:!1,swf_url:l(p.options.flash_swf_url),xap_url:l(p.options.silverlight_xap_url)})},i.bind("embedded error",function(i){n("#"+e.id,p.filelist).find(".plupload_file_thumb").removeClass("plupload_thumb_loading").addClass("plupload_thumb_"+i.type),this.destroy(),setTimeout(t,1)}),n("#"+e.id,p.filelist).find(".plupload_file_thumb").removeClass("plupload_thumb_toload").addClass("plupload_thumb_loading"),i.load(e.getSource())}function a(){"thumbs"!==p.view_mode||h||(i(),_.length&&(h=!0,o(p.getFile(n(_.shift()).closest(".plupload_file").attr("id")),function(){h=!1,a()})))}var r,d,u,p=this,c=0,_=[],h=!1;this.options.views.thumbs&&this.element.on("selected",function f(){p.element.off("selected",f),l()})},_addFiles:function(e){var t,l=this,o="";t='
    • {ext}
      {percent}
      {name}
      {size}
    • ',"array"!==i.typeOf(e)&&(e=[e]),n.each(e,function(e,n){var a=s.core.utils.Mime.getFileExtension(n.name)||"none";o+=t.replace(/\{(\w+)\}/g,function(e,t){switch(t){case"thumb_width":case"thumb_height":return l.options[t];case"size":return i.formatSize(n.size);case"ext":return a;default:return i.xmlEncode(n[t]||"")}})}),l.filelist.append(o)},_addFormFields:function(){var e=this;n(".plupload_file_fields",this.filelist).html(""),i.each(this.uploader.files,function(t,s){var l="",o=e.id+"_"+s;t.target_name&&(l+=''),l+='',l+='',n("#"+t.id).find(".plupload_file_fields").html(l)}),this.counter.val(this.uploader.files.length)},_viewChanged:function(e){this.options.views.remember&&n.cookie&&n.cookie("plupload_ui_view",e,{expires:7,path:"/"}),"IE"===i.ua.browser&&i.ua.version<7&&this.content.attr("style",'height:expression(document.getElementById("'+this.id+"_container"+'").clientHeight - '+("list"===e?132:102)+")"),this.container.removeClass("plupload_view_list plupload_view_thumbs").addClass("plupload_view_"+e),this.view_mode=e,this._trigger("viewchanged",null,{view:e})},_enableViewSwitcher:function(){var e,t,s,l=this,o=n(".plupload_view_switch",this.container);i.each(["list","thumbs"],function(e){l.options.views[e]||o.find('[for="'+l.id+"_view_"+e+'"], #'+l.id+"_view_"+e).remove()}),t=o.find(".plupload_button"),1===t.length?(o.hide(),e=t.eq(0).data("view"),this._viewChanged(e)):n.ui.button&&t.length>1?(this.options.views.remember&&n.cookie&&(e=n.cookie("plupload_ui_view")),~i.inArray(e,["list","thumbs"])||(e=this.options.views.active),o.show().buttonset().find(".ui-button").click(function(t){e=n(this).data("view"),l._viewChanged(e),t.preventDefault()}),s=o.find('[for="'+l.id+"_view_"+e+'"]'),s.length&&s.trigger("click")):(o.show(),this._viewChanged(this.options.views.active)),this.options.views.thumbs&&this._displayThumbs()},_enableRenaming:function(){var e=this;this.filelist.dblclick(function(t){var i,s,l,o,a,r="",d=n(t.target);d.hasClass("plupload_file_name_wrapper")&&(s=d.closest(".plupload_file"),s.hasClass("plupload_delete")&&(l=e.uploader.getFile(s[0].id),a=l.name,o=/^(.+)(\.[^.]+)$/.exec(a),o&&(a=o[1],r=o[2]),i=n('').width(d.width()).insertAfter(d.hide()),i.val(a).blur(function(){d.show().parent().scrollLeft(0).end().next().remove()}).keydown(function(e){var t=n(this);-1!==n.inArray(e.keyCode,[13,27])&&(e.preventDefault(),13===e.keyCode&&(l.name=t.val()+r,d.text(l.name)),t.blur())})[0].focus()))})},_enableSortingList:function(){var e=this;n(".plupload_file",this.filelist).length<2||(n("tbody",this.filelist).sortable("destroy"),this.filelist.sortable({items:".plupload_delete",cancel:"object, .plupload_clearer",stop:function(){var t=[];n.each(n(this).sortable("toArray"),function(i,s){t[t.length]=e.uploader.getFile(s)}),t.unshift(t.length),t.unshift(0),Array.prototype.splice.apply(e.uploader.files,t)}}))}})}(window,document,plupload,moxie,jQuery); \ No newline at end of file diff --git a/lib/javascript/plupload/js/moxie.js b/lib/javascript/plupload/js/moxie.js new file mode 100644 index 0000000..65f3316 --- /dev/null +++ b/lib/javascript/plupload/js/moxie.js @@ -0,0 +1,11714 @@ +;var MXI_DEBUG = true; +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.5.7 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +;(function (global, factory) { + var extract = function() { + var ctx = {}; + factory.apply(ctx, arguments); + return ctx.moxie; + }; + + if (typeof define === "function" && define.amd) { + define("moxie", [], extract); + } else if (typeof module === "object" && module.exports) { + module.exports = extract(); + } else { + global.moxie = extract(); + } +}(this || window, function() { +/** + * Compiled inline version. (Library mode) + */ + +/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ +/*globals $code */ + +(function(exports, undefined) { + "use strict"; + + var modules = {}; + + function require(ids, callback) { + var module, defs = []; + + for (var i = 0; i < ids.length; ++i) { + module = modules[ids[i]] || resolve(ids[i]); + if (!module) { + throw 'module definition dependecy not found: ' + ids[i]; + } + + defs.push(module); + } + + callback.apply(null, defs); + } + + function define(id, dependencies, definition) { + if (typeof id !== 'string') { + throw 'invalid module definition, module id must be defined and be a string'; + } + + if (dependencies === undefined) { + throw 'invalid module definition, dependencies must be specified'; + } + + if (definition === undefined) { + throw 'invalid module definition, definition function must be specified'; + } + + require(dependencies, function() { + modules[id] = definition.apply(null, arguments); + }); + } + + function defined(id) { + return !!modules[id]; + } + + function resolve(id) { + var target = exports; + var fragments = id.split(/[.\/]/); + + for (var fi = 0; fi < fragments.length; ++fi) { + if (!target[fragments[fi]]) { + return; + } + + target = target[fragments[fi]]; + } + + return target; + } + + function expose(ids) { + for (var i = 0; i < ids.length; i++) { + var target = exports; + var id = ids[i]; + var fragments = id.split(/[.\/]/); + + for (var fi = 0; fi < fragments.length - 1; ++fi) { + if (target[fragments[fi]] === undefined) { + target[fragments[fi]] = {}; + } + + target = target[fragments[fi]]; + } + + target[fragments[fragments.length - 1]] = modules[id]; + } + } + +// Included from: src/javascript/core/utils/Basic.js + +/** + * Basic.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Basic +@public +@static +*/ + +define('moxie/core/utils/Basic', [], function() { + /** + Gets the true type of the built-in object (better version of typeof). + @author Angus Croll (http://javascriptweblog.wordpress.com/) + + @method typeOf + @static + @param {Object} o Object to check. + @return {String} Object [[Class]] + */ + function typeOf(o) { + var undef; + + if (o === undef) { + return 'undefined'; + } else if (o === null) { + return 'null'; + } else if (o.nodeType) { + return 'node'; + } + + // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 + return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); + } + + /** + Extends the specified object with another object(s). + + @method extend + @static + @param {Object} target Object to extend. + @param {Object} [obj]* Multiple objects to extend with. + @return {Object} Same as target, the extended object. + */ + function extend() { + return merge(false, false, arguments); + } + + + /** + Extends the specified object with another object(s), but only if the property exists in the target. + + @method extendIf + @static + @param {Object} target Object to extend. + @param {Object} [obj]* Multiple objects to extend with. + @return {Object} Same as target, the extended object. + */ + function extendIf() { + return merge(true, false, arguments); + } + + + function extendImmutable() { + return merge(false, true, arguments); + } + + + function extendImmutableIf() { + return merge(true, true, arguments); + } + + + function clone(value) { + switch (typeOf(value)) { + case 'array': + return merge(false, true, [[], value]); + + case 'object': + return merge(false, true, [{}, value]); + + default: + return value; + } + } + + + function shallowCopy(obj) { + switch (typeOf(obj)) { + case 'array': + return Array.prototype.slice.call(obj); + + case 'object': + return extend({}, obj); + } + return obj; + } + + + function merge(strict, immutable, args) { + var undef; + var target = args[0]; + + each(args, function(arg, i) { + if (i > 0) { + each(arg, function(value, key) { + var isComplex = inArray(typeOf(value), ['array', 'object']) !== -1; + + if (value === undef || strict && target[key] === undef) { + return true; + } + + if (isComplex && immutable) { + value = shallowCopy(value); + } + + if (typeOf(target[key]) === typeOf(value) && isComplex) { + merge(strict, immutable, [target[key], value]); + } else { + target[key] = value; + } + }); + } + }); + + return target; + } + + + /** + A way to inherit one `class` from another in a consisstent way (more or less) + + @method inherit + @static + @since >1.4.1 + @param {Function} child + @param {Function} parent + @return {Function} Prepared constructor + */ + function inherit(child, parent) { + // copy over all parent properties + for (var key in parent) { + if ({}.hasOwnProperty.call(parent, key)) { + child[key] = parent[key]; + } + } + + // give child `class` a place to define its own methods + function ctor() { + this.constructor = child; + + if (MXI_DEBUG) { + var getCtorName = function(fn) { + var m = fn.toString().match(/^function\s([^\(\s]+)/); + return m ? m[1] : false; + }; + + this.ctorName = getCtorName(child); + } + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + + // keep a way to reference parent methods + child.parent = parent.prototype; + return child; + } + + + /** + Executes the callback function for each item in array/object. If you return false in the + callback it will break the loop. + + @method each + @static + @param {Object} obj Object to iterate. + @param {function} callback Callback function to execute for each item. + */ + function each(obj, callback) { + var length, key, i, undef; + + if (obj) { + try { + length = obj.length; + } catch(ex) { + length = undef; + } + + if (length === undef || typeof(length) !== 'number') { + // Loop object items + for (key in obj) { + if (obj.hasOwnProperty(key)) { + if (callback(obj[key], key) === false) { + return; + } + } + } + } else { + // Loop array items + for (i = 0; i < length; i++) { + if (callback(obj[i], i) === false) { + return; + } + } + } + } + } + + /** + Checks if object is empty. + + @method isEmptyObj + @static + @param {Object} o Object to check. + @return {Boolean} + */ + function isEmptyObj(obj) { + var prop; + + if (!obj || typeOf(obj) !== 'object') { + return true; + } + + for (prop in obj) { + return false; + } + + return true; + } + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + function inSeries(queue, cb) { + var i = 0, length = queue.length; + + if (typeOf(cb) !== 'function') { + cb = function() {}; + } + + if (!queue || !queue.length) { + cb(); + } + + function callNext(i) { + if (typeOf(queue[i]) === 'function') { + queue[i](function(error) { + /*jshint expr:true */ + ++i < length && !error ? callNext(i) : cb(error); + }); + } + } + callNext(i); + } + + + /** + Recieve an array of functions (usually async) to call in parallel, each function + receives a callback as first argument that it should call, when it completes. After + everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the process and invoke main callback + immediately. + + @method inParallel + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of erro + */ + function inParallel(queue, cb) { + var count = 0, num = queue.length, cbArgs = new Array(num); + + each(queue, function(fn, i) { + fn(function(error) { + if (error) { + return cb(error); + } + + var args = [].slice.call(arguments); + args.shift(); // strip error - undefined or not + + cbArgs[i] = args; + count++; + + if (count === num) { + cbArgs.unshift(null); + cb.apply(this, cbArgs); + } + }); + }); + } + + + /** + Find an element in array and return it's index if present, otherwise return -1. + + @method inArray + @static + @param {Mixed} needle Element to find + @param {Array} array + @return {Int} Index of the element, or -1 if not found + */ + function inArray(needle, array) { + if (array) { + if (Array.prototype.indexOf) { + return Array.prototype.indexOf.call(array, needle); + } + + for (var i = 0, length = array.length; i < length; i++) { + if (array[i] === needle) { + return i; + } + } + } + return -1; + } + + + /** + Returns elements of first array if they are not present in second. And false - otherwise. + + @private + @method arrayDiff + @param {Array} needles + @param {Array} array + @return {Array|Boolean} + */ + function arrayDiff(needles, array) { + var diff = []; + + if (typeOf(needles) !== 'array') { + needles = [needles]; + } + + if (typeOf(array) !== 'array') { + array = [array]; + } + + for (var i in needles) { + if (inArray(needles[i], array) === -1) { + diff.push(needles[i]); + } + } + return diff.length ? diff : false; + } + + + /** + Find intersection of two arrays. + + @private + @method arrayIntersect + @param {Array} array1 + @param {Array} array2 + @return {Array} Intersection of two arrays or null if there is none + */ + function arrayIntersect(array1, array2) { + var result = []; + each(array1, function(item) { + if (inArray(item, array2) !== -1) { + result.push(item); + } + }); + return result.length ? result : null; + } + + + /** + Forces anything into an array. + + @method toArray + @static + @param {Object} obj Object with length field. + @return {Array} Array object containing all items. + */ + function toArray(obj) { + var i, arr = []; + + for (i = 0; i < obj.length; i++) { + arr[i] = obj[i]; + } + + return arr; + } + + + /** + Generates an unique ID. The only way a user would be able to get the same ID is if the two persons + at the same exact millisecond manage to get the same 5 random numbers between 0-65535; it also uses + a counter so each ID is guaranteed to be unique for the given page. It is more probable for the earth + to be hit with an asteroid. + + @method guid + @static + @param {String} prefix to prepend (by default 'o' will be prepended). + @method guid + @return {String} Virtually unique id. + */ + var guid = (function() { + var counter = 0; + + return function(prefix) { + var guid = new Date().getTime().toString(32), i; + + for (i = 0; i < 5; i++) { + guid += Math.floor(Math.random() * 65535).toString(32); + } + + return (prefix || 'o_') + guid + (counter++).toString(32); + }; + }()); + + + /** + Trims white spaces around the string + + @method trim + @static + @param {String} str + @return {String} + */ + function trim(str) { + if (!str) { + return str; + } + return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); + } + + + /** + Parses the specified size string into a byte value. For example 10kb becomes 10240. + + @method parseSizeStr + @static + @param {String/Number} size String to parse or number to just pass through. + @return {Number} Size in bytes. + */ + function parseSizeStr(size) { + if (typeof(size) !== 'string') { + return size; + } + + var muls = { + t: 1099511627776, + g: 1073741824, + m: 1048576, + k: 1024 + }, + mul; + + size = /^([0-9\.]+)([tmgk]?)$/.exec(size.toLowerCase().replace(/[^0-9\.tmkg]/g, '')); + mul = size[2]; + size = +size[1]; + + if (muls.hasOwnProperty(mul)) { + size *= muls[mul]; + } + return Math.floor(size); + } + + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + function sprintf(str) { + var args = [].slice.call(arguments, 1); + + return str.replace(/%([a-z])/g, function($0, $1) { + var value = args.shift(); + + switch ($1) { + case 's': + return value + ''; + + case 'd': + return parseInt(value, 10); + + case 'f': + return parseFloat(value); + + case 'c': + return ''; + + default: + return value; + } + }); + } + + + + function delay(cb, timeout) { + var self = this; + setTimeout(function() { + cb.call(self); + }, timeout || 1); + } + + + return { + guid: guid, + typeOf: typeOf, + extend: extend, + extendIf: extendIf, + extendImmutable: extendImmutable, + extendImmutableIf: extendImmutableIf, + clone: clone, + inherit: inherit, + each: each, + isEmptyObj: isEmptyObj, + inSeries: inSeries, + inParallel: inParallel, + inArray: inArray, + arrayDiff: arrayDiff, + arrayIntersect: arrayIntersect, + toArray: toArray, + trim: trim, + sprintf: sprintf, + parseSizeStr: parseSizeStr, + delay: delay + }; +}); + +// Included from: src/javascript/core/utils/Encode.js + +/** + * Encode.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Encode +@public +@static +*/ + +define('moxie/core/utils/Encode', [], function() { + + /** + Encode string with UTF-8 + + @method utf8_encode + @static + @param {String} str String to encode + @return {String} UTF-8 encoded string + */ + var utf8_encode = function(str) { + return unescape(encodeURIComponent(str)); + }; + + /** + Decode UTF-8 encoded string + + @method utf8_decode + @static + @param {String} str String to decode + @return {String} Decoded string + */ + var utf8_decode = function(str_data) { + return decodeURIComponent(escape(str_data)); + }; + + /** + Decode Base64 encoded string (uses browser's default method if available), + from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js + + @method atob + @static + @param {String} data String to decode + @return {String} Decoded string + */ + var atob = function(data, utf8) { + if (typeof(window.atob) === 'function') { + return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); + } + + // http://kevin.vanzonneveld.net + // + original by: Tyler Akins (http://rumkin.com) + // + improved by: Thunder.m + // + input by: Aman Gupta + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Onno Marsman + // + bugfixed by: Pellentesque Malesuada + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Brett Zamir (http://brett-zamir.me) + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); + // * returns 1: 'Kevin van Zonneveld' + // mozilla has this native + // - but breaks in 2.0.0.12! + //if (typeof this.window.atob == 'function') { + // return atob(data); + //} + var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + dec = "", + tmp_arr = []; + + if (!data) { + return data; + } + + data += ''; + + do { // unpack four hexets into three octets using index points in b64 + h1 = b64.indexOf(data.charAt(i++)); + h2 = b64.indexOf(data.charAt(i++)); + h3 = b64.indexOf(data.charAt(i++)); + h4 = b64.indexOf(data.charAt(i++)); + + bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; + + o1 = bits >> 16 & 0xff; + o2 = bits >> 8 & 0xff; + o3 = bits & 0xff; + + if (h3 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1); + } else if (h4 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1, o2); + } else { + tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); + } + } while (i < data.length); + + dec = tmp_arr.join(''); + + return utf8 ? utf8_decode(dec) : dec; + }; + + /** + Base64 encode string (uses browser's default method if available), + from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js + + @method btoa + @static + @param {String} data String to encode + @return {String} Base64 encoded string + */ + var btoa = function(data, utf8) { + if (utf8) { + data = utf8_encode(data); + } + + if (typeof(window.btoa) === 'function') { + return window.btoa(data); + } + + // http://kevin.vanzonneveld.net + // + original by: Tyler Akins (http://rumkin.com) + // + improved by: Bayron Guevara + // + improved by: Thunder.m + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Pellentesque Malesuada + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + improved by: Rafał Kukawski (http://kukawski.pl) + // * example 1: base64_encode('Kevin van Zonneveld'); + // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' + // mozilla has this native + // - but breaks in 2.0.0.12! + var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + enc = "", + tmp_arr = []; + + if (!data) { + return data; + } + + do { // pack three octets into four hexets + o1 = data.charCodeAt(i++); + o2 = data.charCodeAt(i++); + o3 = data.charCodeAt(i++); + + bits = o1 << 16 | o2 << 8 | o3; + + h1 = bits >> 18 & 0x3f; + h2 = bits >> 12 & 0x3f; + h3 = bits >> 6 & 0x3f; + h4 = bits & 0x3f; + + // use hexets to index into b64, and append result to encoded string + tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); + } while (i < data.length); + + enc = tmp_arr.join(''); + + var r = data.length % 3; + + return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); + }; + + + return { + utf8_encode: utf8_encode, + utf8_decode: utf8_decode, + atob: atob, + btoa: btoa + }; +}); + +// Included from: src/javascript/core/utils/Env.js + +/** + * Env.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Env +@public +@static +*/ + +define("moxie/core/utils/Env", [ + "moxie/core/utils/Basic" +], function(Basic) { + + /** + * UAParser.js v0.7.7 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2015 Faisal Salman + * Dual licensed under GPLv2 & MIT + */ + var UAParser = (function (undefined) { + + ////////////// + // Constants + ///////////// + + + var EMPTY = '', + UNKNOWN = '?', + FUNC_TYPE = 'function', + UNDEF_TYPE = 'undefined', + OBJ_TYPE = 'object', + MAJOR = 'major', + MODEL = 'model', + NAME = 'name', + TYPE = 'type', + VENDOR = 'vendor', + VERSION = 'version', + ARCHITECTURE= 'architecture', + CONSOLE = 'console', + MOBILE = 'mobile', + TABLET = 'tablet'; + + + /////////// + // Helper + ////////// + + + var util = { + has : function (str1, str2) { + return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; + }, + lowerize : function (str) { + return str.toLowerCase(); + } + }; + + + /////////////// + // Map helper + ////////////// + + + var mapper = { + + rgx : function () { + + // loop through all regexes maps + for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { + + var regex = args[i], // even sequence (0,2,4,..) + props = args[i + 1]; // odd sequence (1,3,5,..) + + // construct object barebones + if (typeof(result) === UNDEF_TYPE) { + result = {}; + for (p in props) { + q = props[p]; + if (typeof(q) === OBJ_TYPE) { + result[q[0]] = undefined; + } else { + result[q] = undefined; + } + } + } + + // try matching uastring with regexes + for (j = k = 0; j < regex.length; j++) { + matches = regex[j].exec(this.getUA()); + if (!!matches) { + for (p = 0; p < props.length; p++) { + match = matches[++k]; + q = props[p]; + // check if given property is actually array + if (typeof(q) === OBJ_TYPE && q.length > 0) { + if (q.length == 2) { + if (typeof(q[1]) == FUNC_TYPE) { + // assign modified match + result[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + result[q[0]] = q[1]; + } + } else if (q.length == 3) { + // check whether function or regex + if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { + // call function (usually string mapper) + result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; + } else { + // sanitize match using given regex + result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; + } + } else if (q.length == 4) { + result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; + } + } else { + result[q] = match ? match : undefined; + } + } + break; + } + } + + if(!!matches) break; // break the loop immediately if match found + } + return result; + }, + + str : function (str, map) { + + for (var i in map) { + // check if array + if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (util.has(map[i][j], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + } else if (util.has(map[i], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + return str; + } + }; + + + /////////////// + // String map + ////////////// + + + var maps = { + + browser : { + oldsafari : { + major : { + '1' : ['/8', '/1', '/3'], + '2' : '/4', + '?' : '/' + }, + version : { + '1.0' : '/8', + '1.2' : '/1', + '1.3' : '/3', + '2.0' : '/412', + '2.0.2' : '/416', + '2.0.3' : '/417', + '2.0.4' : '/419', + '?' : '/' + } + } + }, + + device : { + sprint : { + model : { + 'Evo Shift 4G' : '7373KT' + }, + vendor : { + 'HTC' : 'APA', + 'Sprint' : 'Sprint' + } + } + }, + + os : { + windows : { + version : { + 'ME' : '4.90', + 'NT 3.11' : 'NT3.51', + 'NT 4.0' : 'NT4.0', + '2000' : 'NT 5.0', + 'XP' : ['NT 5.1', 'NT 5.2'], + 'Vista' : 'NT 6.0', + '7' : 'NT 6.1', + '8' : 'NT 6.2', + '8.1' : 'NT 6.3', + 'RT' : 'ARM' + } + } + } + }; + + + ////////////// + // Regex map + ///////////// + + + var regexes = { + + browser : [[ + + // Presto based + /(opera\smini)\/([\w\.-]+)/i, // Opera Mini + /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet + /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 + /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 + + ], [NAME, VERSION], [ + + /\s(opr)\/([\w\.]+)/i // Opera Webkit + ], [[NAME, 'Opera'], VERSION], [ + + // Mixed + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, + // Lunascape/Maxthon/Netfront/Jasmine/Blazer + + // Trident based + /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, + // Avant/IEMobile/SlimBrowser/Baidu + /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based + /(rekonq)\/([\w\.]+)*/i, // Rekonq + /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i + // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron + ], [NAME, VERSION], [ + + /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 + ], [[NAME, 'IE'], VERSION], [ + + /(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge + ], [NAME, VERSION], [ + + /(yabrowser)\/([\w\.]+)/i // Yandex + ], [[NAME, 'Yandex'], VERSION], [ + + /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon + ], [[NAME, /_/g, ' '], VERSION], [ + + /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, + // Chrome/OmniWeb/Arora/Tizen/Nokia + /(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i + // UCBrowser/QQBrowser + ], [NAME, VERSION], [ + + /(dolfin)\/([\w\.]+)/i // Dolphin + ], [[NAME, 'Dolphin'], VERSION], [ + + /((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS + ], [[NAME, 'Chrome'], VERSION], [ + + /XiaoMi\/MiuiBrowser\/([\w\.]+)/i // MIUI Browser + ], [VERSION, [NAME, 'MIUI Browser']], [ + + /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i // Android Browser + ], [VERSION, [NAME, 'Android Browser']], [ + + /FBAV\/([\w\.]+);/i // Facebook App for iOS + ], [VERSION, [NAME, 'Facebook']], [ + + /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari + ], [VERSION, [NAME, 'Mobile Safari']], [ + + /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile + ], [VERSION, NAME], [ + + /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 + ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [ + + /(konqueror)\/([\w\.]+)/i, // Konqueror + /(webkit|khtml)\/([\w\.]+)/i + ], [NAME, VERSION], [ + + // Gecko based + /(navigator|netscape)\/([\w\.-]+)/i // Netscape + ], [[NAME, 'Netscape'], VERSION], [ + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror + /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf + /(links)\s\(([\w\.]+)/i, // Links + /(gobrowser)\/?([\w\.]+)*/i, // GoBrowser + /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser + /(mosaic)[\/\s]([\w\.]+)/i // Mosaic + ], [NAME, VERSION] + ], + + engine : [[ + + /windows.+\sedge\/([\w\.]+)/i // EdgeHTML + ], [VERSION, [NAME, 'EdgeHTML']], [ + + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m + /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab + ], [NAME, VERSION], [ + + /rv\:([\w\.]+).*(gecko)/i // Gecko + ], [VERSION, NAME] + ], + + os : [[ + + // Windows based + /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) + ], [NAME, VERSION], [ + /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT + /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i + ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ + /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i + ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ + + // Mobile/Embedded OS + /\((bb)(10);/i // BlackBerry 10 + ], [[NAME, 'BlackBerry'], VERSION], [ + /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry + /(tizen)[\/\s]([\w\.]+)/i, // Tizen + /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, + // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki + /linux;.+(sailfish);/i // Sailfish OS + ], [NAME, VERSION], [ + /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian + ], [[NAME, 'Symbian'], VERSION], [ + /\((series40);/i // Series 40 + ], [NAME], [ + /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS + ], [[NAME, 'Firefox OS'], VERSION], [ + + // Console + /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation + + // GNU/Linux based + /(mint)[\/\s\(]?(\w+)*/i, // Mint + /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux + /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, + // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware + // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus + /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux + /(gnu)\s?([\w\.]+)*/i // GNU + ], [NAME, VERSION], [ + + /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS + ], [[NAME, 'Chromium OS'], VERSION],[ + + // Solaris + /(sunos)\s?([\w\.]+\d)*/i // Solaris + ], [[NAME, 'Solaris'], VERSION], [ + + // BSD based + /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly + ], [NAME, VERSION],[ + + /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS + ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ + + /(mac\sos\sx)\s?([\w\s\.]+\w)*/i, + /(macintosh|mac(?=_powerpc)\s)/i // Mac OS + ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ + + // Other + /((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris + /(haiku)\s(\w+)/i, // Haiku + /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX + /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, + // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS + /(unix)\s?([\w\.]+)*/i // UNIX + ], [NAME, VERSION] + ] + }; + + + ///////////////// + // Constructor + //////////////// + + + var UAParser = function (uastring) { + + var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); + + this.getBrowser = function () { + return mapper.rgx.apply(this, regexes.browser); + }; + this.getEngine = function () { + return mapper.rgx.apply(this, regexes.engine); + }; + this.getOS = function () { + return mapper.rgx.apply(this, regexes.os); + }; + this.getResult = function() { + return { + ua : this.getUA(), + browser : this.getBrowser(), + engine : this.getEngine(), + os : this.getOS() + }; + }; + this.getUA = function () { + return ua; + }; + this.setUA = function (uastring) { + ua = uastring; + return this; + }; + this.setUA(ua); + }; + + return UAParser; + })(); + + + function version_compare(v1, v2, operator) { + // From: http://phpjs.org/functions + // + original by: Philippe Jausions (http://pear.php.net/user/jausions) + // + original by: Aidan Lister (http://aidanlister.com/) + // + reimplemented by: Kankrelune (http://www.webfaktory.info/) + // + improved by: Brett Zamir (http://brett-zamir.me) + // + improved by: Scott Baker + // + improved by: Theriault + // * example 1: version_compare('8.2.5rc', '8.2.5a'); + // * returns 1: 1 + // * example 2: version_compare('8.2.50', '8.2.52', '<'); + // * returns 2: true + // * example 3: version_compare('5.3.0-dev', '5.3.0'); + // * returns 3: -1 + // * example 4: version_compare('4.1.0.52','4.01.0.51'); + // * returns 4: 1 + + // Important: compare must be initialized at 0. + var i = 0, + x = 0, + compare = 0, + // vm maps textual PHP versions to negatives so they're less than 0. + // PHP currently defines these as CASE-SENSITIVE. It is important to + // leave these as negatives so that they can come before numerical versions + // and as if no letters were there to begin with. + // (1alpha is < 1 and < 1.1 but > 1dev1) + // If a non-numerical value can't be mapped to this table, it receives + // -7 as its value. + vm = { + 'dev': -6, + 'alpha': -5, + 'a': -5, + 'beta': -4, + 'b': -4, + 'RC': -3, + 'rc': -3, + '#': -2, + 'p': 1, + 'pl': 1 + }, + // This function will be called to prepare each version argument. + // It replaces every _, -, and + with a dot. + // It surrounds any nonsequence of numbers/dots with dots. + // It replaces sequences of dots with a single dot. + // version_compare('4..0', '4.0') == 0 + // Important: A string of 0 length needs to be converted into a value + // even less than an unexisting value in vm (-7), hence [-8]. + // It's also important to not strip spaces because of this. + // version_compare('', ' ') == 1 + prepVersion = function (v) { + v = ('' + v).replace(/[_\-+]/g, '.'); + v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); + return (!v.length ? [-8] : v.split('.')); + }, + // This converts a version component to a number. + // Empty component becomes 0. + // Non-numerical component becomes a negative number. + // Numerical component becomes itself as an integer. + numVersion = function (v) { + return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); + }; + + v1 = prepVersion(v1); + v2 = prepVersion(v2); + x = Math.max(v1.length, v2.length); + for (i = 0; i < x; i++) { + if (v1[i] == v2[i]) { + continue; + } + v1[i] = numVersion(v1[i]); + v2[i] = numVersion(v2[i]); + if (v1[i] < v2[i]) { + compare = -1; + break; + } else if (v1[i] > v2[i]) { + compare = 1; + break; + } + } + if (!operator) { + return compare; + } + + // Important: operator is CASE-SENSITIVE. + // "No operator" seems to be treated as "<." + // Any other values seem to make the function return null. + switch (operator) { + case '>': + case 'gt': + return (compare > 0); + case '>=': + case 'ge': + return (compare >= 0); + case '<=': + case 'le': + return (compare <= 0); + case '==': + case '=': + case 'eq': + return (compare === 0); + case '<>': + case '!=': + case 'ne': + return (compare !== 0); + case '': + case '<': + case 'lt': + return (compare < 0); + default: + return null; + } + } + + + var can = (function() { + var caps = { + access_global_ns: function () { + return !!window.moxie; + }, + + define_property: (function() { + /* // currently too much extra code required, not exactly worth it + try { // as of IE8, getters/setters are supported only on DOM elements + var obj = {}; + if (Object.defineProperty) { + Object.defineProperty(obj, 'prop', { + enumerable: true, + configurable: true + }); + return true; + } + } catch(ex) {} + + if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { + return true; + }*/ + return false; + }()), + + create_canvas: function() { + // On the S60 and BB Storm, getContext exists, but always returns undefined + // so we actually have to call getContext() to verify + // github.com/Modernizr/Modernizr/issues/issue/97/ + var el = document.createElement('canvas'); + var isSupported = !!(el.getContext && el.getContext('2d')); + caps.create_canvas = isSupported; + return isSupported; + }, + + return_response_type: function(responseType) { + try { + if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { + return true; + } else if (window.XMLHttpRequest) { + var xhr = new XMLHttpRequest(); + xhr.open('get', '/'); // otherwise Gecko throws an exception + if ('responseType' in xhr) { + xhr.responseType = responseType; + // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) + if (xhr.responseType !== responseType) { + return false; + } + return true; + } + } + } catch (ex) {} + return false; + }, + + use_blob_uri: function() { + var URL = window.URL; + caps.use_blob_uri = (URL && + 'createObjectURL' in URL && + 'revokeObjectURL' in URL && + (Env.browser !== 'IE' || Env.verComp(Env.version, '11.0.46', '>=')) // IE supports createObjectURL, but not fully, for example it fails to use it as a src for the image + ); + return caps.use_blob_uri; + }, + + // ideas for this heavily come from Modernizr (http://modernizr.com/) + use_data_uri: (function() { + var du = new Image(); + + du.onload = function() { + caps.use_data_uri = (du.width === 1 && du.height === 1); + }; + + setTimeout(function() { + du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; + }, 1); + return false; + }()), + + use_data_uri_over32kb: function() { // IE8 + return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); + }, + + use_data_uri_of: function(bytes) { + return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); + }, + + use_fileinput: function() { + if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) { + return false; + } + + var el = document.createElement('input'); + el.setAttribute('type', 'file'); + return caps.use_fileinput = !el.disabled; + }, + + use_webgl: function() { + var canvas = document.createElement('canvas'); + var gl = null, isSupported; + try { + gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); + } + catch(e) {} + + if (!gl) { // it seems that sometimes it doesn't throw exception, but still fails to get context + gl = null; + } + + isSupported = !!gl; + caps.use_webgl = isSupported; // save result of our check + canvas = undefined; + return isSupported; + } + }; + + return function(cap) { + var args = [].slice.call(arguments); + args.shift(); // shift of cap + return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; + }; + }()); + + + var uaResult = new UAParser().getResult(); + + + var Env = { + can: can, + + uaParser: UAParser, + + browser: uaResult.browser.name, + version: uaResult.browser.version, + os: uaResult.os.name, // everybody intuitively types it in a lowercase for some reason + osVersion: uaResult.os.version, + + verComp: version_compare, + + swf_url: "../flash/Moxie.swf", + xap_url: "../silverlight/Moxie.xap", + global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" + }; + + // for backward compatibility + // @deprecated Use `Env.os` instead + Env.OS = Env.os; + + if (MXI_DEBUG) { + Env.debug = { + runtime: true, + events: false + }; + + Env.log = function() { + + function logObj(data) { + // TODO: this should recursively print out the object in a pretty way + console.appendChild(document.createTextNode(data + "\n")); + } + + // if debugger present, IE8 might have window.console.log method, but not be able to apply on it (why...) + if (window && window.console && window.console.log && window.console.log.apply) { + window.console.log.apply(window.console, arguments); + } else if (document) { + var console = document.getElementById('moxie-console'); + if (!console) { + console = document.createElement('pre'); + console.id = 'moxie-console'; + //console.style.display = 'none'; + document.body.appendChild(console); + } + + var data = arguments[0]; + if (Basic.typeOf(data) === 'string') { + data = Basic.sprintf.apply(this, arguments); + } else if (Basic.inArray(Basic.typeOf(data), ['object', 'array']) !== -1) { + logObj(data); + return; + } + + console.appendChild(document.createTextNode(data + "\n")); + } + }; + } + + return Env; +}); + +// Included from: src/javascript/core/Exceptions.js + +/** + * Exceptions.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/Exceptions', [ + 'moxie/core/utils/Basic' +], function(Basic) { + + function _findKey(obj, value) { + var key; + for (key in obj) { + if (obj[key] === value) { + return key; + } + } + return null; + } + + /** + @class moxie/core/Exception + */ + return { + RuntimeError: (function() { + var namecodes = { + NOT_INIT_ERR: 1, + EXCEPTION_ERR: 3, + NOT_SUPPORTED_ERR: 9, + JS_ERR: 4 + }; + + function RuntimeError(code, message) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + (message || ": RuntimeError " + this.code); + } + + Basic.extend(RuntimeError, namecodes); + RuntimeError.prototype = Error.prototype; + return RuntimeError; + }()), + + OperationNotAllowedException: (function() { + + function OperationNotAllowedException(code) { + this.code = code; + this.name = 'OperationNotAllowedException'; + } + + Basic.extend(OperationNotAllowedException, { + NOT_ALLOWED_ERR: 1 + }); + + OperationNotAllowedException.prototype = Error.prototype; + + return OperationNotAllowedException; + }()), + + ImageError: (function() { + var namecodes = { + WRONG_FORMAT: 1, + MAX_RESOLUTION_ERR: 2, + INVALID_META_ERR: 3 + }; + + function ImageError(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": ImageError " + this.code; + } + + Basic.extend(ImageError, namecodes); + ImageError.prototype = Error.prototype; + + return ImageError; + }()), + + FileException: (function() { + var namecodes = { + NOT_FOUND_ERR: 1, + SECURITY_ERR: 2, + ABORT_ERR: 3, + NOT_READABLE_ERR: 4, + ENCODING_ERR: 5, + NO_MODIFICATION_ALLOWED_ERR: 6, + INVALID_STATE_ERR: 7, + SYNTAX_ERR: 8 + }; + + function FileException(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": FileException " + this.code; + } + + Basic.extend(FileException, namecodes); + FileException.prototype = Error.prototype; + return FileException; + }()), + + DOMException: (function() { + var namecodes = { + INDEX_SIZE_ERR: 1, + DOMSTRING_SIZE_ERR: 2, + HIERARCHY_REQUEST_ERR: 3, + WRONG_DOCUMENT_ERR: 4, + INVALID_CHARACTER_ERR: 5, + NO_DATA_ALLOWED_ERR: 6, + NO_MODIFICATION_ALLOWED_ERR: 7, + NOT_FOUND_ERR: 8, + NOT_SUPPORTED_ERR: 9, + INUSE_ATTRIBUTE_ERR: 10, + INVALID_STATE_ERR: 11, + SYNTAX_ERR: 12, + INVALID_MODIFICATION_ERR: 13, + NAMESPACE_ERR: 14, + INVALID_ACCESS_ERR: 15, + VALIDATION_ERR: 16, + TYPE_MISMATCH_ERR: 17, + SECURITY_ERR: 18, + NETWORK_ERR: 19, + ABORT_ERR: 20, + URL_MISMATCH_ERR: 21, + QUOTA_EXCEEDED_ERR: 22, + TIMEOUT_ERR: 23, + INVALID_NODE_TYPE_ERR: 24, + DATA_CLONE_ERR: 25 + }; + + function DOMException(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": DOMException " + this.code; + } + + Basic.extend(DOMException, namecodes); + DOMException.prototype = Error.prototype; + return DOMException; + }()), + + EventException: (function() { + function EventException(code) { + this.code = code; + this.name = 'EventException'; + } + + Basic.extend(EventException, { + UNSPECIFIED_EVENT_TYPE_ERR: 0 + }); + + EventException.prototype = Error.prototype; + + return EventException; + }()) + }; +}); + +// Included from: src/javascript/core/utils/Dom.js + +/** + * Dom.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Dom +@public +@static +*/ + +define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { + + /** + Get DOM Element by it's id. + + @method get + @param {String} id Identifier of the DOM Element + @return {DOMElement} + */ + var get = function(id) { + if (typeof id !== 'string') { + return id; + } + return document.getElementById(id); + }; + + /** + Checks if specified DOM element has specified class. + + @method hasClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var hasClass = function(obj, name) { + if (!obj.className) { + return false; + } + + var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); + return regExp.test(obj.className); + }; + + /** + Adds specified className to specified DOM element. + + @method addClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var addClass = function(obj, name) { + if (!hasClass(obj, name)) { + obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; + } + }; + + /** + Removes specified className from specified DOM element. + + @method removeClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var removeClass = function(obj, name) { + if (obj.className) { + var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); + obj.className = obj.className.replace(regExp, function($0, $1, $2) { + return $1 === ' ' && $2 === ' ' ? ' ' : ''; + }); + } + }; + + /** + Returns a given computed style of a DOM element. + + @method getStyle + @static + @param {Object} obj DOM element like object. + @param {String} name Style you want to get from the DOM element + */ + var getStyle = function(obj, name) { + if (obj.currentStyle) { + return obj.currentStyle[name]; + } else if (window.getComputedStyle) { + return window.getComputedStyle(obj, null)[name]; + } + }; + + + /** + Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + + @method getPos + @static + @param {Element} node HTML element or element id to get x, y position from. + @param {Element} root Optional root element to stop calculations at. + @return {object} Absolute position of the specified element object with x, y fields. + */ + var getPos = function(node, root) { + var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; + + node = node; + root = root || doc.body; + + // Returns the x, y cordinate for an element on IE 6 and IE 7 + function getIEPos(node) { + var bodyElm, rect, x = 0, y = 0; + + if (node) { + rect = node.getBoundingClientRect(); + bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; + x = rect.left + bodyElm.scrollLeft; + y = rect.top + bodyElm.scrollTop; + } + + return { + x : x, + y : y + }; + } + + // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode + if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { + nodeRect = getIEPos(node); + rootRect = getIEPos(root); + + return { + x : nodeRect.x - rootRect.x, + y : nodeRect.y - rootRect.y + }; + } + + parent = node; + while (parent && parent != root && parent.nodeType) { + x += parent.offsetLeft || 0; + y += parent.offsetTop || 0; + parent = parent.offsetParent; + } + + parent = node.parentNode; + while (parent && parent != root && parent.nodeType) { + x -= parent.scrollLeft || 0; + y -= parent.scrollTop || 0; + parent = parent.parentNode; + } + + return { + x : x, + y : y + }; + }; + + /** + Returns the size of the specified node in pixels. + + @method getSize + @static + @param {Node} node Node to get the size of. + @return {Object} Object with a w and h property. + */ + var getSize = function(node) { + return { + w : node.offsetWidth || node.clientWidth, + h : node.offsetHeight || node.clientHeight + }; + }; + + return { + get: get, + hasClass: hasClass, + addClass: addClass, + removeClass: removeClass, + getStyle: getStyle, + getPos: getPos, + getSize: getSize + }; +}); + +// Included from: src/javascript/core/EventTarget.js + +/** + * EventTarget.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/EventTarget', [ + 'moxie/core/utils/Env', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic' +], function(Env, x, Basic) { + + // hash of event listeners by object uid + var eventpool = {}; + + /** + Parent object for all event dispatching components and objects + + @class moxie/core/EventTarget + @constructor EventTarget + */ + function EventTarget() { + /** + Unique id of the event dispatcher, usually overriden by children + + @property uid + @type String + */ + this.uid = Basic.guid(); + } + + + Basic.extend(EventTarget.prototype, { + + /** + Can be called from within a child in order to acquire uniqie id in automated manner + + @method init + */ + init: function() { + if (!this.uid) { + this.uid = Basic.guid('uid_'); + } + }, + + /** + Register a handler to a specific event dispatched by the object + + @method addEventListener + @param {String} type Type or basically a name of the event to subscribe to + @param {Function} fn Callback function that will be called when event happens + @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first + @param {Object} [scope=this] A scope to invoke event handler in + */ + addEventListener: function(type, fn, priority, scope) { + var self = this, list; + + // without uid no event handlers can be added, so make sure we got one + if (!this.hasOwnProperty('uid')) { + this.uid = Basic.guid('uid_'); + } + + type = Basic.trim(type); + + if (/\s/.test(type)) { + // multiple event types were passed for one handler + Basic.each(type.split(/\s+/), function(type) { + self.addEventListener(type, fn, priority, scope); + }); + return; + } + + type = type.toLowerCase(); + priority = parseInt(priority, 10) || 0; + + list = eventpool[this.uid] && eventpool[this.uid][type] || []; + list.push({fn : fn, priority : priority, scope : scope || this}); + + if (!eventpool[this.uid]) { + eventpool[this.uid] = {}; + } + eventpool[this.uid][type] = list; + }, + + /** + Check if any handlers were registered to the specified event + + @method hasEventListener + @param {String} [type] Type or basically a name of the event to check + @return {Mixed} Returns a handler if it was found and false, if - not + */ + hasEventListener: function(type) { + var list; + if (type) { + type = type.toLowerCase(); + list = eventpool[this.uid] && eventpool[this.uid][type]; + } else { + list = eventpool[this.uid]; + } + return list ? list : false; + }, + + /** + Unregister the handler from the event, or if former was not specified - unregister all handlers + + @method removeEventListener + @param {String} type Type or basically a name of the event + @param {Function} [fn] Handler to unregister + */ + removeEventListener: function(type, fn) { + var self = this, list, i; + + type = type.toLowerCase(); + + if (/\s/.test(type)) { + // multiple event types were passed for one handler + Basic.each(type.split(/\s+/), function(type) { + self.removeEventListener(type, fn); + }); + return; + } + + list = eventpool[this.uid] && eventpool[this.uid][type]; + + if (list) { + if (fn) { + for (i = list.length - 1; i >= 0; i--) { + if (list[i].fn === fn) { + list.splice(i, 1); + break; + } + } + } else { + list = []; + } + + // delete event list if it has become empty + if (!list.length) { + delete eventpool[this.uid][type]; + + // and object specific entry in a hash if it has no more listeners attached + if (Basic.isEmptyObj(eventpool[this.uid])) { + delete eventpool[this.uid]; + } + } + } + }, + + /** + Remove all event handlers from the object + + @method removeAllEventListeners + */ + removeAllEventListeners: function() { + if (eventpool[this.uid]) { + delete eventpool[this.uid]; + } + }, + + /** + Dispatch the event + + @method dispatchEvent + @param {String/Object} Type of event or event object to dispatch + @param {Mixed} [...] Variable number of arguments to be passed to a handlers + @return {Boolean} true by default and false if any handler returned false + */ + dispatchEvent: function(type) { + var uid, list, args, tmpEvt, evt = {}, result = true, undef; + + if (Basic.typeOf(type) !== 'string') { + // we can't use original object directly (because of Silverlight) + tmpEvt = type; + + if (Basic.typeOf(tmpEvt.type) === 'string') { + type = tmpEvt.type; + + if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event + evt.total = tmpEvt.total; + evt.loaded = tmpEvt.loaded; + } + evt.async = tmpEvt.async || false; + } else { + throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); + } + } + + // check if event is meant to be dispatched on an object having specific uid + if (type.indexOf('::') !== -1) { + (function(arr) { + uid = arr[0]; + type = arr[1]; + }(type.split('::'))); + } else { + uid = this.uid; + } + + type = type.toLowerCase(); + + list = eventpool[uid] && eventpool[uid][type]; + + if (list) { + // sort event list by prority + list.sort(function(a, b) { return b.priority - a.priority; }); + + args = [].slice.call(arguments); + + // first argument will be pseudo-event object + args.shift(); + evt.type = type; + args.unshift(evt); + + if (MXI_DEBUG && Env.debug.events) { + Env.log("%cEvent '%s' fired on %s", 'color: #999;', evt.type, (this.ctorName ? this.ctorName + '::' : '') + uid); + } + + // Dispatch event to all listeners + var queue = []; + Basic.each(list, function(handler) { + // explicitly set the target, otherwise events fired from shims do not get it + args[0].target = handler.scope; + // if event is marked as async, detach the handler + if (evt.async) { + queue.push(function(cb) { + setTimeout(function() { + cb(handler.fn.apply(handler.scope, args) === false); + }, 1); + }); + } else { + queue.push(function(cb) { + cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation + }); + } + }); + if (queue.length) { + Basic.inSeries(queue, function(err) { + result = !err; + }); + } + } + return result; + }, + + /** + Register a handler to the event type that will run only once + + @method bindOnce + @since >1.4.1 + @param {String} type Type or basically a name of the event to subscribe to + @param {Function} fn Callback function that will be called when event happens + @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first + @param {Object} [scope=this] A scope to invoke event handler in + */ + bindOnce: function(type, fn, priority, scope) { + var self = this; + self.bind.call(this, type, function cb() { + self.unbind(type, cb); + return fn.apply(this, arguments); + }, priority, scope); + }, + + /** + Alias for addEventListener + + @method bind + @protected + */ + bind: function() { + this.addEventListener.apply(this, arguments); + }, + + /** + Alias for removeEventListener + + @method unbind + @protected + */ + unbind: function() { + this.removeEventListener.apply(this, arguments); + }, + + /** + Alias for removeAllEventListeners + + @method unbindAll + @protected + */ + unbindAll: function() { + this.removeAllEventListeners.apply(this, arguments); + }, + + /** + Alias for dispatchEvent + + @method trigger + @protected + */ + trigger: function() { + return this.dispatchEvent.apply(this, arguments); + }, + + + /** + Handle properties of on[event] type. + + @method handleEventProps + @private + */ + handleEventProps: function(dispatches) { + var self = this; + + this.bind(dispatches.join(' '), function(e) { + var prop = 'on' + e.type.toLowerCase(); + if (Basic.typeOf(this[prop]) === 'function') { + this[prop].apply(this, arguments); + } + }); + + // object must have defined event properties, even if it doesn't make use of them + Basic.each(dispatches, function(prop) { + prop = 'on' + prop.toLowerCase(prop); + if (Basic.typeOf(self[prop]) === 'undefined') { + self[prop] = null; + } + }); + } + + }); + + + EventTarget.instance = new EventTarget(); + + return EventTarget; +}); + +// Included from: src/javascript/runtime/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/Runtime', [ + "moxie/core/utils/Env", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/EventTarget" +], function(Env, Basic, Dom, EventTarget) { + var runtimeConstructors = {}, runtimes = {}; + + /** + Common set of methods and properties for every runtime instance + + @class moxie/runtime/Runtime + + @param {Object} options + @param {String} type Sanitized name of the runtime + @param {Object} [caps] Set of capabilities that differentiate specified runtime + @param {Object} [modeCaps] Set of capabilities that do require specific operational mode + @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested + */ + function Runtime(options, type, caps, modeCaps, preferredMode) { + /** + Dispatched when runtime is initialized and ready. + Results in RuntimeInit on a connected component. + + @event Init + */ + + /** + Dispatched when runtime fails to initialize. + Results in RuntimeError on a connected component. + + @event Error + */ + + var self = this + , _shim + , _uid = Basic.guid(type + '_') + , defaultMode = preferredMode || 'browser' + ; + + options = options || {}; + + // register runtime in private hash + runtimes[_uid] = this; + + /** + Default set of capabilities, which can be redifined later by specific runtime + + @private + @property caps + @type Object + */ + caps = Basic.extend({ + // Runtime can: + // provide access to raw binary data of the file + access_binary: false, + // provide access to raw binary data of the image (image extension is optional) + access_image_binary: false, + // display binary data as thumbs for example + display_media: false, + // make cross-domain requests + do_cors: false, + // accept files dragged and dropped from the desktop + drag_and_drop: false, + // filter files in selection dialog by their extensions + filter_by_extension: true, + // resize image (and manipulate it raw data of any file in general) + resize_image: false, + // periodically report how many bytes of total in the file were uploaded (loaded) + report_upload_progress: false, + // provide access to the headers of http response + return_response_headers: false, + // support response of specific type, which should be passed as an argument + // e.g. runtime.can('return_response_type', 'blob') + return_response_type: false, + // return http status code of the response + return_status_code: true, + // send custom http header with the request + send_custom_headers: false, + // pick up the files from a dialog + select_file: false, + // select whole folder in file browse dialog + select_folder: false, + // select multiple files at once in file browse dialog + select_multiple: true, + // send raw binary data, that is generated after image resizing or manipulation of other kind + send_binary_string: false, + // send cookies with http request and therefore retain session + send_browser_cookies: true, + // send data formatted as multipart/form-data + send_multipart: true, + // slice the file or blob to smaller parts + slice_blob: false, + // upload file without preloading it to memory, stream it out directly from disk + stream_upload: false, + // programmatically trigger file browse dialog + summon_file_dialog: false, + // upload file of specific size, size should be passed as argument + // e.g. runtime.can('upload_filesize', '500mb') + upload_filesize: true, + // initiate http request with specific http method, method should be passed as argument + // e.g. runtime.can('use_http_method', 'put') + use_http_method: true + }, caps); + + + // default to the mode that is compatible with preferred caps + if (options.preferred_caps) { + defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tdefault mode: %s", defaultMode); + } + + // small extension factory here (is meant to be extended with actual extensions constructors) + _shim = (function() { + var objpool = {}; + return { + exec: function(uid, comp, fn, args) { + if (_shim[comp]) { + if (!objpool[uid]) { + objpool[uid] = { + context: this, + instance: new _shim[comp]() + }; + } + if (objpool[uid].instance[fn]) { + return objpool[uid].instance[fn].apply(this, args); + } + } + }, + + removeInstance: function(uid) { + delete objpool[uid]; + }, + + removeAllInstances: function() { + var self = this; + Basic.each(objpool, function(obj, uid) { + if (Basic.typeOf(obj.instance.destroy) === 'function') { + obj.instance.destroy.call(obj.context); + } + self.removeInstance(uid); + }); + } + }; + }()); + + + // public methods + Basic.extend(this, { + /** + Specifies whether runtime instance was initialized or not + + @property initialized + @type {Boolean} + @default false + */ + initialized: false, // shims require this flag to stop initialization retries + + /** + Unique ID of the runtime + + @property uid + @type {String} + */ + uid: _uid, + + /** + Runtime type (e.g. flash, html5, etc) + + @property type + @type {String} + */ + type: type, + + /** + Runtime (not native one) may operate in browser or client mode. + + @property mode + @private + @type {String|Boolean} current mode or false, if none possible + */ + mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), + + /** + id of the DOM container for the runtime (if available) + + @property shimid + @type {String} + */ + shimid: _uid + '_container', + + /** + Number of connected clients. If equal to zero, runtime can be destroyed + + @property clients + @type {Number} + */ + clients: 0, + + /** + Runtime initialization options + + @property options + @type {Object} + */ + options: options, + + /** + Checks if the runtime has specific capability + + @method can + @param {String} cap Name of capability to check + @param {Mixed} [value] If passed, capability should somehow correlate to the value + @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) + @return {Boolean} true if runtime has such capability and false, if - not + */ + can: function(cap, value) { + var refCaps = arguments[2] || caps; + + // if cap var is a comma-separated list of caps, convert it to object (key/value) + if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { + cap = Runtime.parseCaps(cap); + } + + if (Basic.typeOf(cap) === 'object') { + for (var key in cap) { + if (!this.can(key, cap[key], refCaps)) { + return false; + } + } + return true; + } + + // check the individual cap + if (Basic.typeOf(refCaps[cap]) === 'function') { + return refCaps[cap].call(this, value); + } else { + return (value === refCaps[cap]); + } + }, + + /** + Returns container for the runtime as DOM element + + @method getShimContainer + @return {DOMElement} + */ + getShimContainer: function() { + var container, shimContainer = Dom.get(this.shimid); + + // if no container for shim, create one + if (!shimContainer) { + container = Dom.get(this.options.container) || document.body; + + // create shim container and insert it at an absolute position into the outer container + shimContainer = document.createElement('div'); + shimContainer.id = this.shimid; + shimContainer.className = 'moxie-shim moxie-shim-' + this.type; + + Basic.extend(shimContainer.style, { + position: 'absolute', + top: '0px', + left: '0px', + width: '1px', + height: '1px', + overflow: 'hidden' + }); + + container.appendChild(shimContainer); + container = null; + } + + return shimContainer; + }, + + /** + Returns runtime as DOM element (if appropriate) + + @method getShim + @return {DOMElement} + */ + getShim: function() { + return _shim; + }, + + /** + Invokes a method within the runtime itself (might differ across the runtimes) + + @method shimExec + @param {Mixed} [] + @protected + @return {Mixed} Depends on the action and component + */ + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return self.getShim().exec.call(this, this.uid, component, action, args); + }, + + /** + Operaional interface that is used by components to invoke specific actions on the runtime + (is invoked in the scope of component) + + @method exec + @param {Mixed} []* + @protected + @return {Mixed} Depends on the action and component + */ + exec: function(component, action) { // this is called in the context of component, not runtime + var args = [].slice.call(arguments, 2); + + if (self[component] && self[component][action]) { + return self[component][action].apply(this, args); + } + return self.shimExec.apply(this, arguments); + }, + + /** + Destroys the runtime (removes all events and deletes DOM structures) + + @method destroy + */ + destroy: function() { + if (!self) { + return; // obviously already destroyed + } + + var shimContainer = Dom.get(this.shimid); + if (shimContainer) { + shimContainer.parentNode.removeChild(shimContainer); + } + + if (_shim) { + _shim.removeAllInstances(); + } + + this.unbindAll(); + delete runtimes[this.uid]; + this.uid = null; // mark this runtime as destroyed + _uid = self = _shim = shimContainer = null; + } + }); + + // once we got the mode, test against all caps + if (this.mode && options.required_caps && !this.can(options.required_caps)) { + this.mode = false; + } + } + + + /** + Default order to try different runtime types + + @property order + @type String + @static + */ + Runtime.order = 'html5,flash,silverlight,html4'; + + + /** + Retrieves runtime from private hash by it's uid + + @method getRuntime + @private + @static + @param {String} uid Unique identifier of the runtime + @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not + */ + Runtime.getRuntime = function(uid) { + return runtimes[uid] ? runtimes[uid] : false; + }; + + + /** + Register constructor for the Runtime of new (or perhaps modified) type + + @method addConstructor + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @param {Function} construct Constructor for the Runtime type + */ + Runtime.addConstructor = function(type, constructor) { + constructor.prototype = EventTarget.instance; + runtimeConstructors[type] = constructor; + }; + + + /** + Get the constructor for the specified type. + + method getConstructor + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @return {Function} Constructor for the Runtime type + */ + Runtime.getConstructor = function(type) { + return runtimeConstructors[type] || null; + }; + + + /** + Get info about the runtime (uid, type, capabilities) + + @method getInfo + @static + @param {String} uid Unique identifier of the runtime + @return {Mixed} Info object or null if runtime doesn't exist + */ + Runtime.getInfo = function(uid) { + var runtime = Runtime.getRuntime(uid); + + if (runtime) { + return { + uid: runtime.uid, + type: runtime.type, + mode: runtime.mode, + can: function() { + return runtime.can.apply(runtime, arguments); + } + }; + } + return null; + }; + + + /** + Convert caps represented by a comma-separated string to the object representation. + + @method parseCaps + @static + @param {String} capStr Comma-separated list of capabilities + @return {Object} + */ + Runtime.parseCaps = function(capStr) { + var capObj = {}; + + if (Basic.typeOf(capStr) !== 'string') { + return capStr || {}; + } + + Basic.each(capStr.split(','), function(key) { + capObj[key] = true; // we assume it to be - true + }); + + return capObj; + }; + + /** + Test the specified runtime for specific capabilities. + + @method can + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @param {String|Object} caps Set of capabilities to check + @return {Boolean} Result of the test + */ + Runtime.can = function(type, caps) { + var runtime + , constructor = Runtime.getConstructor(type) + , mode + ; + if (constructor) { + runtime = new constructor({ + required_caps: caps + }); + mode = runtime.mode; + runtime.destroy(); + return !!mode; + } + return false; + }; + + + /** + Figure out a runtime that supports specified capabilities. + + @method thatCan + @static + @param {String|Object} caps Set of capabilities to check + @param {String} [runtimeOrder] Comma-separated list of runtimes to check against + @return {String} Usable runtime identifier or null + */ + Runtime.thatCan = function(caps, runtimeOrder) { + var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); + for (var i in types) { + if (Runtime.can(types[i], caps)) { + return types[i]; + } + } + return null; + }; + + + /** + Figure out an operational mode for the specified set of capabilities. + + @method getMode + @static + @param {Object} modeCaps Set of capabilities that depend on particular runtime mode + @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for + @param {String|Boolean} [defaultMode='browser'] Default mode to use + @return {String|Boolean} Compatible operational mode + */ + Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { + var mode = null; + + if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified + defaultMode = 'browser'; + } + + if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { + // loop over required caps and check if they do require the same mode + Basic.each(requiredCaps, function(value, cap) { + if (modeCaps.hasOwnProperty(cap)) { + var capMode = modeCaps[cap](value); + + // make sure we always have an array + if (typeof(capMode) === 'string') { + capMode = [capMode]; + } + + if (!mode) { + mode = capMode; + } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { + // if cap requires conflicting mode - runtime cannot fulfill required caps + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\t\t%s: %s (conflicting mode requested: %s)", cap, value, capMode); + } + + return (mode = false); + } + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\t\t%s: %s (compatible modes: %s)", cap, value, mode); + } + }); + + if (mode) { + return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; + } else if (mode === false) { + return false; + } + } + return defaultMode; + }; + + + /** + * Third party shims (Flash and Silverlight) require global event target against which they + * will fire their events. However when moxie is not loaded to global namespace, default + * event target is not accessible and we have to create artificial ones. + * + * @method getGlobalEventTarget + * @static + * @return {String} Name of the global event target + */ + Runtime.getGlobalEventTarget = function() { + if (/^moxie\./.test(Env.global_event_dispatcher) && !Env.can('access_global_ns')) { + var uniqueCallbackName = Basic.guid('moxie_event_target_'); + + window[uniqueCallbackName] = function(e, data) { + EventTarget.instance.dispatchEvent(e, data); + }; + + Env.global_event_dispatcher = uniqueCallbackName; + } + + return Env.global_event_dispatcher; + }; + + + /** + Capability check that always returns true + + @private + @static + @return {True} + */ + Runtime.capTrue = function() { + return true; + }; + + /** + Capability check that always returns false + + @private + @static + @return {False} + */ + Runtime.capFalse = function() { + return false; + }; + + /** + Evaluate the expression to boolean value and create a function that always returns it. + + @private + @static + @param {Mixed} expr Expression to evaluate + @return {Function} Function returning the result of evaluation + */ + Runtime.capTest = function(expr) { + return function() { + return !!expr; + }; + }; + + return Runtime; +}); + +// Included from: src/javascript/runtime/RuntimeClient.js + +/** + * RuntimeClient.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/RuntimeClient', [ + 'moxie/core/utils/Env', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic', + 'moxie/runtime/Runtime' +], function(Env, x, Basic, Runtime) { + /** + Set of methods and properties, required by a component to acquire ability to connect to a runtime + + @class moxie/runtime/RuntimeClient + */ + return function RuntimeClient() { + var runtime; + + Basic.extend(this, { + /** + Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. + Increments number of clients connected to the specified runtime. + + @private + @method connectRuntime + @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites + */ + connectRuntime: function(options) { + var comp = this, ruid; + + function initialize(items) { + var type, constructor; + + // if we ran out of runtimes + if (!items.length) { + comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + runtime = null; + return; + } + + type = items.shift().toLowerCase(); + constructor = Runtime.getConstructor(type); + if (!constructor) { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Constructor for '%s' runtime is not available.", type); + } + initialize(items); + return; + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Trying runtime: %s", type); + Env.log(options); + } + + // try initializing the runtime + runtime = new constructor(options); + + runtime.bind('Init', function() { + // mark runtime as initialized + runtime.initialized = true; + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Runtime '%s' initialized", runtime.type); + } + + // jailbreak ... + setTimeout(function() { + runtime.clients++; + comp.ruid = runtime.uid; + // this will be triggered on component + comp.trigger('RuntimeInit', runtime); + }, 1); + }); + + runtime.bind('Error', function() { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Runtime '%s' failed to initialize", runtime.type); + } + + runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here + initialize(items); + }); + + runtime.bind('Exception', function(e, err) { + var message = err.name + "(#" + err.code + ")" + (err.message ? ", from: " + err.message : ''); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Runtime '%s' has thrown an exception: %s", this.type, message); + } + comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.EXCEPTION_ERR, message)); + }); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tselected mode: %s", runtime.mode); + } + + // check if runtime managed to pick-up operational mode + if (!runtime.mode) { + runtime.trigger('Error'); + return; + } + + runtime.init(); + } + + // check if a particular runtime was requested + if (Basic.typeOf(options) === 'string') { + ruid = options; + } else if (Basic.typeOf(options.ruid) === 'string') { + ruid = options.ruid; + } + + if (ruid) { + runtime = Runtime.getRuntime(ruid); + if (runtime) { + comp.ruid = ruid; + runtime.clients++; + return runtime; + } else { + // there should be a runtime and there's none - weird case + throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); + } + } + + // initialize a fresh one, that fits runtime list and required features best + initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); + }, + + + /** + Disconnects from the runtime. Decrements number of clients connected to the specified runtime. + + @private + @method disconnectRuntime + */ + disconnectRuntime: function() { + if (runtime && --runtime.clients <= 0) { + runtime.destroy(); + } + + // once the component is disconnected, it shouldn't have access to the runtime + runtime = null; + }, + + + /** + Returns the runtime to which the client is currently connected. + + @method getRuntime + @return {Runtime} Runtime or null if client is not connected + */ + getRuntime: function() { + if (runtime && runtime.uid) { + return runtime; + } + return runtime = null; // make sure we do not leave zombies rambling around + }, + + + /** + Handy shortcut to safely invoke runtime extension methods. + + @private + @method exec + @return {Mixed} Whatever runtime extension method returns + */ + exec: function() { + return runtime ? runtime.exec.apply(this, arguments) : null; + }, + + + /** + Test runtime client for specific capability + + @method can + @param {String} cap + @return {Bool} + */ + can: function(cap) { + return runtime ? runtime.can(cap) : false; + } + + }); + }; + + +}); + +// Included from: src/javascript/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/Blob', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Encode', + 'moxie/runtime/RuntimeClient' +], function(Basic, Encode, RuntimeClient) { + + var blobpool = {}; + + /** + @class moxie/file/Blob + @constructor + @param {String} ruid Unique id of the runtime, to which this blob belongs to + @param {Object} blob Object "Native" blob object, as it is represented in the runtime + */ + function Blob(ruid, blob) { + + function _sliceDetached(start, end, type) { + var blob, data = blobpool[this.uid]; + + if (Basic.typeOf(data) !== 'string' || !data.length) { + return null; // or throw exception + } + + blob = new Blob(null, { + type: type, + size: end - start + }); + blob.detach(data.substr(start, blob.size)); + + return blob; + } + + RuntimeClient.call(this); + + if (ruid) { + this.connectRuntime(ruid); + } + + if (!blob) { + blob = {}; + } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string + blob = { data: blob }; + } + + Basic.extend(this, { + + /** + Unique id of the component + + @property uid + @type {String} + */ + uid: blob.uid || Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if falsy, then runtime will have to be initialized + before this Blob can be used, modified or sent + + @property ruid + @type {String} + */ + ruid: ruid, + + /** + Size of blob + + @property size + @type {Number} + @default 0 + */ + size: blob.size || 0, + + /** + Mime type of blob + + @property type + @type {String} + @default '' + */ + type: blob.type || '', + + /** + @method slice + @param {Number} [start=0] + */ + slice: function(start, end, type) { + if (this.isDetached()) { + return _sliceDetached.apply(this, arguments); + } + return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); + }, + + /** + Returns "native" blob object (as it is represented in connected runtime) or null if not found + + @method getSource + @return {Blob} Returns "native" blob object or null if not found + */ + getSource: function() { + if (!blobpool[this.uid]) { + return null; + } + return blobpool[this.uid]; + }, + + /** + Detaches blob from any runtime that it depends on and initialize with standalone value + + @method detach + @protected + @param {DOMString} [data=''] Standalone value + */ + detach: function(data) { + if (this.ruid) { + this.getRuntime().exec.call(this, 'Blob', 'destroy'); + this.disconnectRuntime(); + this.ruid = null; + } + + data = data || ''; + + // if dataUrl, convert to binary string + if (data.substr(0, 5) == 'data:') { + var base64Offset = data.indexOf(';base64,'); + this.type = data.substring(5, base64Offset); + data = Encode.atob(data.substring(base64Offset + 8)); + } + + this.size = data.length; + + blobpool[this.uid] = data; + }, + + /** + Checks if blob is standalone (detached of any runtime) + + @method isDetached + @protected + @return {Boolean} + */ + isDetached: function() { + return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; + }, + + /** + Destroy Blob and free any resources it was using + + @method destroy + */ + destroy: function() { + this.detach(); + delete blobpool[this.uid]; + } + }); + + + if (blob.data) { + this.detach(blob.data); // auto-detach if payload has been passed + } else { + blobpool[this.uid] = blob; + } + } + + return Blob; +}); + +// Included from: src/javascript/core/I18n.js + +/** + * I18n.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/core/I18n", [ + "moxie/core/utils/Basic" +], function(Basic) { + var i18n = {}; + + /** + @class moxie/core/I18n + */ + return { + /** + * Extends the language pack object with new items. + * + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + addI18n: function(pack) { + return Basic.extend(i18n, pack); + }, + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + translate: function(str) { + return i18n[str] || str; + }, + + /** + * Shortcut for translate function + * + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + _: function(str) { + return this.translate(str); + }, + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + sprintf: function(str) { + var args = [].slice.call(arguments, 1); + + return str.replace(/%[a-z]/g, function() { + var value = args.shift(); + return Basic.typeOf(value) !== 'undefined' ? value : ''; + }); + } + }; +}); + +// Included from: src/javascript/core/utils/Mime.js + +/** + * Mime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Mime +@public +@static +*/ + +define("moxie/core/utils/Mime", [ + "moxie/core/utils/Basic", + "moxie/core/I18n" +], function(Basic, I18n) { + + var mimeData = "" + + "application/msword,doc dot," + + "application/pdf,pdf," + + "application/pgp-signature,pgp," + + "application/postscript,ps ai eps," + + "application/rtf,rtf," + + "application/vnd.ms-excel,xls xlb xlt xla," + + "application/vnd.ms-powerpoint,ppt pps pot ppa," + + "application/zip,zip," + + "application/x-shockwave-flash,swf swfl," + + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + + "application/x-javascript,js," + + "application/json,json," + + "audio/mpeg,mp3 mpga mpega mp2," + + "audio/x-wav,wav," + + "audio/x-m4a,m4a," + + "audio/ogg,oga ogg," + + "audio/aiff,aiff aif," + + "audio/flac,flac," + + "audio/aac,aac," + + "audio/ac3,ac3," + + "audio/x-ms-wma,wma," + + "image/bmp,bmp," + + "image/gif,gif," + + "image/jpeg,jpg jpeg jpe," + + "image/photoshop,psd," + + "image/png,png," + + "image/svg+xml,svg svgz," + + "image/tiff,tiff tif," + + "text/plain,asc txt text diff log," + + "text/html,htm html xhtml," + + "text/css,css," + + "text/csv,csv," + + "text/rtf,rtf," + + "video/mpeg,mpeg mpg mpe m2v," + + "video/quicktime,qt mov," + + "video/mp4,mp4," + + "video/x-m4v,m4v," + + "video/x-flv,flv," + + "video/x-ms-wmv,wmv," + + "video/avi,avi," + + "video/webm,webm," + + "video/3gpp,3gpp 3gp," + + "video/3gpp2,3g2," + + "video/vnd.rn-realvideo,rv," + + "video/ogg,ogv," + + "video/x-matroska,mkv," + + "application/vnd.oasis.opendocument.formula-template,otf," + + "application/octet-stream,exe"; + + + /** + * Map of mimes to extensions + * + * @property mimes + * @type {Object} + */ + var mimes = {}; + + /** + * Map of extensions to mimes + * + * @property extensions + * @type {Object} + */ + var extensions = {}; + + + /** + * Parses mimeData string into a mimes and extensions lookup maps. String should have the + * following format: + * + * application/msword,doc dot,application/pdf,pdf, ... + * + * so mime-type followed by comma and followed by space-separated list of associated extensions, + * then comma again and then another mime-type, etc. + * + * If invoked externally will replace override internal lookup maps with user-provided data. + * + * @method addMimeType + * @param {String} mimeData + */ + var addMimeType = function (mimeData) { + var items = mimeData.split(/,/), i, ii, ext; + + for (i = 0; i < items.length; i += 2) { + ext = items[i + 1].split(/ /); + + // extension to mime lookup + for (ii = 0; ii < ext.length; ii++) { + mimes[ext[ii]] = items[i]; + } + // mime to extension lookup + extensions[items[i]] = ext; + } + }; + + + var extList2mimes = function (filters, addMissingExtensions) { + var ext, i, ii, type, mimes = []; + + // convert extensions to mime types list + for (i = 0; i < filters.length; i++) { + ext = filters[i].extensions.toLowerCase().split(/\s*,\s*/); + + for (ii = 0; ii < ext.length; ii++) { + + // if there's an asterisk in the list, then accept attribute is not required + if (ext[ii] === '*') { + return []; + } + + type = mimes[ext[ii]]; + + // future browsers should filter by extension, finally + if (addMissingExtensions && /^\w+$/.test(ext[ii])) { + mimes.push('.' + ext[ii]); + } else if (type && Basic.inArray(type, mimes) === -1) { + mimes.push(type); + } else if (!type) { + // if we have no type in our map, then accept all + return []; + } + } + } + return mimes; + }; + + + var mimes2exts = function(mimes) { + var exts = []; + + Basic.each(mimes, function(mime) { + mime = mime.toLowerCase(); + + if (mime === '*') { + exts = []; + return false; + } + + // check if this thing looks like mime type + var m = mime.match(/^(\w+)\/(\*|\w+)$/); + if (m) { + if (m[2] === '*') { + // wildcard mime type detected + Basic.each(extensions, function(arr, mime) { + if ((new RegExp('^' + m[1] + '/')).test(mime)) { + [].push.apply(exts, extensions[mime]); + } + }); + } else if (extensions[mime]) { + [].push.apply(exts, extensions[mime]); + } + } + }); + return exts; + }; + + + var mimes2extList = function(mimes) { + var accept = [], exts = []; + + if (Basic.typeOf(mimes) === 'string') { + mimes = Basic.trim(mimes).split(/\s*,\s*/); + } + + exts = mimes2exts(mimes); + + accept.push({ + title: I18n.translate('Files'), + extensions: exts.length ? exts.join(',') : '*' + }); + + return accept; + }; + + /** + * Extract extension from the given filename + * + * @method getFileExtension + * @param {String} fileName + * @return {String} File extension + */ + var getFileExtension = function(fileName) { + var matches = fileName && fileName.match(/\.([^.]+)$/); + if (matches) { + return matches[1].toLowerCase(); + } + return ''; + }; + + + /** + * Get file mime-type from it's filename - will try to match the extension + * against internal mime-type lookup map + * + * @method getFileMime + * @param {String} fileName + * @return File mime-type if found or an empty string if not + */ + var getFileMime = function(fileName) { + return mimes[getFileExtension(fileName)] || ''; + }; + + + addMimeType(mimeData); + + return { + mimes: mimes, + extensions: extensions, + addMimeType: addMimeType, + extList2mimes: extList2mimes, + mimes2exts: mimes2exts, + mimes2extList: mimes2extList, + getFileExtension: getFileExtension, + getFileMime: getFileMime + } +}); + +// Included from: src/javascript/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileInput', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Env', + 'moxie/core/utils/Mime', + 'moxie/core/utils/Dom', + 'moxie/core/Exceptions', + 'moxie/core/EventTarget', + 'moxie/core/I18n', + 'moxie/runtime/Runtime', + 'moxie/runtime/RuntimeClient' +], function(Basic, Env, Mime, Dom, x, EventTarget, I18n, Runtime, RuntimeClient) { + /** + Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, + converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory + with _FileReader_ or uploaded to a server through _XMLHttpRequest_. + + @class moxie/file/FileInput + @constructor + @extends EventTarget + @uses RuntimeClient + @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. + @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. + @param {Array} [options.accept] Array of mime types to accept. By default accepts all. + @param {Boolean} [options.multiple=false] Enable selection of multiple files. + @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). + @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode + for _browse\_button_. + @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. + + @example +
      + Browse... +
      + + + */ + var dispatches = [ + /** + Dispatched when runtime is connected and file-picker is ready to be used. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. + Check [corresponding documentation entry](#method_refresh) for more info. + + @event refresh + @param {Object} event + */ + + /** + Dispatched when selection of files in the dialog is complete. + + @event change + @param {Object} event + */ + 'change', + + 'cancel', // TODO: might be useful + + /** + Dispatched when mouse cursor enters file-picker area. Can be used to style element + accordingly. + + @event mouseenter + @param {Object} event + */ + 'mouseenter', + + /** + Dispatched when mouse cursor leaves file-picker area. Can be used to style element + accordingly. + + @event mouseleave + @param {Object} event + */ + 'mouseleave', + + /** + Dispatched when functional mouse button is pressed on top of file-picker area. + + @event mousedown + @param {Object} event + */ + 'mousedown', + + /** + Dispatched when functional mouse button is released on top of file-picker area. + + @event mouseup + @param {Object} event + */ + 'mouseup' + ]; + + function FileInput(options) { + if (MXI_DEBUG) { + Env.log("Instantiating FileInput..."); + } + + var container, browseButton, defaults; + + // if flat argument passed it should be browse_button id + if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { + options = { browse_button : options }; + } + + // this will help us to find proper default container + browseButton = Dom.get(options.browse_button); + if (!browseButton) { + // browse button is required + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + multiple: false, + required_caps: false, + container: browseButton.parentNode || document.body + }; + + options = Basic.extend({}, defaults, options); + + // convert to object representation + if (typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + container = Dom.get(options.container); + // make sure we have container + if (!container) { + container = document.body; + } + + // make container relative, if it's not + if (Dom.getStyle(container, 'position') === 'static') { + container.style.position = 'relative'; + } + + container = browseButton = null; // IE + + RuntimeClient.call(this); + + Basic.extend(this, { + /** + Unique id of the component + + @property uid + @protected + @readOnly + @type {String} + @default UID + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @protected + @type {String} + */ + ruid: null, + + /** + Unique id of the runtime container. Useful to get hold of it for various manipulations. + + @property shimid + @protected + @type {String} + */ + shimid: null, + + /** + Array of selected moxie.file.File objects + + @property files + @type {Array} + @default null + */ + files: null, + + /** + Initializes the file-picker, connects it to runtime and dispatches event ready when done. + + @method init + */ + init: function() { + var self = this; + + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + self.shimid = runtime.shimid; + + self.bind("Ready", function() { + self.trigger("Refresh"); + }, 999); + + // re-position and resize shim container + self.bind('Refresh', function() { + var pos, size, browseButton, shimContainer, zIndex; + + browseButton = Dom.get(options.browse_button); + shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist + + if (browseButton) { + pos = Dom.getPos(browseButton, Dom.get(options.container)); + size = Dom.getSize(browseButton); + zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 0; + + if (shimContainer) { + Basic.extend(shimContainer.style, { + top: pos.y + 'px', + left: pos.x + 'px', + width: size.w + 'px', + height: size.h + 'px', + zIndex: zIndex + 1 + }); + } + } + shimContainer = browseButton = null; + }); + + runtime.exec.call(self, 'FileInput', 'init', options); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(Basic.extend({}, options, { + required_caps: { + select_file: true + } + })); + }, + + + /** + * Get current option value by its name + * + * @method getOption + * @param name + * @return {Mixed} + */ + getOption: function(name) { + return options[name]; + }, + + + /** + * Sets a new value for the option specified by name + * + * @method setOption + * @param name + * @param value + */ + setOption: function(name, value) { + if (!options.hasOwnProperty(name)) { + return; + } + + var oldValue = options[name]; + + switch (name) { + case 'accept': + if (typeof(value) === 'string') { + value = Mime.mimes2extList(value); + } + break; + + case 'container': + case 'required_caps': + throw new x.FileException(x.FileException.NO_MODIFICATION_ALLOWED_ERR); + } + + options[name] = value; + this.exec('FileInput', 'setOption', name, value); + + this.trigger('OptionChanged', name, value, oldValue); + }, + + /** + Disables file-picker element, so that it doesn't react to mouse clicks. + + @method disable + @param {Boolean} [state=true] Disable component if - true, enable if - false + */ + disable: function(state) { + var runtime = this.getRuntime(); + if (runtime) { + this.exec('FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); + } + }, + + + /** + Reposition and resize dialog trigger to match the position and size of browse_button element. + + @method refresh + */ + refresh: function() { + this.trigger("Refresh"); + }, + + + /** + Destroy component. + + @method destroy + */ + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileInput', 'destroy'); + this.disconnectRuntime(); + } + + if (Basic.typeOf(this.files) === 'array') { + // no sense in leaving associated files behind + Basic.each(this.files, function(file) { + file.destroy(); + }); + } + this.files = null; + + this.unbindAll(); + } + }); + + this.handleEventProps(dispatches); + } + + FileInput.prototype = EventTarget.instance; + + return FileInput; +}); + +// Included from: src/javascript/file/File.js + +/** + * File.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/File', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Mime', + 'moxie/file/Blob' +], function(Basic, Mime, Blob) { + /** + @class moxie/file/File + @extends Blob + @constructor + @param {String} ruid Unique id of the runtime, to which this blob belongs to + @param {Object} file Object "Native" file object, as it is represented in the runtime + */ + function File(ruid, file) { + if (!file) { // avoid extra errors in case we overlooked something + file = {}; + } + + Blob.apply(this, arguments); + + if (!this.type) { + this.type = Mime.getFileMime(file.name); + } + + // sanitize file name or generate new one + var name; + if (file.name) { + name = file.name.replace(/\\/g, '/'); + name = name.substr(name.lastIndexOf('/') + 1); + } else if (this.type) { + var prefix = this.type.split('/')[0]; + name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); + + if (Mime.extensions[this.type]) { + name += '.' + Mime.extensions[this.type][0]; // append proper extension if possible + } + } + + + Basic.extend(this, { + /** + File name + + @property name + @type {String} + @default UID + */ + name: name || Basic.guid('file_'), + + /** + Relative path to the file inside a directory + + @property relativePath + @type {String} + @default '' + */ + relativePath: '', + + /** + Date of last modification + + @property lastModifiedDate + @type {String} + @default now + */ + lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) + }); + } + + File.prototype = Blob.prototype; + + return File; +}); + +// Included from: src/javascript/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileDrop', [ + 'moxie/core/I18n', + 'moxie/core/utils/Dom', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic', + 'moxie/core/utils/Env', + 'moxie/file/File', + 'moxie/runtime/RuntimeClient', + 'moxie/core/EventTarget', + 'moxie/core/utils/Mime' +], function(I18n, Dom, x, Basic, Env, File, RuntimeClient, EventTarget, Mime) { + /** + Turn arbitrary DOM element to a drop zone accepting files. Converts selected files to _File_ objects, to be used + in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through + _XMLHttpRequest_. + + @example +
      + Drop files here +
      +
      +
      + + + + @class moxie/file/FileDrop + @constructor + @extends EventTarget + @uses RuntimeClient + @param {Object|String} options If options has typeof string, argument is considered as options.drop_zone + @param {String|DOMElement} options.drop_zone DOM Element to turn into a drop zone + @param {Array} [options.accept] Array of mime types to accept. By default accepts all + @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support + */ + var dispatches = [ + /** + Dispatched when runtime is connected and drop zone is ready to accept files. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched when dragging cursor enters the drop zone. + + @event dragenter + @param {Object} event + */ + 'dragenter', + + /** + Dispatched when dragging cursor leaves the drop zone. + + @event dragleave + @param {Object} event + */ + 'dragleave', + + /** + Dispatched when file is dropped onto the drop zone. + + @event drop + @param {Object} event + */ + 'drop', + + /** + Dispatched if error occurs. + + @event error + @param {Object} event + */ + 'error' + ]; + + function FileDrop(options) { + if (MXI_DEBUG) { + Env.log("Instantiating FileDrop..."); + } + + var self = this, defaults; + + // if flat argument passed it should be drop_zone id + if (typeof(options) === 'string') { + options = { drop_zone : options }; + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + required_caps: { + drag_and_drop: true + } + }; + + options = typeof(options) === 'object' ? Basic.extend({}, defaults, options) : defaults; + + // this will help us to find proper default container + options.container = Dom.get(options.drop_zone) || document.body; + + // make container relative, if it is not + if (Dom.getStyle(options.container, 'position') === 'static') { + options.container.style.position = 'relative'; + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + RuntimeClient.call(self); + + Basic.extend(self, { + uid: Basic.guid('uid_'), + + ruid: null, + + files: null, + + init: function() { + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + runtime.exec.call(self, 'FileDrop', 'init', options); + self.dispatchEvent('ready'); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(options); // throws RuntimeError + }, + + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileDrop', 'destroy'); + this.disconnectRuntime(); + } + this.files = null; + + this.unbindAll(); + } + }); + + this.handleEventProps(dispatches); + } + + FileDrop.prototype = EventTarget.instance; + + return FileDrop; +}); + +// Included from: src/javascript/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReader', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Encode', + 'moxie/core/Exceptions', + 'moxie/core/EventTarget', + 'moxie/file/Blob', + 'moxie/runtime/RuntimeClient' +], function(Basic, Encode, x, EventTarget, Blob, RuntimeClient) { + /** + Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) + interface. Where possible uses native FileReader, where - not falls back to shims. + + @class moxie/file/FileReader + @constructor FileReader + @extends EventTarget + @uses RuntimeClient + */ + var dispatches = [ + + /** + Dispatched when the read starts. + + @event loadstart + @param {Object} event + */ + 'loadstart', + + /** + Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). + + @event progress + @param {Object} event + */ + 'progress', + + /** + Dispatched when the read has successfully completed. + + @event load + @param {Object} event + */ + 'load', + + /** + Dispatched when the read has been aborted. For instance, by invoking the abort() method. + + @event abort + @param {Object} event + */ + 'abort', + + /** + Dispatched when the read has failed. + + @event error + @param {Object} event + */ + 'error', + + /** + Dispatched when the request has completed (either in success or failure). + + @event loadend + @param {Object} event + */ + 'loadend' + ]; + + function FileReader() { + + RuntimeClient.call(this); + + Basic.extend(this, { + /** + UID of the component instance. + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING + and FileReader.DONE. + + @property readyState + @type {Number} + @default FileReader.EMPTY + */ + readyState: FileReader.EMPTY, + + /** + Result of the successful read operation. + + @property result + @type {String} + */ + result: null, + + /** + Stores the error of failed asynchronous read operation. + + @property error + @type {DOMError} + */ + error: null, + + /** + Initiates reading of File/Blob object contents to binary string. + + @method readAsBinaryString + @param {Blob|File} blob Object to preload + */ + readAsBinaryString: function(blob) { + _read.call(this, 'readAsBinaryString', blob); + }, + + /** + Initiates reading of File/Blob object contents to dataURL string. + + @method readAsDataURL + @param {Blob|File} blob Object to preload + */ + readAsDataURL: function(blob) { + _read.call(this, 'readAsDataURL', blob); + }, + + /** + Initiates reading of File/Blob object contents to string. + + @method readAsText + @param {Blob|File} blob Object to preload + */ + readAsText: function(blob) { + _read.call(this, 'readAsText', blob); + }, + + /** + Aborts preloading process. + + @method abort + */ + abort: function() { + this.result = null; + + if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { + return; + } else if (this.readyState === FileReader.LOADING) { + this.readyState = FileReader.DONE; + } + + this.exec('FileReader', 'abort'); + + this.trigger('abort'); + this.trigger('loadend'); + }, + + /** + Destroy component and release resources. + + @method destroy + */ + destroy: function() { + this.abort(); + this.exec('FileReader', 'destroy'); + this.disconnectRuntime(); + this.unbindAll(); + } + }); + + // uid must already be assigned + this.handleEventProps(dispatches); + + this.bind('Error', function(e, err) { + this.readyState = FileReader.DONE; + this.error = err; + }, 999); + + this.bind('Load', function(e) { + this.readyState = FileReader.DONE; + }, 999); + + + function _read(op, blob) { + var self = this; + + this.trigger('loadstart'); + + if (this.readyState === FileReader.LOADING) { + this.trigger('error', new x.DOMException(x.DOMException.INVALID_STATE_ERR)); + this.trigger('loadend'); + return; + } + + // if source is not o.Blob/o.File + if (!(blob instanceof Blob)) { + this.trigger('error', new x.DOMException(x.DOMException.NOT_FOUND_ERR)); + this.trigger('loadend'); + return; + } + + this.result = null; + this.readyState = FileReader.LOADING; + + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsText': + case 'readAsBinaryString': + this.result = src; + break; + case 'readAsDataURL': + this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); + break; + } + this.readyState = FileReader.DONE; + this.trigger('load'); + this.trigger('loadend'); + } else { + this.connectRuntime(blob.ruid); + this.exec('FileReader', 'read', op, blob); + } + } + } + + /** + Initial FileReader state + + @property EMPTY + @type {Number} + @final + @static + @default 0 + */ + FileReader.EMPTY = 0; + + /** + FileReader switches to this state when it is preloading the source + + @property LOADING + @type {Number} + @final + @static + @default 1 + */ + FileReader.LOADING = 1; + + /** + Preloading is complete, this is a final state + + @property DONE + @type {Number} + @final + @static + @default 2 + */ + FileReader.DONE = 2; + + FileReader.prototype = EventTarget.instance; + + return FileReader; +}); + +// Included from: src/javascript/core/utils/Url.js + +/** + * Url.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Url +@public +@static +*/ + +define('moxie/core/utils/Url', [ + 'moxie/core/utils/Basic' +], function(Basic) { + /** + Parse url into separate components and fill in absent parts with parts from current url, + based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js + + @method parseUrl + @static + @param {String} url Url to parse (defaults to empty string if undefined) + @return {Object} Hash containing extracted uri components + */ + var parseUrl = function(url, currentUrl) { + var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] + , i = key.length + , ports = { + http: 80, + https: 443 + } + , uri = {} + , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?(\[[\da-fA-F:]+\]|[^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ + , m = regex.exec(url || '') + , isRelative + , isSchemeLess = /^\/\/\w/.test(url) + ; + + switch (Basic.typeOf(currentUrl)) { + case 'undefined': + currentUrl = parseUrl(document.location.href, false); + break; + + case 'string': + currentUrl = parseUrl(currentUrl, false); + break; + } + + while (i--) { + if (m[i]) { + uri[key[i]] = m[i]; + } + } + + isRelative = !isSchemeLess && !uri.scheme; + + if (isSchemeLess || isRelative) { + uri.scheme = currentUrl.scheme; + } + + // when url is relative, we set the origin and the path ourselves + if (isRelative) { + uri.host = currentUrl.host; + uri.port = currentUrl.port; + + var path = ''; + // for urls without trailing slash we need to figure out the path + if (/^[^\/]/.test(uri.path)) { + path = currentUrl.path; + // if path ends with a filename, strip it + if (/\/[^\/]*\.[^\/]*$/.test(path)) { + path = path.replace(/\/[^\/]+$/, '/'); + } else { + // avoid double slash at the end (see #127) + path = path.replace(/\/?$/, '/'); + } + } + uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir + } + + if (!uri.port) { + uri.port = ports[uri.scheme] || 80; + } + + uri.port = parseInt(uri.port, 10); + + if (!uri.path) { + uri.path = "/"; + } + + delete uri.source; + + return uri; + }; + + /** + Resolve url - among other things will turn relative url to absolute + + @method resolveUrl + @static + @param {String|Object} url Either absolute or relative, or a result of parseUrl call + @return {String} Resolved, absolute url + */ + var resolveUrl = function(url) { + var ports = { // we ignore default ports + http: 80, + https: 443 + } + , urlp = typeof(url) === 'object' ? url : parseUrl(url); + ; + + return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); + }; + + /** + Check if specified url has the same origin as the current document + + @method hasSameOrigin + @static + @param {String|Object} url + @return {Boolean} + */ + var hasSameOrigin = function(url) { + function origin(url) { + return [url.scheme, url.host, url.port].join('/'); + } + + if (typeof url === 'string') { + url = parseUrl(url); + } + + return origin(parseUrl()) === origin(url); + }; + + return { + parseUrl: parseUrl, + resolveUrl: resolveUrl, + hasSameOrigin: hasSameOrigin + }; +}); + +// Included from: src/javascript/runtime/RuntimeTarget.js + +/** + * RuntimeTarget.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/RuntimeTarget', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + "moxie/core/EventTarget" +], function(Basic, RuntimeClient, EventTarget) { + /** + Instance of this class can be used as a target for the events dispatched by shims, + when allowing them onto components is for either reason inappropriate + + @class moxie/runtime/RuntimeTarget + @constructor + @protected + @extends EventTarget + */ + function RuntimeTarget() { + this.uid = Basic.guid('uid_'); + + RuntimeClient.call(this); + + this.destroy = function() { + this.disconnectRuntime(); + this.unbindAll(); + }; + } + + RuntimeTarget.prototype = EventTarget.instance; + + return RuntimeTarget; +}); + +// Included from: src/javascript/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReaderSync', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + 'moxie/core/utils/Encode' +], function(Basic, RuntimeClient, Encode) { + /** + Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here + it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, + but probably < 1mb). Not meant to be used directly by user. + + @class moxie/file/FileReaderSync + @private + @constructor + */ + return function() { + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + readAsBinaryString: function(blob) { + return _read.call(this, 'readAsBinaryString', blob); + }, + + readAsDataURL: function(blob) { + return _read.call(this, 'readAsDataURL', blob); + }, + + /*readAsArrayBuffer: function(blob) { + return _read.call(this, 'readAsArrayBuffer', blob); + },*/ + + readAsText: function(blob) { + return _read.call(this, 'readAsText', blob); + } + }); + + function _read(op, blob) { + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsBinaryString': + return src; + case 'readAsDataURL': + return 'data:' + blob.type + ';base64,' + Encode.btoa(src); + case 'readAsText': + var txt = ''; + for (var i = 0, length = src.length; i < length; i++) { + txt += String.fromCharCode(src[i]); + } + return txt; + } + } else { + var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); + this.disconnectRuntime(); + return result; + } + } + }; +}); + +// Included from: src/javascript/xhr/FormData.js + +/** + * FormData.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/FormData", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/file/Blob" +], function(x, Basic, Blob) { + /** + FormData + + @class moxie/xhr/FormData + @constructor + */ + function FormData() { + var _blob, _fields = []; + + Basic.extend(this, { + /** + Append another key-value pair to the FormData object + + @method append + @param {String} name Name for the new field + @param {String|Blob|Array|Object} value Value for the field + */ + append: function(name, value) { + var self = this, valueType = Basic.typeOf(value); + + // according to specs value might be either Blob or String + if (value instanceof Blob) { + _blob = { + name: name, + value: value // unfortunately we can only send single Blob in one FormData + }; + } else if ('array' === valueType) { + name += '[]'; + + Basic.each(value, function(value) { + self.append(name, value); + }); + } else if ('object' === valueType) { + Basic.each(value, function(value, key) { + self.append(name + '[' + key + ']', value); + }); + } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { + self.append(name, "false"); + } else { + _fields.push({ + name: name, + value: value.toString() + }); + } + }, + + /** + Checks if FormData contains Blob. + + @method hasBlob + @return {Boolean} + */ + hasBlob: function() { + return !!this.getBlob(); + }, + + /** + Retrieves blob. + + @method getBlob + @return {Object} Either Blob if found or null + */ + getBlob: function() { + return _blob && _blob.value || null; + }, + + /** + Retrieves blob field name. + + @method getBlobName + @return {String} Either Blob field name or null + */ + getBlobName: function() { + return _blob && _blob.name || null; + }, + + /** + Loop over the fields in FormData and invoke the callback for each of them. + + @method each + @param {Function} cb Callback to call for each field + */ + each: function(cb) { + Basic.each(_fields, function(field) { + cb(field.value, field.name); + }); + + if (_blob) { + cb(_blob.value, _blob.name); + } + }, + + destroy: function() { + _blob = null; + _fields = []; + } + }); + } + + return FormData; +}); + +// Included from: src/javascript/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/XMLHttpRequest", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/EventTarget", + "moxie/core/utils/Encode", + "moxie/core/utils/Url", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeTarget", + "moxie/file/Blob", + "moxie/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/core/utils/Env", + "moxie/core/utils/Mime" +], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { + + var httpCode = { + 100: 'Continue', + 101: 'Switching Protocols', + 102: 'Processing', + + 200: 'OK', + 201: 'Created', + 202: 'Accepted', + 203: 'Non-Authoritative Information', + 204: 'No Content', + 205: 'Reset Content', + 206: 'Partial Content', + 207: 'Multi-Status', + 226: 'IM Used', + + 300: 'Multiple Choices', + 301: 'Moved Permanently', + 302: 'Found', + 303: 'See Other', + 304: 'Not Modified', + 305: 'Use Proxy', + 306: 'Reserved', + 307: 'Temporary Redirect', + + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Request Entity Too Large', + 414: 'Request-URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Requested Range Not Satisfiable', + 417: 'Expectation Failed', + 422: 'Unprocessable Entity', + 423: 'Locked', + 424: 'Failed Dependency', + 426: 'Upgrade Required', + + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 510: 'Not Extended' + }; + + function XMLHttpRequestUpload() { + this.uid = Basic.guid('uid_'); + } + + XMLHttpRequestUpload.prototype = EventTarget.instance; + + /** + Implementation of XMLHttpRequest + + @class moxie/xhr/XMLHttpRequest + @constructor + @uses RuntimeClient + @extends EventTarget + */ + var dispatches = [ + 'loadstart', + + 'progress', + + 'abort', + + 'error', + + 'load', + + 'timeout', + + 'loadend' + + // readystatechange (for historical reasons) + ]; + + var NATIVE = 1, RUNTIME = 2; + + function XMLHttpRequest() { + var self = this, + // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible + props = { + /** + The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. + + @property timeout + @type Number + @default 0 + */ + timeout: 0, + + /** + Current state, can take following values: + UNSENT (numeric value 0) + The object has been constructed. + + OPENED (numeric value 1) + The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. + + HEADERS_RECEIVED (numeric value 2) + All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. + + LOADING (numeric value 3) + The response entity body is being received. + + DONE (numeric value 4) + + @property readyState + @type Number + @default 0 (UNSENT) + */ + readyState: XMLHttpRequest.UNSENT, + + /** + True when user credentials are to be included in a cross-origin request. False when they are to be excluded + in a cross-origin request and when cookies are to be ignored in its response. Initially false. + + @property withCredentials + @type Boolean + @default false + */ + withCredentials: false, + + /** + Returns the HTTP status code. + + @property status + @type Number + @default 0 + */ + status: 0, + + /** + Returns the HTTP status text. + + @property statusText + @type String + */ + statusText: "", + + /** + Returns the response type. Can be set to change the response type. Values are: + the empty string (default), "arraybuffer", "blob", "document", "json", and "text". + + @property responseType + @type String + */ + responseType: "", + + /** + Returns the document response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "document". + + @property responseXML + @type Document + */ + responseXML: null, + + /** + Returns the text response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "text". + + @property responseText + @type String + */ + responseText: null, + + /** + Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). + Can become: ArrayBuffer, Blob, Document, JSON, Text + + @property response + @type Mixed + */ + response: null + }, + + _async = true, + _url, + _method, + _headers = {}, + _user, + _password, + _encoding = null, + _mimeType = null, + + // flags + _sync_flag = false, + _send_flag = false, + _upload_events_flag = false, + _upload_complete_flag = false, + _error_flag = false, + _same_origin_flag = false, + + // times + _start_time, + _timeoutset_time, + + _finalMime = null, + _finalCharset = null, + + _options = {}, + _xhr, + _responseHeaders = '', + _responseHeadersBag + ; + + + Basic.extend(this, props, { + /** + Unique id of the component + + @property uid + @type String + */ + uid: Basic.guid('uid_'), + + /** + Target for Upload events + + @property upload + @type XMLHttpRequestUpload + */ + upload: new XMLHttpRequestUpload(), + + + /** + Sets the request method, request URL, synchronous flag, request username, and request password. + + Throws a "SyntaxError" exception if one of the following is true: + + method is not a valid HTTP method. + url cannot be resolved. + url contains the "user:password" format in the userinfo production. + Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. + + Throws an "InvalidAccessError" exception if one of the following is true: + + Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. + There is an associated XMLHttpRequest document and either the timeout attribute is not zero, + the withCredentials attribute is true, or the responseType attribute is not the empty string. + + + @method open + @param {String} method HTTP method to use on request + @param {String} url URL to request + @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. + @param {String} [user] Username to use in HTTP authentication process on server-side + @param {String} [password] Password to use in HTTP authentication process on server-side + */ + open: function(method, url, async, user, password) { + var urlp; + + // first two arguments are required + if (!method || !url) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method + if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3 + if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { + _method = method.toUpperCase(); + } + + + // 4 - allowing these methods poses a security risk + if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { + throw new x.DOMException(x.DOMException.SECURITY_ERR); + } + + // 5 + url = Encode.utf8_encode(url); + + // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". + urlp = Url.parseUrl(url); + + _same_origin_flag = Url.hasSameOrigin(urlp); + + // 7 - manually build up absolute url + _url = Url.resolveUrl(url); + + // 9-10, 12-13 + if ((user || password) && !_same_origin_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + _user = user || urlp.user; + _password = password || urlp.pass; + + // 11 + _async = async || true; + + if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 14 - terminate abort() + + // 15 - terminate send() + + // 18 + _sync_flag = !_async; + _send_flag = false; + _headers = {}; + _reset.call(this); + + // 19 + _p('readyState', XMLHttpRequest.OPENED); + + // 20 + this.dispatchEvent('readystatechange'); + }, + + /** + Appends an header to the list of author request headers, or if header is already + in the list of author request headers, combines its value with value. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value + is not a valid HTTP header field value. + + @method setRequestHeader + @param {String} header + @param {String|Number} value + */ + setRequestHeader: function(header, value) { + var uaHeaders = [ // these headers are controlled by the user agent + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "cookie", + "cookie2", + "content-transfer-encoding", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via" + ]; + + // 1-2 + if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 4 + /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values + if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + }*/ + + header = Basic.trim(header).toLowerCase(); + + // setting of proxy-* and sec-* headers is prohibited by spec + if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { + return false; + } + + // camelize + // browsers lowercase header names (at least for custom ones) + // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); + + if (!_headers[header]) { + _headers[header] = value; + } else { + // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) + _headers[header] += ', ' + value; + } + return true; + }, + + /** + * Test if the specified header is already set on this request. + * Returns a header value or boolean false if it's not yet set. + * + * @method hasRequestHeader + * @param {String} header Name of the header to test + * @return {Boolean|String} + */ + hasRequestHeader: function(header) { + return header && _headers[header.toLowerCase()] || false; + }, + + /** + Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. + + @method getAllResponseHeaders + @return {String} reponse headers or empty string + */ + getAllResponseHeaders: function() { + return _responseHeaders || ''; + }, + + /** + Returns the header field value from the response of which the field name matches header, + unless the field name is Set-Cookie or Set-Cookie2. + + @method getResponseHeader + @param {String} header + @return {String} value(s) for the specified header or null + */ + getResponseHeader: function(header) { + header = header.toLowerCase(); + + if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { + return null; + } + + if (_responseHeaders && _responseHeaders !== '') { + // if we didn't parse response headers until now, do it and keep for later + if (!_responseHeadersBag) { + _responseHeadersBag = {}; + Basic.each(_responseHeaders.split(/\r\n/), function(line) { + var pair = line.split(/:\s+/); + if (pair.length === 2) { // last line might be empty, omit + pair[0] = Basic.trim(pair[0]); // just in case + _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form + header: pair[0], + value: Basic.trim(pair[1]) + }; + } + }); + } + if (_responseHeadersBag.hasOwnProperty(header)) { + return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; + } + } + return null; + }, + + /** + Sets the Content-Type header for the response to mime. + Throws an "InvalidStateError" exception if the state is LOADING or DONE. + Throws a "SyntaxError" exception if mime is not a valid media type. + + @method overrideMimeType + @param String mime Mime type to set + */ + overrideMimeType: function(mime) { + var matches, charset; + + // 1 + if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + mime = Basic.trim(mime.toLowerCase()); + + if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { + mime = matches[1]; + if (matches[2]) { + charset = matches[2]; + } + } + + if (!Mime.mimes[mime]) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3-4 + _finalMime = mime; + _finalCharset = charset; + }, + + /** + Initiates the request. The optional argument provides the request entity body. + The argument is ignored if request method is GET or HEAD. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + + @method send + @param {Blob|Document|String|FormData} [data] Request entity body + @param {Object} [options] Set of requirements and pre-requisities for runtime initialization + */ + send: function(data, options) { + if (Basic.typeOf(options) === 'string') { + _options = { ruid: options }; + } else if (!options) { + _options = {}; + } else { + _options = options; + } + + // 1-2 + if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + // sending Blob + if (data instanceof Blob) { + _options.ruid = data.ruid; + _mimeType = data.type || 'application/octet-stream'; + } + + // FormData + else if (data instanceof FormData) { + if (data.hasBlob()) { + var blob = data.getBlob(); + _options.ruid = blob.ruid; + _mimeType = blob.type || 'application/octet-stream'; + } + } + + // DOMString + else if (typeof data === 'string') { + _encoding = 'UTF-8'; + _mimeType = 'text/plain;charset=UTF-8'; + + // data should be converted to Unicode and encoded as UTF-8 + data = Encode.utf8_encode(data); + } + + // if withCredentials not set, but requested, set it automatically + if (!this.withCredentials) { + this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; + } + + // 4 - storage mutex + // 5 + _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP + // 6 + _error_flag = false; + // 7 + _upload_complete_flag = !data; + // 8 - Asynchronous steps + if (!_sync_flag) { + // 8.1 + _send_flag = true; + // 8.2 + // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + // 8.3 + //if (!_upload_complete_flag) { + // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + //} + } + // 8.5 - Return the send() method call, but continue running the steps in this algorithm. + _doXHR.call(this, data); + }, + + /** + Cancels any network activity. + + @method abort + */ + abort: function() { + _error_flag = true; + _sync_flag = false; + + if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { + _p('readyState', XMLHttpRequest.DONE); + _send_flag = false; + + if (_xhr) { + _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); + } else { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + _upload_complete_flag = true; + } else { + _p('readyState', XMLHttpRequest.UNSENT); + } + }, + + destroy: function() { + if (_xhr) { + if (Basic.typeOf(_xhr.destroy) === 'function') { + _xhr.destroy(); + } + _xhr = null; + } + + this.unbindAll(); + + if (this.upload) { + this.upload.unbindAll(); + this.upload = null; + } + } + }); + + this.handleEventProps(dispatches.concat(['readystatechange'])); // for historical reasons + this.upload.handleEventProps(dispatches); + + /* this is nice, but maybe too lengthy + + // if supported by JS version, set getters/setters for specific properties + o.defineProperty(this, 'readyState', { + configurable: false, + + get: function() { + return _p('readyState'); + } + }); + + o.defineProperty(this, 'timeout', { + configurable: false, + + get: function() { + return _p('timeout'); + }, + + set: function(value) { + + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // timeout still should be measured relative to the start time of request + _timeoutset_time = (new Date).getTime(); + + _p('timeout', value); + } + }); + + // the withCredentials attribute has no effect when fetching same-origin resources + o.defineProperty(this, 'withCredentials', { + configurable: false, + + get: function() { + return _p('withCredentials'); + }, + + set: function(value) { + // 1-2 + if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3-4 + if (_anonymous_flag || _sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 5 + _p('withCredentials', value); + } + }); + + o.defineProperty(this, 'status', { + configurable: false, + + get: function() { + return _p('status'); + } + }); + + o.defineProperty(this, 'statusText', { + configurable: false, + + get: function() { + return _p('statusText'); + } + }); + + o.defineProperty(this, 'responseType', { + configurable: false, + + get: function() { + return _p('responseType'); + }, + + set: function(value) { + // 1 + if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 3 + _p('responseType', value.toLowerCase()); + } + }); + + o.defineProperty(this, 'responseText', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'text'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseText'); + } + }); + + o.defineProperty(this, 'responseXML', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'document'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseXML'); + } + }); + + o.defineProperty(this, 'response', { + configurable: false, + + get: function() { + if (!!~o.inArray(_p('responseType'), ['', 'text'])) { + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + return ''; + } + } + + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + return null; + } + + return _p('response'); + } + }); + + */ + + function _p(prop, value) { + if (!props.hasOwnProperty(prop)) { + return; + } + if (arguments.length === 1) { // get + return Env.can('define_property') ? props[prop] : self[prop]; + } else { // set + if (Env.can('define_property')) { + props[prop] = value; + } else { + self[prop] = value; + } + } + } + + /* + function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { + // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 + return str.toLowerCase(); + } + */ + + + function _doXHR(data) { + var self = this; + + _start_time = new Date().getTime(); + + _xhr = new RuntimeTarget(); + + function loadEnd() { + if (_xhr) { // it could have been destroyed by now + _xhr.destroy(); + _xhr = null; + } + self.dispatchEvent('loadend'); + self = null; + } + + function exec(runtime) { + _xhr.bind('LoadStart', function(e) { + _p('readyState', XMLHttpRequest.LOADING); + self.dispatchEvent('readystatechange'); + + self.dispatchEvent(e); + + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + }); + + _xhr.bind('Progress', function(e) { + if (_p('readyState') !== XMLHttpRequest.LOADING) { + _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) + self.dispatchEvent('readystatechange'); + } + self.dispatchEvent(e); + }); + + _xhr.bind('UploadProgress', function(e) { + if (_upload_events_flag) { + self.upload.dispatchEvent({ + type: 'progress', + lengthComputable: false, + total: e.total, + loaded: e.loaded + }); + } + }); + + _xhr.bind('Load', function(e) { + _p('readyState', XMLHttpRequest.DONE); + _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); + _p('statusText', httpCode[_p('status')] || ""); + + _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); + + if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { + _p('responseText', _p('response')); + } else if (_p('responseType') === 'document') { + _p('responseXML', _p('response')); + } + + _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); + + self.dispatchEvent('readystatechange'); + + if (_p('status') > 0) { // status 0 usually means that server is unreachable + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + self.dispatchEvent(e); + } else { + _error_flag = true; + self.dispatchEvent('error'); + } + loadEnd(); + }); + + _xhr.bind('Abort', function(e) { + self.dispatchEvent(e); + loadEnd(); + }); + + _xhr.bind('Error', function(e) { + _error_flag = true; + _p('readyState', XMLHttpRequest.DONE); + self.dispatchEvent('readystatechange'); + _upload_complete_flag = true; + self.dispatchEvent(e); + loadEnd(); + }); + + runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { + url: _url, + method: _method, + async: _async, + user: _user, + password: _password, + headers: _headers, + mimeType: _mimeType, + encoding: _encoding, + responseType: self.responseType, + withCredentials: self.withCredentials, + options: _options + }, data); + } + + // clarify our requirements + if (typeof(_options.required_caps) === 'string') { + _options.required_caps = Runtime.parseCaps(_options.required_caps); + } + + _options.required_caps = Basic.extend({}, _options.required_caps, { + return_response_type: self.responseType + }); + + if (data instanceof FormData) { + _options.required_caps.send_multipart = true; + } + + if (!Basic.isEmptyObj(_headers)) { + _options.required_caps.send_custom_headers = true; + } + + if (!_same_origin_flag) { + _options.required_caps.do_cors = true; + } + + + if (_options.ruid) { // we do not need to wait if we can connect directly + exec(_xhr.connectRuntime(_options)); + } else { + _xhr.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + _xhr.bind('RuntimeError', function(e, err) { + self.dispatchEvent('RuntimeError', err); + }); + _xhr.connectRuntime(_options); + } + } + + + function _reset() { + _p('responseText', ""); + _p('responseXML', null); + _p('response', null); + _p('status', 0); + _p('statusText', ""); + _start_time = _timeoutset_time = null; + } + } + + XMLHttpRequest.UNSENT = 0; + XMLHttpRequest.OPENED = 1; + XMLHttpRequest.HEADERS_RECEIVED = 2; + XMLHttpRequest.LOADING = 3; + XMLHttpRequest.DONE = 4; + + XMLHttpRequest.prototype = EventTarget.instance; + + return XMLHttpRequest; +}); + +// Included from: src/javascript/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/runtime/Transporter", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Encode", + "moxie/runtime/RuntimeClient", + "moxie/core/EventTarget" +], function(Basic, Encode, RuntimeClient, EventTarget) { + + /** + @class moxie/runtime/Transporter + @private + @constructor + */ + function Transporter() { + var mod, _runtime, _data, _size, _pos, _chunk_size; + + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + state: Transporter.IDLE, + + result: null, + + transport: function(data, type, options) { + var self = this; + + options = Basic.extend({ + chunk_size: 204798 + }, options); + + // should divide by three, base64 requires this + if ((mod = options.chunk_size % 3)) { + options.chunk_size += 3 - mod; + } + + _chunk_size = options.chunk_size; + + _reset.call(this); + _data = data; + _size = data.length; + + if (Basic.typeOf(options) === 'string' || options.ruid) { + _run.call(self, type, this.connectRuntime(options)); + } else { + // we require this to run only once + var cb = function(e, runtime) { + self.unbind("RuntimeInit", cb); + _run.call(self, type, runtime); + }; + this.bind("RuntimeInit", cb); + this.connectRuntime(options); + } + }, + + abort: function() { + var self = this; + + self.state = Transporter.IDLE; + if (_runtime) { + _runtime.exec.call(self, 'Transporter', 'clear'); + self.trigger("TransportingAborted"); + } + + _reset.call(self); + }, + + + destroy: function() { + this.unbindAll(); + _runtime = null; + this.disconnectRuntime(); + _reset.call(this); + } + }); + + function _reset() { + _size = _pos = 0; + _data = this.result = null; + } + + function _run(type, runtime) { + var self = this; + + _runtime = runtime; + + //self.unbind("RuntimeInit"); + + self.bind("TransportingProgress", function(e) { + _pos = e.loaded; + + if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { + _transport.call(self); + } + }, 999); + + self.bind("TransportingComplete", function() { + _pos = _size; + self.state = Transporter.DONE; + _data = null; // clean a bit + self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); + }, 999); + + self.state = Transporter.BUSY; + self.trigger("TransportingStarted"); + _transport.call(self); + } + + function _transport() { + var self = this, + chunk, + bytesLeft = _size - _pos; + + if (_chunk_size > bytesLeft) { + _chunk_size = bytesLeft; + } + + chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); + _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); + } + } + + Transporter.IDLE = 0; + Transporter.BUSY = 1; + Transporter.DONE = 2; + + Transporter.prototype = EventTarget.instance; + + return Transporter; +}); + +// Included from: src/javascript/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/image/Image", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/file/FileReaderSync", + "moxie/xhr/XMLHttpRequest", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeClient", + "moxie/runtime/Transporter", + "moxie/core/utils/Env", + "moxie/core/EventTarget", + "moxie/file/Blob", + "moxie/file/File", + "moxie/core/utils/Encode" +], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) { + /** + Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data. + + @class moxie/image/Image + @constructor + @extends EventTarget + */ + var dispatches = [ + 'progress', + + /** + Dispatched when loading is complete. + + @event load + @param {Object} event + */ + 'load', + + 'error', + + /** + Dispatched when resize operation is complete. + + @event resize + @param {Object} event + */ + 'resize', + + /** + Dispatched when visual representation of the image is successfully embedded + into the corresponsing container. + + @event embedded + @param {Object} event + */ + 'embedded' + ]; + + function Image() { + + RuntimeClient.call(this); + + Basic.extend(this, { + /** + Unique id of the component + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @type {String} + */ + ruid: null, + + /** + Name of the file, that was used to create an image, if available. If not equals to empty string. + + @property name + @type {String} + @default "" + */ + name: "", + + /** + Size of the image in bytes. Actual value is set only after image is preloaded. + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Width of the image. Actual value is set only after image is preloaded. + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Height of the image. Actual value is set only after image is preloaded. + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded. + + @property type + @type {String} + @default "" + */ + type: "", + + /** + Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded. + + @property meta + @type {Object} + @default {} + */ + meta: {}, + + /** + Alias for load method, that takes another moxie.image.Image object as a source (see load). + + @method clone + @param {Image} src Source for the image + @param {Boolean} [exact=false] Whether to activate in-depth clone mode + */ + clone: function() { + this.load.apply(this, arguments); + }, + + /** + Loads image from various sources. Currently the source for new image can be: moxie.image.Image, + moxie.file.Blob/moxie.file.File, native Blob/File, dataUrl or URL. Depending on the type of the + source, arguments - differ. When source is URL, Image will be downloaded from remote destination + and loaded in memory. + + @example + var img = new moxie.image.Image(); + img.onload = function() { + var blob = img.getAsBlob(); + + var formData = new moxie.xhr.FormData(); + formData.append('file', blob); + + var xhr = new moxie.xhr.XMLHttpRequest(); + xhr.onload = function() { + // upload complete + }; + xhr.open('post', 'upload.php'); + xhr.send(formData); + }; + img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg) + + + @method load + @param {Image|Blob|File|String} src Source for the image + @param {Boolean|Object} [mixed] + */ + load: function() { + _load.apply(this, arguments); + }, + + + /** + Resizes the image to fit the specified width/height. If crop is specified, image will also be + cropped to the exact dimensions. + + @method resize + @since 3.0 + @param {Object} options + @param {Number} options.width Resulting width + @param {Number} [options.height=width] Resulting height (optional, if not supplied will default to width) + @param {String} [options.type='image/jpeg'] MIME type of the resulting image + @param {Number} [options.quality=90] In the case of JPEG, controls the quality of resulting image + @param {Boolean} [options.crop='cc'] If not falsy, image will be cropped, by default from center + @param {Boolean} [options.fit=true] Whether to upscale the image to fit the exact dimensions + @param {Boolean} [options.preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + @param {String} [options.resample='default'] Resampling algorithm to use during resize + @param {Boolean} [options.multipass=true] Whether to scale the image in steps (results in better quality) + */ + resize: function(options) { + var self = this; + var orientation; + var scale; + + var srcRect = { + x: 0, + y: 0, + width: self.width, + height: self.height + }; + + var opts = Basic.extendIf({ + width: self.width, + height: self.height, + type: self.type || 'image/jpeg', + quality: 90, + crop: false, + fit: true, + preserveHeaders: true, + resample: 'default', + multipass: true + }, options); + + try { + if (!self.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // no way to reliably intercept the crash due to high resolution, so we simply avoid it + if (self.width > Image.MAX_RESIZE_WIDTH || self.height > Image.MAX_RESIZE_HEIGHT) { + throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + // take into account orientation tag + orientation = (self.meta && self.meta.tiff && self.meta.tiff.Orientation) || 1; + + if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation + var tmp = opts.width; + opts.width = opts.height; + opts.height = tmp; + } + + if (opts.crop) { + scale = Math.max(opts.width/self.width, opts.height/self.height); + + if (options.fit) { + // first scale it up or down to fit the original image + srcRect.width = Math.min(Math.ceil(opts.width/scale), self.width); + srcRect.height = Math.min(Math.ceil(opts.height/scale), self.height); + + // recalculate the scale for adapted dimensions + scale = opts.width/srcRect.width; + } else { + srcRect.width = Math.min(opts.width, self.width); + srcRect.height = Math.min(opts.height, self.height); + + // now we do not need to scale it any further + scale = 1; + } + + if (typeof(opts.crop) === 'boolean') { + opts.crop = 'cc'; + } + + switch (opts.crop.toLowerCase().replace(/_/, '-')) { + case 'rb': + case 'right-bottom': + srcRect.x = self.width - srcRect.width; + srcRect.y = self.height - srcRect.height; + break; + + case 'cb': + case 'center-bottom': + srcRect.x = Math.floor((self.width - srcRect.width) / 2); + srcRect.y = self.height - srcRect.height; + break; + + case 'lb': + case 'left-bottom': + srcRect.x = 0; + srcRect.y = self.height - srcRect.height; + break; + + case 'lt': + case 'left-top': + srcRect.x = 0; + srcRect.y = 0; + break; + + case 'ct': + case 'center-top': + srcRect.x = Math.floor((self.width - srcRect.width) / 2); + srcRect.y = 0; + break; + + case 'rt': + case 'right-top': + srcRect.x = self.width - srcRect.width; + srcRect.y = 0; + break; + + case 'rc': + case 'right-center': + case 'right-middle': + srcRect.x = self.width - srcRect.width; + srcRect.y = Math.floor((self.height - srcRect.height) / 2); + break; + + + case 'lc': + case 'left-center': + case 'left-middle': + srcRect.x = 0; + srcRect.y = Math.floor((self.height - srcRect.height) / 2); + break; + + case 'cc': + case 'center-center': + case 'center-middle': + default: + srcRect.x = Math.floor((self.width - srcRect.width) / 2); + srcRect.y = Math.floor((self.height - srcRect.height) / 2); + } + + // original image might be smaller than requested crop, so - avoid negative values + srcRect.x = Math.max(srcRect.x, 0); + srcRect.y = Math.max(srcRect.y, 0); + } else { + scale = Math.min(opts.width/self.width, opts.height/self.height); + + // do not upscale if we were asked to not fit it + if (scale > 1 && !opts.fit) { + scale = 1; + } + } + + this.exec('Image', 'resize', srcRect, scale, opts); + } catch(ex) { + // for now simply trigger error event + self.trigger('error', ex.code); + } + }, + + /** + Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions. + + @method downsize + @deprecated use resize() + */ + downsize: function(options) { + var defaults = { + width: this.width, + height: this.height, + type: this.type || 'image/jpeg', + quality: 90, + crop: false, + fit: false, + preserveHeaders: true, + resample: 'default' + }, opts; + + if (typeof(options) === 'object') { + opts = Basic.extend(defaults, options); + } else { + // for backward compatibility + opts = Basic.extend(defaults, { + width: arguments[0], + height: arguments[1], + crop: arguments[2], + preserveHeaders: arguments[3] + }); + } + + this.resize(opts); + }, + + /** + Alias for downsize(width, height, true). (see downsize) + + @method crop + @param {Number} width Resulting width + @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) + @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + */ + crop: function(width, height, preserveHeaders) { + this.downsize(width, height, true, preserveHeaders); + }, + + getAsCanvas: function() { + if (!Env.can('create_canvas')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + return this.exec('Image', 'getAsCanvas'); + }, + + /** + Retrieves image in it's current state as moxie.file.Blob object. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBlob + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {Blob} Image as Blob + */ + getAsBlob: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + return this.exec('Image', 'getAsBlob', type || 'image/jpeg', quality || 90); + }, + + /** + Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsDataURL + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as dataURL string + */ + getAsDataURL: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + return this.exec('Image', 'getAsDataURL', type || 'image/jpeg', quality || 90); + }, + + /** + Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBinaryString + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as binary string + */ + getAsBinaryString: function(type, quality) { + var dataUrl = this.getAsDataURL(type, quality); + return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)); + }, + + /** + Embeds a visual representation of the image into the specified node. Depending on the runtime, + it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare, + can be used in legacy browsers that do not have canvas or proper dataURI support). + + @method embed + @param {DOMElement} el DOM element to insert the image object into + @param {Object} [options] + @param {Number} [options.width] The width of an embed (defaults to the image width) + @param {Number} [options.height] The height of an embed (defaults to the image height) + @param {String} [options.type="image/jpeg"] Mime type + @param {Number} [options.quality=90] Quality of an embed, if mime type is image/jpeg + @param {Boolean} [options.crop=false] Whether to crop an embed to the specified dimensions + @param {Boolean} [options.fit=true] By default thumbs will be up- or downscaled as necessary to fit the dimensions + */ + embed: function(el, options) { + var self = this + , runtime // this has to be outside of all the closures to contain proper runtime + ; + + var opts = Basic.extend({ + width: this.width, + height: this.height, + type: this.type || 'image/jpeg', + quality: 90, + fit: true, + resample: 'nearest' + }, options); + + + function render(type, quality) { + var img = this; + + // if possible, embed a canvas element directly + if (Env.can('create_canvas')) { + var canvas = img.getAsCanvas(); + if (canvas) { + el.appendChild(canvas); + canvas = null; + img.destroy(); + self.trigger('embedded'); + return; + } + } + + var dataUrl = img.getAsDataURL(type, quality); + if (!dataUrl) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + if (Env.can('use_data_uri_of', dataUrl.length)) { + el.innerHTML = ''; + img.destroy(); + self.trigger('embedded'); + } else { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + runtime = self.connectRuntime(this.result.ruid); + + self.bind("Embedded", function() { + // position and size properly + Basic.extend(runtime.getShimContainer().style, { + //position: 'relative', + top: '0px', + left: '0px', + width: img.width + 'px', + height: img.height + 'px' + }); + + // some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's + // position type changes (in Gecko), but since we basically need this only in IEs 6/7 and + // sometimes 8 and they do not have this problem, we can comment this for now + /*tr.bind("RuntimeInit", function(e, runtime) { + tr.destroy(); + runtime.destroy(); + onResize.call(self); // re-feed our image data + });*/ + + runtime = null; // release + }, 999); + + runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height); + img.destroy(); + }); + + tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, { + required_caps: { + display_media: true + }, + runtime_order: 'flash,silverlight', + container: el + }); + } + } + + try { + if (!(el = Dom.get(el))) { + throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR); + } + + if (!this.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // high-resolution images cannot be consistently handled across the runtimes + if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { + //throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + var imgCopy = new Image(); + + imgCopy.bind("Resize", function() { + render.call(this, opts.type, opts.quality); + }); + + imgCopy.bind("Load", function() { + this.downsize(opts); + }); + + // if embedded thumb data is available and dimensions are big enough, use it + if (this.meta.thumb && this.meta.thumb.width >= opts.width && this.meta.thumb.height >= opts.height) { + imgCopy.load(this.meta.thumb.data); + } else { + imgCopy.clone(this, false); + } + + return imgCopy; + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + }, + + /** + Properly destroys the image and frees resources in use. If any. Recommended way to dispose + moxie.image.Image object. + + @method destroy + */ + destroy: function() { + if (this.ruid) { + this.getRuntime().exec.call(this, 'Image', 'destroy'); + this.disconnectRuntime(); + } + if (this.meta && this.meta.thumb) { + // thumb is blob, make sure we destroy it first + this.meta.thumb.data.destroy(); + } + this.unbindAll(); + } + }); + + + // this is here, because in order to bind properly, we need uid, which is created above + this.handleEventProps(dispatches); + + this.bind('Load Resize', function() { + return _updateInfo.call(this); // if operation fails (e.g. image is neither PNG nor JPEG) cancel all pending events + }, 999); + + + function _updateInfo(info) { + try { + if (!info) { + info = this.exec('Image', 'getInfo'); + } + + this.size = info.size; + this.width = info.width; + this.height = info.height; + this.type = info.type; + this.meta = info.meta; + + // update file name, only if empty + if (this.name === '') { + this.name = info.name; + } + + return true; + } catch(ex) { + this.trigger('error', ex.code); + return false; + } + } + + + function _load(src) { + var srcType = Basic.typeOf(src); + + try { + // if source is Image + if (src instanceof Image) { + if (!src.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + _loadFromImage.apply(this, arguments); + } + // if source is o.Blob/o.File + else if (src instanceof Blob) { + if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + _loadFromBlob.apply(this, arguments); + } + // if native blob/file + else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) { + _load.call(this, new File(null, src), arguments[1]); + } + // if String + else if (srcType === 'string') { + // if dataUrl String + if (src.substr(0, 5) === 'data:') { + _load.call(this, new Blob(null, { data: src }), arguments[1]); + } + // else assume Url, either relative or absolute + else { + _loadFromUrl.apply(this, arguments); + } + } + // if source seems to be an img node + else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') { + _load.call(this, src.src, arguments[1]); + } + else { + throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR); + } + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + } + + + function _loadFromImage(img, exact) { + var runtime = this.connectRuntime(img.ruid); + this.ruid = runtime.uid; + runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact)); + } + + + function _loadFromBlob(blob, options) { + var self = this; + + self.name = blob.name || ''; + + function exec(runtime) { + self.ruid = runtime.uid; + runtime.exec.call(self, 'Image', 'loadFromBlob', blob); + } + + if (blob.isDetached()) { + this.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + + // convert to object representation + if (options && typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + this.connectRuntime(Basic.extend({ + required_caps: { + access_image_binary: true, + resize_image: true + } + }, options)); + } else { + exec(this.connectRuntime(blob.ruid)); + } + } + + + function _loadFromUrl(url, options) { + var self = this, xhr; + + xhr = new XMLHttpRequest(); + + xhr.open('get', url); + xhr.responseType = 'blob'; + + xhr.onprogress = function(e) { + self.trigger(e); + }; + + xhr.onload = function() { + _loadFromBlob.call(self, xhr.response, true); + }; + + xhr.onerror = function(e) { + self.trigger(e); + }; + + xhr.onloadend = function() { + xhr.destroy(); + }; + + xhr.bind('RuntimeError', function(e, err) { + self.trigger('RuntimeError', err); + }); + + xhr.send(null, options); + } + } + + // virtual world will crash on you if image has a resolution higher than this: + Image.MAX_RESIZE_WIDTH = 8192; + Image.MAX_RESIZE_HEIGHT = 8192; + + Image.prototype = EventTarget.instance; + + return Image; +}); + +// Included from: src/javascript/runtime/html5/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML5 runtime. + +@class moxie/runtime/html5/Runtime +@private +*/ +define("moxie/runtime/html5/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = "html5", extensions = {}; + + function Html5Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + var caps = Basic.extend({ + access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), + access_image_binary: function() { + return I.can('access_binary') && !!extensions.Image; + }, + display_media: Test( + (Env.can('create_canvas') || Env.can('use_data_uri_over32kb')) && + defined('moxie/image/Image') + ), + do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), + drag_and_drop: Test(function() { + // this comes directly from Modernizr: http://www.modernizr.com/ + var div = document.createElement('div'); + // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop + return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && + (Env.browser !== 'IE' || Env.verComp(Env.version, 9, '>')); + }()), + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return !( + (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '<')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) || + (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '<')) || + (Env.browser === 'Firefox' && Env.verComp(Env.version, 37, '<')) + ); + }()), + return_response_headers: True, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported + return true; + } + return Env.can('return_response_type', responseType); + }, + return_status_code: True, + report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), + resize_image: function() { + return I.can('access_binary') && Env.can('create_canvas'); + }, + select_file: function() { + return Env.can('use_fileinput') && window.File; + }, + select_folder: function() { + return I.can('select_file') && ( + Env.browser === 'Chrome' && Env.verComp(Env.version, 21, '>=') || + Env.browser === 'Firefox' && Env.verComp(Env.version, 42, '>=') // https://developer.mozilla.org/en-US/Firefox/Releases/42 + ); + }, + select_multiple: function() { + // it is buggy on Safari Windows and iOS + return I.can('select_file') && + !(Env.browser === 'Safari' && Env.os === 'Windows') && + !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.0", '>') && Env.verComp(Env.osVersion, "8.0.0", '<')); + }, + send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), + send_custom_headers: Test(window.XMLHttpRequest), + send_multipart: function() { + return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); + }, + slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), + stream_upload: function(){ + return I.can('slice_blob') && I.can('send_multipart'); + }, + summon_file_dialog: function() { // yeah... some dirty sniffing here... + return I.can('select_file') && !( + (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '<')) || + (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '<')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) + ); + }, + upload_filesize: True, + use_http_method: True + }, + arguments[2] + ); + + Runtime.call(this, options, (arguments[1] || type), caps); + + + Basic.extend(this, { + + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html5Runtime); + + return extensions; +}); + +// Included from: src/javascript/runtime/html5/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/Blob +@private +*/ +define("moxie/runtime/html5/file/Blob", [ + "moxie/runtime/html5/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + function HTML5Blob() { + function w3cBlobSlice(blob, start, end) { + var blobSlice; + + if (window.File.prototype.slice) { + try { + blob.slice(); // depricated version will throw WRONG_ARGUMENTS_ERR exception + return blob.slice(start, end); + } catch (e) { + // depricated slice method + return blob.slice(start, end - start); + } + // slice method got prefixed: https://bugzilla.mozilla.org/show_bug.cgi?id=649672 + } else if ((blobSlice = window.File.prototype.webkitSlice || window.File.prototype.mozSlice)) { + return blobSlice.call(blob, start, end); + } else { + return null; // or throw some exception + } + } + + this.slice = function() { + return new Blob(this.getRuntime().uid, w3cBlobSlice.apply(this, arguments)); + }; + + this.destroy = function() { + this.getRuntime().getShim().removeInstance(this.uid); + }; + } + + return (extensions.Blob = HTML5Blob); +}); + +// Included from: src/javascript/core/utils/Events.js + +/** + * Events.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/core/utils/Events +@public +@static +*/ + +define('moxie/core/utils/Events', [ + 'moxie/core/utils/Basic' +], function(Basic) { + var eventhash = {}, uid = 'moxie_' + Basic.guid(); + + // IE W3C like event funcs + function preventDefault() { + this.returnValue = false; + } + + function stopPropagation() { + this.cancelBubble = true; + } + + /** + Adds an event handler to the specified object and store reference to the handler + in objects internal Plupload registry (@see removeEvent). + + @method addEvent + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Name to add event listener to. + @param {Function} callback Function to call when event occurs. + @param {String} [key] that might be used to add specifity to the event record. + */ + var addEvent = function(obj, name, callback, key) { + var func, events; + + name = name.toLowerCase(); + + // Add event listener + if (obj.addEventListener) { + func = callback; + + obj.addEventListener(name, func, false); + } else if (obj.attachEvent) { + func = function() { + var evt = window.event; + + if (!evt.target) { + evt.target = evt.srcElement; + } + + evt.preventDefault = preventDefault; + evt.stopPropagation = stopPropagation; + + callback(evt); + }; + + obj.attachEvent('on' + name, func); + } + + // Log event handler to objects internal mOxie registry + if (!obj[uid]) { + obj[uid] = Basic.guid(); + } + + if (!eventhash.hasOwnProperty(obj[uid])) { + eventhash[obj[uid]] = {}; + } + + events = eventhash[obj[uid]]; + + if (!events.hasOwnProperty(name)) { + events[name] = []; + } + + events[name].push({ + func: func, + orig: callback, // store original callback for IE + key: key + }); + }; + + + /** + Remove event handler from the specified object. If third argument (callback) + is not specified remove all events with the specified name. + + @method removeEvent + @static + @param {Object} obj DOM element to remove event listener(s) from. + @param {String} name Name of event listener to remove. + @param {Function|String} [callback] might be a callback or unique key to match. + */ + var removeEvent = function(obj, name, callback) { + var type, undef; + + name = name.toLowerCase(); + + if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { + type = eventhash[obj[uid]][name]; + } else { + return; + } + + for (var i = type.length - 1; i >= 0; i--) { + // undefined or not, key should match + if (type[i].orig === callback || type[i].key === callback) { + if (obj.removeEventListener) { + obj.removeEventListener(name, type[i].func, false); + } else if (obj.detachEvent) { + obj.detachEvent('on'+name, type[i].func); + } + + type[i].orig = null; + type[i].func = null; + type.splice(i, 1); + + // If callback was passed we are done here, otherwise proceed + if (callback !== undef) { + break; + } + } + } + + // If event array got empty, remove it + if (!type.length) { + delete eventhash[obj[uid]][name]; + } + + // If mOxie registry has become empty, remove it + if (Basic.isEmptyObj(eventhash[obj[uid]])) { + delete eventhash[obj[uid]]; + + // IE doesn't let you remove DOM object property with - delete + try { + delete obj[uid]; + } catch(e) { + obj[uid] = undef; + } + } + }; + + + /** + Remove all kind of events from the specified object + + @method removeAllEvents + @static + @param {Object} obj DOM element to remove event listeners from. + @param {String} [key] unique key to match, when removing events. + */ + var removeAllEvents = function(obj, key) { + if (!obj || !obj[uid]) { + return; + } + + Basic.each(eventhash[obj[uid]], function(events, name) { + removeEvent(obj, name, key); + }); + }; + + return { + addEvent: addEvent, + removeEvent: removeEvent, + removeAllEvents: removeAllEvents + }; +}); + +// Included from: src/javascript/runtime/html5/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileInput +@private +*/ +define("moxie/runtime/html5/file/FileInput", [ + "moxie/runtime/html5/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, File, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _options, _browseBtnZIndex; // save original z-index + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), input, shimContainer, mimes, browseButton, zIndex, top; + + _options = options; + + // figure out accept string + mimes = Mime.extList2mimes(_options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + shimContainer.innerHTML = ''; + + input = Dom.get(I.uid); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + + browseButton = Dom.get(_options.browse_button); + _browseBtnZIndex = Dom.getStyle(browseButton, 'z-index') || 'auto'; + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + Events.addEvent(browseButton, 'click', function(e) { + var input = Dom.get(I.uid); + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + + comp.bind('Refresh', function() { + zIndex = parseInt(_browseBtnZIndex, 10) || 1; + + Dom.get(_options.browse_button).style.zIndex = zIndex; + this.getRuntime().getShimContainer().style.zIndex = zIndex - 1; + }); + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(_options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + // it shouldn't be possible to tab into the hidden element + (I.can('summon_file_dialog') ? input : browseButton).setAttribute('tabindex', -1); + + input.onchange = function onChange() { // there should be only one handler for this + comp.files = []; + + Basic.each(this.files, function(file) { + var relativePath = ''; + + if (_options.directory) { + // folders are represented by dots, filter them out (Chrome 11+) + if (file.name == ".") { + // if it looks like a folder... + return true; + } + } + + if (file.webkitRelativePath) { + relativePath = '/' + file.webkitRelativePath.replace(/^\//, ''); + } + + file = new File(I.uid, file); + file.relativePath = relativePath; + + comp.files.push(file); + }); + + // clearing the value enables the user to select the same file again if they want to + if (Env.browser !== 'IE' && Env.browser !== 'IEMobile') { + this.value = ''; + } else { + // in IE input[type="file"] is read-only so the only way to reset it is to re-insert it + var clone = this.cloneNode(true); + this.parentNode.replaceChild(clone, this); + clone.onchange = onChange; + } + + if (comp.files.length) { + comp.trigger('change'); + } + }; + + // ready event is perfectly asynchronous + comp.trigger({ + type: 'ready', + async: true + }); + + shimContainer = null; + }, + + + setOption: function(name, value) { + var I = this.getRuntime(); + var input = Dom.get(I.uid); + + switch (name) { + case 'accept': + if (value) { + var mimes = value.mimes || Mime.extList2mimes(value, I.can('filter_by_extension')); + input.setAttribute('accept', mimes.join(',')); + } else { + input.removeAttribute('accept'); + } + break; + + case 'directory': + if (value && I.can('select_folder')) { + input.setAttribute('directory', ''); + input.setAttribute('webkitdirectory', ''); + } else { + input.removeAttribute('directory'); + input.removeAttribute('webkitdirectory'); + } + break; + + case 'multiple': + if (value && I.can('select_multiple')) { + input.setAttribute('multiple', ''); + } else { + input.removeAttribute('multiple'); + } + + } + }, + + + disable: function(state) { + var I = this.getRuntime(), input; + + if ((input = Dom.get(I.uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + , container = _options && Dom.get(_options.container) + , browseButton = _options && Dom.get(_options.browse_button) + ; + + if (container) { + Events.removeAllEvents(container, this.uid); + } + + if (browseButton) { + Events.removeAllEvents(browseButton, this.uid); + browseButton.style.zIndex = _browseBtnZIndex; // reset to original value + } + + if (shimContainer) { + Events.removeAllEvents(shimContainer, this.uid); + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _options = shimContainer = container = browseButton = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html5/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileDrop +@private +*/ +define("moxie/runtime/html5/file/FileDrop", [ + "moxie/runtime/html5/Runtime", + 'moxie/file/File', + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime" +], function(extensions, File, Basic, Dom, Events, Mime) { + + function FileDrop() { + var _files = [], _allowedExts = [], _options, _ruid; + + Basic.extend(this, { + init: function(options) { + var comp = this, dropZone; + + _options = options; + _ruid = comp.ruid; // every dropped-in file should have a reference to the runtime + _allowedExts = _extractExts(_options.accept); + dropZone = _options.container; + + Events.addEvent(dropZone, 'dragover', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + + _files = []; + + // Chrome 21+ accepts folders via Drag'n'Drop + if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) { + _readItems(e.dataTransfer.items, function() { + comp.files = _files; + comp.trigger("drop"); + }); + } else { + Basic.each(e.dataTransfer.files, function(file) { + _addFile(file); + }); + comp.files = _files; + comp.trigger("drop"); + } + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + comp.trigger("dragenter"); + }, comp.uid); + + Events.addEvent(dropZone, 'dragleave', function(e) { + comp.trigger("dragleave"); + }, comp.uid); + }, + + destroy: function() { + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + _ruid = _files = _allowedExts = _options = null; + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + + function _hasFiles(e) { + if (!e.dataTransfer || !e.dataTransfer.types) { // e.dataTransfer.files is not available in Gecko during dragover + return false; + } + + var types = Basic.toArray(e.dataTransfer.types || []); + + return Basic.inArray("Files", types) !== -1 || + Basic.inArray("public.file-url", types) !== -1 || // Safari < 5 + Basic.inArray("application/x-moz-file", types) !== -1 // Gecko < 1.9.2 (< Firefox 3.6) + ; + } + + + function _addFile(file, relativePath) { + if (_isAcceptable(file)) { + var fileObj = new File(_ruid, file); + fileObj.relativePath = relativePath || ''; + _files.push(fileObj); + } + } + + + function _extractExts(accept) { + var exts = []; + for (var i = 0; i < accept.length; i++) { + [].push.apply(exts, accept[i].extensions.split(/\s*,\s*/)); + } + return Basic.inArray('*', exts) === -1 ? exts : []; + } + + + function _isAcceptable(file) { + if (!_allowedExts.length) { + return true; + } + var ext = Mime.getFileExtension(file.name); + return !ext || Basic.inArray(ext, _allowedExts) !== -1; + } + + + function _readItems(items, cb) { + var entries = []; + Basic.each(items, function(item) { + var entry = item.webkitGetAsEntry(); + // Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579) + if (entry) { + // file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61 + if (entry.isFile) { + _addFile(item.getAsFile(), entry.fullPath); + } else { + entries.push(entry); + } + } + }); + + if (entries.length) { + _readEntries(entries, cb); + } else { + cb(); + } + } + + + function _readEntries(entries, cb) { + var queue = []; + Basic.each(entries, function(entry) { + queue.push(function(cbcb) { + _readEntry(entry, cbcb); + }); + }); + Basic.inSeries(queue, function() { + cb(); + }); + } + + + function _readEntry(entry, cb) { + if (entry.isFile) { + entry.file(function(file) { + _addFile(file, entry.fullPath); + cb(); + }, function() { + // fire an error event maybe + cb(); + }); + } else if (entry.isDirectory) { + _readDirEntry(entry, cb); + } else { + cb(); // not file, not directory? what then?.. + } + } + + + function _readDirEntry(dirEntry, cb) { + var entries = [], dirReader = dirEntry.createReader(); + + // keep quering recursively till no more entries + function getEntries(cbcb) { + dirReader.readEntries(function(moreEntries) { + if (moreEntries.length) { + [].push.apply(entries, moreEntries); + getEntries(cbcb); + } else { + cbcb(); + } + }, cbcb); + } + + // ...and you thought FileReader was crazy... + getEntries(function() { + _readEntries(entries, cb); + }); + } + } + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/html5/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileReader +@private +*/ +define("moxie/runtime/html5/file/FileReader", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Encode", + "moxie/core/utils/Basic" +], function(extensions, Encode, Basic) { + + function FileReader() { + var _fr, _convertToBinary = false; + + Basic.extend(this, { + + read: function(op, blob) { + var comp = this; + + comp.result = ''; + + _fr = new window.FileReader(); + + _fr.addEventListener('progress', function(e) { + comp.trigger(e); + }); + + _fr.addEventListener('load', function(e) { + comp.result = _convertToBinary ? _toBinary(_fr.result) : _fr.result; + comp.trigger(e); + }); + + _fr.addEventListener('error', function(e) { + comp.trigger(e, _fr.error); + }); + + _fr.addEventListener('loadend', function(e) { + _fr = null; + comp.trigger(e); + }); + + if (Basic.typeOf(_fr[op]) === 'function') { + _convertToBinary = false; + _fr[op](blob.getSource()); + } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ + _convertToBinary = true; + _fr.readAsDataURL(blob.getSource()); + } + }, + + abort: function() { + if (_fr) { + _fr.abort(); + } + }, + + destroy: function() { + _fr = null; + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + } + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html5/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +@class moxie/runtime/html5/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html5/xhr/XMLHttpRequest", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Mime", + "moxie/core/utils/Url", + "moxie/file/File", + "moxie/file/Blob", + "moxie/xhr/FormData", + "moxie/core/Exceptions", + "moxie/core/utils/Env" +], function(extensions, Basic, Mime, Url, File, Blob, FormData, x, Env) { + + function XMLHttpRequest() { + var self = this + , _xhr + , _filename + ; + + Basic.extend(this, { + send: function(meta, data) { + var target = this + , isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.verComp(Env.version, 4, '>=') && Env.verComp(Env.version, 7, '<')) + , isAndroidBrowser = Env.browser === 'Android Browser' + , mustSendAsBinary = false + ; + + // extract file name + _filename = meta.url.replace(/^.+?\/([\w\-\.]+)$/, '$1').toLowerCase(); + + _xhr = _getNativeXHR(); + _xhr.open(meta.method, meta.url, meta.async, meta.user, meta.password); + + + // prepare data to be sent + if (data instanceof Blob) { + if (data.isDetached()) { + mustSendAsBinary = true; + } + data = data.getSource(); + } else if (data instanceof FormData) { + + if (data.hasBlob()) { + if (data.getBlob().isDetached()) { + data = _prepareMultipart.call(target, data); // _xhr must be instantiated and be in OPENED state + mustSendAsBinary = true; + } else if ((isGecko2_5_6 || isAndroidBrowser) && Basic.typeOf(data.getBlob().getSource()) === 'blob' && window.FileReader) { + // Gecko 2/5/6 can't send blob in FormData: https://bugzilla.mozilla.org/show_bug.cgi?id=649150 + // Android browsers (default one and Dolphin) seem to have the same issue, see: #613 + _preloadAndSend.call(target, meta, data); + return; // _preloadAndSend will reinvoke send() with transmutated FormData =%D + } + } + + // transfer fields to real FormData + if (data instanceof FormData) { // if still a FormData, e.g. not mangled by _prepareMultipart() + var fd = new window.FormData(); + data.each(function(value, name) { + if (value instanceof Blob) { + fd.append(name, value.getSource()); + } else { + fd.append(name, value); + } + }); + data = fd; + } + } + + + // if XHR L2 + if (_xhr.upload) { + if (meta.withCredentials) { + _xhr.withCredentials = true; + } + + _xhr.addEventListener('load', function(e) { + target.trigger(e); + }); + + _xhr.addEventListener('error', function(e) { + target.trigger(e); + }); + + // additionally listen to progress events + _xhr.addEventListener('progress', function(e) { + target.trigger(e); + }); + + _xhr.upload.addEventListener('progress', function(e) { + target.trigger({ + type: 'UploadProgress', + loaded: e.loaded, + total: e.total + }); + }); + // ... otherwise simulate XHR L2 + } else { + _xhr.onreadystatechange = function onReadyStateChange() { + + // fake Level 2 events + switch (_xhr.readyState) { + + case 1: // XMLHttpRequest.OPENED + // readystatechanged is fired twice for OPENED state (in IE and Mozilla) - neu + break; + + // looks like HEADERS_RECEIVED (state 2) is not reported in Opera (or it's old versions) - neu + case 2: // XMLHttpRequest.HEADERS_RECEIVED + break; + + case 3: // XMLHttpRequest.LOADING + // try to fire progress event for not XHR L2 + var total, loaded; + + try { + if (Url.hasSameOrigin(meta.url)) { // Content-Length not accessible for cross-domain on some browsers + total = _xhr.getResponseHeader('Content-Length') || 0; // old Safari throws an exception here + } + + if (_xhr.responseText) { // responseText was introduced in IE7 + loaded = _xhr.responseText.length; + } + } catch(ex) { + total = loaded = 0; + } + + target.trigger({ + type: 'progress', + lengthComputable: !!total, + total: parseInt(total, 10), + loaded: loaded + }); + break; + + case 4: // XMLHttpRequest.DONE + // release readystatechange handler (mostly for IE) + _xhr.onreadystatechange = function() {}; + + // usually status 0 is returned when server is unreachable, but FF also fails to status 0 for 408 timeout + try { + if (_xhr.status >= 200 && _xhr.status < 400) { + target.trigger('load'); + break; + } + } catch(ex) {} + + target.trigger('error'); + break; + } + }; + } + + + // set request headers + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + _xhr.setRequestHeader(header, value); + }); + } + + // request response type + if ("" !== meta.responseType && 'responseType' in _xhr) { + if ('json' === meta.responseType && !Env.can('return_response_type', 'json')) { // we can fake this one + _xhr.responseType = 'text'; + } else { + _xhr.responseType = meta.responseType; + } + } + + // send ... + if (!mustSendAsBinary) { + _xhr.send(data); + } else { + if (_xhr.sendAsBinary) { // Gecko + _xhr.sendAsBinary(data); + } else { // other browsers having support for typed arrays + (function() { + // mimic Gecko's sendAsBinary + var ui8a = new Uint8Array(data.length); + for (var i = 0; i < data.length; i++) { + ui8a[i] = (data.charCodeAt(i) & 0xff); + } + _xhr.send(ui8a.buffer); + }()); + } + } + + target.trigger('loadstart'); + }, + + getStatus: function() { + // according to W3C spec it should return 0 for readyState < 3, but instead it throws an exception + try { + if (_xhr) { + return _xhr.status; + } + } catch(ex) {} + return 0; + }, + + getResponse: function(responseType) { + var I = this.getRuntime(); + + try { + switch (responseType) { + case 'blob': + var file = new File(I.uid, _xhr.response); + + // try to extract file name from content-disposition if possible (might be - not, if CORS for example) + var disposition = _xhr.getResponseHeader('Content-Disposition'); + if (disposition) { + // extract filename from response header if available + var match = disposition.match(/filename=([\'\"'])([^\1]+)\1/); + if (match) { + _filename = match[2]; + } + } + file.name = _filename; + + // pre-webkit Opera doesn't set type property on the blob response + if (!file.type) { + file.type = Mime.getFileMime(_filename); + } + return file; + + case 'json': + if (!Env.can('return_response_type', 'json')) { + return _xhr.status === 200 && !!window.JSON ? JSON.parse(_xhr.responseText) : null; + } + return _xhr.response; + + case 'document': + return _getDocument(_xhr); + + default: + return _xhr.responseText !== '' ? _xhr.responseText : null; // against the specs, but for consistency across the runtimes + } + } catch(ex) { + return null; + } + }, + + getAllResponseHeaders: function() { + try { + return _xhr.getAllResponseHeaders(); + } catch(ex) {} + return ''; + }, + + abort: function() { + if (_xhr) { + _xhr.abort(); + } + }, + + destroy: function() { + self = _filename = null; + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + + // here we go... ugly fix for ugly bug + function _preloadAndSend(meta, data) { + var target = this, blob, fr; + + // get original blob + blob = data.getBlob().getSource(); + + // preload blob in memory to be sent as binary string + fr = new window.FileReader(); + fr.onload = function() { + // overwrite original blob + data.append(data.getBlobName(), new Blob(null, { + type: blob.type, + data: fr.result + })); + // invoke send operation again + self.send.call(target, meta, data); + }; + fr.readAsBinaryString(blob); + } + + + function _getNativeXHR() { + if (window.XMLHttpRequest && !(Env.browser === 'IE' && Env.verComp(Env.version, 8, '<'))) { // IE7 has native XHR but it's buggy + return new window.XMLHttpRequest(); + } else { + return (function() { + var progIDs = ['Msxml2.XMLHTTP.6.0', 'Microsoft.XMLHTTP']; // if 6.0 available, use it, otherwise failback to default 3.0 + for (var i = 0; i < progIDs.length; i++) { + try { + return new ActiveXObject(progIDs[i]); + } catch (ex) {} + } + })(); + } + } + + // @credits Sergey Ilinsky (http://www.ilinsky.com/) + function _getDocument(xhr) { + var rXML = xhr.responseXML; + var rText = xhr.responseText; + + // Try parsing responseText (@see: http://www.ilinsky.com/articles/XMLHttpRequest/#bugs-ie-responseXML-content-type) + if (Env.browser === 'IE' && rText && rXML && !rXML.documentElement && /[^\/]+\/[^\+]+\+xml/.test(xhr.getResponseHeader("Content-Type"))) { + rXML = new window.ActiveXObject("Microsoft.XMLDOM"); + rXML.async = false; + rXML.validateOnParse = false; + rXML.loadXML(rText); + } + + // Check if there is no error in document + if (rXML) { + if ((Env.browser === 'IE' && rXML.parseError !== 0) || !rXML.documentElement || rXML.documentElement.tagName === "parsererror") { + return null; + } + } + return rXML; + } + + + function _prepareMultipart(fd) { + var boundary = '----moxieboundary' + new Date().getTime() + , dashdash = '--' + , crlf = '\r\n' + , multipart = '' + , I = this.getRuntime() + ; + + if (!I.can('send_binary_string')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); + + // append multipart parameters + fd.each(function(value, name) { + // Firefox 3.6 failed to convert multibyte characters to UTF-8 in sendAsBinary(), + // so we try it here ourselves with: unescape(encodeURIComponent(value)) + if (value instanceof Blob) { + // Build RFC2388 blob + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf + + 'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf + + value.getSource() + crlf; + } else { + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf + + unescape(encodeURIComponent(value)) + crlf; + } + }); + + multipart += dashdash + boundary + dashdash + crlf; + + return multipart; + } + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html5/utils/BinaryReader.js + +/** + * BinaryReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/utils/BinaryReader +@private +*/ +define("moxie/runtime/html5/utils/BinaryReader", [ + "moxie/core/utils/Basic" +], function(Basic) { + + + function BinaryReader(data) { + if (data instanceof ArrayBuffer) { + ArrayBufferReader.apply(this, arguments); + } else { + UTF16StringReader.apply(this, arguments); + } + } + + Basic.extend(BinaryReader.prototype, { + + littleEndian: false, + + + read: function(idx, size) { + var sum, mv, i; + + if (idx + size > this.length()) { + throw new Error("You are trying to read outside the source boundaries."); + } + + mv = this.littleEndian + ? 0 + : -8 * (size - 1) + ; + + for (i = 0, sum = 0; i < size; i++) { + sum |= (this.readByteAt(idx + i) << Math.abs(mv + i*8)); + } + return sum; + }, + + + write: function(idx, num, size) { + var mv, i, str = ''; + + if (idx > this.length()) { + throw new Error("You are trying to write outside the source boundaries."); + } + + mv = this.littleEndian + ? 0 + : -8 * (size - 1) + ; + + for (i = 0; i < size; i++) { + this.writeByteAt(idx + i, (num >> Math.abs(mv + i*8)) & 255); + } + }, + + + BYTE: function(idx) { + return this.read(idx, 1); + }, + + + SHORT: function(idx) { + return this.read(idx, 2); + }, + + + LONG: function(idx) { + return this.read(idx, 4); + }, + + + SLONG: function(idx) { // 2's complement notation + var num = this.read(idx, 4); + return (num > 2147483647 ? num - 4294967296 : num); + }, + + + CHAR: function(idx) { + return String.fromCharCode(this.read(idx, 1)); + }, + + + STRING: function(idx, count) { + return this.asArray('CHAR', idx, count).join(''); + }, + + + asArray: function(type, idx, count) { + var values = []; + + for (var i = 0; i < count; i++) { + values[i] = this[type](idx + i); + } + return values; + } + }); + + + function ArrayBufferReader(data) { + var _dv = new DataView(data); + + Basic.extend(this, { + + readByteAt: function(idx) { + return _dv.getUint8(idx); + }, + + + writeByteAt: function(idx, value) { + _dv.setUint8(idx, value); + }, + + + SEGMENT: function(idx, size, value) { + switch (arguments.length) { + case 2: + return data.slice(idx, idx + size); + + case 1: + return data.slice(idx); + + case 3: + if (value === null) { + value = new ArrayBuffer(); + } + + if (value instanceof ArrayBuffer) { + var arr = new Uint8Array(this.length() - size + value.byteLength); + if (idx > 0) { + arr.set(new Uint8Array(data.slice(0, idx)), 0); + } + arr.set(new Uint8Array(value), idx); + arr.set(new Uint8Array(data.slice(idx + size)), idx + value.byteLength); + + this.clear(); + data = arr.buffer; + _dv = new DataView(data); + break; + } + + default: return data; + } + }, + + + length: function() { + return data ? data.byteLength : 0; + }, + + + clear: function() { + _dv = data = null; + } + }); + } + + + function UTF16StringReader(data) { + Basic.extend(this, { + + readByteAt: function(idx) { + return data.charCodeAt(idx); + }, + + + writeByteAt: function(idx, value) { + putstr(String.fromCharCode(value), idx, 1); + }, + + + SEGMENT: function(idx, length, segment) { + switch (arguments.length) { + case 1: + return data.substr(idx); + case 2: + return data.substr(idx, length); + case 3: + putstr(segment !== null ? segment : '', idx, length); + break; + default: return data; + } + }, + + + length: function() { + return data ? data.length : 0; + }, + + clear: function() { + data = null; + } + }); + + + function putstr(segment, idx, length) { + length = arguments.length === 3 ? length : data.length - idx - 1; + data = data.substr(0, idx) + segment + data.substr(length + idx); + } + } + + + return BinaryReader; +}); + +// Included from: src/javascript/runtime/html5/image/JPEGHeaders.js + +/** + * JPEGHeaders.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEGHeaders +@private +*/ +define("moxie/runtime/html5/image/JPEGHeaders", [ + "moxie/runtime/html5/utils/BinaryReader", + "moxie/core/Exceptions" +], function(BinaryReader, x) { + + return function JPEGHeaders(data) { + var headers = [], _br, idx, marker, length = 0; + + _br = new BinaryReader(data); + + // Check if data is jpeg + if (_br.SHORT(0) !== 0xFFD8) { + _br.clear(); + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + idx = 2; + + while (idx <= _br.length()) { + marker = _br.SHORT(idx); + + // omit RST (restart) markers + if (marker >= 0xFFD0 && marker <= 0xFFD7) { + idx += 2; + continue; + } + + // no headers allowed after SOS marker + if (marker === 0xFFDA || marker === 0xFFD9) { + break; + } + + length = _br.SHORT(idx + 2) + 2; + + // APPn marker detected + if (marker >= 0xFFE1 && marker <= 0xFFEF) { + headers.push({ + hex: marker, + name: 'APP' + (marker & 0x000F), + start: idx, + length: length, + segment: _br.SEGMENT(idx, length) + }); + } + + idx += length; + } + + _br.clear(); + + return { + headers: headers, + + restore: function(data) { + var max, i, br; + + br = new BinaryReader(data); + + idx = br.SHORT(2) == 0xFFE0 ? 4 + br.SHORT(4) : 2; + + for (i = 0, max = headers.length; i < max; i++) { + br.SEGMENT(idx, 0, headers[i].segment); + idx += headers[i].length; + } + + data = br.SEGMENT(); + br.clear(); + return data; + }, + + strip: function(data) { + var br, headers, jpegHeaders, i; + + jpegHeaders = new JPEGHeaders(data); + headers = jpegHeaders.headers; + jpegHeaders.purge(); + + br = new BinaryReader(data); + + i = headers.length; + while (i--) { + br.SEGMENT(headers[i].start, headers[i].length, ''); + } + + data = br.SEGMENT(); + br.clear(); + return data; + }, + + get: function(name) { + var array = []; + + for (var i = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + array.push(headers[i].segment); + } + } + return array; + }, + + set: function(name, segment) { + var array = [], i, ii, max; + + if (typeof(segment) === 'string') { + array.push(segment); + } else { + array = segment; + } + + for (i = ii = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + headers[i].segment = array[ii]; + headers[i].length = array[ii].length; + ii++; + } + if (ii >= array.length) { + break; + } + } + }, + + purge: function() { + this.headers = headers = []; + } + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/ExifParser.js + +/** + * ExifParser.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/ExifParser +@private +*/ +define("moxie/runtime/html5/image/ExifParser", [ + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader", + "moxie/core/Exceptions" +], function(Basic, BinaryReader, x) { + + function ExifParser(data) { + var __super__, tags, tagDescs, offsets, idx, Tiff; + + BinaryReader.call(this, data); + + tags = { + tiff: { + /* + The image orientation viewed in terms of rows and columns. + + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + 0x0112: 'Orientation', + 0x010E: 'ImageDescription', + 0x010F: 'Make', + 0x0110: 'Model', + 0x0131: 'Software', + 0x8769: 'ExifIFDPointer', + 0x8825: 'GPSInfoIFDPointer' + }, + exif: { + 0x9000: 'ExifVersion', + 0xA001: 'ColorSpace', + 0xA002: 'PixelXDimension', + 0xA003: 'PixelYDimension', + 0x9003: 'DateTimeOriginal', + 0x829A: 'ExposureTime', + 0x829D: 'FNumber', + 0x8827: 'ISOSpeedRatings', + 0x9201: 'ShutterSpeedValue', + 0x9202: 'ApertureValue' , + 0x9207: 'MeteringMode', + 0x9208: 'LightSource', + 0x9209: 'Flash', + 0x920A: 'FocalLength', + 0xA402: 'ExposureMode', + 0xA403: 'WhiteBalance', + 0xA406: 'SceneCaptureType', + 0xA404: 'DigitalZoomRatio', + 0xA408: 'Contrast', + 0xA409: 'Saturation', + 0xA40A: 'Sharpness' + }, + gps: { + 0x0000: 'GPSVersionID', + 0x0001: 'GPSLatitudeRef', + 0x0002: 'GPSLatitude', + 0x0003: 'GPSLongitudeRef', + 0x0004: 'GPSLongitude' + }, + + thumb: { + 0x0201: 'JPEGInterchangeFormat', + 0x0202: 'JPEGInterchangeFormatLength' + } + }; + + tagDescs = { + 'ColorSpace': { + 1: 'sRGB', + 0: 'Uncalibrated' + }, + + 'MeteringMode': { + 0: 'Unknown', + 1: 'Average', + 2: 'CenterWeightedAverage', + 3: 'Spot', + 4: 'MultiSpot', + 5: 'Pattern', + 6: 'Partial', + 255: 'Other' + }, + + 'LightSource': { + 1: 'Daylight', + 2: 'Fliorescent', + 3: 'Tungsten', + 4: 'Flash', + 9: 'Fine weather', + 10: 'Cloudy weather', + 11: 'Shade', + 12: 'Daylight fluorescent (D 5700 - 7100K)', + 13: 'Day white fluorescent (N 4600 -5400K)', + 14: 'Cool white fluorescent (W 3900 - 4500K)', + 15: 'White fluorescent (WW 3200 - 3700K)', + 17: 'Standard light A', + 18: 'Standard light B', + 19: 'Standard light C', + 20: 'D55', + 21: 'D65', + 22: 'D75', + 23: 'D50', + 24: 'ISO studio tungsten', + 255: 'Other' + }, + + 'Flash': { + 0x0000: 'Flash did not fire', + 0x0001: 'Flash fired', + 0x0005: 'Strobe return light not detected', + 0x0007: 'Strobe return light detected', + 0x0009: 'Flash fired, compulsory flash mode', + 0x000D: 'Flash fired, compulsory flash mode, return light not detected', + 0x000F: 'Flash fired, compulsory flash mode, return light detected', + 0x0010: 'Flash did not fire, compulsory flash mode', + 0x0018: 'Flash did not fire, auto mode', + 0x0019: 'Flash fired, auto mode', + 0x001D: 'Flash fired, auto mode, return light not detected', + 0x001F: 'Flash fired, auto mode, return light detected', + 0x0020: 'No flash function', + 0x0041: 'Flash fired, red-eye reduction mode', + 0x0045: 'Flash fired, red-eye reduction mode, return light not detected', + 0x0047: 'Flash fired, red-eye reduction mode, return light detected', + 0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode', + 0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected', + 0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected', + 0x0059: 'Flash fired, auto mode, red-eye reduction mode', + 0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode', + 0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode' + }, + + 'ExposureMode': { + 0: 'Auto exposure', + 1: 'Manual exposure', + 2: 'Auto bracket' + }, + + 'WhiteBalance': { + 0: 'Auto white balance', + 1: 'Manual white balance' + }, + + 'SceneCaptureType': { + 0: 'Standard', + 1: 'Landscape', + 2: 'Portrait', + 3: 'Night scene' + }, + + 'Contrast': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + 'Saturation': { + 0: 'Normal', + 1: 'Low saturation', + 2: 'High saturation' + }, + + 'Sharpness': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + // GPS related + 'GPSLatitudeRef': { + N: 'North latitude', + S: 'South latitude' + }, + + 'GPSLongitudeRef': { + E: 'East longitude', + W: 'West longitude' + } + }; + + offsets = { + tiffHeader: 10 + }; + + idx = offsets.tiffHeader; + + __super__ = { + clear: this.clear + }; + + // Public functions + Basic.extend(this, { + + read: function() { + try { + return ExifParser.prototype.read.apply(this, arguments); + } catch (ex) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + }, + + + write: function() { + try { + return ExifParser.prototype.write.apply(this, arguments); + } catch (ex) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + }, + + + UNDEFINED: function() { + return this.BYTE.apply(this, arguments); + }, + + + RATIONAL: function(idx) { + return this.LONG(idx) / this.LONG(idx + 4) + }, + + + SRATIONAL: function(idx) { + return this.SLONG(idx) / this.SLONG(idx + 4) + }, + + ASCII: function(idx) { + return this.CHAR(idx); + }, + + TIFF: function() { + return Tiff || null; + }, + + + EXIF: function() { + var Exif = null; + + if (offsets.exifIFD) { + try { + Exif = extractTags.call(this, offsets.exifIFD, tags.exif); + } catch(ex) { + return null; + } + + // Fix formatting of some tags + if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') { + for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) { + exifVersion += String.fromCharCode(Exif.ExifVersion[i]); + } + Exif.ExifVersion = exifVersion; + } + } + + return Exif; + }, + + + GPS: function() { + var GPS = null; + + if (offsets.gpsIFD) { + try { + GPS = extractTags.call(this, offsets.gpsIFD, tags.gps); + } catch (ex) { + return null; + } + + // iOS devices (and probably some others) do not put in GPSVersionID tag (why?..) + if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') { + GPS.GPSVersionID = GPS.GPSVersionID.join('.'); + } + } + + return GPS; + }, + + + thumb: function() { + if (offsets.IFD1) { + try { + var IFD1Tags = extractTags.call(this, offsets.IFD1, tags.thumb); + + if ('JPEGInterchangeFormat' in IFD1Tags) { + return this.SEGMENT(offsets.tiffHeader + IFD1Tags.JPEGInterchangeFormat, IFD1Tags.JPEGInterchangeFormatLength); + } + } catch (ex) {} + } + return null; + }, + + + setExif: function(tag, value) { + // Right now only setting of width/height is possible + if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') { return false; } + + return setTag.call(this, 'exif', tag, value); + }, + + + clear: function() { + __super__.clear(); + data = tags = tagDescs = Tiff = offsets = __super__ = null; + } + }); + + + // Check if that's APP1 and that it has EXIF + if (this.SHORT(0) !== 0xFFE1 || this.STRING(4, 5).toUpperCase() !== "EXIF\0") { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + // Set read order of multi-byte data + this.littleEndian = (this.SHORT(idx) == 0x4949); + + // Check if always present bytes are indeed present + if (this.SHORT(idx+=2) !== 0x002A) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + offsets.IFD0 = offsets.tiffHeader + this.LONG(idx += 2); + Tiff = extractTags.call(this, offsets.IFD0, tags.tiff); + + if ('ExifIFDPointer' in Tiff) { + offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer; + delete Tiff.ExifIFDPointer; + } + + if ('GPSInfoIFDPointer' in Tiff) { + offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer; + delete Tiff.GPSInfoIFDPointer; + } + + if (Basic.isEmptyObj(Tiff)) { + Tiff = null; + } + + // check if we have a thumb as well + var IFD1Offset = this.LONG(offsets.IFD0 + this.SHORT(offsets.IFD0) * 12 + 2); + if (IFD1Offset) { + offsets.IFD1 = offsets.tiffHeader + IFD1Offset; + } + + + function extractTags(IFD_offset, tags2extract) { + var data = this; + var length, i, tag, type, count, size, offset, value, values = [], hash = {}; + + var types = { + 1 : 'BYTE', + 7 : 'UNDEFINED', + 2 : 'ASCII', + 3 : 'SHORT', + 4 : 'LONG', + 5 : 'RATIONAL', + 9 : 'SLONG', + 10: 'SRATIONAL' + }; + + var sizes = { + 'BYTE' : 1, + 'UNDEFINED' : 1, + 'ASCII' : 1, + 'SHORT' : 2, + 'LONG' : 4, + 'RATIONAL' : 8, + 'SLONG' : 4, + 'SRATIONAL' : 8 + }; + + length = data.SHORT(IFD_offset); + + // The size of APP1 including all these elements shall not exceed the 64 Kbytes specified in the JPEG standard. + + for (i = 0; i < length; i++) { + values = []; + + // Set binary reader pointer to beginning of the next tag + offset = IFD_offset + 2 + i*12; + + tag = tags2extract[data.SHORT(offset)]; + + if (tag === undefined) { + continue; // Not the tag we requested + } + + type = types[data.SHORT(offset+=2)]; + count = data.LONG(offset+=2); + size = sizes[type]; + + if (!size) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + offset += 4; + + // tag can only fit 4 bytes of data, if data is larger we should look outside + if (size * count > 4) { + // instead of data tag contains an offset of the data + offset = data.LONG(offset) + offsets.tiffHeader; + } + + // in case we left the boundaries of data throw an early exception + if (offset + size * count >= this.length()) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + // special care for the string + if (type === 'ASCII') { + hash[tag] = Basic.trim(data.STRING(offset, count).replace(/\0$/, '')); // strip trailing NULL + continue; + } else { + values = data.asArray(type, offset, count); + value = (count == 1 ? values[0] : values); + + if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') { + hash[tag] = tagDescs[tag][value]; + } else { + hash[tag] = value; + } + } + } + + return hash; + } + + // At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported + function setTag(ifd, tag, value) { + var offset, length, tagOffset, valueOffset = 0; + + // If tag name passed translate into hex key + if (typeof(tag) === 'string') { + var tmpTags = tags[ifd.toLowerCase()]; + for (var hex in tmpTags) { + if (tmpTags[hex] === tag) { + tag = hex; + break; + } + } + } + offset = offsets[ifd.toLowerCase() + 'IFD']; + length = this.SHORT(offset); + + for (var i = 0; i < length; i++) { + tagOffset = offset + 12 * i + 2; + + if (this.SHORT(tagOffset) == tag) { + valueOffset = tagOffset + 8; + break; + } + } + + if (!valueOffset) { + return false; + } + + try { + this.write(valueOffset, value, 4); + } catch(ex) { + return false; + } + + return true; + } + } + + ExifParser.prototype = BinaryReader.prototype; + + return ExifParser; +}); + +// Included from: src/javascript/runtime/html5/image/JPEG.js + +/** + * JPEG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEG +@private +*/ +define("moxie/runtime/html5/image/JPEG", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEGHeaders", + "moxie/runtime/html5/utils/BinaryReader", + "moxie/runtime/html5/image/ExifParser" +], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) { + + function JPEG(data) { + var _br, _hm, _ep, _info; + + _br = new BinaryReader(data); + + // check if it is jpeg + if (_br.SHORT(0) !== 0xFFD8) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + // backup headers + _hm = new JPEGHeaders(data); + + // extract exif info + try { + _ep = new ExifParser(_hm.get('app1')[0]); + } catch(ex) {} + + // get dimensions + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/jpeg', + + size: _br.length(), + + width: _info && _info.width || 0, + + height: _info && _info.height || 0, + + setExif: function(tag, value) { + if (!_ep) { + return false; // or throw an exception + } + + if (Basic.typeOf(tag) === 'object') { + Basic.each(tag, function(value, tag) { + _ep.setExif(tag, value); + }); + } else { + _ep.setExif(tag, value); + } + + // update internal headers + _hm.set('app1', _ep.SEGMENT()); + }, + + writeHeaders: function() { + if (!arguments.length) { + // if no arguments passed, update headers internally + return _hm.restore(data); + } + return _hm.restore(arguments[0]); + }, + + stripHeaders: function(data) { + return _hm.strip(data); + }, + + purge: function() { + _purge.call(this); + } + }); + + if (_ep) { + this.meta = { + tiff: _ep.TIFF(), + exif: _ep.EXIF(), + gps: _ep.GPS(), + thumb: _getThumb() + }; + } + + + function _getDimensions(br) { + var idx = 0 + , marker + , length + ; + + if (!br) { + br = _br; + } + + // examine all through the end, since some images might have very large APP segments + while (idx <= br.length()) { + marker = br.SHORT(idx += 2); + + if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn + idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte) + return { + height: br.SHORT(idx), + width: br.SHORT(idx += 2) + }; + } + length = br.SHORT(idx += 2); + idx += length - 2; + } + return null; + } + + + function _getThumb() { + var data = _ep.thumb() + , br + , info + ; + + if (data) { + br = new BinaryReader(data); + info = _getDimensions(br); + br.clear(); + + if (info) { + info.data = data; + return info; + } + } + return null; + } + + + function _purge() { + if (!_ep || !_hm || !_br) { + return; // ignore any repeating purge requests + } + _ep.clear(); + _hm.purge(); + _br.clear(); + _info = _hm = _ep = _br = null; + } + } + + return JPEG; +}); + +// Included from: src/javascript/runtime/html5/image/PNG.js + +/** + * PNG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/PNG +@private +*/ +define("moxie/runtime/html5/image/PNG", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader" +], function(x, Basic, BinaryReader) { + + function PNG(data) { + var _br, _hm, _ep, _info; + + _br = new BinaryReader(data); + + // check if it's png + (function() { + var idx = 0, i = 0 + , signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A] + ; + + for (i = 0; i < signature.length; i++, idx += 2) { + if (signature[i] != _br.SHORT(idx)) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + } + }()); + + function _getDimensions() { + var chunk, idx; + + chunk = _getChunkAt.call(this, 8); + + if (chunk.type == 'IHDR') { + idx = chunk.start; + return { + width: _br.LONG(idx), + height: _br.LONG(idx += 4) + }; + } + return null; + } + + function _purge() { + if (!_br) { + return; // ignore any repeating purge requests + } + _br.clear(); + data = _info = _hm = _ep = _br = null; + } + + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/png', + + size: _br.length(), + + width: _info.width, + + height: _info.height, + + purge: function() { + _purge.call(this); + } + }); + + // for PNG we can safely trigger purge automatically, as we do not keep any data for later + _purge.call(this); + + function _getChunkAt(idx) { + var length, type, start, CRC; + + length = _br.LONG(idx); + type = _br.STRING(idx += 4, 4); + start = idx += 4; + CRC = _br.LONG(idx + length); + + return { + length: length, + type: type, + start: start, + CRC: CRC + }; + } + } + + return PNG; +}); + +// Included from: src/javascript/runtime/html5/image/ImageInfo.js + +/** + * ImageInfo.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +Optional image investigation tool for HTML5 runtime. Provides the following features: +- ability to distinguish image type (JPEG or PNG) by signature +- ability to extract image width/height directly from it's internals, without preloading in memory (fast) +- ability to extract APP headers from JPEGs (Exif, GPS, etc) +- ability to replace width/height tags in extracted JPEG headers +- ability to restore APP headers, that were for example stripped during image manipulation + +@class moxie/runtime/html5/image/ImageInfo +@private +@param {String} data Image source as binary string +*/ +define("moxie/runtime/html5/image/ImageInfo", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEG", + "moxie/runtime/html5/image/PNG" +], function(Basic, x, JPEG, PNG) { + + return function(data) { + var _cs = [JPEG, PNG], _img; + + // figure out the format, throw: ImageError.WRONG_FORMAT if not supported + _img = (function() { + for (var i = 0; i < _cs.length; i++) { + try { + return new _cs[i](data); + } catch (ex) { + // console.info(ex); + } + } + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + }()); + + Basic.extend(this, { + /** + Image Mime Type extracted from it's depths + + @property type + @type {String} + @default '' + */ + type: '', + + /** + Image size in bytes + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Image width extracted from image source + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Image height extracted from image source + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs. + + @method setExif + @param {String} tag Tag to set + @param {Mixed} value Value to assign to the tag + */ + setExif: function() {}, + + /** + Restores headers to the source. + + @method writeHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + writeHeaders: function(data) { + return data; + }, + + /** + Strip all headers from the source. + + @method stripHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + stripHeaders: function(data) { + return data; + }, + + /** + Dispose resources. + + @method purge + */ + purge: function() { + data = null; + } + }); + + Basic.extend(this, _img); + + this.purge = function() { + _img.purge(); + _img = null; + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/ResizerCanvas.js + +/** + * ResizerCanvas.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** + * Resizes image/canvas using canvas + */ +define("moxie/runtime/html5/image/ResizerCanvas", [], function() { + + function scale(image, ratio, resample) { + var sD = image.width > image.height ? 'width' : 'height'; // take the largest side + var dD = Math.round(image[sD] * ratio); + var scaleCapped = false; + + if (resample !== 'nearest' && (ratio < 0.5 || ratio > 2)) { + ratio = ratio < 0.5 ? 0.5 : 2; + scaleCapped = true; + } + + var tCanvas = _scale(image, ratio); + + if (scaleCapped) { + return scale(tCanvas, dD / tCanvas[sD], resample); + } else { + return tCanvas; + } + } + + + function _scale(image, ratio) { + var sW = image.width; + var sH = image.height; + var dW = Math.round(sW * ratio); + var dH = Math.round(sH * ratio); + + var canvas = document.createElement('canvas'); + canvas.width = dW; + canvas.height = dH; + canvas.getContext("2d").drawImage(image, 0, 0, sW, sH, 0, 0, dW, dH); + + image = null; // just in case + return canvas; + } + + return { + scale: scale + }; + +}); + +// Included from: src/javascript/runtime/html5/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/Image +@private +*/ +define("moxie/runtime/html5/image/Image", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/utils/Encode", + "moxie/file/Blob", + "moxie/file/File", + "moxie/runtime/html5/image/ImageInfo", + "moxie/runtime/html5/image/ResizerCanvas", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, Basic, x, Encode, Blob, File, ImageInfo, ResizerCanvas, Mime, Env) { + + function HTML5Image() { + var me = this + , _img, _imgInfo, _canvas, _binStr, _blob + , _modified = false // is set true whenever image is modified + , _preserveHeaders = true + ; + + Basic.extend(this, { + loadFromBlob: function(blob) { + var I = this.getRuntime() + , asBinary = arguments.length > 1 ? arguments[1] : true + ; + + if (!I.can('access_binary')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _blob = blob; + + if (blob.isDetached()) { + _binStr = blob.getSource(); + _preload.call(this, _binStr); + return; + } else { + _readAsDataUrl.call(this, blob.getSource(), function(dataUrl) { + if (asBinary) { + _binStr = _toBinary(dataUrl); + } + _preload.call(this, dataUrl); + }); + } + }, + + loadFromImage: function(img, exact) { + this.meta = img.meta; + + _blob = new File(null, { + name: img.name, + size: img.size, + type: img.type + }); + + _preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL()); + }, + + getInfo: function() { + var I = this.getRuntime(), info; + + if (!_imgInfo && _binStr && I.can('access_image_binary')) { + _imgInfo = new ImageInfo(_binStr); + } + + // this stuff below is definitely having fun with itself + info = { + width: _getImg().width || 0, + height: _getImg().height || 0, + type: _blob.type || Mime.getFileMime(_blob.name), + size: _binStr && _binStr.length || _blob.size || 0, + name: _blob.name || '', + meta: null + }; + + if (_preserveHeaders) { + info.meta = _imgInfo && _imgInfo.meta || this.meta || {}; + + // if data was taken from ImageInfo it will be a binary string, so we convert it to blob + if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(null, { + type: 'image/jpeg', + data: info.meta.thumb.data + }); + } + } + + return info; + }, + + + resize: function(rect, ratio, options) { + var canvas = document.createElement('canvas'); + canvas.width = rect.width; + canvas.height = rect.height; + + canvas.getContext("2d").drawImage(_getImg(), rect.x, rect.y, rect.width, rect.height, 0, 0, canvas.width, canvas.height); + + _canvas = ResizerCanvas.scale(canvas, ratio); + + _preserveHeaders = options.preserveHeaders; + + // rotate if required, according to orientation tag + if (!_preserveHeaders) { + var orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1; + _canvas = _rotateToOrientaion(_canvas, orientation); + } + + this.width = _canvas.width; + this.height = _canvas.height; + + _modified = true; + + this.trigger('Resize'); + }, + + getAsCanvas: function() { + if (!_canvas) { + _canvas = _getCanvas(); + } + _canvas.id = this.uid + '_canvas'; + return _canvas; + }, + + getAsBlob: function(type, quality) { + if (type !== this.type) { + _modified = true; // reconsider the state + return new File(null, { + name: _blob.name || '', + type: type, + data: me.getAsDataURL(type, quality) + }); + } + return new File(null, { + name: _blob.name || '', + type: type, + data: me.getAsBinaryString(type, quality) + }); + }, + + getAsDataURL: function(type) { + var quality = arguments[1] || 90; + + // if image has not been modified, return the source right away + if (!_modified) { + return _img.src; + } + + // make sure we have a canvas to work with + _getCanvas(); + + if ('image/jpeg' !== type) { + return _canvas.toDataURL('image/png'); + } else { + try { + // older Geckos used to result in an exception on quality argument + return _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + return _canvas.toDataURL('image/jpeg'); + } + } + }, + + getAsBinaryString: function(type, quality) { + // if image has not been modified, return the source right away + if (!_modified) { + // if image was not loaded from binary string + if (!_binStr) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } + return _binStr; + } + + if ('image/jpeg' !== type) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } else { + var dataUrl; + + // if jpeg + if (!quality) { + quality = 90; + } + + // make sure we have a canvas to work with + _getCanvas(); + + try { + // older Geckos used to result in an exception on quality argument + dataUrl = _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + dataUrl = _canvas.toDataURL('image/jpeg'); + } + + _binStr = _toBinary(dataUrl); + + if (_imgInfo) { + _binStr = _imgInfo.stripHeaders(_binStr); + + if (_preserveHeaders) { + // update dimensions info in exif + if (_imgInfo.meta && _imgInfo.meta.exif) { + _imgInfo.setExif({ + PixelXDimension: this.width, + PixelYDimension: this.height + }); + } + + // re-inject the headers + _binStr = _imgInfo.writeHeaders(_binStr); + } + + // will be re-created from fresh on next getInfo call + _imgInfo.purge(); + _imgInfo = null; + } + } + + _modified = false; + + return _binStr; + }, + + destroy: function() { + me = null; + _purge.call(this); + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + + function _getImg() { + if (!_canvas && !_img) { + throw new x.ImageError(x.DOMException.INVALID_STATE_ERR); + } + return _canvas || _img; + } + + + function _getCanvas() { + var canvas = _getImg(); + if (canvas.nodeName.toLowerCase() == 'canvas') { + return canvas; + } + _canvas = document.createElement('canvas'); + _canvas.width = canvas.width; + _canvas.height = canvas.height; + _canvas.getContext("2d").drawImage(canvas, 0, 0); + return _canvas; + } + + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + + + function _toDataUrl(str, type) { + return 'data:' + (type || '') + ';base64,' + Encode.btoa(str); + } + + + function _preload(str) { + var comp = this; + + _img = new Image(); + _img.onerror = function() { + _purge.call(this); + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + _img.onload = function() { + comp.trigger('load'); + }; + + _img.src = str.substr(0, 5) == 'data:' ? str : _toDataUrl(str, _blob.type); + } + + + function _readAsDataUrl(file, callback) { + var comp = this, fr; + + // use FileReader if it's available + if (window.FileReader) { + fr = new FileReader(); + fr.onload = function() { + callback.call(comp, this.result); + }; + fr.onerror = function() { + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + fr.readAsDataURL(file); + } else { + return callback.call(this, file.getAsDataURL()); + } + } + + /** + * Transform canvas coordination according to specified frame size and orientation + * Orientation value is from EXIF tag + * @author Shinichi Tomita + */ + function _rotateToOrientaion(img, orientation) { + var RADIANS = Math.PI/180; + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var width = img.width; + var height = img.height; + + if (Basic.inArray(orientation, [5,6,7,8]) > -1) { + canvas.width = height; + canvas.height = width; + } else { + canvas.width = width; + canvas.height = height; + } + + /** + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + switch (orientation) { + case 2: + // horizontal flip + ctx.translate(width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180 rotate left + ctx.translate(width, height); + ctx.rotate(180 * RADIANS); + break; + case 4: + // vertical flip + ctx.translate(0, height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(90 * RADIANS); + ctx.scale(1, -1); + break; + case 6: + // 90 rotate right + ctx.rotate(90 * RADIANS); + ctx.translate(0, -height); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(90 * RADIANS); + ctx.translate(width, -height); + ctx.scale(-1, 1); + break; + case 8: + // 90 rotate left + ctx.rotate(-90 * RADIANS); + ctx.translate(-width, 0); + break; + } + + ctx.drawImage(img, 0, 0, width, height); + return canvas; + } + + + function _purge() { + if (_imgInfo) { + _imgInfo.purge(); + _imgInfo = null; + } + + _binStr = _img = _canvas = _blob = null; + _modified = false; + } + } + + return (extensions.Image = HTML5Image); +}); + +// Included from: src/javascript/runtime/flash/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Flash runtime. + +@class moxie/runtime/flash/Runtime +@private +*/ +define("moxie/runtime/flash/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = 'flash', extensions = {}; + + /** + Get the version of the Flash Player + + @method getShimVersion + @private + @return {Number} Flash Player version + */ + function getShimVersion() { + var version; + + try { + version = navigator.plugins['Shockwave Flash']; + version = version.description; + } catch (e1) { + try { + version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); + } catch (e2) { + version = '0.0'; + } + } + version = version.match(/\d+/g); + return parseFloat(version[0] + '.' + version[1]); + } + + + /** + Cross-browser SWF removal + - Especially needed to safely and completely remove a SWF in Internet Explorer + + Originated from SWFObject v2.2 + */ + function removeSWF(id) { + var obj = Dom.get(id); + if (obj && obj.nodeName == "OBJECT") { + if (Env.browser === 'IE') { + obj.style.display = "none"; + (function onInit(){ + // http://msdn.microsoft.com/en-us/library/ie/ms534360(v=vs.85).aspx + if (obj.readyState == 4) { + removeObjectInIE(id); + } + else { + setTimeout(onInit, 10); + } + })(); + } + else { + obj.parentNode.removeChild(obj); + } + } + } + + + function removeObjectInIE(id) { + var obj = Dom.get(id); + if (obj) { + for (var i in obj) { + if (typeof obj[i] == "function") { + obj[i] = null; + } + } + obj.parentNode.removeChild(obj); + } + } + + /** + Constructor for the Flash Runtime + */ + function FlashRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ swf_url: Env.swf_url }, options); + + Runtime.call(this, options, type, { + access_binary: function(value) { + return value && I.mode === 'browser'; + }, + access_image_binary: function(value) { + return value && I.mode === 'browser'; + }, + display_media: Runtime.capTest(defined('moxie/image/Image')), + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: function() { + return I.mode === 'client'; + }, + resize_image: Runtime.capTrue, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; + }, + return_status_code: function(code) { + return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: function(value) { + return value && I.mode === 'browser'; + }, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'browser'; + }, + send_multipart: Runtime.capTrue, + slice_blob: function(value) { + return value && I.mode === 'browser'; + }, + stream_upload: function(value) { + return value && I.mode === 'browser'; + }, + summon_file_dialog: false, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; + }, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + access_binary: function(value) { + return value ? 'browser' : 'client'; + }, + access_image_binary: function(value) { + return value ? 'browser' : 'client'; + }, + report_upload_progress: function(value) { + return value ? 'browser' : 'client'; + }, + return_response_type: function(responseType) { + return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; + }, + send_binary_string: function(value) { + return value ? 'browser' : 'client'; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'browser' : 'client'; + }, + slice_blob: function(value) { + return value ? 'browser' : 'client'; + }, + stream_upload: function(value) { + return value ? 'client' : 'browser'; + }, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; + } + }, 'client'); + + + // minimal requirement for Flash Player version + if (getShimVersion() < 11.3) { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tFlash didn't meet minimal version requirement (11.3)."); + } + + this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before + } + + + Basic.extend(this, { + + getShim: function() { + return Dom.get(this.uid); + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init: function() { + var html, el, container; + + container = this.getShimContainer(); + + // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) + Basic.extend(container.style, { + position: 'absolute', + top: '-8px', + left: '-8px', + width: '9px', + height: '9px', + overflow: 'hidden' + }); + + // insert flash object + html = '' + + '' + + '' + + '' + + ''; + + if (Env.browser === 'IE') { + el = document.createElement('div'); + container.appendChild(el); + el.outerHTML = html; + el = container = null; // just in case + } else { + container.innerHTML = html; + } + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tFlash failed to initialize within a specified period of time (typically 5s)."); + } + } + }, 5000); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + removeSWF(I.uid); // SWF removal requires special care in IE + + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, FlashRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/flash/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/Blob +@private +*/ +define("moxie/runtime/flash/file/Blob", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var FlashBlob = { + slice: function(blob, start, end, type) { + var self = this.getRuntime(); + + if (start < 0) { + start = Math.max(blob.size + start, 0); + } else if (start > 0) { + start = Math.min(start, blob.size); + } + + if (end < 0) { + end = Math.max(blob.size + end, 0); + } else if (end > 0) { + end = Math.min(end, blob.size); + } + + blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); + + if (blob) { + blob = new Blob(self.uid, blob); + } + return blob; + } + }; + + return (extensions.Blob = FlashBlob); +}); + +// Included from: src/javascript/runtime/flash/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileInput +@private +*/ +define("moxie/runtime/flash/file/FileInput", [ + "moxie/runtime/flash/Runtime", + "moxie/file/File", + "moxie/core/utils/Dom", + "moxie/core/utils/Basic" +], function(extensions, File, Dom, Basic) { + + var FileInput = { + init: function(options) { + var comp = this, I = this.getRuntime(); + var browseButton = Dom.get(options.browse_button); + + if (browseButton) { + browseButton.setAttribute('tabindex', -1); + browseButton = null; + } + + this.bind("Change", function() { + var files = I.shimExec.call(comp, 'FileInput', 'getFiles'); + comp.files = []; + Basic.each(files, function(file) { + comp.files.push(new File(I.uid, file)); + }); + }, 999); + + this.getRuntime().shimExec.call(this, 'FileInput', 'init', { + accept: options.accept, + multiple: options.multiple + }); + + this.trigger('ready'); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/flash/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReader +@private +*/ +define("moxie/runtime/flash/file/FileReader", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReader = { + read: function(op, blob) { + var comp = this; + + comp.result = ''; + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + comp.result = 'data:' + (blob.type || '') + ';base64,'; + } + + comp.bind('Progress', function(e, data) { + if (data) { + comp.result += _formatData(data, op); + } + }, 999); + + return comp.getRuntime().shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); + } + }; + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/flash/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReaderSync +@private +*/ +define("moxie/runtime/flash/file/FileReaderSync", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReaderSync = { + read: function(op, blob) { + var result, self = this.getRuntime(); + + result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); + if (!result) { + return null; // or throw ex + } + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + result = 'data:' + (blob.type || '') + ';base64,' + result; + } + + return _formatData(result, op, blob.type); + } + }; + + return (extensions.FileReaderSync = FileReaderSync); +}); + +// Included from: src/javascript/runtime/flash/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/runtime/Transporter +@private +*/ +define("moxie/runtime/flash/runtime/Transporter", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var Transporter = { + getAsBlob: function(type) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + } + }; + + return (extensions.Transporter = Transporter); +}); + +// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/flash/xhr/XMLHttpRequest", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/file/Blob", + "moxie/file/File", + "moxie/file/FileReaderSync", + "moxie/runtime/flash/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/runtime/Transporter", + "moxie/runtime/flash/runtime/Transporter" +], function(extensions, Basic, Blob, File, FileReaderSync, FileReaderSyncFlash, FormData, Transporter, TransporterFlash) { + + var XMLHttpRequest = { + + send: function(meta, data) { + var target = this, self = target.getRuntime(); + + function send() { + meta.transport = self.mode; + self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); + } + + + function appendBlob(name, blob) { + self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); + data = null; + send(); + } + + + function attachBlob(blob, cb) { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + cb(this.result); + }); + + tr.transport(blob.getSource(), blob.type, { + ruid: self.uid + }); + } + + // copy over the headers if any + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object + }); + } + + // transfer over multipart params and blob itself + if (data instanceof FormData) { + var blobField; + data.each(function(value, name) { + if (value instanceof Blob) { + blobField = name; + } else { + self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); + } + }); + + if (!data.hasBlob()) { + data = null; + send(); + } else { + var blob = data.getBlob(); + if (blob.isDetached()) { + attachBlob(blob, function(attachedBlob) { + blob.destroy(); + appendBlob(blobField, attachedBlob); + }); + } else { + appendBlob(blobField, blob); + } + } + } else if (data instanceof Blob) { + if (data.isDetached()) { + attachBlob(data, function(attachedBlob) { + data.destroy(); + data = attachedBlob.uid; + send(); + }); + } else { + data = data.uid; + send(); + } + } else { + send(); + } + }, + + getResponse: function(responseType) { + var frs, blob, self = this.getRuntime(); + + blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); + + if (blob) { + blob = new File(self.uid, blob); + + if ('blob' === responseType) { + return blob; + } + + try { + frs = new FileReaderSync(); + + if (!!~Basic.inArray(responseType, ["", "text"])) { + return frs.readAsText(blob); + } else if ('json' === responseType && !!window.JSON) { + return JSON.parse(frs.readAsText(blob)); + } + } finally { + blob.destroy(); + } + } + return null; + }, + + abort: function(upload_complete_flag) { + var self = this.getRuntime(); + + self.shimExec.call(this, 'XMLHttpRequest', 'abort'); + + this.dispatchEvent('readystatechange'); + // this.dispatchEvent('progress'); + this.dispatchEvent('abort'); + + //if (!upload_complete_flag) { + // this.dispatchEvent('uploadprogress'); + //} + } + }; + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/flash/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/image/Image +@private +*/ +define("moxie/runtime/flash/image/Image", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/Transporter", + "moxie/file/Blob", + "moxie/file/FileReaderSync" +], function(extensions, Basic, Transporter, Blob, FileReaderSync) { + + var Image = { + loadFromBlob: function(blob) { + var comp = this, self = comp.getRuntime(); + + function exec(srcBlob) { + self.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid); + comp = self = null; + } + + if (blob.isDetached()) { // binary string + var tr = new Transporter(); + tr.bind("TransportingComplete", function() { + exec(tr.result.getSource()); + }); + tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); + } else { + exec(blob.getSource()); + } + }, + + loadFromImage: function(img) { + var self = this.getRuntime(); + return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid); + }, + + getInfo: function() { + var self = this.getRuntime() + , info = self.shimExec.call(this, 'Image', 'getInfo') + ; + + if (info.meta && info.meta.thumb && info.meta.thumb.data && !(self.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data); + } + return info; + }, + + getAsBlob: function(type, quality) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + }, + + getAsDataURL: function() { + var self = this.getRuntime() + , blob = self.Image.getAsBlob.apply(this, arguments) + , frs + ; + if (!blob) { + return null; + } + frs = new FileReaderSync(); + return frs.readAsDataURL(blob); + } + }; + + return (extensions.Image = Image); +}); + +// Included from: src/javascript/runtime/silverlight/Runtime.js + +/** + * RunTime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Silverlight runtime. + +@class moxie/runtime/silverlight/Runtime +@private +*/ +define("moxie/runtime/silverlight/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = "silverlight", extensions = {}; + + function isInstalled(version) { + var isVersionSupported = false, control = null, actualVer, + actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0; + + try { + try { + control = new ActiveXObject('AgControl.AgControl'); + + if (control.IsVersionSupported(version)) { + isVersionSupported = true; + } + + control = null; + } catch (e) { + var plugin = navigator.plugins["Silverlight Plug-In"]; + + if (plugin) { + actualVer = plugin.description; + + if (actualVer === "1.0.30226.2") { + actualVer = "2.0.30226.2"; + } + + actualVerArray = actualVer.split("."); + + while (actualVerArray.length > 3) { + actualVerArray.pop(); + } + + while ( actualVerArray.length < 4) { + actualVerArray.push(0); + } + + reqVerArray = version.split("."); + + while (reqVerArray.length > 4) { + reqVerArray.pop(); + } + + do { + requiredVersionPart = parseInt(reqVerArray[index], 10); + actualVersionPart = parseInt(actualVerArray[index], 10); + index++; + } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) { + isVersionSupported = true; + } + } + } + } catch (e2) { + isVersionSupported = false; + } + + return isVersionSupported; + } + + /** + Constructor for the Silverlight Runtime + */ + function SilverlightRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ xap_url: Env.xap_url }, options); + + Runtime.call(this, options, type, { + access_binary: Runtime.capTrue, + access_image_binary: Runtime.capTrue, + display_media: Runtime.capTest(defined('moxie/image/Image')), + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: Runtime.capTrue, + resize_image: Runtime.capTrue, + return_response_headers: function(value) { + return value && I.mode === 'client'; + }, + return_response_type: function(responseType) { + if (responseType !== 'json') { + return true; + } else { + return !!window.JSON; + } + }, + return_status_code: function(code) { + return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: Runtime.capTrue, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'client'; + }, + send_multipart: Runtime.capTrue, + slice_blob: Runtime.capTrue, + stream_upload: true, + summon_file_dialog: false, + upload_filesize: Runtime.capTrue, + use_http_method: function(methods) { + return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + return_response_headers: function(value) { + return value ? 'client' : 'browser'; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser']; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'client' : 'browser'; + }, + use_http_method: function(methods) { + return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser']; + } + }); + + + // minimal requirement + if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tSilverlight is not installed or minimal version (2.0.31005.0) requirement not met (not likely)."); + } + + this.mode = false; + } + + + Basic.extend(this, { + getShim: function() { + return Dom.get(this.uid).content.Moxie; + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init : function() { + var container; + + container = this.getShimContainer(); + + container.innerHTML = '' + + '' + + '' + + '' + + '' + + '' + + ''; + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\Silverlight failed to initialize within a specified period of time (5-10s)."); + } + } + }, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac) + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, SilverlightRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/silverlight/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/Blob +@private +*/ +define("moxie/runtime/silverlight/file/Blob", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/Blob" +], function(extensions, Basic, Blob) { + return (extensions.Blob = Basic.extend({}, Blob)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileInput +@private +*/ +define("moxie/runtime/silverlight/file/FileInput", [ + "moxie/runtime/silverlight/Runtime", + "moxie/file/File", + "moxie/core/utils/Dom", + "moxie/core/utils/Basic" +], function(extensions, File, Dom, Basic) { + + function toFilters(accept) { + var filter = ''; + for (var i = 0; i < accept.length; i++) { + filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.'); + } + return filter; + } + + + var FileInput = { + init: function(options) { + var comp = this, I = this.getRuntime(); + var browseButton = Dom.get(options.browse_button); + + if (browseButton) { + browseButton.setAttribute('tabindex', -1); + browseButton = null; + } + + this.bind("Change", function() { + var files = I.shimExec.call(comp, 'FileInput', 'getFiles'); + comp.files = []; + Basic.each(files, function(file) { + comp.files.push(new File(I.uid, file)); + }); + }, 999); + + I.shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.multiple); + this.trigger('ready'); + }, + + setOption: function(name, value) { + if (name == 'accept') { + value = toFilters(value); + } + this.getRuntime().shimExec.call(this, 'FileInput', 'setOption', name, value); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileDrop +@private +*/ +define("moxie/runtime/silverlight/file/FileDrop", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Dom", + "moxie/core/utils/Events" +], function(extensions, Dom, Events) { + + // not exactly useful, since works only in safari (...crickets...) + var FileDrop = { + init: function() { + var comp = this, self = comp.getRuntime(), dropZone; + + dropZone = self.getShimContainer(); + + Events.addEvent(dropZone, 'dragover', function(e) { + e.preventDefault(); + e.stopPropagation(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragEnter(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragDrop(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + return self.shimExec.call(this, 'FileDrop', 'init'); + } + }; + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReader +@private +*/ +define("moxie/runtime/silverlight/file/FileReader", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReader" +], function(extensions, Basic, FileReader) { + return (extensions.FileReader = Basic.extend({}, FileReader)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReaderSync +@private +*/ +define("moxie/runtime/silverlight/file/FileReaderSync", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReaderSync" +], function(extensions, Basic, FileReaderSync) { + return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync)); +}); + +// Included from: src/javascript/runtime/silverlight/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/runtime/Transporter +@private +*/ +define("moxie/runtime/silverlight/runtime/Transporter", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/runtime/Transporter" +], function(extensions, Basic, Transporter) { + return (extensions.Transporter = Basic.extend({}, Transporter)); +}); + +// Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/xhr/XMLHttpRequest", + "moxie/runtime/silverlight/file/FileReaderSync", + "moxie/runtime/silverlight/runtime/Transporter" +], function(extensions, Basic, XMLHttpRequest, FileReaderSyncSilverlight, TransporterSilverlight) { + return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest)); +}); + +// Included from: src/javascript/runtime/silverlight/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/image/Image +@private +*/ +define("moxie/runtime/silverlight/image/Image", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/file/Blob", + "moxie/runtime/flash/image/Image" +], function(extensions, Basic, Blob, Image) { + return (extensions.Image = Basic.extend({}, Image, { + + getInfo: function() { + var self = this.getRuntime() + , grps = ['tiff', 'exif', 'gps', 'thumb'] + , info = { meta: {} } + , rawInfo = self.shimExec.call(this, 'Image', 'getInfo') + ; + + if (rawInfo.meta) { + Basic.each(grps, function(grp) { + var meta = rawInfo.meta[grp] + , tag + , i + , length + , value + ; + if (meta && meta.keys) { + info.meta[grp] = {}; + for (i = 0, length = meta.keys.length; i < length; i++) { + tag = meta.keys[i]; + value = meta[tag]; + if (value) { + // convert numbers + if (/^(\d|[1-9]\d+)$/.test(value)) { // integer (make sure doesn't start with zero) + value = parseInt(value, 10); + } else if (/^\d*\.\d+$/.test(value)) { // double + value = parseFloat(value); + } + info.meta[grp][tag] = value; + } + } + } + }); + + // save thumb data as blob + if (info.meta && info.meta.thumb && info.meta.thumb.data && !(self.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data); + } + } + + info.width = parseInt(rawInfo.width, 10); + info.height = parseInt(rawInfo.height, 10); + info.size = parseInt(rawInfo.size, 10); + info.type = rawInfo.type; + info.name = rawInfo.name; + + return info; + }, + + resize: function(rect, ratio, opts) { + this.getRuntime().shimExec.call(this, 'Image', 'resize', rect.x, rect.y, rect.width, rect.height, ratio, opts.preserveHeaders, opts.resample); + } + })); +}); + +// Included from: src/javascript/runtime/html4/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML4 runtime. + +@class moxie/runtime/html4/Runtime +@private +*/ +define("moxie/runtime/html4/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = 'html4', extensions = {}; + + function Html4Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + Runtime.call(this, options, type, { + access_binary: Test(window.FileReader || window.File && File.getAsDataURL), + access_image_binary: false, + display_media: Test( + (Env.can('create_canvas') || Env.can('use_data_uri_over32kb')) && + defined('moxie/image/Image') + ), + do_cors: false, + drag_and_drop: false, + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return !( + (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '<')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) || + (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '<')) || + (Env.browser === 'Firefox' && Env.verComp(Env.version, 37, '<')) + ); + }()), + resize_image: function() { + return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); + }, + report_upload_progress: false, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !!~Basic.inArray(responseType, ['text', 'document', '']); + }, + return_status_code: function(code) { + return !Basic.arrayDiff(code, [200, 404]); + }, + select_file: function() { + return Env.can('use_fileinput'); + }, + select_multiple: false, + send_binary_string: false, + send_custom_headers: false, + send_multipart: true, + slice_blob: false, + stream_upload: function() { + return I.can('select_file'); + }, + summon_file_dialog: function() { // yeah... some dirty sniffing here... + return I.can('select_file') && !( + (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '<')) || + (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '<')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) + ); + }, + upload_filesize: True, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }); + + + Basic.extend(this, { + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html4Runtime); + + return extensions; +}); + +// Included from: src/javascript/runtime/html4/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileInput +@private +*/ +define("moxie/runtime/html4/file/FileInput", [ + "moxie/runtime/html4/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, File, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _uid, _mimes = [], _options, _browseBtnZIndex; // save original z-index; + + function addInput() { + var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; + + uid = Basic.guid('uid_'); + + shimContainer = I.getShimContainer(); // we get new ref every time to avoid memory leaks in IE + + if (_uid) { // move previous form out of the view + currForm = Dom.get(_uid + '_form'); + if (currForm) { + Basic.extend(currForm.style, { top: '100%' }); + // it shouldn't be possible to tab into the hidden element + currForm.firstChild.setAttribute('tabindex', -1); + } + } + + // build form in DOM, since innerHTML version not able to submit file for some reason + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', 'post'); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + + Basic.extend(form.style, { + overflow: 'hidden', + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + input = document.createElement('input'); + input.setAttribute('id', uid); + input.setAttribute('type', 'file'); + input.setAttribute('accept', _mimes.join(',')); + + if (I.can('summon_file_dialog')) { + input.setAttribute('tabindex', -1); + } + + Basic.extend(input.style, { + fontSize: '999px', + opacity: 0 + }); + + form.appendChild(input); + shimContainer.appendChild(form); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + if (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) { + Basic.extend(input.style, { + filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" + }); + } + + input.onchange = function() { // there should be only one handler for this + var file; + + if (!this.value) { + return; + } + + if (this.files) { // check if browser is fresh enough + file = this.files[0]; + } else { + file = { + name: this.value + }; + } + + file = new File(I.uid, file); + + // clear event handler + this.onchange = function() {}; + addInput.call(comp); + + comp.files = [file]; + + // substitute all ids with file uids (consider file.uid read-only - we cannot do it the other way around) + input.setAttribute('id', file.uid); + form.setAttribute('id', file.uid + '_form'); + + comp.trigger('change'); + + input = form = null; + }; + + + // route click event to the input + if (I.can('summon_file_dialog')) { + browseButton = Dom.get(_options.browse_button); + Events.removeEvent(browseButton, 'click', comp.uid); + Events.addEvent(browseButton, 'click', function(e) { + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + } + + _uid = uid; + + shimContainer = currForm = browseButton = null; + } + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), shimContainer; + + // figure out accept string + _options = options; + _mimes = Mime.extList2mimes(options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + (function() { + var browseButton, zIndex, top; + + browseButton = Dom.get(options.browse_button); + _browseBtnZIndex = Dom.getStyle(browseButton, 'z-index') || 'auto'; + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + comp.bind('Refresh', function() { + zIndex = parseInt(_browseBtnZIndex, 10) || 1; + + Dom.get(_options.browse_button).style.zIndex = zIndex; + this.getRuntime().getShimContainer().style.zIndex = zIndex - 1; + }); + } else { + // it shouldn't be possible to tab into the hidden element + browseButton.setAttribute('tabindex', -1); + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + browseButton = null; + }()); + + addInput.call(this); + + shimContainer = null; + + // trigger ready event asynchronously + comp.trigger({ + type: 'ready', + async: true + }); + }, + + setOption: function(name, value) { + var I = this.getRuntime(); + var input; + + if (name == 'accept') { + _mimes = value.mimes || Mime.extList2mimes(value, I.can('filter_by_extension')); + } + + // update current input + input = Dom.get(_uid) + if (input) { + input.setAttribute('accept', _mimes.join(',')); + } + }, + + + disable: function(state) { + var input; + + if ((input = Dom.get(_uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + , container = _options && Dom.get(_options.container) + , browseButton = _options && Dom.get(_options.browse_button) + ; + + if (container) { + Events.removeAllEvents(container, this.uid); + } + + if (browseButton) { + Events.removeAllEvents(browseButton, this.uid); + browseButton.style.zIndex = _browseBtnZIndex; // reset to original value + } + + if (shimContainer) { + Events.removeAllEvents(shimContainer, this.uid); + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _uid = _mimes = _options = shimContainer = container = browseButton = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html4/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileReader +@private +*/ +define("moxie/runtime/html4/file/FileReader", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/file/FileReader" +], function(extensions, FileReader) { + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html4/xhr/XMLHttpRequest", [ + "moxie/runtime/html4/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Url", + "moxie/core/Exceptions", + "moxie/core/utils/Events", + "moxie/file/Blob", + "moxie/xhr/FormData" +], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { + + function XMLHttpRequest() { + var _status, _response, _iframe; + + function cleanup(cb) { + var target = this, uid, form, inputs, i, hasFile = false; + + if (!_iframe) { + return; + } + + uid = _iframe.id.replace(/_iframe$/, ''); + + form = Dom.get(uid + '_form'); + if (form) { + inputs = form.getElementsByTagName('input'); + i = inputs.length; + + while (i--) { + switch (inputs[i].getAttribute('type')) { + case 'hidden': + inputs[i].parentNode.removeChild(inputs[i]); + break; + case 'file': + hasFile = true; // flag the case for later + break; + } + } + inputs = []; + + if (!hasFile) { // we need to keep the form for sake of possible retries + form.parentNode.removeChild(form); + } + form = null; + } + + // without timeout, request is marked as canceled (in console) + setTimeout(function() { + Events.removeEvent(_iframe, 'load', target.uid); + if (_iframe.parentNode) { // #382 + _iframe.parentNode.removeChild(_iframe); + } + + // check if shim container has any other children, if - not, remove it as well + var shimContainer = target.getRuntime().getShimContainer(); + if (!shimContainer.children.length) { + shimContainer.parentNode.removeChild(shimContainer); + } + + shimContainer = _iframe = null; + cb(); + }, 1); + } + + Basic.extend(this, { + send: function(meta, data) { + var target = this, I = target.getRuntime(), uid, form, input, blob; + + _status = _response = null; + + function createIframe() { + var container = I.getShimContainer() || document.body + , temp = document.createElement('div') + ; + + // IE 6 won't be able to set the name using setAttribute or iframe.name + temp.innerHTML = ''; + _iframe = temp.firstChild; + container.appendChild(_iframe); + + /* _iframe.onreadystatechange = function() { + console.info(_iframe.readyState); + };*/ + + Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 + var el; + + try { + el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; + + // try to detect some standard error pages + if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error + _status = el.title.replace(/^(\d+).*$/, '$1'); + } else { + _status = 200; + // get result + _response = Basic.trim(el.body.innerHTML); + + // we need to fire these at least once + target.trigger({ + type: 'progress', + loaded: _response.length, + total: _response.length + }); + + if (blob) { // if we were uploading a file + target.trigger({ + type: 'uploadprogress', + loaded: blob.size || 1025, + total: blob.size || 1025 + }); + } + } + } catch (ex) { + if (Url.hasSameOrigin(meta.url)) { + // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm + // which obviously results to cross domain error (wtf?) + _status = 404; + } else { + cleanup.call(target, function() { + target.trigger('error'); + }); + return; + } + } + + cleanup.call(target, function() { + target.trigger('load'); + }); + }, target.uid); + } // end createIframe + + // prepare data to be sent and convert if required + if (data instanceof FormData && data.hasBlob()) { + blob = data.getBlob(); + uid = blob.uid; + input = Dom.get(uid); + form = Dom.get(uid + '_form'); + if (!form) { + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + } else { + uid = Basic.guid('uid_'); + + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', meta.method); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + + I.getShimContainer().appendChild(form); + } + + // set upload target + form.setAttribute('target', uid + '_iframe'); + + if (data instanceof FormData) { + data.each(function(value, name) { + if (value instanceof Blob) { + if (input) { + input.setAttribute('name', name); + } + } else { + var hidden = document.createElement('input'); + + Basic.extend(hidden, { + type : 'hidden', + name : name, + value : value + }); + + // make sure that input[type="file"], if it's there, comes last + if (input) { + form.insertBefore(hidden, input); + } else { + form.appendChild(hidden); + } + } + }); + } + + // set destination url + form.setAttribute("action", meta.url); + + createIframe(); + form.submit(); + target.trigger('loadstart'); + }, + + getStatus: function() { + return _status; + }, + + getResponse: function(responseType) { + if ('json' === responseType) { + // strip off
      ..
      tags that might be enclosing the response + if (Basic.typeOf(_response) === 'string' && !!window.JSON) { + try { + return JSON.parse(_response.replace(/^\s*]*>/, '').replace(/<\/pre>\s*$/, '')); + } catch (ex) { + return null; + } + } + } else if ('document' === responseType) { + + } + return _response; + }, + + abort: function() { + var target = this; + + if (_iframe && _iframe.contentWindow) { + if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome + _iframe.contentWindow.stop(); + } else if (_iframe.contentWindow.document.execCommand) { // IE + _iframe.contentWindow.document.execCommand('Stop'); + } else { + _iframe.src = "about:blank"; + } + } + + cleanup.call(this, function() { + // target.dispatchEvent('readystatechange'); + target.dispatchEvent('abort'); + }); + }, + + destroy: function() { + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html4/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/image/Image +@private +*/ +define("moxie/runtime/html4/image/Image", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/image/Image" +], function(extensions, Image) { + return (extensions.Image = Image); +}); + +expose(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"]); +})(this); +})); \ No newline at end of file diff --git a/lib/javascript/plupload/js/moxie.min.js b/lib/javascript/plupload/js/moxie.min.js new file mode 100644 index 0000000..efe1da7 --- /dev/null +++ b/lib/javascript/plupload/js/moxie.min.js @@ -0,0 +1,16 @@ +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.5.7 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&c(n,function(n,u){var c=-1!==h(e(n),["array","object"]);return n===r||t&&o[u]===r?!0:(c&&i&&(n=a(n)),e(o[u])===e(n)&&c?s(t,i,[o[u],n]):o[u]=n,void 0)})}),o}function u(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===h(t[r],i)&&n.push(t[r]);return n.length?n:!1}function p(e,t){var i=[];return c(e,function(e){-1!==h(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:u,each:c,isEmptyObj:l,inSeries:d,inParallel:m,inArray:h,arrayDiff:f,arrayIntersect:p,toArray:g,trim:x,sprintf:w,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(mn;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),_=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(_.connectRuntime(k)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,_,R,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(R||(R={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),(g.can("summon_file_dialog")?c:m).setAttribute("tabindex",-1),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){};try{if(m.status>=200&&m.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var u=t(i,n);return s?e(u,a/u[o],r):u}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),_&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i=''+''+''+''+"","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML=''+''+''+''+''+''+"",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),g.can("summon_file_dialog")&&h.setAttribute("tabindex",-1),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null)},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}); \ No newline at end of file diff --git a/lib/javascript/plupload/js/plupload.dev.js b/lib/javascript/plupload/js/plupload.dev.js new file mode 100644 index 0000000..fb0b36d --- /dev/null +++ b/lib/javascript/plupload/js/plupload.dev.js @@ -0,0 +1,2497 @@ +/** + * Plupload - multi-runtime File Uploader + * v2.3.6 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +;(function (global, factory) { + var extract = function() { + var ctx = {}; + factory.apply(ctx, arguments); + return ctx.plupload; + }; + + if (typeof define === "function" && define.amd) { + define("plupload", ['./moxie'], extract); + } else if (typeof module === "object" && module.exports) { + module.exports = extract(require('./moxie')); + } else { + global.plupload = extract(global.moxie); + } +}(this || window, function(moxie) { +/** + * Plupload.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +;(function(exports, o, undef) { + +var delay = window.setTimeout; +var fileFilters = {}; +var u = o.core.utils; +var Runtime = o.runtime.Runtime; + +// convert plupload features to caps acceptable by mOxie +function normalizeCaps(settings) { + var features = settings.required_features, caps = {}; + + function resolve(feature, value, strict) { + // Feature notation is deprecated, use caps (this thing here is required for backward compatibility) + var map = { + chunks: 'slice_blob', + jpgresize: 'send_binary_string', + pngresize: 'send_binary_string', + progress: 'report_upload_progress', + multi_selection: 'select_multiple', + dragdrop: 'drag_and_drop', + drop_element: 'drag_and_drop', + headers: 'send_custom_headers', + urlstream_upload: 'send_binary_string', + canSendBinary: 'send_binary', + triggerDialog: 'summon_file_dialog' + }; + + if (map[feature]) { + caps[map[feature]] = value; + } else if (!strict) { + caps[feature] = value; + } + } + + if (typeof(features) === 'string') { + plupload.each(features.split(/\s*,\s*/), function(feature) { + resolve(feature, true); + }); + } else if (typeof(features) === 'object') { + plupload.each(features, function(value, feature) { + resolve(feature, value); + }); + } else if (features === true) { + // check settings for required features + if (settings.chunk_size && settings.chunk_size > 0) { + caps.slice_blob = true; + } + + if (!plupload.isEmptyObj(settings.resize) || settings.multipart === false) { + caps.send_binary_string = true; + } + + if (settings.http_method) { + caps.use_http_method = settings.http_method; + } + + plupload.each(settings, function(value, feature) { + resolve(feature, !!value, true); // strict check + }); + } + + return caps; +} + +/** + * @module plupload + * @static + */ +var plupload = { + /** + * Plupload version will be replaced on build. + * + * @property VERSION + * @for Plupload + * @static + * @final + */ + VERSION : '2.3.6', + + /** + * The state of the queue before it has started and after it has finished + * + * @property STOPPED + * @static + * @final + */ + STOPPED : 1, + + /** + * Upload process is running + * + * @property STARTED + * @static + * @final + */ + STARTED : 2, + + /** + * File is queued for upload + * + * @property QUEUED + * @static + * @final + */ + QUEUED : 1, + + /** + * File is being uploaded + * + * @property UPLOADING + * @static + * @final + */ + UPLOADING : 2, + + /** + * File has failed to be uploaded + * + * @property FAILED + * @static + * @final + */ + FAILED : 4, + + /** + * File has been uploaded successfully + * + * @property DONE + * @static + * @final + */ + DONE : 5, + + // Error constants used by the Error event + + /** + * Generic error for example if an exception is thrown inside Silverlight. + * + * @property GENERIC_ERROR + * @static + * @final + */ + GENERIC_ERROR : -100, + + /** + * HTTP transport error. For example if the server produces a HTTP status other than 200. + * + * @property HTTP_ERROR + * @static + * @final + */ + HTTP_ERROR : -200, + + /** + * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. + * + * @property IO_ERROR + * @static + * @final + */ + IO_ERROR : -300, + + /** + * @property SECURITY_ERROR + * @static + * @final + */ + SECURITY_ERROR : -400, + + /** + * Initialization error. Will be triggered if no runtime was initialized. + * + * @property INIT_ERROR + * @static + * @final + */ + INIT_ERROR : -500, + + /** + * File size error. If the user selects a file that is too large or is empty it will be blocked and + * an error of this type will be triggered. + * + * @property FILE_SIZE_ERROR + * @static + * @final + */ + FILE_SIZE_ERROR : -600, + + /** + * File extension error. If the user selects a file that isn't valid according to the filters setting. + * + * @property FILE_EXTENSION_ERROR + * @static + * @final + */ + FILE_EXTENSION_ERROR : -601, + + /** + * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. + * + * @property FILE_DUPLICATE_ERROR + * @static + * @final + */ + FILE_DUPLICATE_ERROR : -602, + + /** + * Runtime will try to detect if image is proper one. Otherwise will throw this error. + * + * @property IMAGE_FORMAT_ERROR + * @static + * @final + */ + IMAGE_FORMAT_ERROR : -700, + + /** + * While working on files runtime may run out of memory and will throw this error. + * + * @since 2.1.2 + * @property MEMORY_ERROR + * @static + * @final + */ + MEMORY_ERROR : -701, + + /** + * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. + * + * @property IMAGE_DIMENSIONS_ERROR + * @static + * @final + */ + IMAGE_DIMENSIONS_ERROR : -702, + + /** + * Expose whole moxie (#1469). + * + * @property moxie + * @type Object + * @final + */ + moxie: o, + + /** + * Mime type lookup table. + * + * @property mimeTypes + * @type Object + * @final + */ + mimeTypes : u.Mime.mimes, + + /** + * In some cases sniffing is the only way around :( + */ + ua: u.Env, + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + typeOf: u.Basic.typeOf, + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + extend : u.Basic.extend, + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + guid : u.Basic.guid, + + /** + * Get array of DOM Elements by their ids. + * + * @method get + * @param {String} id Identifier of the DOM Element + * @return {Array} + */ + getAll : function get(ids) { + var els = [], el; + + if (plupload.typeOf(ids) !== 'array') { + ids = [ids]; + } + + var i = ids.length; + while (i--) { + el = plupload.get(ids[i]); + if (el) { + els.push(el); + } + } + + return els.length ? els : null; + }, + + /** + Get DOM element by id + + @method get + @param {String} id Identifier of the DOM Element + @return {Node} + */ + get: u.Dom.get, + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + each : u.Basic.each, + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + getPos : u.Dom.getPos, + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + getSize : u.Dom.getSize, + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + xmlEncode : function(str) { + var xmlEncodeChars = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}, xmlEncodeRegExp = /[<>&\"\']/g; + + return str ? ('' + str).replace(xmlEncodeRegExp, function(chr) { + return xmlEncodeChars[chr] ? '&' + xmlEncodeChars[chr] + ';' : chr; + }) : str; + }, + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + toArray : u.Basic.toArray, + + /** + * Find an element in array and return its index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + inArray : u.Basic.inArray, + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + inSeries: u.Basic.inSeries, + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + addI18n : o.core.I18n.addI18n, + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + translate : o.core.I18n.translate, + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + sprintf : u.Basic.sprintf, + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + isEmptyObj : u.Basic.isEmptyObj, + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + hasClass : u.Dom.hasClass, + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + addClass : u.Dom.addClass, + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + removeClass : u.Dom.removeClass, + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + getStyle : u.Dom.getStyle, + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + addEvent : u.Events.addEvent, + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + removeEvent: u.Events.removeEvent, + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + removeAllEvents: u.Events.removeAllEvents, + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + cleanName : function(name) { + var i, lookup; + + // Replace diacritics + lookup = [ + /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', + /\307/g, 'C', /\347/g, 'c', + /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', + /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', + /\321/g, 'N', /\361/g, 'n', + /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', + /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' + ]; + + for (i = 0; i < lookup.length; i += 2) { + name = name.replace(lookup[i], lookup[i + 1]); + } + + // Replace whitespace + name = name.replace(/\s+/g, '_'); + + // Remove anything else + name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); + + return name; + }, + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + buildUrl: function(url, items) { + var query = ''; + + plupload.each(items, function(value, name) { + query += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value); + }); + + if (query) { + url += (url.indexOf('?') > 0 ? '&' : '?') + query; + } + + return url; + }, + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + formatSize : function(size) { + + if (size === undef || /\D/.test(size)) { + return plupload.translate('N/A'); + } + + function round(num, precision) { + return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); + } + + var boundary = Math.pow(1024, 4); + + // TB + if (size > boundary) { + return round(size / boundary, 1) + " " + plupload.translate('tb'); + } + + // GB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('gb'); + } + + // MB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('mb'); + } + + // KB + if (size > 1024) { + return Math.round(size / 1024) + " " + plupload.translate('kb'); + } + + return size + " " + plupload.translate('b'); + }, + + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + parseSize : u.Basic.parseSizeStr, + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + predictRuntime : function(config, runtimes) { + var up, runtime; + + up = new plupload.Uploader(config); + runtime = Runtime.thatCan(up.getOption().required_features, runtimes || config.runtimes); + up.destroy(); + return runtime; + }, + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + addFileFilter: function(name, cb) { + fileFilters[name] = cb; + } +}; + + +plupload.addFileFilter('mime_types', function(filters, file, cb) { + if (filters.length && !filters.regexp.test(file.name)) { + this.trigger('Error', { + code : plupload.FILE_EXTENSION_ERROR, + message : plupload.translate('File extension error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('max_file_size', function(maxSize, file, cb) { + var undef; + + maxSize = plupload.parseSize(maxSize); + + // Invalid file size + if (file.size !== undef && maxSize && file.size > maxSize) { + this.trigger('Error', { + code : plupload.FILE_SIZE_ERROR, + message : plupload.translate('File size error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('prevent_duplicates', function(value, file, cb) { + if (value) { + var ii = this.files.length; + while (ii--) { + // Compare by name and size (size might be 0 or undefined, but still equivalent for both) + if (file.name === this.files[ii].name && file.size === this.files[ii].size) { + this.trigger('Error', { + code : plupload.FILE_DUPLICATE_ERROR, + message : plupload.translate('Duplicate file error.'), + file : file + }); + cb(false); + return; + } + } + } + cb(true); +}); + +plupload.addFileFilter('prevent_empty', function(value, file, cb) { + if (value && !file.size && file.size !== undef) { + this.trigger('Error', { + code : plupload.FILE_SIZE_ERROR, + message : plupload.translate('File size error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +/** +@class Uploader +@constructor + +@param {Object} settings For detailed information about each option check documentation. + @param {String|DOMElement} settings.browse_button id of the DOM element or DOM element itself to use as file dialog trigger. + @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. + @param {String|DOMElement} [settings.container] id of the DOM element or DOM element itself that will be used to wrap uploader structures. Defaults to immediate parent of the `browse_button` element. + @param {String|DOMElement} [settings.drop_element] id of the DOM element or DOM element itself to use as a drop zone for Drag-n-Drop. + @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. + @param {Object} [settings.filters={}] Set of file type filters. + @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` + @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {Boolean} [settings.filters.prevent_empty=true] Do not let empty files into the queue (IE10 is known to hang for example when trying to upload such). Dispatches `plupload.FILE_SIZE_ERROR`. + @param {String} [settings.flash_swf_url] URL of the Flash swf. + @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. + @param {String} [settings.http_method="POST"] HTTP method to use during upload (only PUT or POST allowed). + @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. + @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. + @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. + @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. + @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. + @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` + @param {Number} [settings.resize.width] If image is bigger, it will be resized. + @param {Number} [settings.resize.height] If image is bigger, it will be resized. + @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). + @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. + @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. + @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. + @param {Boolean} [settings.send_chunk_number=true] Whether to send chunks and chunk numbers, or total and offset bytes. + @param {Boolean} [settings.send_file_name=true] Whether to send file name as additional argument - 'name' (required for chunked uploads and some other cases where file name cannot be sent via normal ways). + @param {String} settings.url URL of the server-side upload handler. + @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. + +*/ +plupload.Uploader = function(options) { + /** + Fires when the current RunTime has been initialized. + + @event Init + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires after the init event incase you need to perform actions there. + + @event PostInit + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when the option is changed in via uploader.setOption(). + + @event OptionChanged + @since 2.1 + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {String} name Name of the option that was changed + @param {Mixed} value New value for the specified option + @param {Mixed} oldValue Previous value of the option + */ + + /** + Fires when the silverlight/flash or other shim needs to move. + + @event Refresh + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when the overall state is being changed for the upload queue. + + @event StateChanged + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when browse_button is clicked and browse dialog shows. + + @event Browse + @since 2.1.2 + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires for every filtered file before it is added to the queue. + + @event FileFiltered + @since 2.1 + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file Another file that has to be added to the queue. + */ + + /** + Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance. + + @event QueueChanged + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires after files were filtered and added to the queue. + + @event FilesAdded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of file objects that were added to queue by the user. + */ + + /** + Fires when file is removed from the queue. + + @event FilesRemoved + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of files that got removed. + */ + + /** + Fires just before a file is uploaded. Can be used to cancel the upload for the specified file + by returning false from the handler. + + @event BeforeUpload + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File to be uploaded. + */ + + /** + Fires when a file is to be uploaded by the runtime. + + @event UploadFile + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File to be uploaded. + */ + + /** + Fires while a file is being uploaded. Use this event to update the current file upload progress. + + @event UploadProgress + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that is currently being uploaded. + */ + + /** + * Fires just before a chunk is uploaded. This event enables you to override settings + * on the uploader instance before the chunk is uploaded. + * + * @event BeforeChunkUpload + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File to be uploaded. + * @param {Object} args POST params to be sent. + * @param {Blob} chunkBlob Current blob. + * @param {offset} offset Current offset. + */ + + /** + Fires when file chunk is uploaded. + + @event ChunkUploaded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that the chunk was uploaded for. + @param {Object} result Object with response properties. + @param {Number} result.offset The amount of bytes the server has received so far, including this chunk. + @param {Number} result.total The size of the file. + @param {String} result.response The response body sent by the server. + @param {Number} result.status The HTTP status code sent by the server. + @param {String} result.responseHeaders All the response headers as a single string. + */ + + /** + Fires when a file is successfully uploaded. + + @event FileUploaded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that was uploaded. + @param {Object} result Object with response properties. + @param {String} result.response The response body sent by the server. + @param {Number} result.status The HTTP status code sent by the server. + @param {String} result.responseHeaders All the response headers as a single string. + */ + + /** + Fires when all files in a queue are uploaded. + + @event UploadComplete + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of file objects that was added to queue/selected by the user. + */ + + /** + Fires when a error occurs. + + @event Error + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Object} error Contains code, message and sometimes file and other details. + @param {Number} error.code The plupload error code. + @param {String} error.message Description of the error (uses i18n). + */ + + /** + Fires when destroy method is called. + + @event Destroy + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + var uid = plupload.guid() + , settings + , files = [] + , preferred_caps = {} + , fileInputs = [] + , fileDrops = [] + , startTime + , total + , disabled = false + , xhr + ; + + + // Private methods + function uploadNext() { + var file, count = 0, i; + + if (this.state == plupload.STARTED) { + // Find first QUEUED file + for (i = 0; i < files.length; i++) { + if (!file && files[i].status == plupload.QUEUED) { + file = files[i]; + if (this.trigger("BeforeUpload", file)) { + file.status = plupload.UPLOADING; + this.trigger("UploadFile", file); + } + } else { + count++; + } + } + + // All files are DONE or FAILED + if (count == files.length) { + if (this.state !== plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger("StateChanged"); + } + this.trigger("UploadComplete", files); + } + } + } + + + function calcFile(file) { + file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 100; + calc(); + } + + + function calc() { + var i, file; + var loaded; + var loadedDuringCurrentSession = 0; + + // Reset stats + total.reset(); + + // Check status, size, loaded etc on all files + for (i = 0; i < files.length; i++) { + file = files[i]; + + if (file.size !== undef) { + // We calculate totals based on original file size + total.size += file.origSize; + + // Since we cannot predict file size after resize, we do opposite and + // interpolate loaded amount to match magnitude of total + loaded = file.loaded * file.origSize / file.size; + + if (!file.completeTimestamp || file.completeTimestamp > startTime) { + loadedDuringCurrentSession += loaded; + } + + total.loaded += loaded; + } else { + total.size = undef; + } + + if (file.status == plupload.DONE) { + total.uploaded++; + } else if (file.status == plupload.FAILED) { + total.failed++; + } else { + total.queued++; + } + } + + // If we couldn't calculate a total file size then use the number of files to calc percent + if (total.size === undef) { + total.percent = files.length > 0 ? Math.ceil(total.uploaded / files.length * 100) : 0; + } else { + total.bytesPerSec = Math.ceil(loadedDuringCurrentSession / ((+new Date() - startTime || 1) / 1000.0)); + total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; + } + } + + + function getRUID() { + var ctrl = fileInputs[0] || fileDrops[0]; + if (ctrl) { + return ctrl.getRuntime().uid; + } + return false; + } + + + function bindEventListeners() { + this.bind('FilesAdded FilesRemoved', function(up) { + up.trigger('QueueChanged'); + up.refresh(); + }); + + this.bind('CancelUpload', onCancelUpload); + + this.bind('BeforeUpload', onBeforeUpload); + + this.bind('UploadFile', onUploadFile); + + this.bind('UploadProgress', onUploadProgress); + + this.bind('StateChanged', onStateChanged); + + this.bind('QueueChanged', calc); + + this.bind('Error', onError); + + this.bind('FileUploaded', onFileUploaded); + + this.bind('Destroy', onDestroy); + } + + + function initControls(settings, cb) { + var self = this, inited = 0, queue = []; + + // common settings + var options = { + runtime_order: settings.runtimes, + required_caps: settings.required_features, + preferred_caps: preferred_caps, + swf_url: settings.flash_swf_url, + xap_url: settings.silverlight_xap_url + }; + + // add runtime specific options if any + plupload.each(settings.runtimes.split(/\s*,\s*/), function(runtime) { + if (settings[runtime]) { + options[runtime] = settings[runtime]; + } + }); + + // initialize file pickers - there can be many + if (settings.browse_button) { + plupload.each(settings.browse_button, function(el) { + queue.push(function(cb) { + var fileInput = new o.file.FileInput(plupload.extend({}, options, { + accept: settings.filters.mime_types, + name: settings.file_data_name, + multiple: settings.multi_selection, + container: settings.container, + browse_button: el + })); + + fileInput.onready = function() { + var info = Runtime.getInfo(this.ruid); + + // for backward compatibility + plupload.extend(self.features, { + chunks: info.can('slice_blob'), + multipart: info.can('send_multipart'), + multi_selection: info.can('select_multiple') + }); + + inited++; + fileInputs.push(this); + cb(); + }; + + fileInput.onchange = function() { + self.addFile(this.files); + }; + + fileInput.bind('mouseenter mouseleave mousedown mouseup', function(e) { + if (!disabled) { + if (settings.browse_button_hover) { + if ('mouseenter' === e.type) { + plupload.addClass(el, settings.browse_button_hover); + } else if ('mouseleave' === e.type) { + plupload.removeClass(el, settings.browse_button_hover); + } + } + + if (settings.browse_button_active) { + if ('mousedown' === e.type) { + plupload.addClass(el, settings.browse_button_active); + } else if ('mouseup' === e.type) { + plupload.removeClass(el, settings.browse_button_active); + } + } + } + }); + + fileInput.bind('mousedown', function() { + self.trigger('Browse'); + }); + + fileInput.bind('error runtimeerror', function() { + fileInput = null; + cb(); + }); + + fileInput.init(); + }); + }); + } + + // initialize drop zones + if (settings.drop_element) { + plupload.each(settings.drop_element, function(el) { + queue.push(function(cb) { + var fileDrop = new o.file.FileDrop(plupload.extend({}, options, { + drop_zone: el + })); + + fileDrop.onready = function() { + var info = Runtime.getInfo(this.ruid); + + // for backward compatibility + plupload.extend(self.features, { + chunks: info.can('slice_blob'), + multipart: info.can('send_multipart'), + dragdrop: info.can('drag_and_drop') + }); + + inited++; + fileDrops.push(this); + cb(); + }; + + fileDrop.ondrop = function() { + self.addFile(this.files); + }; + + fileDrop.bind('error runtimeerror', function() { + fileDrop = null; + cb(); + }); + + fileDrop.init(); + }); + }); + } + + + plupload.inSeries(queue, function() { + if (typeof(cb) === 'function') { + cb(inited); + } + }); + } + + + function resizeImage(blob, params, runtimeOptions, cb) { + var img = new o.image.Image(); + + try { + img.onload = function() { + // no manipulation required if... + if (params.width > this.width && + params.height > this.height && + params.quality === undef && + params.preserve_headers && + !params.crop + ) { + this.destroy(); + cb(blob); + } else { + // otherwise downsize + img.downsize(params.width, params.height, params.crop, params.preserve_headers); + } + }; + + img.onresize = function() { + var resizedBlob = this.getAsBlob(blob.type, params.quality); + this.destroy(); + cb(resizedBlob); + }; + + img.bind('error runtimeerror', function() { + this.destroy(); + cb(blob); + }); + + img.load(blob, runtimeOptions); + } catch(ex) { + cb(blob); + } + } + + + function setOption(option, value, init) { + var self = this, reinitRequired = false; + + function _setOption(option, value, init) { + var oldValue = settings[option]; + + switch (option) { + case 'max_file_size': + if (option === 'max_file_size') { + settings.max_file_size = settings.filters.max_file_size = value; + } + break; + + case 'chunk_size': + if (value = plupload.parseSize(value)) { + settings[option] = value; + settings.send_file_name = true; + } + break; + + case 'multipart': + settings[option] = value; + if (!value) { + settings.send_file_name = true; + } + break; + + case 'http_method': + settings[option] = value.toUpperCase() === 'PUT' ? 'PUT' : 'POST'; + break; + + case 'unique_names': + settings[option] = value; + if (value) { + settings.send_file_name = true; + } + break; + + case 'filters': + // for sake of backward compatibility + if (plupload.typeOf(value) === 'array') { + value = { + mime_types: value + }; + } + + if (init) { + plupload.extend(settings.filters, value); + } else { + settings.filters = value; + } + + // if file format filters are being updated, regenerate the matching expressions + if (value.mime_types) { + if (plupload.typeOf(value.mime_types) === 'string') { + value.mime_types = o.core.utils.Mime.mimes2extList(value.mime_types); + } + + value.mime_types.regexp = (function(filters) { + var extensionsRegExp = []; + + plupload.each(filters, function(filter) { + plupload.each(filter.extensions.split(/,/), function(ext) { + if (/^\s*\*\s*$/.test(ext)) { + extensionsRegExp.push('\\.*'); + } else { + extensionsRegExp.push('\\.' + ext.replace(new RegExp('[' + ('/^$.*+?|()[]{}\\'.replace(/./g, '\\$&')) + ']', 'g'), '\\$&')); + } + }); + }); + + return new RegExp('(' + extensionsRegExp.join('|') + ')$', 'i'); + }(value.mime_types)); + + settings.filters.mime_types = value.mime_types; + } + break; + + case 'resize': + if (value) { + settings.resize = plupload.extend({ + preserve_headers: true, + crop: false + }, value); + } else { + settings.resize = false; + } + break; + + case 'prevent_duplicates': + settings.prevent_duplicates = settings.filters.prevent_duplicates = !!value; + break; + + // options that require reinitialisation + case 'container': + case 'browse_button': + case 'drop_element': + value = 'container' === option + ? plupload.get(value) + : plupload.getAll(value) + ; + + case 'runtimes': + case 'multi_selection': + case 'flash_swf_url': + case 'silverlight_xap_url': + settings[option] = value; + if (!init) { + reinitRequired = true; + } + break; + + default: + settings[option] = value; + } + + if (!init) { + self.trigger('OptionChanged', option, value, oldValue); + } + } + + if (typeof(option) === 'object') { + plupload.each(option, function(value, option) { + _setOption(option, value, init); + }); + } else { + _setOption(option, value, init); + } + + if (init) { + // Normalize the list of required capabilities + settings.required_features = normalizeCaps(plupload.extend({}, settings)); + + // Come up with the list of capabilities that can affect default mode in a multi-mode runtimes + preferred_caps = normalizeCaps(plupload.extend({}, settings, { + required_features: true + })); + } else if (reinitRequired) { + self.trigger('Destroy'); + + initControls.call(self, settings, function(inited) { + if (inited) { + self.runtime = Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + } + } + + + // Internal event handlers + function onBeforeUpload(up, file) { + // Generate unique target filenames + if (up.settings.unique_names) { + var matches = file.name.match(/\.([^.]+)$/), ext = "part"; + if (matches) { + ext = matches[1]; + } + file.target_name = file.id + '.' + ext; + } + } + + + function onUploadFile(up, file) { + var url = up.settings.url; + var chunkSize = up.settings.chunk_size; + var retries = up.settings.max_retries; + var features = up.features; + var offset = 0; + var blob; + + var runtimeOptions = { + runtime_order: up.settings.runtimes, + required_caps: up.settings.required_features, + preferred_caps: preferred_caps, + swf_url: up.settings.flash_swf_url, + xap_url: up.settings.silverlight_xap_url + }; + + // make sure we start at a predictable offset + if (file.loaded) { + offset = file.loaded = chunkSize ? chunkSize * Math.floor(file.loaded / chunkSize) : 0; + } + + function handleError() { + if (retries-- > 0) { + delay(uploadNextChunk, 1000); + } else { + file.loaded = offset; // reset all progress + + up.trigger('Error', { + code : plupload.HTTP_ERROR, + message : plupload.translate('HTTP Error.'), + file : file, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } + } + + function uploadNextChunk() { + var chunkBlob, args = {}, curChunkSize; + + // make sure that file wasn't cancelled and upload is not stopped in general + if (file.status !== plupload.UPLOADING || up.state === plupload.STOPPED) { + return; + } + + // send additional 'name' parameter only if required + if (up.settings.send_file_name) { + args.name = file.target_name || file.name; + } + + if (chunkSize && features.chunks && blob.size > chunkSize) { // blob will be of type string if it was loaded in memory + curChunkSize = Math.min(chunkSize, blob.size - offset); + chunkBlob = blob.slice(offset, offset + curChunkSize); + } else { + curChunkSize = blob.size; + chunkBlob = blob; + } + + // If chunking is enabled add corresponding args, no matter if file is bigger than chunk or smaller + if (chunkSize && features.chunks) { + // Setup query string arguments + if (up.settings.send_chunk_number) { + args.chunk = Math.ceil(offset / chunkSize); + args.chunks = Math.ceil(blob.size / chunkSize); + } else { // keep support for experimental chunk format, just in case + args.offset = offset; + args.total = blob.size; + } + } + + if (up.trigger('BeforeChunkUpload', file, args, chunkBlob, offset)) { + uploadChunk(args, chunkBlob, curChunkSize); + } + } + + function uploadChunk(args, chunkBlob, curChunkSize) { + var formData; + + xhr = new o.xhr.XMLHttpRequest(); + + // Do we have upload progress support + if (xhr.upload) { + xhr.upload.onprogress = function(e) { + file.loaded = Math.min(file.size, offset + e.loaded); + up.trigger('UploadProgress', file); + }; + } + + xhr.onload = function() { + // check if upload made itself through + if (xhr.status < 200 || xhr.status >= 400) { + handleError(); + return; + } + + retries = up.settings.max_retries; // reset the counter + + // Handle chunk response + if (curChunkSize < blob.size) { + chunkBlob.destroy(); + + offset += curChunkSize; + file.loaded = Math.min(offset, blob.size); + + up.trigger('ChunkUploaded', file, { + offset : file.loaded, + total : blob.size, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + + // stock Android browser doesn't fire upload progress events, but in chunking mode we can fake them + if (plupload.ua.browser === 'Android Browser') { + // doesn't harm in general, but is not required anywhere else + up.trigger('UploadProgress', file); + } + } else { + file.loaded = file.size; + } + + chunkBlob = formData = null; // Free memory + + // Check if file is uploaded + if (!offset || offset >= blob.size) { + // If file was modified, destory the copy + if (file.size != file.origSize) { + blob.destroy(); + blob = null; + } + + up.trigger('UploadProgress', file); + + file.status = plupload.DONE; + file.completeTimestamp = +new Date(); + + up.trigger('FileUploaded', file, { + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } else { + // Still chunks left + delay(uploadNextChunk, 1); // run detached, otherwise event handlers interfere + } + }; + + xhr.onerror = function() { + handleError(); + }; + + xhr.onloadend = function() { + this.destroy(); + }; + + // Build multipart request + if (up.settings.multipart && features.multipart) { + xhr.open(up.settings.http_method, url, true); + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + formData = new o.xhr.FormData(); + + // Add multipart params + plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) { + formData.append(name, value); + }); + + // Add file and send it + formData.append(up.settings.file_data_name, chunkBlob); + xhr.send(formData, runtimeOptions); + } else { + // if no multipart, send as binary stream + url = plupload.buildUrl(up.settings.url, plupload.extend(args, up.settings.multipart_params)); + + xhr.open(up.settings.http_method, url, true); + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + // do not set Content-Type, if it was defined previously (see #1203) + if (!xhr.hasRequestHeader('Content-Type')) { + xhr.setRequestHeader('Content-Type', 'application/octet-stream'); // Binary stream header + } + + xhr.send(chunkBlob, runtimeOptions); + } + } + + + blob = file.getSource(); + + // Start uploading chunks + if (!plupload.isEmptyObj(up.settings.resize) && plupload.inArray(blob.type, ['image/jpeg', 'image/png']) !== -1) { + // Resize if required + resizeImage(blob, up.settings.resize, runtimeOptions, function(resizedBlob) { + blob = resizedBlob; + file.size = resizedBlob.size; + uploadNextChunk(); + }); + } else { + uploadNextChunk(); + } + } + + + function onUploadProgress(up, file) { + calcFile(file); + } + + + function onStateChanged(up) { + if (up.state == plupload.STARTED) { + // Get start time to calculate bps + startTime = (+new Date()); + } else if (up.state == plupload.STOPPED) { + // Reset currently uploading files + for (var i = up.files.length - 1; i >= 0; i--) { + if (up.files[i].status == plupload.UPLOADING) { + up.files[i].status = plupload.QUEUED; + calc(); + } + } + } + } + + + function onCancelUpload() { + if (xhr) { + xhr.abort(); + } + } + + + function onFileUploaded(up) { + calc(); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + delay(function() { + uploadNext.call(up); + }, 1); + } + + + function onError(up, err) { + if (err.code === plupload.INIT_ERROR) { + up.destroy(); + } + // Set failed status if an error occured on a file + else if (err.code === plupload.HTTP_ERROR) { + err.file.status = plupload.FAILED; + err.file.completeTimestamp = +new Date(); + calcFile(err.file); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + if (up.state == plupload.STARTED) { // upload in progress + up.trigger('CancelUpload'); + delay(function() { + uploadNext.call(up); + }, 1); + } + } + } + + + function onDestroy(up) { + up.stop(); + + // Purge the queue + plupload.each(files, function(file) { + file.destroy(); + }); + files = []; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.destroy(); + }); + fileInputs = []; + } + + if (fileDrops.length) { + plupload.each(fileDrops, function(fileDrop) { + fileDrop.destroy(); + }); + fileDrops = []; + } + + preferred_caps = {}; + disabled = false; + startTime = xhr = null; + total.reset(); + } + + + // Default settings + settings = { + chunk_size: 0, + file_data_name: 'file', + filters: { + mime_types: [], + max_file_size: 0, + prevent_duplicates: false, + prevent_empty: true + }, + flash_swf_url: 'js/Moxie.swf', + http_method: 'POST', + max_retries: 0, + multipart: true, + multi_selection: true, + resize: false, + runtimes: Runtime.order, + send_file_name: true, + send_chunk_number: true, + silverlight_xap_url: 'js/Moxie.xap' + }; + + + setOption.call(this, options, null, true); + + // Inital total state + total = new plupload.QueueProgress(); + + // Add public methods + plupload.extend(this, { + + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ + id : uid, + uid : uid, // mOxie uses this to differentiate between event targets + + /** + * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. + * These states are controlled by the stop/start methods. The default value is STOPPED. + * + * @property state + * @type Number + */ + state : plupload.STOPPED, + + /** + * Map of features that are available for the uploader runtime. Features will be filled + * before the init event is called, these features can then be used to alter the UI for the end user. + * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. + * + * @property features + * @type Object + */ + features : {}, + + /** + * Current runtime name. + * + * @property runtime + * @type String + */ + runtime : null, + + /** + * Current upload queue, an array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files : files, + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ + settings : settings, + + /** + * Total progess information. How many files has been uploaded, total percent etc. + * + * @property total + * @type plupload.QueueProgress + */ + total : total, + + + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init : function() { + var self = this, opt, preinitOpt, err; + + preinitOpt = self.getOption('preinit'); + if (typeof(preinitOpt) == "function") { + preinitOpt(self); + } else { + plupload.each(preinitOpt, function(func, name) { + self.bind(name, func); + }); + } + + bindEventListeners.call(self); + + // Check for required options + plupload.each(['container', 'browse_button', 'drop_element'], function(el) { + if (self.getOption(el) === null) { + err = { + code : plupload.INIT_ERROR, + message : plupload.sprintf(plupload.translate("%s specified, but cannot be found."), el) + } + return false; + } + }); + + if (err) { + return self.trigger('Error', err); + } + + + if (!settings.browse_button && !settings.drop_element) { + return self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate("You must specify either browse_button or drop_element.") + }); + } + + + initControls.call(self, settings, function(inited) { + var initOpt = self.getOption('init'); + if (typeof(initOpt) == "function") { + initOpt(self); + } else { + plupload.each(initOpt, function(func, name) { + self.bind(name, func); + }); + } + + if (inited) { + self.runtime = Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + }, + + /** + * Set the value for the specified option(s). + * + * @method setOption + * @since 2.1 + * @param {String|Object} option Name of the option to change or the set of key/value pairs + * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) + */ + setOption: function(option, value) { + setOption.call(this, option, value, !this.runtime); // until runtime not set we do not need to reinitialize + }, + + /** + * Get the value for the specified option or the whole configuration, if not specified. + * + * @method getOption + * @since 2.1 + * @param {String} [option] Name of the option to get + * @return {Mixed} Value for the option or the whole set + */ + getOption: function(option) { + if (!option) { + return settings; + } + return settings[option]; + }, + + /** + * Refreshes the upload instance by dispatching out a refresh event to all runtimes. + * This would for example reposition flash/silverlight shims on the page. + * + * @method refresh + */ + refresh : function() { + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.trigger('Refresh'); + }); + } + this.trigger('Refresh'); + }, + + /** + * Starts uploading the queued files. + * + * @method start + */ + start : function() { + if (this.state != plupload.STARTED) { + this.state = plupload.STARTED; + this.trigger('StateChanged'); + + uploadNext.call(this); + } + }, + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop : function() { + if (this.state != plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger('StateChanged'); + this.trigger('CancelUpload'); + } + }, + + + /** + * Disables/enables browse button on request. + * + * @method disableBrowse + * @param {Boolean} disable Whether to disable or enable (default: true) + */ + disableBrowse : function() { + disabled = arguments[0] !== undef ? arguments[0] : true; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.disable(disabled); + }); + } + + this.trigger('DisableBrowse', disabled); + }, + + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ + getFile : function(id) { + var i; + for (i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return files[i]; + } + } + }, + + /** + * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, + * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, + * if any files were added to the queue. Otherwise nothing happens. + * + * @method addFile + * @since 2.0 + * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. + * @param {String} [fileName] If specified, will be used as a name for the file + */ + addFile : function(file, fileName) { + var self = this + , queue = [] + , filesAdded = [] + , ruid + ; + + function filterFile(file, cb) { + var queue = []; + plupload.each(self.settings.filters, function(rule, name) { + if (fileFilters[name]) { + queue.push(function(cb) { + fileFilters[name].call(self, rule, file, function(res) { + cb(!res); + }); + }); + } + }); + plupload.inSeries(queue, cb); + } + + /** + * @method resolveFile + * @private + * @param {moxie.file.File|moxie.file.Blob|plupload.File|File|Blob|input[type="file"]} file + */ + function resolveFile(file) { + var type = plupload.typeOf(file); + + // moxie.file.File + if (file instanceof o.file.File) { + if (!file.ruid && !file.isDetached()) { + if (!ruid) { // weird case + return false; + } + file.ruid = ruid; + file.connectRuntime(ruid); + } + resolveFile(new plupload.File(file)); + } + // moxie.file.Blob + else if (file instanceof o.file.Blob) { + resolveFile(file.getSource()); + file.destroy(); + } + // plupload.File - final step for other branches + else if (file instanceof plupload.File) { + if (fileName) { + file.name = fileName; + } + + queue.push(function(cb) { + // run through the internal and user-defined filters, if any + filterFile(file, function(err) { + if (!err) { + // make files available for the filters by updating the main queue directly + files.push(file); + // collect the files that will be passed to FilesAdded event + filesAdded.push(file); + + self.trigger("FileFiltered", file); + } + delay(cb, 1); // do not build up recursions or eventually we might hit the limits + }); + }); + } + // native File or blob + else if (plupload.inArray(type, ['file', 'blob']) !== -1) { + resolveFile(new o.file.File(null, file)); + } + // input[type="file"] + else if (type === 'node' && plupload.typeOf(file.files) === 'filelist') { + // if we are dealing with input[type="file"] + plupload.each(file.files, resolveFile); + } + // mixed array of any supported types (see above) + else if (type === 'array') { + fileName = null; // should never happen, but unset anyway to avoid funny situations + plupload.each(file, resolveFile); + } + } + + ruid = getRUID(); + + resolveFile(file); + + if (queue.length) { + plupload.inSeries(queue, function() { + // if any files left after filtration, trigger FilesAdded + if (filesAdded.length) { + self.trigger("FilesAdded", filesAdded); + } + }); + } + }, + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File|String} file File to remove from queue. + */ + removeFile : function(file) { + var id = typeof(file) === 'string' ? file : file.id; + + for (var i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return this.splice(i, 1)[0]; + } + } + }, + + /** + * Removes part of the queue and returns the files removed. This will also trigger the + * FilesRemoved and QueueChanged events. + * + * @method splice + * @param {Number} [start=0] Start index to remove from. + * @param {Number} [length] Number of files to remove (defaults to number of files in the queue). + * @return {Array} Array of files that was removed. + */ + splice : function(start, length) { + // Splice and trigger events + var removed = files.splice(start === undef ? 0 : start, length === undef ? files.length : length); + + // if upload is in progress we need to stop it and restart after files are removed + var restartRequired = false; + if (this.state == plupload.STARTED) { // upload in progress + plupload.each(removed, function(file) { + if (file.status === plupload.UPLOADING) { + restartRequired = true; // do not restart, unless file that is being removed is uploading + return false; + } + }); + + if (restartRequired) { + this.stop(); + } + } + + this.trigger("FilesRemoved", removed); + + // Dispose any resources allocated by those files + plupload.each(removed, function(file) { + file.destroy(); + }); + + if (restartRequired) { + this.start(); + } + + return removed; + }, + + /** + Dispatches the specified event name and its arguments to all listeners. + + @method trigger + @param {String} name Event name to fire. + @param {Object..} Multiple arguments to pass along to the listener functions. + */ + + // override the parent method to match Plupload-like event logic + dispatchEvent: function(type) { + var list, args, result; + + type = type.toLowerCase(); + + list = this.hasEventListener(type); + + if (list) { + // sort event list by priority + list.sort(function(a, b) { return b.priority - a.priority; }); + + // first argument should be current plupload.Uploader instance + args = [].slice.call(arguments); + args.shift(); + args.unshift(this); + + for (var i = 0; i < list.length; i++) { + // Fire event, break chain if false is returned + if (list[i].fn.apply(list[i].scope, args) === false) { + return false; + } + } + } + return true; + }, + + /** + Check whether uploader has any listeners to the specified event. + + @method hasEventListener + @param {String} name Event name to check for. + */ + + + /** + Adds an event listener by name. + + @method bind + @param {String} name Event name to listen for. + @param {function} fn Function to call ones the event gets fired. + @param {Object} [scope] Optional scope to execute the specified function in. + @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first + */ + bind: function(name, fn, scope, priority) { + // adapt moxie EventTarget style to Plupload-like + plupload.Uploader.prototype.bind.call(this, name, fn, priority, scope); + }, + + /** + Removes the specified event listener. + + @method unbind + @param {String} name Name of event to remove. + @param {function} fn Function to remove from listener. + */ + + /** + Removes all event listeners. + + @method unbindAll + */ + + + /** + * Destroys Plupload instance and cleans after itself. + * + * @method destroy + */ + destroy : function() { + this.trigger('Destroy'); + settings = total = null; // purge these exclusively + this.unbindAll(); + } + }); +}; + +plupload.Uploader.prototype = o.core.EventTarget.instance; + +/** + * Constructs a new file instance. + * + * @class File + * @constructor + * + * @param {Object} file Object containing file properties + * @param {String} file.name Name of the file. + * @param {Number} file.size File size. + */ +plupload.File = (function() { + var filepool = {}; + + function PluploadFile(file) { + + plupload.extend(this, { + + /** + * File id this is a globally unique id for the specific file. + * + * @property id + * @type String + */ + id: plupload.guid(), + + /** + * File name for example "myfile.gif". + * + * @property name + * @type String + */ + name: file.name || file.fileName, + + /** + * File type, `e.g image/jpeg` + * + * @property type + * @type String + */ + type: file.type || '', + + /** + * Relative path to the file inside a directory + * + * @property relativePath + * @type String + * @default '' + */ + relativePath: file.relativePath || '', + + /** + * File size in bytes (may change after client-side manupilation). + * + * @property size + * @type Number + */ + size: file.fileSize || file.size, + + /** + * Original file size in bytes. + * + * @property origSize + * @type Number + */ + origSize: file.fileSize || file.size, + + /** + * Number of bytes uploaded of the files total size. + * + * @property loaded + * @type Number + */ + loaded: 0, + + /** + * Number of percentage uploaded of the file. + * + * @property percent + * @type Number + */ + percent: 0, + + /** + * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. + * + * @property status + * @type Number + * @see plupload + */ + status: plupload.QUEUED, + + /** + * Date of last modification. + * + * @property lastModifiedDate + * @type {String} + */ + lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString(), // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) + + + /** + * Set when file becomes plupload.DONE or plupload.FAILED. Is used to calculate proper plupload.QueueProgress.bytesPerSec. + * @private + * @property completeTimestamp + * @type {Number} + */ + completeTimestamp: 0, + + /** + * Returns native window.File object, when it's available. + * + * @method getNative + * @return {window.File} or null, if plupload.File is of different origin + */ + getNative: function() { + var file = this.getSource().getSource(); + return plupload.inArray(plupload.typeOf(file), ['blob', 'file']) !== -1 ? file : null; + }, + + /** + * Returns mOxie.File - unified wrapper object that can be used across runtimes. + * + * @method getSource + * @return {mOxie.File} or null + */ + getSource: function() { + if (!filepool[this.id]) { + return null; + } + return filepool[this.id]; + }, + + /** + * Destroys plupload.File object. + * + * @method destroy + */ + destroy: function() { + var src = this.getSource(); + if (src) { + src.destroy(); + delete filepool[this.id]; + } + } + }); + + filepool[this.id] = file; + } + + return PluploadFile; +}()); + + +/** + * Constructs a queue progress. + * + * @class QueueProgress + * @constructor + */ + plupload.QueueProgress = function() { + var self = this; // Setup alias for self to reduce code size when it's compressed + + /** + * Total queue file size. + * + * @property size + * @type Number + */ + self.size = 0; + + /** + * Total bytes uploaded. + * + * @property loaded + * @type Number + */ + self.loaded = 0; + + /** + * Number of files uploaded. + * + * @property uploaded + * @type Number + */ + self.uploaded = 0; + + /** + * Number of files failed to upload. + * + * @property failed + * @type Number + */ + self.failed = 0; + + /** + * Number of files yet to be uploaded. + * + * @property queued + * @type Number + */ + self.queued = 0; + + /** + * Total percent of the uploaded bytes. + * + * @property percent + * @type Number + */ + self.percent = 0; + + /** + * Bytes uploaded per second. + * + * @property bytesPerSec + * @type Number + */ + self.bytesPerSec = 0; + + /** + * Resets the progress to its initial values. + * + * @method reset + */ + self.reset = function() { + self.size = self.loaded = self.uploaded = self.failed = self.queued = self.percent = self.bytesPerSec = 0; + }; +}; + +exports.plupload = plupload; + +}(this, moxie)); + +})); \ No newline at end of file diff --git a/lib/javascript/plupload/js/plupload.full.min.js b/lib/javascript/plupload/js/plupload.full.min.js new file mode 100644 index 0000000..140c6b5 --- /dev/null +++ b/lib/javascript/plupload/js/plupload.full.min.js @@ -0,0 +1,29 @@ +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.5.7 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&c(n,function(n,u){var c=-1!==h(e(n),["array","object"]);return n===r||t&&o[u]===r?!0:(c&&i&&(n=a(n)),e(o[u])===e(n)&&c?s(t,i,[o[u],n]):o[u]=n,void 0)})}),o}function u(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===h(t[r],i)&&n.push(t[r]);return n.length?n:!1}function p(e,t){var i=[];return c(e,function(e){-1!==h(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:u,each:c,isEmptyObj:l,inSeries:d,inParallel:m,inArray:h,arrayDiff:f,arrayIntersect:p,toArray:g,trim:x,sprintf:w,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(mn;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),_=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(_.connectRuntime(k)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,_,R,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(R||(R={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),(g.can("summon_file_dialog")?c:m).setAttribute("tabindex",-1),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){};try{if(m.status>=200&&m.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var u=t(i,n);return s?e(u,a/u[o],r):u}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),_&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i=''+''+''+''+"","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML=''+''+''+''+''+''+"",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),g.can("summon_file_dialog")&&h.setAttribute("tabindex",-1),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null)},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}); +/** + * Plupload - multi-runtime File Uploader + * v2.3.9 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2021-11-15 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(I.reset(),e=0;eS)&&(r+=n),I.loaded+=n):I.size=i,t.status==l.DONE?I.uploaded++:t.status==l.FAILED?I.failed++:I.queued++;I.size===i?I.percent=D.length>0?Math.ceil(100*(I.uploaded/D.length)):0:(I.bytesPerSec=Math.ceil(r/((+new Date-S||1)/1e3)),I.percent=I.size>0?Math.ceil(100*(I.loaded/I.size)):0)}function c(){var e=F[0]||P[0];return e?e.getRuntime().uid:!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",b),this.bind("BeforeUpload",m),this.bind("UploadFile",_),this.bind("UploadProgress",E),this.bind("StateChanged",v),this.bind("QueueChanged",d),this.bind("Error",R),this.bind("FileUploaded",y),this.bind("Destroy",z)}function p(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:x,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function g(e,n,r,s){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),s(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),s(t)},a.bind("error runtimeerror",function(){this.destroy(),s(e)}),a.load(e,r)}catch(o){s(e)}}function h(e,i,r){function s(e,i,n){var r=O[e];switch(e){case"max_file_size":"max_file_size"===e&&(O.max_file_size=O.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(O[e]=i,O.send_file_name=!0);break;case"multipart":O[e]=i,i||(O.send_file_name=!0);break;case"http_method":O[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":O[e]=i,i&&(O.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(O.filters,i):O.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),O.filters.mime_types=i.mime_types);break;case"resize":O.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":O.prevent_duplicates=O.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":O[e]=i,n||(u=!0);break;default:O[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(O.required_features=n(l.extend({},O)),x=n(l.extend({},O,{required_features:!0}))):u&&(a.trigger("Destroy"),p.call(a,O,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function _(e,i){function n(){c-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&f.chunks&&o.size>d?(n=Math.min(d,o.size-p),t=o.slice(p,p+n)):(n=o.size,t=o),d&&f.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(p/d),r.chunks=Math.ceil(o.size/d)):(r.offset=p,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,p)&&a(r,t,n))}function a(a,d,g){var m;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?(n(),void 0):(c=e.settings.max_retries,g=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&f.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),m=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){m.append(t,e)}),m.append(e.settings.file_data_name,d),T.send(m,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,h))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,f=e.features,p=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:x,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(p=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(o.type,["image/jpeg","image/png"])?s():g(o,e.settings.resize,h,function(e){o=e,i.size=e.size,s()})}function E(e,t){u(t)}function v(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function b(){T&&T.abort()}function y(e){d(),r(function(){a.call(e)},1)}function R(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function z(e){e.stop(),l.each(D,function(e){e.destroy()}),D=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),x={},U=!1,S=T=null,I.reset()}var O,S,I,T,w=l.guid(),D=[],x={},F=[],P=[],U=!1;O={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),I=new l.QueueProgress,l.extend(this,{id:w,uid:w,state:l.STOPPED,features:{},runtime:null,files:D,settings:O,total:I,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),f.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):O.browse_button||O.drop_element?(p.call(i,O,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?O[e]:O},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,F.length&&l.each(F,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=D.length-1;t>=0;t--)if(D[t].id===e)return D[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(D.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=D.length-1;i>=0;i--)if(D[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=D.splice(e===i?0:e,t===i?D.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(I.reset(),e=0;eS)&&(r+=n),I.loaded+=n):I.size=i,t.status==l.DONE?I.uploaded++:t.status==l.FAILED?I.failed++:I.queued++;I.size===i?I.percent=D.length>0?Math.ceil(100*(I.uploaded/D.length)):0:(I.bytesPerSec=Math.ceil(r/((+new Date-S||1)/1e3)),I.percent=I.size>0?Math.ceil(100*(I.loaded/I.size)):0)}function c(){var e=F[0]||P[0];return e?e.getRuntime().uid:!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",b),this.bind("BeforeUpload",m),this.bind("UploadFile",_),this.bind("UploadProgress",E),this.bind("StateChanged",v),this.bind("QueueChanged",d),this.bind("Error",R),this.bind("FileUploaded",y),this.bind("Destroy",z)}function p(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:x,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function g(e,n,r,s){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),s(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),s(t)},a.bind("error runtimeerror",function(){this.destroy(),s(e)}),a.load(e,r)}catch(o){s(e)}}function h(e,i,r){function s(e,i,n){var r=O[e];switch(e){case"max_file_size":"max_file_size"===e&&(O.max_file_size=O.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(O[e]=i,O.send_file_name=!0);break;case"multipart":O[e]=i,i||(O.send_file_name=!0);break;case"http_method":O[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":O[e]=i,i&&(O.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(O.filters,i):O.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),O.filters.mime_types=i.mime_types);break;case"resize":O.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":O.prevent_duplicates=O.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":O[e]=i,n||(u=!0);break;default:O[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(O.required_features=n(l.extend({},O)),x=n(l.extend({},O,{required_features:!0}))):u&&(a.trigger("Destroy"),p.call(a,O,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function _(e,i){function n(){c-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&f.chunks&&o.size>d?(n=Math.min(d,o.size-p),t=o.slice(p,p+n)):(n=o.size,t=o),d&&f.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(p/d),r.chunks=Math.ceil(o.size/d)):(r.offset=p,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,p)&&a(r,t,n))}function a(a,d,g){var m;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?(n(),void 0):(c=e.settings.max_retries,g=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&f.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),m=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){m.append(t,e)}),m.append(e.settings.file_data_name,d),T.send(m,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,h))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,f=e.features,p=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:x,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(p=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(o.type,["image/jpeg","image/png"])?s():g(o,e.settings.resize,h,function(e){o=e,i.size=e.size,s()})}function E(e,t){u(t)}function v(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function b(){T&&T.abort()}function y(e){d(),r(function(){a.call(e)},1)}function R(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function z(e){e.stop(),l.each(D,function(e){e.destroy()}),D=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),x={},U=!1,S=T=null,I.reset()}var O,S,I,T,w=l.guid(),D=[],x={},F=[],P=[],U=!1;O={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),I=new l.QueueProgress,l.extend(this,{id:w,uid:w,state:l.STOPPED,features:{},runtime:null,files:D,settings:O,total:I,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),f.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):O.browse_button||O.drop_element?(p.call(i,O,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?O[e]:O},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,F.length&&l.each(F,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=D.length-1;t>=0;t--)if(D[t].id===e)return D[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(D.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=D.length-1;i>=0;i--)if(D[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=D.splice(e===i?0:e,t===i?D.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file diff --git a/lib/javascript/plupload/readme.md b/lib/javascript/plupload/readme.md new file mode 100644 index 0000000..aa04da8 --- /dev/null +++ b/lib/javascript/plupload/readme.md @@ -0,0 +1,140 @@ +# Plupload + +Plupload is a cross-browser multi-runtime file uploading API. Basically, a set of tools that will help you to +build a reliable and visually appealing file uploader in minutes. + +Historically, Plupload comes from a dark and hostile age of no HTML5, hence all the alternative fallbacks, +like Flash, Silverlight and Java (still in development). It is meant to provide an API, that +will work anywhere and in any case, in one way or another. While having very solid fallbacks, Plupload +is built with the future of HTML5 in mind. + +### Table of Contents +* [Backstory](#backstory) +* [Structure](#structure) + * [File API and XHR L2 pollyfills](https://github.com/moxiecode/moxie/blob/master/README.md) + * [Plupload API](https://github.com/moxiecode/plupload/wiki/API) + * [UI Widget](https://github.com/moxiecode/plupload/wiki/UI.Plupload) + * [Queue Widget](https://github.com/moxiecode/plupload/wiki/pluploadQueue) +* [Demos](https://github.com/jayarjo/plupload-demos/blob/master/README.md) +* [Building Instructions](#building-instructions) +* [Getting Started](https://github.com/moxiecode/plupload/wiki/Getting-Started) + * [Options](https://github.com/moxiecode/plupload/wiki/Options) + * [Events](https://github.com/moxiecode/plupload/wiki/Uploader#wiki-events) + * [Methods](https://github.com/moxiecode/plupload/wiki/Uploader#wiki-methods) + * [Plupload in Your Language](https://github.com/moxiecode/plupload/wiki/Plupload-in-Your-Language) + * [File Filters](https://github.com/moxiecode/plupload/wiki/File-Filters) + * [Image Resizing on Client-Side](https://github.com/moxiecode/plupload/wiki/Image-Resizing-on-Client-Side) + * [Chunking](https://github.com/moxiecode/plupload/wiki/Chunking) + * [Upload to Amazon S3](https://github.com/moxiecode/plupload/wiki/Upload-to-Amazon-S3) +* [FAQ](https://github.com/moxiecode/plupload/wiki/Frequently-Asked-Questions) +* [Support](#support) + * [Create a Fiddle](https://github.com/moxiecode/plupload/wiki/Create-a-Fiddle) +* [Contributing](#contributing) +* [License](#license) +* [Contact Us](http://www.moxiecode.com/contact.php) + +### Backstory + +Plupload started in a time when uploading a file in a responsive and customizable manner was a real pain. +Internally, browsers only had the `input[type="file"]` element. It was ugly and clunky at the same time. +One couldn't even change it's visuals, without hiding it and coding another one on top of it from scratch. +And then there was no progress indication for the upload process... Sounds pretty crazy today. + +It was very logical for developers to look for alternatives and writing their own implementations, using +Flash and Java, in order to somehow extend limited browser capabilities. And so did we, in our search for +a reliable and flexible file uploader for +our [TinyMCE](http://www.tinymce.com/index.php)'s +[MCImageManager](http://www.tinymce.com/enterprise/mcimagemanager.php). + +Quickly enough though, Plupload grew big. It easily split into a standalone project. +With major *version 2.0* it underwent another huge reconstruction, basically +[from the ground up](http://blog.moxiecode.com/2012/11/28/first-public-beta-plupload-2/), +as all the low-level runtime logic has been extracted into separate [File API](http://www.w3.org/TR/FileAPI/) +and [XHR L2](http://www.w3.org/TR/XMLHttpRequest/) pollyfills (currently known under combined name of [mOxie](https://github.com/moxiecode/moxie)), +giving Plupload a chance to evolve further. + +### Structure + +Currently, Plupload may be considered as consisting of three parts: low-level pollyfills, +Plupload API and Widgets (UI and Queue). Initially, Widgets were meant only to serve as examples +of the API, but quickly formed into fully-functional API implementations that now come bundled with +the Plupload API. This has been a source for multiple misconceptions about the API as Widgets were +easily mistaken for the Plupload itself. They are only implementations, such as any of you can +build by yourself out of the API. + +* [Low-level pollyfills (mOxie)](https://github.com/moxiecode/moxie) - have their own [code base](https://github.com/moxiecode/moxie) and [documentation](https://github.com/moxiecode/moxie/wiki) on GitHub. +* [Plupload API](https://github.com/moxiecode/plupload/wiki/API) +* [UI Widget](https://github.com/moxiecode/plupload/wiki/UI.Plupload) +* [Queue Widget](https://github.com/moxiecode/plupload/wiki/pluploadQueue) + +### Building instructions + +Plupload depends on File API and XHR2 L2 pollyfills that currently have their +[own repository](https://github.com/moxiecode/moxie) on GitHub. However, in most cases you shouldn't +care as we bundle the latest build of mOxie, including full and minified JavaScript source and +pre-compiled `SWF` and `XAP` components, with [every release](https://github.com/moxiecode/plupload/releases). You can find everything you may need under `js/` folder. + +There are cases where you might need a custom build, for example free of unnecessary runtimes, half the +original size, etc. The difficult part of this task comes from mOxie and its set of additional runtimes +that require special tools on your workstation in order to compile. +Consider [build instructions for mOxie](https://github.com/moxiecode/moxie#build-instructions) - +everything applies to Plupload as well. + +First of all, if you want to build custom Plupload packages you will require [Node.js](http://nodejs.org/), +as this is our build environment of choice. Node.js binaries (as well as Source) +[are available](http://nodejs.org/download/) for all major operating systems. + +Plupload includes _mOxie_ as a submodule, it also depends on some other repositories for building up it's dev +environment - to avoid necessity of downloading them one by one, we recommended you to simply clone Plupload +with [git](http://git-scm.com/) recursively (you will require git installed on your system for this operation +to succeed): + +``` +git clone --recursive https://github.com/moxiecode/plupload.git +``` + +And finalize the preparation stage with: `npm install` - this will install all additional modules, including those +required by dev and test environments. In case you would rather keep it minimal, add a `--production` flag. + +*Note:* Currently, for an unknown reason, locally installed Node.js modules on Windows, may not be automatically +added to the system PATH. So, if `jake` commands below are not recognized you will need to add them manually: + +``` +set PATH=%PATH%;%CD%\node_modules\.bin\ +``` +### Support + +We are actively standing behind the Plupload and now that we are done with major rewrites and refactoring, +the only real goal that we have ahead is making it as reliable and bulletproof as possible. We are open to +all the suggestions and feature requests. We ask you to file bug reports if you encounter any. We may not +react to them instantly, but we constantly bear them in my mind as we extend the code base. + +In addition to dedicated support for those who dare to buy our OEM licenses, we got +[discussion boards](http://www.plupload.com/punbb/index.php), which is like an enormous FAQ, +covering every possible application case. Of course, you are welcome to file a bug report or feature request, +here on [GitHub](https://github.com/moxiecode/plupload/issues). + +Sometimes it is easier to notice the problem when bug report is accompained by the actual code. Consider providing +[a Plupload fiddle](https://github.com/moxiecode/plupload/wiki/Create-a-Fiddle) for the troublesome code. + +### Contributing + +We are open to suggestions and code revisions, however there are some rules and limitations that you might +want to consider first. + +* Code that you contribute will automatically be licensed under the AGPL, but will not be limited to AGPL. +* Although all contributors will get the credit for their work, copyright notices will be changed to [Moxiecode Systems AB](http://www.moxiecode.com/). +* Third party code will be reviewed, tested and possibly modified before being released. + +These basic rules help us earn a living and ensure that code remains Open Source and compatible with AGPL license. All contributions will be added to the changelog and appear in every release and on the site. + +An easy place to start is to [translate Plupload to your language](https://github.com/moxiecode/plupload/wiki/Plupload-in-Your-Language#contribute). + +You can read more about how to contribute at: [http://www.plupload.com/contributing](http://www.plupload.com/contributing) + +### License + +Copyright 2016, [Ephox](http://www.ephox.com/). +Released under [AGPL-3.0 License](https://github.com/moxiecode/plupload/blob/master/license.txt). + +We also provide [commercial license](http://www.plupload.com/commercial.php). diff --git a/lib/php/argus/argus.php b/lib/php/argus/argus.php index 3c0ef7b..bb994a3 100644 --- a/lib/php/argus/argus.php +++ b/lib/php/argus/argus.php @@ -1,592 +1,598 @@ -Query( $QS, false ); - }; - - function createResource( $NodeID, $AuxID, $Type, $DeviceDesc ){ - global $DATABASE; - $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `used`=1, `type`={$Type}, `aux_id`={$AuxID}, `device`='{$DeviceDesc}' ON DUPLICATE KEY UPDATE `device`='{$DeviceDesc}'"; - $DATABASE->Query( $QS, false ); - $RID = $DATABASE->getLastInsertID(); - if( $RID == 0 ){ - $QS="SELECT `id` FROM `resources` WHERE `node_id`={$NodeID} AND `type`={$Type} AND `aux_id`={$AuxID}"; - $R = $DATABASE->Query( $QS, false ); - $RID = $R[0]['id']; - }; - return $RID; - }; - - function createNIF( $Name, $Type = 1, $Mode = 1, $Mac='', $AUX_ID = 0 ){ - global $DATABASE; - $Key = md5( $Name ); - $Ename = $DATABASE->escape( $Name ); - $QS = "INSERT INTO `network_interfaces` SET `type`={$Type}, `key`='{$Key}', `mode`={$Mode}, `device_name`='{$Ename}', `mac`='{$Mac}', `aux_id`={$AUX_ID} ON DUPLICATE KEY UPDATE `id`=`id`"; - $DATABASE->Query( $QS ); - $NID = $DATABASE->getLastInsertID(); - if( $NID == 0 ){ - $QS="SELECT `id` FROM `network_interfaces` WHERE `key`='{$Key}'"; - $RR = $DATABASE->Query( $QS ); - if( count( $RR ) ) $NID = intval( $RR[0]['id'] ); - }; - return $NID; - }; - - function getServerNode( $SiteID, $Pos = 0 ){ - global $DATABASE; - $QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SiteID} AND `type`=0"; - $SS = $DATABASE->Query( $QS, false ); - if( count( $SS ) ){ - if( $Pos ){ - if( isset ($SS[$Pos] ) ){ - return intval($SS[$Pos]['id']); - }; - } else return intval($SS[0]['id']); - }; - return 0; - }; - - function getResourceID( $NodeID, $ResType ){ - global $DATABASE; - $QS = "SELECT `id` FROM `resources` WHERE `node_id`={$NodeID} AND `type`={$ResType}"; - $RR = $DATABASE->Query( $QS, false ); - $Ret = array(); - if( count( $RR ) ){ - if( count( $RR ) > 1 ) foreach( $RR as $R ) $Ret[] = $R['id']; else $Ret[0]=$RR[0]['id']; - }; - return $Ret; - }; - - function validateIP4( $ADDR ){ - if( strlen( $ADDR ) > 15 ) return false; - $TAr = explode( '.', $ADDR ); - if( count( $TAr ) != 4 ) return false; - $OO = array(); - foreach( $TAr as $R ){ - $k = intval( $R ); - if( $k > 255 ) return false; - $OO[] = $k; - }; - return implode( '.', $OO ); - }; - - function validatePort( $PORT ){ - $K = intval( $PORT ); - if( $K > 65535 ) return false; - return $K; - }; - - function addCamera( $SiteID, $ServerID, $CamName, $CameraType, $MediaStreamID, $CameraID = 0, $PTZProtocolID=0, $FMin=0, $FMax=0, $PanAngles=0, $TiltAngles=0, $PanMode=0, $TiltMode=0, $ImagerSize=0, $UART=0, $PTZProtoccolAUX=0 ){ - global $DATABASE; - - $QS="SELECT * FROM `media_streams` WHERE `id`={$MediaStreamID}"; - $R=$DATABASE->Query( $QS, false ); - if(count($R)){ - $STREAM = $R[0]; - if( $CameraID == 0 && ( $CameraType == ARGUS_ANALOG_STATIC_CAMERA || $CameraType == ARGUS_ANALOG_PTZ_CAMERA ) ){ - //Analogue Camera Made from Analogue Media Stream Detected By HW Manager - $QS="INSERT INTO `cameras` SET `site_id`={$SiteID}, `type`={$CameraType}, `name`='{$STREAM['name']}', `hardware`='{$STREAM['mrl']}', `status`=0"; - $DATABASE->Query( $QS, false ); - $CameraID = $DATABASE->getLastInsertID(); - } else return 0; - if($CameraID==0) return 0; - $QS="UPDATE `media_streams` SET `source_id`={$CameraID} WHERE `id`={$STREAM['id']}"; - $DATABASE->Query( $QS, false ); - $ENAME = $DATABASE->escape($CamName); - $QS="INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`={$CameraType}, `aux_id`={$CameraID}, `name`='{$ENAME}'"; - $DATABASE->Query( $QS, false ); - $NODEID = $DATABASE->getLastInsertID(); - if( $PTZProtocolID > 0 ){ - if( $PTZProtocolID == 3 ){ - } else { - - }; - }; - }; - return 0; - }; - - function addSerialSensor( $SID, $DevType, $Range, $DevName, $UartID, $ProtocolID ){ - global $DATABASE; - $NAME = $DATABASE->escape($DevName); - $UARTID = intval($UartID); - $DEVID = intval($ProtocolID); - $QS = "INSERT INTO `lrf_sensors` SET `type_id`={$DevType}, `device_id`={$DEVID}, `uart_id`={$UARTID}, `data_status`=1, `max_range`={$Range}"; - $DATABASE->Query( $QS, false ); - $AUXID = $DATABASE->getLastInsertID(); - $QS = "INSERT INTO `nodes` SET `type`={$DevType}, `site_id`={$SID}, `aux_id`={$AUXID}, `name`='{$NAME}'"; - $DATABASE->Query( $QS, false ); - $NODEID = $DATABASE->getLastInsertID(); - $PATH_CAM = $NODEID.'_'.$AUXID.'_CAMPORT'; - $QS = "INSERT INTO `uart_settings` SET `node_id`={$NODEID}, `type`=1, `speed`=2400, `bit`=8, `parity`='N', `stop_bit`=1.0, `mode`=2, `port`=2, `path`='{$PATH_CAM}'"; - $DATABASE->Query( $QS, false ); - $CAMUARTID = $DATABASE->getLastInsertID(); - $MM = md5($PATH_CAM); - $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `type`=1, `aux_id`={$CAMUARTID}, `device`='{$PATH_CAM}'"; - $DATABASE->Query( $QS, false ); - $CAMRESID = $DATABASE->getLastInsertID(); - - $PATH_CTL = $NODEID.'_'.$AUXID.'_CTLPORT'; - $QS = "INSERT INTO `uart_settings` SET `node_id`={$NODEID}, `type`=1, `speed`=19200, `bit`=8, `parity`='N', `stop_bit`=1.0, `mode`=1, `port`=1, `path`='{$PATH_CTL}'"; - $DATABASE->Query( $QS, false ); - $CTLUARTID = $DATABASE->getLastInsertID(); - $MM = md5($PATH_CTL); - $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `type`=1, `aux_id`={$CTLUARTID}, `device`='{$PATH_CTL}'"; - $DATABASE->Query( $QS, false ); - $CTLRESID = $DATABASE->getLastInsertID(); - - $QS="SELECT `node_id` as `id`, `id` as `rid` FROM `resources` WHERE `aux_id`={$UARTID} AND `type`=1"; - $TR = $DATABASE->Query( $QS, false ); - $CNID = $TR[0]['id']; - $CAID = $TR[0]['rid']; - $QS = "INSERT INTO `connections` SET `site_id`={$SID}, `to`={$NODEID}, `to_aux`={$CTLRESID}, `from`={$CNID}, `from_aux`={$CAID}, `type`=1"; - $DATABASE->Query( $QS, false ); - $QS = "UPDATE `resources` SET `used`=b'1' WHERE `id`={$CAID}"; - $DATABASE->Query( $QS, false ); - return true; - }; - - function add3DSensor( $SiteID, $ServerNODE, $DevName, $IP, $PORT ){ - global $DATABASE; - $QS = "INSERT INTO `lrf_sensors` SET `type_id`=5, `ip_address`='{$IP}', `port`='{$PORT}'"; - $DATABASE->Query( $QS, false ); - $DevID = $DATABASE->getLastInsertID(); - $QS = "INSERT INTO `nodes` SET `type`=5, `site_id`={$SiteID}, `aux_id`={$DevID}, `name`='{$DevName}'"; - $DATABASE->Query( $QS, false ); - $NodeID = $DATABASE->getLastInsertID(); - $ResName = $IP . ':' . $PORT; - $ResID = createResource( $NodeID, 0, 101, $ResName ); - $ServerNetResources = getResourceID( $ServerNODE, 101 ); - if( count( $ServerNetResources ) ){ - $ServerNetRID = $ServerNetResources[0]; - createConnection( $SiteID, $ServerNODE, $ServerNetRID, $NodeID, $ResID, 4 ); - }; - return true; - }; - - function addAnalogStaticCamera( $SiteID, $ServerNODE, $CamName, $StreamID, $ImagerSize, $F ){ - global $DATABASE, $CUser; - $QS = "SELECT * FROM `media_streams` WHERE `id`={$StreamID}"; - $T = $DATABASE->Query( $QS, false ); - if( count($T) ){ - $STREAM = $T[0]; - $CAMUUID = md5( $SiteID.$CUser->Data['selected_site'].$STREAM['mrl'] ); - $QS = "INSERT INTO `cameras` SET `site_id`={$SiteID}, `node_id`=0, `online`=1, `type`=10, `hardware`='Local_Grabber', `status`=0, uuid='{$CAMUUID}'"; - $DATABASE->Query( $QS, false ); - $CamID = $DATABASE->getLastInsertID(); - $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; - $DATABASE->Query( $QS, false ); - $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=10, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; - $DATABASE->Query( $QS, false ); - $NodeID = $DATABASE->getLastInsertID(); - $QS = "UPDATE `cameras` SET `node_id`={$NodeID} WHERE `id`={$CamID}"; - $DATABASE->Query( $QS, false ); - $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=30, `aux_id`={$CamID}, `device`='Analog Video'"; - $DATABASE->Query( $QS, false ); - $AV_out_pin = $DATABASE->getLastInsertID(); - $QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SiteID} AND `type`=0 LIMIT 1"; - $CC = $DATABASE->Query( $QS, false ); - $ServerNODE = $CC[0]['id']; - $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 ); - return true; - }; - return false; - }; - - function addIpStaticCamera( $SiteID, $ServerNODE, $CamName, $CamID, $StreamID, $ImagerSize, $F ){ - global $DATABASE; - $QS = "UPDATE `cameras` SET `imager_type`={$ImagerSize}, `type`=12, `min_f`={$F} WHERE `id`={$CamID}"; - $DATABASE->Query( $QS, false ); - $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; - $DATABASE->Query( $QS, false ); - $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=12, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; - $DATABASE->Query( $QS, false ); - $NodeID = $DATABASE->getLastInsertID(); - $RMD5 = md5( $CamID.' 30 '.$SiteID ); - $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=32, `aux_id`={$CamID}, `device`='Digial 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 ); - return true; - }; - - function addAnalogPtzCamera( $SiteID, $ServerNODE, $CamName, $StreamID, $ImagerSize, $Fmin, $Fmax, $PanMode, $PanAng, $TiltMode, $TiltAng, $Protocol, $Protocol_Aux, $UartID ){ - global $DATABASE, $CUser; - $CAMUUID = md5( $SiteID.$CUser->Data['selected_site'].$STRRAM['mrl'] ); - $QS = "INSERT INTO `cameras` SET `site_id`={$SiteID}, `node_id`=0, `online`=1, `type`=11, `hardware`='Local_Grabber', `status`=0, `uuid`='{$CAMUUID}', `uart_id`={$UartID}"; - $DATABASE->Query( $QS, false ); - $CamID = $DATABASE->getLastInsertID(); - $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; - $DATABASE->Query( $QS, false ); - $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=11, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; - $DATABASE->Query( $QS, false ); - $NodeID = $DATABASE->getLastInsertID(); - $RMD5 = md5( $CamID.' 30 '.$SiteID ); - $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=30, `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 ); - $RMD5 = md5( $CamID.' 1 '.$SiteID ); - $QS = "INSERT INTO `resources` SET`node_id`={$NodeID}, `type`=1, `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 ); - return true; - }; - - function addIpPtzCamera( $SiteID, $ServerNODE, $CamName, $CamID, $StreamID, $ImagerSize, $LFL, $Zoom, $PanMode, $PanAng, $TiltMode, $TiltAng, $Protocol, $Protocol_Aux, $UART=0 ){ - global $DATABASE; - $QS = "SELECT * FROM `cameras` WHERE `id`={$CamID}"; - $CR = $DATABASE->Query( $QS, false ); - $Range = 0.0; - if( count( $CR ) ){ - $CamData = $CR[0]; - $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=13, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; - $DATABASE->Query( $QS, false ); - $NODEID = $DATABASE->getLastInsertID(); - $DevICE = $CamID .':'.$StreamID.':STREAM'; - $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=4, `type`=32, `aux_id`={$StreamID}, `used`=1, `device`='{$DevICE}'"; - $DATABASE->Query( $QS, false ); - $STRRID = $DATABASE->getLastInsertID(); - $INSTRRIR = getResourceID( $ServerNODE, 101 ); - - $QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NODEID}, `from_aux`={$STRRID}, `to`={$ServerNODE}, `to_aux`={$INSTRRIR[0]}, `type`=4"; - $DATABASE->Query( $QS, false ); - switch( $Protocol ){ - case 3:{ - // Onvif - $QS = "UPDATE `cameras` SET `node_id`={$NODEID}, `type`=13, `status`=3, `protocol`={$Protocol}, `imager_type`={$ImagerSize}, `lens_f`={$LFL}, `zoom`={$Zoom}, `pan_model`={$PanMode}, `pan_angles`={$PanAng}, `tilt_model`={$TiltMode}, `tilt_angles`={$TiltAng}, `max_range`={$Range} WHERE `id`={$CamID}"; - $DATABASE->Query( $QS, false ); - $DevICE = $CamID . ':eth0'; - $Key = md5( $DevICE ); - $QS = "INSERT INTO `network_interfaces` SET `device_name`='{$DevICE}', `key`='{$Key}', `mac`='{$CamData['mac']}'"; - $DATABASE->Query( $QS, false ); - $NIFID = $DATABASE->getLastInsertID(); - $DevICE = $CamID .':'.$StreamID.':CTRL'; - $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=3, `type`=101, `aux_id`={$NIFID}, `used`=1, `device`='{$DevICE}'"; - $DATABASE->Query( $QS, false ); - $CTLRID = $DATABASE->getLastInsertID(); - - $INCTLNID = $ServerNODE; - $INCTLRID = $INSTRRIR[0]; - $CTLTYP = 4; - break; - }; - default:{ - // any serial control - $QS = "UPDATE `cameras` SET `node_id`={$NODEID}, `type`=13, `status`=3, `protocol`={$Protocol}, `protocol_aux`={$Protocol_Aux}, `uart_id`={$UART}, `imager_type`={$ImagerSize}, `lens_f`={$LFL}, `zoom`={$Zoom}, `pan_model`={$PanMode}, `pan_angles`={$PanAng}, `tilt_model`={$TiltMode}, `tilt_angles`={$TiltAng}, `max_range`={$Range} WHERE `id`={$CamID}"; - $DATABASE->Query( $QS, false ); - $DevICE = $CamID .':'.$StreamID.':CTRL'; - $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=1, `type`=1 `aux_id`={$CamID}, `used`=1, `device`='{$DevICE}'"; - $DATABASE->Query( $QS, false ); - $CTLRID = $DATABASE->getLastInsertID(); - $QS = "SELECT `id`, `node_id` FROM `resources` WHERE `type`=1, `aux_id`={$UART}"; - $RR = $DATABASE->Query( $QS, false ); - - $INCTLRID = $RR[0]['id']; - $INCTLNID = $RR[0]['node_id']; - $CTLTYP = 1; - break; - }; - }; - $QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NODEID}, `from_aux`={$CTLRID}, `to`={$INCTLNID}, `to_aux`={$INCTLRID}, `type`={$CTLTYP}"; - $DATABASE->Query( $QS, false ); - return true; - }; - return false; - }; - - function addEthernet2Serial( $SiteID, $ServerNODE, $Name, $Mac, $Ip, $Port, $Mode, $Speed, $Bits, $Stop, $Parity, $User='admin', $Pass='admin' ){ - global $DATABASE; - $SPD = intval( $Speed ); - $BITS = intval( $Bits ); - $STOP = floatval( $Stop ); - $PAR = strtoupper( substr( $Parity, 0, 1 ) ); - $MODE = intval( $Mode ); - $IP = $DATABASE->escape( $Ip ); - $PORT = intval( $Port ); - $EUSER = $DATABASE->escape( $User ); - $EPASS = $DATABASE->escape( $Pass ); - //Add Node - $QS = "INSERT INTO nodes SET `type`=20, `aux_id`=0, `site_id`={$SiteID}, `name`='{$Name}'"; - $DATABASE->Query( $QS, false ); - $NODEID = $DATABASE->getLastInsertID(); - //Add UART - $QS = "INSERT INTO `uart_settings` SET `type`=129, `node_id`={$NODEID}, `mode`={$MODE}, `bit`={$BITS}, `parity`='{$PAR}', `stop_bit`={$STOP}, `port`={$PORT}, `path`='{$IP}', `username`='{$EUSER}', `password`='{$EPASS}'"; - $DATABASE->Query( $QS, false ); - $UARTID = $DATABASE->getLastInsertID(); - $DevICE = $IP .':'.$PORT; - $UARTRESID = createResource( $NODEID, $UARTID, ARGUS_NODE_RES_TYPE_SERIAL_PORT, $DevICE ); - - $QS = "UPDATE `nodes` SET `aux_id`={$UARTID}, `aux_parameter`={$UARTRESID} WHERE `id`={$NODEID}"; - $DATABASE->Query( $QS, false ); - - //Add Network - $NETID = createNIF( $NODEID . ':eth0' ); - $NETRESID = createResource( $NODEID, $NETID, ARGUS_NODE_RES_TYPE_NETWORK, $DevICE ); - //Connection Server <-> E2S - $SNETRESID = getResourceID( $ServerNODE, ARGUS_NODE_RES_TYPE_NETWORK ); - createConnection( $SiteID, $ServerNODE, $SNETRESID[0], $NODEID, $NETRESID, CON_TYPE_TCP ); - return true; - }; - function deleteResource( $RID ){ - global $DATABASE; - $QS = "SELECT * FROM `resources` WHERE ``id`={$RID}"; - $Result = $DATABASE->Query( $QS ); - if( count( $Result ) ){ - $RD = $Result[0]; - switch( $RD['type'] ){ - case 1:{ - // UART - break; - }; - case 30:{ - // analog Video Source - break; - }; - case 31:{ - // analog Video Capture - }; - case 32:{ - // digital Video Source - break; - }; - case 101:{ - // Network eth Interface - $QS = "SELECT * FROM `network_interfaces` WHERE `id`={$RD['aux_id']}"; - $Result = $DATABASE->Query( $QS ); - if( count( $Result ) ){ - $NIF = $Result[0]; - }; - break; - }; - case 102:{ - // Network wifi Interface - break; - }; - }; - }; - }; - - function disrIsEmpty( $Dir ){ - if (!is_readable($Dir)) return false; - return (count(scandir($Dir)) == 2); - }; - - function deletePicturesByStream( $DataDir, $StreamID ){ - global $DATABASE; - if( is_readable( $DataDir ) ){ - /* - $QS = "SELECT id, md5, ext FROM pictures WHERE media_stream_id={$StreamID} LIMIT 100"; - $RR = $DATABASE->Query( $QS ); - while( count( $RR ) ){ - foreach( $RR as $R ){ - //$Base1 = $DataDir . '/' . substr( $R['md5'], 0, 2 ); - //if( is_readable( $Base1 ) ){ - //$Base2 = $Base1 . '/' . substr( $R['md5'], 2, 2 ); - //if( is_readable( $Base2 ) ){ - $Pic = $Base2 . '/' . $R['md5'] . '.' . $R['ext']; - //if( is_readable( $Pic ) ) unlink( $Pic ); - //if( disrIsEmpty( $Base2 ) ) rmdir( $Base2 ); - //}; - //if( disrIsEmpty( $Base1 ) ) rmdir( $Base1 ); - //}; - $QZ = "DELETE FROM events_2_pictures WHERE picture_id={$R['id']}"; - $DATABASE->Query( $QZ ); - }; - $RR = $DATABASE->Query( $QS ); - }; - - */ - $CMD = "rm -R {$DataDir}"; - $LL = `$CMD`; - if( !is_readable( $DataDir ) ) mkdir( $DataDir ); - }; - $QS = "DELETE FROM events_2_pictures WHERE id IN ( SELECT id FROM pictures WHERE media_stream_id={$StreamID} )"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM pictures WHERE media_stream_id={$StreamID}"; - $DATABASE->Query( $QS ); - echo "KOKO"; - }; - - 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; - }; - // Handle Network Interfaces - case 100: - case 101: - case 102: - case 103: - case 104: - case 105:{ - $QS = "DELETE FROM `network_interfaces` WHERE `id`={$R['aux_id']}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `networks` WHERE `nif_id`={$R['aux_id']}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `network_infrastructure` WHERE `nif_id`={$R['aux_id']}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `wifis` WHERE `nif_id`={$R['aux_id']}"; - $DATABASE->Query( $QS ); - break; - }; - // Handle Access Point - case 125:{ - 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 = "SELECT id FROM `media_streams` WHERE `source_id`={$ND['aux_id']} OR `id`={$ND['aux_parameter']}"; - $STR = $DATABASE->Query( $QS ); - //foreach( $STR as $R ) deletePicturesByStream( 'data/reports', $R['id'] ); - $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 `uart_settings` WHERE `node_id`={$ND['id']}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `events_cloud` WHERE `node_id`={$ND['id']}"; - $DATABASE->Query( $QS ); - $QS = "DELETE FROM `events_archive` WHERE `node_id`={$ND['id']}"; - $DATABASE->Query( $QS ); - $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 ); - }; - }; - }; - +Query( $QS, false ); + }; + + function createResource( $NodeID, $AuxID, $Type, $DeviceDesc ){ + global $DATABASE; + $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `used`=1, `type`={$Type}, `aux_id`={$AuxID}, `device`='{$DeviceDesc}' ON DUPLICATE KEY UPDATE `device`='{$DeviceDesc}'"; + $DATABASE->Query( $QS, false ); + $RID = $DATABASE->getLastInsertID(); + if( $RID == 0 ){ + $QS="SELECT `id` FROM `resources` WHERE `node_id`={$NodeID} AND `type`={$Type} AND `aux_id`={$AuxID}"; + $R = $DATABASE->Query( $QS, false ); + $RID = $R[0]['id']; + }; + return $RID; + }; + + function createNIF( $Name, $Type = 1, $Mode = 1, $Mac='', $AUX_ID = 0 ){ + global $DATABASE; + $Key = md5( $Name ); + $Ename = $DATABASE->escape( $Name ); + $QS = "INSERT INTO `network_interfaces` SET `type`={$Type}, `key`='{$Key}', `mode`={$Mode}, `device_name`='{$Ename}', `mac`='{$Mac}', `aux_id`={$AUX_ID} ON DUPLICATE KEY UPDATE `id`=`id`"; + $DATABASE->Query( $QS ); + $NID = $DATABASE->getLastInsertID(); + if( $NID == 0 ){ + $QS="SELECT `id` FROM `network_interfaces` WHERE `key`='{$Key}'"; + $RR = $DATABASE->Query( $QS ); + if( count( $RR ) ) $NID = intval( $RR[0]['id'] ); + }; + return $NID; + }; + + function getServerNode( $SiteID, $Pos = 0 ){ + global $DATABASE; + $QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SiteID} AND `type`=0"; + $SS = $DATABASE->Query( $QS, false ); + if( count( $SS ) ){ + if( $Pos ){ + if( isset ($SS[$Pos] ) ){ + return intval($SS[$Pos]['id']); + }; + } else return intval($SS[0]['id']); + }; + return 0; + }; + + function getResourceID( $NodeID, $ResType ){ + global $DATABASE; + $QS = "SELECT `id` FROM `resources` WHERE `node_id`={$NodeID} AND `type`={$ResType}"; + $RR = $DATABASE->Query( $QS, false ); + $Ret = array(); + if( count( $RR ) ){ + if( count( $RR ) > 1 ) foreach( $RR as $R ) $Ret[] = $R['id']; else $Ret[0]=$RR[0]['id']; + }; + return $Ret; + }; + + function validateIP4( $ADDR ){ + if( strlen( $ADDR ) > 15 ) return false; + $TAr = explode( '.', $ADDR ); + if( count( $TAr ) != 4 ) return false; + $OO = array(); + foreach( $TAr as $R ){ + $k = intval( $R ); + if( $k > 255 ) return false; + $OO[] = $k; + }; + return implode( '.', $OO ); + }; + + function validatePort( $PORT ){ + $K = intval( $PORT ); + if( $K > 65535 ) return false; + return $K; + }; + + function addCamera( $SiteID, $ServerID, $CamName, $CameraType, $MediaStreamID, $CameraID = 0, $PTZProtocolID=0, $FMin=0, $FMax=0, $PanAngles=0, $TiltAngles=0, $PanMode=0, $TiltMode=0, $ImagerSize=0, $UART=0, $PTZProtoccolAUX=0 ){ + global $DATABASE; + + $QS="SELECT * FROM `media_streams` WHERE `id`={$MediaStreamID}"; + $R=$DATABASE->Query( $QS, false ); + if(count($R)){ + $STREAM = $R[0]; + if( $CameraID == 0 && ( $CameraType == ARGUS_ANALOG_STATIC_CAMERA || $CameraType == ARGUS_ANALOG_PTZ_CAMERA ) ){ + //Analogue Camera Made from Analogue Media Stream Detected By HW Manager + $QS="INSERT INTO `cameras` SET `site_id`={$SiteID}, `type`={$CameraType}, `name`='{$STREAM['name']}', `hardware`='{$STREAM['mrl']}', `status`=0"; + $DATABASE->Query( $QS, false ); + $CameraID = $DATABASE->getLastInsertID(); + } else return 0; + if($CameraID==0) return 0; + $QS="UPDATE `media_streams` SET `source_id`={$CameraID} WHERE `id`={$STREAM['id']}"; + $DATABASE->Query( $QS, false ); + $ENAME = $DATABASE->escape($CamName); + $QS="INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`={$CameraType}, `aux_id`={$CameraID}, `name`='{$ENAME}'"; + $DATABASE->Query( $QS, false ); + $NODEID = $DATABASE->getLastInsertID(); + if( $PTZProtocolID > 0 ){ + if( $PTZProtocolID == 3 ){ + } else { + + }; + }; + }; + return 0; + }; + + function addSerialSensor( $SID, $DevType, $Range, $DevName, $UartID, $ProtocolID ){ + global $DATABASE; + $NAME = $DATABASE->escape($DevName); + $UARTID = intval($UartID); + $DEVID = intval($ProtocolID); + $BShift = 0; + if( $DevType == 3 ) $BShift = -160; + $QS = "INSERT INTO `lrf_sensors` SET `type_id`={$DevType}, `device_id`={$DEVID}, `uart_id`={$UARTID}, `data_status`=1, `max_range`={$Range}, base_shift={$BShift}"; + $DATABASE->Query( $QS, false ); + $AUXID = $DATABASE->getLastInsertID(); + $QS = "INSERT INTO `nodes` SET `type`={$DevType}, `site_id`={$SID}, `aux_id`={$AUXID}, `name`='{$NAME}'"; + $DATABASE->Query( $QS, false ); + $NODEID = $DATABASE->getLastInsertID(); + $PATH_CAM = $NODEID.'_'.$AUXID.'_CAMPORT'; + $QS = "INSERT INTO `uart_settings` SET `node_id`={$NODEID}, `type`=1, `speed`=2400, `bit`=8, `parity`='N', `stop_bit`=1.0, `mode`=2, `port`=2, `path`='{$PATH_CAM}'"; + $DATABASE->Query( $QS, false ); + $CAMUARTID = $DATABASE->getLastInsertID(); + $MM = md5($PATH_CAM); + $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `type`=1, `aux_id`={$CAMUARTID}, `device`='{$PATH_CAM}'"; + $DATABASE->Query( $QS, false ); + $CAMRESID = $DATABASE->getLastInsertID(); + + $PATH_CTL = $NODEID.'_'.$AUXID.'_CTLPORT'; + $QS = "INSERT INTO `uart_settings` SET `node_id`={$NODEID}, `type`=1, `speed`=19200, `bit`=8, `parity`='N', `stop_bit`=1.0, `mode`=1, `port`=1, `path`='{$PATH_CTL}'"; + $DATABASE->Query( $QS, false ); + $CTLUARTID = $DATABASE->getLastInsertID(); + $MM = md5($PATH_CTL); + $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `type`=1, `aux_id`={$CTLUARTID}, `device`='{$PATH_CTL}'"; + $DATABASE->Query( $QS, false ); + $CTLRESID = $DATABASE->getLastInsertID(); + + $QS="SELECT `node_id` as `id`, `id` as `rid` FROM `resources` WHERE `aux_id`={$UARTID} AND `type`=1"; + $TR = $DATABASE->Query( $QS, false ); + $CNID = $TR[0]['id']; + $CAID = $TR[0]['rid']; + $QS = "INSERT INTO `connections` SET `site_id`={$SID}, `to`={$NODEID}, `to_aux`={$CTLRESID}, `from`={$CNID}, `from_aux`={$CAID}, `type`=1"; + $DATABASE->Query( $QS, false ); + $QS = "UPDATE `resources` SET `used`=b'1' WHERE `id`={$CAID}"; + $DATABASE->Query( $QS, false ); + return true; + }; + + function add3DSensor( $SiteID, $ServerNODE, $DevName, $IP, $PORT ){ + global $DATABASE; + $QS = "INSERT INTO `lrf_sensors` SET `type_id`=5, `ip_address`='{$IP}', `port`='{$PORT}'"; + $DATABASE->Query( $QS, false ); + $DevID = $DATABASE->getLastInsertID(); + $QS = "INSERT INTO `nodes` SET `type`=5, `site_id`={$SiteID}, `aux_id`={$DevID}, `name`='{$DevName}'"; + $DATABASE->Query( $QS, false ); + $NodeID = $DATABASE->getLastInsertID(); + $ResName = $IP . ':' . $PORT; + $ResID = createResource( $NodeID, 0, 101, $ResName ); + $ServerNetResources = getResourceID( $ServerNODE, 101 ); + if( count( $ServerNetResources ) ){ + $ServerNetRID = $ServerNetResources[0]; + createConnection( $SiteID, $ServerNODE, $ServerNetRID, $NodeID, $ResID, 4 ); + }; + return true; + }; + + function addAnalogStaticCamera( $SiteID, $ServerNODE, $CamName, $StreamID, $ImagerSize, $F ){ + global $DATABASE, $CUser; + $QS = "SELECT * FROM `media_streams` WHERE `id`={$StreamID}"; + $T = $DATABASE->Query( $QS, false ); + if( count($T) ){ + $STREAM = $T[0]; + $CAMUUID = md5( $SiteID.$CUser->Data['selected_site'].$STREAM['mrl'] ); + $QS = "INSERT INTO `cameras` SET `site_id`={$SiteID}, `node_id`=0, `online`=1, `type`=10, `hardware`='Local_Grabber', `status`=0, uuid='{$CAMUUID}'"; + $DATABASE->Query( $QS, false ); + $CamID = $DATABASE->getLastInsertID(); + $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; + $DATABASE->Query( $QS, false ); + $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=10, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; + $DATABASE->Query( $QS, false ); + $NodeID = $DATABASE->getLastInsertID(); + $QS = "UPDATE `cameras` SET `node_id`={$NodeID} WHERE `id`={$CamID}"; + $DATABASE->Query( $QS, false ); + $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=30, `aux_id`={$CamID}, `device`='Analog Video'"; + $DATABASE->Query( $QS, false ); + $AV_out_pin = $DATABASE->getLastInsertID(); + $QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SiteID} AND `type`=0 LIMIT 1"; + $CC = $DATABASE->Query( $QS, false ); + $ServerNODE = $CC[0]['id']; + $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 ); + return true; + }; + return false; + }; + + function addIpStaticCamera( $SiteID, $ServerNODE, $CamName, $CamID, $StreamID, $ImagerSize, $F ){ + global $DATABASE; + $QS = "UPDATE `cameras` SET `imager_type`={$ImagerSize}, `type`=12, `min_f`={$F} WHERE `id`={$CamID}"; + $DATABASE->Query( $QS, false ); + $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; + $DATABASE->Query( $QS, false ); + $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=12, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; + $DATABASE->Query( $QS, false ); + $NodeID = $DATABASE->getLastInsertID(); + $RMD5 = md5( $CamID.' 30 '.$SiteID ); + $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=32, `aux_id`={$CamID}, `device`='Digial 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 ); + return true; + }; + + function addAnalogPtzCamera( $SiteID, $ServerNODE, $CamName, $StreamID, $ImagerSize, $Fmin, $Fmax, $PanMode, $PanAng, $TiltMode, $TiltAng, $Protocol, $Protocol_Aux, $UartID ){ + global $DATABASE, $CUser; + $CAMUUID = md5( $SiteID.$CUser->Data['selected_site'].$STRRAM['mrl'] ); + $QS = "INSERT INTO `cameras` SET `site_id`={$SiteID}, `node_id`=0, `online`=1, `type`=11, `hardware`='Local_Grabber', `status`=0, `uuid`='{$CAMUUID}', `uart_id`={$UartID}"; + $DATABASE->Query( $QS, false ); + $CamID = $DATABASE->getLastInsertID(); + $QS = "UPDATE `media_streams` SET `source_id`={$CamID} WHERE `id`={$StreamID}"; + $DATABASE->Query( $QS, false ); + $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=11, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; + $DATABASE->Query( $QS, false ); + $NodeID = $DATABASE->getLastInsertID(); + $RMD5 = md5( $CamID.' 30 '.$SiteID ); + $QS = "INSERT INTO `resources` SET `node_id`={$NodeID}, `type`=30, `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 ); + $RMD5 = md5( $CamID.' 1 '.$SiteID ); + $QS = "INSERT INTO `resources` SET`node_id`={$NodeID}, `type`=1, `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 ); + return true; + }; + + function addIpPtzCamera( $SiteID, $ServerNODE, $CamName, $CamID, $StreamID, $ImagerSize, $LFL, $Zoom, $PanMode, $PanAng, $TiltMode, $TiltAng, $Protocol, $Protocol_Aux, $UART=0 ){ + global $DATABASE; + $QS = "SELECT * FROM `cameras` WHERE `id`={$CamID}"; + $CR = $DATABASE->Query( $QS, false ); + $Range = 0.0; + if( count( $CR ) ){ + $CamData = $CR[0]; + $QS = "INSERT INTO `nodes` SET `site_id`={$SiteID}, `type`=13, `aux_id`={$CamID}, `aux_parameter`={$StreamID}, `name`='{$CamName}'"; + $DATABASE->Query( $QS, false ); + $NODEID = $DATABASE->getLastInsertID(); + $DevICE = $CamID .':'.$StreamID.':STREAM'; + $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=4, `type`=32, `aux_id`={$StreamID}, `used`=1, `device`='{$DevICE}'"; + $DATABASE->Query( $QS, false ); + $STRRID = $DATABASE->getLastInsertID(); + $INSTRRIR = getResourceID( $ServerNODE, 101 ); + + $QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NODEID}, `from_aux`={$STRRID}, `to`={$ServerNODE}, `to_aux`={$INSTRRIR[0]}, `type`=4"; + $DATABASE->Query( $QS, false ); + switch( $Protocol ){ + case 3:{ + // Onvif + $QS = "UPDATE `cameras` SET `node_id`={$NODEID}, `type`=13, `status`=3, `protocol`={$Protocol}, `imager_type`={$ImagerSize}, `lens_f`={$LFL}, `zoom`={$Zoom}, `pan_model`={$PanMode}, `pan_angles`={$PanAng}, `tilt_model`={$TiltMode}, `tilt_angles`={$TiltAng}, `max_range`={$Range} WHERE `id`={$CamID}"; + $DATABASE->Query( $QS, false ); + $DevICE = $CamID . ':eth0'; + $Key = md5( $DevICE ); + $QS = "INSERT INTO `network_interfaces` SET `device_name`='{$DevICE}', `key`='{$Key}', `mac`='{$CamData['mac']}'"; + $DATABASE->Query( $QS, false ); + $NIFID = $DATABASE->getLastInsertID(); + $DevICE = $CamID .':'.$StreamID.':CTRL'; + $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=3, `type`=101, `aux_id`={$NIFID}, `used`=1, `device`='{$DevICE}'"; + $DATABASE->Query( $QS, false ); + $CTLRID = $DATABASE->getLastInsertID(); + + $INCTLNID = $ServerNODE; + $INCTLRID = $INSTRRIR[0]; + $CTLTYP = 4; + break; + }; + default:{ + // any serial control + $QS = "UPDATE `cameras` SET `node_id`={$NODEID}, `type`=13, `status`=3, `protocol`={$Protocol}, `protocol_aux`={$Protocol_Aux}, `uart_id`={$UART}, `imager_type`={$ImagerSize}, `lens_f`={$LFL}, `zoom`={$Zoom}, `pan_model`={$PanMode}, `pan_angles`={$PanAng}, `tilt_model`={$TiltMode}, `tilt_angles`={$TiltAng}, `max_range`={$Range} WHERE `id`={$CamID}"; + $DATABASE->Query( $QS, false ); + $DevICE = $CamID .':'.$StreamID.':CTRL'; + $QS = "INSERT INTO `resources` SET `node_id`={$NODEID}, `class`=1, `type`=1 `aux_id`={$CamID}, `used`=1, `device`='{$DevICE}'"; + $DATABASE->Query( $QS, false ); + $CTLRID = $DATABASE->getLastInsertID(); + $QS = "SELECT `id`, `node_id` FROM `resources` WHERE `type`=1, `aux_id`={$UART}"; + $RR = $DATABASE->Query( $QS, false ); + + $INCTLRID = $RR[0]['id']; + $INCTLNID = $RR[0]['node_id']; + $CTLTYP = 1; + break; + }; + }; + $QS = "INSERT INTO `connections` SET `site_id`={$SiteID}, `from`={$NODEID}, `from_aux`={$CTLRID}, `to`={$INCTLNID}, `to_aux`={$INCTLRID}, `type`={$CTLTYP}"; + $DATABASE->Query( $QS, false ); + return true; + }; + return false; + }; + + function addEthernet2Serial( $SiteID, $ServerNODE, $Name, $Mac, $Ip, $Port, $Mode, $Speed, $Bits, $Stop, $Parity, $User='admin', $Pass='admin' ){ + global $DATABASE; + $SPD = intval( $Speed ); + $BITS = intval( $Bits ); + $STOP = floatval( $Stop ); + $PAR = strtoupper( substr( $Parity, 0, 1 ) ); + $MODE = intval( $Mode ); + $IP = $DATABASE->escape( $Ip ); + $PORT = intval( $Port ); + $EUSER = $DATABASE->escape( $User ); + $EPASS = $DATABASE->escape( $Pass ); + //Add Node + $QS = "INSERT INTO nodes SET `type`=20, `aux_id`=0, `site_id`={$SiteID}, `name`='{$Name}'"; + $DATABASE->Query( $QS, false ); + $NODEID = $DATABASE->getLastInsertID(); + //Add UART + $QS = "INSERT INTO `uart_settings` SET `type`=129, `node_id`={$NODEID}, `mode`={$MODE}, `bit`={$BITS}, `parity`='{$PAR}', `stop_bit`={$STOP}, `port`={$PORT}, `path`='{$IP}', `username`='{$EUSER}', `password`='{$EPASS}'"; + $DATABASE->Query( $QS, false ); + $UARTID = $DATABASE->getLastInsertID(); + $DevICE = $IP .':'.$PORT; + $UARTRESID = createResource( $NODEID, $UARTID, ARGUS_NODE_RES_TYPE_SERIAL_PORT, $DevICE ); + + $QS = "UPDATE `nodes` SET `aux_id`={$UARTID}, `aux_parameter`={$UARTRESID} WHERE `id`={$NODEID}"; + $DATABASE->Query( $QS, false ); + + //Add Network + $NETID = createNIF( $NODEID . ':eth0' ); + $NETRESID = createResource( $NODEID, $NETID, ARGUS_NODE_RES_TYPE_NETWORK, $DevICE ); + //Connection Server <-> E2S + $SNETRESID = getResourceID( $ServerNODE, ARGUS_NODE_RES_TYPE_NETWORK ); + createConnection( $SiteID, $ServerNODE, $SNETRESID[0], $NODEID, $NETRESID, CON_TYPE_TCP ); + return true; + }; + + + + function deleteResource( $RID ){ + global $DATABASE; + $QS = "SELECT * FROM `resources` WHERE `id`={$RID}"; + $Result = $DATABASE->Query( $QS ); + if( count( $Result ) ){ + $RD = $Result[0]; + switch( $RD['type'] ){ + case 1:{ + // UART + break; + }; + case 30:{ + // analog Video Source + break; + }; + case 31:{ + // analog Video Capture + }; + case 32:{ + // digital Video Source + break; + }; + case 101:{ + // Network eth Interface + $QS = "SELECT * FROM `network_interfaces` WHERE `id`={$RD['aux_id']}"; + $Result = $DATABASE->Query( $QS ); + if( count( $Result ) ){ + $NIF = $Result[0]; + }; + break; + }; + case 102:{ + // Network wifi Interface + break; + }; + }; + }; + $QS = "DELETE FROM `resources` WHERE `id`={$RID}"; + $DATABASE->Query( $QS ); + }; + + function deleteNodeResources( $NID ){ + global $DATABASE; + $QS = "SELECT id FROM `resources` WHERE `node_id`={$NID}"; + $RES = $DATABASE->Query( $QS ); + foreach( $RES as $R ) deleteResource( $R['id'] ); + }; + + function disrIsEmpty( $Dir ){ + if (!is_readable($Dir)) return false; + return (count(scandir($Dir)) == 2); + }; + + 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 Only Clear Resources + case 0: break; + // Sensors + case 1: + case 2: + case 3: + case 4: + case 5: + case 6:{ + $QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$ND['aux_id']}"; + $DD = $DATABASE->Query( $QS ); + if( count( $DD ) != 0 ){ + $SDATA = $DD[0]; + + $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 ); + }; + if( $SDATA['embd_cam_id'] > 0 ){ + $QS = "SELECT id FROM `media_streams` WHERE `source_id`={$SDATA['embd_cam_id']}"; + $STR = $DATABASE->Query( $QS ); + foreach( $STR as $R ){ + $QS = "DELETE ep FROM `events_2_pictures` ep LEFT JOIN pictures pi ON ( ep.picture_id = pi.id ) WHERE pi.media_stream_id = {$R['id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `pictures` WHERE `media_stream_id`={$R['id']}"; + $DATABASE->Query( $QS ); + //$QS = "DELETE `events_2_videos` FROM `events_2_videos` ep LEFT JOIN videos vi ON ( ep.video_id = vi.id ) WHERE vi.media_stream_id = {$R['id']}"; + //$DATABASE->Query( $QS ); + //$QS = "DELETE FROM `videos` WHERE `media_stream_id`={$R['id']}"; + //$DATABASE->Query( $QS ); + }; + $QS = "DELETE FROM `media_streams` WHERE `source_id`={$SDATA['embd_cam_id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `cameras` WHERE `id`={$SDATA['embd_cam_id']}"; + $DATABASE->Query( $QS ); + }; + }; + $QS = "DELETE ep FROM `events_2_pictures` ep LEFT JOIN `events_archive` ea ON ( ep.evt_id = ea.id ) WHERE ea.node_id = {$ND['id']}"; + $DATABASE->Query( $QS ); + //$QS = "DELETE ev FROM `events_2_videos` ev LEFT JOIN `events_archive` ea ON ( ev.evt_id = ea.id ) WHERE ea.node_id = {$ND['id']}"; + //$DATABASE->Query( $QS ); + break; + }; + // Cameras + case 10: + case 11: + case 12: + case 13:{ + $QS = "SELECT id FROM `media_streams` WHERE `source_id`={$ND['aux_id']} OR `id`={$ND['aux_parameter']}"; + $STR = $DATABASE->Query( $QS ); + foreach( $STR as $R ){ + $QS = "DELETE ep FROM `events_2_pictures` ep LEFT JOIN pictures pi ON ( ep.picture_id = pi.id ) WHERE pi.media_stream_id = {$R['id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `pictures` WHERE `media_stream_id`={$R['id']}"; + $DATABASE->Query( $QS ); + //$QS = "DELETE ev FROM `events_2_videos` ev LEFT JOIN videos vi ON ( ev.video_id = vi.id ) WHERE vi.media_stream_id = {$R['id']}"; + //$DATABASE->Query( $QS ); + //$QS = "DELETE FROM `videos` WHERE `media_stream_id`={$R['id']}"; + //$DATABASE->Query( $QS ); + }; + $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 `uart_settings` WHERE `node_id`={$ND['id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `events_cloud` WHERE `node_id`={$ND['id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `events_archive` WHERE `node_id`={$ND['id']}"; + $DATABASE->Query( $QS ); + $QS = "DELETE FROM `connections` WHERE `from`={$ND['id']} OR `to`={$ND['id']}"; + $DATABASE->Query( $QS ); + if( $ND['type'] != 0 ){ + $QS = "DELETE FROM `nodes` WHERE `id`={$ND['id']}"; + $DATABASE->Query( $QS ); + }; + deleteNodeResources( $NodeID ); + }; + return true; + }; + + function loadNotPicture(){ + global $SYSPath; + header("Content-Type: image/jpeg"); + $Data = file_get_contents( $SYSPath . '/style/assets/no_picture.jpg' ); + echo $Data; + }; + + function loadPicture( $PID ){ + global $DATABASE; + $QS = "SELECT * FROM pictures WHERE id={$PID}"; + $Result = $DATABASE->Query( $QS, false ); + if( count( $Result ) ){ + $CP = $Result[0]; + switch( $CP['ext'] ){ + case 'jpe': + case 'jpg': + case 'jpeg': + header("Content-Type: image/jpeg"); + break; + case 'gif': + header("Content-Type: image/gif"); + break; + case 'png': + header("Content-Type: image/png"); + break; + default: + header("Content-Type: image/image"); + break; + }; + echo $CP['data']; + return; + }; + loadNotPicture(); + }; + ?> \ No newline at end of file diff --git a/lib/php/argus/upload.php b/lib/php/argus/upload.php new file mode 100644 index 0000000..b280877 --- /dev/null +++ b/lib/php/argus/upload.php @@ -0,0 +1,43 @@ +$ok, "info"=>$info])); + } + // invalid upload + if (empty($_FILES) || $_FILES['file']['error']) { + verbose(0, "Failed to move uploaded file."); + } + // upload destination + $filePath = __DIR__ . DIRECTORY_SEPARATOR . "uploads"; + if (!file_exists($filePath)) { + if (!mkdir($filePath, 0777, true)) { + verbose(0, "Failed to create $filePath"); + } + } + $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"]; + $filePath = $filePath . DIRECTORY_SEPARATOR . $fileName; + // dealing with the chunks + $chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; + $chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0; + $out = @fopen("{$filePath}.part", $chunk == 0 ? "wb" : "ab"); + if ($out) { + $in = @fopen($_FILES['file']['tmp_name'], "rb"); + if ($in) { + while ($buff = fread($in, 4096)) { fwrite($out, $buff); } + } else { + verbose(0, "Failed to open input stream"); + } + @fclose($in); + @fclose($out); + @unlink($_FILES['file']['tmp_name']); + } else { + verbose(0, "Failed to open output stream"); + } + // check if file was uploaded + if (!$chunks || $chunk == $chunks - 1) { + rename("{$filePath}.part", $filePath); + } + verbose(1, "Upload OK"); +?> \ No newline at end of file diff --git a/lib/php/db/MySQL_class.php b/lib/php/db/MySQL_class.php index f8a1d8f..55c5a70 100644 --- a/lib/php/db/MySQL_class.php +++ b/lib/php/db/MySQL_class.php @@ -19,7 +19,7 @@ class MySQL_DB{ $this->isConnected=true; } else { $this->isConnected=false; - echo "Error During Connection to Database!!
      "; + //echo "Error During Connection to Database!!
      "; } } function CleanUpCache(){ diff --git a/lib/php/db/MySQLi_class.php b/lib/php/db/MySQLi_class.php index 8850105..ad4eee1 100644 --- a/lib/php/db/MySQLi_class.php +++ b/lib/php/db/MySQLi_class.php @@ -8,15 +8,36 @@ class MySQLi_DB{ var $CachePath; var $isConnected=false; var $isCached=false; - function MySQLi_DB( $Host,$Name,$User,$Password){ + function MySQLi_DB( $Host, $Name, $User, $Password, $DBCREATE = false ){ $this->DBHost=$Host; $this->DBName=$Name; $this->DBUser=$User; $this->DBPassword=$Password; $this->DBLink = new mysqli( $this->DBHost, $this->DBUser, $this->DBPassword, $this->DBName ); if( $this->DBLink->connect_error ){ - $this->isConnected=false; - echo 'Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error; + if( $DBCREATE ){ + $this->DBLink = new mysqli( $this->DBHost, $this->DBUser, $this->DBPassword ); + if( $this->DBLink->connect_error ){ + $this->isConnected=false; + //echo 'Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error; + } else { + if (!$this->DBLink->set_charset("utf8")) { + printf("Error loading character set utf8: %s\n", $mysqli->error); + } else { + //printf("Current character set: %s\n", $mysqli->character_set_name()); + }; + $QS = "CREATE DATABASE {$Name}"; + if( mysqli_query( $this->DBLink, $QS ) === false ) { + echo " Error during query [$QS]:".mysqli_error($this->DBLink); + $this->isConnected=false; + } else { + $this->isConnected=true; + }; + }; + } else { + $this->isConnected=false; + //echo 'Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error; + }; } else { //mysql_query("SET NAMES 'UTF8'",$this->DBLink); if (!$this->DBLink->set_charset("utf8")) { @@ -26,7 +47,7 @@ class MySQLi_DB{ }; $this->isConnected=true; }; - } + } function CleanUpCache(){ if ($DD=@opendir($this->CachePath)){ while($FN=readdir($DD)){ diff --git a/lib/php/setup_toolkit/cleanNewTask.php b/lib/php/setup_toolkit/cleanNewTask.php new file mode 100644 index 0000000..025538f --- /dev/null +++ b/lib/php/setup_toolkit/cleanNewTask.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/lib/php/setup_toolkit/createNewTask.php b/lib/php/setup_toolkit/createNewTask.php new file mode 100644 index 0000000..3a4be66 --- /dev/null +++ b/lib/php/setup_toolkit/createNewTask.php @@ -0,0 +1,66 @@ + 0 ){ + switch( $TID ){ + case 1: + if( $PRM!= '' ){ + $TArr = explode( '.', $PRM ); + $TBrr = explode( '_', $TArr[0] ); + createNewTask( $TID, $TBrr[1], "Restore Database Backup" ); + $Data['status'] = 1; + } else { + $Data['error'] = 'No Backup ID Provided!'; + }; + break; + case 2: + createNewTask( $TID, '', "Create Database Backup" ); + $Data['status'] = 1; + break; + case 100:{ + if( $PRM!= '' ){ + $TArr = explode( '.', $PRM ); + $TBrr = explode( '_', $TArr[0] ); + createNewTask( $TID, $GVAULT_PATH.'/'.$TBrr[0].'/'. $PRM , "Delete Package" ); + $Data['status'] = 1; + } else { + $Data['error'] = 'No Snapeshot ID Provided!'; + }; + $Data['status'] = 1; + break; + }; + case 128: + if( $PRM!= '' ){ + $TArr = explode( '.', $PRM ); + $TBrr = explode( '_', $TArr[0] ); + createNewTask( $TID, $GVAULT_PATH.'/'.$TBrr[0].'/'. $PRM , "Restore Full System Snapeshot" ); + $Data['status'] = 1; + } else { + $Data['error'] = 'No Snapeshot ID Provided!'; + }; + $Data['status'] = 1; + break; + case 255: + createNewTask( $TID, '', "Create Full System Snapeshot" ); + $Data['status'] = 1; + break; + default: + $Data['error'] = 'Unrecognized Task ID!'; + }; + } else { + $Data['error'] = 'No Task Type Provided!'; + }; + echo json_encode( $Data ); +?> \ No newline at end of file diff --git a/lib/php/setup_toolkit/getTaskStatus.php b/lib/php/setup_toolkit/getTaskStatus.php new file mode 100644 index 0000000..d792682 --- /dev/null +++ b/lib/php/setup_toolkit/getTaskStatus.php @@ -0,0 +1,52 @@ +description; + break; + }; + case 2:{ + $Data['status_desc']=$Task->description; + if( file_exists( $GVAULT_PATH.'/task_perc.var' ) ){ + $ACO = intval( file_get_contents( $GVAULT_PATH.'/task_perc.var' ) ); + } else { + $ACO = 0; + }; + break; + }; + }; + + echo json_encode( $Data ); + +?> \ No newline at end of file diff --git a/lib/php/setup_toolkit/list_vault.php b/lib/php/setup_toolkit/list_vault.php new file mode 100644 index 0000000..be5bd3f --- /dev/null +++ b/lib/php/setup_toolkit/list_vault.php @@ -0,0 +1,39 @@ + 1 ){ + $CR['id'] = $CID; + $CR['ts'] = date( "Y-m-d H:i", intval($TArr[0])); + $CR['bk_type'] = intval( $TArr[1] ); + $CR['base_version']=$CV; + $CR['file_name']=$CV.'_'.$TArr[0].'.tar.bz2'; + $CR['size']=filesize( $GVAULT_PATH.'/'.$CV.'/'.$CR['file_name'] ); + if( $CR['size'] > 268435456 ){ + $CR['size'] = sprintf("%0.1fGb", $CR['size'] / 1073741824 ); + } else if( $CR['size'] > 716800 ){ + $CR['size'] = sprintf("%0.1fMb", $CR['size'] / 1048576 ); + } else if( $CR['size'] > 1023 ){ + $CR['size'] = sprintf("%0.1fKb", $CR['size'] / 1024 ); + } else { + $CR['size'] = sprintf("%dB", $CR['size'] ); + }; + $Data['backups'][]=$CR; + $CID ++; + }; + }; + }; + $Data['totalCount'] = $CID; + echo json_encode( $Data ); + +?> \ No newline at end of file diff --git a/lib/php/setup_toolkit/upload.php b/lib/php/setup_toolkit/upload.php new file mode 100644 index 0000000..ab56610 --- /dev/null +++ b/lib/php/setup_toolkit/upload.php @@ -0,0 +1,54 @@ +$ok, "info"=>$info])); + }; + // invalid upload + if( empty( $_FILES ) || $_FILES['file']['error'] ){ + verbose( 0, "Failed to move uploaded file.[" . $_FILES['file']['error'] . "]" ); + }; + // upload destination + //$filePath = __DIR__ . DIRECTORY_SEPARATOR . "../../vault/working_dir/uploads"; + $filePath = $GTEMP_DIR . '/uploads'; + if( !file_exists($filePath) ){ + if (!mkdir($filePath, 0777, true)) { + verbose(0, "Failed to create $filePath"); + }; + }; + $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"]; + $filePath = $filePath . DIRECTORY_SEPARATOR . $fileName; + // dealing with the chunks + $chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; + $chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0; + $out = @fopen("{$filePath}.part", $chunk == 0 ? "wb" : "ab"); + if( $out ) { + $in = @fopen($_FILES['file']['tmp_name'], "rb"); + if( $in ){ + while( $buff = fread( $in, 4096 ) ){ + fwrite($out, $buff); + }; + } else { + verbose(0, "Failed to open input stream"); + }; + @fclose($in); + @fclose($out); + @unlink($_FILES['file']['tmp_name']); + } else { + verbose(0, "Failed to open output stream"); + }; + // check if file was uploaded + if (!$chunks || $chunk == $chunks - 1) { + rename("{$filePath}.part", $filePath); + if( createNewTask( 3, $fileName, 'Handle Upload File' ) == 0 ){ + unlink( $filePath ); + verbose(0, "Failed to create new Task"); + }; + }; + verbose(1, "Upload OK"); +?> \ No newline at end of file diff --git a/lib/php/setup_toolkit/vault b/lib/php/setup_toolkit/vault new file mode 120000 index 0000000..6d7a7c4 --- /dev/null +++ b/lib/php/setup_toolkit/vault @@ -0,0 +1 @@ +/srv/vault \ No newline at end of file diff --git a/lib/php/sys/r-goose_sys.php b/lib/php/sys/r-goose_sys.php index ffa5b1b..84e6556 100644 --- a/lib/php/sys/r-goose_sys.php +++ b/lib/php/sys/r-goose_sys.php @@ -68,13 +68,6 @@ function generate3DMapImage( $datafile, $byMin = true, $imagefile='' ){ return $contents; }; -function loadNotPicture(){ - global $SYSPath; - header("Content-Type: image/jpeg"); - $Data = file_get_contents( $SYSPath . '/style/assets/no_picture.jpg' ); - echo $Data; -}; - function makeStorageBasePath( $MD ){ global $SYSPath; $FL = substr( $MD, 0, 2 ); @@ -92,34 +85,6 @@ function makeStorageBasePath( $MD ){ return $SYSPath.'/storage/'.$FL.'/'.$SL.'/'.$TL; }; -function loadPicture( $Data ){ - if( is_array( $Data ) ){ - if( isset( $Data['md5'] ) && isset( $Data['ext'] ) ){ - $fname = makeStorageBasePath( $Data['md5'] ).'/'.$Data['md5'].'.'.$Data['ext']; - switch( $Data['ext'] ){ - case 'jpe': - case 'jpg': - case 'jpeg': - header("Content-Type: image/jpeg"); - break; - case 'gif': - header("Content-Type: image/gif"); - break; - case 'png': - header("Content-Type: image/png"); - break; - default: - header("Content-Type: image/image"); - break; - }; - $D = file_get_contents( $fname ); - echo $D; - return; - }; - }; - loadNotPicture(); -}; - function registerPicture( $fname ){ global $DATABASE; if( file_exists( $fname ) ){ diff --git a/lib/php/ui/UI_functions.php b/lib/php/ui/UI_functions.php index 2b5c1b9..7cda8ef 100644 --- a/lib/php/ui/UI_functions.php +++ b/lib/php/ui/UI_functions.php @@ -161,7 +161,7 @@ function UI_PageHeader(){ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){ - global $WEBPath, $Labels, $UserLang; + global $WEBPath, $Labels, $UserLang, $CUser; ?> @@ -218,7 +218,14 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){ - + Data['access'] > 5 ){ +?> + + + @@ -387,7 +394,7 @@ function UI_INSTALL_DBCRED_Form( $A='', $B='', $C='', $D='', $E='' ){ -
      +
       
      - + \ No newline at end of file diff --git a/setup/index.php b/setup/index.php index f44db59..c19028d 100644 --- a/setup/index.php +++ b/setup/index.php @@ -1,14 +1,104 @@ Data['id'] > 1 ){ - UI_PageHeaderExt( - 'rgoose_general.js', - array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js','rgoose_main.js', 'rgoose_devices_module.js') - ); - UI_PageBottomExt(); + require_once('../lib/install.php'); + UI_INSTALL_PageHeader(); + if( isset( $_GET['stp'] ) ){ + $STP = intval( $_GET['stp'] ); } else { - UI_PageHeader(); - UI_LoginForm(); - UI_PageBottom(); + $STP = 0; }; + switch( $STP ){ + case 0:{ + UI_INSTALL_DBCRED_Form(); + break; + }; + case 1:{ + $DBH = $_POST['dbh']; + $DBN = $_POST['dbn']; + $DBU = $_POST['dbu']; + $DBP = $_POST['dbp']; + $DATABASE = new MySQLi_DB( $DBH, $DBN, $DBU, $DBP, true ); + if( $DATABASE->isConnected ){ + $CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./dfsl_gunter_structs.sql'; + $AA=`$CMD`; + $CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./camera_ptz_protocols.sql'; + $AA=`$CMD`; + $CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./labels_js.sql'; + $AA=`$CMD`; + $CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./labels_php.sql'; + $AA=`$CMD`; + $CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./server_module_types.sql'; + $AA=`$CMD`; + if( is_writable( '../lib/settings.php' ) ){ + $FID = fopen('../lib/settings.php', 'w+' ); + if( $FID ){ + fprintf( $FID, '" ); + fclose( $FID ); + }; + UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP ); + } else { + UI_INSTALL_DBCRED_Form( $DBH, $DBN, $DBU, $DBP, "Cannot Write Settings File
      Please Fix Access to Lib Folder."); + }; + } else { + UI_INSTALL_DBCRED_Form( $DBH, $DBN, $DBU, $DBP, "Error Connecting to Database"); + }; + break; + }; + case 2:{ + $ADU = $_POST['adu']; + $ADP = $_POST['adp']; + $ADP2 = $_POST['adp2']; + $SINA = $_POST['sina']; + $DBH = $_POST['dbh']; + $DBN = $_POST['dbn']; + $DBU = $_POST['dbu']; + $DBP = $_POST['dbp']; + if( $ADP == $ADP2 ){ + if( $SINA != '' ){ + $DATABASE = new MySQLi_DB( $DBH, $DBN, $DBU, $DBP ); + if( 1 || is_writable( './index.php' ) ){ + //$FID = fopen( './index.php', 'w+'); + //if( $FID ){ + // $Data = file_get_contents( './setup/index.php' ); + // fprintf( $FID, $Data ); + // fclose( $FID ); + //}; + $EU = $DATABASE->escape( $ADU ); + $EP = md5( $ADP ); + $ESN = $DATABASE->escape( $SINA ); + $QS = "INSERT INTO `users` SET `login`='{$EU}', `pwdMD5`='{$EP}', `create_ts`=NOW(), `language`=1, `access`=10"; + $DATABASE->Query( $QS ); + //$SID = md5( $ESN ); + $QS = "INSERT INTO `sites` SET `name`='{$ESN}',`anchor_lat`=44.42601349357776,`anchor_lon`=8.823269813144353,`anchor_alt`=18.5";//, `server_ident`='{$SID}'"; + $DATABASE->Query( $QS ); + //$ID = $DATABASE->getLastInsertID(); + //$QS = "INSERT INTO `servers` SET `site_id`={$ID}, `identity`='{$SID}'"; + //$DATABASE->Query( $QS ); + UI_INSTALL_WELCOME_Form(); + } else { + UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Cannot Write Index File
      Please Fix access to File/Folder!' ); + }; + } else { + UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Please Provide Default Site Name!' ); + }; + } else { + UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Admin User Passwords are not identical!' ); + }; + break; + }; + default:{ + echo "STEP: {$STP}\n"; + break; + }; + }; + UI_PageBottomExt(); ?> \ No newline at end of file diff --git a/setup/install.php b/setup/install.php index af11225..643db3c 100644 --- a/setup/install.php +++ b/setup/install.php @@ -1,5 +1,5 @@ |jdSBP;dYxad>v`?QJ`WdZ2~`OQf}~w> zj$RN12fxB0aU}S$aN+$j_#qO#+to)L{JSh3m<0Y_7lk_%4aR>I{)g?}TyOz=s6uc$ zNbrut6Jk%C3xZ-}W4DE#IURlKL{!kW$aBF3TpLvg(uQ0ecllf>oMp#01^V9Rf1jH< zb1o-UkWOO6hj$^1hDCuiisR?{89!L}#VK5tmC|2$rolaL(RXV#B8aM?IM^$T93s zrmgs8>3&6Jb7uP)i71_U$=LQ2P2j09cq$Q$*Cp4wUL&q)uH_eyixHFb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q+R}v7aFSogc+;-xkQ3hra!zV8vqo? zUjShI?XC3h(|zDw+=hQd{te3w%R`I!(K1Dg7K&w$9$Fq*yf0Ex?W|c^DRuD?_!;jJ zHQ;`|U;u>^7HXOFUOivBjKB&lz*+@?Tg(D@R*OckGmleVXQ>T}bWsQE*R+nAHTCs1 znRXqA-rpb?YSS_E-UfcARmU2DYpgof16*&_(Fs;K@ho%X1s&~DiH?pU|D=wx@hex3 zm)Uh3aeu2|giS};y{&wiRmbrFkGJZ$65y3q9i3o>6VEb7UeM7lmFVawvaycn26_lD zhgf6GLj+Hgo87aZW{>cMjk;rj*C#ME93bv-*jj+r65M%!&NqM@R7Vc06o+J&0&jo@ F{|B;<(|P~^ literal 0 HcmV?d00001 diff --git a/style/assets/cursor.png b/style/assets/cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..b67b59de8de50657effa63f3215c3b9a0d80924f GIT binary patch literal 714 zcmV;*0yX`KP)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=i0S9!4|YCf)!u_W&lxj1omL2 zM&?jL+Z0N3Na!J!a!Ks?+m3${q(Y=Z$^wCABuPDI*1hR?ckoLmNR&f5!BYK2hu(q+ zW5!F4z!_kyoehE>I?n*?fYl2C07(K>C5jQElrjKTz^Mi5mz@}2w=2xbqFL0MV4^kb z_ApDg&<5dKdI8%f*7q5(yJK#4O1I&%V0>kHosv#phRDD$5qSnMeIjx!=No{73=@&o z92_>=088NRU~_2`ktz!$%R35Jht1Z&0(dys?ArnJ;nwn60{e!X+kNT4>D|JPv_q?g w1As_Gk%;1pD87jP{vwKBvk8990)u!C00`Z^FsnpRg#Z8m07*qoM6N<$f*uwwF#rGn literal 0 HcmV?d00001 diff --git a/style/assets/green_1.gif b/style/assets/green_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..3df63df684927ed00ed8ae639f73ab23cc28afa7 GIT binary patch literal 1331 zcmZ?wbhEHb6krfwI3mEn$jGShjKRvmnSqfZr@V$YhGF8uP%ls@!Z$#{C9xzCNZZ&~ z6eK2RrR+S8t5Au=^L2q8X8!cnp+tdDnNk}(6*wKG^-#NH>h1e zo~=?wNlAf~zJ7Umxn8-kUVc%!zM-Y1rM`iYzLAkGP=#)BWnM{Qg>GK4GRy>*)Z*l# z%z~24{5%DaiHS-1r6smXK$k+ikXryZHm_I@>>a)2{9OHt!~%UoJp+)JUE zg{v+u2}(t{7puX=A(aKG`a!A1`K3k4sX*n*AgcnUy@&( zkzb(T9Bis*s1Tl+my%yz3|8;!Yvq|&T#}fVoa*Ufs{}MbFEca6%EHji&C$Zi+|A6* z#n8~z*~!Ad)z#F%(a6=s(Zt!w9H!SLKe;qFHLnDwHwB^B0;gV3Qpha;+U$~Alv$RV z;#QQOs{r=0RVHq?nBp`Ksy79}YRmZE0?5Y^blRt*Nf6tSB!l zEh#Q4EXdEx&B@Nn%t%j5O-W8lOo)$*jfswmj0g`44G9hk4Dk2!_3`%d^l*1`b#Zob zbg;LxwXwFcv@ka_H8C~g9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS z9&Rp94t6$H7G@@3;h^}Fh1CdHGUbAck!gyu|W(F=GWMEZNVBu&<6kt-&@_((hSlj-|n`vd)&(5D*yhkLPO?aY@Mkoh^ FH2`3g#2^3w literal 0 HcmV?d00001 diff --git a/style/assets/green_2.gif b/style/assets/green_2.gif new file mode 100644 index 0000000000000000000000000000000000000000..d9dfddf6290957a00a4f1ee73ec234423b69e53f GIT binary patch literal 1331 zcmZ?wbhEHb6krfwI3mEn$jHDO!w}}h&A`YYv6|t$^ZZVpMeyh_@CR)H6+;CF~HSG&w!Z`s23;{;Txdfl30=mq;2dg z3KEmEQ%e+*Qqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)Wn zQ(;w+TacStlBiITo0C^;Rbi`?n3A8AY6WD2g!Ppaz)DK8ZIv8B5(*$Yo%4%Q6-@OE zbdwFt3>C~w^bAc5EKMwR6pRcE4fG9-^bO2)4GpYJ&8-X!6`()~Xj@TAnpKdC8`Lf! z&sHg;q@=(~U%$M(T(8_%FTW^V-_X+1Qs2Nx-^fT8s6w~6GOr}DLN~8i8D@e@YH@N= zW? z$S+WE4mQ;@R0z+^OUW-U2CMh=werj>E=kNwPW5!LRRWrzmzkMjWoBvY=;&%@}YB3>TKX_XyWW-Y3gih1k>x1pIn-onpXnTn}X15j8iWtDdZLaZFWg5$}CGw zaVyHtRRDY0DigO`3~-tU)tiFbErvMt>H{644~kf%h=vIPQxAvNJFPuMj_RQ&1Cr=zdcJ#>MLkAD+-?w+q?p-@~Y~QwZ%jQiRH>_W`cFpQlD_1OE zwsgtjMGF_qpEq~T>{&BsOrJJ&%H&BCC-nFA_H=i3cC@#(wlp_2Hq_VE)>KzjR+N{O zmJ}Bi7UbvU=45AOW~8U3rX(jNCd9|Z#zaR&Mudljh6D!%2Kf8=`gnVJdbqo}x;Q&I zI@sIU+E`mzT9})eniv}avy`5$j<%MjhPs-nin5ZTg1nrpjI@-bgt(Zfh_H~L06!lu z4>uPl2Rj=p3o{e2a8Ufo!fFI8nRGy945)}=VD(Z^=}XC+r*XyL^dXZBLl%}Mfr9}v znjigfIJ)2p2Sa}!L(UNeg+>;(%*Kj;0^ONcyHrir_Gzr-2%A>rztGcd^TU!Ap|7W| zy6vxsFrJx#nSl!k8CaDRSU8RqN-!y?`M*|MtZo0~&9t)YXXj5Y-XoIDCOpwcBb0-| F8USy}!!7^- literal 0 HcmV?d00001 diff --git a/style/assets/red_1.gif b/style/assets/red_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd61ff750f18307ecc68d271dc2c8a92e5812803 GIT binary patch literal 1331 zcmZ?wbhEHb6krfwI3mEn$jJDNK_P~Lmyv-Xr@Y3>!Fl4s<*OMaUc7kGz#tSD87nC% z84?n*c=6(en|A(ZQ2GD=KLaU1@jthpYe=xOV}PrXo&ht^76zbDgl~X?OJYePkhZa} zC`e4sPAySLN=?tqvsHS(d%u!GW{Ry+xT&v!Z-H}aMy5wqQEG6NUr2IQcCuxPlD(aR zO@&oOZb5EpNuokUZcbjYRfVlmVoH8esuhq864qBz04piUwpDTjNhpBqbj~kIRWQ{v z&`mZlGgL4$(K9qLur#sMQ7|$vG|)FR(l;>IH8ij?HMcS_RDc2{plwAdX;wilZcw{` zJX@uVl9B=|ef{$Ca=mh6z5JqdeM3u2OML?)eIp}XpbFjM%Dj@q3f;V7Wta&rsl~}f znFS@8`FRQ;6BCp2OG|8(fG&l2A-4c-Y+kV**gJa3`MLTPi3R$GdIlgb!4&%X;#ZoR z3s+rS5|oN?FIIz#Ln;eW^@CE2^Gl18Q-R8rK~@!5ITxiSmgE4u`)9aF-T$-DjR|3v4~Pj*wm=R%;iu*SQ+p9G zSu_6s_xI25Uq63*|MvCE=T9F$ynpxh&Ffb$Up#;I^vUB#4%#K*DArlQF4tD{WLk%;W zKm9pyWWf~yhJJp=oFf(rjqGfhf))Rmx-+kKshY0s*I3CBHm%Bkp{LvChb1dQUr$|i z+g}l3JTn6`0~Zi7uqr9Ah_oaMuqtTzz1CW+ZT;lUw6g4H=T0u(Ba+P~JkduZl!L(< E0M**UjsO4v literal 0 HcmV?d00001 diff --git a/style/assets/red_2.gif b/style/assets/red_2.gif new file mode 100644 index 0000000000000000000000000000000000000000..1e671e43f688534833e3af98c997511843235686 GIT binary patch literal 1331 zcmZ?wbhEHb6krfwI3mEn$jA`p#m&gTu$n>Q8H2*LT{82#L}M6uU%YtHz#vqfE+8o> z84?n*c=6)5=j8u0sQmx`pMeyh_@CR)H6+;CF~HSG&wv?d5d%;t!Z$#{C9xzCNZZ&~ z6eK2RrR+S8t5Au=^L2q8X8!cnp+tdDnNk}(6*wKG^-#NH>h1e zo~=?wNlAf~zJ7Umxn8-kUVc%!zM-Y1rM`iYzLAkGP=#)BWnM{Qg>GK4GRy>*)Z*l# z%z~24{5%DaiHS-1r6smXK$k+ikXryZHm_I@>>a)2{9OHt!~%UoJp+)JUE zg{v+u2}(t{7puX=A(aKG`a!A1`K3k4sX*n*AgcnUy@&( zkzb(T9Bis*s1Tl+my%yz3|8;!Yvq|&T#}fVoa*Ufs{}MbFEca6%EZOR(a^xz!p+Rh z#n8~z+0xM5)XCDq#o5Hj(8}YRmZE0?5Y^blRt*Nf6tSB!l zEh#Q4EXdEx&B@Nn%t%j5O-W8lOo)$*jfswmj0g`44G9hk4Dk2!_3`%d^l*1`b#Zob zbg;LxwXwFcv@ka_H8C~g9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS z9&Rp94t6$H7G@@3;h^}Fh1CdHGUrztGcd^TU!Ap|7W| zy6vxsFrJx#nSl!k8CaDRSXkTwB^VX7{9bD<*0z4~W?EVHvvVgG?-9vn6Q1a!5z4_} F4FGKM!KwfN literal 0 HcmV?d00001