Se agrega funcionalidad de WebSockets
This commit is contained in:
@ -1 +1 @@
|
||||
{"version":3,"file":"../main.min.js","sources":["main.js"],"sourcesContent":["\"use strict\";\n\nfunction formatValue(value, base) {\n return new Intl.NumberFormat('es-CL', {\n style: 'currency',\n currency: base,\n minimumSignificantDigits: 2\n }).format(value);\n}\n\nfunction formatDate(date) {\n return new Intl.DateTimeFormat('es-CL', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }).format(date);\n}\n\nfunction readyDate(date) {\n return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();\n}"],"names":["formatValue","value","base","Intl","NumberFormat","style","currency","minimumSignificantDigits","format","formatDate","date","DateTimeFormat","year","month","day","hour","minute","second","readyDate","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds"],"mappings":"aAEA,SAASA,YAAYC,EAAOC,GAC1B,OAAO,IAAIC,KAAKC,aAAa,QAAS,CACpCC,MAAO,WACPC,SAAUJ,EACVK,yBAA0B,IACzBC,OAAOP,GAGZ,SAASQ,WAAWC,GAClB,OAAO,IAAIP,KAAKQ,eAAe,QAAS,CACtCC,KAAM,UACNC,MAAO,UACPC,IAAK,UACLC,KAAM,UACNC,OAAQ,UACRC,OAAQ,YACPT,OAAOE,GAGZ,SAASQ,UAAUR,GACjB,OAAOA,EAAKS,cAAgB,KAAOT,EAAKU,WAAa,GAAK,IAAMV,EAAKW,UAAY,IAAMX,EAAKY,WAAa,IAAMZ,EAAKa,aAAe,IAAMb,EAAKc"}
|
||||
{"version":3,"file":"../main.min.js","sources":["main.js"],"sourcesContent":["\"use strict\";\n\nfunction formatValue(value, base) {\n return new Intl.NumberFormat('es-CL', {\n style: 'currency',\n currency: base,\n minimumSignificantDigits: 2\n }).format(value);\n}\n\nfunction formatDate(date) {\n return new Intl.DateTimeFormat('es-CL', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }).format(date);\n}\n\nfunction readyDate(date) {\n return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();\n}\n\nvar socket = {\n url: '',\n conn: null,\n connect: function connect(ready, getMessage) {\n this.conn = new WebSocket(this.url);\n\n this.conn.onopen = function (e) {\n console.debug(e);\n ready();\n };\n\n this.conn.onmessage = function (e) {\n console.debug(e);\n getMessage(e);\n };\n\n this.conn.onerror = function (e) {\n console.error(e);\n };\n\n this.conn.onclose = function (e) {\n if (e.code != 1000) {\n console.error(e);\n return;\n }\n\n console.debug(e);\n };\n },\n sendMessage: function sendMessage(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var msg = {\n action: action\n };\n\n if (data != null) {\n msg['data'] = data;\n }\n\n this.conn.send(JSON.stringify(msg));\n }\n};"],"names":["formatValue","value","base","Intl","NumberFormat","style","currency","minimumSignificantDigits","format","formatDate","date","DateTimeFormat","year","month","day","hour","minute","second","readyDate","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","socket","url","conn","connect","ready","getMessage","this","WebSocket","onopen","e","console","debug","onmessage","onerror","error","onclose","code","sendMessage","action","data","arguments","length","undefined","msg","send","JSON","stringify"],"mappings":"aAEA,SAASA,YAAYC,EAAOC,GAC1B,OAAO,IAAIC,KAAKC,aAAa,QAAS,CACpCC,MAAO,WACPC,SAAUJ,EACVK,yBAA0B,IACzBC,OAAOP,GAGZ,SAASQ,WAAWC,GAClB,OAAO,IAAIP,KAAKQ,eAAe,QAAS,CACtCC,KAAM,UACNC,MAAO,UACPC,IAAK,UACLC,KAAM,UACNC,OAAQ,UACRC,OAAQ,YACPT,OAAOE,GAGZ,SAASQ,UAAUR,GACjB,OAAOA,EAAKS,cAAgB,KAAOT,EAAKU,WAAa,GAAK,IAAMV,EAAKW,UAAY,IAAMX,EAAKY,WAAa,IAAMZ,EAAKa,aAAe,IAAMb,EAAKc,aAGhJ,IAAIC,OAAS,CACXC,IAAK,GACLC,KAAM,KACNC,QAAS,SAAiBC,EAAOC,GAC/BC,KAAKJ,KAAO,IAAIK,UAAUD,KAAKL,KAE/BK,KAAKJ,KAAKM,OAAS,SAAUC,GAC3BC,QAAQC,MAAMF,GACdL,KAGFE,KAAKJ,KAAKU,UAAY,SAAUH,GAC9BC,QAAQC,MAAMF,GACdJ,EAAWI,IAGbH,KAAKJ,KAAKW,QAAU,SAAUJ,GAC5BC,QAAQI,MAAML,IAGhBH,KAAKJ,KAAKa,QAAU,SAAUN,GACd,KAAVA,EAAEO,KAKNN,QAAQC,MAAMF,GAJZC,QAAQI,MAAML,KAOpBQ,YAAa,SAAqBC,GAChC,IAAIC,EAA0B,EAAnBC,UAAUC,aAA+BC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,KAC3EG,EAAM,CACRL,OAAQA,GAGE,MAARC,IACFI,EAAU,KAAIJ,GAGhBb,KAAKJ,KAAKsB,KAAKC,KAAKC,UAAUH"}
|
Reference in New Issue
Block a user