summaryrefslogtreecommitdiffstats
path: root/admin/survey/script
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/survey/script/Chartjs.js28
-rw-r--r--admin/survey/script/Chartjs/chart.js13
-rw-r--r--admin/survey/script/DragDrop/dragdropInAdmin.js16
-rw-r--r--admin/survey/script/GDPR.js102
-rw-r--r--admin/survey/script/Maps/VnaprejMarkers.js2
-rw-r--r--admin/survey/script/appendMerge.js34
-rw-r--r--admin/survey/script/branching.js461
-rw-r--r--admin/survey/script/break.js36
-rw-r--r--admin/survey/script/cReport.js87
-rw-r--r--admin/survey/script/calendar/calendar.js2
-rw-r--r--admin/survey/script/charts.js8
-rw-r--r--admin/survey/script/collectData.js2
-rw-r--r--admin/survey/script/comments.js198
-rw-r--r--admin/survey/script/conditionProfiles.js4
-rw-r--r--admin/survey/script/crosstab.js46
-rw-r--r--admin/survey/script/customizeImageView.js20
-rw-r--r--admin/survey/script/dataSettingProfiles.js6
-rw-r--r--admin/survey/script/datatables/jquery.dataTables.min.css2
-rw-r--r--admin/survey/script/datepicker.js6
-rw-r--r--admin/survey/script/domainChange.js28
-rw-r--r--admin/survey/script/dostop.js2
-rw-r--r--admin/survey/script/folders.js4
-rw-r--r--admin/survey/script/inspect.js2
-rw-r--r--admin/survey/script/invitations.js316
-rw-r--r--admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js7
-rw-r--r--admin/survey/script/js-lang.php35
-rw-r--r--admin/survey/script/library.js490
-rw-r--r--admin/survey/script/means.js21
-rw-r--r--admin/survey/script/missingProfiles.js4
-rw-r--r--admin/survey/script/missingValues.js6
-rw-r--r--admin/survey/script/mobile.js104
-rw-r--r--admin/survey/script/multiCrosstabs.js6
-rw-r--r--admin/survey/script/notifications.js63
-rw-r--r--admin/survey/script/postProcess.js165
-rw-r--r--admin/survey/script/progressBar.js10
-rw-r--r--admin/survey/script/quota.js38
-rw-r--r--admin/survey/script/script.js1597
-rw-r--r--admin/survey/script/script_analiza.js627
-rw-r--r--admin/survey/script/skupine.js12
-rw-r--r--admin/survey/script/slideshow.js4
-rw-r--r--admin/survey/script/statistika.js4
-rw-r--r--admin/survey/script/statusProfiles.js46
-rw-r--r--admin/survey/script/surveyCondition.js6
-rw-r--r--admin/survey/script/surveyList.js317
-rw-r--r--admin/survey/script/telephone.js64
-rw-r--r--admin/survey/script/themes.js68
-rw-r--r--admin/survey/script/timeProfiles.js4
-rw-r--r--admin/survey/script/ttest.js20
-rw-r--r--admin/survey/script/uporabniki_custom.js12
-rw-r--r--admin/survey/script/vprasanje.js377
-rw-r--r--admin/survey/script/vprasanjeDeleted.js86
-rw-r--r--admin/survey/script/vprasanjeInline.js470
-rw-r--r--admin/survey/script/zankaProfiles.js47
-rw-r--r--admin/survey/script/zoom.js31
54 files changed, 3916 insertions, 2250 deletions
diff --git a/admin/survey/script/Chartjs.js b/admin/survey/script/Chartjs.js
new file mode 100644
index 0000000..d968d2f
--- /dev/null
+++ b/admin/survey/script/Chartjs.js
@@ -0,0 +1,28 @@
+function diagnosticsChart(place,display) {
+
+ const data = {
+ datasets: [{
+ data: display,
+ backgroundColor: [
+ 'rgb(229,229,229)',
+ 'rgb(30, 136, 229)',
+ ],
+ borderWidth: 0, //spacing between slices
+ }]
+ };
+
+ const config = {
+ type: 'doughnut',
+ data: data,
+ options: {
+ events: [], //no hover labels,animations,...
+ cutout: 30, //slice width
+ }
+ };
+
+ const myChart = new Chart(
+ document.getElementById(place),
+ config
+ );
+
+} \ No newline at end of file
diff --git a/admin/survey/script/Chartjs/chart.js b/admin/survey/script/Chartjs/chart.js
new file mode 100644
index 0000000..27815c8
--- /dev/null
+++ b/admin/survey/script/Chartjs/chart.js
@@ -0,0 +1,13 @@
+/*!
+ * Chart.js v3.8.0
+ * https://www.chartjs.org
+ * (c) 2022 Chart.js Contributors
+ * Released under the MIT License
+ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";const t="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function e(e,i,s){const n=s||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...s){a=n(s),o||(o=!0,t.call(window,(()=>{o=!1,e.apply(i,a)})))}}function i(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const s=t=>"start"===t?"left":"end"===t?"right":"center",n=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,o=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;var a=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=t.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};
+/*!
+ * @kurkle/color v0.2.1
+ * https://github.com/kurkle/color#readme
+ * (c) 2022 Jukka Kurkela
+ * Released under the MIT License
+ */function r(t){return t+.5|0}const l=(t,e,i)=>Math.max(Math.min(t,i),e);function h(t){return l(r(2.55*t),0,255)}function c(t){return l(r(255*t),0,255)}function d(t){return l(r(t/2.55)/100,0,1)}function u(t){return l(r(100*t),0,100)}const f={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},g=[..."0123456789ABCDEF"],p=t=>g[15&t],m=t=>g[(240&t)>>4]+g[15&t],b=t=>(240&t)>>4==(15&t);function x(t){var e=(t=>b(t.r)&&b(t.g)&&b(t.b)&&b(t.a))(t)?p:m;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const _=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function v(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function w(t,e,i){const s=y(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function M(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function k(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(c)}function S(t,e,i){return k(y,t,e,i)}function P(t){return(t%360+360)%360}function D(t){const e=_.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?h(+e[5]):c(+e[5]));const n=P(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return k(w,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return k(v,t,e,i)}(n,o,a):S(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}const C={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},O={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let A;function T(t){A||(A=function(){const t={},e=Object.keys(O),i=Object.keys(C);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,C[o]);o=parseInt(O[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),A.transparent=[0,0,0,0]);const e=A[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const L=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const R=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,E=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function I(t,e,i){if(t){let s=M(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=S(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function z(t,e){return t?Object.assign(e||{},t):t}function F(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=c(t[3]))):(e=z(t,{r:0,g:0,b:0,a:1})).a=c(e.a),e}function B(t){return"r"===t.charAt(0)?function(t){const e=L.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?h(t):l(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?h(i):l(i,0,255)),s=255&(e[4]?h(s):l(s,0,255)),n=255&(e[6]?h(n):l(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):D(t)}class V{constructor(t){if(t instanceof V)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=F(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*f[s[1]],g:255&17*f[s[2]],b:255&17*f[s[3]],a:5===o?17*f[s[4]]:255}:7!==o&&9!==o||(n={r:f[s[1]]<<4|f[s[2]],g:f[s[3]]<<4|f[s[4]],b:f[s[5]]<<4|f[s[6]],a:9===o?f[s[7]]<<4|f[s[8]]:255})),i=n||T(t)||B(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=z(this._rgb);return t&&(t.a=d(t.a)),t}set rgb(t){this._rgb=F(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${d(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?x(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=M(t),i=e[0],s=u(e[1]),n=u(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${d(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=E(d(t.r)),n=E(d(t.g)),o=E(d(t.b));return{r:c(R(s+i*(E(d(e.r))-s))),g:c(R(n+i*(E(d(e.g))-n))),b:c(R(o+i*(E(d(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new V(this.rgb)}alpha(t){return this._rgb.a=c(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=r(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return I(this._rgb,2,t),this}darken(t){return I(this._rgb,2,-t),this}saturate(t){return I(this._rgb,1,t),this}desaturate(t){return I(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=M(t);i[0]=P(i[0]+e),i=S(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function N(t){return new V(t)}function W(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function H(t){return W(t)?t:N(t)}function j(t){return W(t)?t:N(t).saturate(.5).darken(.1).hexString()}function $(){}const Y=function(){let t=0;return function(){return t++}}();function U(t){return null==t}function X(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function q(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const K=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function G(t,e){return K(t)?t:e}function Z(t,e){return void 0===t?e:t}const J=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,Q=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function tt(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function et(t,e,i,s){let n,o,a;if(X(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(q(t))for(a=Object.keys(t),o=a.length,n=0;n<o;n++)e.call(i,t[a[n]],a[n])}function it(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function st(t){if(X(t))return t.map(st);if(q(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=st(t[i[n]]);return e}return t}function nt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ot(t,e,i,s){if(!nt(t))return;const n=e[t],o=i[t];q(n)&&q(o)?at(n,o,s):e[t]=st(o)}function at(t,e,i){const s=X(e)?e:[e],n=s.length;if(!q(t))return t;const o=(i=i||{}).merger||ot;for(let a=0;a<n;++a){if(!q(e=s[a]))continue;const n=Object.keys(e);for(let s=0,a=n.length;s<a;++s)o(n[s],t,e,i)}return t}function rt(t,e){return at(t,e,{merger:lt})}function lt(t,e,i){if(!nt(t))return;const s=e[t],n=i[t];q(s)&&q(n)?rt(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=st(n))}function ht(t,e){const i=t.indexOf(".",e);return-1===i?t.length:i}function ct(t,e){if(""===e)return t;let i=0,s=ht(e,i);for(;t&&s>i;)t=t[e.slice(i,s)],i=s+1,s=ht(e,i);return t}function dt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ut=t=>void 0!==t,ft=t=>"function"==typeof t,gt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function pt(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const mt=Object.create(null),bt=Object.create(null);function xt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function _t(t,e,i){return"string"==typeof e?at(xt(t,e),i):at(xt(t,""),e)}var yt=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>j(e.backgroundColor),this.hoverBorderColor=(t,e)=>j(e.borderColor),this.hoverColor=(t,e)=>j(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return _t(this,t,e)}get(t){return xt(this,t)}describe(t,e){return _t(bt,t,e)}override(t,e){return _t(mt,t,e)}route(t,e,i,s){const n=xt(this,t),o=xt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return q(t)?Object.assign({},e,t):Z(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function vt(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const wt=(t,e,i)=>vt(t,i,(s=>t[s][e]<i)),Mt=(t,e,i)=>vt(t,i,(s=>t[s][e]>=i));function kt(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const St=["push","pop","shift","splice","unshift"];function Pt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),St.forEach((e=>{const i="_onData"+dt(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function Dt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(St.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ct(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}const Ot=Math.PI,At=2*Ot,Tt=At+Ot,Lt=Number.POSITIVE_INFINITY,Rt=Ot/180,Et=Ot/2,It=Ot/4,zt=2*Ot/3,Ft=Math.log10,Bt=Math.sign;function Vt(t){const e=Math.round(t);t=Ht(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Ft(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function Nt(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function Wt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Ht(t,e,i){return Math.abs(t-e)<i}function jt(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function $t(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Yt(t){return t*(Ot/180)}function Ut(t){return t*(180/Ot)}function Xt(t){if(!K(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function qt(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*Ot&&(o+=At),{angle:o,distance:n}}function Kt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gt(t,e){return(t-e+Tt)%At-Ot}function Zt(t){return(t%At+At)%At}function Jt(t,e,i,s){const n=Zt(t),o=Zt(e),a=Zt(i),r=Zt(o-n),l=Zt(a-n),h=Zt(n-o),c=Zt(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function Qt(t,e,i){return Math.max(e,Math.min(i,t))}function te(t){return Qt(t,-32768,32767)}function ee(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function ie(){return"undefined"!=typeof window&&"undefined"!=typeof document}function se(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ne(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const oe=t=>window.getComputedStyle(t,null);function ae(t,e){return oe(t).getPropertyValue(e)}const re=["top","right","bottom","left"];function le(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=re[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function he(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=oe(i),o="border-box"===n.boxSizing,a=le(n,"padding"),r=le(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const ce=t=>Math.round(10*t)/10;function de(t,e,i,s){const n=oe(t),o=le(n,"margin"),a=ne(n.maxWidth,t,"clientWidth")||Lt,r=ne(n.maxHeight,t,"clientHeight")||Lt,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=se(t);if(o){const t=o.getBoundingClientRect(),a=oe(o),r=le(a,"border","width"),l=le(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=ne(a.maxWidth,o,"clientWidth"),n=ne(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||Lt,maxHeight:n||Lt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=le(n,"border","width"),e=le(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?Math.floor(h/s):c-o.height),h=ce(Math.min(h,a,l.maxWidth)),c=ce(Math.min(c,r,l.maxHeight)),h&&!c&&(c=ce(h/2)),{width:h,height:c}}function ue(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=n/s,t.width=o/s;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const fe=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function ge(t,e){const i=ae(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function pe(t){return!t||U(t.size)||U(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function me(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function be(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,h,c,d,u;for(l=0;l<r;l++)if(d=i[l],null!=d&&!0!==X(d))a=me(t,n,o,a,d);else if(X(d))for(h=0,c=d.length;h<c;h++)u=d[h],null==u||X(u)||(a=me(t,n,o,a,u));t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function xe(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function _e(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ye(t,e,i,s){let n,o,a,r,l;const h=e.pointStyle,c=e.rotation,d=e.radius;let u=(c||0)*Rt;if(h&&"object"==typeof h&&(n=h.toString(),"[object HTMLImageElement]"===n||"[object HTMLCanvasElement]"===n))return t.save(),t.translate(i,s),t.rotate(u),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),h){default:t.arc(i,s,d,0,At),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=zt,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=zt,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,o=Math.cos(u+It)*r,a=Math.sin(u+It)*r,t.arc(i-o,s-a,l,u-Ot,u-Et),t.arc(i+a,s-o,l,u-Et,u),t.arc(i+o,s+a,l,u,u+Et),t.arc(i-a,s+o,l,u+Et,u+Ot),t.closePath();break;case"rect":if(!c){r=Math.SQRT1_2*d,t.rect(i-r,s-r,2*r,2*r);break}u+=It;case"rectRot":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+a,s-o),t.lineTo(i+o,s+a),t.lineTo(i-a,s+o),t.closePath();break;case"crossRot":u+=It;case"cross":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o);break;case"star":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o),u+=It,o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o);break;case"line":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(u)*d,s+Math.sin(u)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function ve(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function we(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Me(t){t.restore()}function ke(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Se(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Pe(t,e,i,s,n,o={}){const a=X(e)?e:[e],r=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);U(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)h=a[l],r&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),U(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,s,o.maxWidth)),t.fillText(h,i,s,o.maxWidth),De(t,i,s,h,o),s+=n.lineHeight;t.restore()}function De(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Ce(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,-Et,Ot,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,Ot,Et,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,Et,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-Et,!0),t.lineTo(i+a.topLeft,s)}function Oe(t,e=[""],i=t,s,n=(()=>t[0])){ut(s)||(s=Ne("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:n,override:n=>Oe([n,...t],e,i,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ee(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=Ne(Le(o,t),i),ut(n))return Re(t,n)?Be(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>We(t).includes(e),ownKeys:t=>We(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Ae(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Te(t,s),setContext:e=>Ae(t,e,i,s),override:n=>Ae(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ee(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];ft(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t),e=e(o,a||s),r.delete(t),Re(t,e)&&(e=Be(n._scopes,n,t,e));return e}(e,r,t,i));X(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(ut(o.index)&&s(t))e=e[o.index%e.length];else if(q(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Be(s,n,t,l);e.push(Ae(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable));Re(e,r)&&(r=Ae(r,n,o&&o[e],a));return r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Te(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:ft(i)?i:()=>i,isIndexable:ft(s)?s:()=>s}}const Le=(t,e)=>t?t+dt(e):e,Re=(t,e)=>q(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ee(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function Ie(t,e,i){return ft(t)?t(e,i):t}const ze=(t,e)=>!0===t?e:"string"==typeof t?ct(e,t):void 0;function Fe(t,e,i,s,n){for(const o of e){const e=ze(i,o);if(e){t.add(e);const o=Ie(e._fallback,i,n);if(ut(o)&&o!==i&&o!==s)return o}else if(!1===e&&ut(s)&&i!==s)return null}return!1}function Be(t,e,i,s){const n=e._rootScopes,o=Ie(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let l=Ve(r,a,i,o||i,s);return null!==l&&((!ut(o)||o===i||(l=Ve(r,a,o,l,s),null!==l))&&Oe(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];if(X(n)&&q(i))return i;return n}(e,i,s))))}function Ve(t,e,i,s,n){for(;i;)i=Fe(t,e,i,s,n);return i}function Ne(t,e){for(const i of e){if(!i)continue;const e=i[t];if(ut(e))return e}}function We(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function He(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(ct(c,o),h)};return a}const je=Number.EPSILON||1e-14,$e=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ye=t=>"x"===t?"y":"x";function Ue(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=Kt(o,n),l=Kt(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Xe(t,e="x"){const i=Ye(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=$e(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=$e(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?Bt(n[a-1])!==Bt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=$e(t,0);for(let c=0;c<s-1;++c)l=h,h=$e(t,c+1),l&&h&&(Ht(e[c],0,je)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ye(i),n=t.length;let o,a,r,l=$e(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=$e(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}function qe(t,e,i){return Math.max(Math.min(t,i),e)}function Ke(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Xe(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Ue(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=ve(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&ve(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=qe(n.cp1x,e.left,e.right),n.cp1y=qe(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=qe(n.cp2x,e.left,e.right),n.cp2y=qe(n.cp2y,e.top,e.bottom)))}(t,i)}const Ge=t=>0===t||1===t,Ze=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*At/i),Je=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*At/i)+1,Qe={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Et),easeOutSine:t=>Math.sin(t*Et),easeInOutSine:t=>-.5*(Math.cos(Ot*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ge(t)?t:Ze(t,.075,.3),easeOutElastic:t=>Ge(t)?t:Je(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ge(t)?t:t<.5?.5*Ze(2*t,e,.45):.5+.5*Je(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Qe.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Qe.easeInBounce(2*t):.5*Qe.easeOutBounce(2*t-1)+.5};function ti(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ei(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ii(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=ti(t,n,i),r=ti(n,o,i),l=ti(o,e,i),h=ti(a,r,i),c=ti(r,l,i);return ti(h,c,i)}const si=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=si.get(i);return s||(s=new Intl.NumberFormat(t,e),si.set(i,s)),s}(e,i).format(t)}const oi=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ai=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ri(t,e){const i=(""+t).match(oi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function li(t,e){const i={},s=q(e),n=s?Object.keys(e):e,o=q(t)?s?i=>Z(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+o(t)||0;return i}function hi(t){return li(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ci(t){return li(t,["topLeft","topRight","bottomLeft","bottomRight"])}function di(t){const e=hi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ui(t,e){t=t||{},e=e||yt.font;let i=Z(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=Z(t.style,e.style);s&&!(""+s).match(ai)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:Z(t.family,e.family),lineHeight:ri(Z(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:Z(t.weight,e.weight),string:""};return n.string=pe(n),n}function fi(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;n<o;++n)if(a=t[n],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),r=!1),void 0!==i&&X(a)&&(a=a[i%a.length],r=!1),void 0!==a))return s&&!r&&(s.cacheable=!1),a}function gi(t,e,i){const{min:s,max:n}=t,o=Q(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function pi(t,e){return Object.assign(Object.create(t),e)}function mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function bi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function xi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function _i(t){return"angle"===t?{between:Jt,compare:Gt,normalize:Zt}:{between:ee,compare:(t,e)=>t-e,normalize:t=>t}}function yi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function vi(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=_i(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=_i(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,m,b,x=!1,_=null;const y=()=>x||l(n,b,p)&&0!==r(n,b),v=()=>!x||0===r(o,p)||l(o,b,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==b&&(x=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(yi({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,b=p));return null!==_&&g.push(yi({start:_,end:d,loop:u,count:a,style:f})),g}function wi(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=vi(s[n],t.points,e);o.length&&i.push(...o)}return i}function Mi(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return ki(t,[{start:a,end:r,loop:o}],i,e);return ki(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function ki(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=Si(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Si(s.setContext(pi(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Pi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function Si(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Pi(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Di=Object.freeze({__proto__:null,easingEffects:Qe,isPatternOrGradient:W,color:H,getHoverColor:j,noop:$,uid:Y,isNullOrUndef:U,isArray:X,isObject:q,isFinite:K,finiteOrDefault:G,valueOrDefault:Z,toPercentage:J,toDimension:Q,callback:tt,each:et,_elementsEqual:it,clone:st,_merger:ot,merge:at,mergeIf:rt,_mergerIf:lt,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},resolveObjectKey:ct,_capitalize:dt,defined:ut,isFunction:ft,setsEqual:gt,_isClickEvent:pt,toFontString:pe,_measureText:me,_longestText:be,_alignPixel:xe,clearCanvas:_e,drawPoint:ye,_isPointInArea:ve,clipArea:we,unclipArea:Me,_steppedLineTo:ke,_bezierCurveTo:Se,renderText:Pe,addRoundedRectPath:Ce,_lookup:vt,_lookupByKey:wt,_rlookupByKey:Mt,_filterBetween:kt,listenArrayEvents:Pt,unlistenArrayEvents:Dt,_arrayUnique:Ct,_createResolver:Oe,_attachContext:Ae,_descriptors:Te,_parseObjectDataRadialScale:He,splineCurve:Ue,splineCurveMonotone:Xe,_updateBezierControlPoints:Ke,_isDomSupported:ie,_getParentNode:se,getStyle:ae,getRelativePosition:he,getMaximumSize:de,retinaScale:ue,supportsEventListenerOptions:fe,readUsedSize:ge,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:t,throttled:e,debounce:i,_toLeftRightCenter:s,_alignStartEnd:n,_textX:o,_pointInLine:ti,_steppedInterpolation:ei,_bezierInterpolation:ii,formatNumber:ni,toLineHeight:ri,_readValueToProps:li,toTRBL:hi,toTRBLCorners:ci,toPadding:di,toFont:ui,resolve:fi,_addGrace:gi,createContext:pi,PI:Ot,TAU:At,PITAU:Tt,INFINITY:Lt,RAD_PER_DEG:Rt,HALF_PI:Et,QUARTER_PI:It,TWO_THIRDS_PI:zt,log10:Ft,sign:Bt,niceNum:Vt,_factorize:Nt,isNumber:Wt,almostEquals:Ht,almostWhole:jt,_setMinAndMaxByKey:$t,toRadians:Yt,toDegrees:Ut,_decimalPlaces:Xt,getAngleFromPoint:qt,distanceBetweenPoints:Kt,_angleDiff:Gt,_normalizeAngle:Zt,_angleBetween:Jt,_limitValue:Qt,_int16Range:te,_isBetween:ee,getRtlAdapter:mi,overrideTextDirection:bi,restoreTextDirection:xi,_boundSegment:vi,_boundSegments:wi,_computeSegments:Mi});function Ci(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?Mt:wt;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Oi(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=Ci(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function Ai(t,e,i,s,n){const o=[];if(!n&&!t.isPointInArea(e))return o;return Oi(t,i,e,(function(i,a,r){(n||ve(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:a,index:r})}),!0),o}function Ti(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return Oi(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})})),a}function Li(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?Ti(t,e,i,s,n,o):function(t,e,i,s){let n=[];return Oi(t,i,e,(function(t,i,o){const{startAngle:a,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=qt(t,{x:e.x,y:e.y});Jt(l,a,r)&&n.push({element:t,datasetIndex:i,index:o})})),n}(t,e,i,n):[]}function Ri(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return Oi(t,i,e,((t,s,l)=>{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Ei={evaluateInteractionItems:Oi,modes:{index(t,e,i,s){const n=he(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Ai(t,n,o,s,a):Li(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=he(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Ai(t,n,o,s,a):Li(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>Ai(t,he(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=he(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return Li(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Ri(t,he(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Ri(t,he(e,t),"y",i.intersect,s)}};const Ii=["left","top","right","bottom"];function zi(t,e){return t.filter((t=>t.pos===e))}function Fi(t,e){return t.filter((t=>-1===Ii.indexOf(t.pos)&&t.box.axis===e))}function Bi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Vi(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Ii.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}function Ni(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Wi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Hi(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!q(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Wi(a,o.getPadding());const r=Math.max(0,e.outerWidth-Ni(a,t,"left","right")),l=Math.max(0,e.outerHeight-Ni(a,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function ji(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function $i(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,ji(r.horizontal,e));const{same:a,other:d}=Hi(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&$i(n,e,i,s)||c}function Yi(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Ui(t,e,i,s){const n=i.padding;let{x:o,y:a}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,o=l.size||t.height;ut(l.start)&&(a=l.start),t.fullSize?Yi(t,n.left,a,i.outerWidth-n.right-n.left,o):Yi(t,e.left+l.placed,a,s,o),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*h,a=l.size||t.width;ut(l.start)&&(o=l.start),t.fullSize?Yi(t,o,n.top,a,i.outerHeight-n.bottom-n.top):Yi(t,o,e.top+l.placed,a,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=a}yt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Xi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=di(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=Bi(e.filter((t=>t.box.fullSize)),!0),s=Bi(zi(e,"left"),!0),n=Bi(zi(e,"right")),o=Bi(zi(e,"top"),!0),a=Bi(zi(e,"bottom")),r=Fi(e,"x"),l=Fi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:zi(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;et(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);Wi(u,di(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=Vi(l.concat(h),d);$i(r.fullSize,f,d,g),$i(l,f,d,g),$i(h,f,d,g)&&$i(l,f,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Ui(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Ui(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},et(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class qi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ki extends qi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zi=t=>null===t||""===t;const Ji=!!fe&&{passive:!0};function Qi(t,e,i){t.canvas.removeEventListener(e,i,Ji)}function ts(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function es(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ts(i.addedNodes,s),e=e&&!ts(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function is(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ts(i.removedNodes,s),e=e&&!ts(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const ss=new Map;let ns=0;function os(){const t=window.devicePixelRatio;t!==ns&&(ns=t,ss.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function as(t,i,s){const n=t.canvas,o=n&&se(n);if(!o)return;const a=e(((t,e)=>{const i=o.clientWidth;s(t,e),i<o.clientWidth&&s()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){ss.size||window.addEventListener("resize",os),ss.set(t,e)}(t,a),r}function rs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){ss.delete(t),ss.size||window.removeEventListener("resize",os)}(t)}function ls(t,i,s){const n=t.canvas,o=e((e=>{null!==t.ctx&&s(function(t,e){const i=Gi[t.type]||t.type,{x:s,y:n}=he(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,Ji)}(n,i,o),o}class hs extends qi{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Zi(n)){const e=ge(t,"width");void 0!==e&&(t.width=e)}if(Zi(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ge(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];U(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:es,detach:is,resize:as}[e]||ls;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:rs,detach:rs,resize:rs}[e]||Qi)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return de(t,e,i,s)}isAttached(t){const e=se(t);return!(!e||!e.isConnected)}}function cs(t){return!ie()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ki:hs}var ds=Object.freeze({__proto__:null,_detectPlatform:cs,BasePlatform:qi,BasicPlatform:Ki,DomPlatform:hs});const us="transparent",fs={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=H(t||us),n=s.valid&&H(e||us);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class gs{constructor(t,e,i,s){const n=e[i];s=fi([t.to,s,n,t.from]);const o=fi([t.from,n,s]);this._active=!0,this._fn=t.fn||fs[t.type||typeof o],this._easing=Qe[t.easing]||Qe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=fi([t.to,e,s,t.from]),this._from=fi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}yt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const ps=Object.keys(yt.animation);yt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),yt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),yt.describe("animations",{_fallback:"animation"}),yt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class ms{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!q(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!q(s))return;const n={};for(const t of ps)n[t]=s[t];(X(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,n)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new gs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(a.add(this._chart,i),!0):void 0}}function bs(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function xs(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function _s(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let a,r,l,h;if(null!==e){for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===i){if(s.all)continue;break}h=t.values[l],K(h)&&(o||0===e||Bt(e)===Bt(h))&&(e+=h)}return e}}function ys(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function vs(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function ws(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Ms(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=vs(n,c,o),u[r]=d,u._top=ws(u,a,!0,s.type),u._bottom=ws(u,a,!1,s.type)}}function ks(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Ss(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const Ps=t=>"reset"===t||"none"===t,Ds=(t,e)=>e?t:Object.assign({},t);class Cs{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ys(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ss(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=Z(i.xAxisID,ks(t,"x")),o=e.yAxisID=Z(i.yAxisID,ks(t,"y")),a=e.rAxisID=Z(i.rAxisID,ks(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,o,a),h=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Dt(this._data,this),t._stacked&&Ss(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(q(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s],i[s]={x:o,y:t[o]};return i}(e);else if(i!==e){if(i){Dt(i,this);const t=this._cachedMeta;Ss(t),t._parsed=[]}e&&Object.isExtensible(e)&&Pt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=ys(e.vScale,e),e.stack!==i.stack&&(s=!0,Ss(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&Ms(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=X(s[t])?this.parseArrayData(i,s,t,e):q(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[a]||d&&l[a]<d[a];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(n()&&(c=!1),d=l);i._sorted=c}o&&Ms(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(ct(u,a),d),y:o.parse(ct(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return _s({keys:xs(s,!0),values:e._stacks[t.axis]},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=_s(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),r=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:xs(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function f(){u=s[d];const e=u[a.axis];return!K(u[t.axis])||h>e||c<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,t,u,r),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],K(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return q(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(Z(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=bs(t,i),n=bs(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return pi(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return pi(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,a=n[o],r=this.enableOptionSharing&&ut(i);if(a)return Ds(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(yt.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ds(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new ms(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ps(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){Ps(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ps(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ss(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Cs.defaults={},Cs.prototype.datasetElementType=null,Cs.prototype.dataElementType=null;class Os{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Wt(this.x)&&Wt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}Os.defaults={},Os.defaultRoutes=void 0;const As={values:t=>X(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=Ft(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ni(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Ft(t)));return 1===s||2===s||5===s?As.numeric.call(this,t,e,i):""}};var Ts={formatters:As};function Ls(t,e){const i=t.options.ticks,s=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],o=n.length,a=n[0],r=n[o-1],l=[];if(o>s)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,l,n,o/s),l;const h=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=Nt(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(n,e,s);if(o>0){let t,i;const s=o>1?Math.round((r-a)/(o-1)):null;for(Rs(e,l,h,U(s)?0:a-s,a),t=0,i=o-1;t<i;t++)Rs(e,l,h,n[t],n[t+1]);return Rs(e,l,h,r,U(s)?e.length:r+s),l}return Rs(e,l,h),l}function Rs(t,e,i,s,n){const o=Z(s,0),a=Math.min(Z(n,t.length),t.length);let r,l,h,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<a;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}yt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ts.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),yt.route("scale.ticks","color","","color"),yt.route("scale.grid","color","","borderColor"),yt.route("scale.grid","borderColor","","borderColor"),yt.route("scale.title","color","","color"),yt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),yt.describe("scales",{_fallback:"scale"}),yt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Es=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Is(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function zs(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function Fs(t){return t.drawTicks?t.tickLength:0}function Bs(t,e){if(!t.display)return 0;const i=ui(t.font,e),s=di(t.padding);return(X(t.text)?t.text.length:1)*i.lineHeight+s.height}function Vs(t,e,i){let n=s(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ns extends Os{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=G(t,Number.POSITIVE_INFINITY),e=G(e,Number.NEGATIVE_INFINITY),i=G(i,Number.POSITIVE_INFINITY),s=G(s,Number.NEGATIVE_INFINITY),{min:G(t,i),max:G(e,s),minDefined:K(t),maxDefined:K(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;r<l;++r)e=a[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:G(i,G(s,i)),max:G(s,G(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gi(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Is(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Ls(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){tt(this.options.afterUpdate,[this])}beforeSetDimensions(){tt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=tt(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,n=e.maxRotation;let o,a,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Qt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Fs(t.grid)-e.padding-Bs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Ut(Math.min(Math.asin(Qt((h.highest.height+6)/o,-1,1)),Math.asin(Qt(a/r,-1,1))-Math.asin(Qt(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Bs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Fs(n)+o):(t.height=this.maxHeight,t.width=Fs(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=Yt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)U(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Is(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,n=[],o=[];let a,r,l,h,c,d,u,f,g,p,m,b=0,x=0;for(a=0;a<e;++a){if(h=t[a].label,c=this._resolveTickFontOptions(a),i.font=d=c.string,u=s[d]=s[d]||{data:{},gc:[]},f=c.lineHeight,g=p=0,U(h)||X(h)){if(X(h))for(r=0,l=h.length;r<l;++r)m=h[r],U(m)||X(m)||(g=me(i,u.data,u.gc,g,m),p+=f)}else g=me(i,u.data,u.gc,g,h),p=f;n.push(g),o.push(p),b=Math.max(g,b),x=Math.max(p,x)}!function(t,e){et(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(s,e);const _=n.indexOf(b),y=o.indexOf(x),v=t=>({width:n[t]||0,height:o[t]||0});return{first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:n,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return te(this._alignToPixels?xe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return pi(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=pi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o}=s,a=n.offset,r=this.isHorizontal(),l=this.ticks.length+(a?1:0),h=Fs(n),c=[],d=n.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return xe(i,t,u)};let p,m,b,x,_,y,v,w,M,k,S,P;if("top"===o)p=g(this.bottom),y=this.bottom-h,w=p-f,k=g(t.top)+f,P=t.bottom;else if("bottom"===o)p=g(this.top),k=t.top,P=g(t.bottom)-f,y=p+f,w=this.top+h;else if("left"===o)p=g(this.right),_=this.right-h,v=p-f,M=g(t.left)+f,S=t.right;else if("right"===o)p=g(this.left),M=t.left,S=g(t.right)-f,_=p+f,v=this.left+h;else if("x"===e){if("center"===o)p=g((t.top+t.bottom)/2+.5);else if(q(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}k=t.top,P=t.bottom,y=p+f,w=y+h}else if("y"===e){if("center"===o)p=g((t.left+t.right)/2);else if(q(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,v=_-h,M=t.left,S=t.right}const D=Z(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/D));for(m=0;m<l;m+=C){const t=n.setContext(this.getContext(m)),e=t.lineWidth,s=t.color,o=n.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,u=t.tickBorderDash||[],f=t.tickBorderDashOffset;b=zs(this,m,a),void 0!==b&&(x=xe(i,b,e),r?_=v=M=S=x:y=w=k=P=x,c.push({tx1:_,ty1:y,tx2:v,ty2:w,x1:M,y1:k,x2:S,y2:P,width:e,color:s,borderDash:o,borderDashOffset:l,tickWidth:h,tickColor:d,tickBorderDash:u,tickBorderDashOffset:f}))}return this._ticksLength=l,this._borderValue=p,c}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),a=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=n,d=Fs(i.grid),u=d+h,f=c?-h:u,g=-Yt(this.labelRotation),p=[];let m,b,x,_,y,v,w,M,k,S,P,D,C="middle";if("top"===s)v=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(q(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(q(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===r?C="top":"end"===r&&(C="bottom"));const O=this._getLabelSizes();for(m=0,b=a.length;m<b;++m){x=a[m],_=x.label;const t=n.setContext(this.getContext(m));M=this.getPixelForTick(m)+n.labelOffset,k=this._resolveTickFontOptions(m),S=k.lineHeight,P=X(_)?_.length:1;const e=P/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let d,u=w;if(o?(y=M,"inner"===w&&(u=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),D="top"===s?"near"===l||0!==g?-P*S+S/2:"center"===l?-O.highest.height/2-e*S+S:-O.highest.height+S/2:"near"===l||0!==g?S/2:"center"===l?O.highest.height/2-e*S:O.highest.height-P*S,c&&(D*=-1)):(v=M,D=(1-P)*S/2),t.showLabelBackdrop){const e=di(t.backdropPadding),i=O.heights[m],s=O.widths[m];let n=v+D-e.top,o=y-e.left;switch(C){case"middle":n-=i/2;break;case"bottom":n-=i}switch(w){case"center":o-=s/2;break;case"right":o-=s}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({rotation:g,label:_,font:k,color:i,strokeColor:r,strokeWidth:h,textOffset:D,textAlign:u,textBaseline:C,translation:[y,v],backdrop:d})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),n=i.drawBorder?s.borderWidth:0;if(!n)return;const o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=xe(t,this.left,n)-n/2,l=xe(t,this.right,o)+o/2,h=c=a):(h=xe(t,this.top,n)-n/2,c=xe(t,this.bottom,o)+o/2,r=l=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&we(e,i);const s=this._labelItems||(this._labelItems=this._computeLabelItems(t));let n,o;for(n=0,o=s.length;n<o;++n){const t=s[n],i=t.font,o=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Pe(e,o,0,t.textOffset,i,t)}i&&Me(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=ui(i.font),a=di(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||q(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:h,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,s){const{top:o,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,g,p=0;const m=r-o,b=l-a;if(t.isHorizontal()){if(f=n(s,a,l),q(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)+m-e}else g="center"===i?(c.bottom+c.top)/2+m-e:Es(t,i,e);u=l-a}else{if(q(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-b+e}else f="center"===i?(c.left+c.right)/2-b+e:Es(t,i,e);g=n(s,r,o),p="left"===i?-Et:Et}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,l,e,r);Pe(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Vs(r,e,s),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Z(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Ns.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return ui(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ws{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=at(Object.create(null),[i?yt.get(i):{},yt.get(e),t.defaults]);yt.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");yt.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&yt.describe(e,t.descriptors)}(t,o,i),this.override&&yt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in yt[s]&&(delete yt[s][i],this.override&&delete mt[i])}}var Hs=new class{constructor(){this.controllers=new Ws(Cs,"datasets",!0),this.elements=new Ws(Os,"elements"),this.plugins=new Ws(Object,"plugins"),this.scales=new Ws(Ns,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):et(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=dt(t);tt(i["before"+s],[],i),e[t](i),tt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}};class js{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===tt(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Z(i.options&&i.options.plugins,{}),n=function(t){const e=[],i=Object.keys(Hs.plugins.items);for(let t=0;t<i.length;t++)e.push(Hs.getPlugin(i[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const i=s[t];-1===e.indexOf(i)&&e.push(i)}return e}(i);return!1!==s||e?function(t,e,i,s){const n=[],o=t.getContext();for(let a=0;a<e.length;a++){const r=e[a],l=$s(i[r.id],s);null!==l&&n.push({plugin:r,options:Ys(t.config,r,l,o)})}return n}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function $s(t,e){return e||!1!==t?!0===t?{}:t:null}function Ys(t,e,i,s){const n=t.pluginScopeKeys(e),o=t.getOptionScopes(i,n);return t.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Us(t,e){const i=yt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xs(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qs(t){const e=t.options||(t.options={});e.plugins=Z(e.plugins,{}),e.scales=function(t,e){const i=mt[t.type]||{scales:{}},s=e.scales||{},n=Us(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!q(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=Xs(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(r,n),h=i.scales||{};o[r]=o[r]||t,a[t]=rt(Object.create(null),[{axis:r},e,h[r],h[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,r=i.indexAxis||Us(n,e),l=(mt[n]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||o[e]||e;a[n]=a[n]||Object.create(null),rt(a[n],[{axis:e},s[n],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];rt(e,[yt.scales[e.type],yt.scale])})),a}(t,e)}function Ks(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Gs=new Map,Zs=new Set;function Js(t,e){let i=Gs.get(t);return i||(i=e(),Gs.set(t,i),Zs.add(i)),i}const Qs=(t,e,i)=>{const s=ct(e,i);void 0!==s&&t.add(s)};class tn{constructor(t){this._config=function(t){return(t=t||{}).data=Ks(t.data),qs(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ks(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qs(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Js(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Js(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Js(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Js(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Qs(r,t,e)))),e.forEach((t=>Qs(r,s,t))),e.forEach((t=>Qs(r,mt[n]||{},t))),e.forEach((t=>Qs(r,yt,t))),e.forEach((t=>Qs(r,bt,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Zs.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,mt[e]||{},yt.datasets[e]||{},{type:e},yt,bt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=en(this._resolverCache,t,s);let r=o;if(function(t,e){const{isScriptable:i,isIndexable:s}=Te(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(ft(a)||sn(a))||o&&X(a))return!0}return!1}(o,e)){n.$shared=!1;r=Ae(o,i=ft(i)?i():i,this.createResolver(t,i,a))}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=en(this._resolverCache,t,i);return q(e)?Ae(n,e,void 0,s):n}}function en(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:Oe(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const sn=t=>q(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||ft(t[i])),!1);const nn=["top","bottom","left","right","chartArea"];function on(t,e){return"top"===t||"bottom"===t||-1===nn.indexOf(t)&&"x"===e}function an(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function rn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),tt(i&&i.onComplete,[t],e)}function ln(t){const e=t.chart,i=e.options.animation;tt(i&&i.onProgress,[t],e)}function hn(t){return ie()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cn={},dn=t=>{const e=hn(t);return Object.values(cn).filter((t=>t.canvas===e)).pop()};function un(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class fn{constructor(t,e){const s=this.config=new tn(e),n=hn(t),o=dn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||cs(n)),this.platform.updateConfig(s);const l=this.platform.acquireContext(n,r.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;this.id=Y(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new js,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=i((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],cn[this.id]=this,l&&h?(a.listen(this,"complete",rn),a.listen(this,"progress",ln),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return U(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ue(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return _e(this.canvas,this.ctx),this}stop(){return a.stop(this),this}resize(t,e){a.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ue(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),tt(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){et(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Xs(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),et(n,(e=>{const n=e.options,o=n.id,a=Xs(o,n),r=Z(n.type,e.dtype);void 0!==n.position&&on(n.position,a)===on(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;if(o in i&&i[o].type===r)l=i[o];else{l=new(Hs.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(n,t)})),et(s,((t,e)=>{t||delete i[e]})),et(i,(t=>{Xi.configure(this,t,t.options),Xi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(an("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||Us(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=Hs.getController(o),{datasetElementType:s,dataElementType:a}=yt.datasets[o];Object.assign(e.prototype,{dataElementType:Hs.getElement(a),datasetElementType:s&&Hs.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){et(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||et(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(an("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){et(this.scales,(t=>{Xi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);gt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){un(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!gt(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Xi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],et(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ft(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(a.has(this)?this.attached&&!a.running(this)&&a.start(this):(this.draw(),rn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&we(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Me(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Ei.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);ut(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),a.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),_e(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete cn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};et(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){et(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},et(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!it(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=pt(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,tt(n.onHover,[t,a,this],this),r&&tt(n.onClick,[t,a,this],this));const h=!it(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}const gn=()=>et(fn.instances,(t=>t._plugins.invalidate())),pn=!0;function mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(fn,{defaults:{enumerable:pn,value:yt},instances:{enumerable:pn,value:cn},overrides:{enumerable:pn,value:mt},registry:{enumerable:pn,value:Hs},version:{enumerable:pn,value:"3.8.0"},getChart:{enumerable:pn,value:dn},register:{enumerable:pn,value:(...t)=>{Hs.add(...t),gn()}},unregister:{enumerable:pn,value:(...t)=>{Hs.remove(...t),gn()}}});class bn{constructor(t){this.options=t||{}}formats(){return mn()}parse(t,e){return mn()}format(t,e){return mn()}add(t,e,i){return mn()}diff(t,e,i){return mn()}startOf(t,e,i){return mn()}endOf(t,e){return mn()}}bn.override=function(t){Object.assign(bn.prototype,t)};var xn={_date:bn};function _n(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Ct(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(ut(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return r}function yn(t,e,i,s){return X(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,h=r;Math.abs(a)>Math.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function vn(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(a[h],h),l.push(yn(u,d,o,h));return l}function wn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Mn(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);const{start:a,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[kn(c,a,r,l)]=!0,n=h)),o[kn(n,a,r,l)]=!0,t.borderSkipped=o}function kn(t,e,i,s){var n,o,a;return s?(a=i,t=Sn(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=Sn(t,e,i),t}function Sn(t,e,i){return"start"===t?e:"end"===t?i:t}function Pn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Dn extends Cs{parsePrimitiveData(t,e,i,s){return vn(t,e,i,s)}parseArrayData(t,e,i,s){return vn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,f,g;for(d=i,u=i+s;d<u;++d)g=e[d],f={},f[n.axis]=n.parse(ct(g,l),d),c.push(yn(ct(g,h),f,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=wn(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const n="reset"===s,{index:o,_cachedMeta:{vScale:a}}=this,r=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let c=e;c<e+i;c++){const e=this.getParsed(c),i=n||U(e[a.axis])?{base:r,head:r}:this._calculateBarValuePixels(c),f=this._calculateBarIndexPixels(c,h),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||wn(e._custom)||o===g._top||o===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};u&&(p.options=d||this.resolveDataElementOptions(c,t[c].active?"active":s));const m=p.options||t[c].options;Mn(p,m,g,o),Pn(p,m,h.ratio),this.updateElement(t[c],c,p,s)}}_getStacks(t,e){const i=this._cachedMeta.iScale,s=i.getMatchingVisibleMetas(this._type),n=i.options.stacked,o=s.length,a=[];let r,l;for(r=0;r<o;++r)if(l=s[r],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(U(t)||isNaN(t))continue}if((!1===n||-1===a.indexOf(l.stack)||void 0===n&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||_n(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:n}}=this,o=s||0,a=this.getParsed(t),r=a._custom,l=wn(r);let h,c,d=a[e.axis],u=0,f=i?this.applyStack(e,a,i):d;f!==d&&(u=f-d,f=d),l&&(d=r.barStart,f=r.barEnd-r.barStart,0!==d&&Bt(d)!==Bt(r.barEnd)&&(u=0),u+=d);const g=U(s)||l?u:s;let p=e.getPixelForValue(g);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(u+f):p,c=h-p,Math.abs(c)<n){c=function(t,e,i){return 0!==t?Bt(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(c,e,o)*n,d===o&&(p-=c/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),s=Math.min(t,i),a=Math.max(t,i);p=Math.max(Math.min(p,a),s),h=p+c}if(p===e.getPixelForValue(o)){const t=Bt(c)*e.getLineWidthForValue(o)/2;p+=t,c-=t}return{size:c,base:p,head:h,center:h+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=Z(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const h=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,s,i):function(t,e,i,s){const n=i.barThickness;let o,a;return U(n)?(o=e.min*i.categoryPercentage,a=i.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:e.pixels[t]-o/2}}(t,e,s,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);a=l.start+l.chunk*h+l.chunk/2,r=Math.min(o,l.chunk*l.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(o,e.min*e.ratio);return{base:a-r/2,head:a+r/2,center:a,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[e.axis]&&i[n].draw(this._ctx)}}Dn.id="bar",Dn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Dn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Cn extends Cs{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=Z(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=Z(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=o.axis,d=a.axis;for(let r=e;r<e+i;r++){const e=t[r],i=!n&&this.getParsed(r),l={},u=l[c]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),f=l[d]=n?a.getBasePixel():a.getPixelForValue(i[d]);l.skip=isNaN(u)||isNaN(f),h&&(l.options=this.resolveDataElementOptions(r,e.active?"active":s),n&&(l.options.radius=0)),this.updateElement(e,r,l,s)}this.updateSharedOptions(l,s,r)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=Z(i&&i._custom,n),s}}Cn.id="bubble",Cn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Cn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class On extends Cs{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(q(i[t])){const{key:t="value"}=this._parsing;a=e=>+ct(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=a(n)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=At,e=-At;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min(J(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:f,offsetY:g}=function(t,e,i){let s=1,n=1,o=0,a=0;if(e<At){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>Jt(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Jt(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(Et,c,u),b=g(Ot,h,d),x=g(Ot+Et,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(c,h,r),p=(i.width-o)/d,m=(i.height-o)/u,b=Math.max(Math.min(p,m)/2,0),x=Q(this.options.radius,b),_=(x-Math.max(x*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*x,this.offsetY=g*x,s.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/At)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,f=this.resolveDataElementOptions(e,s),g=this.getSharedOptions(f),p=this.includeOptions(s,g);let m,b=this._getRotation();for(m=0;m<e;++m)b+=this._circumference(m,n);for(m=e;m<e+i;++m){const e=this._circumference(m,n),i=t[m],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=g||this.resolveDataElementOptions(m,i.active?"active":s)),b+=e,this.updateElement(i,m,o,s)}this.updateSharedOptions(g,s,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?At*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ni(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}On.id="doughnut",On.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},On.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},On.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return X(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class An extends Cs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=Qt(Math.min(wt(r,a.axis,h).lo,i?s:wt(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?Qt(Math.max(wt(r,a.axis,c).hi+1,i?0:wt(e,l,a.getPixelForValue(c)).hi+1),n,s)-n:s-n}return{start:n,count:o}}(e,s,o);this._drawStart=a,this._drawCount=r,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=o.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Wt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===s;let x=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),g=b?e:{},_=U(i[f]),y=g[u]=o.getPixelForValue(i[u],h),v=g[f]=n||_?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,i,r):i[f],h);g.skip=isNaN(y)||isNaN(v)||_,g.stop=h>0&&Math.abs(i[u]-x[u])>m,p&&(g.parsed=i,g.raw=l.data[h]),d&&(g.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),b||this.updateElement(e,h,g,s),x=i}this.updateSharedOptions(c,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}An.id="line",An.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},An.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Tn extends Cs{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ni(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*Ot;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,g=u+this._computeAngle(d,s,f),p=o.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=g,n&&(a.animateScale&&(p=0),a.animateRotate&&(i=g=c));const m={x:l,y:h,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}Tn.id="polarArea",Tn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Tn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ln extends On{}Ln.id="pie",Ln.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Rn extends Cs{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),l=o?n.xCenter:r.x,h=o?n.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,c,s)}}}Rn.id="radar",Rn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Rn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class En extends An{}En.id="scatter",En.defaults={showLine:!1,fill:!1},En.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var In=Object.freeze({__proto__:null,BarController:Dn,BubbleController:Cn,DoughnutController:On,LineController:An,PolarAreaController:Tn,PieController:Ln,RadarController:Rn,ScatterController:En});function zn(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(o,a,r,s-h,i+h),l>n?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+Et,s-Et),t.closePath(),t.clip()}function Fn(t,e,i,s){const n=li(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return Qt(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Qt(n.innerStart,0,a),innerEnd:Qt(n.innerEnd,0,a)}}function Bn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Vn(t,e,i,s,n){const{x:o,y:a,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const f=n-r;if(s){const t=((h>0?h-s:0)+(c>0?c-s:0))/2;u=(f-(0!==t?f*t/(t+s):f))/2}const g=(f-Math.max(.001,f*c-i/Ot)/c)/2,p=r+g+u,m=n-g-u,{outerStart:b,outerEnd:x,innerStart:_,innerEnd:y}=Fn(e,d,c,m-p),v=c-b,w=c-x,M=p+b/v,k=m-x/w,S=d+_,P=d+y,D=p+_/S,C=m-y/P;if(t.beginPath(),t.arc(o,a,c,M,k),x>0){const e=Bn(w,k,o,a);t.arc(e.x,e.y,x,k,m+Et)}const O=Bn(P,m,o,a);if(t.lineTo(O.x,O.y),y>0){const e=Bn(P,C,o,a);t.arc(e.x,e.y,y,m+Et,C+Math.PI)}if(t.arc(o,a,d,m-y/d,p+_/d,!0),_>0){const e=Bn(S,D,o,a);t.arc(e.x,e.y,_,D+Math.PI,p-Et)}const A=Bn(v,p,o,a);if(t.lineTo(A.x,A.y),b>0){const e=Bn(v,M,o,a);t.arc(e.x,e.y,b,p-Et,M)}t.closePath()}function Nn(t,e,i,s,n){const{options:o}=e,{borderWidth:a,borderJoinStyle:r}=o,l="inner"===o.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=r||"round"):(t.lineWidth=a,t.lineJoin=r||"bevel"),e.fullCircles&&function(t,e,i){const{x:s,y:n,startAngle:o,pixelMargin:a,fullCircles:r}=e,l=Math.max(e.outerRadius-a,0),h=e.innerRadius+a;let c;for(i&&zn(t,e,o+At),t.beginPath(),t.arc(s,n,h,o+At,o,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,n,l,o,o+At),c=0;c<r;++c)t.stroke()}(t,e,l),l&&zn(t,e,n),Vn(t,e,i,s,n),t.stroke())}class Wn extends Os{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=qt(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=Z(c,r-a)>=At||Jt(n,a,r),f=ee(o,l+d,h+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>At?Math.floor(i/At):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(s){o=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=Ot&&(o=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,i,s){const{fullCircles:n,startAngle:o,circumference:a}=e;let r=e.endAngle;if(n){Vn(t,e,i,s,o+At);for(let e=0;e<n;++e)t.fill();isNaN(a)||(r=o+a%At,a%At==0&&(r+=At))}return Vn(t,e,i,s,r),t.fill(),r}(t,this,o,n);Nn(t,this,o,n,a),t.restore()}}function Hn(t,e,i=e){t.lineCap=Z(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Z(i.borderDash,e.borderDash)),t.lineDashOffset=Z(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Z(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Z(i.borderWidth,e.borderWidth),t.strokeStyle=Z(i.borderColor,e.borderColor)}function jn(t,e,i){t.lineTo(i.x,i.y)}function $n(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Yn(t,e,i,s){const{points:n,options:o}=e,{count:a,start:r,loop:l,ilen:h}=$n(n,i,s),c=function(t){return t.stepped?ke:t.tension||"monotone"===t.cubicInterpolationMode?Se:jn}(o);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=h;++d)u=n[(r+(p?h-d:d))%a],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,o.stepped),f=u);return l&&(u=n[(r+(p?h:0))%a],c(t,f,u,p,o.stepped)),!!l}function Un(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=$n(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,g,p,m=0,b=0;const x=t=>(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=g=i),p=i}_()}function Xn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Un:Yn}Wn.id="arc",Wn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Wn.defaultRoutes={backgroundColor:"backgroundColor"};const qn="function"==typeof Path2D;function Kn(t,e,i,s){qn&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Hn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Xn(e);for(const r of n)Hn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class Gn extends Os{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ke(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Mi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=wi(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?ei:t.tension||"monotone"===t.cubicInterpolationMode?ii:ti}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){a.push(d);continue}const f=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return Xn(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Xn(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),Kn(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Zn(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}Gn.id="line",Gn.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Gn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Gn.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Jn extends Os{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Zn(this,t,"x",e)}inYRange(t,e){return Zn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ve(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ye(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Qn(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function to(t,e,i,s){return t?0:Qt(e,i,s)}function eo(t){const e=Qn(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=hi(s);return{t:to(n.top,o.top,0,i),r:to(n.right,o.right,0,e),b:to(n.bottom,o.bottom,0,i),l:to(n.left,o.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=ci(n),a=Math.min(e,i),r=t.borderSkipped,l=s||q(n);return{topLeft:to(!l||r.top||r.left,o.topLeft,0,a),topRight:to(!l||r.top||r.right,o.topRight,0,a),bottomLeft:to(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:to(!l||r.bottom||r.right,o.bottomRight,0,a)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function io(t,e,i,s){const n=null===e,o=null===i,a=t&&!(n&&o)&&Qn(t,s);return a&&(n||ee(e,a.left,a.right))&&(o||ee(i,a.top,a.bottom))}function so(t,e){t.rect(e.x,e.y,e.w,e.h)}function no(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}Jn.id="point",Jn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Jn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class oo extends Os{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=eo(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Ce:so;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,no(o,e,n)),t.clip(),a(t,no(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,no(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return io(this,t,e,i)}inXRange(t,e){return io(this,t,null,e)}inYRange(t,e){return io(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}oo.id="bar",oo.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},oo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var ao=Object.freeze({__proto__:null,ArcElement:Wn,LineElement:Gn,PointElement:Jn,BarElement:oo});function ro(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function lo(t){t.data.datasets.forEach((t=>{ro(t)}))}var ho={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void lo(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:o,indexAxis:a}=e,r=t.getDatasetMeta(n),l=o||e.data;if("y"===fi([a,t.options.indexAxis]))return;if(!r.controller.supportsDecimation)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=Qt(wt(e,o.axis,a).lo,0,i-1)),s=h?Qt(wt(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(r,l);if(d<=(i.threshold||4*s))return void ro(e);let u;switch(U(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;c<o-2;c++){let s,n=0,o=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,o+=t[s].y;n/=b,o/=b;const x=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[p];for(u=f=-1,s=x;s<_;s++)f=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),f>u&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(l,c,d,s,i);break;case"min-max":u=function(t,e,i,s){let n,o,a,r,l,h,c,d,u,f,g=0,p=0;const m=[],b=e+i-1,x=t[e].x,_=t[b].x-x;for(n=e;n<e+i;++n){o=t[n],a=(o.x-x)/_*s,r=o.y;const e=0|a;if(e===l)r<u?(u=r,h=n):r>f&&(f=r,c=n),g=(p*g+o.x)/++p;else{const i=n-1;if(!U(h)&&!U(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:g}),s!==d&&s!==i&&m.push({...t[s],x:g})}n>0&&i!==d&&m.push(t[i]),m.push(o),l=e,p=0,u=f=r,h=c=d=n}}return m}(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u}))},destroy(t){lo(t)}};function co(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=Zt(n),o=Zt(o)),{property:t,start:n,end:o}}function uo(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function fo(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function go(t,e){let i=[],s=!1;return X(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=uo(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new Gn({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function po(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!K(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function mo(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=Z(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(q(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return K(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function bo(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=xo(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function xo(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,a=t.points;let r=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=a[e.start][i],h=a[e.end][i];if(ee(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class _o{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:At},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function yo(t){const{chart:e,fill:i,line:s}=t;if(K(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(go({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)bo(n,a[t],r)}return new Gn({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){if((t.scale||{}).getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,a=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:q(t)?t.value:e.getBaseValue(),s}(i,e,o),r=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new _o({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<n;++t)r.push(e.getPointPositionForValue(t,a));return r}(t);return function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:q(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(K(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof _o?n:go(n,s)}function vo(t,e,i){const s=yo(e),{line:n,scale:o,axis:a}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(we(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==n&&(wo(t,s,a.top),Mo(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),wo(t,s,a.bottom));Mo(t,{line:i,target:s,color:o,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:o,axis:a}),Me(t))}function wo(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[uo(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Mo(t,e){const{line:i,target:s,property:n,color:o,scale:a}=e,r=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=uo(s,r,n);const l=co(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=wi(e,l);for(const e of h){const s=co(i,o[e.start],o[e.end],e.loop),r=vi(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:fo(l,s,"start",Math.max)},end:{[i]:fo(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=o}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,ko(t,a,d&&co(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():So(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||So(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function ko(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function So(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var Po={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Gn&&(l={visible:t.isDatasetVisible(a),index:a,fill:mo(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=po(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&vo(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&vo(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&vo(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Do=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Co extends Os{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=ui(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=Do(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,n,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const p=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:s},d=Math.max(d,p),u+=s+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=mi(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=n(i,this.left+s,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=n(i,this.left+s,this.right-this.lineWidths[o])),l.top+=this.top+t+s,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+s}else{let o=0,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+s,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;we(t,this),this._draw(),Me(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:a,labels:r}=t,l=yt.color,h=mi(t.rtl,this.left,this.width),c=ui(r.font),{color:d,padding:u}=r,f=c.size,g=f/2;let p;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:x}=Do(r,f),_=this.isHorizontal(),y=this._computeTitleHeight();p=_?{x:n(a,this.left+u,this.right-i[0]),y:this.top+u+y,line:0}:{x:this.left+u,y:n(a,this.top+y+u,this.bottom-e[0].height),line:0},bi(this.ctx,t.textDirection);const v=x+u;this.legendItems.forEach(((w,M)=>{s.strokeStyle=w.fontColor||d,s.fillStyle=w.fontColor||d;const k=s.measureText(w.text).width,S=h.textAlign(w.textAlign||(w.textAlign=r.textAlign)),P=m+g+k;let D=p.x,C=p.y;h.setWidth(this.width),_?M>0&&D+P+u>this.right&&(C=p.y+=v,p.line++,D=p.x=n(a,this.left+u,this.right-i[p.line])):M>0&&C+v>this.bottom&&(D=p.x=D+e[p.line].width+u,p.line++,C=p.y=n(a,this.top+y+u,this.bottom-e[p.line].height));!function(t,e,i){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;s.save();const n=Z(i.lineWidth,1);if(s.fillStyle=Z(i.fillStyle,l),s.lineCap=Z(i.lineCap,"butt"),s.lineDashOffset=Z(i.lineDashOffset,0),s.lineJoin=Z(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=Z(i.strokeStyle,l),s.setLineDash(Z(i.lineDash,[])),r.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},a=h.xPlus(t,m/2);ye(s,o,a,e+g)}else{const o=e+Math.max((f-b)/2,0),a=h.leftForLtr(t,m),r=ci(i.borderRadius);s.beginPath(),Object.values(r).some((t=>0!==t))?Ce(s,{x:a,y:o,w:m,h:b,radius:r}):s.rect(a,o,m,b),s.fill(),0!==n&&s.stroke()}s.restore()}(h.x(D),C,w),D=o(S,D+m+g,_?D+P:this.right,t.rtl),function(t,e,i){Pe(s,i.text,t,e+x/2,c,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(D),C,w),_?p.x+=P+u:p.y+=v})),xi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ui(e.font),o=di(e.padding);if(!e.display)return;const a=mi(t.rtl,this.left,this.width),r=this.ctx,l=e.position,h=i.size/2,c=o.top+h;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=n(t.align,u,this.right-f);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);d=c+n(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=n(l,u,u+f);r.textAlign=a.textAlign(s(l)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Pe(r,e.text,g,d,i)}_computeTitleHeight(){const t=this.options.title,e=ui(t.font),i=di(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(ee(t,this.left,this.right)&&ee(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],ee(t,s.left,s.left+s.width)&&ee(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&tt(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&tt(e.onHover,[t,i,this],this)}else i&&tt(e.onClick,[t,i,this],this);var s,n}}var Oo={id:"legend",_element:Co,start(t,e,i){const s=t.legend=new Co({ctx:t.ctx,options:i,chart:t});Xi.configure(t,s,i),Xi.addBox(t,s)},stop(t){Xi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;Xi.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),r=di(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ao extends Os{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=X(i.text)?i.text.length:1;this._padding=di(i.padding);const n=s*ui(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l,h,c,d=0;return this.isHorizontal()?(h=n(r,i,o),c=e+t,l=o-i):("left"===a.position?(h=i+t,c=n(r,s,e),d=-.5*Ot):(h=o-t,c=n(r,e,s),d=.5*Ot),l=s-e),{titleX:h,titleY:c,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ui(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);Pe(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:l,textAlign:s(e.align),textBaseline:"middle",translation:[o,a]})}}var To={id:"title",_element:Ao,start(t,e,i){!function(t,e){const i=new Ao({ctx:t.ctx,options:e,chart:t});Xi.configure(t,i,e),Xi.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Xi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;Xi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Lo=new WeakMap;var Ro={id:"subtitle",start(t,e,i){const s=new Ao({ctx:t.ctx,options:i,chart:t});Xi.configure(t,s,i),Xi.addBox(t,s),Lo.set(t,s)},stop(t){Xi.removeBox(t,Lo.get(t)),Lo.delete(t)},beforeUpdate(t,e,i){const s=Lo.get(t);Xi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,n+=t.y,++o}}return{x:s/o,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=Kt(e,s.getCenterPoint());t<r&&(r=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Io(t,e){return e&&(X(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function zo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Fo(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Bo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=ui(e.bodyFont),h=ui(e.titleFont),c=ui(e.footerFont),d=o.length,u=n.length,f=s.length,g=di(e.padding);let p=g.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const _=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=h.string,et(t.title,_),i.font=l.string,et(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?a+2+e.boxPadding:0,et(s,(t=>{et(t.before,_),et(t.lines,_),et(t.after,_)})),x=0,i.font=c.string,et(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Vo(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function No(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Vo(t,e,i,s),yAlign:s}}function Wo(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ci(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:Qt(g,0,s.width-e.width),y:Qt(p,0,s.height-e.height)}}function Ho(t,e,i){const s=di(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function jo(t){return Io([],zo(t))}function $o(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Yo extends Os{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new ms(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,pi(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=Io(a,zo(s)),a=Io(a,zo(n)),a=Io(a,zo(o)),a}getBeforeBody(t,e){return jo(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return et(t,(t=>{const e={before:[],lines:[],after:[]},n=$o(i,t);Io(e.before,zo(n.beforeLabel.call(this,t))),Io(e.lines,n.label.call(this,t)),Io(e.after,zo(n.afterLabel.call(this,t))),s.push(e)})),s}getAfterBody(t,e){return jo(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=Io(a,zo(s)),a=Io(a,zo(n)),a=Io(a,zo(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;a<r;++a)l.push(Fo(this.chart,e[a]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),et(l,(e=>{const i=$o(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Eo[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Bo(this,i),a=Object.assign({},t,e),r=No(this.chart,i,a),l=Wo(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=ci(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=mi(i.rtl,this.x,this.width);for(t.x=Ho(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=ui(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,r+1===n&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:r,boxWidth:l,boxPadding:h}=n,c=ui(n.bodyFont),d=Ho(this,"left",n),u=s.x(d),f=r<c.lineHeight?(c.lineHeight-r)/2:0,g=e.y+f;if(n.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=g+r/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ye(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,ye(t,e,i,h)}else{t.lineWidth=o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(u,l-h),i=s.leftForLtr(s.xPlus(u,1),l-h-2),a=ci(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ce(t,{x:e,y:g,w:l,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ce(t,{x:i,y:g+1,w:l-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,l,r),t.strokeRect(e,g,l,r),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=ui(i.bodyFont);let d=c.lineHeight,u=0;const f=mi(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,b,x,_,y,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ho(this,p,i),e.fillStyle=i.bodyColor,et(this.beforeBody,g),u=a&&"right"!==p?"center"===o?l/2+h:l+2+h:0,_=0,v=s.length;_<v;++_){for(m=s[_],b=this.labelTextColors[_],e.fillStyle=b,et(m.before,g),x=m.lines,a&&x.length&&(this._drawColorBox(e,t,_,f,i),d=Math.max(c.lineHeight,r)),y=0,w=x.length;y<w;++y)g(x[y]),d=c.lineHeight;et(m.after,g)}u=0,d=c.lineHeight,et(this.afterBody,g),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,a;if(n){const r=mi(i.rtl,this.x,this.width);for(t.x=Ho(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",o=ui(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],r.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ci(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+c,r),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,r),e.quadraticCurveTo(a+l,r,a+l,r+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(a+l,r+h-f),e.quadraticCurveTo(a+l,r+h,a+l-f,r+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+u,r+h),e.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(a,r+c),e.quadraticCurveTo(a,r,a+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Eo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Bo(this,t),a=Object.assign({},i,this._size),r=No(e,t,a),l=Wo(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=di(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),bi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),xi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!it(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!it(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Eo[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}Yo.positioners=Eo;var Uo={id:"tooltip",_element:Yo,positioners:Eo,afterInit(t,e,i){i&&(t.tooltip=new Yo({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:$,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:$,beforeBody:$,beforeLabel:$,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return U(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:$,afterBody:$,beforeFooter:$,footer:$,afterFooter:$}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Xo=Object.freeze({__proto__:null,Decimation:ho,Filler:Po,Legend:Oo,SubTitle:Ro,Title:To,Tooltip:Uo});function qo(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}class Ko extends Ns{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(U(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Qt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:qo(i,t,Z(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Go(t,e,{horizontal:i,minRotation:s}){const n=Yt(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}Ko.id="category",Ko.defaults={ticks:{callback:Ko.prototype.getLabelForValue}};class Zo extends Ns{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return U(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=Bt(s),e=Bt(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,f=h-1,{min:g,max:p}=e,m=!U(o),b=!U(a),x=!U(l),_=(p-g)/(c+1);let y,v,w,M,k=Vt((p-g)/f/u)*u;if(k<1e-14&&!m&&!b)return[{value:g},{value:p}];M=Math.ceil(p/k)-Math.floor(g/k),M>f&&(k=Vt(M*k/f/u)*u),U(r)||(y=Math.pow(10,r),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(g/k)*k,w=Math.ceil(p/k)*k):(v=g,w=p),m&&b&&n&&jt((a-o)/n,k/1e3)?(M=Math.round(Math.min((a-o)/k,h)),k=(a-o)/M,v=o,w=a):x?(v=m?o:v,w=b?a:w,M=l-1,k=(w-v)/M):(M=(w-v)/k,M=Ht(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Xt(k),Xt(v));y=Math.pow(10,U(r)?S:r),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let P=0;for(m&&(d&&v!==o?(i.push({value:o}),v<o&&P++,Ht(Math.round((v+P*k)*y)/y,o,Go(o,_,t))&&P++):v<o&&P++);P<M;++P)i.push({value:Math.round((v+P*k)*y)/y});return b&&d&&w!==a?i.length&&Ht(i[i.length-1].value,a,Go(a,_,t))?i[i.length-1].value=a:i.push({value:a}):b&&w!==a||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&$t(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ni(t,this.chart.options.locale,this.options.ticks.format)}}class Jo extends Zo{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Qo(t){return 1===t/Math.pow(10,Math.floor(Ft(t)))}Jo.id="linear",Jo.defaults={ticks:{callback:Ts.formatters.numeric}};class ta extends Ns{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Zo.prototype.parse.apply(this,[t,e]);if(0!==i)return K(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Ft(t))+e);i===s&&(i<=0?(n(1),o(10)):(n(a(i,-1)),o(a(s,1)))),i<=0&&n(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&n(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Ft(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=G(t.min,Math.pow(10,Math.floor(Ft(e.min)))),a=Math.floor(Ft(o)),r=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{n.push({value:o,major:Qo(o)}),++r,10===r&&(r=1,++a,l=a>=0?1:l),o=Math.round(r*Math.pow(10,a)*l)/l}while(a<i||a===i&&r<s);const h=G(t.max,o);return n.push({value:h,major:Qo(o)}),n}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&$t(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ni(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ft(t),this._valueRange=Ft(this.max)-Ft(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ft(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ea(t){const e=t.ticks;if(e.display&&t.display){const t=di(e.backdropPadding);return Z(e.font&&e.font.size,yt.font.size)+t.height}return 0}function ia(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function sa(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,r=a.centerPointLabels?Ot/o:0;for(let d=0;d<o;d++){const o=a.setContext(t.getPointLabelContext(d));n[d]=o.padding;const u=t.getPointPosition(d,t.drawingArea+n[d],r),f=ui(o.font),g=(l=t.ctx,h=f,c=X(c=t._pointLabels[d])?c:[c],{w:be(l,h.string,c),h:c.length*h.lineHeight});s[d]=g;const p=Zt(t.getIndexAngle(d)+r),m=Math.round(Ut(p));na(i,e,p,ia(m,u.x,g.w,0,180),ia(m,u.y,g.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,a=ea(o)/2,r=t.drawingArea,l=o.pointLabels.centerPointLabels?Ot/n:0;for(let o=0;o<n;o++){const n=t.getPointPosition(o,r+a+i[o],l),h=Math.round(Ut(Zt(n.angle+Et))),c=e[o],d=ra(n.y,c.h,h),u=oa(h),f=aa(n.x,c.w,u);s.push({x:n.x,y:d,textAlign:u,left:f,top:d,right:f+c.w,bottom:d+c.h})}return s}(t,s,n)}function na(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function oa(t){return 0===t||180===t?"center":t<180?"left":"right"}function aa(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function ra(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function la(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,At);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}ta.id="logarithmic",ta.defaults={ticks:{callback:Ts.formatters.logarithmic,major:{enabled:!0}}};class ha extends Zo{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=di(ea(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=K(t)&&!isNaN(t)?t:0,this.max=K(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ea(this.options))}generateTickLabels(t){Zo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=tt(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?sa(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return Zt(t*(At/(this._pointLabels.length||1))+Yt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(U(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(U(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return pi(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),la(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,n=this._pointLabels.length;let o,a,r;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=s.setContext(t.getPointLabelContext(n)),o=ui(e.font),{x:a,y:r,textAlign:l,left:h,top:c,right:d,bottom:u}=t._pointLabelItems[n],{backdropColor:f}=e;if(!U(f)){const t=ci(e.borderRadius),s=di(e.backdropPadding);i.fillStyle=f;const n=h-s.left,o=c-s.top,a=d-h+s.width,r=u-c+s.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),Ce(i,{x:n,y:o,w:a,h:r,radius:t}),i.fill()):i.fillRect(n,o,a,r)}Pe(i,t._pointLabels[n],a,r+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,n),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),la(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,s.setContext(this.getContext(e-1)),a,n)}})),i.display){for(t.save(),o=n-1;o>=0;o--){const s=i.setContext(this.getPointLabelContext(o)),{color:n,lineWidth:l}=s;l&&n&&(t.lineWidth=l,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=ui(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=di(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Pe(t,s.label,0,-n,l,{color:r.color})})),t.restore()}drawTitle(){}}ha.id="radialLinear",ha.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ts.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ha.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ha.descriptors={angleLines:{_fallback:"grid"}};const ca={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},da=Object.keys(ca);function ua(t,e){return t-e}function fa(t,e){if(U(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof s&&(a=s(a)),K(a)||(a="string"==typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!Wt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function ga(t,e,i,s){const n=da.length;for(let o=da.indexOf(t);o<n-1;++o){const t=ca[da[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return da[o]}return da[n-1]}function pa(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=vt(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function ma(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class ba extends Ns{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new xn._date(t.adapters.date);rt(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function r(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=K(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=K(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=kt(s,n,this.max);return this._unit=e.unit||(i.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=da.length-1;o>=da.indexOf(i);o--){const i=da[o];if(ca[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return da[i?da.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=da.indexOf(t)+1,i=da.length;e<i;++e)if(ca[da[e]].common)return da[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),ma(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=Qt(s,0,o),n=Qt(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||ga(n.minUnit,e,i,this._getLabelCapacity(e)),a=Z(n.stepSize,1),r="week"===o&&n.isoWeekday,l=Wt(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,a,o),d++)pa(h,c,f);return c!==i&&"ticks"!==s.bounds&&1!==d||pa(h,c,f),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.time.displayFormats,a=this._unit,r=this._majorUnit,l=a&&o[a],h=r&&o[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),f=n.ticks.callback;return f?tt(f,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*n+a*o,h:i*o+a*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,ma(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(fa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ct(t.sort(ua))}}function xa(t,e,i){let s,n,o,a,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=wt(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=wt(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}ba.id="time",ba.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class _a extends ba{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=xa(e,this.min),this._tableRange=xa(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],r=s[o-1],l=s[o],Math.round((h+r)/2)!==l&&n.push({time:l,pos:o/(a-1)});return n}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(xa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return xa(this._table,i*this._tableRange+this._minPos,!0)}}_a.id="timeseries",_a.defaults=ba.defaults;var ya=Object.freeze({__proto__:null,CategoryScale:Ko,LinearScale:Jo,LogarithmicScale:ta,RadialLinearScale:ha,TimeScale:ba,TimeSeriesScale:_a});return fn.register(In,ya,ao,Xo),fn.helpers={...Di},fn._adapters=xn,fn.Animation=gs,fn.Animations=ms,fn.animator=a,fn.controllers=Hs.controllers.items,fn.DatasetController=Cs,fn.Element=Os,fn.elements=ao,fn.Interaction=Ei,fn.layouts=Xi,fn.platforms=ds,fn.Scale=Ns,fn.Ticks=Ts,Object.assign(fn,In,ya,ao,Xo,ds),fn.Chart=fn,"undefined"!=typeof window&&(window.Chart=fn),fn}));
diff --git a/admin/survey/script/DragDrop/dragdropInAdmin.js b/admin/survey/script/DragDrop/dragdropInAdmin.js
index 65d1799..f95ebe8 100644
--- a/admin/survey/script/DragDrop/dragdropInAdmin.js
+++ b/admin/survey/script/DragDrop/dragdropInAdmin.js
@@ -120,8 +120,8 @@ function Draggable(tip, spremenljivka, vre_id, ajax, anketa, site_url, usr_id, o
var top_cat = -1;
var left_cat = -1;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
}
$('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).addClass('drag_and_drop').detach().appendTo('#half_frame_dropping_'+spremenljivka) //zeleni element s kategorijami dodaj v zacetnem kontejnerju
@@ -334,8 +334,8 @@ function DragDropDelovanje(tip, spremenljivka, site_url, ajax, anketa, usr_id, n
var left_cat = -1;
var default_var_height = 290;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
default_var_height = 220; //default visina celotnega vprasanja @ mobile == 0 (desktop) in mobile == 2 (tablica)
}
@@ -568,8 +568,8 @@ function GridDraggable(tip, spremenljivka, vre_id, ajax, anketa, site_url, usr_i
var top_cat = -1;
var left_cat = -1;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
top_cat_right = 30;
}
//*********************
@@ -828,8 +828,8 @@ function GridDragDropDelovanje(num_grids, indeks, tip, spremenljivka, site_url,
var left_cat = -1;
var default_var_height = 290; //default visina celotnega vprasanja
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
top_cat_right = 30;
var default_var_height = 220; //default visina celotnega vprasanja
}
diff --git a/admin/survey/script/GDPR.js b/admin/survey/script/GDPR.js
index 7ac7a24..15be256 100644
--- a/admin/survey/script/GDPR.js
+++ b/admin/survey/script/GDPR.js
@@ -103,6 +103,8 @@ function toggleGDPRInfoText(obj){
function previewGDPRExport(type){
var ank_id = $("input[name=anketa]").val();
+
+ $('#fullscreen').addClass("divPopUp");
$('#fullscreen').html('').fadeIn('slow').draggable({
delay: 100
@@ -145,17 +147,22 @@ function toggleGDPRDPO(){
var has_dpo = $('input[name=has_dpo]:checked').val();
if(organization == '1' || has_dpo == '1')
- $("#gdpr_dpo").show();
+ $("#gdpr_dpo").removeClass('displayNone');
+
else
- $("#gdpr_dpo").hide();
+ $("#gdpr_dpo").addClass('displayNone');
+
if(organization == '1'){
- $("#gdpr_organization").show();
- $("#gdpr_has_dpo").hide();
+ $("#gdpr_organization").removeClass('displayNone');
+ $("#gdpr_has_dpo").addClass('displayNone');
+ $("#gdpr_has_dpo").find('.setting_holder').removeClass('bottom16');
+
}
else{
- $("#gdpr_organization").hide();
- $("#gdpr_has_dpo").show();
+ $("#gdpr_organization").addClass('displayNone');
+ $("#gdpr_has_dpo").removeClass('displayNone');
+ $("#gdpr_has_dpo").find('.setting_holder').addClass('bottom16');
}
}
// Prikazemo/skrijemo nastavitve organizacije in dpo-ja (ce je zasebnik)
@@ -164,9 +171,10 @@ function toggleGDPRHasDPO(){
var has_dpo = $('input[name=has_dpo]:checked').val();
if(has_dpo == '1')
- $("#gdpr_dpo").show();
+ $("#gdpr_dpo").removeClass('displayNone');
+
else
- $("#gdpr_dpo").hide();
+ $("#gdpr_dpo").addClass('displayNone');
}
// Nastavimo zahtevo za izbris da je opravljena
@@ -195,7 +203,7 @@ function setGDPRRequestComment(request_id, text){
var value = text;
- $("#anketa_edit").load('ajax.php?t=gdpr&a=gdpr_request_comment', {request_id: request_id, value:value});
+ $("#gdpr_nastavitve").load('ajax.php?t=gdpr&a=gdpr_request_comment', {request_id: request_id, value:value});
}
// Nastavimo komentar zahtevi za izbris - znotraj ankete
function setGDPRRequestCommentSurvey(request_id, text){
@@ -205,3 +213,79 @@ function setGDPRRequestCommentSurvey(request_id, text){
$("#survey_requests").load('ajax.php?t=gdpr&a=gdpr_request_comment_survey', {request_id: request_id, value:value, ank_id:ank_id});
}
+
+
+// Filter po gdpr anketah - seznam anket
+function gdpr_ankete(){
+
+ var check_gdpr_ankete = document.getElementById('gdpr_ankete_check');
+
+ if (check_gdpr_ankete.checked){
+ check_gdpr_ankete.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box1').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.green_row').hide();
+ }
+ else {
+ check_gdpr_ankete.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box1').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.green_row').show();
+ }
+}
+
+// Filter po potencialnih gdpr anketah - seznam anket
+function potenc_gdpr_ankete(){
+
+ var check_potenc_gdpr = document.getElementById('potenc_gdpr_ankete_check');
+
+ if (check_potenc_gdpr.checked){
+ check_potenc_gdpr.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box2').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.red_row').hide();
+ }
+ else {
+ check_potenc_gdpr.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box2').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.red_row').show();
+ }
+}
+
+// Filter po ne-gdpr anketah - seznam anket
+function ne_gdpr_ankete(){
+
+ var check_negdpr_ankete = document.getElementById('ne_gdpr_ankete');
+
+ if (check_negdpr_ankete.checked){
+ check_negdpr_ankete.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box3').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.grey_row').hide();
+ }
+ else {
+ check_negdpr_ankete.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box3').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.grey_row').show();
+ }
+}
diff --git a/admin/survey/script/Maps/VnaprejMarkers.js b/admin/survey/script/Maps/VnaprejMarkers.js
index 3bca4e6..de6e83c 100644
--- a/admin/survey/script/Maps/VnaprejMarkers.js
+++ b/admin/survey/script/Maps/VnaprejMarkers.js
@@ -317,7 +317,7 @@ function drawMarkers(spremenljivka) {
} else {
marker.setMap(null);
//odpre se okno, ce je prislo do napake - null - (mozen je tudi prekratek delay med geocoding requesti)
- alert(lang['srv_resevanje_alert_location_not_found_map']);
+ genericAlertPopup('srv_resevanje_alert_location_not_found_map');
}
});
});
diff --git a/admin/survey/script/appendMerge.js b/admin/survey/script/appendMerge.js
index bc24c3d..f091294 100644
--- a/admin/survey/script/appendMerge.js
+++ b/admin/survey/script/appendMerge.js
@@ -105,10 +105,10 @@ function append_prepare_add_recipients() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=get_profile_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', doAdd:doAdd, pid:pid});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
} else if (type == 0) {
@@ -158,10 +158,10 @@ function append_add_recipients(profile_id) {
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -180,14 +180,16 @@ function merge_getItems () {
var id = $(this).closest('li').attr('id');
var label = $(this).closest('li').find('label').text();
+ var dataTip = $(this).closest('li').data('tip');
var ch, cl;
if (checked == id+'_radio') { ch=' checked'; cl='inv_field_enabled'; } else { cd=''; cl=''; }
-
- $('ul#merge').append('<li class="'+cl+'"><input type="radio" id="'+id+'_radio"'+ch+' name="merge" value="'+id+'" onclick="merge_labels();"><label style="display: inline;" for="'+id+'_radio">'+label+'</label></li>');
+
+ //za checkboxe in tabele ne dovolimo, da so identifikator pri merge
+ if(dataTip != 2 && dataTip != 6)
+ $('ul#merge').append('<li class="'+cl+'"><input type="radio" id="'+id+'_radio"'+ch+' name="merge" value="'+id+'" onclick="merge_labels();"><label style="display: inline;" for="'+id+'_radio">'+label+'</label></li>');
});
-
}
function merge_labels() {
@@ -202,5 +204,21 @@ function merge_labels() {
}
});
-
+}
+
+// Sortiranje box-ov pri dodajanju respondentov
+function initAppendMergeConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ append_refreshFieldsList();
+ },
+ forcePlaceholderSize: 'true',
+ tolerance: 'pointer',
+ placeholder: 'inv_field_placeholder'
+ });
} \ No newline at end of file
diff --git a/admin/survey/script/branching.js b/admin/survey/script/branching.js
index 613b205..6585325 100644
--- a/admin/survey/script/branching.js
+++ b/admin/survey/script/branching.js
@@ -49,10 +49,10 @@ function onload_init_branching() {
if (locked) {
$('#branching ul.first.locked').bind('click', function (event) {
if ($("#prevent_unlock").val() == 1) {
- alert(lang['srv_unlock_popup3']);
+ genericAlertPopup('srv_unlock_popup3');
}
else {
- alert(lang['srv_unlock_popup2']);
+ genericAlertPopup('srv_unlock_popup2');
}
});
return;
@@ -60,6 +60,7 @@ function onload_init_branching() {
// funkcijo poklicemo ko se stran naloada in ob koncu vsakega ajax klica
branching_struktura();
+
$("body").ajaxStop(function () {
branching_struktura();
});
@@ -83,6 +84,34 @@ function onload_init_branching() {
branching_if_mouseleave(event);
}
});
+
+ // Copy paste iz worda - pocistimo text
+ $('div[contenteditable=true]').on('paste', function(e) {
+
+ // Prevent the default action
+ e.preventDefault();
+
+ // Dobimo plain text iz clipboarda
+ var text = e.originalEvent.clipboardData.getData('text/plain');
+
+ if (document.queryCommandSupported('insertText')) {console.log('xxx' + text);
+ document.execCommand('insertText', false, text);
+ }
+ else {console.log('aaaa' + text);
+ // Insert text at the current position of caret
+ const range = document.getSelection().getRangeAt(0);
+ range.deleteContents();
+
+ const textNode = document.createTextNode(text);
+ range.insertNode(textNode);
+ range.selectNodeContents(textNode);
+ range.collapse(false);
+
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+ });
}
// polovi vse click-e, ki se zgodijo v branchingu
@@ -107,12 +136,12 @@ function branching_click(event) {
}
// spremeni tip skale (ordinalna/nominalna) za tip 1,3,6
- if (ta.is('div.spr_edit a.scale_ordnom')) {
+ if (ta.is('div.spr_edit .scale_ordnom button:not(.active)')) {
var id = ta.parent().parent().attr('id');
id = id.replace('edit_', '');
value = ta.parent().parent().parent().find('.spremenljivka_content').attr('skala');
- if(value == 0) value = 1;
+ if(value == 0 || value == -1) value = 1;
else value = 0;
scale_ordnom(id, value);
@@ -148,7 +177,7 @@ function branching_click(event) {
}
// preview spremenljivke
- if (ta.is('div.spr_edit a.preview')) {
+ if (ta.is('div.spr_edit a.monitor')) {
var id = ta.parent().attr('id');
id = id.replace('edit_', '');
preview_spremenljivka(id);
@@ -239,7 +268,7 @@ function branching_click(event) {
// plusminus if, blok
- if (ta.is('a.pm')) {
+ if (ta.is('span.pm')) {
var id = ta.parent().attr('id');
id = id.replace('branching_if', '');
plusminus(id);
@@ -364,15 +393,20 @@ function branching_click(event) {
}
// pagebreak (klik na celo vrstico)
- td = $(event.target).closest('li.drop span, li.nodrop span');
+ td = $(event.target).closest('li.drop > div, li.nodrop > div');
if (td.hasClass('pb_new') || td.hasClass('pb_on')) {
- var spr;
- if (td.parent().attr('spr_pb'))
- spr = td.parent().attr('spr_pb');
- else
- spr = td.parent().attr('spr');
- if (!td.hasClass('permanent'))
+
+ if (!td.hasClass('permanent')){
+ var spr;
+
+ if (td.parent().attr('spr_pb'))
+ spr = td.parent().attr('spr_pb');
+ else
+ spr = td.parent().attr('spr');
+
pagebreak(spr);
+ }
+
return false;
}
@@ -431,6 +465,7 @@ function branching_mouseover(event) {
edit = edit.replace('branching_', '');
if (edit > 0) {
if (branchborder.find('div.spr_edit').length == 0) {
+
var html_snippet;
// Dodamo izbiro nominalne/ordinalne skale pri tipih 1, 3 in 6
@@ -443,24 +478,26 @@ function branching_mouseover(event) {
scale = 1;
if(scale == 1){
- scale_string = '<span class="scale_ordnom"><a class="scale_ordnom">' + lang['srv_skala_0'] + '</a>' +
- ' / ' +
- '<span class="bold">' + lang['srv_skala_1'] + '</span></span>';
+ scale_string = '<div class="scale_ordnom"><button class="small">' + lang['srv_skala_0'] + '</button>' +
+ '<button class="small active">' + lang['srv_skala_1'] + '</button></div>';
}
else{
- scale_string = '<span class="scale_ordnom"><span class="bold">' + lang['srv_skala_0'] + '</span>' +
- ' / ' +
- '<a class="scale_ordnom">' + lang['srv_skala_1'] + '</a></span>';
+ scale_string = '<div class="scale_ordnom"><button class="small active">' + lang['srv_skala_0'] + '</button>' +
+ '<button class="small">' + lang['srv_skala_1'] + '</button></div>';
}
}
- html_snippet = /*'<div class="spr_edit" id="edit_'+edit+'"><span class="edit">'+lang['srv_editirajspremenljivko']+' </span>'+*/
- '<div class="spr_edit" id="edit_' + edit + '">' +
- scale_string +
+ // Svincnik - urejanje
+ html_snippet = '<div class="spr_edit" id="edit_' + edit + '">' +
+ scale_string +
'<a title="' + lang['srv_editirajspremenljivko'] + '" class="edit faicon"></a>';
+ // Glasovanje te ikone nima
+ if($('#branching').hasClass('branching_glasovanje')){
+
+ }
// Disablamo ife, ce nima ustreznega paketa
- if ($('#commercial_package').attr('value') == '1') {
+ else if ($('#commercial_package').attr('value') == '1') {
html_snippet = html_snippet +
'<a title="' + lang['srv_if_new_question'] + '" class="addif faicon user_access_locked"></a>';
}
@@ -483,8 +520,12 @@ function branching_mouseover(event) {
signature = 1;
}
+ // Glasovanje te ikone nima
+ if($('#branching').hasClass('branching_glasovanje')){
+
+ }
// Disablamo kopiranje, ce nima ustreznega paketa za ta tip vprasanja
- if ( ($('#commercial_package').attr('value') == '1' && ['17','18','24','26','27'].includes(tip))
+ else if ( ($('#commercial_package').attr('value') == '1' && ['17','18','24','26','27'].includes(tip))
|| (($('#commercial_package').attr('value') == '1' || $('#commercial_package').attr('value') == '2') && ['22','25'].includes(tip))
|| (($('#commercial_package').attr('value') == '1' || $('#commercial_package').attr('value') == '2') && ['21'].includes(tip) && signature == 1) ) {
@@ -496,15 +537,22 @@ function branching_mouseover(event) {
'<a title="' + lang['srv_copy_spr'] + '" class="copy faicon"></a>';
}
- html_snippet = html_snippet +
- '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="preview faicon"></a>';
+ // Kalkulacija in kvota nimata predogleda
+ if(!['22','25'].includes(tip)){
+ html_snippet = html_snippet +
+ '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="monitor faicon"></a>';
+ }
+
}
// zarad tega so errorji
if (vprasanje_tracking == 2)
html_snippet += '<a title="'+lang['srv_analiza_arhiviraj']+'" class="arhiv faicon"></a>';
- html_snippet += '<a title="' + lang['srv_brisispremenljivko'] + '" class="delete faicon"></a>' +
- '</div>';
+ // Glasovanje te ikone nima
+ if(!$('#branching').hasClass('branching_glasovanje')){
+ html_snippet += '<a title="' + lang['srv_brisispremenljivko'] + '" class="delete faicon"></a>' + '</div>';
+ }
+
branchborder.prepend(html_snippet);
}
@@ -520,6 +568,7 @@ function branching_mouseover(event) {
html_snippet = '<div class="spr_edit" id="edit_' + edit + '">' +
'<a title="' + (hidden == 1 ? lang['edit_show'] : lang['edit_hide']) + '" class="hide faicon ' + (hidden == 1 ? 'unhide_icon' : 'hide_icon') + '"></a>' +
'<a title="' + (edit == -1 ? lang['srv_editirajuvod'] : lang['srv_editirajzakljucek']) + '" class="faicon edit"></a>' +
+ '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="monitor faicon"></a>'+
'</div>';
branchborder.prepend(html_snippet);
@@ -620,7 +669,7 @@ function branching_struktura() {
// nastavimo droppable
$('li.drop', $('#branching')).droppable({
- accept: '.spr, .if, .block, .endif, .endblock, .new_spr, .new_adv, .new_if, .new_block, .new_loop, .new_pb, .loop, .endloop',
+ accept: '.spr, .if, .block, .endif, .endblock, .new_spr, .new_if, .new_block, .new_loop, .new_pb, .loop, .endloop',
hoverClass: 'branchinghover',
tolerance: 'pointer',
drop: function (e, ui) {
@@ -642,12 +691,6 @@ function branching_struktura() {
spremenljivka_new(spr, _if, endif, copy, tip, podtip, drop);
}
- } else if ($(ui.draggable).hasClass('new_adv')) { // nova advanced spremenljivka (odpre se popup za izbiro)
- var spr = $(this).attr('spr');
- var _if = $(this).attr('if');
- var endif = $(this).attr('endif');
- toolbox_add_advanced(spr, _if, endif);
-
} else if ($(ui.draggable).hasClass('new_if')) { // nov if iz toolbox
var spr = $(this).attr('spr');
var _if = $(this).attr('if');
@@ -681,53 +724,44 @@ function branching_struktura() {
});
load_help(); // help moramo loadati tudi na zacetku in ob vsakem ajax klicu
-
- // paste from word alert
- $('div[contenteditable=true]').off('paste', pasteFromWordAlert);
- $('div[contenteditable=true]').on('paste', pasteFromWordAlert);
-
}
-var pasteFromWord = false;
-function pasteFromWordAlert() {
-
- if (pasteFromWord == true) return;
- pasteFromWord = true;
-}
-
-function pasteFromWordAlertClose() {
-
- $('#pasteFromWordAlert').hide();
- $('#fade').fadeOut('slow');
-}
var is_new_spr_dragable = false; // gledamo ali vlečemo new_spr da skrbimo za skrivanje
// inicializira toolbox na levi strani
function init_toolbox() {
- /*$('#toolbox, #toolbox_basic, #toolbox_settings').draggable({handle: '.handle'});*/
- $('p.new_spr:not(.user_access_locked), p.new_adv:not(.user_access_locked), p.new_if:not(.user_access_locked), p.new_block:not(.user_access_locked), p.new_loop:not(.user_access_locked), p.new_pb', '#toolbox_basic').draggable({
- start: function () {
- is_new_spr_dragable = true, $('#toolbox_add_advanced').addClass('dragging')
+ $('.new_spr:not(.user_access_locked), .new_if:not(.user_access_locked), .new_block:not(.user_access_locked), .new_loop:not(.user_access_locked), .new_pb', '#toolbox_basic').draggable({
+ start: function (e, ui) {
+ is_new_spr_dragable = true;
+ $('#toolbox_add_advanced').addClass('dragging');
+ $(ui.helper).addClass("clone-dragging");
},
- stop: function () {
- is_new_spr_dragable = false, $('#toolbox_add_advanced').removeClass('dragging')
+ stop: function (e, ui) {
+ is_new_spr_dragable = false;
+ $('#toolbox_add_advanced').removeClass('dragging');
+ $(ui.helper).removeClass("clone-dragging");
},
revert: false,
helper: 'clone',
opacity: 0.9,
appendTo: 'body',
- distance: 5
+ distance: 5,
+ cursor: 'pointer'
}).bind('click', function (event) {
var ta = $(event.target);
- ta = $(ta).closest('p');
+ ta = $(ta).closest('.new_spr, .new_if, .new_block, .new_loop');
+
if (ta.hasClass('new_spr')) { // nova spremenljivka (iz toolboxa)
- //$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()}); // scrollamo na dno zaslona
+
var tip = ta.attr('tip');
var podtip = 0;
- if (ta.hasClass('podtip')) podtip = ta.attr('podtip');
+
+ if (ta.hasClass('podtip'))
+ podtip = ta.attr('podtip');
+
// pri kreiranju generatorja imen ustvarimo za njim se loop in nagovor, ki mu pripadata
if (tip == '9_sn') {
SN_generator_new(0, 1);
@@ -736,78 +770,112 @@ function init_toolbox() {
spremenljivka_new(0, 0, 1, 0, tip, podtip);
}
- } else if (ta.hasClass('new_adv')) { // nova spremenljivka advanced (prikaze se popup z vsemi tipi vprasanj)
- //$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()}); // scrollamo na dno zaslona
- toolbox_add_advanced(0, 0, 1);
-
- } else if (ta.hasClass('new_if')) { // nov if iz toolbox
+ }
+ else if (ta.hasClass('new_if')) { // nov if iz toolbox
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 0);
-
- } else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
+ }
+ else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 1);
-
- } else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
+ }
+ else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 2);
}
$('#toolbox_add_advanced').addClass('dragging');
+
setTimeout(function () {
$('#toolbox_add_advanced').removeClass('dragging');
}, 500);
+ event.stopPropagation();
});
// mousever preview vprasanja
$('#toolbox_basic').bind('mouseover', function (event) {
- var tip = $(event.target).closest('p.new_spr, p.new_adv, p.new_if, p.new_block, p.new_loop, p.new_sn');
+ var tip = $(event.target).closest('.new_spr, .new_adv, .new_if, .new_block, .new_loop, .new_sn');
- if (tip.hasClass('adv')) { // tooltip za vprasanja v advanced toolboxu
- if (tip.hasClass('podtip')) { // vprasanja s podtipom
+ // tooltip za vprasanja v advanced toolboxu
+ if (tip.hasClass('adv')) {
+
+ // vprasanja s podtipom
+ if (tip.hasClass('podtip')) {
show_tip_preview_subtype(-1, tip.attr('podtip'), tip.attr('tip'));
}
else if (tip.hasClass('new_sn')) {
show_tip_preview_toolbox(tip.attr('tip'), 0, 1);
}
- else if (tip.hasClass('new_spr')) { // osnovna vprasanja, samo z tipom
+ // osnovna vprasanja, samo z tipom
+ else if (tip.hasClass('new_spr')) {
show_tip_preview_toolbox(tip.attr('tip'), 0, 1);
}
}
- else if (tip.hasClass('new_spr') && !is_new_spr_dragable) { // tooltip za vprasanja v osnovnemu toolboxu
+ // tooltip za vprasanja v osnovnemu toolboxu
+ else if (tip.hasClass('new_spr') && !is_new_spr_dragable) {
var podtip = tip.attr('podtip');
show_tip_preview_toolbox(tip.attr('tip'), undefined, undefined, podtip);
}
else if (tip.hasClass('new_if') || tip.hasClass('new_block') || tip.hasClass('new_loop')) {
show_tip_preview_toolbox(tip.attr('tip'));
}
- else if (tip.hasClass('new_adv')) { // gumb za +
+ // gumb za +
+ else if (tip.hasClass('new_adv')) {
// prikazemo s CSSom
}
}).bind('mouseout', function (event) {
$("#tip_preview").hide();
});
-
- // max-height toolboxa
- //$('#toolbox_basic').css('max-height', $(window).height()-188);
}
// prikaze popup za dodajanje naprednih tipov vprasanj
-function toolbox_add_advanced(spr, _if, endif) {
+function toolbox_add_advanced_popup() {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').show().load('ajax.php?t=branching&a=toolbox_add_advanced', {
- anketa: srv_meta_anketa_id,
- spr: spr,
- 'if': _if,
- endif: endif
- });
+
+ $('#fullscreen').show().load('ajax.php?t=branching&a=toolbox_add_advanced', {anketa: srv_meta_anketa_id}, function(){
+
+ $('#toolbox_add_advanced_popup .new_spr:not(.user_access_locked), #toolbox_add_advanced_popup .new_if:not(.user_access_locked), #toolbox_add_advanced_popup .new_block:not(.user_access_locked), #toolbox_add_advanced_popup .new_loop:not(.user_access_locked)').click(function() {
+ var ta = $(event.target);
+
+ if (ta.hasClass('new_spr')) { // nova spremenljivka (iz toolboxa)
+
+ var tip = ta.attr('tip');
+ var podtip = 0;
+
+ if (ta.hasClass('podtip'))
+ podtip = ta.attr('podtip');
+
+ // pri kreiranju generatorja imen ustvarimo za njim se loop in nagovor, ki mu pripadata
+ if (tip == '9_sn') {
+ SN_generator_new(0, 1);
+ }
+ else {
+ spremenljivka_new(0, 0, 1, 0, tip, podtip);
+ }
+
+ }
+ else if (ta.hasClass('new_if')) { // nov if iz toolbox
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 0);
+ }
+ else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 1);
+ }
+ else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 2);
+ }
+ });
+ });
}
+
// ----------------------- funkcije, ki se klicejo iz htmlja
// -----------------------
@@ -827,25 +895,10 @@ function change_mode(what, value) {
}
// spremeni hitre nastavitve pri formi
-function change_form_quicksettings(what) {
+function change_form_quicksettings() {
- var status = $('#' + what).css('display');
- if (status == 'none') {
- $('#' + what).show();
- if (what == 'form_settings_obvescanje') {
- $('#obvescanje_switch').removeClass("plus").addClass("minus");
- } else {
- $('#email_switch').removeClass("plus").addClass("minus");
- }
- }
- else {
- $('#' + what).hide();
- if (what == 'form_settings_obvescanje') {
- $('#obvescanje_switch').removeClass("minus").addClass("plus");
- } else {
- $('#email_switch').removeClass("minus").addClass("plus");
- }
- }
+ $('#form_settings_obvescanje').slideToggle();
+ $('#obvescanje_switch').toggleClass("arrow2_d").toggleClass("arrow2_u");
vprasanje_save();
}
@@ -860,7 +913,7 @@ function toolbox_advanced(checked) {
}
// doda nov if
-function if_new(spremenljivka, _if, endif, tip, copy, no_content, follow_up) {
+function if_new(spremenljivka, _if, endif, tip, copy=0, no_content=0, follow_up=0) {
close_all_editing();
@@ -896,6 +949,9 @@ function if_new(spremenljivka, _if, endif, tip, copy, no_content, follow_up) {
condition_editing(new_if_id);
}
}
+ else{
+ actionNotePopup('condition_copy', 'success');
+ }
});
}
@@ -934,6 +990,7 @@ function spremenljivka_new(spremenljivka, _if, endif, copy, tip, podtip, drop) {
}
else {
refreshLeft(data.nova_spremenljivka_id);
+ actionNotePopup('question_copy', 'success');
}
// dvojne gride moramo na novo shranit da se prepise grid v bazi
@@ -1011,7 +1068,7 @@ function if_remove(_if, all, confirmed) {
// Warning da brisemo vsebino pogoja in imamo ze podatke, ki jih bomo pobrisali
if (data.substring(0, 3) === '<p>' || data.substring(0, 4) === '<h2>') {
$('#fade').fadeIn("fast");
- $('#dropped_alert').html(data).fadeIn("fast").css('width', '400px');
+ $('#dropped_alert').html(data).fadeIn("fast").css('width', '600px');
}
else{
$('#branching').html(data);
@@ -1050,8 +1107,6 @@ function if_tip(_if, tip) {
'if': _if,
anketa: srv_meta_anketa_id,
tip: tip
- }, function () {
- centerDiv2Page('#div_condition_editing');
});
}
@@ -1138,17 +1193,13 @@ function vrednost_condition_editing(vrednost) {
'ajax.php?t=branching&a=vrednost_condition_editing', {
'vrednost': vrednost,
'anketa': srv_meta_anketa_id
- }, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_conditions .clr_if').children('span').show(); //prikažemo zvezdico *IF
}
);
}
function condition_editing(_if, odpreminus) {
+
close_all_editing();
- // zapremo knjiznico
- $('#toolbox_library').hide();
$('li#branching_if' + _if).addClass('if_editing');
$('ul#if_' + _if).addClass('if_editing');
@@ -1202,16 +1253,16 @@ function condition_editing_close(_if, if_nova) {
var plus = 0;
- if ($('#branching_if' + _if + ' a.pm').hasClass('plus'))
+ if ($('#branching_if' + _if + ' span.pm').hasClass('plus'))
plus = 1;
$.post('ajax.php?t=branching&a=condition_editing_close', {anketa: srv_meta_anketa_id, 'if': _if, if_nova: if_nova},
function (data) {
if (plus == 1)
- $('#branching_if' + _if).html('<a class="pm plus"></a>' + data);
+ $('#branching_if' + _if).html('<span class="pm faicon plus"></span>' + data);
else
- $('#branching_if' + _if).html('<a class="pm minus"></a>' + data);
+ $('#branching_if' + _if).html('<span class="pm faicon minus"></span>' + data);
if ($('#vprasanje').css('display') == 'block') { // refreshamo tudi preview pogoja v urejanju vprasanja
@@ -1281,7 +1332,7 @@ function vrednost_condition_editing_close_save(vrednost, _if) {
//če pa pogoja še nimamo potem moramo najprej narediti span element, kamor bomo vstavili IF pogoj
//za checkox, radio in tisti, ki imajo div in ne tabele
if (v.is('div')) {
- v.append('<span style="font-size:9px; cursor:pointer" id="if_notranji_' + vrednost + '" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">');
+ v.append('<span style="cursor:pointer" id="if_notranji_' + vrednost + '" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">');
}//za vsa vprašanja, ki so v tabelah
if (v.is('tr')) {
v.find('td.grid_question').closest('td').append('<span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">*</span>');
@@ -1308,9 +1359,7 @@ function condition_add(_if, conjunction, negation, vrednost) {
'noupdate': __vnosi + __analiza,
'anketa': srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $("#div_condition_editing_container").attr({scrollTop: $("#div_condition_editing_container").attr("scrollHeight")});
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
+ $(".condition_editing_body").animate({ scrollTop: $('.condition_editing_body').prop("scrollHeight")}, 1000);
});
}
@@ -1485,7 +1534,6 @@ function bracket_edit_new(condition, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
});
@@ -1501,12 +1549,35 @@ function conjunction_edit(condition, conjunction, negation) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
});
}
+function conjunction_dropdown_edit(condition) {
+
+ var conj = $('#conjunction_dropdown_' + condition).val().split('_');
+
+ var conjunction = conj[0];
+ var negation = conj[1];
+
+ $('#div_condition_editing_inner').load('ajax.php?t=branching&a=conjunction_edit',
+ {
+ condition: condition,
+ conjunction: conjunction,
+ negation: negation,
+ noupdate: __vnosi + __analiza,
+ anketa: srv_meta_anketa_id
+ }, function () {
+
+ // Zascrollamo na pravo pozicijo
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
+ }
+ );
+}
+
function fill_value(condition, vrednost) {
var spr_id = document.getElementById('spremenljivka_' + condition);
@@ -1519,15 +1590,16 @@ function fill_value(condition, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
- });
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
+});
}
function edit_fill_value(condition) {
$('#edit_fill_value_' + condition).show();
$('#preview_fill_value_' + condition).hide();
+ $('#preview_fill_link_' + condition).hide();
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
}
@@ -1580,7 +1652,6 @@ function condition_remove(_if, condition, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
});
@@ -1618,8 +1689,6 @@ function calculation_editing_close(condition, vrednost) {
anketa: srv_meta_anketa_id,
condition: condition,
vrednost: vrednost
- }, function () {
- centerDiv2Page('#div_condition_editing');
});
// kalkulacija kot tip vprasanja
@@ -1638,9 +1707,8 @@ function calculation_editing_close(condition, vrednost) {
'ajax.php?t=branching&a=calculation_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
}
}
}
@@ -1665,8 +1733,7 @@ function calculation_add(condition, operator, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- $("#calculation_editing_inner").attr({scrollTop: $("#calculation_editing_inner").attr("scrollHeight")});
- $('#calculation_editing_inner').scroll();
+ $(".calculation_editing_body").animate({ scrollTop: $('.calculation_editing_body').prop("scrollHeight")}, 1000);
});
}
@@ -1680,7 +1747,6 @@ function calculation_operator_edit(calculation, operator) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#calculation_editing_inner').scroll();
});
}
@@ -1696,6 +1762,17 @@ function calculation_sort(condition) {
});
}
+function quota_sort(condition) {
+
+ $('#quota_editing_inner').load('ajax.php?t=branching&a=quota_sort', {
+ 'condition': condition,
+ sortable: $('#quota_editing_inner').sortable('serialize'),
+ anketa: srv_meta_anketa_id
+ }, function () {
+ $('#quota_editing_inner').scroll();
+ });
+}
+
function calculation_edit(calculation, vrednost) {
var spr_id = document
@@ -1740,7 +1817,6 @@ function calculation_bracket_edit_new(calculation, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#calculation_editing_inner').scroll();
});
}
@@ -1823,7 +1899,7 @@ function vprasanje_edit(spremenljivka, buffer) {
function plusminus(id, odpremo) {
- var a = $('#branching_if' + id + ' a.pm');
+ var a = $('#branching_if' + id + ' span.pm');
// blok/if je prikazan, mi ga bomo skrili
if (a.hasClass('minus') && odpremo != 1) {
@@ -1952,13 +2028,39 @@ function intro_concl_preview(spremenljivka) {
});
}
+function toggle_missing_dropdown_table(spr){
+ if($('[id="table_missings_menu_'+spr+'"]').last().css('display') == 'none')
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'inline');
+ else
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'none');
+}
+
+function close_missing_menu(spr){
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'none');
+}
+
// preklopi ordinalno/nominalno skalo
function scale_ordnom(spremenljivka, value) {
$('#branching_' + spremenljivka).load('ajax.php?t=branching&a=scale_ordnom', {spremenljivka: spremenljivka, value: value, anketa: srv_meta_anketa_id}, function () {
- $('input[type="radio"][name="skala"]').not(':checked').prop("checked", true, function () {
+
+ //as radio
+ /* $('input[type="checkbox"][name="skala"]').not(':checked').prop("checked", true, function () {
vprasanje_save();
- });
+ }); */
+
+ //as checkbox
+ if(value == 1){
+ $('input[type="checkbox"][name="skala"]').prop("checked", false, function () {
+ vprasanje_save();
+ });
+ }
+ else {
+ $('input[type="checkbox"][name="skala"]').prop("checked", true, function () {
+ vprasanje_save();
+ });
+ }
+
show_scale_text(value);
});
}
@@ -2144,7 +2246,7 @@ function expandCollapseAllPlusMinus(what) {
var id = $(this).attr('id').replace('branching_if', '');
- var a = $('#branching_if' + id + ' a.pm');
+ var a = $('#branching_if' + id + ' span.pm');
if (what == 'expand') {
// blok/if je skrit
@@ -2184,12 +2286,6 @@ function branch_brisi_grupo(id, text) {
}
}
-// document ready funkcijo sem prestavil na vrh strani, da je vse skupaj
-
-function centerDiv2Page(id) {
- return false;
-}
-
// prestevilci anketo v branchingu
function prestevilci() {
@@ -2220,10 +2316,9 @@ function alert_close_block() {
}
// hitre nastavitve
-function quick_settings(spremenljivka, results, what) {
+function quick_settings(results, what) {
var status1 = $('#form_settings_obvescanje').css('display');
- //var status2 = $('#form_settings_vabila').css('display');
if (what == 'finish_author' || what == 'finish_respondent_cms' || what == 'finish_respondent' || what == 'finish_other') {
if (results.checked == true)
@@ -2232,23 +2327,18 @@ function quick_settings(spremenljivka, results, what) {
results = 0;
}
- //$("#simple").load('ajax.php?a=form_settings', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, results: results, what: what});
- //$.post('ajax.php?a=form_settings', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, results: results, what: what});
-
$("#quick_settings").load('ajax.php?t=branching&a=edit_quick_settings', {
anketa: srv_meta_anketa_id,
- spremenljivka: spremenljivka,
results: results,
what: what,
- status1: status1,
- status2: status2
+ status1: status1
});
- if (what == 'finish_respondent')
+ /*if (what == 'finish_respondent')
$("#branching").load('ajax.php?t=branching&a=refresh_left', {
anketa: srv_meta_anketa_id,
spremenljivka: spremenljivka
- });
+ });*/
}
function calculation_edit_variable(spremenljivka) {
@@ -2522,7 +2612,6 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_' + spremenljivka).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_' + spremenljivka).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2530,7 +2619,6 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2550,12 +2638,10 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
@@ -2669,7 +2755,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
//globalne spremenljivke, ki so potrebne za posodobitev drsnika v prevodih - konec
$("#variabla_limit_" + spremenljivka).css('display', 'none');
- //$("input[name^='foo_" + spremenljivka + "']").parent().css('display', 'none'); //pokomnetiral zaradi skrivanja missing-ov
var minmaxlabela = "label";//hrani nastavitev za minmax labele
var rest = false; //hrani nastavitve za vmesne črtice z ("label") in brez label ("pip") ter odsotnost črtic (false)
@@ -2693,7 +2778,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_prevajanje' + spremenljivka).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2701,7 +2785,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2721,12 +2804,10 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
@@ -2735,14 +2816,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
rest = "label";
}
-/* if(tip_vmesne_descr_labele != 0 && prevod==''){ //ce se je izbralo prednalozene vmesne opisne labele in ni prevoda
- vmesne_opisne_labele = vmesne_descr_labele.split(";");
- max = vmesne_opisne_labele.length-1;
- }else if((slider_VmesneDescrLabel)||(tip_vmesne_descr_labele != 0 && prevod)){ //ce se je izbralo Brez oz. custom opisne labele ALI se je izbralo prednalozene vmesne opisne labele in je prevod
- vmesne_opisne_labele = slider_CustomDescriptiveLabels.split(";");
- max = vmesne_opisne_labele.length;
- } */
-
if((slider_VmesneDescrLabel)||(tip_vmesne_descr_labele != 0)){ //ce se je izbralo Brez oz. custom opisne labele ALI se je izbralo prednalozene vmesne opisne labele
vmesne_opisne_labele = slider_CustomDescriptiveLabels.split(";");
max = vmesne_opisne_labele.length;
@@ -2757,7 +2830,8 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
slide: function (event, ui) {
if (slider_window_number == 0){ //ce rabimo stevilo nad handle
- // Sproti popravljamo vrednost v okencu ob slidu
+
+ // Sproti popravljamo vrednost v okencu ob slidu
$("#sliderTextbranching_" + spremenljivka).html(ui.value);
// Premikamo okencek skupaj z sliderjem
@@ -2769,12 +2843,7 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
};
// wait for the ui.handle to set its position
setTimeout(delay, 5);
- }
-
- //if (slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', '');//
- //}
-
+ }
},
// Prikazemo okencek s vrednostjo
@@ -2805,19 +2874,11 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
}
$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('left', percent_def + '%');
-
-
- //if (slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#sliderbranching_' + spremenljivka + ' .special_slider').css('visibility', '');//skrij handle
- //}
-
-
+
// Postavimo na zacetku okencek na pravo mesto
if (slider_window_number == 0){
$("#sliderTextbranching_" + spremenljivka).position({
of: $('#sliderbranching_' + spremenljivka + ' .ui-slider-handle'),
- //of: $('#sliderbranching_' + spremenljivka + ' .classic_slider'),
offset: "0, -37"
});
}
@@ -2829,7 +2890,7 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
last: minmaxlabela,
labels: vmesne_opisne_labele,
});
- //$( ".selector" ).slider( "option", "value", 10 );
+
$('#sliderbranching_prevajanje' + spremenljivka).slider("option", "value", def);//postavi rocico na mesto, kjer je izracunana default vrednost
}
//*********************************************************
@@ -2868,7 +2929,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2876,7 +2936,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2972,11 +3031,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
}
$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('left', percent_def + '%');
- //if($('#slider_handle_'+spremenljivka+' option:selected').val() == 2){//ce si zelimo skriti handle
- //if(slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#slider_' + spremenljivka + ' .ui-slider-handle.ui-state-default.ui-corner-all').css('visibility', 'hidden');//skrij handle
- //}
if (slider_window_number == 0){
// Postavimo na zacetku okencek na pravo mesto
$("#sliderTextbranching_" + spremenljivka + "_" + vrednost).position({
@@ -2986,8 +3040,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
});
}
}
-
- //});
})
.slider("pips",{
rest: rest,
@@ -3072,11 +3124,9 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
//if (vmesne_labels == 1) {
@@ -3146,11 +3196,6 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
}
$('#sliderbranching_prevajanje' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('left', percent_def + '%');
- //if($('#slider_handle_'+spremenljivka+' option:selected').val() == 2){//ce si zelimo skriti handle
- //if(slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#slider_' + spremenljivka + ' .ui-slider-handle.ui-state-default.ui-corner-all').css('visibility', 'hidden');//skrij handle
- //}
if (slider_window_number == 0){
// Postavimo na zacetku okencek na pravo mesto
$("#sliderTextbranching_" + spremenljivka + "_" + vrednost).position({
@@ -3160,8 +3205,6 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
});
}
}
-
- //});
})
.slider("pips",{
rest: rest,
diff --git a/admin/survey/script/break.js b/admin/survey/script/break.js
index f0603d5..018666a 100644
--- a/admin/survey/script/break.js
+++ b/admin/survey/script/break.js
@@ -3,18 +3,23 @@ function break_init() {
function breakSpremenljivkaChange() {
+
// drugi dropdown
var spr = $('#breakSpremenljivka').val();
var seq = $("#breakSpremenljivka option:selected").attr('seq');
+
$("#breakResults").html('');
+
$("#breakResults").load("ajax.php?t=break&a=spremenljivkaChange", {anketa:srv_meta_anketa_id, spr:spr, seq:seq}, function() {
$("#breakResults").fadeTo(100, 1);
}).show();
}
function change_break_percent () {
+
var break_percent = $("#break_percent").is(':checked');
var crossChk1 = break_percent;
+
//ponastavimo tudi za crostabe
$.post("ajax.php?t=crosstab&a=change_cb_percent", {anketa:srv_meta_anketa_id, crossChk1:crossChk1}, function() {
$.post("ajax.php?t=break&a=change_break_percent", {anketa:srv_meta_anketa_id, break_percent:break_percent}, function() {
@@ -31,6 +36,7 @@ function change_break_charts (break_charts) {
}
function doArchiveBreak() {
+
//preverimo ali obstaja vsebina breakResults
if ($("#breakResults").length > 0 && $("#breakResults").html() != '') {
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
@@ -38,11 +44,14 @@ function doArchiveBreak() {
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
+
function submitArchiveBreak() {
+
//preverimo ali obstaja vsebina meansa
if ($("#breakResults").html().length > 0 ) {
var content = $("#breakResults").html();
@@ -55,33 +64,40 @@ function submitArchiveBreak() {
$("#fullscreen").load('ajax.php?a=submitArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, name:name, note:note, access:access, duration:duration, durationType:durationType, content:content}, function() {
$("#fullscreen").show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
function createArchiveBreakBeforeEmail() {
+
//preverimo ali obstaja vsebina breakResults
if ($("#breakResults").html().length > 0 ) {
+
var content = $("#breakResults").html();
+
$.post('ajax.php?a=createArchiveBeforeEmail', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, content:content}, function(response) {
if (parseInt(response) > 0) {
var aid = parseInt(response);
$("#fullscreen").load('ajax.php?a=emailArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, aid:aid}, function() {
$('#fullscreen').show();
});
- } else {
+ }
+ else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
- } else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
+ }
+ else {
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
}
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/cReport.js b/admin/survey/script/cReport.js
index 9159b6e..c421d23 100644
--- a/admin/survey/script/cReport.js
+++ b/admin/survey/script/cReport.js
@@ -7,8 +7,8 @@ function creport_init () {
// sortable za custom report
$('.report_element').live('mouseover', function (event) {
$('#custom_report_sortable').sortable({
- items: 'li',
- handle: '.report_element_title',
+ items: 'li.report_element_standard, li.report_element_break',
+ handle: '.report_element_head',
opacity: 0.8,
revert: true,
create:function(){
@@ -32,18 +32,23 @@ function creport_init () {
});
$(".report_element_separator").live({
+
mouseenter: function(){
- $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //}
},
mouseleave: function(){
- $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //}
}
});
// click report elementa
- $(".report_element_title").live("click", function(event) {
+ $(".report_element_head").live("click", function(event) {
- var element = $(this).parent().parent();
+ var element = $(this).parent();
var id = $(element).attr('id').substr(15);
expandCustomReportElement(id);
@@ -218,6 +223,7 @@ function addPBCustomReportElement(id) {
// zbrise element iz custom reporta
function deleteCustomReportElement(element_id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=delete_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:element_id});
+ event.stopPropagation();
}
// razsirjanje elementa v custom reportu
@@ -260,6 +266,7 @@ function editCustomReportTTestVar(id) {
// kopiranje elementa v custom reportu
function copyCustomReportElement(id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=copy_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:id});
+ event.stopPropagation();
}
function printCustomReportElement(ime, id){
@@ -280,6 +287,8 @@ function printCustomReportElement(ime, id){
newWin.focus();
newWin.document.close();
+
+ event.stopPropagation();
}
// alert za dodajanje vseh elementov istega tipa v custom report
@@ -340,28 +349,14 @@ function addCustomReportAllElements(type) {
* nastavi editor na contenteditable element za naslov
*/
function creport_load_editor (_this) {
-
- /*$(_this).css('display', 'none');
- var el = $(_this).parent().find('.creport_textarea');
-
- var el_id = el.attr('el_id');
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
- create_editor('report_element_texteditor_'+el_id);*/
-
-
-
$(_this).css('display', 'none');
var el = $(_this).parent().find('.creport_text_inline');
var el_id = el.attr('el_id');
-
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
+ el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:100%">'+el.html()+'</textarea>'+
+ '<div class="button_holder below"><button class="medium blue" onclick="creport_save_editor(\''+el_id+'\'); return false;">'+lang['save']+'</button></div>');
create_editor('report_element_texteditor_'+el_id);
}
@@ -370,17 +365,7 @@ function creport_load_editor (_this) {
* shrani editor in nastavi nazaj contenteditable
*/
function creport_save_editor(el_id) {
-
- /*get_editor_close('report_element_texteditor_'+el_id);
-
- var el = $('#report_element_texteditor_'+el_id);
- var parent = el.parent();
-
- el.replaceWith('<textarea style="width:90%; height: 80px;" class="creport_textarea" el_id="'+el_id+'" id="report_element_text_'+el_id+'" onBlur="editCustomReportElement('+el_id+', text, this.value)">');
- parent.find('span.buttonwrapper').remove();
-
- editCustomReportElement(el_id, 'text', el.val());*/
-
+
get_editor_close('report_element_texteditor_'+el_id);
var el = $('#report_element_texteditor_'+el_id);
@@ -402,13 +387,14 @@ function doArchiveCReport() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
+
function submitArchiveCReport() {
+
//preverimo ali obstaja vsebina meansa
if ($("#custom_report_elements").html().length > 0 ) {
- //var content = $("#custom_report_elements").html();
var name = $("#newAnalysisArchiveName").val();
var note = $("#newAnalysisArchiveNote").val();
@@ -418,8 +404,9 @@ function submitArchiveCReport() {
$("#fullscreen").load('ajax.php?a=submitArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, name:name, note:note, access:access, duration:duration, durationType:durationType}, function() {
$("#fullscreen").show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -435,9 +422,9 @@ function createArchiveCReportBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -445,7 +432,7 @@ function createArchiveCReportBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
@@ -458,15 +445,11 @@ function showCReportPreview() {
recipe.document.write('<html><head><title>Predogled poro&#269;ila po meri</title>');
- recipe.document.write('<link rel="stylesheet" href="css/style_font.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_basic.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_main.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_new2.css">');
- recipe.document.write('<link rel="stylesheet" href="css/print.css">');
+ recipe.document.write('<link rel="stylesheet" href="minify/g=css">');
recipe.document.write('<link rel="stylesheet" href="css/style_print.css" media="print">');
-
+
recipe.document.write('<style>');
- recipe.document.write('.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}');
+ recipe.document.write('ul{margin: 16px; padding: 0; list-style-type: none;} li{margin:16px 0;} .container {margin-bottom:45px;} #navigationBottom {width: 100%; margin-bottom: 16px; padding-right: 16px;}');
recipe.document.write('</style>');
recipe.document.write('</head><body>');
@@ -516,6 +499,16 @@ function use_creport_profile() {
});
}
+// Preklopimo porocilo
+function change_creport_profile(profile_id, author) {
+
+ $.post('ajax.php?t=custom_report&a=use_creport_profile', {anketa:srv_meta_anketa_id, id:profile_id, author:author}, function(){
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=analysis&m=analysis_creport&expanded='+global_expanded;
+ window.location.href = srv_site_url;
+ });
+}
+
// popravljamo custom report profil
function creport_profile_action(action){
diff --git a/admin/survey/script/calendar/calendar.js b/admin/survey/script/calendar/calendar.js
index 1dbcef4..8272439 100644
--- a/admin/survey/script/calendar/calendar.js
+++ b/admin/survey/script/calendar/calendar.js
@@ -641,7 +641,7 @@ Calendar.cellClick = function(el, ev) {
"Thank you!\n" +
"http://dynarch.com/mishoo/calendar.epl\n";
}
- alert(text);
+ genericAlertPopup('alert_parameter_text');
return;
case -2:
if (year > cal.minYear) {
diff --git a/admin/survey/script/charts.js b/admin/survey/script/charts.js
index 3d64bb7..2451e4e 100644
--- a/admin/survey/script/charts.js
+++ b/admin/survey/script/charts.js
@@ -264,7 +264,7 @@ function chartSaveAdvancedSettings (spid, loop) {
var checkEmpty = chartAdvancedSettingsLimitEmpty();
if(checkEmpty == true){
- alert(lang['srv_chart_num_limit_warning']);
+ genericAlertPopup('srv_chart_num_limit_warning');
}
else{
$.post('ajax.php?t=charts&a=chart_save_advanced_settings', form, function(data) {
@@ -280,10 +280,10 @@ function chartSaveAdvancedSettings (spid, loop) {
// prikaze napredno urejanje grafa
function chartTabAdvancedSettings (tab) {
- $('.chartSettingsArea').css('visibility', 'hidden');
+ $('.chartSettingsArea').addClass("displayNone");
$('.chartTab').removeClass('active');
- $('#chartSettingsArea'+tab).css('visibility', 'visible');
+ $('#chartSettingsArea'+tab).removeClass("displayNone");
$('#chartTab'+tab).addClass('active');
}
@@ -500,9 +500,11 @@ function tableChartSaveAdvancedSettings (chartID) {
function edit_labels(val){
if(val == 0) {
$('.chart_editing :input').attr('disabled', true);
+ $('#title_edit').addClass('gray');
}
else {
$('.chart_editing :input').removeAttr('disabled');
+ $('#title_edit').removeClass('gray');
}
}
diff --git a/admin/survey/script/collectData.js b/admin/survey/script/collectData.js
index 704e054..da91e99 100644
--- a/admin/survey/script/collectData.js
+++ b/admin/survey/script/collectData.js
@@ -24,7 +24,7 @@ function collectDataAjax(){
location.reload();
}
else{
- alert(lang['srv_collectdata_failed']);
+ genericAlertPopup('srv_collectdata_failed');
}
}
});
diff --git a/admin/survey/script/comments.js b/admin/survey/script/comments.js
new file mode 100644
index 0000000..9ada2b4
--- /dev/null
+++ b/admin/survey/script/comments.js
@@ -0,0 +1,198 @@
+
+// Prikaze popup v urejanju ankete (spodnja vrstica pod vsakim vprasanjem - 3 gumbi)
+function openCommentPopupInline (type, spremenljivka) {
+
+ // Vse odprte najprej zapremo
+ $('.comment_inline_popup').addClass('displayNone');
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_inline_add_"+spremenljivka).removeClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_inline_editor_"+spremenljivka).removeClass('displayNone');
+ }
+ // komentarji respondentov
+ else if (type==3){
+ $("#comment_inline_respondent_"+spremenljivka).removeClass('displayNone');
+ }
+}
+
+// Zapre popupe v urejanju ankete (spodnja vrstica pod vsakim vprasanjem - 3 gumbi)
+function closeCommentPopupInline (type, spremenljivka) {
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_inline_add_"+spremenljivka).addClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_inline_editor_"+spremenljivka).addClass('displayNone');
+ }
+ // komentarji respondentov
+ else if (type==3){
+ $("#comment_inline_respondent_"+spremenljivka).addClass('displayNone');
+ }
+}
+
+// Prikaze popup v urejanju ankete (spodnja vrstica pod vsakim pogojem - 2 gumba)
+function openIfCommentPopupInline (type, if_id) {
+
+ // Vse odprte najprej zapremo
+ $('.comment_inline_popup').addClass('displayNone');
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_if_inline_add_"+if_id).removeClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_if_inline_editor_"+if_id).removeClass('displayNone');
+ }
+}
+
+// Zapre popupe v urejanju ankete (spodnja vrstica pod vsakim pogojem - 2 gumba)
+function closeIfCommentPopupInline (type, if_id) {
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_if_inline_add_"+if_id).addClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_if_inline_editor_"+if_id).addClass('displayNone');
+ }
+}
+
+
+function toggleCommentDropdown () {
+ $("#comment_dropdown").toggleClass('displayNone');
+}
+
+function toggleCommentDropdownTestSurvey () {
+ $("#comment_dropdown_test_survey").toggleClass('displayNone');
+ $(".open_comment_box").toggleClass('active');
+}
+
+function toggleCommentOptions(id) {
+ $("#options_"+id).toggleClass("displayNone");
+}
+
+
+var siteurl = '';
+if ( typeof srv_site_url !== 'undefined' ) { // komentarji v izpolnjevanju ankete
+ siteurl = srv_site_url + '/admin/survey/';
+}
+
+// doda komentar in osvezi oblacek
+// type=0 : anketa, type=1 : vprasanje
+function add_comment (spremenljivka, type, view, vsebina) {
+
+ $('div#survey_comment_'+spremenljivka+'_'+view).load(siteurl+'ajax.php?t=branching&a=comment_manage', {type: type, view: view, spremenljivka: spremenljivka, vsebina: vsebina, anketa: srv_meta_anketa_id, refresh: '1'},
+ function () {
+
+ // V predogledu izpisemo samo text da je bil uspesno dodan
+ if(view == 1 && (type == 0 || type == 4)){
+ $('#comment_dropdown_test_survey').html('<div class="success">'+lang['action_note_comment_added']+'</div>');
+ }
+ // pri opciji Dodaj komentar (urejanje vprasalnika - pod vsakim vprasanjem), skrijemo oblacek po submitu
+ else if (view == 0) {
+ $(".comment_inline_popup").addClass('displayNone');
+ }
+ else if (view == 4 || view == 5) {
+ window.location.reload();
+ }
+ }
+ );
+}
+
+// nastavi podanemu linku (a.surveycomment) oblacek za komentarje
+function load_comment (__this, show) {
+ if (show == 1) { // opcije za takrat, ko je po defaultu ze na zacetku prikazan - za dodat komentar na anketo
+ _when = false;
+ _ready = true;
+ var corners = ['leftMiddle', 'leftMiddle'];
+ var opposites = ['rightMiddle', 'rightMiddle'];
+ } else if (show == 2) { // opcija za takrat, ko se aktivira preko oblacka, ko se prikaze takoj
+ _when = 'click';
+ _ready = true;
+ var corners = ['topRight', 'topRight'];
+ var opposites = ['bottomLeft', 'bottomLeft'];
+ } else { // default za normalne komentarje, da se odpre na klik
+ _when = 'click';
+ _ready = false;
+ var corners = ['topLeft', 'topRight'];
+ var opposites = ['bottomRight', 'bottomLeft'];
+ }
+
+ var width = $(document).width();
+ // nastavitve za help
+
+ // preverimo ali prikažemo tip na levo stran
+ var position = $(__this).offset(); // position = { left: 42, top: 567 }
+
+ var left = width - position.left;
+
+ var i = (left >= 350) ? 0 : 1;
+
+ if ($(__this).data("qtip")) {
+ $(__this).qtip("destroy");
+ $('div.qtip').html('');
+ }
+
+ // Posebej naslov ce smo v urejanju
+ if($(__this).attr('view') == '1' && !show && $('#comment_qtip_title').length > 0 && $(__this).attr('subtype') == undefined){
+ var naslov = $('#comment_qtip_title').val();
+ }
+ // komentar na vprasanje
+ else if($(__this).attr('subtype') == 'q_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_q_title'];
+ }
+ // komentar na if
+ else if($(__this).attr('subtype') == 'if_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_if_title'];
+ }
+ // komentarji na if
+ else if($(__this).attr('subtype') == 'if_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_if_all_title'];
+ }
+ // komentar na blok
+ else if($(__this).attr('subtype') == 'blok_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_blok_title'];
+ }
+ // komentarji na blok
+ else if($(__this).attr('subtype') == 'blok_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_blok_all_title'];
+ }
+ // komentarji na vprasanja
+ else if($(__this).attr('subtype') == 'q_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_q_all_title'];
+ }
+ // komentarji respondentov na vprasanja
+ else if($(__this).attr('subtype') == 'q_resp_all'){
+ var naslov = lang['srv_testiranje_komentar_q_resp_all_title'];
+ }
+ else{
+ var naslov = lang['srv_testiranje_komentarji_anketa_title2'];
+ }
+
+ $(__this).qtip({
+ content: {text: '<div class="qtip_comment"><h1>'+naslov+'</h1><div id="survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')+'"></div></div>', title: {button: '&#x2715;'}},
+ fixed: false, show: {when: _when, ready: _ready, solo: true},hide: {when: 'click'},
+ style: {name: 'light', border: {width: 3, radius: 8}, width: 350, tip: {corner: corners[i]}},
+ position: {corner: {tooltip: corners[i], target: opposites[i] }, adjust: {screen : true}},
+ api: {
+ beforeShow: function () {
+ // tuki se poklice zato, ker se drugace content: {url: ....} ne refresha, ce zapres in spet odpres oblacek
+ _comment = 1;
+ $('div#survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')).load(siteurl+'ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: $(__this).attr('type'), view: $(__this).attr('view'), spremenljivka: $(__this).attr('spremenljivka'), vsebina: '', anketa: srv_meta_anketa_id, refresh: '1'});
+ },
+ onShow: function () {
+ $('div.qtip').draggable();
+ }
+ }
+ });
+
+}
+var _comment = 0; \ No newline at end of file
diff --git a/admin/survey/script/conditionProfiles.js b/admin/survey/script/conditionProfiles.js
index a56c697..240aaf4 100644
--- a/admin/survey/script/conditionProfiles.js
+++ b/admin/survey/script/conditionProfiles.js
@@ -54,7 +54,7 @@ function conditionProfileAction(action) {
// dropdownu dodamo nov prodil in ga izberemo
$("#current_condition_profile").append( $("<option></option>").attr("value", newId).attr( "selected", true).text(name));
} else {
- alert('Error!');
+ genericAlertPopup('error');
}
});
@@ -106,5 +106,5 @@ function conditionProfileAction(action) {
$.post('ajax.php?t=conditionProfile&a=change_condition_profile', { anketa : srv_meta_anketa_id, pid : pid, meta_akcija : srv_meta_akcija, podstran : srv_meta_podstran, condition_label:condition_label, condition_error:condition_error }, function() {
return reloadData('condition');
});
- } else {alert('Missing action:'+action)};
+ } else {genericAlertPopup('alert_missing_action',action)};
} \ No newline at end of file
diff --git a/admin/survey/script/crosstab.js b/admin/survey/script/crosstab.js
index e2bb144..78b2ac9 100644
--- a/admin/survey/script/crosstab.js
+++ b/admin/survey/script/crosstab.js
@@ -14,12 +14,6 @@ function add_new_variable(which) {
var spr = new Array();
var grid = new Array();
- if (which == '2' ) {
- //$('#crossRightHolder #crosstab_add_new').hide();
- } else {
- //$('#crossLeftHolder #crosstab_add_new').hide();
- }
-
$('select[name=crosstab_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
@@ -32,19 +26,17 @@ function add_new_variable(which) {
$.post("ajax.php?t=crosstab&a=add_new_variable", {anketa:srv_meta_anketa_id, which:which, sequence:sequence, spr:spr, grid:grid, crossNavVsEno:crossNavVsEno}, function(response) {
if (which == '2' ) {
- $(response).appendTo('#crossRightHolder');
+ $(response).appendTo('#crossRightDropdowns');
} else {
- $(response).appendTo('#crossLeftHolder');
+ $(response).appendTo('#crossLeftDropdowns');
}
});
}
function crs_remove_variable(what) {
- $(what).parent().remove();
- if ( $(what).parent().find('select').val() > 0 ) {
- change_crosstab();
- }
+ $(what).parent().parent().remove();
+ change_crosstab();
}
function change_crosstab (action) {
@@ -108,7 +100,7 @@ function change_crosstab (action) {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
$("#crosstab_drobdowns").load("ajax.php?t=crosstab&a=changeDropdown", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
spr1:spr1, spr2:spr2 , crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2}, function() {
if (isNaN(spr1) && isNaN(spr2)) {
@@ -117,7 +109,7 @@ function change_crosstab (action) {
});
} else {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
}
});
@@ -125,7 +117,7 @@ function change_crosstab (action) {
function change_crosstab_cb () {
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
// prebereomo dropdown variabli
@@ -149,12 +141,12 @@ function change_crosstab_cb () {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
- $("#crosstab_table").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
+ $("#crosstab_tables").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
//crossChk0:crossChk0, crossChk1:crossChk1, crossChk2:crossChk2, crossChk3:crossChk3,
//crossChkEC:crossChkEC, crossChkRE:crossChkRE,crossChkSR:crossChkSR,crossChkAR:crossChkAR, doColor:doColor,
spr1:spr1, spr2:spr2, crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2 }, function () {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
});
}
@@ -203,20 +195,20 @@ function doInspectFromCrosstab(el,event) {
function doArchiveCrosstab() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function createArchiveCrosstabBeforeEmail() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -230,9 +222,9 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -240,13 +232,13 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveCrosstabs() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -263,7 +255,7 @@ function submitArchiveCrosstabs() {
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
diff --git a/admin/survey/script/customizeImageView.js b/admin/survey/script/customizeImageView.js
index fd8fb41..7969324 100644
--- a/admin/survey/script/customizeImageView.js
+++ b/admin/survey/script/customizeImageView.js
@@ -119,7 +119,7 @@ function customizeImageView4Respondent(tip, spremenljivka, vre_id, ajax, anketa,
}
//ureditev visine kategorije (div) glede na prisotnost slike ali vecvrsticnega teksta **************************************************
- var default_cat_height = 15;
+ var default_cat_height = 30;
var final_height = 0;
//var cat_text_length = $('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).text().length; //hrani stevilo znakov, ki so vpisani v trenutni kategoriji odgovora
var cat_text_length = $('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).html().length; //hrani stevilo znakov, ki so vpisani v trenutni kategoriji odgovora
@@ -222,6 +222,7 @@ function customizeImageView4Respondent(tip, spremenljivka, vre_id, ajax, anketa,
if (final_height != 0){
$('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).css({'height':final_height}); //dodaj style atributu še novo višino za levi blok
}
+ //console.log(final_height);
//ureditev visine kategorije (div) glede na prisotnost slike ali vecvrsticnega teksta - konec********************************************
//ureditev visine celotnega vprasanja****************************************************************************************************
@@ -274,6 +275,23 @@ function question_height_ranking(spremenljivka){
//console.log("final_height: "+final_height);
}
+function frame_height_ranking (ui, spremenljivka){
+ var trenutna_visina_prenesenega = ui.item.height();
+ console.log(trenutna_visina_prenesenega);
+ //console.log('drugo');
+ var trenutni_okvir = $('#half2_'+spremenljivka);
+ var stevilo_prisotnih = trenutni_okvir.children('div').length;
+ console.log(stevilo_prisotnih);
+ var i = 0;
+ trenutni_okvir.siblings().children('li').children('div').each(function(){ //preleti prazne okvirje
+ i = i + 1;
+ if(stevilo_prisotnih == i){
+ $(this).height(trenutna_visina_prenesenega);
+ //console.log(i);
+ }
+ });
+}
+
function frame_height_ranking_premikanje_dyn (ui, spremenljivka){
var trenutna_visina_prenesenega = ui.item.height();
var trenutni_okvir = $('#sortzone_'+spremenljivka);
diff --git a/admin/survey/script/dataSettingProfiles.js b/admin/survey/script/dataSettingProfiles.js
index df3c624..0b79cb1 100644
--- a/admin/survey/script/dataSettingProfiles.js
+++ b/admin/survey/script/dataSettingProfiles.js
@@ -139,7 +139,7 @@ function dataSettingProfileAction(action) {
var chartPieZeros = $("#chartPieZeros").is(':checked') ? '1' : '0';
var hideEmpty = $("#hideEmpty").is(':checked') ? '1' : '0';
var hideAllSystem = $("#hideAllSystem").is(':checked') ? '1' : '0';
- var numOpenAnswers = $("#numOpenAnswers").val();
+ var numOpenAnswers = $("#dsp_content #numOpenAnswers").val();
// var enableInspect = $('input[name="enableInspect"]:checked').val();
var dataPdfType = $('#dataPdfType').val();
var exportDataNumbering = $("#exportDataNumbering").is(':checked') ? '1' : '0';
@@ -157,7 +157,7 @@ function dataSettingProfileAction(action) {
var dataShowIcons = $('input[name="dataShowIcons"]:checked').val();
var analysisGoTo = $('#analysisGoTo').val();
var analiza_legenda = $("#analiza_legenda").is(':checked') ? '1' : '0';
-
+
$.post("ajax.php?t=dataSettingProfile&a=saveProfile", {anketa:srv_meta_anketa_id, pid:pid, dsp_ndp:dsp_ndp, dsp_nda:dsp_nda, dsp_ndd:dsp_ndd, dsp_res:dsp_res, dsp_sep:dsp_sep,
crossChk0:crossChk0, crossChk1:crossChk1, crossChk2:crossChk2, crossChk3:crossChk3,
crossChkEC:crossChkEC, crossChkRE:crossChkRE, crossChkSR:crossChkSR, crossChkAR:crossChkAR, doColor:doColor, doValues:doValues,
@@ -171,7 +171,7 @@ function dataSettingProfileAction(action) {
return reloadData('dataSetting');
});
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
return false;
}
}
diff --git a/admin/survey/script/datatables/jquery.dataTables.min.css b/admin/survey/script/datatables/jquery.dataTables.min.css
index 2e710c3..ea45ffe 100644
--- a/admin/survey/script/datatables/jquery.dataTables.min.css
+++ b/admin/survey/script/datatables/jquery.dataTables.min.css
@@ -1 +1 @@
-table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
+table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
diff --git a/admin/survey/script/datepicker.js b/admin/survey/script/datepicker.js
index 8fc4a10..ca340fc 100644
--- a/admin/survey/script/datepicker.js
+++ b/admin/survey/script/datepicker.js
@@ -17,8 +17,6 @@ function datepicker (selector, event_trigger, datetime) {
dateFormat: "dd.mm.yy",
showAnim: "slideDown",
showOn: "button",
- /*buttonImage: srv_site_url + "admin/survey/script/calendar/calendar.gif",
- buttonImageOnly: true,*/
buttonText: "",
controlType: 'select',
oneLine: true,
@@ -42,9 +40,7 @@ function datepicker (selector, event_trigger, datetime) {
changeYear: true,
dateFormat: "dd.mm.yy",
showAnim: "slideDown",
- showOn: "button",
- /*buttonImage: srv_site_url + "admin/survey/script/calendar/calendar.gif",*/
- /*buttonImageOnly: true,*/
+ showOn: "both",
buttonText: "",
onSelect: function(selected,evnt) {
if (event_trigger) {
diff --git a/admin/survey/script/domainChange.js b/admin/survey/script/domainChange.js
new file mode 100644
index 0000000..2ab3f90
--- /dev/null
+++ b/admin/survey/script/domainChange.js
@@ -0,0 +1,28 @@
+
+// Prikaz popupa za preklop domene
+function popupSwitch() {
+
+ $('#fade').fadeTo('slow', 1);
+ $("#popup_user_access").load('ajax.php?t=domainChange&a=displaySwitchPopup');
+ $("#popup_user_access").show();
+}
+
+// Prikaz popupa za preklop domene - zapri
+function popupSwitch_close() {
+
+ $("#popup_user_access").html().hide();
+ $('#fade').fadeOut('slow');
+}
+
+//
+function popupSwitch_save(switch_status){
+
+ $.post('ajax.php?t=domainChange&a=setSwitchStatus', {switch_status:switch_status}, function (response) {
+
+ var data = JSON.parse(response);
+
+ if(data['action'] == 'switch_domain'){
+ window.location = data['url'];
+ }
+ });
+} \ No newline at end of file
diff --git a/admin/survey/script/dostop.js b/admin/survey/script/dostop.js
index 95c634b..f16083f 100644
--- a/admin/survey/script/dostop.js
+++ b/admin/survey/script/dostop.js
@@ -326,7 +326,7 @@ $(document).ready(function () {
},
fnInitComplete : function() {
if ($(this).find('tbody tr td').hasClass('dataTables_empty')) {
- $(this).parent().parent().hide();
+ //$(this).parent().parent().hide();
}
}
});
diff --git a/admin/survey/script/folders.js b/admin/survey/script/folders.js
index bafbac3..5cb69b3 100644
--- a/admin/survey/script/folders.js
+++ b/admin/survey/script/folders.js
@@ -102,7 +102,7 @@ function folders_myknjiznica (anketa) {
function language_change (lang) {
$.post('ajax.php?t=surveyList&a=language_change', {lang: lang}, function () {
- /*window.location.reload();*/
- window.location = window.location.href.split("?")[0];
+ window.location.reload();
+ //window.location = window.location.href.split("?")[0];
});
} \ No newline at end of file
diff --git a/admin/survey/script/inspect.js b/admin/survey/script/inspect.js
index 304d9c7..e8088f6 100644
--- a/admin/survey/script/inspect.js
+++ b/admin/survey/script/inspect.js
@@ -6,7 +6,7 @@ function inspect_init() {
//});
$('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=inspect&a=show_inspectListSpr', {anketa : srv_meta_anketa_id}).addClass('z-index200');
+ $("#fullscreen").load('ajax.php?t=inspect&a=show_inspectListSpr', {anketa : srv_meta_anketa_id}).addClass('z-index200').addClass('popupShadow');
});
$("#dsp_inspect_cancel").live('click', function(event) {
diff --git a/admin/survey/script/invitations.js b/admin/survey/script/invitations.js
index 05d2a56..71c36f6 100644
--- a/admin/survey/script/invitations.js
+++ b/admin/survey/script/invitations.js
@@ -19,6 +19,7 @@ function inv_delete_recipient() {
}
function editRecipient(inv_rid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_recipient', {anketa:srv_meta_anketa_id, inv_rid:inv_rid,noNavi:'true'});
}
@@ -61,7 +62,7 @@ function inv_change_import_type() {
}
function toggleInvCheckbox(what) {
var id = $(what).attr("id");
-
+
if ( $(what).is(":checked") ) {
$(what).parent().addClass('inv_field_enabled');
}
@@ -77,7 +78,7 @@ function refreshFieldsList() {
var fields_id = '';
var prefix = '';
var pass_field = false;
-
+
$('ul').children('li.inv_field_enabled').each(function(idx, elm) {
fields = fields + prefix + $(elm).find('label').html();
fields_id = fields_id + prefix + $(elm).attr('id');
@@ -116,7 +117,7 @@ function inv_save_rec_profile() {
inv_add_recipients(data.pid);
} else {
// prikažemo profil
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
}
});
@@ -129,7 +130,7 @@ function inv_update_rec_profile() {
var pid = $('#inv_recipients_profile_name').find('#rec_profile_pid').val();
var profile_name = $('#inv_recipients_profile_name').find('#rec_profile_name').val();
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post('ajax.php?t=invitations&a=update_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, profile_name:profile_name, noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
@@ -137,11 +138,11 @@ function inv_update_rec_profile() {
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
// osvežimo polja
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
} else {
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
}
});
}
@@ -163,17 +164,17 @@ function inv_add_recipients(profile_id) {
});
if (fields.length > 0) {
if (recipients_list.length > 0) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
// porihtamo še navigacijo - hardcoded
$elm = $("ul.secondNavigation li.inv_ff_left_on");
$elm.prev().find('a').removeClass('active');
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -210,7 +211,7 @@ function inv_save_recipient() {
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.error_email == '1') {
$("#rec_email").addClass('inv_input_error');
}
@@ -238,27 +239,29 @@ function inv_filter_recipients() {
$("#globalSettingsInner").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
else{
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
});
}
function inv_add_rec_to_db() {
$('#fade').fadeTo('slow', 1);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
$('#fade').fadeOut('slow');
});
}
function recipientsProfileOnlyThisSurvey() {
- //var checked = $("#inv_rec_only_this_survey").is(":checked");
+
var checked = $('input[name=inv_show_list_type]:checked').val() == 1 ? true : false;
+
$.post('ajax.php?t=invitations&a=only_this_survey', {anketa:srv_meta_anketa_id, checked:checked, noNavi:'true'}, function(data) {
var pid = $("#inv_import_list_profiles ol li.active").attr('pid');
if (pid == 'undefined') {
pid = '-1';
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
});
}
@@ -468,11 +471,10 @@ function invitations_init() {
// izbira obstoječega profila prejemnikov
$("#inv_import_list_profiles ol li").live('click', function(event) {
-
- var target = $(event.target);
- var pid = $(target).attr('pid');
+
+ var pid = $(this).attr('pid');
if (pid != 'undefined') {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
}
});
@@ -499,7 +501,7 @@ function invChangeMessage(mid) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=make_default',
+ $("#anketa_edit").load('ajax.php?t=invitations&a=make_default',
{anketa:srv_meta_anketa_id, mid:mid },
function(){
if (!CKEDITOR.instances) {
@@ -510,12 +512,18 @@ function invChangeMessage(mid) {
}
function invMessageDelete() {
+
var mid = $("#invitation_messages ol li.active").attr("mid");
- if (confirm(lang['srv_inv_recipients_delete_profile_confirm'])) {
+
+ if (confirm(lang['srv_inv_recipients_delete_message_confirm'])) {
+
if(CKEDITOR.instances['inv_message_body']) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ event.stopPropagation();
}
}
@@ -523,6 +531,7 @@ function invShowMessageRename() {
// prikažemo popup za preimenovanje
var mid = $("#invitation_messages ol li.active").attr("mid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=show_message_rename', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
@@ -555,12 +564,17 @@ function invMessageRename() {
}
);
}
+
+// najprej dodatno poeditiramo sporočilo
function inv_message_save_advanced(mid) {
- // najprej dodatno poeditiramo sporočilo
+
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
+
$("#fullscreen").load('ajax.php?t=invitations&a=edit_message_details', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
+
function inv_message_save_forward(mid) {
//v kolikor je CKEditor vklopljen potem, ga odstranimo pred skranjevanjem
if(CKEDITOR.instances['inv_message_body']){
@@ -586,7 +600,7 @@ function inv_message_save_forward(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward',
{
@@ -610,7 +624,7 @@ function inv_message_save_forward(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_¸ge_replyto").css({
'border' : '1px solid red'
@@ -651,7 +665,7 @@ function inv_message_save_forward_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward_noEmail',
{
@@ -674,7 +688,7 @@ function inv_message_save_forward_noEmail(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -712,7 +726,7 @@ function inv_message_save_simple(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple',
{
@@ -725,15 +739,17 @@ function inv_message_save_simple(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('inv_message_body', true);
data = jQuery.parseJSON(data);
+
if (data.error == 0) {
return true;
- }else {
+ }
+ else {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_messge_replyto").css({
'border' : '1px solid red'
@@ -773,7 +789,7 @@ function inv_message_save_simple_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple_noEmail',
{
@@ -785,7 +801,7 @@ function inv_message_save_simple_noEmail(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('', true)
data = jQuery.parseJSON(data);
if (data.error == 0) {
return true;
@@ -793,7 +809,7 @@ function inv_message_save_simple_noEmail(mid) {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -843,7 +859,7 @@ function inv_message_save_details() {
window.location.reload()
} else {
// so napake
- alert (' '+data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
}
);
@@ -860,100 +876,6 @@ function inv_new_message_list_change(what) {
}
}
-/*
-function edit_message_save(mid) {
- // shranimo v mid
- var replyto = $("#inv_message_replyto").val();
- var subject = $("#inv_message_subject").val();
- var body = $("#inv_message_body").val();
- var profile_comment = $("#inv_message_comment").val();
- var quickSave = true;
- if (!mid || mid == 'undefined') {
- mid = $("#inv_recipients_profile_name select").val();
- quickSave = false;
- }
- var naslov = $("#rec_profile_name").val();
- var old_mid = $("#invitation_messages ol li.active").attr('mid');
- // resetiramo morebitne prejšne napake
- $("#inv_message_replyto").css({
- 'border' : 'none'
- });
- $("#inv_message_subject").css({
- 'border' : 'none'
- });
- $("#inv_message_body").css({
- 'border' : 'none'
- });
-
- $("#inv_error_note").addClass('hidden');
-
- $.post(
- 'ajax.php?t=invitations&a=save_message',
- {
- anketa : srv_meta_anketa_id,
- mid : mid,
- old_mid:old_mid,
- quickSave:quickSave,
- replyto : replyto,
- subject : subject,
- body : body,
- noNavi : 'true',
- profile_comment : profile_comment,
- naslov:naslov
- },
- function(data) {
- data = jQuery.parseJSON(data);
- if (data.error == "0") {
- // redirektamo na pošiljanje
- //var href = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=send_message';
- //window.location = href;
- window.location.reload()
- } else {
- // skrijemo okno in
- $('#fade').fadeOut('slow');
- $('#fullscreen').fadeOut('slow').html('')
- // prikažemo obvestilo o napaki
- $("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
- if (data.inv_message_replyto == '1') {
- $("#inv_message_replyto").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_subject == '1') {
- $("#inv_message_subject").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_body == '1') {
- $("#inv_message_body").css({
- 'border' : '1px solid red'
- });
- }
- }
- });
-
- return false;
-
-}
-
-function invSendMail() {
- var send_type = $('input[name=mailto]:checked').val();
- var prefix = "";
- var checkboxes = "";
-
- $('input[name="mailto_status[]"]:checked').each(function(el) {
- checkboxes = checkboxes+prefix+$(this).val();
- prefix = ",";
- });
-
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
-
- $("#fullscreen").load('ajax.php?t=invitations&a=check_send_mail',{anketa:srv_meta_anketa_id, noNavi:'true', send_type:send_type, checkboxes:checkboxes});
-
-};
-*/
function inv_del_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
@@ -970,7 +892,7 @@ function inv_del_rec_profile() {
var new_pid = $("#inv_import_list_profiles ol li").first().next().attr('pid');
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
});
}
}
@@ -979,12 +901,13 @@ function inv_edit_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
function inv_prepare_add_recipients() {
- alert('Deprecated!');
+ genericAlertPopup('alert_deprecated');
return false;
}
@@ -1005,10 +928,10 @@ function inv_recipients_add_to_list() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=get_profile_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', doAdd:doAdd});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1064,7 +987,10 @@ function invTogleSend(what) {
}
}
-function inv_selectAll(val){
+function inv_selectAll(checkbox){
+
+ val = $(checkbox).is(':checked');
+
// oznacimo vse checkboxe
$('#tbl_recipients_list tr td input[type="checkbox"]').each(function() {
$(this).attr("checked", val);
@@ -1073,32 +999,33 @@ function inv_selectAll(val){
if(val == true){
$("#inv_switch_on").hide();
$("#inv_switch_off").show();
- } else{
+ }
+ else{
$("#inv_switch_off").hide();
$("#inv_switch_on").show();
}
}
function inv_list_selectAll(val){
- $(document).ready(function(){
- if(val == true){
- $('.test_checkAll').each(function(){
- this.checked = true;
- })
- $("#inv_switch_on").hide();
- $("#inv_switch_off").show();
- }else{
- $('.test_checkAll').each(function(){
- this.checked = false;
- })
- $("#inv_switch_on").show();
- $("#inv_switch_off").hide();
- }
- });
+
+ if(val == true){
+ $('.test_checkAll').each(function(){
+ this.checked = true;
+ })
+ $("#inv_switch_on").hide();
+ $("#inv_switch_off").show();
+ }
+ else{
+ $('.test_checkAll').each(function(){
+ this.checked = false;
+ })
+ $("#inv_switch_on").show();
+ $("#inv_switch_off").hide();
+ }
}
function inv_recipients_form_action(action) {
-
+
var recipents = $('#tbl_recipients_list input[name="inv_rids[]"]:checked');
if (action == 'delete') {
@@ -1116,9 +1043,9 @@ function inv_recipients_form_action(action) {
$.post('ajax.php?t=invitations&a=delete_recipient_all', {anketa:srv_meta_anketa_id,noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
if (data.success == 1) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
} else {
- alert(data.error);
+ genericAlertPopup('alert_parameter_dataerror',data.error);
}
});
}
@@ -1132,6 +1059,13 @@ function inv_recipients_form_action(action) {
return false;
}
+ else if (action == 'export_qr_codes') {
+ $("#frm_inv_rec_export").attr("action", "ajax.php?t=invitations&a=export_recipients_qr_codes");
+ $("#frm_inv_rec_export").attr("target", "_blank");
+ $('#frm_inv_rec_export').submit();
+
+ return false;
+ }
else if (action == 'export') {
// imamo akcijo izvozi
//če je kak izbran izvozimo tistega, če ne pa izberemo vse in izvozimo vse
@@ -1186,7 +1120,7 @@ function inv_recipients_list_action(action){
url: "ajax.php?t=invitations&a=deleteRecipientsListMulti",
success: function(data){
//console.log("Tle pride");
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
}
});
}
@@ -1242,7 +1176,7 @@ function edit_message_save(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message',
@@ -1271,7 +1205,7 @@ function edit_message_save(mid) {
$('#fullscreen').fadeOut('slow').html('')
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_message_replyto").css({
'border' : '1px solid red'
@@ -1328,10 +1262,12 @@ function showRecipientTracking(rid) {
function changeInvRecListCheckbox() {
var pids = "";
var prefix = "";
+
$('#inv_edit_rec_list table tr td input:checked').each(function(idx, elm) {
pids = pids + prefix + $(elm).attr('value');
prefix = ',';
});
+
var onlyThisSurvey = $('input[name=inv_show_list_type]:checked').val();
$("#inv_selected_rec_list").load('ajax.php?t=invitations&a=editRecList', {anketa:srv_meta_anketa_id,noNavi:'true',pids:pids, onlyThisSurvey:onlyThisSurvey});
@@ -1372,6 +1308,7 @@ $("#inv_edit_rec_list table tr td").live('click', function(event) {
*/
function inv_list_edit(pid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=invListEdit', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
@@ -1399,10 +1336,10 @@ function inv_list_get_name(saveNew) {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=list_get_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid, saveNew:saveNew});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1420,8 +1357,8 @@ function inv_list_save() {
var recipients_list = $("#inv_prof_recipients_list").val();
var field_list = $("#inv_prof_field_list").val();
var saveNew = ($("#saveNew").val() == 'true') ? 'true': 'false';
- alert(profile_name);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
+ genericAlertPopup('alert_parameter_profilename',profile_name);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1430,7 +1367,7 @@ function inv_list_edit_save() {
form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
form_serialize[form_serialize.length] = {name:'noNavi', value:'true'}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1444,14 +1381,14 @@ function inv_list_save_old(profile_id) {
var rec_profile_name = $("#rec_profile_name").val();
var rec_profile_comment = $("#rec_profile_comment").val();
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
function deleteRecipientsList_confirm(id) {
if (confirm(lang['srv_inv_recipients_delete_list_confirm'])) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
}
}
@@ -1517,10 +1454,10 @@ function inv_upload_list_check() {
if (extension == 'txt' || extension == 'csv') {
$('#inv_recipients_upload_form').submit();
} else {
- alert("Nepravilna vrsta datoteke!");
+ genericAlertPopup('alert_incorrect_filetype');
}
} else {
- alert("Izberite datoteko!");
+ genericAlertPopup('alert_choose_file');
}
}
@@ -1554,7 +1491,7 @@ function mailSourceMesageChange(what) {
function inv_set_sort_field(field,type) {
$.post('ajax.php?t=invitations&a=setSortField', {anketa:srv_meta_anketa_id,noNavi:'true', field:field,type:type}, function() {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
});
}
@@ -1650,16 +1587,18 @@ function invRecipientsForward() {
if (recipients_list.length > 0)
{
// shranimo seznam ali dodamo respondente ali oboje
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
- }
+ $("#anketa_edit").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ /*$.post('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ window.location = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=view_recipients';*/
+ }
else
{
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
}
else
{
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1688,7 +1627,7 @@ function invitationSetCondition(cid)
$('#fullscreen').fadeOut('slow').html('');
$('#fade').fadeOut('slow');
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
}
function noEmailingToggle(value){
@@ -1715,28 +1654,20 @@ function noEmailingType(value){
function smtpAAIPopupShow(){
$('#fade').fadeTo('slow', 1);
- $('#popup_note').html('').fadeIn('slow');
- $("#popup_note").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
}
function smtpAAIPopupClose(){
// Ni sprejel - vrnemo radio
$('input[name=SMTPMailMode][value=2]').prop('checked', true);
- $('#popup_note').fadeOut('slow').html('');
- $('#fade').fadeOut('slow');
+ popupClose();
}
function smtpAAISet(){
// Shranimo formo
$("form[name='settingsanketa_"+srv_meta_anketa_id+"']").submit();
-
- // Prikazemo nastavitve za Arnes smtp
- /*$('#send_mail_mode1, #send_mail_mode2').hide();
- $('#send_mail_mode0').show();
-
- // Zapremo popup
- smtpAAIPopupClose();*/
}
function smtpAAIAccept(){
@@ -1751,13 +1682,30 @@ function smtpAAIAccept(){
function squaloSwitch(){
if($('#squalo_mode').prop('checked')){
- $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').hide();
+ $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').addClass('displayNone');
$('#success_save').hide();
}
else{
- $('.squalo_settings').hide();
- $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').show();
+ $('.squalo_settings').addClass('displayNone');
+ $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').removeClass('displayNone');
$('#success_save').hide();
}
}
+// Sortiranje box-ov pri dodajanju respondentov
+function initInvitationsConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ refreshFieldsList();
+ },
+ forcePlaceholderSize:'true',
+ tolerance:'pointer',
+ placeholder:'inv_field_placeholder',
+ cancel:'#inv_field_relation'
+ });
+}
diff --git a/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js b/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
index 1a1ca5d..21bcdb8 100644
--- a/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
+++ b/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
@@ -12,6 +12,11 @@
* @author Krzysztof Suszyński <k.suszynski@wit.edu.pl>
**/
jQuery.fn.selectbox = function(options){
+
+ // Na mobitelu pustimo vedno default dropdowne
+ if ($('.mobile_header:visible').length != 0)
+ return;
+
/* Default settings */
var settings = {
className: 'jquery-selectbox',
@@ -159,7 +164,7 @@ jQuery.fn.selectbox = function(options){
jQuery('.'+settings.className + '-currentItem', replacement).text(v.text());
}
});
- replacement.find('.' + settings.className + '-moreButton').click(function(){
+ replacement.find('.'+settings.className+'-moreButton, .'+settings.className+'-currentItem').click(function(){
var thisMoreButton = jQuery(this);
var otherLists = jQuery('.' + settings.className + '-list')
.not(thisMoreButton.siblings('.' + settings.className + '-list'));
diff --git a/admin/survey/script/js-lang.php b/admin/survey/script/js-lang.php
index ab71fd3..6493ba1 100644
--- a/admin/survey/script/js-lang.php
+++ b/admin/survey/script/js-lang.php
@@ -108,6 +108,7 @@ lang('srv_disable');
lang('srv_if_new');
lang('srv_if_new_question');
lang('srv_chart_edit_warning');
+lang('srv_inv_recipients_delete_message_confirm');
lang('srv_inv_recipients_delete_profile_confirm');
lang('srv_inv_recipients_delete_list_confirm');
lang('srv_inv_recipients_delete_multi');
@@ -115,6 +116,7 @@ lang('srv_inv_recipients_delete_all');
lang('srv_inv_list_delete_multi');
lang('save');
lang('srv_new_vrednost');
+lang('srv_new_vrednost_grid');
lang('srv_analiza_arhiviraj');
lang('srv_success_save');
lang('srv_invitation_note1');
@@ -126,6 +128,8 @@ lang('srv_novavrednost_drugo');
lang('srv_unlock_alert');
lang('srv_custom_report_first');
lang('srv_ask_delete');
+lang('srv_ask_delete_data');
+lang('srv_ask_delete_multiple_data');
lang('srv_brisivrednostconfirm');
lang('srv_brisivrednost');
lang('srv_incremental_hs1');
@@ -146,22 +150,6 @@ lang('srv_advanced_slideshow');
lang('srv_urlLinks_delete');
lang('srv_zapri');
lang('srv_remind_preview');
-lang('srv_language_technology_flagged_wordings');
-lang('srv_language_technology_wording_properites');
-lang('srv_language_technology_wording');
-lang('srv_language_technology_freguency');
-lang('srv_language_technology_word_type');
-lang('srv_language_technology_word_type');
-lang('srv_language_technology_meanings');
-lang('srv_language_technology_noun');
-lang('srv_language_technology_verb');
-lang('srv_language_technology_adjective');
-lang('srv_language_technology_adverb');
-lang('srv_language_technology_existential');
-lang('srv_language_technology_relevant_meanings');
-lang('srv_language_technology_alternative_wordings');
-lang('srv_language_technology_no_alternative');
-lang('srv_language_technology_no_alternative_selected');
lang('srv_aapor_automatic');
lang('edit_hide');
lang('edit_show');
@@ -193,6 +181,21 @@ lang('srv_alert_upload_ext');
lang('srv_trans_lang');
lang('srv_manager_remove_alert');
lang('srv_resevanje_foto_pre_result');
+lang('srv_vrednost_correct');
+lang('srv_editor_title');
+lang('srv_comments_new');
+lang('srv_comment_comment');
+lang('edit1338');
+lang('for');
+lang('alternative_email_delete');
+lang('srv_anketa_deleted_restore_confirm');
+lang('srv_data_deleted_restore_confirm');
+lang('more2');
+lang('less2');
+lang('srv_concl_deactivation_text_edit');
+lang('action_note_comment_added');
+lang('srv_comments_archive');
+lang('srv_comments_unarchive');
//LOKACIJA
diff --git a/admin/survey/script/library.js b/admin/survey/script/library.js
index e679d84..054395e 100644
--- a/admin/survey/script/library.js
+++ b/admin/survey/script/library.js
@@ -7,43 +7,33 @@ var srv_meta_branching = $("#srv_meta_branching").val();
// poklice se iz htmlja ob prikazu librarija (init)
function library () {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
// nardimo ankete, vprasanja draggable
- $('div#libraryInner div.folder_container, div.anketa_vprasanja span').draggable({opacity:'0.5', zIndex:'50', helper: 'clone', appendTo: 'body', distance:5});
+ //$('div#libraryInner div.folder_container, div.anketa_vprasanja span').draggable({opacity:'0.5', zIndex:'50', helper: 'clone', appendTo: 'body', distance:5});
// nardimo folderje draggable
- //if (!$.browser.msie) { // ne dela zaradi nestable draggables buga
- $('div#libraryInner ul.can_edit li.folder').draggable({revert: 'invalid', opacitiy:'0.5', zIndex:'1', handle:'.movable', distance:5});
- //}
+ $('div#libraryInner ul.can_edit li.folder.can_drag, div#libraryInner li.anketa.can_drag').draggable({
+ revert: 'invalid',
+ opacitiy: '0.5',
+ zIndex: '1',
+ handle: '.movable',
+ distance: 5,
+ handle: '.folder_box, folder_container'
+ });
// nardimo folderje droppable
- //$('div#libraryInner .folderdrop').droppable({accept: '.folder_container, ul .folder, .branch', hoverClass: 'grupahover', tolerance: 'pointer',
- $('div#libraryInner ul.can_edit .folderdrop').droppable({accept: 'ul.can_edit .folder_container, ul.can_edit .folder, .branch, .spr, .if, .block', hoverClass: 'grupahover', tolerance: 'pointer',
+ $('div#libraryInner ul.can_edit .folderdrop').droppable({
+ hoverClass: 'folderhover',
+ tolerance: 'pointer',
drop: function (e, ui) {
- if ($(ui.draggable).attr('name') == 'folder') { // premikanje folderjev v librariju
-
- $('#libraryInner').load('ajax.php?t=library&a=folder_dropped', {drop: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else if ($(ui.draggable).attr('name') == 'library') { // premikanje spremenljivk
-
- $('#libraryInner').load('ajax.php?t=library&a=spr_dropped', {spremenljivka: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else if ($(ui.draggable).attr('name') == 'library_if') { // premikanje ifov
-
- $('#libraryInner').load('ajax.php?t=library&a=if_dropped', {'if': $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else { // dodajanje v library (karkoli ze pac je - spr, if, blok)
-
- $.post('ajax.php?t=library&a=library_add', {spremenljivka: $(ui.draggable).attr('id'), folder: $(this).attr('eid'), tab: lib_tab, anketa: srv_meta_anketa_id}, function(data) {
-
- $('#libraryInner').html(data.folders);
- $('#clipboard').html(data.response).show().delay('3000').slideUp();
-
- }, 'json');
- refreshLeft();
-
+ // premikanje folderjev v librariju
+ if ($(ui.draggable).attr('name') == 'folder') {
+ $('#libraryInner').load('ajax.php?t=library&a=folder_dropped', {drop: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab});
+ }
+ // premikanje anket
+ else if ($(ui.draggable).attr('name') == 'library') {
+ $('#libraryInner').load('ajax.php?t=library&a=spr_dropped', {spremenljivka: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab});
}
}
});
@@ -62,11 +52,6 @@ function library () {
}
-function library_spremenljivka_new (spremenljivka) {
- $('html, body').animate({scrollTop: $('body').height()+$('#branching').height()});
- spremenljivka_new(0, 0, 1, spremenljivka);
-}
-
function library_if_new (copy) {
$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()});
if_new(0, 0, 1, '0', copy);
@@ -102,36 +87,44 @@ function folder_rename (folder) {
}
function library_folder_newname (folder) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=folder_newname', {folder: folder, naslov: $('#naslov_'+folder).attr('value'), tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=folder_newname', {folder: folder, naslov: $('#naslov_'+folder).attr('value'), tab: lib_tab});
}
function library_new_folder (folder, uid) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=new_folder', {folder: folder, uid: uid, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=new_folder', {folder: folder, uid: uid, tab: lib_tab});
}
function library_delete_folder (folder) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=delete_folder', {folder: folder, tab: lib_tab, prva: lib_prva});
+
+ $('#libraryInner').load('ajax.php?t=library&a=delete_folder', {folder: folder, tab: lib_tab});
}
+// Prikaz vec na tri pikice
+function library_show_more(ank_id){
+
+ if($('#library_more_box_'+ank_id).hasClass('displayNone')){
+ $('.library_more_box').addClass('displayNone');
+ $('#library_more_box_'+ank_id).removeClass('displayNone');
+ }
+ else{
+ $('.library_more_box').addClass('displayNone');
+ }
+}
+
function library_del_anketa (anketa, text) {
if (confirm(text)) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=library_del_anketa', {anketa: anketa, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=library_del_anketa', {anketa: anketa, tab: lib_tab});
}
}
function library_del_myanketa (anketa, text) {
if (confirm(text)) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=library_del_myanketa', {anketa: anketa, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=library_del_myanketa', {anketa: anketa, tab: lib_tab});
}
}
@@ -143,14 +136,9 @@ function add_to_my_library () {
}
-function anketa_copy (ank_id, text) {
- var lib_prva = $("input#lib_prva").val();
- if (lib_prva == 1 ) {
- var naslov = $("#novaanketa_naslov").val();
- $.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id: ank_id, naslov: naslov});
- } else {
- $.redirect('ajax.php?t=library&a=anketa_copy', {anketa:srv_meta_anketa_id, ank_id: ank_id});
- }
+function anketa_copy (ank_id) {
+ var naslov = $("#novaanketa_naslov").val();
+ $.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id: ank_id, naslov: naslov});
}
function anketa_copy_top (ank_id, hierarhija) {
@@ -162,25 +150,21 @@ function anketa_copy_top (ank_id, hierarhija) {
}
function library_folders_plusminus (folder) {
+
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
var sortable_if = document.getElementById('folder_'+folder).style;
if (sortable_if.display != "none") {
-
- $('#folder_'+folder).slideUp();
-
- //$('#f_pm_'+folder).html('<img src="img/plus.png" class="folder_plusminus" style="width:12px; height:12px">');
-
- $('#f_pm_'+folder).load('ajax.php?t=library&a=folder_collapsed', {collapsed: 1, folder: folder, tab: lib_tab, prva:lib_prva});
-
- } else {
-
- $('#folder_'+folder).slideDown();
-
- //$('#f_pm_'+folder).html('<img src="img/minus.png" class="folder_plusminus" style="width:12px; height:12px">');
-
- $('#f_pm_'+folder).load('ajax.php?t=library&a=folder_collapsed', {collapsed: 0, folder: folder, tab:lib_tab, prva:lib_prva});
+ $('#folder_'+folder).slideUp();
+ $('#li'+folder).find('> .folder_box_holder > .folder_box').removeClass('open');
+
+ $.post('ajax.php?t=library&a=folder_collapsed', {collapsed: 1, folder: folder, tab: lib_tab});
+ }
+ else {
+ $('#folder_'+folder).slideDown();
+ $('#li'+folder).find('> .folder_box_holder > .folder_box').addClass('open');
+
+ $.post('ajax.php?t=library&a=folder_collapsed', {collapsed: 0, folder: folder, tab:lib_tab});
}
}
@@ -211,10 +195,9 @@ function library_if_remove (_if) {
// izbrise spremenljivko iz knjiznice
function library_brisi_spremenljivko (spremenljivka, text) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
if (confirm(text)) {
- $('#libraryInner').load('ajax.php?t=library&a=brisi_spremenljivko', {spremenljivka: spremenljivka, grupa: srv_meta_grupa, anketa: srv_meta_anketa_id, branching: srv_meta_branching, tab:lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=brisi_spremenljivko', {spremenljivka: spremenljivka, grupa: srv_meta_grupa, anketa: srv_meta_anketa_id, branching: srv_meta_branching, tab:lib_tab});
}
}
@@ -246,11 +229,376 @@ function check_library () {
if ( $('input[name=javne_ankete]:checked').val() == '1' ) {
$('input[name=moje_ankete][value=0]').attr('checked', 'true');
- $('#moje_ankete').hide();
+ $('#moje_ankete').addClass('displayNone');
} else {
- $('#moje_ankete').show();
+ $('#moje_ankete').removeClass('displayNone');
}
}
+
+
+// Odpremo knjiznico v urejanju ankete
+function displayLibraryPopup(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('library_popup').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=libraryBranching&a=displayLibraryPopup', {anketa: srv_meta_anketa_id});
+}
+
+// Preklop med tabi
+function displayLibraryTab(tab){
+
+ if(tab == 1){
+ $('#tab_0').removeClass('active');
+ $('#tab_1').addClass('active');
+ }
+ else{
+ $('#tab_1').removeClass('active');
+ $('#tab_0').addClass('active');
+ }
+
+ $('#active_tab').val(tab);
+
+ $("#tab_content").load('ajax.php?t=libraryBranching&a=displayLibraryTabContent', {anketa: srv_meta_anketa_id, tab: tab});
+}
+
+// Odpremo folder - na desni prikazemo vprasanja
+function openLibraryFolder(folder_id){
+
+ $('.folder_item').removeClass('active');
+ $('#folder_item_'+folder_id).addClass('active').addClass('open');
+
+ // Ce poddirektoriji niso vidni jih prikazemo
+ if(!$('#folder_list_'+folder_id).is(':visible')){
+ $('#folder_list_'+folder_id).slideDown();
+ }
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=displayLibraryQuestionList', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+
+
+ // Ugasnemo vse prejšnje checkboxe
+ $(".question_item_check").removeClass('active').attr("checked", false);
+
+ // Nastavimo oznacene iteme na 0 in disablamo gumb
+ $('#selected_item_counter').html('0');
+ $("#insert_library_button").prop('disabled', true);
+}
+
+// Odpremo anketo - na desni prikazemo vprasanja
+function openLibrarySurvey(folder_id, type){
+
+ $('.folder_item').removeClass('active');
+ $('#'+type+'_survey_item_'+folder_id).addClass('active');
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=displayLibrarySurveyQuestionList', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+
+
+ // Ugasnemo vse prejšnje checkboxe
+ $(".question_item_check").removeClass('active').attr("checked", false);
+
+ // Nastavimo oznacene iteme na 0 in disablamo gumb
+ $('#selected_item_counter').html('0');
+ $("#insert_library_button").prop('disabled', true);
+}
+
+// Razpremo/skrcimo folder na levi
+function expandLibraryFolder(folder_id){
+
+ if($('#folder_list_'+folder_id).is(':visible')){
+ $('#folder_list_'+folder_id).slideUp();
+ $('#folder_item_'+folder_id).removeClass('open');
+ }
+ else{
+ $('#folder_list_'+folder_id).slideDown();
+ $('#folder_item_'+folder_id).addClass('open');
+ }
+
+ event.stopPropagation();
+}
+
+// Prikazemo opcije za urejanje folderja
+function showLibraryFolderEdit(element){
+
+ if($(element).parent().find('.folder_item_settings').hasClass('displayNone')){
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').addClass('displayNone');
+ $(element).removeClass('active');
+ }
+
+ event.stopPropagation();
+}
+
+
+// Zaprtje dodatnega popupa
+function closeAdditionalPopup(){
+ $("#lib_additional_popup").fadeOut().html();
+}
+
+// Ime novega folderja
+function displayAddFolderPopup(parent_folder_id, uid){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=addFolderPopup', {anketa: srv_meta_anketa_id, tab: tab, folder_id: parent_folder_id, uid: uid});
+}
+
+// Ime obstojecega folderja
+function displayRenameFolderPopup(folder_id, folder_name){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=renameFolderPopup', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id, folder_name: folder_name});
+}
+
+
+// Dodamo nov folder
+function addLibraryFolder(parent_folder_id, uid){
+
+ var tab = $('#active_tab').val();
+ var folder_name = $("#lib_folder_name").val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=addFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: parent_folder_id, uid: uid, folder_name: folder_name});
+}
+
+// Pobrisemo obstojeci folder
+function deleteLibraryFolder(folder_id){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=deleteFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+}
+
+// Preimenujemo obstojeci folder
+function renameLibraryFolder(folder_id){
+
+ var tab = $('#active_tab').val();
+ var folder_name = $("#lib_folder_name").val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=renameFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id, folder_name: folder_name});
+}
+
+
+// Klik na posamezno anketo - prikazemo/skrijemo vprasanja na desni znotraj ankete (desni tab)
+function toggleLibrarySurveyQuestions(folder_id){
+
+ if($('#survey_title_'+folder_id).hasClass('active')){
+ $('#survey_title_'+folder_id).removeClass('active');
+ $('#survey_questions_'+folder_id).hide();
+ }
+ else{
+ $('#survey_title_'+folder_id).addClass('active');
+ $('#survey_questions_'+folder_id).show();
+ }
+}
+
+// Klik na posamezen item na desni
+function selectLibraryItem(item_id){
+
+ if($('#question_item_holder_'+item_id).hasClass('active')){
+ $('#question_item_holder_'+item_id).removeClass('active');
+ $('#question_item_check_'+item_id).attr("checked", false);
+ }
+ else{
+ $('#question_item_holder_'+item_id).addClass('active');
+ $('#question_item_check_'+item_id).attr("checked", true);
+ }
+
+ // Prestejemo oznacene iteme
+ var count = $('.question_item_check:checkbox:checked').length;
+ $('#selected_item_counter').html(count);
+
+ // Nastavimo gumb dodaj kot disabled glede na to ce imamo elemente ali ne
+ if(count > 0){
+ $("#insert_library_button").prop('disabled', false);
+ }
+ else{
+ $("#insert_library_button").prop('disabled', true);
+ }
+}
+
+// Prikaz urejanja posameznega itema na desni
+function showLibraryItemEdit(element){
+
+ if($(element).parent().find('.item_settings').hasClass('displayNone')){
+ $('.item_settings').addClass('displayNone');
+ $('.dots_ver_item').removeClass('active');
+ $(element).parent().find('.item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.item_settings').addClass('displayNone');
+ $('.dots_ver_item').removeClass('active');
+ $(element).parent().find('.item_settings').addClass('displayNone');
+ }
+
+ event.stopPropagation();
+}
+
+function deleteLibraryItem(item_id, item_type){
+
+ $.post('ajax.php?t=libraryBranching&a=deleteItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+
+ event.stopPropagation();
+}
+
+// Odpremo popup za dodajanje itema v knjiznico v urejanju ankete
+function displayRenameLibraryItemPopup(item_id, type){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=displayRenameLibraryItemPopup', {anketa: srv_meta_anketa_id, tab: tab, item_id: item_id, type: type});
+
+ event.stopPropagation();
+}
+
+// Preimenujemo obstojeci element
+function renameLibraryItem(item_id, type){
+
+ var tab = $('#active_tab').val();
+ var title = $('#lib_element_name').val();
+ var folder_id = $('.folder_item.active').attr("folder-id");
+
+ closeAdditionalPopup();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=renameItem', {anketa: srv_meta_anketa_id, tab: tab, item_id: item_id, type: type, title: title, folder_id: folder_id});
+}
+
+// Funkcija za init drag drop vprasanj v knjiznici
+function dropLibraryItem(item_id, item_type, folder_id){
+
+ $.post('ajax.php?t=libraryBranching&a=dropItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type, folder_id: folder_id}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+}
+
+// Funkcija za init drag drop
+function initDragLibraryItem(){
+
+ $('.question_item_info').draggable({
+ containment: $('#general_popup'),
+ helper: 'clone',
+ //distance: 20,
+ //snap: theVoteBar,
+ //revert: true,
+ });
+
+ $(".droppable_folder").droppable({
+ accept: ".question_item_info",
+ tolerance: "pointer",
+ hoverClass: "drag-hover",
+ drop: function( event, ui ) {
+ var item_id = ui.draggable.attr('item-id');
+ var item_type = ui.draggable.attr('item-type');
+ var folder_id = $(this).attr("folder-id");
+
+ dropLibraryItem(item_id, item_type, folder_id);
+ }
+ });
+}
+
+// Skrijemo puscice folderjem brez subfolderjev
+function initHideLibraryArrows(){
+
+ $('ul.folder_list').each(function(){
+
+ if($(this).is(':empty')){
+
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(12);
+
+ $('#folder_item_'+id).addClass('no_arrow');
+ }
+ });
+}
+
+function insertLibraryItemsIntoSurvey(){
+
+ var items = [];
+
+ var multiple = false;
+ var different = false;
+ var prev = '';
+ var subtype = '';
+
+ $('.question_item_check:checkbox:checked').each(function(){
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(20);
+
+ var type = $(this).attr("item-type");
+ subtype = $(this).attr("item-subtype");
+
+ items.push(id + '_' + type);
+
+ // Preverimo za obvestilo, ce dodajamo vec elementov in ce so razlicni
+ if(prev != ''){
+ multiple = true;
+
+ if(prev != subtype){
+ different = true;
+ }
+ }
+
+ prev = subtype;
+ });
+
+ // Pohendlamo obvestilo, ce dodajamo vec elementov in ce so razlicni
+ var note = subtype;
+ if(different){
+ note = 'm';
+ }
+ else if(multiple){
+ note = subtype + 'm';
+ }
+ else{
+ note = subtype;
+ }
+ console.log(note)
+
+ $("#branching").load('ajax.php?t=libraryBranching&a=addIntoSurvey', {anketa: srv_meta_anketa_id, items: items}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_survey_'+note, 'success');
+ });
+}
+
+
+// Odpremo popup za dodajanje itema v knjiznico v urejanju ankete
+function displayAddIntoLibraryPopup(item_id, type){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=libraryBranching&a=displayAddIntoLibraryPopup', {anketa: srv_meta_anketa_id, item_id:item_id, type:type});
+}
+
+// Dodamo element v knjiznico
+function addIntoLibrary(item_id, type){
+
+ var title = $('#lib_item_title').val();
+ var folder_id = $('#lib_item_folder').val();
+
+ $.post('ajax.php?t=libraryBranching&a=addIntoLibrary', {anketa: srv_meta_anketa_id, item_id:item_id, type:type, title:title, folder_id:folder_id}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_lib_type'+type, 'success');
+ });
+}
diff --git a/admin/survey/script/means.js b/admin/survey/script/means.js
index c5326c5..178c0ef 100644
--- a/admin/survey/script/means.js
+++ b/admin/survey/script/means.js
@@ -68,15 +68,10 @@ function means_add_new_variable(which) {
var spr = new Array();
var grid = new Array();
- if (which == '2' ) {
- //$('#crossRightHolder #crosstab_add_new').hide();
- } else {
- //$('#crossLeftHolder #crosstab_add_new').hide();
- }
-
$('select[name=means_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
+
$('select[name=means_variable_'+which+'] option:selected').each(function(index,el) {
spr.push($(el).attr("spr_id"));
grid.push($(el).attr("grd_id"));
@@ -94,9 +89,9 @@ function means_add_new_variable(which) {
function means_remove_variable(what) {
$(what).parent().remove();
- if ( $(what).parent().find('select').val() > 0 ) {
+ //if ( $(what).parent().find('select').val() > 0 ) {
change_means();
- }
+ //}
}
function changeMeansSubSetting() {
var chkMeansSeperate = $("#chkMeansSeperate").is(':checked') ? 1 : 0;
@@ -124,7 +119,7 @@ function doArchiveMeans() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveMeans() {
@@ -141,7 +136,7 @@ function submitArchiveMeans() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -157,9 +152,9 @@ function createArchiveMeansBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -167,6 +162,6 @@ function createArchiveMeansBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/missingProfiles.js b/admin/survey/script/missingProfiles.js
index 483265f..84d72e2 100644
--- a/admin/survey/script/missingProfiles.js
+++ b/admin/survey/script/missingProfiles.js
@@ -132,11 +132,11 @@ function missingProfileAction(action) {
$("#renameProfileDiv").hide();
$("#missingProfileCoverDiv").fadeOut();
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
}
}
diff --git a/admin/survey/script/missingValues.js b/admin/survey/script/missingValues.js
index 316e433..e891c92 100644
--- a/admin/survey/script/missingValues.js
+++ b/admin/survey/script/missingValues.js
@@ -53,7 +53,7 @@ function sysMissingValuesAdd()
if (filter != undefined && !(filter === '') && text != undefined && !(text === '' )) {
$("#sys_missing_values").load('ajax.php?t=missingValues&a=sysMissingValuesAdd', {filter:filter, text:text});
} else {
- alert(lang['srv_missing_value_not_empty']);
+ genericAlertPopup('srv_missing_value_not_empty');
}
}
function sysMissingValuesDelete(id)
@@ -70,7 +70,7 @@ function sysMissingValuesSave(id) {
if (filter != undefined && !(filter === '') && text != undefined && !(text === '') ) {
$("#sys_missing_values").load('ajax.php?t=missingValues&a=sysMissingValuesSave', {filter:filter, text:text, id:id});
} else {
- alert(lang['srv_missing_value_not_empty']);
+ genericAlertPopup('srv_missing_value_not_empty');
}
}
@@ -126,7 +126,7 @@ function addSurveyMissingValueConfirm() {
$('#fullscreen').fadeOut('slow');
});
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} \ No newline at end of file
diff --git a/admin/survey/script/mobile.js b/admin/survey/script/mobile.js
index 32a171c..ab43ec1 100644
--- a/admin/survey/script/mobile.js
+++ b/admin/survey/script/mobile.js
@@ -8,34 +8,100 @@ function mobile_init(){
closed: function () {
}
- })
+ })
- // dynamically bind 'closing' event
- zeynep.on('closing', function () {
+ // dynamically bind 'closing' event
+ zeynep.on('closing', function () {
- })
+ })
- // handle zeynepjs overlay click
- $('.mobile_menu_close').on('click', function () {
- zeynep.close();
- $('#fade').fadeOut();
+ // handle zeynepjs overlay click
+ $('.mobile_menu_close').on('click', function () {
- $('.mobile_menu_close').fadeOut('fast', function(){
- $('.mobile_menu_open').fadeIn('fast');
- });
- })
+ $('#fade').fadeOut();
- // open zeynepjs side menu
- $('.mobile_menu_open').on('click', function () {
- zeynep.open();
+ mobile_menu_close(zeynep);
+ })
+
+ // open zeynepjs side menu
+ $('.mobile_menu_open').on('click', function () {
+
+ if($('#fade').is(':hidden')){
$('#fade').fadeIn();
+ }
+ else{
+ mobile_settings_close(zeynep);
+ }
+
+ mobile_menu_open(zeynep);
+ })
+
+ // handle settings overlay click
+ $('.mobile_settings_close').on('click', function () {
+
+ $('#fade').fadeOut();
+
+ mobile_settings_close(zeynep);
+ })
+
+ // open settings side menu
+ $('.mobile_settings_open').on('click', function () {
+
+ if($('#fade').is(':hidden')){
+ $('#fade').fadeIn();
+ }
+ else{
+ mobile_menu_close(zeynep);
+ }
+
+ mobile_settings_open(zeynep);
+ })
+}
+
+// Odpremo mobile meni na levi
+function mobile_menu_open(zeynep){
- $('.mobile_menu_open').fadeOut('fast', function(){
- $('.mobile_menu_close').fadeIn('fast');
- });
- })
+ zeynep.open();
+
+ $('.mobile_menu_open').fadeOut('fast', function(){
+ $('.mobile_menu_close').fadeIn('fast');
+ });
+}
+
+// Zapremo mobile meni na levi
+function mobile_menu_close(zeynep){
+
+ zeynep.close();
+
+ $('.mobile_menu_close').fadeOut('fast', function(){
+ $('.mobile_menu_open').fadeIn('fast');
+ });
}
+// Odpremo settings meni na desni
+function mobile_settings_open(){
+
+ $('.mobile_settings').animate({"margin-right": '+=85vw'},200,'linear');
+
+ $('.mobile_settings_open').fadeOut('fast', function(){
+ $('.mobile_settings_close').fadeIn('fast');
+ });
+}
+
+// Zapremo settings meni na desni
+function mobile_settings_close(callback){
+
+ $('.mobile_settings').animate({"margin-right": '-85vw'},200,'linear');
+
+ $('.mobile_settings_close').fadeOut('fast', function(){
+ $('.mobile_settings_open').fadeIn('fast');
+ });
+
+ if (typeof callback == "function")
+ callback();
+}
+
+
// Popup za dodajanje vprasanja na mobile
function mobile_add_question_popup(){
$('.mobile_add_question_popup').fadeIn();
diff --git a/admin/survey/script/multiCrosstabs.js b/admin/survey/script/multiCrosstabs.js
index b4bd3cf..e85071a 100644
--- a/admin/survey/script/multiCrosstabs.js
+++ b/admin/survey/script/multiCrosstabs.js
@@ -190,6 +190,12 @@ function use_mc_table() {
location.reload();
});
}
+function switch_mc_table(value) {
+
+ $.post('ajax.php?t=multicrosstabs&a=use_mc_table', {anketa:srv_meta_anketa_id, value:value}, function(){
+ location.reload();
+ });
+}
// popravljamo ime tabele...
function mc_table_action(action){
diff --git a/admin/survey/script/notifications.js b/admin/survey/script/notifications.js
index 2494385..cdd5074 100644
--- a/admin/survey/script/notifications.js
+++ b/admin/survey/script/notifications.js
@@ -1,9 +1,14 @@
// poslje novo sporocilo
function sendNotification() {
+ if(CKEDITOR.instances['notification']){
+ CKEDITOR.instances['notification'].destroy();
+ }
+
var recipient = $( "input[name='recipient']" ).val();
var title = $( "input[name='title']" ).val();
- var notification = $( "textarea[name='notification']" ).val();
+ //var notification = $( "textarea[name='notification']" ).val();
+ var notification = $("#notification").val();
if ($( "input[name='recipient_all_slo']" ).is(':checked'))
var recipient_all_slo = 1;
@@ -20,7 +25,21 @@ function sendNotification() {
else
var force_show = 0;
- $('#notifications').load('ajax.php?t=notifications&a=sendNotification', {anketa:srv_meta_anketa_id, recipient:recipient, recipient_all_slo:recipient_all_slo, recipient_all_ang:recipient_all_ang, title:title, notification:notification, force_show:force_show});
+ $('#notifications').load('ajax.php?t=notifications&a=sendNotification', {
+ anketa:srv_meta_anketa_id,
+ recipient:recipient,
+ recipient_all_slo:recipient_all_slo,
+ recipient_all_ang:recipient_all_ang,
+ title:title,
+ notification:notification,
+ force_show:force_show,
+
+ function(){
+ if (!CKEDITOR.instances) {
+ CKEDITOR.replace['notification'];
+ }
+ }
+ });
}
// prikaze sporocilo in ga oznaci kot viewed
@@ -54,23 +73,31 @@ function closeUnreadMessages(){
$("#unread_notifications").fadeOut();
}
-function recipient_all_disable_email(){
-
- if ($( "input[name='recipient_all_slo']" ).is(':checked'))
- var recipient_all_slo = 1;
- else
- var recipient_all_slo = 0;
-
- if ($( "input[name='recipient_all_ang']" ).is(':checked'))
- var recipient_all_ang = 1;
- else
- var recipient_all_ang = 0;
-
- if(recipient_all_slo == 0 && recipient_all_ang == 0)
- $("#recipient").attr('disabled', false);
- else
- $("#recipient").attr('disabled', true);
+function recipient_toggle(type){
+
+ if (type == 'slo') {
+ if ($( "input[name='recipient_all_slo']" ).is(':checked')) {
+ $( "input[name='recipient_custom']" ).attr("checked", false);
+ $("#recipient").addClass('disabled');
+ }
+ }
+
+ if (type == 'ang') {
+ if ($( "input[name='recipient_all_ang']" ).is(':checked')) {
+ $( "input[name='recipient_custom']" ).attr("checked", false);
+ $("#recipient").addClass('disabled');
+ }
+ }
+
+ if (type == 'custom') {
+ if ($( "input[name='recipient_custom']" ).is(':checked')) {
+ $( "input[name='recipient_all_slo']" ).attr("checked", false);
+ $( "input[name='recipient_all_ang']" ).attr("checked", false);
+ $("#recipient").removeClass('disabled');
+ }
+ }
}
+
// Prikaze popup z neprebranimi sporocili
diff --git a/admin/survey/script/postProcess.js b/admin/survey/script/postProcess.js
index f8133d4..42cbdbd 100644
--- a/admin/survey/script/postProcess.js
+++ b/admin/survey/script/postProcess.js
@@ -22,7 +22,7 @@ function edit_data(event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
var td = target.prevAll('td.data_uid'); // td, ki vsebuje usr_id
@@ -110,7 +110,7 @@ function edit_data_hover (event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
// nad katero celico je kurosr
var cell_over = target_parent_children.index(target);
@@ -162,7 +162,7 @@ function edit_data_inline_edit () {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt( $("#tableIconColspan").val() ) || 0;
- var tableHeadChildren = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele
+ var tableHeadChildren = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele
var sprList = [];
@@ -297,19 +297,25 @@ function data_header_hoverout (event) {
function data_header_click (event) {
var target = $(event.target);
- // ce smo kliknili na notranji div z classom: .dataCell
- if ( target.is('.dataCell') ) {
- target = target.parent();
- }
-
- if ( ! target.is('th') ) return;
-
- $("#loading").show();
-
- var sort_seq = target.attr('seq');
- if ( !isNaN(sort_seq) && sort_seq!='' ) {
- var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
- vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ let spr_id = target.attr('spr_id');
+
+ //ignoriramo line number
+ if(spr_id != 'lineNo'){
+ // ce smo kliknili na notranji div z classom: .dataCell
+ if ( target.is('.dataCell') ) {
+ target = target.parent();
+ }
+
+ if ( ! target.is('th') ) return;
+
+ $("#loading").show();
+
+
+ var sort_seq = target.attr('seq');
+ if ( !isNaN(sort_seq) && sort_seq!='') {
+ var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
+ vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ }
}
}
@@ -322,7 +328,7 @@ function coding_click ( el, event ) {
var td_pos = el.parent().children().index(el);
- var spr_id = $('#dataTable tr:nth-child(3) th:eq('+td_pos+')').attr('spr_id');
+ var spr_id = $('#dataTable tr:nth-child(2) th:eq('+td_pos+')').attr('spr_id');
if ( ! spr_id > 0) return;
@@ -360,7 +366,7 @@ function coding_save (usr_id) {
$('#dataTable tbody td').removeClass('cellBlue');
$('#coding').hide();
- $('.coding-refresh').fadeIn();
+ $('.coding-refresh').show();
}
function coding_vrednost_new (spr_id, usr_id, naslov) {
@@ -404,6 +410,11 @@ function coding_filter (seq) {
});
}
+function toggle_coding_div () {
+
+ $('#coding').hide();
+
+}
function coding_merge (spr_id, vre_id, usr_id, merge) {
@@ -439,7 +450,7 @@ function postProcessAddMetaTitles() {
fields['itime'] = 0;
fields['lineNo'] = 0;
fields['meta'] = 0;
- $.each ( $('#dataTable tr:nth-child(3) th') ,function (i, element)
+ $.each ( $('#dataTable tr:nth-child(2) th') ,function (i, element)
{
if ($(element).attr('spr_id') == 'status')
{
@@ -576,13 +587,14 @@ function postProcessAddLurkerTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 4 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=5]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=lurker]").index();
+
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_id za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
@@ -591,31 +603,68 @@ function postProcessAddLurkerTitles(column) {
langs[0]=data.status0;
langs[1]=data.status1;
// preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tr') ,
+ $.each ( $('#dataTable tbody tr') ,
function (i, value) {
- var element = $(value).find(':nth-child('+(table_index)+')');
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
element.attr('title',new_val);
element.html(new_val);
+ element.addClass("cellGreen");
}
-
});
});
}
}
+
+function postProcessAddRelevanceTitles(column) {
+ // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
+ var tableIconColspan = parseInt($("#tableIconColspan").val());
+ // zamenjamo statuse
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=relevance]").index();
+
+ // če sploh prikazujemo statuse
+ if (table_index > 0) {
+ //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
+ table_index = 1+tableIconColspan+column;
+
+ var langs = new Array();
+ // polovimo tekste
+ $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
+ data = jQuery.parseJSON(data);
+ langs[0]=data.status0;
+ langs[1]=data.status1;
+ // preletimo skozi kolono in dodamo title
+ $.each ( $('#dataTable tbody tr') ,
+ function (i, value) {
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+ if ($(element).is('td')) {
+ var status = parseInt(element.html());
+ var new_val = langs[status];
+ element.attr('title',new_val);
+ element.html(new_val);
+ element.addClass("cellGreen");
+ }
+ });
+ });
+ }
+}
+
function postProcessAddEmailTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=3]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=invitation]").index();
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
$.post('ajax.php?a=getDataEmailTitles', {anketa: srv_meta_anketa_id}, function (data) {
@@ -627,6 +676,7 @@ function postProcessAddEmailTitles(column) {
$.each ( $('#dataTable tbody tr') ,
function (i, value) {
var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
@@ -637,65 +687,20 @@ function postProcessAddEmailTitles(column) {
if(status == 1)
element.addClass("invitation_cell");
}
-
- });
- });
- }
-}
-function postProcessAddRelevanceTitles() {
- // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
- var tableIconColspan = parseInt($("#tableIconColspan").val());
- // zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=2]").index();
- // če sploh prikazujemo statuse
- if (table_index > 0) {
- //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+2;
-
- var langs = new Array();
- // polovimo tekste
- $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
- data = jQuery.parseJSON(data);
- langs[0]=data.status0;
- langs[1]=data.status1;
- // preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tbody tr') ,
- function (i, value) {
- var element = $(value).find('td:nth-child('+(table_index)+')');
- if ($(element).is('td')) {
- var status = parseInt(element.html());
- var new_val = langs[status];
- element.attr('title',new_val);
- element.html(new_val);
- element.addClass("cellGreen");
- }
-
});
});
}
}
function showSurveyAnswers(event) {
-/*
- var srv_site_url = $("#srv_site_url").val();
- var target = $(event.target);
- var uid = $(target).parent().find('.data_uid').html();
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
- //alert(href);
- //return false;
- if (uid > 0 ){
- window.open(href, '_blank');
- }
-*/
+
// polovimo user id
var srv_site_url = $("#srv_site_url").val();
var target = $(event.target);
var uid = $(target).parent().parent().find('.data_uid').html();
-// var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
var href = srv_site_url+'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=data&m=quick_edit&usr_id='+uid+'&quick_view=1';
- if (uid > 0 ){
+
+ if (uid > 0 ){
window.location = href;
}
}
@@ -717,9 +722,9 @@ function dataTableResize (sid) {
$('#dataTable col[seq='+seq+']').width(widths[anketa][seq]);
}
- $('#dataTable tr:nth-child(3) th div.dataCell').append('<div class="tableResize"></div>');
+ $('#dataTable tr:nth-child(2) th div.dataCell').append('<div class="tableResize"></div>');
- $('#dataTable tr:nth-child(3) th .tableResize').bind('mousedown', function (e) {
+ $('#dataTable tr:nth-child(2) th .tableResize').bind('mousedown', function (e) {
startObj = $('#dataTable col[seq='+ $(this).closest('th').attr('seq') +']');
mousedown = true;
diff --git a/admin/survey/script/progressBar.js b/admin/survey/script/progressBar.js
index 0a0885f..337a087 100644
--- a/admin/survey/script/progressBar.js
+++ b/admin/survey/script/progressBar.js
@@ -34,8 +34,12 @@ var starttime = 0;
* @param getProgress - ali bomo v sessionu sporocali napredek, ali ne (ce ne, potem samo stejemo cas)
*/
function init_progressBar (getProgress) {
+
+ // Po novem nimamo vec progress bara in prikazemo samo "nalaganje"
+ $('body').addClass('waitlong');
+ $("#loading").show();
- if (typeof(getProgress) == 'undefined') getProgress = false;
+ /*if (typeof(getProgress) == 'undefined') getProgress = false;
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
@@ -44,7 +48,6 @@ function init_progressBar (getProgress) {
'<div class="red" id="pbLabel">'+lang['srv_please_wait']+'</div>' +
'<br/><br/>' +
'<div id="pbPercent" class="floatLeft pbLabel">'+lang['srv_collectdata_progress_status']+':</div><div id="pbRowPercent" class="floatLeft"><span id="pbRowPercentLabel"></span><div>&nbsp;</div></div>' +
- '<br class="clr">' +
'</div>'
);
@@ -56,8 +59,7 @@ function init_progressBar (getProgress) {
var d = new Date();
starttime = d.getTime();
- pbInterval=window.setInterval("refresh_progressBar("+getProgress+")",250); // klicemo na 250ms
-
+ pbInterval=window.setInterval("refresh_progressBar("+getProgress+")",250); // klicemo na 250ms*/
}
/**
diff --git a/admin/survey/script/quota.js b/admin/survey/script/quota.js
index 6077385..710f12d 100644
--- a/admin/survey/script/quota.js
+++ b/admin/survey/script/quota.js
@@ -19,40 +19,44 @@ function quota_editing(condition, new_spremenljivka, vrednost) {
function quota_editing_close(condition, vrednost) {
- document.getElementById('quota').style.display = "none";
- if (condition < 0) $('#branching_' + (-condition)).delay('3000').removeClass('spr_editing', 500);
+ $('#quota').fadeOut('slow');
// kalkulacija v pogojih
if (condition >= 0) {
- $('#fade').fadeOut('slow');
+
+ // Ce imamo spodaj odprt popup za if, ga pustimo odprtega
+ if($('#div_condition_editing').is(':hidden')){
+ $('#fade').fadeOut('slow');
+ }
+
$('#div_condition_editing').load(
'ajax.php?t=quota&a=quota_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition,
vrednost: vrednost
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
+ }
+ // kalkulacija kot tip vprasanja
+ else {
- // kalkulacija kot tip vprasanja
- } else {
+ $('#branching_' + (-condition)).delay('3000').removeClass('spr_editing', 500);
// ce smo v vnosih, refreshamo stran, da se izpise nova kalkulacija..
if (__vnosi == 1) {
-
- window.location.reload();
-
- // obicajno zapiranje kalkulacije v urejanju
- } else {
+ window.location.reload();
+ }
+ // obicajno zapiranje kalkulacije v urejanju
+ else {
$('#fade').fadeOut('slow');
+
$('#branching_' + (-condition)).load(
'ajax.php?t=quota&a=quota_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
}
}
}
@@ -92,7 +96,6 @@ function quota_operator_edit(quota, operator) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#quota_editing_inner').scroll();
});
}
@@ -163,7 +166,6 @@ function quota_bracket_edit_new(quota, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#quota_editing_inner').scroll();
});
}
diff --git a/admin/survey/script/script.js b/admin/survey/script/script.js
index c0aa65b..450aacc 100644
--- a/admin/survey/script/script.js
+++ b/admin/survey/script/script.js
@@ -24,11 +24,13 @@ var __tabele = 0; // pove ce smo v analizi v krostabulacijah(1)
// poklice se v onload.js
function load_meta_variables () {
srv_meta_anketa_id = $("#srv_meta_anketa_id").val();
+ srv_meta_anketa_hash = $("#srv_meta_anketa_hash").val();
srv_meta_podstran = $("#srv_meta_podstran").val();
srv_meta_akcija = $("#srv_meta_akcija").val();
srv_meta_grupa = $("#srv_meta_grupa").val();
srv_meta_branching = $("#srv_meta_branching").val();
srv_meta_full_screen_edit = ($("#srv_meta_full_screen_edit").val() == 1 ? true : false);
+
loaded = true;
};
@@ -38,7 +40,7 @@ function ajax_start_stop () {
$('body').ajaxStart(function() {
t=setTimeout(function() {$('body').addClass('waitlong');},1000);
$('body').addClass('wait');
- }).ajaxStop(function() {
+ }).ajaxComplete(function() {
clearTimeout(t);
$('body').removeClass('wait').removeClass('waitlong');
});
@@ -138,8 +140,11 @@ function onload_init () {
});
- $('#test_user_alert span').blink(
- {fadeIn: 100, fadeOut: 200,pauseShow:500});
+ $('#test_user_alert span').blink({
+ fadeIn: 100,
+ fadeOut: 200,
+ pauseShow:500
+ });
// Search na vrhu po pritisku na enter skoci na drupal search
$('#searchSurvey').keypress(function (e) {
@@ -376,54 +381,32 @@ function new_anketa() {
var isInfoOver = false;
var isInfoLoaded = false;
function showInfoBox(action,e) {
- if (action == 'show') {
-
- /*
- isInfoOver = true;
- // ugotovimo elementovo pozicijo
- var pos = e.offset();
- // ugotovimo dimenzije info boxa
- var surveyInfo_height = $("#surveyInfo").height();
-
- // ce infobox ne moremo prikazati navzgor, ga prikazemo navzdol
- // ugotovimo velikost strani
- var w_height = $(window).height();
- var w_width = $(document).width();
-
- if (pos.top - surveyInfo_height && (pos.top + surveyInfo_height) < w_height) {
- // risemo navzdol
- show_top = pos.top + e.height() + 5;
- }
- else { // risemo navzgor
- show_top = pos.top - surveyInfo_height - e.height() - 5;
- }*/
+
+ if (action == 'show') {
if (!isInfoLoaded) {
$('#surveyInfo_msg').load('ajax.php?a=displayInfoBox', {anketa: srv_meta_anketa_id});
isInfoLoaded = true;
}
- //$("#surveyInfo").css( { "left": (pos.left+e.width()+5)+ "px", "top": show_top + "px" } ).show().draggable();
-
- } /*else {
- isInfoOver = false;
- setTimeout(function() {hideBottomInfoBox()}, 350);
- }*/
+ }
}
function hideBottomInfoBox() {
- if (isInfoOver == false)
+
+ if (isInfoOver == false)
$('#surveyInfo').fadeOut(400);
-
}
// spremeni ime ankete
function edit_anketa_naslov (anketa) {
$('#anketa_naslov').load('ajax.php?a=edit_anketa', {anketa: anketa, naslov: $('#anketa_polnoIme').val()});
}
+
// spremeni opombo ankete
function edit_anketa_note (anketa){
$.post('ajax.php?a=edit_anketa_note', {anketa: anketa, note: $('#anketa_note').val()});
}
+
// spremeni akronim-kratko ime ankete
function edit_anketa_akronim (anketa){
$.post('ajax.php?a=edit_anketa_akronim', {anketa: anketa, akronim: $('#anketa_akronim').val()});
@@ -436,8 +419,8 @@ function anketa_active (anketa, state, folders, hierarhija) {
if (state == 0) {
// Če aktiviramo anketo, najprej vprašamo po datumih
- $.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: anketa}, function (data) {
- if (data == '1') { // vse ok, anketa nima napak
+ //$.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: anketa}, function (data) {
+ //if (data == '1') { // vse ok, anketa nima napak
$('#fade').fadeTo('slow', 1);
$('#fullscreen').html('').fadeIn('slow');
// aktiviramo anketo in prikažemo okno
@@ -447,18 +430,18 @@ function anketa_active (anketa, state, folders, hierarhija) {
// Pošljemo zahtevek za aktiviranje hierarhije
hierarhija_active(anketa);
}else {
- startTimerActivation(anketa, folders);
+ //startTimerActivation(anketa, folders);
}
});
- }
+ //}
// anketa ima napake
- else {
+ /* else {
// izpišemo obvestilo o napakah
$('#fade').fadeIn('slow');
$('#surveyTrajanje').fadeIn('slow');
$('#surveyTrajanje_msg').html(data);
- }
- });
+ } */
+ //});
}
else
@@ -748,12 +731,16 @@ function anketa_activate_save(anketa,folders) {
var voteCountLimitType = $("input[name=vote_count_limit]:checked").val();
var voteCountValue = $("#vote_count_val").val();
- $.post('ajax.php?a=anketa_save_activation', {anketa:anketa,
- durationType:durationType, durationStarts:durationStarts, durationExpire:durationExpire, voteCountLimitType:voteCountLimitType, voteCountValue:voteCountValue}, function (response) {
- refresh_anketa_activation(anketa,folders);
- });
+ $.post('ajax.php?a=anketa_activate', {anketa:anketa,folders:folders}, function (response) {
+ $.post('ajax.php?a=anketa_save_activation', {anketa:anketa,
+ durationType:durationType, durationStarts:durationStarts, durationExpire:durationExpire, voteCountLimitType:voteCountLimitType, voteCountValue:voteCountValue}, function (response) {
+ refresh_anketa_activation(anketa,folders);
+ });
+ });
} else {
- refresh_anketa_activation(anketa,folders);
+ $.post('ajax.php?a=anketa_activate', {anketa:anketa,folders:folders}, function (response) {
+ refresh_anketa_activation(anketa,folders);
+ });
}
}
@@ -930,7 +917,7 @@ function insert_grupa_before(grupa) {
function grupa_recount(prevent_recount) {
if (prevent_recount) {
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_recount_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_recount_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else {
$.redirect('ajax.php?a=grupa_recount', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa});
}
@@ -1031,17 +1018,23 @@ function brisi_spremenljivko (spremenljivka, text, confirmed) {
//refreshLeft();
$('#branching').html(data.output);
refreshRight();
+
+ // Prikazemo gumb za pobrisana vprasanja (toolbox na levi) in povecamo counter
+ $('#vprasanje_deleted_border, #vprasanje_deleted_toolbox').removeClass('displayNone');
+ var vprasanje_deleted_count = parseInt($('#vprasanje_deleted_count').html()) + 1;
+ $('#vprasanje_deleted_count').html(vprasanje_deleted_count);
}
else if (data.error == 1) {
$('#fade').fadeIn('slow');
- $('#dropped_alert').html(data.output).fadeIn('slow').animate({opacity: 1.0}, 3000, function(){
+ /*$('#dropped_alert').html(data.output).fadeIn('slow').animate({opacity: 1.0}, 3000, function(){
$('#fade').fadeOut("slow");
$('#dropped_alert').fadeOut("slow");
- });
+ });*/
+ $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '600px');
}
else if (data.error == 2) {
$('#fade').fadeIn('slow');
- $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '400px');
+ $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '600px');
}
}
@@ -1516,7 +1509,33 @@ function normalmode_spremenljivka (spremenljivka) {
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
function create_editor (id, focus) {
- CKEDITOR.replace(id);
+ editor = CKEDITOR.replace(id);
+
+ // Dodamo gumb vec
+ editor.addCommand("advanced_editor_show", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').addClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('More', {
+ label: lang['more2'],
+ command: 'advanced_editor_show',
+ name: "More",
+ });
+
+ // Dodamo gumb manj
+ editor.addCommand("advanced_editor_hide", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').removeClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('Less', {
+ label: lang['less2'],
+ command: 'advanced_editor_hide',
+ name: "Less",
+ });
//namestitev editorja za tekst pri obveščanju
if(gup('a') == 'alert' && focus == false){
@@ -1623,6 +1642,23 @@ function create_editor_hotspot (id, focus) {
editor_init = true;
}
+function create_editor_notification(id) {
+
+ CKEDITOR.replace( id, {toolbar: 'Notification'}); // prikazi editor s Notification configuration
+
+ CKEDITOR.config.removePlugins = 'elementspath'; //odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
+
+ CKEDITOR.instances[id].on('focus', function () {
+ this.execCommand('selectAll');
+ });
+
+ if (id == 'notification')
+ CKEDITOR.config.resize_enabled = false;
+ CKEDITOR.config.height = 238;
+
+ editor_init = true;
+}
+
// odstrani editor za ne-spremenljivka (treba preden se odstrani html)
function remove_editor (id) {
//odstranimo CKEDITOR v kolikor je inicializiran -> če preverjanja potem javi error in ostala javascript datoteka ne deluje
@@ -1639,35 +1675,53 @@ function remove_editor (id) {
// prikaze editor za spremenljivko (definiran mora biti textarea za idjem naslov_$spremenljivka
function editor_display (spremenljivka) {
- //if (editor_init != true) {
- CKEDITOR.replace( 'naslov_'+spremenljivka );
+ editor = CKEDITOR.replace( 'naslov_'+spremenljivka );
- //v kolikor je default vrednost potem naredimo selectAll
- var def = $('#naslov_'+spremenljivka).attr("default");
- if( def == 1) {
- CKEDITOR.instances['naslov_' + spremenljivka].on('focus', function () {
- this.execCommand('selectAll');
- });
- }
- // editor_init = true;
- //}
+ // Dodamo gumb vec
+ editor.addCommand("advanced_editor_show", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').addClass('advanced');
+ }
+ });
+ editor.ui.addButton('More', {
+ label: lang['more2'],
+ command: 'advanced_editor_show',
+ name: "More",
+ });
+
+ // Dodamo gumb manj
+ editor.addCommand("advanced_editor_hide", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').removeClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('Less', {
+ label: lang['less2'],
+ command: 'advanced_editor_hide',
+ name: "Less",
+ });
+
+ //v kolikor je default vrednost potem naredimo selectAll
+ var def = $('#naslov_'+spremenljivka).attr("default");
+ if( def == 1) {
+ CKEDITOR.instances['naslov_' + spremenljivka].on('focus', function () {
+ this.execCommand('selectAll');
+ });
+ }
}
function editor_display_hotspot (vre_id) {
- //if (editor_init != true) {
- CKEDITOR.replace( 'hotspot_image_'+vre_id, {toolbar: 'HotSpot', width: 300, removePlugins: 'elementspath'}); //izberi config toolbar HotSpot, sirina naj bo 300px, odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
+ CKEDITOR.replace( 'hotspot_image_'+vre_id, {toolbar: 'HotSpot', width: 300, removePlugins: 'elementspath'}); //izberi config toolbar HotSpot, sirina naj bo 300px, odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
- //v kolikor je default vrednost potem naredimo selectAll
- var def = $('#hotspot_image_'+vre_id).attr("default");
- //if( def == 1) {
- CKEDITOR.instances['hotspot_image_' + vre_id].on('focus', function () {
- this.execCommand('selectAll');
- });
- //}
- // editor_init = true;
- //}
+ //v kolikor je default vrednost potem naredimo selectAll
+ var def = $('#hotspot_image_'+vre_id).attr("default");
+
+ CKEDITOR.instances['hotspot_image_' + vre_id].on('focus', function () {
+ this.execCommand('selectAll');
+ });
}
// odstrani editor (treba preden se odstrani html)
@@ -1789,7 +1843,7 @@ function grupa_sortable (preventMove) {
stop: function () {
if (preventMove == true) {
$(this).sortable('cancel');
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_move_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_move_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else
$.post('ajax.php?a=vrstnired_grupa', {serialize: $('#grupe').sortable('serialize')});
}
@@ -1826,7 +1880,7 @@ function spremenljivka_sortable (preventMove) {
// {duration: 1});¸
if (preventMove == true) {
$(this).sortable('cancel');
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_spremenljivka_move_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_spremenljivka_move_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else {
var moved = ui.item.attr('id');
var topage = $("#"+moved).parent().attr('id');
@@ -1942,7 +1996,7 @@ function data_show_labels () {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt( $("#tableIconColspan").val() ) || 0;
- var tableHeadChildren = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele
+ var tableHeadChildren = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele
var sprList = [];
@@ -2078,138 +2132,22 @@ function toggleStatusAlertOtherCheckbox(element) {
// alert_expire_other
if ( $('#alert_'+element).is(':checked') )
{
- $('#alert_holder_'+element+'_emails').show();
+ $('#alert_holder_'+element+'_emails').removeClass('displayNone');
} else {
- $('#alert_holder_'+element+'_emails').hide(); }
+ $('#alert_holder_'+element+'_emails').addClass('displayNone'); }
}
-function clear_analizaFilters()
-{
-$('input[id^=analiza_mv_checkbox_]').each(function()
-{ if ( $(this).is(':checked') )
- $(this).trigger('click');
-});
-}
-
-/* komentarji */
-
-// funkcija, ki pohendla komentarje ankete in vprasanj (preusmeri v forum in po potrebi (pri vprasanju) kreira novo temo, ce se ni)
-function comment_manage(type, spremenljivka) {
- $.redirect('ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: type, spremenljivka: spremenljivka});
-}
-
-var siteurl = '';
-if ( typeof srv_site_url !== 'undefined' ) { // komentarji v izpolnjevanju ankete
- siteurl = srv_site_url + '/admin/survey/';
-}
+function clear_analizaFilters(){
-// doda komentar in osvezi oblacek
-// type=0 : anketa, type=1 : vprasanje
-function add_comment (spremenljivka, type, view, vsebina) {
- $('div#survey_comment_'+spremenljivka+'_'+view).load(siteurl+'ajax.php?t=branching&a=comment_manage', {type: type, view: view, spremenljivka: spremenljivka, vsebina: vsebina, anketa: srv_meta_anketa_id, refresh: '1'},
- function () {
- if (view == 0) {
- $('#surveycomment_'+spremenljivka+'_0').qtip("hide"); // pri opciji Dodaj komentar, skrijemo oblacek po submitu
- $('#comment_add_'+spremenljivka).css('visibility', 'visible'); // pokazemo opcijo Poglej komentarje
- } else if (view == 4 || view == 5) {
- window.location.reload();
- }
+ $('input[id^=analiza_mv_checkbox_]').each(function(){
+ if ( $(this).is(':checked') )
+ $(this).trigger('click');
});
}
-// nastavi podanemu linku (a.surveycomment) oblacek za komentarje
-function load_comment (__this, show) {
- if (show == 1) { // opcije za takrat, ko je po defaultu ze na zacetku prikazan - za dodat komentar na anketo
- _when = false;
- _ready = true;
- var corners = ['leftMiddle', 'leftMiddle'];
- var opposites = ['rightMiddle', 'rightMiddle'];
- } else if (show == 2) { // opcija za takrat, ko se aktivira preko oblacka, ko se prikaze takoj
- _when = 'click';
- _ready = true;
- var corners = ['topRight', 'topRight'];
- var opposites = ['bottomLeft', 'bottomLeft'];
- } else { // default za normalne komentarje, da se odpre na klik
- _when = 'click';
- _ready = false;
- var corners = ['topLeft', 'topRight'];
- var opposites = ['bottomRight', 'bottomLeft'];
- }
-
- var width = $(document).width();
- // nastavitve za help
-
- // preverimo ali prikažemo tip na levo stran
- var position = $(__this).offset(); // position = { left: 42, top: 567 }
-
- var left = width - position.left;
-
- var i = (left >= 350) ? 0 : 1;
-
- if ($(__this).data("qtip")) {
- $(__this).qtip("destroy");
- $('div.qtip').html('');
- }
-
- // Posebej naslov ce smo v urejanju
- if($(__this).attr('view') == '1' && !show && $('#comment_qtip_title').length > 0 && $(__this).attr('subtype') == undefined){
- var naslov = $('#comment_qtip_title').val();
- }
- // komentar na vprasanje
- else if($(__this).attr('subtype') == 'q_admin_add'){
- var naslov = lang['srv_testiranje_komentar_q_title'];
- }
- // komentar na if
- else if($(__this).attr('subtype') == 'if_admin_add'){
- var naslov = lang['srv_testiranje_komentar_if_title'];
- }
- // komentarji na if
- else if($(__this).attr('subtype') == 'if_admin_all'){
- var naslov = lang['srv_testiranje_komentar_if_all_title'];
- }
- // komentar na blok
- else if($(__this).attr('subtype') == 'blok_admin_add'){
- var naslov = lang['srv_testiranje_komentar_blok_title'];
- }
- // komentarji na blok
- else if($(__this).attr('subtype') == 'blok_admin_all'){
- var naslov = lang['srv_testiranje_komentar_blok_all_title'];
- }
- // komentarji na vprasanja
- else if($(__this).attr('subtype') == 'q_admin_all'){
- var naslov = lang['srv_testiranje_komentar_q_all_title'];
- }
- // komentarji respondentov na vprasanja
- else if($(__this).attr('subtype') == 'q_resp_all'){
- var naslov = lang['srv_testiranje_komentar_q_resp_all_title'];
- }
- else{
- var naslov = lang['srv_testiranje_komentarji_anketa_title2'];
- }
-
- $(__this).qtip({
- content: {text: '<div id="survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')+'"></div>', title: {text: naslov, button: '&#x2715;'}},
- fixed: false, show: {when: _when, ready: _ready, solo: true},hide: {when: 'click'},
- style: {name: 'light', border: {width: 3, radius: 8}, width: 350, tip: {corner: corners[i]}},
- position: {corner: {tooltip: corners[i], target: opposites[i] }, adjust: {screen : true}},
- api: {
- beforeShow: function () {
- // tuki se poklice zato, ker se drugace content: {url: ....} ne refresha, ce zapres in spet odpres oblacek
- _comment = 1;
- $('div#survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')).load(siteurl+'ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: $(__this).attr('type'), view: $(__this).attr('view'), spremenljivka: $(__this).attr('spremenljivka'), vsebina: '', anketa: srv_meta_anketa_id, refresh: '1'});
- },
- onShow: function () {
- $('div.qtip').draggable();
- }
- }
- });
-
-}
-var _comment = 0;
/* help */
-
function load_help () { // ta funkcija je še mal slaba.
// prvi oblacek se ob vsakem ajax klicu overloadajo in se pol prikaze veckrat
// drugi oblacek ne dela v IE
@@ -2286,6 +2224,22 @@ function save_help (what, lang) {
try { $('#help_'+what).attr('qtip', '').qtip('destroy'); } catch (e) {/*alert("Napaka"+e)*/};
});
}
+
+// shrani vprasajcek iz masovnega urejanja iz nastavitev vprasajckov
+function save_help_mass(what, lang) {
+
+ var help = $('#edithelp_mass_'+what).val();
+
+ $.post('ajax.php?t=help&a=save_help&lang='+lang, {what: what, help: help}, function(){
+ try {
+ $('#help_'+what).attr('qtip', '').qtip('destroy');
+ }
+ catch (e) {
+ /*alert("Napaka"+e)*/
+ };
+ });
+}
+
function saveGlobalSetting(what)
{
var state = $("input[name="+what+"]:checked").val();
@@ -2517,34 +2471,25 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
if (advanced == 1) {
if ($("#tip_preview_sub_"+tip).length > 0) {
- var pos = $("p[tip="+tip+"]", "#toolbox_add_advanced").offset();
- var width = $("p[tip="+tip+"]", "#toolbox_add_advanced").width();
+
+ $("#tip_preview").css({"left":"520px"});
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- // prikažemo glevni div
+ // prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
$("[name=tip_preview_sub]:visible", "#tip_preview").hide();
$("#tip_preview_sub_"+tip).show();
-
- // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
- //var w_height = $(window).height();
- var height = $("#tip_preview").height();
- //if(w_height < height + pos.top){
- $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
- //}
}
// preview v toolboxu levo
} else {
if ($("#tip_preview_sub_"+tip).length > 0) {
- var pos = $("p[tip="+tip+"]:not(.adv)", "#toolbox_basic").offset();
- var width = $("p[tip="+tip+"]:not(.adv)", "#toolbox_basic").width();
- $("#tip_preview").css( { "left": (13+pos.left + width) + "px", "right":"auto", "top":(pos.top) + "px" } );
- // prikažemo glevni div
+ $("#tip_preview").css({"left":"245px"});
+
+ // prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
@@ -2573,7 +2518,6 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
$("#tip_preview").css( { "right": ($(window).width()-cnt.left) + "px", "left":"auto", "top":(10+pos.top) + "px" } );
else
$("#tip_preview").css( { "right": ($(window).width()-cnt.left) + "px", "left":"auto", "top":(10+pos.top) + "px" } );
- //$("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
// prikažemo glavni div
$("#tip_preview").show();
@@ -2601,241 +2545,194 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
}
function show_tip_preview(spr, value) {
-// if ($("#tip_preview").is(':hidden'))
if ( $('select#spremenljivka_tip_'+spr).attr('data-ajax') == 'true' ) {
show_tip_preview_toolbox(0, value);
return;
}
+
+ // To zacasno izklopimo - mogoce tega raje ne uporabljamo??
//pozicioniramo div
- var pos = $("#spremenljivka_tip_"+spr).offset();
- var width = $("#spremenljivka_tip_"+spr).width();
+ /*var pos = $("#vprasanje_float_editing").offset();
var body = $('body').width();
- //$("#tip_preview").css( { "left": (10+pos.left + width) + "px", "top":(10+pos.top) + "px" } );
- $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
+
+ $("#tip_preview").css( { "left":"auto", "right": "360px", "top": "250px" } );
+
// prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
$("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_"+value).show();
-}
-function show_tip_preview_first(value) {
-
- if(value < 5 || value == 7 || value == 21)
- stolpec = 1;
- else if(value == 6 || value == 16 || value == 19 || value == 20)
- stolpec = 2;
- else if(value == 5 || value == 8 || value == 17 || value == 18)
- stolpec = 3;
- else if(value > 8 && value < 16)
- stolpec = 'SN';
- else
- stolpec = 4;
-
- //pozicioniramo div
- var pos = $(".questions"+stolpec).offset();
- var width = $(".questions"+stolpec).width();
- var height = $(".questions"+stolpec).height();
-
- if(stolpec == 1 || stolpec == 3)
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- else if(stolpec == 2 || stolpec == 4)
- $("#tip_preview").css( { "left": (pos.left - 200) + "px", "right":"auto", "top":(10+pos.top+height) + "px" } );
- else
- $("#tip_preview").css( { "left": (pos.left - 250) + "px", "right":"auto", "top":(10+pos.top+height) + "px" } );
-
- // prikažemo glevni div
- $("#tip_preview").show();
+ $("#tip_preview_sub_"+value).show();*/
+}
- // priredimo še vsebino
- $("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_"+value).show();
+//preview pri design, orientation in grid subtype dropdownu (ranking, radio b, multigrid)
+function show_tip_preview_subtype(spr, design, tip) {
-}
-function nova_spremenljivka_type(type) {
- $("#tip_preview").hide();
+ //ranking
+ if(tip == '17'){
+ if(design == '0')
+ val = '17';
+ else if(design == '1')
+ val = '17_1';
+ else
+ val = '17_2';
+ }
- if (srv_meta_branching == 1) {
- $('#branching').load('ajax.php?t=branching&a=spremenljivka_new', {anketa: srv_meta_anketa_id, q_type:type}, function() {
- refreshRight();
- refreshBottomIcons('gray');
- });
+ //SN generator imen
+ else if(tip == '9'){
+ if(design == '0')
+ val = '9';
+ else if(design == '1')
+ val = '9_1';
+ else if(design == '2')
+ val = '9_2';
+ else if(design == '3')
+ val = '9_3';
+ }
- } else {
- $('#vprasanja').load('ajax.php?a=nova_spremenljivka', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa, q_type:type}, function() {
- $("#grupe").load('ajax.php?a=refresh_grupe', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa});
- refreshBottomIcons('gray');
- });
+ //multigrid
+ else if(tip == '6'){
+ if(design == '0')
+ val = '6';
+ else if(design == '1')
+ val = '6_1';
+ else if(design == '2')
+ val = '6_2';
+ else if(design == '3')
+ val = '6_3';
+ else if(design == '4')
+ val = '6_4';
+ else if(design == '5')
+ val = '6_5';
+ else if(design == '6')
+ val = '6_6';
+ else if(design == '8')
+ val = '6_8';
+ else if(design == '9')
+ val = '6_9';
+ else if(design == '10')
+ val = '6_10';
}
-}
-//preview pri design, orientation in grid subtype dropdownu (ranking, radio b, multigrid)
-function show_tip_preview_subtype(spr, design, tip) {
-// if ($("#tip_preview").is(':hidden'))
- {
- //ranking
- if(tip == '17'){
- if(design == '0')
- val = '17';
- else if(design == '1')
- val = '17_1';
- else
- val = '17_2';
- }
+ //radio
+ else if(tip == '1'){
+ if(design == '0')
+ val = '1_1';
+ else if(design == '1')
+ val = '1';
+ else if(design == '2')
+ val = '1_2';
+ else if(design == '4')
+ val = '3';
+ else if (design == '5')
+ val = '1_5';
+ else if (design == '6')
+ val = '1_6';
+ else if (design == '8')
+ val = '1_8';
+ else if (design == '9')
+ val = '1_9';
+ else if (design == '10')
+ val = '1_10';
+ else if (design == '11')
+ val = '1_11';
+ }
- //SN generator imen
- else if(tip == '9'){
- if(design == '0')
- val = '9';
- else if(design == '1')
- val = '9_1';
- else if(design == '2')
- val = '9_2';
- else if(design == '3')
- val = '9_3';
- }
+ //checkbox
+ else if(tip == '2'){
+ if(design == '1')
+ val = '2';
+ else if(design == '0')
+ val = '2_1';
+ else if(design == '2')
+ val = '2_2';
+ else if (design == '6')
+ val = '1_6';
+ else if (design == '8')
+ val = '2_8';
+ else if (design == '10')
+ val = '2_10';
+ else
+ val = '2';
- //multigrid
- else if(tip == '6'){
- if(design == '0')
- val = '6';
- else if(design == '1')
- val = '6_1';
- else if(design == '2')
- val = '6_2';
- else if(design == '3')
- val = '6_3';
- else if(design == '4')
- val = '6_4';
- else if(design == '5')
- val = '6_5';
- else if(design == '6')
- val = '6_6';
- else if(design == '8')
- val = '6_8';
- else if(design == '9')
- val = '6_9';
- else if(design == '10')
- val = '6_10';
- }
+ }
- //radio
- else if(tip == '1'){
- if(design == '0')
- val = '1_1';
- else if(design == '1')
- val = '1';
- else if(design == '2')
- val = '1_2';
- else if(design == '4')
- val = '3';
- else if (design == '5')
- val = '1_5';
- else if (design == '6')
- val = '1_6';
- else if (design == '8')
- val = '1_8';
- else if (design == '9')
- val = '1_9';
- else if (design == '10')
- val = '1_10';
- else if (design == '11')
- val = '1_11';
- }
+ else if (tip == '21') {
+ if (design == '1')
+ val = '21_1';
+ else if (design == '2')
+ val = '21_2';
+ else if (design == '3')
+ val = '21_3';
+ else if (design == '4')
+ val = '21_4';
+ else if (design == '5')
+ val = '21_5';
+ else if (design == '6')
+ val = '21_6';
+ else if (design == '7')
+ val = '21_7';
+ }
- //checkbox
- else if(tip == '2'){
- if(design == '1')
- val = '2';
- else if(design == '0')
- val = '2_1';
- else if(design == '2')
- val = '2_2';
- else if (design == '6')
- val = '1_6';
- else if (design == '8')
- val = '2_8';
- else if (design == '10')
- val = '2_10';
- else
- val = '2';
+ else if (tip == '23') {
+ val = design;
+ }
- }
+ else if (tip == '5') {
+ if(design == '2')
+ val = '5_2';
+ }
- else if (tip == '21') {
- if (design == '1')
- val = '21_1';
- else if (design == '2')
- val = '21_2';
- else if (design == '3')
- val = '21_3';
- else if (design == '4')
- val = '21_4';
- else if (design == '5')
- val = '21_5';
- else if (design == '6')
- val = '21_6';
- else if (design == '7')
- val = '21_7';
- }
+ // lokacija
+ else if(tip == '26'){
+ if(design == '2')
+ val = '26_2';
+ else if(design == '1')
+ val = '26_1';
+ }
- else if (tip == '23') {
- val = design;
- }
+ // slider
+ else if (tip == '7') {
+ val = '7_2';
+ }
- else if (tip == '5') {
- if(design == '2')
- val = '5_2';
- }
- // lokacija
- else if(tip == '26'){
- if(design == '2')
- val = '26_2';
- else if(design == '1')
- val = '26_1';
- }
+ // normalno
+ if (spr >= 0) {
- // slider
- else if (tip == '7') {
- val = '7_2';
- }
+ //pozicioniramo div
+ var pos = $("#spremenljivka_podtip_"+spr).offset();
+ var width = $("#spremenljivka_podtip_"+spr).width();
+ var body = $('body').width();
+ $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
- // normalno
- if (spr >= 0) {
+ // prikažemo glavni div
+ $("#tip_preview").show();
- //pozicioniramo div
- var pos = $("#spremenljivka_podtip_"+spr).offset();
- var width = $("#spremenljivka_podtip_"+spr).width();
- var body = $('body').width();
- //$("#tip_preview").css( { "left": (pos.left) + "px", "right":"auto", "top":(100+pos.top) + "px" } );
- $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
+ // priredimo še vsebino
+ $("[name=tip_preview_sub]:visible").hide();
+ $("#tip_preview_sub_" + val).show();
- // pri popuupu za dodajanje advanced tipov vprasanj
- } else {
+ // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
+ var height = $("#tip_preview").height();
+ $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
+ }
+ // pri popuupu za dodajanje advanced tipov vprasanj
+ else {
- //pozicioniramo div
- var pos = $("#toolbox_add_advanced p[tip="+tip+"][podtip="+design+"]").offset();
- var width = $("#toolbox_add_advanced p[tip="+tip+"][podtip="+design+"]").width();
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- }
+ // pozicioniramo div
+ $("#tip_preview").css({"left":"520px"});
- // prikažemo glavni div
- $("#tip_preview").show();
- }
- // priredimo še vsebino
- $("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_" + val).show();
+ // prikažemo glavni div
+ $("#tip_preview").show();
- // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
- //var w_height = $(window).height();
- var height = $("#tip_preview").height();
- //if(w_height < height + pos.top){
- $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
- //}
+ // priredimo še vsebino
+ $("[name=tip_preview_sub]:visible").hide();
+ $("#tip_preview_sub_" + val).show();
+ }
}
// skrijemo div za preview
@@ -2845,8 +2742,10 @@ function hide_tip_preview () {
}
function edit_email_invitations(id) {
+
$('#div_float_editing').html('');
$('#div_float_editing').fadeIn("slow");
+
if (id == 0) {
var email_subject = $("#email_subject").val();
var email_text = $("#email_text").val();
@@ -2855,11 +2754,11 @@ function edit_email_invitations(id) {
create_editor('template_text_'+id);
}
).draggable({delay:100, ghosting: true , cancel: 'input, textarea, select, .buttonwrapper'});
- } else {
+ }
+ else {
$('#div_float_editing').load('ajax.php?a=edit_email_invitations', {anketa: srv_meta_anketa_id, id: id},
function () {
CKEDITOR.replace('template_text_'+id);
-// create_editor('template_text_'+id);
}
).draggable({delay:100, ghosting: true , cancel: 'input, textarea, select, .buttonwrapper'});
}
@@ -3172,18 +3071,18 @@ function survey_chaneg_type_cancle() {
$('#fade').fadeOut('slow');
}
function preview_spremenljivka(spremenljivka, lang_id) {
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').html('').fadeIn('slow');
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').load('ajax.php?a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran}).draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').load('ajax.php?a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran})/* .draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'}) */;
}
function preview_spremenljivka_analiza(spremenljivka, lang_id) {
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').html('').fadeIn('slow');
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').load('ajax.php?t=analysis&a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran}).draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').load('ajax.php?t=analysis&a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran})/* .draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'}) */;
}
-function preview_spremenljivka_cancle() {
+function preview_spremenljivka_cancel() {
$('#fullscreen').hide();
if ($('#vprasanje').css('display') != 'block') {
$('#fade').fadeOut('slow');
@@ -3230,9 +3129,9 @@ function IE7_select_disabled_fix () {
function change_alert_respondent(what,el) {
var id = el.attr("id");
var checked = $("#alert_"+what).is(':checked');
- $("span#label_alert_"+what).load('ajax.php?a=change_alert_respondent', {anketa: srv_meta_anketa_id, checked: checked, what:what});
+ $("#label_alert_"+what).load('ajax.php?a=change_alert_respondent', {anketa: srv_meta_anketa_id, checked: checked, what:what});
}
-function chnage_alert_instruction(el) {
+function change_alert_instruction(el) {
var checked = el.is(':checked');
if (checked) {
$("#alert_respondent_cms_instruction").show();
@@ -3243,10 +3142,10 @@ function chnage_alert_instruction(el) {
function alert_add_necessary_sysvar(what,el) {
var id = el.attr("id");
var checked = $("#alert_"+what).is(':checked');
- $("span#label_alert_"+what).load('ajax.php?a=alert_add_necessary_sysvar', {anketa: srv_meta_anketa_id, checked: checked, what:what});
+ $("div#label_alert_"+what).load('ajax.php?a=alert_add_necessary_sysvar', {anketa: srv_meta_anketa_id, checked: checked, what:what});
}
function alert_change_user_from_cms(what, el) {
- $("span#label_alert_"+what).load('ajax.php?a=alert_change_user_from_cms', {anketa: srv_meta_anketa_id});
+ $("div#label_alert_"+what).load('ajax.php?a=alert_change_user_from_cms', {anketa: srv_meta_anketa_id});
}
function alert_edit_if (type, uid) {
@@ -3297,19 +3196,9 @@ function edit_glasovanje(spremenljivka, results, what){
function glas_extra_settings(){
$('.more').toggle();
$('.less').toggle();
- $('#glas_extra_settings').toggle();
-}
-
-//reload za editiranje uvoda/zakljucka pri formi
-/*function load_formIO(spremenljivka, what){
- $("#question_holder").load('ajax.php?a=form_extra', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, what: what});
+ $('#glas_extra_settings').slideToggle();
}
-//reload za editiranje uvoda/zakljucka pri glasovanju
-function load_glasIO(spremenljivka, what){
- $("#question_holder").load('ajax.php?a=form_extra', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, what: what});
-}*/
-
//hitre nastavitve za formo - what je spremenljivka, ki jo spreminjamo
function edit_form_settings(spremenljivka, results, what){
@@ -3426,13 +3315,57 @@ function newAnketaTemplate() {
}
if(ank_id == '' || ank_id < 1){
- alert(lang['srv_newSurvey_survey_template_error']);
+ genericAlertPopup('srv_newSurvey_survey_template_error');
}
else{
$.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id:ank_id, naslov:naslov, akronim:akronim, folder:folder});
}
}
+// preveri ali je uploadana datoteka .1ka in pokazi obvestilo
+function checkFileExtension1ka() {
+ var fileName = document.getElementById("restore").value;
+ var fileExtension = fileName.split(".").pop().toLowerCase();
+
+ if(fileName){
+ document.getElementById("file-input-label-populated").textContent = fileName.split("\\").pop();
+
+ document.getElementById("info_text_populated").style.display = "block";
+ document.getElementById("info_text_empty").style.display = "none";
+
+ document.getElementById("file-input-label-clear").style.display = "inline-block";
+ document.getElementById("file-input-label-empty").style.display = "none";
+ document.getElementById("file-input-label-populated").style.display = "inline-block";
+
+ if (fileExtension === "1ka") {
+ document.getElementById("1ka_file_approved_text").style.display = "block";
+ document.getElementById("1ka_file_not_approved_text").style.display = "none";
+ document.getElementById("noSurvey_create").disabled = false;
+ } else {
+ document.getElementById("1ka_file_approved_text").style.display = "none";
+ document.getElementById("1ka_file_not_approved_text").style.display = "block";
+ document.getElementById("noSurvey_create").disabled = true;
+ }
+ }
+ else{
+ document.getElementById("info_text_populated").style.display = "none";
+ document.getElementById("info_text_empty").style.display = "block";
+
+ document.getElementById("file-input-label-clear").style.display = "none";
+ document.getElementById("file-input-label-empty").style.display = "block";
+ document.getElementById("file-input-label-populated").style.display = "none";
+
+ document.getElementById("1ka_file_approved_text").style.display = "none";
+ document.getElementById("1ka_file_not_approved_text").style.display = "none";
+ document.getElementById("noSurvey_create").disabled = true;
+ }
+}
+
+function clearFileInput() {
+ document.getElementById("restore").value = "";
+ checkFileExtension1ka();
+}
+
// Preview vprasanj pri uvozu ankete iz besedila
function anketaFromText_preview(text) {
@@ -3661,12 +3594,19 @@ function recalc_alert_expire(days) {
// enablamo in disablamo vnos max stevila glasov (trajanje)
function voteCountStatus(status) {
+
if (status == 1 || status == 2) {
- $('#vote_count').removeAttr('disabled');
- $('.vote_limit_warning').show();
+ $('#vote_limit_warning').removeClass('displayNone');
+ $('#vote_limit').removeClass('bottom0');
} else {
- $('#vote_count').attr('disabled', true);
- $('.vote_limit_warning').hide();
+ $('#vote_limit_warning').addClass('displayNone');
+ $('#vote_limit').addClass('bottom0');
+ }
+
+ if (status == 1) {
+ $('#vote_limit_all_warning').removeClass('displayNone');
+ } else {
+ $('#vote_limit_all_warning').addClass('displayNone');
}
}
function voteCountToggle(status) {
@@ -3678,6 +3618,7 @@ function voteCountToggle(status) {
}
function survey_statistic_referal(what) {
+
if ($(what).attr('value') == '0') { // nalozimo vsebino samo prvi klik
var type = $("#type").val();
var period = $("#period").val();
@@ -3688,15 +3629,19 @@ function survey_statistic_referal(what) {
$("#survey_referals").slideDown();
$(what).attr('value','1');
});
- } else if ($(what).attr('value') == '1') { // skrijemo
+ }
+ else if ($(what).attr('value') == '1') { // skrijemo
$("#survey_referals").slideUp();
$(what).attr('value','2');
- } else { // prikazemo
+ }
+ else { // prikazemo
$("#survey_referals").slideDown();
$(what).attr('value','1');
}
}
+
function ip_list_podrobno (what) {
+
if ($(what).attr('value') == '0') { // nalozimo vsebino samo prvi klik
var type = $("#type").val();
var period = $("#period").val();
@@ -3707,20 +3652,15 @@ function ip_list_podrobno (what) {
$("#ip_list_podrobno").slideDown();
$(what).attr('value','1');
});
- } else if ($(what).attr('value') == '1') { // skrijemo
+ }
+ else if ($(what).attr('value') == '1') { // skrijemo
$("#ip_list_podrobno").slideUp();
$(what).attr('value','2');
- } else { // prikazemo
+ }
+ else { // prikazemo
$("#ip_list_podrobno").slideDown();
$(what).attr('value','1');
}
-/*
- if ($('#ip_list_podrobno').css('display') == 'none') {
- $('#ip_list_podrobno').slideDown();
- } else {
- $('#ip_list_podrobno').slideUp();
- }
- */
}
function survey_statistic_status(status) {
$('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
@@ -3749,7 +3689,7 @@ function save_user_settings() {
var icons_always_on = $("input[name=icons_always_on]:checked").val();
var full_screen_edit = $("input[name=full_screen_edit]:checked").val();
$.post('ajax.php?a=save_user_settings', {icons_always_on: icons_always_on, full_screen_edit: full_screen_edit}, function() {
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -3760,24 +3700,13 @@ function updateManual1() {
$("#radioManual1").attr("checked", "checked");
}
-function show_success_save(timeout){
-
- if (timeout == undefined)
- timeout = 2500;
-
- $(".btn_savesettings").addClass('ovalbutton_orange').removeClass('ovalbutton_orange');
- $('#success_save').load('ajax.php?a=display_success_save', {anketa: srv_meta_anketa_id}).show();
-
- setTimeout(function() {$('#success_save').animate({opacity:0})}, timeout);
-}
-
function chnage_full_screen_edit() {
//srv_meta_full_screen_edit = $("input[name=full_screen_edit]:checked").val();
srv_meta_full_screen_edit = $("input[name=full_screen_edit]").is(':checked') ? 1 : 0;
$.post('ajax.php?a=save_user_settings', {anketa: srv_meta_anketa_id, full_screen_edit: srv_meta_full_screen_edit}, function() {
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -3826,9 +3755,16 @@ function doExcelExport() {
//return false;
*/
}
-function excelExportChangeDelimit() {
- $('#replace_export_delimit_semicolon').toggle();
- $('#replace_export_delimit_comma').toggle();
+function excelExportChangeDelimit($param) {
+ if ($param == 1) {
+ $('#replace_export_delimit_semicolon').removeClass('displayNone');
+ $('#replace_export_delimit_comma').addClass('displayNone');
+ }
+ else if ($param == 2) {
+ $('#replace_export_delimit_semicolon').addClass('displayNone');
+ $('#replace_export_delimit_comma').removeClass('displayNone');
+ }
+
return false;
}
@@ -3899,6 +3835,25 @@ function check_valid_variable(variable) {
return result;
}
+function check_valid_radio_variable(variable) {
+
+ var ValidPattern = /^[0-9\-]*$/;
+ var result = '';
+
+ for (var i=0; i<variable.length; i++) {
+ var chr = variable.charAt(i);
+
+ // Radio ima lahko samo number
+ if (ValidPattern.test(chr) ){
+ result = result + chr;
+ }
+ }
+
+ result = result.substring(0, 15);
+
+ return result;
+}
+
function clearDefaultValue(el) {
if (el.defaultValue==el.value) el.value = ""
}
@@ -3910,6 +3865,22 @@ function showSearch() {
$('#searchSurvey').animate({width: 'toggle'});
}
+// search for data table
+function showDataTableSearch() {
+ if($('#data_search_value').is(":visible"))
+ $('#data_search_filter').css('background-color', '#f8f8f8');
+ else
+ $('#data_search_filter').css('background-color', 'white');
+
+ $('#data_search_value').animate({width: 'toggle'});
+}
+
+// clear search for data table
+function clearDataTableSearch() {
+ $('#data_search_value').val('');
+ data_search_filter();
+}
+
function showSearchb() {
//$('#searchSurvey').toggle("blind", { direction: 'horizontal', start: }, 500);
//$('#searchSurvey').animate({width: 'toggle'});
@@ -3929,11 +3900,11 @@ function showAdvancedSearch(){
if ($('#advancedSearch').is(":visible")) {
$('#advancedSearch').slideUp('slow');
- $('#searchSettings').find('.minus').removeClass('minus').addClass('plus');
+ $('#advanced_settings_button').removeClass('active');
}
else {
$('#advancedSearch').slideDown('slow');
- $('#searchSettings').find('.plus').removeClass('plus').addClass('minus');
+ $('#advanced_settings_button').addClass('active');
}
}
@@ -4010,6 +3981,35 @@ function dostopPassiveShowAll(show_hide) {
}
}
+function dostopNoteToggle () {
+
+ if($('#addusers_note_checkbox').is(':checked')){
+ $('#addusers_note').removeClass('displayNone');
+ }
+ else{
+ $('#addusers_note').addClass('displayNone');
+ }
+}
+
+// Ajax klic za dodajanje dostopa in posiljanje obvestila
+function dostopAddAccess () {
+
+ var addusers = $('#addusers').val();
+ var addusers_note = '';
+ if($('#addusers_note_checkbox').is(':checked')){
+ addusers_note = $('#addusers_note').val();
+ }
+
+ // Popup z rezultatom (uspesno ali neuspesno dodajanje dostopa)
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=add_survey_dostop_popup', {addusers:addusers, addusers_note:addusers_note, anketa:srv_meta_anketa_id}, function(){
+
+ // Refresh vsebine v ozadju
+ $("#globalSetingsList").load('ajax.php?a=refresh_dostop_settings', {anketa:srv_meta_anketa_id});
+ });
+}
+
function comments_admin_toggle (type) {
if ( $('#comments_admin'+type).attr('admin_on') == 'true' ) {
comments_admin_off(type);
@@ -4228,10 +4228,8 @@ function add_to_library(anketa,where) {
$.post('ajax.php?a=add_to_library', {anketa:anketa, where:where});
}
-function create_archive_survey(anketa, msg) {
+function create_archive_survey(anketa) {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
- $('#fullscreen').append('<div id="survey_archive_note">'+msg+'</div>');
$.post('index.php?anketa='+anketa+'&a=backup_create', {intro_opomba: $('#intro_opomba').val()},
function() {
window.location.reload();
@@ -4239,10 +4237,8 @@ function create_archive_survey(anketa, msg) {
return false;
}
-function create_archive_survey_data(anketa, msg) {
+function create_archive_survey_data(anketa) {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
- $('#fullscreen').append('<div id="survey_archive_note">'+msg+'</div>');
$.post('ajax.php?anketa='+anketa+'&a=backup_data&data=true', {intro_opomba: $('#intro_opomba').val()},
function() {
window.location.reload();
@@ -4315,7 +4311,7 @@ function surveyBaseSettingRadio(what,foreceReload) {
//} else if (data.action == 1) {
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
}
@@ -4327,7 +4323,7 @@ function surveyBaseSettingText(what,refresh) {
} else if ($('[name='+what+']').length) {
value = $('[name='+what+']').val();
} else {
- alert('Error while saving!');
+ genericAlertPopup('alert_save_error');
return false;
}
@@ -4340,7 +4336,7 @@ function surveyBaseSettingText(what,refresh) {
// todo show save window
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
}
@@ -4354,9 +4350,9 @@ function alert_custom(type, uid) {
}
-function exportChangeCheckbox (name) {
-
- $.post('ajax.php?a=exportChangeCheckbox', {anketa:srv_meta_anketa_id, name:name});
+function exportChangeCheckbox () {
+ var value = $("input[name=exportSetting]:checked").val();
+ $.post('ajax.php?a=exportChangeCheckbox', {anketa:srv_meta_anketa_id, value:value});
}
function exportChangeRadio (id,name) {
@@ -4364,17 +4360,43 @@ function exportChangeRadio (id,name) {
$.post('ajax.php?a=exportChangeRadio', {anketa:srv_meta_anketa_id, id:id, name:name, value:value});
}
function setExpirePermanent() {
+ // check for warnings of IF
+ $.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: srv_meta_anketa_id}, function (data) {
+ // if there are warning, we dont allow change of statement
+ if (data !== '1') {
+ //reset checkox to initial state
+ $("#expirePermanent").prop('checked', !$("#expirePermanent").is(':checked'));
+ $('#fade').fadeTo('slow', 1);
+ $('#fullscreen').html('').fadeIn('slow');
+ // aktiviramo anketo in prikažemo okno
+ $("#fullscreen").load('ajax.php?a=anketa_show_activation', {anketa: srv_meta_anketa_id, folders: folders, izpis:'only_warnings'}, function() {
+ });
+ }
+ //all ok, proced with set permanent
+ else{
+ setExpirePermanentSetting();
+ }
+ });
+}
+function setExpirePermanentSetting() {
makePermanent = $("#expirePermanent").is(':checked');
$.post('ajax.php?a=setExpirePermanent', {anketa:srv_meta_anketa_id, makePermanent:makePermanent}, function (data) {
data = jQuery.parseJSON(data);
if (data.permanent == '0') {
- // pokažemo koledarcek
- $("#expire_img_manual1").show();
+ // enablamo polje
+ $("#expireManual1").removeClass("disabled");
+ $("#expire").find(".ui-datepicker-trigger").removeClass("disabled");
+
} else {
- // skrijemo koledarcek
- $("#expire_img_manual1").hide();
+ // disablamo polje
+ $("#expireManual1").addClass("disabled");
+ $("#expire").find(".ui-datepicker-trigger").addClass("disabled");
+
}
$("#expireManual1").val(data.expire);
+
+ // reload, da se na strani prika#e anketa kot aktivna (switch, link,...)
+ window.location.reload(); return;
});
}
@@ -4389,35 +4411,25 @@ function changeDoCMSUserFilterCheckbox() {
function anketa_restore(anketa) {
- if ( confirm('?') ) {
-
+ if ( confirm(lang['srv_anketa_deleted_restore_confirm']) ) {
$.post('ajax.php?a=anketa_restore', {id: anketa}, function () {
-
window.location.href = 'index.php?anketa='+anketa;
-
})
-
}
-
}
function data_restore(anketa) {
- if ( confirm('?') ) {
-
+ if ( confirm(lang['srv_data_deleted_restore_confirm']) ) {
$.post('ajax.php?a=data_restore', {id: anketa}, function () {
-
window.location.href = 'index.php?anketa='+anketa;
-
})
-
}
-
}
function deleteSurveyDataFile(note) {
if (confirm(note)) {
- $.post('ajax.php?a=deleteSurveyDataFile', {anketa:srv_meta_anketa_id}, function (result) {alert(result)});
+ $.post('ajax.php?a=deleteSurveyDataFile', {anketa:srv_meta_anketa_id}, function (result) {genericAlertPopup('alert_parameter_response',response)});
}
}
function userGlobalSettingChange(what) {
@@ -4430,7 +4442,7 @@ function userGlobalSettingChange(what) {
var state = $(what).is(':checked') ? value : '0';
$.post('ajax.php?t=globalUserSettings', {name:name, value:state}, function (data) {});
} else {
- alert("TODO:userGlobalSettingChange ("+type+")");
+ genericAlertPopup('alert_userGlobalSettingChange',type);
}
}
function changeSurveyLock(what) {
@@ -4505,8 +4517,8 @@ function testiranje_preview_settings_save () {
function showTestSurveySMTP()
{
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=showTestSurveySMTP', $('form[name="settingsanketa_'+srv_meta_anketa_id+'"]').serialize(), function() {});
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=showTestSurveySMTP', $('form[name="settingsanketa_'+srv_meta_anketa_id+'"]').serialize(), function() {});
return false;
}
@@ -4514,7 +4526,7 @@ function showTestSurveySMTP()
function showSurveyUrlLinks(podstran, m)
{
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
+ $('#fullscreen').html('').addClass('divPopUp').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=SurveyUrlLinks&a=showLinks',
{
anketa:srv_meta_anketa_id,
@@ -4524,7 +4536,7 @@ function showSurveyUrlLinks(podstran, m)
return false;
}
-function addSurveyUrlLink(podstran ,m)
+function addSurveyUrlLink(podstran, m)
{
$("#fullscreen").load('ajax.php?t=SurveyUrlLinks&a=addLink',
{
@@ -4556,13 +4568,28 @@ function changeParaAnalysisCbx(what, reverse) {
value = !value;
}
var what_id = $(what).attr('id');
-
+
$.post('ajax.php?t=ParaAnalysis&a=setCbx', {anketa: srv_meta_anketa_id,value:value,what:what_id}, function () {
window.location.reload();
});
return false;
}
+
+function check_para_wrap() {
+
+ var value = $("#show_with_zero").is(":checked");
+ if (value) {
+ $("#scroll1").removeClass("table-horizontal-scroll-wrapper1");
+ $("#scroll2").removeClass("table-horizontal-scroll-wrapper2");
+ }
+ else {
+ $("#scroll1").addClass("table-horizontal-scroll-wrapper1");
+ $("#scroll2").addClass("table-horizontal-scroll-wrapper2");
+ }
+
+}
+
function changeParaAnalysisSelect(what) {
var value = $(what).val();
@@ -4660,17 +4687,24 @@ function toggleAdvancedModule(what, reload){
function toggleDataCheckboxes(podstran){
+ if (podstran == 'paraAnalysisGraph'){
+ $("#anketa").addClass("drop_setting_transition");
+ $("#anketa").toggleClass("drop_setting_margin");
+ }
+
if($('#dataSettingsCheckboxes').css('display') == 'none'){
- $("#dataSettingsCheckboxes").slideDown("slow");
+ $("#dataSettingsCheckboxes").fadeIn("medium");
+ $("#toggleDataCheckboxes").addClass("active");
var showSettings = 1;
-
- $(".dropdown_blue").switchClass("dropdown_blue", "dropup_blue");
+
+ $(".fa-angle-down").switchClass("fa-angle-down", "fa-angle-up");
}
else{
- $("#dataSettingsCheckboxes").slideUp("slow");
+ $("#dataSettingsCheckboxes").fadeOut("medium");
+ $("#toggleDataCheckboxes").removeClass("active");
var showSettings = 0;
- $(".dropup_blue").switchClass("dropup_blue", "dropdown_blue");
+ $(".fa-angle-up").switchClass("fa-angle-up", "fa-angle-down");
}
if(podstran == 'data'){
@@ -4683,6 +4717,28 @@ function toggleDataCheckboxes(podstran){
}
}
+function toggle_drop_settings_margin(){
+ $("#anketa").addClass("drop_setting_margin");
+}
+
+// Preklop tabele s podatki - fullscreen / navaden pogled
+function data_fullscreen(data_fullscreen){
+
+ // Fullscreen
+ if(data_fullscreen == 1){
+ $('body').addClass('data_fullscreen');
+ $('#data_fullscreen_1').addClass('active');
+ $('#data_fullscreen_0').removeClass('active');
+ }
+ else{
+ $('body').removeClass('data_fullscreen');
+ $('#data_fullscreen_0').addClass('active');
+ $('#data_fullscreen_1').removeClass('active');
+ }
+
+ $.post('ajax.php?t=dataSettingProfile&a=changeDataFullscreen', {anketa: srv_meta_anketa_id, data_fullscreen:data_fullscreen});
+}
+
// Iskanje po tabeli s podatki
function data_search_filter(){
@@ -4789,12 +4845,9 @@ function diagnosticsParadataChooseDate(){
});
}
function changeSelectOption(){
- //console.log($("#diagnostics_date_selected").val());
- //console.log($("#diagnostics_date_selected").find(":selected").val());
$("#diagnostics_date_selected").find(":selected").prop('selected',false);
//$("#diagnostics_date_selected option").find("[value=99data]").prop('selected',true);
$("#option_99date").prop('selected',true);
- //console.log($("#diagnostics_date_selected").find(":selected").val());
diagnosticsChooseDate();
}
/** END FLOAT HEADER function for tables and div **/
@@ -4809,21 +4862,22 @@ function inline_jezik_edit(id_value){
id.siblings('.sb-edit').hide();
id.replaceWith('<div class="fixed-position"><div id="vrednost_edit">'+
+
+ '<h2><span class="faicon edit-vprasanje st-besede-popup blue"></span><span>'+lang['srv_editor_title']+'</span></h2>'+
+
+ '<div class="popup_close"><a href="#" onclick="inline_jezik_reset(\''+id_value+'\');">✕</a></div>'+
- '<br><textarea name="'+id_value+'" id="'+id_value+'">'+id.html()+'</textarea>'+
+ '<textarea name="'+id_value+'" id="'+id_value+'">'+id.html()+'</textarea>'+
// Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
- '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea><br />'+
+ '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea>'+
- // Gumb shrani
- '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_jezik_save(\''+id_value+'\');">'+
- '<span>'+lang['save']+'</span>'+
- '</a></span>'+
-
- // Gumb zapri
- '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inline_jezik_reset(\''+id_value+'\');">'+
- '<span>'+lang['srv_zapri']+'</span>'+
- '</a></span><br><br>'+
+ // Gumb shrani / zapri
+
+ '<div class="button_holder popup">'+
+ '<button class="white-blue medium" onclick="inline_jezik_reset(\''+id_value+'\');">'+lang['srv_zapri']+'</button>'+
+ '<button class="blue medium" onclick="inline_jezik_save(\''+id_value+'\');">'+lang['save']+'</button>'+
+ '</div>'+
'</div></div>');
@@ -4951,6 +5005,125 @@ function close_API_window(){
}
+// Prikaz popupap za izvoz paketa anket
+function archive_surveys_display_export(){
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=display_export');
+}
+
+// Toggle checkboxov za seznam anket za izvoz
+function archive_surveys_export_toggle(val){
+
+ // oznacimo vse checkboxe
+ if(val == 1){
+ $(".survey_archive_checkbox").attr("checked", "true");
+ $("#switch_on").addClass("displayNone");
+ $("#switch_off").removeClass("displayNone");
+ }
+ else{
+ $('.survey_archive_checkbox').removeAttr('checked');
+ $("#switch_off").addClass("displayNone");
+ $("#switch_on").removeClass("displayNone");
+ }
+
+ archive_surveys_export_counter();
+}
+
+// Posodobimo stevilo oznacenih anket - counter
+function archive_surveys_export_counter(){
+
+ var selectedCheckboxes = $('.survey_archive_checkbox:checked');
+ var selectedCount = selectedCheckboxes.length;
+
+ $('#mass_select_counter_number').text(selectedCount);
+}
+
+// Ustvari paket anket
+function archive_surveys_export(){
+
+ var form_serialize = $("#survey_archive_form").serializeArray();
+
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=export', form_serialize);
+}
+
+// Download Izvoza paketa anket
+function archive_surveys_download_export(url) {
+
+ var link = $('<a>', {
+ href: url,
+ target: '_blank',
+ download: url.substring(url.lastIndexOf('/') + 1)
+ });
+
+ link.on('click', function() {
+ $(this).remove();
+ });
+
+ $('body').append(link);
+ link[0].click();
+
+ popupClose();
+}
+
+// Prikaz popupa za uvoz paketa anket
+function archive_surveys_display_import(){
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=display_import');
+}
+
+// Izbran paket za uvoz - preverimo ce je zip in prikazemo gumb za uvoz
+function archive_surveys_select_import(){
+
+ var fileInput = $('#archive_surveys_input')[0];
+ var fileName = fileInput.value;
+ //var fileName = $('#archive_surveys_input').val();
+ var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
+ var fileSize = fileInput.files[0].size;
+
+ var warningFileSize = 5 * 1024 * 1024;
+ var maxFileSize = 20 * 1024 * 1024;
+
+ // Napaka - paket ni zip
+ if (fileExtension !== 'zip') {
+ $('#archive_surveys_error').removeClass('displayNone');
+ $('#archive_surveys_import_button, #archive_surveys_error2, #archive_surveys_error3').addClass('displayNone');
+ }
+ // Napaka - paket je vecji od 20 mb
+ else if (fileSize > maxFileSize) {
+ $('#archive_surveys_error3').removeClass('displayNone');
+ $('#archive_surveys_import_button, #archive_surveys_error, #archive_surveys_error2').addClass('displayNone');
+ }
+ // Opozorilo - paket je vecji od 5 mb
+ else if (fileSize > warningFileSize) {
+ $('#archive_surveys_error2, #archive_surveys_import_button').removeClass('displayNone');
+ $('#archive_surveys_error, #archive_surveys_error3').addClass('displayNone');
+ }
+ else {
+ $('#archive_surveys_import_button').removeClass('displayNone');
+ $('#archive_surveys_error, #archive_surveys_error2, #archive_surveys_error2').addClass('displayNone');
+ }
+}
+
+// Izvedemo uvoz paketa anket
+function archive_surveys_import(){
+
+ var formData = new FormData($('#restore')[0]);
+
+ $.ajax({
+ url: 'ajax.php?t=archiveSurveys&a=import',
+ type: 'POST',
+ data: formData,
+ processData: false,
+ contentType: false,
+ success: function(response) {
+ $("#general_popup").html(response);
+ }
+ });
+}
+
+
// Nastavitve modula za chat
function chat_save_settings() {
@@ -4958,7 +5131,7 @@ function chat_save_settings() {
var chat_type = $('input[name=chat_type]:checked').val();
$.post('ajax.php?t=chat&a=save_settings', {anketa: srv_meta_anketa_id, code:code, chat_type:chat_type}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -4970,7 +5143,7 @@ function quiz_save_settings() {
var results_chart = $("input[name=quiz_results_chart]:checked").val();
$.post('ajax.php?t=quiz&a=save_settings', {anketa: srv_meta_anketa_id, results:results, results_chart:results_chart}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -4981,7 +5154,7 @@ function advanced_paradata_save_settings() {
var collect_post_time = $("input[name=collect_post_time]:checked").val();
$.post('ajax.php?t=advanced_paradata&a=save_settings', {anketa: srv_meta_anketa_id, collect_post_time:collect_post_time}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
// brisanje vseh podatkov ankete pri naprednih parapodatkih
@@ -5003,8 +5176,27 @@ function panel_save_settings() {
var status_default = $('input[name=status_default]').val();
var url = $('input[name=url]').val();
- $("#globalSettingsInner").load('ajax.php?t=panel&a=save_settings', {anketa: srv_meta_anketa_id, user_id_name:user_id_name, status_name:status_name, status_default:status_default, url:url}, function(){
- show_success_save();
+ var cookie_return = $('input[name=cookie_return]:checked').val();
+
+ var continue_later = 0;
+ continue_later = $('input[name=continue_later]:checked').val();
+
+ $("#globalSettingsInner").load('ajax.php?t=panel&a=save_settings', {anketa: srv_meta_anketa_id, user_id_name:user_id_name, status_name:status_name, status_default:status_default, url:url, cookie_return:cookie_return, continue_later:continue_later}, function(){
+ actionNotePopup('success_save', 'success');
+ });
+}
+
+
+// Nastavitve modula za dostop z emailom
+function email_access_save_settings() {
+
+ var captcha = 0;
+ captcha = $('input[name=captcha]:checked').val();
+
+ var terms_text = $('textarea[name=terms_text]').val();
+
+ $("#globalSettingsInner").load('ajax.php?t=email_access&a=save_settings', {anketa:srv_meta_anketa_id, captcha:captcha, terms_text:terms_text}, function(){
+ actionNotePopup('success_save', 'success');
});
}
@@ -5102,7 +5294,6 @@ function setCheckedClass(element, type, ifId){
//Image HotSpot: brisemo obmocja iz slike
image1.mapster('set', false, loop_id); //spucaj trenutno obmocje iz slike
- //console.log(loop_id);
}
});
@@ -5139,9 +5330,6 @@ function evoli_tm_settings_add_oddelek(tm_id) {
}
-// Zakaj je to tukaj?? - ne sme biti tako, ker drugače povozi funkcijo z istim imenom v main/survey (ce se kdaj klice iz tam - recimo pri komentarjih)
-//function checkBranching(){}
-
// Popravimo crte med vprasanji ce imamo blok s horizontalnim izrisom vprasanj
function blockHorizontalLine(spr_id){
@@ -5187,11 +5375,11 @@ function save1kaRacunSettings(){
}
// Gesla nista enaka
else if(geslo1 != geslo2){
- alert(lang['cms_error_password_incorrect']);
+ genericAlertPopup('cms_error_password_incorrect');
}
// Geslo ni dovolj kompleksno
else if(!complexPassword(geslo1)){
- alert(lang['password_err_complex']);
+ genericAlertPopup('password_err_complex');
}
// Pri popravljanju gesla ga opozorimo, da bo odjavljen
else{
@@ -5241,14 +5429,17 @@ function stringContains(password, allowedChars){
*
* @param id
*/
-function izbrisiAlternativniEmail(id){
- if (confirm(lang['delete_alternative_email'])) {
+function izbrisiAlternativniEmail(id, email){
+
+ if (confirm(lang['alternative_email_delete'] + ' ' + email + '?')) {
+
$.post('ajax.php?a=editanketasettings&m=global_user_myProfile', {
izbrisiAlternativniEmail: 1,
- alternativniEmailId: id
+ alternativniEmailId: id
}).success(function(response){
window.location.reload();
});
+
}
}
@@ -5291,63 +5482,53 @@ function check_akronim() {
/* START FUNKCIJA ZA UREJANJE zakljucka po deaktivaciji - popup v urejanju zakljucka */
function vprasanje_jezik_edit_zakljucek(id_value){
- /*$('#fade').fadeTo('slow', 1);*/
+ $('#fade').fadeTo('slow', 1);
var id = $("#"+id_value);
- id.replaceWith('<div class="fixed-position"><div id="vrednost_edit">'+
-
- '<br /><textarea name="'+id_value+'" id="'+id_value+'">'+id.val()+'</textarea>'+
-
- // Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
- '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.val()+'</textarea><br />'+
+ $('#vrednost_edit').show().html(
+ '<h2><span class="faicon edit-vprasanje st-besede-popup blue"></span><span>'+lang['srv_concl_deactivation_text_edit']+'</span></h2>'+
- // Gumb shrani
- '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="vprasanje_jezik_save_zakljucek(\''+id_value+'\');">'+
- '<span>'+lang['save']+'</span>'+
- '</a></span>'+
-
- // Gumb zapri
- '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="vprasanje_jezik_reset_zakljucek(\''+id_value+'\');">'+
- '<span>'+lang['srv_zapri']+'</span>'+
- '</a></span>'+
-
- '</div></div>');
+ '<div class="popup_close"><a href="#" onclick="inline_jezik_reset(\''+id_value+'\');">✕</a></div>'+
+
+ '<textarea name="popup_'+id_value+'" id="popup_'+id_value+'">'+id.val()+'</textarea>'+
+
+ // Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
+ '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea>'+
+
+ // Gumb shrani / zapri
+ '<div class="button_holder popup">'+
+ '<button class="white-blue medium" onclick="vprasanje_jezik_reset_zakljucek(\''+id_value+'\');">'+lang['srv_zapri']+'</button>'+
+ '<button class="blue medium" onclick="vprasanje_jezik_save_zakljucek(\''+id_value+'\');">'+lang['save']+'</button>'+
+ '</div>'
+ );
- create_editor(id_value);
+ create_editor('popup_'+id_value);
}
-function vprasanje_jezik_reset_zakljucek(id_value){
-
- //$('#fade').fadeOut('slow');
-
- var id = $('#'+id_value);
- var old_val = $("textarea[name=old_val_"+id_value+"]").val();
-
- var par = id.closest('.fixed-position');
-
- CKEDITOR.instances[id_value].destroy();
+function vprasanje_jezik_reset_zakljucek(){
- par.replaceWith('<textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:190px">'+old_val+'</textarea>');
-
- // postavimo se na dno strani
- $('html, body').animate({scrollTop:$(document).height()}, 100);
+ $('#fade').fadeOut('slow');
+ $('#vrednost_edit').hide().html();
}
function vprasanje_jezik_save_zakljucek(id_value){
- var id = $('#'+id_value);
- var par = id.closest('.fixed-position');
-
- CKEDITOR.instances[id_value].destroy();
+ $('#fade').fadeOut('slow');
+
+ CKEDITOR.instances['popup_'+id_value].destroy();
- par.replaceWith('<textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:190px">'+id.val()+'</textarea>');
-
- $('html, body').animate({scrollTop:$(document).height()}, 100, function(){
- vprasanje_save(true);
- });
+ var value = $('#popup_'+id_value).val();
+ $('#'+id_value).val(value);
+
+ $('html, body').animate({scrollTop:$(document).height()}, 100, function(){
+ vprasanje_save(true);
+ });
+
+ $('#vrednost_edit').hide().html();
}
+
function prikaziGoogle2faKodo(){
$('#2fa-display').toggle();
}
@@ -5460,13 +5641,8 @@ $(document).ready(function(){
function consultingPopupOpen(){
$('#fade').fadeTo('slow', 1);
- $('#popup_note').html('').fadeIn('slow');
- $("#popup_note").load('ajax.php?a=consulting_popup_open', {anketa: srv_meta_anketa_id});
-}
-function consultingPopupClose(){
-
- $('#popup_note').fadeOut('slow').html('');
- $('#fade').fadeOut('slow');
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=consulting_popup_open', {anketa: srv_meta_anketa_id});
}
@@ -5475,3 +5651,256 @@ function removeUploadFromData(usr_id, spr_id, code){
$("#fullscreen").load('ajax.php?t=postprocess&a=edit_data_question_upload_delete', {anketa: srv_meta_anketa_id, usr_id: usr_id, spr_id: spr_id, code: code});
}
+
+// Kopiranje URLja za anketo
+function CopyToClipboard(copyText){
+ var temp_copy = $('<input>').val(copyText).appendTo('body').select()
+ document.execCommand('copy')
+ temp_copy.remove()
+}
+
+// Popup - opozorilo na vsa vprašanja
+function popupAlertAll(alert_type){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=alert_all_popup', {alert_type:alert_type, anketa:srv_meta_anketa_id});
+}
+
+
+//Generičen alert popup
+function genericAlertPopup(name, optional_parameter, class_string){
+
+ if (optional_parameter === undefined) {
+ optional_parameter = "";
+ }
+ if (class_string !== undefined) {
+ $('#general_popup').addClass(class_string);
+ }
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=genericAlertPopup', {name:name, optional_parameter:optional_parameter});
+
+}
+
+//Toggle za prikaz nastavitev in opozoril v parapodatkih
+function toggleParapodatki(){
+
+ var survey_ip = $('input[name=survey_ip]:checked').val();
+ var survey_show_ip = $('input[name=survey_show_ip ]:checked').val();
+ var show_email = $('input[name=show_email ]:checked').val();
+
+ if(survey_ip == '0') {
+ $("#save_IP_warning").removeClass('displayNone');
+ $("#save_IP").removeClass('bottom0');
+ $("#connect_IP").removeClass('displayNone');
+ }
+
+ else {
+ $("#save_IP_warning").addClass('displayNone');
+ $("#save_IP").addClass('bottom0');
+ $("#connect_IP").addClass('displayNone');
+ }
+
+ if(survey_show_ip == '1')
+ $("#connect_IP_warning").removeClass('displayNone');
+
+ else
+ $("#connect_IP_warning").addClass('displayNone');
+
+ if(show_email == '1')
+ $("#connect_identifier_warning").removeClass('displayNone');
+
+ else
+ $("#connect_identifier_warning").addClass('displayNone');
+}
+
+
+function popupClose(){
+ $('#general_popup').fadeOut('slow').html('').attr('class', 'divPopUp');
+ $('#fade').fadeOut('slow');
+}
+
+
+// Note popup spodaj levo
+function actionNotePopup(name, type){
+
+ let anketa = (typeof srv_meta_anketa_id !== 'undefined') ? srv_meta_anketa_id : '';
+
+ $('#action_note_holder').html('').load('ajax.php?a=actionNotePopup', {anketa:anketa, name:name, type:type}, function(){
+
+ setTimeout(function(){
+ actionNotePopupClose();
+ }, 10000);
+ });
+}
+
+// Zapri note popup spodaj levo
+function actionNotePopupClose(){
+
+ $('#action_note_holder .action_note_box').fadeOut(function(){
+ $('#action_note_holder').html('');
+ });
+}
+
+//Hide top_note div
+function top_note_hide(id) {
+
+ $('#'+id).addClass('displayNone');
+
+}
+
+//Objava - pregled (gumbi)
+function publishPopupOpen(name){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=publish_popup_open', {anketa: srv_meta_anketa_id, name: name});
+}
+
+//Objava - check lepi link
+function addPrettyURL(){
+ $.post('ajax.php?a=nice_url_check', {anketa: srv_meta_anketa_id, nice_url: $('#nice_url').val()},
+ function(response) {
+ console.log(response);
+ if(response==""){
+ $.redirect('ajax.php?a=nice_url', {anketa: srv_meta_anketa_id, nice_url: $('#nice_url').val()});
+ }
+ else{
+ $('#add_url_error').html(response).fadeIn('slow');
+ }
+ });
+ return false;
+}
+
+//Objava - prikaz dodajanje lepega linka
+function toggleNiceURL(type) {
+
+ if (type == 'show') {
+ $("#nice_url_button").addClass('displayNone');
+ $("#nice_url_holder").removeClass('displayNone');
+ }
+ else if (type == 'hide') {
+ $("#nice_url_button").removeClass('displayNone');
+ $("#nice_url_holder").addClass('displayNone');
+ }
+}
+
+//Objava - privzete nastavitve
+function togglePublishSettings() {
+ $("#srv_objava_info_more1, #srv_objava_info_more2").toggleClass("displayNone");
+ $("#publish_settings_more").slideToggle('medium');
+}
+
+//Aktivnost - toggle dropdown checkboxes
+function toggleAktivnostCheckboxes(type) {
+ if (type == 'units') {
+ $("#dataSettingsCheckboxes").fadeIn("medium");
+ $("#dataSettingsCheckboxes").toggleClass("displayNone");
+ $("#toggleDataCheckboxes").toggleClass("border_blue");
+ }
+ else if (type == 'date') {
+ $("#dataSettingsCheckboxes_Date").fadeIn("medium");
+ $("#dataSettingsCheckboxes_Date").toggleClass("displayNone");
+ $("#toggleDataCheckboxes_Date").toggleClass("border_blue");
+
+ }
+}
+
+function toggleAddComment (box_id) {
+
+ var toggle = '#comment_toggle_' + box_id;
+ var wrapper = '#comment_wrapper_' + box_id;
+
+ $(toggle).toggle();
+ $(wrapper).toggle();
+}
+
+function closeCommentQtip (box_id) {
+
+ var content = '#survey_comment_' + box_id;
+ $(content).closest('.qtip ').qtip("hide");
+}
+
+function toggleGrafiColorWheel () {
+ $("#chart_custom_skin_cover").css("pointer-events", "auto");
+}
+
+function toggleSurveyTopSettings() {
+ $("#top_napredne_gumb").toggleClass("border_blue");
+ $("#top_napredne_dropdown").toggleClass("displayNone");
+}
+
+//Vprašalnik - enklikarhiv gumb
+function oneClickArchive(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
+}
+
+
+
+// kliči popup
+function show_gdpr_messeage(id_sporocila, anketa){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('hello').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=show_gdpr_messeage', {id_sporocila: id_sporocila, anketa: anketa});
+
+}
+
+
+//Toggle za dodajanje uporabnika (admini in managerji)
+function toggleAddUser(value){
+ $('.add_user_option').addClass('displayNone');
+ $("#add_user_option_"+value).removeClass('displayNone');
+}
+
+
+function toggleAnketaOpomba () {
+ $("#dodaj-opombo").toggleClass('displayNone');
+}
+
+function toggleAnketaMapa () {
+ $("#dodaj-v-mapo").toggleClass('displayNone');
+ $("#anketa-toggle").toggleClass('bottom0');
+}
+
+//lahko se klice na onclick in downloada file iz url
+function download_file(url) {
+ const a = document.createElement('a')
+ a.href = url
+ a.download = url.split('/').pop()
+ document.body.appendChild(a)
+ a.click()
+ document.body.removeChild(a)
+}
+
+//header when scrolling
+$(function() {
+ $(window).on("scroll", { passive: true }, function() {
+ var header = $(".desktop_header");
+ var top_center_settings = $("#branching .top_center_settings");
+
+ var scroll = $(window).scrollTop();
+
+ if (scroll > 190) {
+ top_center_settings.addClass("top_sticky");
+ header.addClass("shrink_header");
+ }
+ else if (0 < scroll && scroll <= 190) {
+ header.addClass("shrink_header");
+ top_center_settings.removeClass("top_sticky");
+ }
+ else if(scroll > 0){
+ header.addClass("shrink_header");
+ }
+ else {
+ header.removeClass("shrink_header");
+ top_center_settings.removeClass("top_sticky");
+ }
+ });
+}); \ No newline at end of file
diff --git a/admin/survey/script/script_analiza.js b/admin/survey/script/script_analiza.js
index e166278..9cd011c 100644
--- a/admin/survey/script/script_analiza.js
+++ b/admin/survey/script/script_analiza.js
@@ -1,5 +1,7 @@
function analiza_init () {
+
var srv_site_url = $("#srv_site_url").val();
+
// dodamo klike za odpiranje divov profilov (ker so z linki ble tezave)
$("#link_filter_profile").live("click", function(event) {
if (event.button != 0) { // wasn't the left button - ignore
@@ -9,15 +11,6 @@ function analiza_init () {
return false; // "capture" the click
});
-/*
- $("#link_collect_data_setting").live("click", function(event) {
- if (event.button != 0) { // wasn't the left button - ignore
- return true;
- }
- show_collect_data_setting();
- return false; // "capture" the click
- });
-*/
$("#link_status_casi").live("click", function(event) {
if (event.button != 0) { // wasn't the left button - ignore
return true;
@@ -48,13 +41,13 @@ function analiza_init () {
});
// brisanje vnosa
- $('#dataTable td .delete_circle').live('click', function(event) {
+ $('#dataTable td .delete').live('click', function(event) {
// polovimo user id
var usr_id = $(this).parent().parent().find('.data_uid').html();
var row = $(this).parent().parent();
- var note = 'srv_ask_delete';
+ var note = 'srv_ask_delete_data';
// Preverimo ce je med njimi tudi kaksno vabilo - dodatno opozorilo
if($(this).parent().parent().find('.invitation_cell').length == 1){
@@ -70,20 +63,36 @@ function analiza_init () {
if (response == '0') {
row.hide();
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert("Napaka pri brisanju!");
+ genericAlertPopup('alert_delete_error');
}
}
});
});
+ // klik na checkbox za oznacevanje za brisanje
+ $('#dataTable td .delete_data_row').live('click', function(event) {
+
+ // Preverimo ce je kaksen checkbox oznacen - prikazemo gumb za mass delete
+ if($(this).is(':checked')){
+ $("#switch_on").hide();
+ $("#switch_off").show();
+ $("#mass_delete_button").show();
+ }
+ // Skrijemo gumb za mass delete
+ else if($('#dataTable td .delete_data_row:checked').length == 0){
+ $("#switch_on").show();
+ $("#switch_off").hide();
+ $("#mass_delete_button").hide();
+ }
+ });
// editiranje starega vnosa
$('#dataTable td .edit_square').live('click', function(event) {
// polovimo user id
var uid = $(this).parent().parent().find('.data_uid').html();
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'';
+ var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_hash+'&usr_id='+uid+'';
if (uid > 0 ){
window.open(href, '_blank');
}
@@ -211,15 +220,7 @@ function analiza_init () {
$("#span_color_residual_legend2").toggle();
});
- /*
- $(document).ready(function() {
- $('#dataTable tbody tr:odd').addClass('odd');
-
- $('#dataTable tbody tr:even').addClass('even');
-
- });
- */
// inspect za frekvence
$("td.fr_inspect").live("click", function(event) {
doInspectFromFrequency(this,event);
@@ -249,36 +250,36 @@ function analiza_init () {
$('.div_analiza_holder').live({
mouseenter: function(){
$(this).find('.div_analiza_icons').stop().animate({opacity:1}, 600);
- $(this).find('.div_analiza_scale').stop().animate({opacity:1}, 600);
+ //$(this).find('.div_analiza_scale').stop().animate({opacity:1}, 600);
},
mouseleave: function(){
$(this).find('.div_analiza_icons').stop().animate({opacity:0}, 600);
- $(this).find('.div_analiza_scale').stop().animate({opacity:0}, 600);
+ //$(this).find('.div_analiza_scale').stop().animate({opacity:0}, 600);
}
});
+
// prikazovanje gumbov za hitro skrolanje levo desno v podatkih
- $('#tableContainer').live(
- {
- mouseenter: function()
- {
- var windowWidth = $(window).width(); //retrieve current window width
- var dtWidth = $('#dataTable').outerWidth();
- if ( (dtWidth - windowWidth) > 0)
- {
- $(this).find('#dataTableScroller').stop().animate({opacity:1}, 600);
- }
- },
- mouseleave: function()
- {
- var windowWidth = $(window).width(); //retrieve current window width
- var dtWidth = $('#dataTable').outerWidth();
- if ( (dtWidth - windowWidth) > 0)
- {
- $(this).find('#dataTableScroller').stop().animate({opacity:0}, 600);
- }
- }
- });
+ // Sirina in visina okna
+ var windowWidth = $(window).width();
+ var windowHeight = $(window).height();
+
+ // Sirina in visina tabele
+ var tableWidth = $('#dataTable').width();
+ var tableHeight = $('#dataTable').height();
+
+ // Puscice za scroll prikazemo samo ce je tabela prevelika
+ if(tableWidth > windowWidth && tableHeight > 0.8*windowHeight){
+
+ $('#tableContainer').live({
+ mouseenter: function(){
+ $(this).find('#dataTableScroller').stop().animate({opacity:1}, 600);
+ },
+ mouseleave: function(){
+ $(this).find('#dataTableScroller').stop().animate({opacity:0}, 600);
+ }
+ });
+ }
};
/**
@@ -286,19 +287,21 @@ function analiza_init () {
*/
function statusCasiAction(action) {
- $("#loading").show();
+
if (action == 'change') {
pid = $("#vnosi_current_status_casi").val();
$.post('ajax.php?a=vnosi_change_status_casi', {anketa: srv_meta_anketa_id, pid:pid}, function() {
return reloadData();
});
- } else if (action == 'run') {
- $("#loading").show();
+ }
+ else if (action == 'run') {
+
pid = $("#status_casi .active").attr('value');
// polovimo statuse
var statusCnt = 0;
var srv_userstatus = "";
prefix="";
+
$("input[name^=srv_userstatus]:checked").each(function() {
srv_userstatus = srv_userstatus + prefix + $(this).attr('id');
prefix = ",";
@@ -311,12 +314,13 @@ function statusCasiAction(action) {
// osvezimo vnose
return reloadData();
});
+
// skrijemo vse dive
$("#div_status_values").hide(200);
- //$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'run_rezanje') {
- $("#loading").show();
+ }
+ else if (action == 'run_rezanje') {
+
var rezanje = $("input[name=rezanje]:checked").val();
var rezanje_meja_sp = $("select[name=rezanje_meja_sp]").val();
var rezanje_meja_zg = $("select[name=rezanje_meja_zg]").val();
@@ -333,16 +337,19 @@ function statusCasiAction(action) {
$("#div_status_values").hide(200);
//$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'cancle') {
- $('#loading').hide();
+ }
+ else if (action == 'cancle') {
+
$("#div_status_values").hide(200);
$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'newName') { // dodelimo novo ime profilu
+ }
+ else if (action == 'newName') { // dodelimo novo ime profilu
$("#statusCasiCoverDiv").show();
$("#newProfile").show();
- } else if (action == 'newSave') { // shranimo kot nov profil in pozenemo
- $("#loading").show();
+ }
+ else if (action == 'newSave') { // shranimo kot nov profil in pozenemo
+
pid = $("#status_casi .active").attr('value');
name = $("#newProfileName").val();
$("#newProfile").hide();
@@ -366,15 +373,18 @@ function statusCasiAction(action) {
$("#div_status_values").hide(200);
$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'deleteAsk') { // vprašamo po potrditvi
+ }
+ else if (action == 'deleteAsk') { // vprašamo po potrditvi
$("#statusProfileCoverDiv").show();
$("#deleteProfileDiv").show();
- } else if (action == 'deleteCancle') { // prekicemo brisanje
+ }
+ else if (action == 'deleteCancle') { // prekicemo brisanje
$("#deleteProfileDiv").hide();
$("#statusProfileCoverDiv").fadeOut();
- } else if (action == 'deleteConfirm') { // izbrisemo profil
- $("#loading").show();
+ }
+ else if (action == 'deleteConfirm') { // izbrisemo profil
+
pid = $("#status_casi .active").attr('value');
$.post('ajax.php?a=vnosi_delete_status_casi', {anketa: srv_meta_anketa_id, pid:pid}, function() {
// dropdownu izberemo profil
@@ -382,6 +392,7 @@ function statusCasiAction(action) {
// osvezimo vnose
return reloadData();
});
+
$("#deleteProfileDiv").hide();
$("#statusProfileCoverDiv").fadeOut();
$("#div_status_values").hide(200);
@@ -423,7 +434,7 @@ function vnosi_show_rezanje_casi()
var left = width - (msg.width() )-42;
var top = height/2 - (msg.height() / 2);
// pozicioniramo na center strani
- $("#div_status_values").show(200).draggable({delay:100, cancel: 'input, .buttonwrapper, select'});
+ $("#div_status_values").show(200);
}
// prikaže skrit div za nastavitev manjkajočih vrednosti
@@ -478,39 +489,22 @@ function showspremenljivkaSingleVarPopup(id) {
});
}
-function showSpremenljivkaTextAnswersPopup(id,seq) {
- var size = "location=0,height=500,width=700,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
- var recipe = window.open('','RecipeWindow',size);
-
- $.post('ajax.php?t=analysis&a=showSpremenljivkaTextAnswersPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, id:id,seq:seq}, function(response) {
- recipe.document.open();
- recipe.document.write(response);
- recipe.document.close();
- recipe.focus();
- return false;
- });
+function showSpremenljivkaTextAnswersPopup(id) {
+ $('#fade').fadeTo('slow', 1);
+ $('#analysis_popup').html('').fadeIn('slow');
+ $('#analysis_popup').load('ajax.php?t=analysis&a=showSpremenljivkaTextAnswersPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, id:id});
}
-function showAnalizaSingleVarPopup(id,zaPodstran,navedbe,loop) {
- var size = "location=0,height=500,width=700,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
- var recipe = window.open('','RecipeWindow',size);
-
- $.post('ajax.php?t=analysis&a=showAnalizaSingleVarPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, podstran: zaPodstran, zaPodstran:zaPodstran, id:id,navedbe:navedbe,loop:loop}, function(response) {
- recipe.document.open();
- recipe.document.write(response);
- recipe.document.close();
- recipe.focus();
- return false;
- });
- /*
- $("#fullscreen").load('ajax.php?t=analysis&a=showAnalizaSingleVar', {anketa: srv_meta_anketa_id, podstran: zaPodstran, zaPodstran:zaPodstran, id:id}, function() {
- $('#fullscreen').show();
- $('#fade').fadeTo('slow', 1);
- }).draggable({handle: '#div_analiza_single_var_close, #div_analiza_single_var' });
- */
+function showAnalizaSingleVarPopup(id, zaPodstran, navedbe, loop, _this) {
+
+ var title = encodeURIComponent($(_this).html());
+
+ $('#fade').fadeTo('slow', 1);
+ $('#analysis_popup').html('').fadeIn('slow');
+ $('#analysis_popup').load('ajax.php?t=analysis&a=showAnalizaSingleVarPopup&setSkipCreate=1', {anketa:srv_meta_anketa_id, podstran:zaPodstran, zaPodstran:zaPodstran, id:id, navedbe:navedbe, loop:loop, title:title});
}
-function showAnalizaSingleChartPopup(id,zaPodstran) {
+function showAnalizaSingleChartPopup(id, zaPodstran) {
var size = "location=0,height=550,width=830,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
var recipe = window.open('','RecipeWindow',size);
@@ -543,7 +537,7 @@ function hideAnalizaSingleVarPopup() {
}
function show_single_missing(id, what) {
- //
+
if (what == 0) {
$('tr[name=missing_detail_'+id+']').each(function() {$(this).removeClass('displayNone');});
$("#single_missing_0"+id).hide();
@@ -553,7 +547,8 @@ function show_single_missing(id, what) {
$("#single_missing_percent_"+id).hide();
$("#single_missing_title_"+id).hide();
- } else {
+ }
+ else {
$('tr[name=missing_detail_'+id+']').each(function() {$(this).addClass('displayNone');});
$("#single_missing_0"+id).show();
$("#single_missing_1"+id).hide();
@@ -561,7 +556,6 @@ function show_single_missing(id, what) {
$("#single_missing_suma_freq_"+id).hide();
$("#single_missing_percent_"+id).show();
$("#single_missing_title_"+id).show();
-
}
}
@@ -687,27 +681,6 @@ function renameFilterProfile() {
});
}
-/*function showHideRenameFilterProfile(showhide) {
- if (showhide=='true') {
- //$("#filterProfileCoverDiv").show();
- $("#renameFilterProfileDiv").show();
- }
- else {
- //$("#filterProfileCoverDiv").hide();
- $("#renameFilterProfileDiv").hide();
- }
-}
-function showHideDeleteFilterProfile(showhide) {
- if (showhide=='true') {
- //$("#filterProfileCoverDiv").show();
- $("#deleteFilterProfileDiv").show();
- }
- else {
- //$("#filterProfileCoverDiv").hide();
- $("#deleteFilterProfileDiv").hide();
- }
-}*/
-
function toggle_click_missing(what) {
var variabla = $(what).attr('id').substr(14); // odrezemo prvih 14 znakov : click_missing_
@@ -718,85 +691,85 @@ function toggle_click_missing(what) {
}
if (state == 0) {
- // odstranimo spodnjo polno črto, ostane rdeca crtkana
- $("#anl_click_missing_tr_"+variabla).removeClass('anl_bb');
- $("#anl_click_missing_tr_"+variabla).addClass('anl_dash_red_bb');
- // nič od missingov še ni vidno. prikažemo osnovne missinge in skupo sumo
- $("#click_missing_1_"+variabla).show();
- $("#click_missing_suma_"+variabla).show();
- $(what).attr('value',1);
- // skrijemo osnovni link za vklop manjkajocih (manjkajoci)
- $("#click_missing_"+variabla).hide();
- $("#single_missing_title_"+variabla).show();
- } else if (state == 1 || state == 2 || state == ""){
- // dodamo spodnjo polno črto, skrijemo rdeco crtkana
- $("#anl_click_missing_tr_"+variabla).addClass('anl_bb');
- $("#anl_click_missing_tr_"+variabla).removeClass('anl_dash_red_bb');
- // nič od missingov še ni vidno. prikažemo osnovne missinge in skupo sumo
- $("#click_missing_1_"+variabla).hide();
- $("#click_missing_suma_"+variabla).hide();
- $(what).attr('value',0);
- $("#click_missing_"+variabla).show();
- $("#single_missing_title_"+variabla).hide();
+
+ // Odpremo missinge in skupno sumo
+ $('tr[name=missing_detail_'+variabla+']').each(function() {
+ $(this).removeClass('displayNone');
+ });
+
+ $(what).attr('value', 1);
+
+ // Zamenjamo puscico
+ $(what).find('.arrow2_d').removeClass('arrow2_d').addClass('arrow2_u');
+ }
+ else if (state == 1 || state == 2 || state == ""){
+
+ // Zapremo missinge
+ $('tr[name=missing_detail_'+variabla+']').each(function() {
+ $(this).addClass('displayNone');
+ });
+
+ $(what).attr('value', 0);
+
+ // Zamenjamo puscico
+ $(what).find('.arrow2_u').removeClass('arrow2_u').addClass('arrow2_d');
}
}
-function show_single_percent(id,status) {
+function show_single_percent(id, status) {
- if (status == 0) {
- // pokazemo frekvence in skrijemo procente
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).hide();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').removeClass('anl_dash_bb');
+ // Vklop/izklop frekvenc
+ if (status == 1) {
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).addClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).removeClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).addClass("displayNone");
-
- } else if (status == 1) {
- // pokazemo oboje
- $('[name=single_sums_percent_cnt_'+id+']').addClass('anl_dash_bb');
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).show();});
-
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).removeClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).addClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).addClass("displayNone");
-
- // skrijemo še vrednosti v vrstici z procenti
- $("#span_do_hide_1"+id).hide();
- $("#span_do_hide_2"+id).hide();
- $("#span_do_hide_3"+id).hide();
- $("#span_do_hide_4"+id).hide();
- $("#span_do_hide_5"+id).hide();
-
- } else {
- $('[name=single_sums_percent_cnt_'+id+']').removeClass('anl_dash_bb');
- // pokazemo procente skrijemo frekvence
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).hide();});
-
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).addClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).addClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).removeClass("displayNone");
-
- // skrijemo še vrednosti v vrstici z procenti
- $("#span_do_hide_1"+id).show();
- $("#span_do_hide_2"+id).show();
- $("#span_do_hide_3"+id).show();
- $("#span_do_hide_4"+id).show();
- $("#span_do_hide_5"+id).show();
+ // Ugasnemo - samo ce je drug vklopljen
+ if($('#freq-p_button_1_'+id).hasClass('active')){
- }
+ if($('#freq-p_button_2_'+id).hasClass('active')){
+ $('[name=single_sums_percent_cnt_'+id+']').each(function() {
+ $(this).hide().parent().parent().removeClass('freq_row');
+ });
+
+ $('#freq-p_button_1_'+id).removeClass('active');
+ }
+ }
+ // Prizgemo
+ else{
+ $('[name=single_sums_percent_cnt_'+id+']').each(function() {
+ $(this).show().parent().parent().addClass('freq_row');
+ });
+
+ $('#freq-p_button_1_'+id).addClass('active');
+ }
+ }
+ // Vklop/izklop procentov
+ else if (status == 2) {
+
+ // Ugasnemo - samo ce je drug vklopljen
+ if($('#freq-p_button_2_'+id).hasClass('active')){
+
+ if($('#freq-p_button_1_'+id).hasClass('active')){
+ $('[name=single_sums_percent_'+id+']').each(function() {
+ $(this).hide().parent().parent().removeClass('percent_row');
+ });
+
+ $('#freq-p_button_2_'+id).removeClass('active');
+ }
+ }
+ // Prizgemo
+ else{
+ $('[name=single_sums_percent_'+id+']').each(function() {
+ $(this).show().parent().parent().addClass('percent_row');
+ });
+
+ $('#freq-p_button_2_'+id).addClass('active');
+ }
+ }
}
function printAnaliza(ime)
{
if(ime == 'Crosstab')
- var divToPrint=document.getElementById('crosstab_table');
+ var divToPrint=document.getElementById('crosstab_tables');
else if(ime == 'MultiCrosstab')
var divToPrint=document.getElementById('mc_holder');
else if(ime == 'Means')
@@ -857,10 +830,11 @@ function scrollToProfile(_target) {
}
function cancleArchiveAnaliza() {
- $('#fullscreen').hide();
+ $('#fullscreen').hide().removeClass('PopUpNarrow').removeClass('divPopUp');
$('#fade').fadeOut('slow');
}
function doArchiveAnaliza() {
+ $("#fullscreen").addClass('PopUpNarrow').addClass('divPopUp');
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
$('#fade').fadeTo('slow', 1);
@@ -885,7 +859,7 @@ function submitArchiveAnaliza() {
}
function closeArchiveAnaliza() {
- $('#fullscreen').hide();
+ $('#fullscreen').hide().removeClass('PopUpNarrow').removeClass('divPopUp');
$('#fade').fadeOut('slow');
}
@@ -935,7 +909,7 @@ function saveArchiveAnaliza(aid) {
});
} else {
- alert('Napaka!');
+ genericAlertPopup('error');
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -951,7 +925,7 @@ function saveArchiveAnaliza(aid) {
function toggleAnalysisArchiveAccessPassword() {
var value = $("input[name=newAnalysisArchiveAccess]:checked").val();
var pass_div = document.getElementById("newAnalysisArchiveAccessPasswordDiv");
- value == 2 ? pass_div.style.visibility='visible' : pass_div.style.visibility='hidden';
+ value == 2 ? pass_div.style.display='block' : pass_div.style.display='none';
}
function AnalysisArchiveDelete(aid) {
@@ -968,7 +942,7 @@ function doDeleteArchiveAnaliza(aid) {
$('#fade').fadeOut('slow');
});
} else {
- alert('Napaka!');
+ genericAlertPopup('error');
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
}
@@ -984,15 +958,15 @@ function createArchiveBeforeEmail() {
if (parseInt(response) > 0) {
var aid = parseInt(response);
$("#fullscreen").load('ajax.php?a=emailArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, aid:aid}, function() {
- $('#fullscreen').show();
+ $('#fullscreen').addClass("divPopUp").show();
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
- $('#fullscreen').hide();
+ $('#fullscreen').removeClass("PopUpNarrow divPopUp").hide();
$('#fade').fadeOut('slow');
}
});
@@ -1003,173 +977,45 @@ function showHidenTextRow($sequence) {
}
-function showHidenTextTable(spid,num_records,loop_id) {
+function showHidenTextTable(spid, num_records, loop_id) {
+
+ var srv_site_url = $("#srv_site_url").val();
+
if ($("#srv_meta_podstran").length == 0 ) {
var podstran = srv_meta_podstran;
- } else {
+ }
+ else {
var podstran = $("#srv_meta_podstran").val();
}
+
if ($("#srv_meta_anketa_id").length == 0 ) {
var srv_meta_anketa_id = srv_meta_anketa_id;
- } else {
+ }
+ else {
var srv_meta_anketa_id = $("#srv_meta_anketa_id").val();
}
if (podstran == 'frequency') {
- $('#freq_'+spid+'[loop="'+loop_id+'"]').load('ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
- } else if (podstran == 'sumarnik') {
- $('#sum_'+spid+'[loop="'+loop_id+'"]').load('ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
- } else if (podstran == 'charts') {
- $('#chart_'+spid+'_loop_'+loop_id).load('ajax.php?t=charts&a=show_spid_more_table', {anketa:srv_meta_anketa_id, spid:spid, num_records:num_records, loop:loop_id});
- }
-}
-/*
-var intervalPB='';
-var hasStarted=false;
-
-function createCollectData(auto) {
- var _automatic = '&automatic=false';
- if (arguments.length > 0 ) {
- if (auto == true) {
- _automatic = '';
- }
+ $('#freq_'+spid+'[loop="'+loop_id+'"]').load(srv_site_url+'/admin/survey/ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
+ }
+ else if (podstran == 'sumarnik') {
+ $('#sum_'+spid+'[loop="'+loop_id+'"]').load(srv_site_url+'/admin/survey/ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
+ }
+ else if (podstran == 'charts') {
+ $('#chart_'+spid+'_loop_'+loop_id).load(srv_site_url+'/admin/survey/ajax.php?t=charts&a=show_spid_more_table', {anketa:srv_meta_anketa_id, spid:spid, num_records:num_records, loop:loop_id});
}
-
- if (hasStarted == false) {
- // skrijemo tekst z file statusom
- $('#vnosi_file_status').hide();
-
- // nalozimo div za izris poteka
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').show();
-
- $("#fullscreen").load('prepareDataCrontab.php?action=LoadProgresBar', {anketa: srv_meta_anketa_id}, function () {
- $('#pbAllPercent div').css('width','0%');
- $('#pbCurrPercent div').css('width','0%');
- $('#pbRowPercent div').css('width','0%');
-
- $('#pbAllPercent').css('visibility','visible');
- $('#pbCurrPercent').css('visibility','visible');
- $('#hpbRowPercent, #pbRowPercent').css('visibility','visible');
-
- $.ajax({
- cache: false,
- type: 'post',
- url: 'prepareDataCrontab.php?action=collectSingle'+_automatic+'&anketa='+srv_meta_anketa_id,
- beforeSend: start_display_progressBar()
- });
- });
- }
-}
-
-var pbLabels= new Array()
-pbLabels['1'] = lang['srv_collectdata_progress_status1'];
-pbLabels['2'] = lang['srv_collectdata_progress_status2'];
-pbLabels['3'] = lang['srv_collectdata_progress_status3'];
-pbLabels['8'] = lang['srv_collectdata_progress_status8'];
-pbLabels['9'] = lang['srv_collectdata_progress_status9']
-pbLabels['-1'] = lang['srv_collectdata_progress_status0']
-
-function start_display_progressBar(type) {
- if (type == undefined) type = 'true';
- if (intervalPB=="") {
- $('#start').css('visibility','hidden');
- intervalPB=window.setInterval("display_progressBar('"+type+"')",750); // interval = 400 ms
- $('#loader').css('display','inline');
- } else {
- stop_display_progressBar();
- }
}
-function stop_display_progressBar() {
- $("#loading").show();
- if (intervalPB!="") {
- $('#start').css('visibility','visible');
- window.clearInterval(intervalPB);
- intervalPB="";
+function show_navedbe(spid, status) {
-// $('#fade').fadeOut('slow');
- $('#fullscreen').hide();
- $('#fullscreen').html('');
-
- hasStarted = true;
- return reloadData();
- }
-}
-function display_progressBar(type) {
- if (type == undefined) type = 'true';
- $.ajax({
- cache: false,
- type: 'get',
- url: 'getCollectTimer.php?ajaxTimer='+type,
- success: function(response) {
- var data = jQuery.parseJSON(response);
-
- $('#actionLabel').html(pbLabels[data.id]+' ('+data.t+')');
- $('#pbAllPercent div').css('width',data.pa+'%');
- if ( data.id == '2') {
- // na koliko % smo v header datoteki
- $('#pbCurrPercent div').css('width',data.ph+'%');
- $('#pbCurrPercentLabel').html(data.ph+'%');
- // na katerem zapisu smo
- $('#pbRowPercent div').css('width',data.pr+'%');
- $('#pbRowPercentLabel').html(data.nr);
-
- }
- if ( data.id == '3') {
-// $('#hpbRowPercent, #pbRowPercent').css('visibility','visible');
- // na koliko % smo v data datoteki
- $('#pbCurrPercent div').css('width',data.pd+'%');
- $('#pbCurrPercentLabel').html(data.pd+'%');
- // na katerem zapisu smo
- $('#pbRowPercent div').css('width',data.pr+'%');
- $('#pbRowPercentLabel').html(data.nr);
- }
-
- if ( data.id == '9' || data.id == '-1' ) { // 9 = konec
- hasStarted = true;
- // konec prenosa
- $('#pbCurrPercent div').css('width','100%');
- $('#pbRowPercent div').css('width','100%');
- $('#pbCurrPercentLabel').html('100%');
- $('#pbRowPercentLabel').html('100%');
- stop_display_progressBar();
- }
- }
- });
-}
-*/
-function show_navedbe(spid,status) {
- if (status == 1) {
- // vidno je oboje
- // pokažemo pravilne linke
-// $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("#div_navedbe_1_"+spid).removeClass('displayNone');
- $("#div_navedbe_2_"+spid).addClass('displayNone');
-
- } else if (status == 2) {
- // pokažemo samo navedbe
- // pokažemo pravilne linke
-// $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("#div_navedbe_1_"+spid).addClass('displayNone');
- $("#div_navedbe_2_"+spid).removeClass('displayNone');
- /*
- } else {
-
- // pokažemo samo odgovore
-
- // pokažemo pravilne linke
- $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("#div_navedbe_1_"+spid).removeClass('displayNone');
- $("#div_navedbe_2_"+spid).addClass('displayNone');
-*/
- }
+ if (status == 1) {
+ $("#div_navedbe_1_"+spid).removeClass('displayNone');
+ $("#div_navedbe_2_"+spid).addClass('displayNone');
+ }
+ else if (status == 2) {
+ $("#div_navedbe_1_"+spid).addClass('displayNone');
+ $("#div_navedbe_2_"+spid).removeClass('displayNone');
+ }
}
// Pobrisemo vec vnosov hkrati
@@ -1177,7 +1023,7 @@ function deleteMultipleData(){
var userArray = new Array;
- var note = 'srv_ask_delete';
+ var note = 'srv_ask_delete_multiple_data';
// Napolnimo array z checkanimi userji
$('#div_vnosi_data input:checked').each(function() {
@@ -1205,7 +1051,7 @@ function deleteMultipleData(){
});
} else {
- alert(lang["srv_data_delete_not_selected"]);
+ genericAlertPopup('srv_data_delete_not_selected');
}
}
@@ -1215,11 +1061,13 @@ function selectAll(val){
$(".delete_data_row").attr("checked", "true");
$("#switch_on").hide();
$("#switch_off").show();
+ $("#mass_delete_button").show();
}
else{
$('.delete_data_row').removeAttr('checked');
$("#switch_off").hide();
$("#switch_on").show();
+ $("#mass_delete_button").hide();
}
}
@@ -1238,11 +1086,11 @@ function quickEditAction(action, usr_id){
var href = srv_site_url+'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=data&m=quick_edit';
window.location = href;
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert("Napaka pri brisanju!");
+ genericAlertPopup('alert_delete_error');
}
}
});
@@ -1250,7 +1098,7 @@ function quickEditAction(action, usr_id){
// editiranje starega vnosa
if(action == 'edit'){
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+usr_id+'';
+ var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_hash+'&usr_id='+usr_id+'';
if (usr_id > 0 ){
window.open(href, '_blank');
}
@@ -1305,7 +1153,7 @@ function quickEditAction(action, usr_id){
window.location = href;
});
} else {
- alert("Napaka pri kopiranju!");
+ genericAlertPopup('alert_copy_error');
}
}
});
@@ -1419,7 +1267,7 @@ function doArchiveChart() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveChart() {
@@ -1438,7 +1286,7 @@ function submitArchiveChart() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -1456,9 +1304,9 @@ function createArchiveChartBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -1466,7 +1314,7 @@ function createArchiveChartBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
@@ -1501,23 +1349,6 @@ function printCurrentAnalysis(spid) {
pri.print();
}
-/*
- * $.fn.center = function() {
- this.css({
- 'position': 'fixed',
- 'left': '50%',
- 'top': '50%'
- });
- this.css({
- 'margin-left': -this.width() / 2 + 'px',
- 'margin-top': -this.height() / 2 + 'px'
- });
-
- return this;
- }
-
-
- */
$.fn.followTo = function ( pos ) {
var $this = this,
@@ -1541,37 +1372,35 @@ $.fn.followTo = function ( pos ) {
};
+// Horizontalen scroll tabele s podatki pri kliku na puscice
+function dataTableScroll(where){
+ var scroll_width = $(window).width() / 4 * 3;
-/**
- * Copyright (c) 2007-2012 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Dual licensed under MIT and GPL.
- * @author Ariel Flesler
- * @version 1.4.3.1
- */
-//(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
-
-
-/**
- * Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
- * Licensed under MIT
- * @author Ariel Flesler
- * @version 1.4.14
- */
-//(function(k){'use strict';k(['jquery'],function($){var j=$.scrollTo=function(a,b,c){return $(window).scrollTo(a,b,c)};j.defaults={axis:'xy',duration:0,limit:!0};j.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(f,g,h){if(typeof g=='object'){h=g;g=0}if(typeof h=='function')h={onAfter:h};if(f=='max')f=9e9;h=$.extend({},j.defaults,h);g=g||h.duration;h.queue=h.queue&&h.axis.length>1;if(h.queue)g/=2;h.offset=both(h.offset);h.over=both(h.over);return this._scrollable().each(function(){if(f==null)return;var d=this,$elem=$(d),targ=f,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}var e=$.isFunction(h.offset)&&h.offset(d,targ)||h.offset;$.each(h.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=j.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(h.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=e[pos]||0;if(h.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*h.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(h.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&h.queue){if(old!=attr[key])animate(h.onAfterFirst);delete attr[key]}});animate(h.onAfter);function animate(a){$elem.animate(attr,g,h.easing,a&&function(){a.call(this,targ,h)})}}).end()};j.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}return j})}(typeof define==='function'&&define.amd?define:function(a,b){if(typeof module!=='undefined'&&module.exports){module.exports=b(require('jquery'))}else{b(jQuery)}}));
-
-function dataTableScroll(where)
-{
if (where == 'left'){
- //$(window).scrollTo('-=500px', 300, { axis:'x' });
-
- var leftPos = $('html').scrollLeft();
- $("html").animate({scrollLeft: leftPos - 700}, 800);
+ var leftPos = $('#tableContainer').scrollLeft();
+ $("#tableContainer").animate({scrollLeft: leftPos - scroll_width}, 600);
}
if (where == 'right'){
- //$(window).scrollTo('+=500px', 300, { axis:'x' });
-
- var leftPos = $('html').scrollLeft();
- $("html").animate({scrollLeft: leftPos + 700}, 800);
+ var leftPos = $('#tableContainer').scrollLeft();
+ $("#tableContainer").animate({scrollLeft: leftPos + scroll_width}, 600);
}
+}
+
+// Prikaz ikon (frekvence, sums...) pri kliku na 3 pikice
+function show_settings_survey_analysis(id_of_element){
+
+ if($('#options'+id_of_element).is(":visible")){
+ $('#options'+id_of_element).hide();
+ }
+ else{
+ $('.options').hide();
+ $('#options'+id_of_element).show();
+ }
+}
+
+// Zapremo popup z analizo
+function closeAnalizaPopup(){
+ $('#analysis_popup').fadeOut('slow').html('');
+ $('#fade').fadeOut('slow');
} \ No newline at end of file
diff --git a/admin/survey/script/skupine.js b/admin/survey/script/skupine.js
index 5f782cc..dae555a 100644
--- a/admin/survey/script/skupine.js
+++ b/admin/survey/script/skupine.js
@@ -5,8 +5,12 @@ function add_skupina(skupine){
var text = $('input[name=skupina]').val();
$.post('ajax.php?t=skupine&a=add_skupina', {anketa: srv_meta_anketa_id, spr_id:spr_id, text:text, skupine:skupine}, function(response){
- //window.location.reload();
- $(response).insertBefore('.add_skupina_button');
+ $('#groups_table').removeClass('displayNone');
+ $('#groups_table tr:last').after(response);
+ $('input[name=skupina]').val('').focus();
+
+ $('#passwords_table').removeClass('displayNone');
+ $('#passwords_table tr:last').after(response);
$('input[name=skupina]').val('').focus();
});
}
@@ -20,11 +24,11 @@ function add_skupina_enter(skupine, event){
}
// brisanje skupine
-function delete_skupina(skupine, vre_id, text){
+function delete_skupina(skupine, vre_id){
var spr_id = $('#skupine_spr_id').val();
- $.post('ajax.php?t=skupine&a=delete_skupina', {anketa: srv_meta_anketa_id, skupine:skupine, spr_id:spr_id, vre_id:vre_id, text:text}, function(){
+ $.post('ajax.php?t=skupine&a=delete_skupina', {anketa: srv_meta_anketa_id, skupine:skupine, spr_id:spr_id, vre_id:vre_id}, function(){
window.location.reload();
});
}
diff --git a/admin/survey/script/slideshow.js b/admin/survey/script/slideshow.js
index 00cdfe2..914cd67 100644
--- a/admin/survey/script/slideshow.js
+++ b/admin/survey/script/slideshow.js
@@ -19,7 +19,7 @@ function slideshow_reset_interval() {
} else {
// ne moremo resetriat, ker checkbox ni izbran
- alert("Error! Select checkbox");
+ genericAlertPopup('alert_checkbox_error');
}
}
@@ -37,7 +37,7 @@ function slideshow_save_settings() {
$.post('ajax.php?t=slideshow&a=save_settings',
{anketa: srv_meta_anketa_id, timer:timer, fixed_interval:fixed_interval, save_entries:save_entries, autostart:autostart, next_btn:next_btn, back_btn:back_btn, pause_btn:pause_btn},function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
} \ No newline at end of file
diff --git a/admin/survey/script/statistika.js b/admin/survey/script/statistika.js
index db3598d..1f4497c 100644
--- a/admin/survey/script/statistika.js
+++ b/admin/survey/script/statistika.js
@@ -97,7 +97,7 @@ function renameStatisticProfile() {
if (response > 0) {
$("#statistic_profile .active").html(name);
} else if (response < 0){
- alert("Error!");
+ genericAlertPopup('error');
}
});
}
@@ -145,7 +145,7 @@ function create_new_statistic_interval_filter() {
$("#div_statistic_date_select").load("ajax.php?t=dashboard&a=loadStatisticProfile", {anketa:srv_meta_anketa_id});
} else {
// prišlo je do napake;
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
}
diff --git a/admin/survey/script/statusProfiles.js b/admin/survey/script/statusProfiles.js
index 087ac4d..720e963 100644
--- a/admin/survey/script/statusProfiles.js
+++ b/admin/survey/script/statusProfiles.js
@@ -185,20 +185,55 @@ function statusProfileRefreshData(pid) {
return reloadData('status');
}
-function showColectDataSetting() {
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=statusProfile&a=showColectDataSetting', {anketa:srv_meta_anketa_id});
+// Klik na novo generiranje datoteke s podatki
+function changeColectDataStatus() {
+
+ // Preverimo, ce imamo prevec neustreznih - potem ponudimo popup za brisanje neustreznih
+ let invalid_answers_count = 0;
+ $.post('ajax.php?a=dataCountNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+ invalid_answers_count = response;
+
+ // Imamo prevec neustreznih enot - prikazemo popup za brisanje
+ if(invalid_answers_count > 1000){
+ showInvalidResponsesWarning();
+ }
+ // Na novo zgeneriramo datoteko s podatki
+ else{
+ refreshDataFile();
+ }
+ });
}
+// Prikazemo popup za brisanje neustreznih enot
+function showInvalidResponsesWarning() {
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('').fadeIn('slow');
+ //$("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
+ $("#general_popup").load('ajax.php?t=statusProfile&a=showInvalidResponsesWarning', {anketa:srv_meta_anketa_id});
+}
-function changeColectDataStatus() {
+// Na novo zgeneriramo datoteko s podatki
+function refreshDataFile(){
+
var collect_all_status = $('input[name="collect_all_status"]').is(':checked') ? '0' : '1';
+
$.post('ajax.php?t=statusProfile&a=saveCollectDataSetting', {anketa: srv_meta_anketa_id, collect_all_status:collect_all_status}, function(response) {
return reloadData('status');
});
}
+// Pobrišemo neustrezne enote
+function deleteInvalidAnswers() {
+
+ $.post('ajax.php?a=dataDeleteNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+
+ // Potem na novo zgeneriramo datoteko s podatki
+ refreshDataFile();
+ });
+}
+
function changeOnlyValidRadio() {
var checked = $('input[name=statusOnlyValid]:checked').val();
@@ -206,5 +241,4 @@ function changeOnlyValidRadio() {
$.post('ajax.php?t=statusProfile&a=changeOnlyValidRadio', {anketa: srv_meta_anketa_id,meta_akcija: srv_meta_akcija, podstran: srv_meta_podstran, checked:checked}, function(response) {
return reloadData('status');
});
-
} \ No newline at end of file
diff --git a/admin/survey/script/surveyCondition.js b/admin/survey/script/surveyCondition.js
index 3670c7e..7223b66 100644
--- a/admin/survey/script/surveyCondition.js
+++ b/admin/survey/script/surveyCondition.js
@@ -19,7 +19,7 @@ function newSurveyCondition()
}
else
{
- alert('Error! (errCode:'+data.error+')');
+ genericAlertPopup('alert_error_code',data.error);
}
}
)
@@ -47,7 +47,7 @@ function deleteSurveyCondition(cid)
}
else
{
- alert('Error! (errCode:'+data.error+')');
+ genericAlertPopup('alert_error_code',data.error);
}
}
);
@@ -73,7 +73,7 @@ function renameSurveyCondition()
}
else
{
- alert(data.errorMsg+'');
+ genericAlertPopup('alert_parameter_dataerrormsg');
}
}
);
diff --git a/admin/survey/script/surveyList.js b/admin/survey/script/surveyList.js
index 5000e72..c7261ef 100644
--- a/admin/survey/script/surveyList.js
+++ b/admin/survey/script/surveyList.js
@@ -1,37 +1,116 @@
+/** Izbrise anketo
+ *
+ * @param anketa
+ * @param confirmtext
+ * @return
+ */
+ function anketa_delete_list (anketa, confirmtext) {
+ if (confirm(confirmtext)) {
+ $("#anketa_list_"+anketa).slideUp();
+ $.post('ajax.php?a=anketa_delete', {anketa: anketa, 'inList': 'true'}, function(response) {
+ if (response == '0') {
+ window.location = 'index.php';
+ }
+ });
+ }
+}
+
+/** doda/odstrani anketo v sistemsko knjiznico in refresa ikono za knjiznico ankete
+ *
+ */
+function surveyList_knjiznica (anketa) {
+ $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_glb").load('ajax.php?t=surveyList&a=surveyList_knjiznica', {anketa: anketa});
+}
+
+/** navadnega uporabnika obvesti da nima dostopa za dodajanje v sistemsko knjiznico
+ *
+ */
+function surveyList_knjiznica_noaccess (msg) {
+ genericAlertPopup('alert_parameter_msg');
+}
+
+/** doda/odstrani anketo v uporabnisko knjiznico in refresa ikono za knjiznico ankete
+*
+*/
+function surveyList_myknjiznica (anketa) {
+ $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_usr").load('ajax.php?t=surveyList&a=surveyList_myknjiznica', {anketa: anketa});
+ //$('#folders').load('ajax.php?t=folders&a=folders_myknjiznica', {anketa: anketa});
+}
+
+function surveyList_myknjiznica_new (anketa) {
+ $.post('ajax.php?t=surveyList&a=surveyList_myknjiznica_new', {anketa: anketa}, function() {
+ window.location.reload(true);
+ });
+}
+
+function surveyList_knjiznica_new (anketa) {
+ $.post('ajax.php?t=surveyList&a=surveyList_knjiznica_new', {anketa: anketa}, function() {
+ window.location.reload(true);
+ });
+}
+
+// Prikaz vec na tri pikice v tabeli anket
+function surveyList_show_more(ank_id){
+
+ if($('#survey_other_box_'+ank_id).hasClass('displayNone')){
+ $('.survey_other_box').addClass('displayNone');
+ $('#survey_other_box_'+ank_id).removeClass('displayNone');
+ }
+ else{
+ $('.survey_other_box').addClass('displayNone');
+ }
+
+}
+
+
+
+/* MOJE ANKETE - pogled z mapami */
+
+// Preklopimo med prikazom folderjev in navadnim prikazom
+function switchFolder(show){
+ if(show == 1)
+ var show_folders = 0;
+ else
+ var show_folders = 1;
+
+ $('#survey_list').load('ajax.php?a=surveyList_folders', {show_folders:show_folders}, function(){
+ $('body').toggleClass('body_mySurveys_folders');
+ $('body').toggleClass('body_mySurveys');
+ });
+}
+
// inicializiramo drag/drop anket in folderjev
-function surveyList_folder_init() {
+function mySurvey_folder_init() {
- $('#survey_list div.droppable').droppable({
- accept: '.mySurvey_draggable',
+ $('#survey_list .mySurvey_droppable').droppable({
+ accept: '#survey_list .mySurvey_draggable',
hoverClass: 'folderhover',
tolerance: 'pointer',
drop: function (e, ui) {
// Drop folderja
- if($(ui.draggable).hasClass('folder_title')){
- var drag_folder = $(ui.draggable).attr('folder_id');
- var parent = $(this).attr('folder_id');
+ if($(ui.draggable).hasClass('folder_item')){
+
+ var drag_folder_id = $(ui.draggable).attr('folder_id');
+ var parent_folder_id = $(this).attr('folder_id');
- $.post('ajax.php?t=surveyList&a=folder_dropped', {parent: parent, drag_folder: drag_folder}, function(){
- window.location.reload();
- });
+ $('#survey_list').load('ajax.php?t=surveyListFolders&a=mysurvey_folder_drop', {parent_folder_id: parent_folder_id, drag_folder_id: drag_folder_id});
}
// Drop ankete
if($(ui.draggable).hasClass('anketa_list')){
- var drag_survey = $(ui.draggable).attr('anketa_id');
- var parent = $(this).attr('folder_id');
- $.post('ajax.php?t=surveyList&a=survey_dropped', {parent: parent, drag_survey: drag_survey}, function(){
- window.location.reload();
- });
+ var drag_survey_id = $(ui.draggable).attr('anketa_id');
+ var parent_folder_id = $(this).attr('folder_id');
+
+ $('#survey_list').load('ajax.php?t=surveyListFolders&a=mysurvey_survey_drop', {parent_folder_id: parent_folder_id, drag_survey_id: drag_survey_id});
}
}
});
- $('.mySurvey_draggable').draggable({
+ $('#survey_list .mySurvey_draggable').draggable({
revert: 'invalid',
- opacitiy: '0.7',
+ opacitiy: '0.9',
helper: 'clone',
cursor: 'move',
cursorAt: { left: 20 },
@@ -41,127 +120,149 @@ function surveyList_folder_init() {
});
}
-// prikazemo/skrijemo ankete v folderju
-function toggle_folder (folder) {
-
- var open = 0;
- if($('#folder_content_'+folder).hasClass('closed')){
- open = 1;
- }
-
- $.post('ajax.php?t=surveyList&a=folder_toggle', {folder: folder, open: open}, function(){
- if(open == 1){
- $('#folder_content_'+folder).removeClass('closed');
- $('#folder_'+folder).find('.plus').removeClass('plus').addClass('minus');
- }
- else{
- $('#folder_content_'+folder).addClass('closed');
- $('#folder_'+folder).find('.minus').removeClass('minus').addClass('plus');
- }
- });
-}
+// Razpremo/skrcimo folder
+function mySurvey_folder_toggle(folder_id){
-// Pobrisemo folder
-function delete_folder (folder) {
- $.post('ajax.php?t=surveyList&a=folder_delete', {folder: folder}, function(){
- window.location.reload();
- });
+ if($('#folder_item_'+folder_id).hasClass('open'))
+ var open = 0;
+ else
+ var open = 1;
+
+ $.post('ajax.php?t=surveyListFolders&a=mysurvey_folder_toggle', {folder_id: folder_id, open: open}, function(){
+
+ if($('#folder_item_'+folder_id).hasClass('open')){
+ $('#folder_item_'+folder_id).removeClass('open');
+ $('#folder_list_'+folder_id).slideUp();
+ }
+ else{
+ $('#folder_item_'+folder_id).addClass('open');
+ $('#folder_list_'+folder_id).slideDown();
+ }
+ });
+
+ event.stopPropagation();
}
-// Ustvarimo folder
-function create_folder (parent) {
-
- $('#survey_list').load('ajax.php?t=surveyList&a=folder_create', {parent: parent}, function(){
-
- var added_folder_id = $('#new_added_folder').val();
+// Aktiviramo folder
+function mySurvey_folder_activate(folder_id){
+
+ $('#right_content').load('ajax.php?t=surveyListFolders&a=mysurvey_folder_activate', {folder_id: folder_id}, function(){
+
+ // Pobrisemo aktivni class aktivnega
+ $('.folder_item').removeClass('active');
- edit_title_folder(added_folder_id);
+ // Dodamo aktivni class novemu
+ $('#folder_item_'+folder_id).addClass('active');
});
}
-// Urejamo ime folderja
-function edit_title_folder (folder) {
-
- var text = $('#folder_title_text_'+folder).text();
+// Prikazemo opcije za urejanje folderja
+function mySurvey_folder_show_edit(element){
+
+ if($(element).parent().find('.folder_item_settings').hasClass('displayNone')){
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').addClass('displayNone');
+ $(element).removeClass('active');
+ }
- $('#folder_title_text_'+folder).html('<input type="text" name="folder_title_edit" folder="'+folder+'" id="folder_title_edit_'+folder+'" class="folder_title_edit" value="'+text+'" onBlur="rename_folder(\''+folder+'\'); return false;" />');
- $('#folder_title_edit_'+folder).select();
+ event.stopPropagation();
}
-// Preimenujemo folder
-function rename_folder(folder){
- var text = $('#folder_title_edit_'+folder).val();
- $.post('ajax.php?t=surveyList&a=folder_rename', {folder: folder, text: text}, function(){
- $('#folder_title_text_'+folder).html('<a href="#" onClick="edit_title_folder(\''+folder+'\'); return false;">'+text+'</a>');
- });
+// Zaprtje dodatnega popupa
+function mySurvey_folder_close_popup(){
+ $('#fade').fadeOut('slow');
+ $("#mySurvey_additional_popup").fadeOut().html();
}
-// Kopiramo folder
-function copy_folder(folder){
- $.post('ajax.php?t=surveyList&a=folder_copy', {folder: folder}, function(){
- window.location.reload();
- });
+// Ime novega folderja
+function mySurvey_folder_add_popup(parent_folder_id){
+
+ $('#fade').fadeTo('slow', 1);
+ $("#mySurvey_additional_popup").fadeIn();
+ $("#mySurvey_additional_popup").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_add_popup', {folder_id: parent_folder_id});
}
+// Dodamo nov folder
+function mySurvey_folder_add(parent_folder_id){
-// Preklopimo med prikazom folderjev in navadnim prikazom
-function switchFolder(show){
- if(show == 1)
- var show_folders = 0;
- else
- var show_folders = 1;
+ var folder_name = $("#mySurvey_folder_name").val();
- $('#survey_list').load('ajax.php?a=surveyList_folders', {show_folders:show_folders});
+ $("#left_content").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_add', {folder_id: parent_folder_id, folder_name: folder_name}, function(){
+ mySurvey_folder_close_popup();
+ });
}
+// Ime obstojecega folderja
+function mySurvey_folder_rename_popup(folder_id, folder_name){
-/** Izbrise anketo
- *
- * @param anketa
- * @param confirmtext
- * @return
- */
-function anketa_delete_list (anketa, confirmtext) {
- if (confirm(confirmtext)) {
- $("#anketa_list_"+anketa).slideUp();
- $.post('ajax.php?a=anketa_delete', {anketa: anketa, 'inList': 'true'}, function(response) {
- if (response == '0') {
- window.location = 'index.php';
- }
- });
- }
+ $('#fade').fadeTo('slow', 1);
+ $("#mySurvey_additional_popup").fadeIn();
+ $("#mySurvey_additional_popup").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_rename_popup', {folder_id: folder_id, folder_name: folder_name});
}
+// Preimenujemo obstojeci folder
+function mySurvey_folder_rename(folder_id){
-/** doda/odstrani anketo v sistemsko knjiznico in refresa ikono za knjiznico ankete
- *
- */
-function surveyList_knjiznica (anketa) {
- $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_glb").load('ajax.php?t=surveyList&a=surveyList_knjiznica', {anketa: anketa});
-}
-/** navadnega uporabnika obvesti da nima dostopa za dodajanje v sistemsko knjiznico
- *
- */
-function surveyList_knjiznica_noaccess (msg) {
- alert(msg);
+ var folder_name = $("#mySurvey_folder_name").val();
+
+ $("#left_content").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_rename', {folder_id: folder_id, folder_name: folder_name}, function(){
+ mySurvey_folder_close_popup();
+ });
}
-/** doda/odstrani anketo v uporabnisko knjiznico in refresa ikono za knjiznico ankete
-*
-*/
-function surveyList_myknjiznica (anketa) {
- $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_usr").load('ajax.php?t=surveyList&a=surveyList_myknjiznica', {anketa: anketa});
- //$('#folders').load('ajax.php?t=folders&a=folders_myknjiznica', {anketa: anketa});
+// Pobrisemo obstojeci folder
+function mySurvey_folder_delete(folder_id){
+
+ $("#survey_list").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_delete', {folder_id: folder_id});
}
-function surveyList_myknjiznica_new (anketa) {
- $.post('ajax.php?t=surveyList&a=surveyList_myknjiznica_new', {anketa: anketa}, function() {
- window.location.reload();
+
+
+
+/*
+
+// prikazemo/skrijemo ankete v folderju
+function toggle_folder (folder) {
+
+ var open = 0;
+ if($('#folder_content_'+folder).hasClass('closed')){
+ open = 1;
+ }
+
+ $.post('ajax.php?t=surveyList&a=folder_toggle', {folder: folder, open: open}, function(){
+ if(open == 1){
+ $('#folder_content_'+folder).removeClass('closed');
+ //$('#folder_'+folder).find('.arrow2_u').removeClass('arrow2_u').addClass('arrow2_d');
+
+ $('#folder_'+folder).removeClass('closed').addClass('open');
+ }
+ else{
+ $('#folder_content_'+folder).addClass('closed');
+ //$('#folder_'+folder).find('.arrow2_d').removeClass('arrow2_d').addClass('arrow2_u');
+
+ $('#folder_'+folder).removeClass('open').addClass('closed');
+ }
});
}
-function surveyList_knjiznica_new (anketa) {
- $.post('ajax.php?t=surveyList&a=surveyList_knjiznica_new', {anketa: anketa}, function() {
+
+
+// Kopiramo folder
+function copy_folder(folder){
+
+ $.post('ajax.php?t=surveyList&a=folder_copy', {folder: folder}, function(){
window.location.reload();
});
}
+
+*/
+
+
+
diff --git a/admin/survey/script/telephone.js b/admin/survey/script/telephone.js
index 26d126a..f97b082 100644
--- a/admin/survey/script/telephone.js
+++ b/admin/survey/script/telephone.js
@@ -1,3 +1,34 @@
+// meta podatki
+var srv_meta_anketa_id = $("#srv_meta_anketa").val();
+
+// avtomatsko vsake 30 sekund preverimo, ce se je pojavila kaksna nova stevilka
+function preveri_nove_stevilke () {
+ $.timer(30000, function (timer) {
+
+ $('#preveri_stevilke').load('ajax.php?t=telefon&a=preveri_stevilke', {anketa: srv_meta_anketa_id});
+ timer.stop();
+ });
+}
+
+// dashboard filter na datum
+function tel_date_filter () {
+
+ // Ce imamo nastavljen datum "od"
+ var dateFrom = $('#tel_dash_dateFrom').val();
+ var dateFromText = '';
+ if(dateFrom != '')
+ dateFromText = '&date_from=' + dateFrom;
+
+ // Ce imamo nastavljen datum "do"
+ var dateTo = $('#tel_dash_dateTo').val();
+ var dateToText = '';
+ if(dateTo != '')
+ dateToText = '&date_to=' + dateTo;
+
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=telephone&m=dashboard'+dateFromText+dateToText;
+ window.location.href = srv_site_url;
+}
function showPhnList(pid) {
$("#globalSettingsInner").load('ajax.php?t=telephone&m=recipients_lists', {anketa:srv_meta_anketa_id, pid:pid });
@@ -8,7 +39,7 @@ function phn_settings_save() {
form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
$("#globalSettingsInner").load('ajax.php?t=telephone&m=settings_save', form_serialize, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -45,10 +76,10 @@ function phn_add_recipients() {
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
return true;
@@ -79,7 +110,7 @@ function phnStartSurvey(usr_id){
window.location = return_data.reloadUrl;
return false;
} else {
- alert(return_data.msg);
+ genericAlertPopup('alert_parameter_datamsg');
}
},
async: false
@@ -87,7 +118,7 @@ function phnStartSurvey(usr_id){
}
-function phnNextActionChange() {
+function phnNextActionChange(phnNextAction) {
var phnNextAction = $("input[name=phnNextAction]:checked").val();
$.post('ajax.php?t=telephone&m=setNextAction', {anketa:srv_meta_anketa_id,noNavi:'true',phnNextAction:phnNextAction});
}
@@ -177,13 +208,13 @@ function phnGetNewProfileName() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=telephone&m=getProfileName', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
} else {
- alert('Invalid PID!');
+ genericAlertPopup('alert_invalidPID',null,'PopUpNarrow');
}
}
@@ -241,3 +272,20 @@ function phnUndoStatus(usr_id) {
phnGoToUser(usr_id);
});
}
+
+// Sortiranje box-ov pri dodajanju respondentov
+function initTelephoneConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ refreshFieldsList();
+ },
+ forcePlaceholderSize:'true',
+ tolerance:'pointer',
+ placeholder:'inv_field_placeholder'
+ });
+}
diff --git a/admin/survey/script/themes.js b/admin/survey/script/themes.js
index 0ec5257..d48ebc1 100644
--- a/admin/survey/script/themes.js
+++ b/admin/survey/script/themes.js
@@ -10,13 +10,13 @@ function themes_init() {
$.post("ajax.php?t=theme&a=changeProgressbar", {anketa:srv_meta_anketa_id, progressbar:progressbar}, function() {});
});
- $("a.theme_links_preview").live('click', function(event) {
+ $("div.theme_links_preview").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
window.open($(this).attr('src')+'&size=full', '_blank');
});
- $("a.theme_delete.theme").live('click', function(event) {
+ $("div.theme_delete.theme").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
@@ -27,13 +27,6 @@ function themes_init() {
});
}
});
-
- /*$("#div_theme_group span.theme_links_rename").live('click', function(event) {
- var theme = $(this).attr('theme');
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=theme&a=theme_rename', {anketa:srv_meta_anketa_id, theme:theme});
- });*/
$("#theme_rename_confirm").live('click', function(event) {
var theme_new_name = $("#theme_new_name").val();
@@ -64,20 +57,6 @@ function themes_init() {
return false;
});
- // change theme
- $("#div_theme_group img.theme").live('click', function(event) {
- event.preventDefault();
- event.stopPropagation();
- var css = $(this).attr('css');
- var gid = $(this).attr('gid');
- $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
- $("#div_theme_group_holder").html(data.group_themes);
- $('#div_theme_groups').html(data.theme_name);
- $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
- show_success_save();
- }, 'json');
- });
-
//change checkbox value
$('#izbira-checkbox-gumbov').change(function(){
var izbira = $(this).find(":selected").val();
@@ -222,6 +201,45 @@ function te_change_name (_this) {
function toggle_custom_themes () {
- $('.user_themes_button').toggleClass("plus minus");
- $('#div_theme_group.custom').toggle('medium');
+ $('.user_themes_button').toggleClass("fa-angle-up");
+ $('.div_theme_group.custom').slideToggle('medium');
+}
+
+function changeTheme (gid, css) {
+ $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
+ $("#div_theme_group_holder").html(data.group_themes);
+ $('#div_theme_groups').html(data.theme_name);
+ $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
+ actionNotePopup('success_save', 'success');
+ }, 'json');
+}
+
+function show_settings(id_of_element){
+
+ if($('#additional_settings_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
+}
+
+
+function show_settings_mobile(id_of_element){
+
+ // var options = document.getElementsByClassName("options_mobile"+id_of_element)[0];
+ var options = document.getElementById("options_mobile"+id_of_element);
+ var additional_settings = document.getElementById("additional_settings_mobile_"+id_of_element);
+
+ additional_settings.classList.toggle("active");
+
+
+ if($('#additional_settings_mobile_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_mobile_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
} \ No newline at end of file
diff --git a/admin/survey/script/timeProfiles.js b/admin/survey/script/timeProfiles.js
index 619f7f7..50833ad 100644
--- a/admin/survey/script/timeProfiles.js
+++ b/admin/survey/script/timeProfiles.js
@@ -117,7 +117,7 @@ function timeProfileAction(action) {
var stat_interval = $("#stat_interval").val();
if (type == 1 && stat_interval == '') {
// če je type 1 (intervalni način) in interval ni izbran, damo opozorilo
- alert(lang['srv_time_profile_error_interval']);
+ genericAlertPopup('srv_time_profile_error_interval');
return false;
} else {
$.post("ajax.php?t=timeProfile&a=saveProfile", {anketa:srv_meta_anketa_id, pid:pid, type:type, startDate:startDate,endDate:endDate,stat_interval:stat_interval}, function(response) {
@@ -125,7 +125,7 @@ function timeProfileAction(action) {
});
}
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
return false;
}
} \ No newline at end of file
diff --git a/admin/survey/script/ttest.js b/admin/survey/script/ttest.js
index 6daf350..edea283 100644
--- a/admin/survey/script/ttest.js
+++ b/admin/survey/script/ttest.js
@@ -17,6 +17,7 @@ function ttestSpremenljivkaChange() {
$('#ttestNumerusSpan').addClass('gray');
}
function ttestVariableChange() {
+
// prvi dropdown
var seq = new Array();
var spr = new Array();
@@ -24,6 +25,7 @@ function ttestVariableChange() {
$('#ttestNumerus').each(function(index,el) {
spr.push($(el).val());
});
+
// omogočimo
$('#ttestNumerus').attr('disabled',false).focus().attr('size', 1);
$('#ttestNumerusSpan').removeClass('gray');
@@ -40,11 +42,13 @@ function ttestVariableChange() {
var seq2 = $("#ttestSpremenljivka option:selected").attr('seq2');
var label2 = $("#ttestSpremenljivka option:selected").html();
+
// variable iz checkboxov
var sub_conditions = new Array();
$('#ttestVariablesSpan input:checked').each(function(index,el) {
sub_conditions.push($(el).val());
});
+
$("#ttestResults").load("ajax.php?t=ttest&a=variableChange", {anketa:srv_meta_anketa_id, sub_conditions:sub_conditions, spr:spr, seq:seq, grd:grd, spr2:spr2, seq2:seq2, grid2:grid2, label2:label2}, function() {
// preverimo da samo dva izbrana checkboxa
var cnt = $("input[name=subTtest]:checked").length;
@@ -54,9 +58,9 @@ function ttestVariableChange() {
$(this).attr("disabled", true);
$(this).parent().addClass("gray");
});
- $("#ttestVariablesSpan").removeClass('active');
-
- } else if (cnt < 2) {
+ $("#ttestVariablesSpan").removeClass('active');
+ }
+ else if (cnt < 2) {
// onemogočimo
$('#ttestNumerus').attr('disabled',true);
$('#ttestNumerusSpan').addClass('gray');
@@ -80,7 +84,7 @@ function doArchiveTTest() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveTTest() {
@@ -97,7 +101,7 @@ function submitArchiveTTest() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -113,9 +117,9 @@ function createArchiveTTestBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -123,6 +127,6 @@ function createArchiveTTestBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/uporabniki_custom.js b/admin/survey/script/uporabniki_custom.js
index 13c9d24..a5df8e8 100644
--- a/admin/survey/script/uporabniki_custom.js
+++ b/admin/survey/script/uporabniki_custom.js
@@ -1,7 +1,13 @@
//Uporabimo custom funkcijo pri uporabnikih, dokler se ne posodobi jQuery
$(document).ready(function () {
- onload_init();
+ // Search na vrhu po pritisku na enter skoci na drupal search
+ $('#searchSurvey').keypress(function (e) {
+ if (e.which == 13) {
+ executeDrupalSearch();
+ return false;
+ }
+ });
$('#xtradiv strong').on("click", function (event) {
$('#xtradivSettings').toggle();
@@ -12,7 +18,7 @@ $(document).ready(function () {
function language_change (lang) {
$.post('ajax.php?t=surveyList&a=language_change', {lang: lang}, function () {
- /*window.location.reload();*/
- window.location = window.location.href.split("?")[0];
+ window.location.reload();
+ //window.location = window.location.href.split("?")[0];
});
}
diff --git a/admin/survey/script/vprasanje.js b/admin/survey/script/vprasanje.js
index 886d689..a2f6363 100644
--- a/admin/survey/script/vprasanje.js
+++ b/admin/survey/script/vprasanje.js
@@ -11,7 +11,7 @@ function onload_init_vprasanje() {
});
}
// prikaze fullscreen urejanje vprasanja
-function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
+function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close, focus_last) {
if (locked) return;
//za ureditev custom opisnih label pri drsniku
@@ -25,10 +25,7 @@ function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
if ( ! (no_close==true) )
close_all_editing();
-
- // zapremo knjiznico
- $('#toolbox_library').hide();
-
+
// ce smo v formi zapremo hitre nastavitve desno zgoraj
$('#form_settings_obvescanje').hide();
$('#email_switch').attr("src", "img_0/plus.png");
@@ -58,7 +55,8 @@ function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
// odpremo okno za dodajanje nove kategorije
var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
- inline_nova_vrednost(last);
+
+ inline_nova_vrednost(last, focus_last);
//Preklop na tab za urejanje label grafov
if(chart_edit == 1){ vprasanje_tab(spremenljivka, 4); }
@@ -115,7 +113,7 @@ function vprasanje_pozicija (spremenljivka) {
var elHeight = $(id).height();
//$('#vprasanje_float_editing').css('top', elTop-163).show();
- $('#vprasanje_float_editing').css('margin-top', elTop-163).show();
+ $('#vprasanje_float_editing').css('margin-top', elTop-224).show();
var floatingTop = $('#vprasanje_float_editing').offset().top - 40; // ker je premaknjeno navzgor
var floatingHeight = $('#vprasanje_float_editing').height() + 40;
@@ -177,18 +175,15 @@ function vprasanje_save (silentsave, spr, callback) {
id = '#'+spremenljivka;
var form_serialize = $("form[name=vprasanje_edit]").serialize() || {spremenljivka: spremenljivka};
-
+
if (silentsave != true) {
$('#calculation').fadeOut('fast').html('');
$('#vprasanje_float_editing').hide().html('');
$(id).removeClass('spr_editing');
-
- // prikazemo knjiznico ce je odprta
- $('#toolbox_library').show();
}
-
+
$.post('ajax.php?t=vprasanje&a=vprasanje_save&silentsave='+silentsave, form_serialize, function (data) {
if (silentsave != true) {
@@ -206,6 +201,10 @@ function vprasanje_save (silentsave, spr, callback) {
else {
$(id).html(data);
+
+ // ker se z zgornjo kodo pobrise vrstica desno zgoraj (hitre nastavitve - celotni div se nadomesti z novo vsebino) jo je potrebno na novo izrisati
+ let fake_event = {target: id};
+ branching_mouseover(fake_event);
// odpremo okno za dodajanje nove kategorije
var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
@@ -250,10 +249,13 @@ function vprasanje_cancel () {
// pobrise vrednost (v srv_vrednost)
function vrednost_delete(spremenljivka, vrednost, tip, other) {
-
+
$('#vrednost_'+vrednost).remove();
// popravimo še čhekbox za missinge
+ //star nacin
$("#missing_value_"+other).attr('checked', false);
+ //nov nacin
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', false);
$.post('ajax.php?t=vprasanje&a=vrednost_delete', {spremenljivka: spremenljivka, vrednost: vrednost, other: other, anketa: srv_meta_anketa_id}, function() {
if(tip == 17) edit_ranking_moznosti();
});
@@ -481,6 +483,7 @@ function vrednost_cancel () {
function vrednost_fastadd (spremenljivka) {
$('#fade').fadeTo('slow', 1);
+ $('#vrednost_edit').addClass('PopUpNarrow');
$('#vrednost_edit').show().load('ajax.php?t=vprasanje&a=vrednost_fastadd', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id});
}
@@ -521,6 +524,26 @@ function show_timer (value) {
function show_dostop (value) {
$('#dostop').toggle();
+
+ //ce se odkljuka "skrij za respondente" (visible) nastavi dostop na 4 (vidno vsem)
+ if(!value){
+ $('#_dostop').prop('checked', false);
+ }
+}
+
+// prikaze/skrije opcije reminder (obvezno, neobvezno vprasanje)
+function show_reminders (value) {
+
+ $('#reminders').toggle();
+
+ //ce se nastasvi na 0, se more narediti uncheck za radio
+ if(value == 0){
+ $('#reminder_1').prop('checked', false);
+ $('#reminder_2').prop('checked', false);
+ }
+ else
+ $('#reminder_1').prop('checked', true);
+
}
function change_number(id1, id2) {
@@ -601,12 +624,31 @@ function change_subtype_number (spremenljivka) {
vprasanje_fullscreen(spremenljivka);
});
}
-function change_tip(spremenljivka, tip) {
+function change_tip(spremenljivka, tip, confirmed) {
- $.post('ajax.php?t=vprasanje&a=change_tip', {spremenljivka: spremenljivka, tip: tip, anketa: srv_meta_anketa_id}, function (data) {
- vprasanje_fullscreen(spremenljivka, data, false, true);
- vprasanje_save(true);
- });
+ var old_tip = $('li#branching_'+spremenljivka).attr('tip');
+
+ $.post('ajax.php?t=vprasanje&a=change_tip', {spremenljivka: spremenljivka, tip: tip, confirmed: confirmed, anketa: srv_meta_anketa_id},
+ function (data) {
+
+ try {
+ var data_json = JSON.parse(data);
+
+ if (data_json.error == 1) {
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data_json.output).fadeIn("fast").css('width', '600px');
+
+ return;
+ }
+ }
+ catch(e){}
+
+ $('li#branching_'+spremenljivka).attr('tip', tip);
+ $('li#branching_'+spremenljivka).removeClass('spr_tip_'+old_tip).addClass('spr_tip_'+tip);
+
+ vprasanje_fullscreen(spremenljivka, data, false, true);
+ vprasanje_save(true);
+ });
}
function change_demografija(spremenljivka, podtip) {
@@ -632,9 +674,9 @@ function change_limittype(limittype) {
}
}
-function num_limit(field, checked) {
+function num_limit(field, checkbox_id) {
- if(checked){
+ if($('#'+checkbox_id).is(':checked')){
document.getElementById(field).disabled = false;
}
@@ -643,6 +685,18 @@ function num_limit(field, checked) {
}
}
+function changeGridAlign(spremenljivka, enota){
+ var tip = $('#spremenljivka_tip_'+spremenljivka+' option:selected').val();
+
+ //"izberi iz seznama" ima po default postavitev na levo, ostale na sredino
+ //sprememba v seznam
+ if(tip == 6 && enota == 6)
+ $('#gridAlign').val(2); //poravnavo uredi na desno
+ //sprememba iz seznama
+ else if(tip == 6 && enota != 6)
+ $('#gridAlign').val(0); //poravnavo uredi na sredino
+}
+
function change_diferencial(spremenljivka, enota){
if(enota == 3)
$('.grid_subtitle').css('display', 'block');
@@ -741,11 +795,145 @@ function get_editor_close(id) {
// prikaze field da manager doda nek komentar obstojecemu komentarju na vprasanje
-function comment_on_comment (id) {
+function comment_on_comment (id, user, date, spr_id) {
$('#comment_on_comment_'+id).html(
- '<br /><textarea name="vsebina" id="vsebina_comment_on_comment_'+id+'" style="width:100%"></textarea><br />' +
- '<input type="submit" value="'+lang['send']+'" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;" />'
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+// prikaze field da manager doda nek komentar obstojecemu komentarju na vprasanje respondenta
+function comment_on_comment_resp (id, user, date) {
+ $('#comment_on_comment_resp_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_resp_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_resp_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment_resp\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_resp_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+}
+
+// prikaze field da manager doda nek komentar obstojecemu splosnemu komentarju
+function comment_on_comment_splosni (id, user, date) {
+ $('#comment_on_comment_splosni_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_splosni_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_splosni_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_splosni_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+// prikaze field da manager doda nek komentar obstojecemu splosnemu komentarju respondenta
+function comment_on_comment_splosni_resp (id, user, date) {
+ $('#comment_on_comment_splosni_resp_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_splosni_resp_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_splosni_resp_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment_splosni_resp\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_splosni_resp_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
);
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+function comment_delete (id) {
+ $.post("ajax.php?a=comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function respondent_comment_delete (id) {
+ $.post("ajax.php?a=respondent_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function survey_respondent_comment_delete (id) {
+ $.post("ajax.php?a=survey_respondent_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function survey_comment_delete (id) {
+ $.post("ajax.php?a=survey_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function question_comment_solve(ocena, id){
+
+ $.post("ajax.php?a=comment_ocena", {type: 'question_comment', ocena: ocena, id: id, anketa: srv_meta_anketa_id}, function () {
+
+ if(ocena == '2'){
+ $('#comment_box_'+id).addClass('archived').find('.solve').html(
+ '<p class="unarchive_comment" onclick="question_comment_solve(\'0\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_unarchive']+
+ '</p>'
+ );
+ }
+ else{
+ $('#comment_box_'+id).removeClass('archived').find('.solve').html(
+ '<p class="archive_comment" onclick="question_comment_solve(\'2\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_archive']+
+ '</p>'
+ );
+ }
+ });
+}
+
+function question_respondent_comment_solve(text2, id){
+
+ $.post("ajax.php?a=comment_ocena", {type: 'respondent_comment', text2: text2, id: id, anketa: srv_meta_anketa_id}, function () {
+
+ if(text2 == '2'){
+ $('#comment_box_'+id).addClass('archived').find('.solve').html(
+ '<p class="unarchive_comment" onclick="question_respondent_comment_solve(\'0\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_unarchive']+
+ '</p>'
+ );
+ }
+ else{
+ $('#comment_box_'+id).removeClass('archived').find('.solve').html(
+ '<p class="archive_comment" onclick="question_respondent_comment_solve(\'2\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_archive']+
+ '</p>'
+ );
+ }
+ });
}
@@ -838,22 +1026,81 @@ function validation_if_remove (spremenljivka, _if) {
}
-function grid_plus_minus (type) {
+function grid_plus_minus (type, confirm='0') {
var selected = $('#grids_count').val();
- if (type == '1')
+ // Dodajamo stolpec
+ if (type == '1'){
selected = parseInt(selected) + 1;
- else if (type == '0')
- selected = parseInt(selected) - 1;
-
- if (selected >= 2 && selected <= 12)
- $('#grids_count').val( selected );
-
- vprasanje_save(true);
-
- return false;
+
+ if (selected >= 2 && selected <= 12)
+ $('#grids_count').val( selected );
+ vprasanje_save(true);
+
+ return false;
+ }
+ // Brisemo stolpec
+ else if (type == '0'){
+ selected = parseInt(selected) - 1;
+
+ // Preverimo, ce imamo podatke - potem opozorimo da se lahko izgubijo podatki
+ $.post('ajax.php?t=vprasanje&a=grid_delete_check', {anketa: srv_meta_anketa_id},
+ function(data) {
+
+ // Nimamo podatkov - normalno nadaljujemo
+ if (!data || confirm === '1'){
+ if (selected >= 2 && selected <= 12)
+ $('#grids_count').val( selected );
+
+ vprasanje_save(true);
+
+ return false;
+ }
+ else{
+ // Imamo podatke - prikazemo popup z opozorilom
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ }
+ }, 'json'
+ );
+ }
+}
+
+// Dodamo/odstranimo missing stolpec iz vprasanj tipa tabela
+function grid_add_remove_missing (checkbox, spremenljivka, confirm='0') {
+
+ // Dodajamo missing stolpec - ne rabimo nicesar preverjati
+ if ($(checkbox).is(":checked")){
+
+ // Shranimo spremembo
+ vprasanje_save(true, spremenljivka);
+ }
+ // Brisemo stolpec
+ else{
+
+ // Preverimo, ce imamo podatke - potem opozorimo da se lahko izgubijo podatki
+ $.post('ajax.php?t=vprasanje&a=grid_delete_missing_check', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka},
+ function(data) {
+
+ // Nimamo podatkov oz. smo potrdili brisanje - normalno nadaljujemo
+ if (!data || confirm === '1'){
+ // Shranimo spremembo
+ vprasanje_save(true, spremenljivka);
+ }
+ else{
+ // Imamo podatke - prikazemo popup z opozorilom
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ }
+
+ }, 'json'
+ );
+ }
+
+ // Zapremo meni z missingi
+ close_missing_menu(spremenljivka);
}
function grid_multiple_add (spr_id) {
@@ -925,27 +1172,30 @@ function grid_multiple_save (spr) {
}
-function show_alert_missing(){
+function show_alert_missing(sprid){
- if($('#missing_value_-97').attr("checked"))
+ if($('#missing_value_-97').attr("checked") || $('#missing_value_'+sprid+'-97').attr("checked"))
var missing_97 = 1;
else
var missing_97 = 0;
- if($('#missing_value_-98').attr("checked"))
+ if($('#missing_value_-98').attr("checked") || $('#missing_value_'+sprid+'-98').attr("checked"))
var missing_98 = 1;
else
var missing_98 = 0;
- if($('#missing_value_-99').attr("checked"))
+ if($('#missing_value_-99').attr("checked") || $('#missing_value_'+sprid+'-99').attr("checked"))
var missing_99 = 1;
else
var missing_99 = 0;
- var reminder = $('select[name=reminder]').val();
+ //samo preveri, ce je reminder vklopljen - ne preveri ali je soft ali hard (to pridobi iz radio)
+ var reminder = $('input[type=checkbox][name=reminder]').is(':checked');
+ //var reminder_type = $('input[type=radio][name=reminder]').val();
if(reminder == 1 || reminder == 2){
- if(missing_97 == 1){
+
+ /* if(missing_97 == 1){
$('#alert_show_97').prop('disabled', false);
$('#alert_show_97_text').removeClass('gray');
}
@@ -973,20 +1223,22 @@ function show_alert_missing(){
$('#alert_show_99').prop('disabled', true);
$('#alert_show_99').attr("checked", false);
$('#alert_show_99_text').addClass('gray');
- }
+ } */
}
else{
- $('#alert_show_97').prop('disabled', true);
- $('#alert_show_97').attr("checked", false);
- $('#alert_show_97_text').addClass('gray');
+ $('#alert_show_96_'+sprid).attr("checked", false);
+
+ //$('#alert_show_97').prop('disabled', true);
+ $('#alert_show_97_'+sprid).attr("checked", false);
+ //$('#alert_show_97_text').addClass('gray');
- $('#alert_show_98').prop('disabled', true);
- $('#alert_show_98').attr("checked", false);
- $('#alert_show_98_text').addClass('gray');
+ //$('#alert_show_98').prop('disabled', true);
+ $('#alert_show_98_'+sprid).attr("checked", false);
+ //$('#alert_show_98_text').addClass('gray');
- $('#alert_show_99').prop('disabled', true);
- $('#alert_show_99').attr("checked", false);
- $('#alert_show_99_text').addClass('gray');
+ //$('#alert_show_99').prop('disabled', true);
+ $('#alert_show_99_'+sprid).attr("checked", false);
+ //$('#alert_show_99_text').addClass('gray');
}
}
@@ -1625,7 +1877,7 @@ function checkCheckboxLimits(spremenljivka, value, checkbox_limit_name){
//ce je min limit vecji od max limit, je potrebno javiti opozorilo in vrednost min limita dati na 0
//if(min_value > max_value){
if(max_value!=0 && min_value > max_value){
- alert(lang['srv_checkbox_min_limit_error_msg']); //opozorilo v obliki pop-up okna
+ genericAlertPopup('srv_checkbox_min_limit_error_msg'); //opozorilo v obliki pop-up okna
$('#checkbox_min_limit_' + spremenljivka).val(0); //spremeni vrednost min limita na 0 oz. Ne
}
}
@@ -1637,4 +1889,25 @@ function toggleCheckboxMinLimitReminder(spremenljivka, checkbox_min_limit){
}else{
$('#checkboxLimitReminder_' + spremenljivka).css('display', 'none'); //skrij nastavitve za opozorilo
}
-} \ No newline at end of file
+}
+
+
+// Fieldset toggle
+function fieldsetToggle(element){
+
+ $(element).next('.fieldset_holder').slideToggle(function(){
+ //$('#vprasanje_edit').animate({scrollTop: $(this).offset().top}, 2000);
+ });
+
+ $(element).find('.faicon').toggleClass('arrow2_d').toggleClass('arrow2_u');
+
+}
+
+// Gumb dodaj kategorijo - doda okno za novo kategorijo in ga fokusira
+function add_question_category(spremenljivka){
+
+ var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
+
+ inline_nova_vrednost(last, true);
+}
+
diff --git a/admin/survey/script/vprasanjeDeleted.js b/admin/survey/script/vprasanjeDeleted.js
new file mode 100644
index 0000000..ee2f644
--- /dev/null
+++ b/admin/survey/script/vprasanjeDeleted.js
@@ -0,0 +1,86 @@
+// Odpremo knjiznico v urejanju ankete
+function displayVprasanjeDeletedPopup(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('vprasanje_deleted_popup').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=vprasanjeDeleted&a=displayVprasanjeDeletedPopup', {anketa: srv_meta_anketa_id});
+}
+
+
+// Klik na posamezen item na desni
+function selectVprasanjeDeletedItem(item_id){
+
+ if($('#question_item_holder_'+item_id).hasClass('active')){
+ $('#question_item_holder_'+item_id).removeClass('active');
+ $('#question_item_check_'+item_id).attr("checked", false);
+ }
+ else{
+ $('#question_item_holder_'+item_id).addClass('active');
+ $('#question_item_check_'+item_id).attr("checked", true);
+ }
+
+ // Prestejemo oznacene iteme
+ var count = $('.question_item_check:checkbox:checked').length;
+ $('#selected_item_counter').html(count);
+
+ // Nastavimo gumb dodaj kot disabled glede na to ce imamo elemente ali ne
+ if(count > 0){
+ $("#insert_vprasanje_deleted_button").prop('disabled', false);
+ }
+ else{
+ $("#insert_vprasanje_deleted_button").prop('disabled', true);
+ }
+}
+
+function deleteVprasanjeDeleted(item_id, item_type){
+
+ $.post('ajax.php?t=vprasanjeDeleted&a=deleteItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+
+ event.stopPropagation();
+}
+
+// Restavriramo pobrisano vprasanje nazaj v anketo na konec
+function insertVprasanjeDeletedItemsIntoSurvey(){
+
+ var items = [];
+
+ var prev = false;
+ var note = '1';
+
+ $('.question_item_check:checkbox:checked').each(function(){
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(20);
+
+ items.push(id);
+
+ // Preverimo za obvestilo, ce dodajamo vec elementov in ce so razlicni
+ if(prev){
+ note = '1m';
+ }
+
+ prev = true;
+ });
+
+ $("#branching").load('ajax.php?t=vprasanjeDeleted&a=addIntoSurvey', {anketa: srv_meta_anketa_id, items: items}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_survey_'+note, 'success');
+ });
+}
+
+
+// Predogled pobrisanega vprasanjaoz. vprasanja iz knjiznice
+function previewVprasanje(spr_id){
+
+ $('#vprasanje_preview').load('ajax.php?a=preview_spremenljivka_lib', {anketa: srv_meta_anketa_id, spremenljivka: spr_id, podstran: srv_meta_podstran}).removeClass('displayNone');
+
+ event.stopPropagation();
+}
+
+// Predogled pobrisanega vprasanja
+function closePreviewVprasanje(){
+ $('#vprasanje_preview').addClass('displayNone').empty();
+}
diff --git a/admin/survey/script/vprasanjeInline.js b/admin/survey/script/vprasanjeInline.js
index 73974dd..1cef4ab 100644
--- a/admin/survey/script/vprasanjeInline.js
+++ b/admin/survey/script/vprasanjeInline.js
@@ -70,8 +70,10 @@ function onload_init_inline () {
$("div.variable_inline").live('focus', function() {
close_all_editing($(this).closest('.spremenljivka_content').attr('spr_id'));
}).live('keyup', function () {
+
var variable = $(this).html();
var tip = $(this).closest('.spremenljivka_content').attr('tip');
+
if($.trim(variable).length && tip != 1){
variable = variable.replace(/(<([^>]+)>)/ig,"");
var variable1 = check_valid_variable(variable);
@@ -79,6 +81,13 @@ function onload_init_inline () {
$(this).html(variable1);
}
}
+ else if($.trim(variable).length && tip == 1){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_radio_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
}).live('keypress', function (event) {
enterKeyPressHandler(event);
}).live('blur', function () {
@@ -100,7 +109,6 @@ function onload_init_inline () {
inline_nova_vrednost(this); // tale je ce urejamo kategorijo, da se pojavi cim kliknemo
},
keypress: function (event) {
- //console.log("keypress");
var evt = event || window.event;
var charCode = evt.which || evt.keyCode;
if (charCode == 9) return; // ce gremo s tabom naprej, da ne doda nove kategorije
@@ -113,6 +121,7 @@ function onload_init_inline () {
// ko zacnemo pisati v polje za dodajanje nove vrednosti, jo takoj kreiramo, da dobimo nov ID - naprej gre potem isto kot urejanje
// new="waiting" nam pove, da se je izvrsil post, drugace se ob tipkanju veckrat dodaja
if (div.attr('id') == 'variabla_new' && div.attr('new') != 'waiting' && ( div.find('div.vrednost_inline:first').html() != '' || div.find('div.vrednost_inline:last').html() != '' )) {
+
var spr_id = div.closest('.spremenljivka_content').attr('spr_id');
div.attr('new', 'waiting');
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_new', {
@@ -122,7 +131,9 @@ function onload_init_inline () {
div.attr('id', 'variabla_' + data);
div.attr('new', '');
div.find('div.vrednost_inline').attr('id', 'vre_id_' + data).attr('vre_id', data);
+ div.find('div.icons_holder').css('display', 'inline');
div.find('span.inline_hidden').attr('odg_id', data);
+ div.find('span.correct').attr('vre_id', data);
div.find('span.inline_if_follow').attr('onclick', 'follow_up_condition(\''+data+'\'); return false;');
div.find('span.inline_if_not').attr('onclick', 'vrednost_condition_editing(\''+data+'\'); return false;');
@@ -218,8 +229,30 @@ function onload_init_inline () {
});
// urejanje vrednosti grida
- $("div.grid_variable_inline").live('blur', function () {
- var spr_id = $(this).closest('div.spremenljivka_content').attr('spr_id');
+ $("div.grid_variable_inline").live('focus', function() {
+ close_all_editing($(this).closest('.spremenljivka_content').attr('spr_id'));
+ }).live('keyup', function () {
+
+ var variable = $(this).html();
+ var tip = $(this).closest('.spremenljivka_content').attr('tip');
+
+ if($.trim(variable).length && tip != 6){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
+ else if($.trim(variable).length && tip == 6){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_radio_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
+ }).live('keypress', function (event) {
+ enterKeyPressHandler(event);
+ }).live('blur', function () {
inline_variable_grid(spr_id, this);
});
@@ -416,11 +449,6 @@ function inline_vprasanje_float_editing_click(event) {
function inline_naslov (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
// shranimo
if (parseInt(spremenljivka) == -1) { // uvod
@@ -436,11 +464,6 @@ function inline_naslov (spremenljivka, _this) {
function inline_textfield (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
// shranimo
if (parseInt(spremenljivka) == -1) { // uvod
@@ -454,14 +477,7 @@ function inline_textfield (spremenljivka, _this) {
// shrani vsebino za hotspot vprasanje
function inline_hotspot (spremenljivka, _this) {
-
- //if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
// shranimo
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
}
@@ -471,11 +487,6 @@ function inline_info (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
$.post('ajax.php?t=vprasanjeinline&a=inline_info_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, info: $(_this).html()});
}
@@ -485,7 +496,6 @@ function inline_vrednost_variable(vre_id, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_variable_save', {vre_id: vre_id, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, variable: $(_this).html()});
-
}
// shrani variablo vprasanja
@@ -502,25 +512,15 @@ function inline_variable (spremenljivka, _this) {
function inline_vrednost (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //var vnosi = $('#spremenljivka_contentdiv3444 div.variabla').length;
- //var vnosi = $('#variable_holder div.variabla').length;
- //var vnosi = $('.edit_mode div.variabla').length;
- var vnosi = $('.edit_mode div.vrednost_inline').length;
- //console.log(spremenljivka);
- //console.log(vnosi);
+ var vnosi = $('.edit_mode div.vrednost_inline').length;
- // dodatek may: shranimo vrednost textaree in inputa pri text fieldih
- if ($(_this).attr('ETF') == 'true') {
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).val()} );
- }
- else {
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
- }
- //$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html(), sbSize: vnosi});
+ // dodatek may: shranimo vrednost textaree in inputa pri text fieldih
+ if ($(_this).attr('ETF') == 'true') {
+ $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).val()} );
+ }
+ else {
+ $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
+ }
}
// shrani ime hotspot obmocja
@@ -528,31 +528,16 @@ function inline_hotspot_vrednost (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //var vnosi = $('#spremenljivka_contentdiv3444 div.variabla').length;
- //var vnosi = $('#variable_holder div.variabla').length;
- //var vnosi = $('.edit_mode div.variabla').length;
var vnosi = $('.edit_mode div.vrednost_inline').length;
- //console.log(spremenljivka);
- //console.log(vnosi);
- $.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_vrednost_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
- //$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html(), sbSize: vnosi});
+
+ $.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_vrednost_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
}
// shrani grid vprasanja
function inline_grid (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
// String zaenkrat pustimo kot html
- //var string = $(_this).text();
var string = $(_this).html();
// pri dvojni tabeli popravimo se desna polja
@@ -575,12 +560,7 @@ function inline_subtitle_grid (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //$.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).html()});
- $.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).text(), grid_id: $(_this).attr('grid_id')});
+ $.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).text(), grid_id: $(_this).attr('grid_id')});
}
// pobrise vrednost (v srv_vrednost)
@@ -590,7 +570,9 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
//ce je posebna vrednost, se rabi dodat callbaack in se lahko brise tudi zadnja vednost
//special vrednost je recimo marker na mapi - ni html taga z id="variabla_"+vrednost
var special_vrednost = ($("#variabla_"+vrednost).length < 1);
-
+
+ var other = $("#variabla_"+vrednost).attr('other');
+
if ( confirmed==1 || confirm(text) ) {
if (confirmed == undefined) confirmed = 1;
@@ -605,9 +587,11 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
//ce je navadna vrednost, kot rec. radio ali checkbox
if(!special_vrednost){
// popravimo se chekbox za missinge
- var other = $("#variabla_"+vrednost).attr('other');
if (other != '0') {
- $("#missing_value_"+other).attr('checked', false);
+ //star nacin
+ $("#missing_value_"+other).attr('checked', false);
+ //nov nacin
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', false);
}
// odstranimo element
@@ -622,9 +606,6 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
else{
callback();
}
-
-
-
}
else if (data.error == 1) {
$('#fade').fadeIn("fast");
@@ -633,29 +614,43 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
else if (data.error == 2) {
$('#fade').fadeIn("fast");
- $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '400px');
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ //ce je missing
+ /* var missing = $("#missing_value_"+spremenljivka+"_"+other);
+
+ if(missing){
+ $('#brisivrednostcancel').attr('onClick', $('#brisivrednostcancel').attr('onClick')+' $(\'#missing_value_'+spremenljivka+'_'+other+'\').attr(\'checked\', true);');
+ } */
+
//ce je posebna vrednost, se rabi dodat callbaack
if(special_vrednost){
//treba je dodati callback - sori, vem da je grdo - glej funkcijo ajax_vrednost_delete v class.Vprasanje.php
document.getElementById('brisivrednostchecked').onclick =
function(){inline_vrednost_delete(spremenljivka, vrednost, 1, callback); $('#dropped_alert').html('').hide(); return false;}
-
+
+ var missing = $("#missing_value_"+spremenljivka+"_"+other);
+
$('#fade').fadeOut("fast");
}
}
}, 'json'
);
-
+ }
+ else{
+ //ce stisne cancel, nazaj vklopi check
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', true);
}
}
// narise polje za dodajanje vrednosti
-function inline_nova_vrednost (_this) {
-
+function inline_nova_vrednost (_this, focus) {
// ce je anketa zaklenjena
if ($(_this).attr('contenteditable') != 'true') return;
+
+ // Ce smo na mobitelu tega ni
+ if ($('.mobile_header:visible').length != 0) return;
// ce imamo v edit modu vprasanja same default odgovore (to je ob novem vprasanju in ce se nic ne spreminja)
var variable_holder = $(_this).closest('.variable_holder');
@@ -664,7 +659,7 @@ function inline_nova_vrednost (_this) {
if ( $(this).find('.vrednost_inline').attr('default') != '1' ) _default = 0;
});
if (_default == 1) return;
-
+
var tip = $(_this).closest('.spremenljivka_content').attr('tip');
// Disablamo ife, ce nima ustreznega paketa
@@ -674,13 +669,12 @@ function inline_nova_vrednost (_this) {
else{
var if_class_locked = '';
}
-
+
// ce je zadnje polje in ce lahko znotraj tega parenta dodajamo vrednosti
if ( $(_this).closest('.variabla').is(':last-child') && $(_this).closest('.variabla').parent().hasClass('allow_new') ) {
-
// ce ni prazno (da pri novem ne dodamo takoj) && ce je attr new tudi ne dodamo, ker pocakamo da se zgenerira nov id
- if ($(_this).html() != '' && $(_this).attr('vre_id') != 'new') {
+ if ($(_this).html() != '' && $(_this).attr('vre_id') != 'new' && $(_this).attr('vre_id') != 'new_2') {
var spremenljivka = $(_this).closest('.spremenljivka_content').attr('spr_id'); //dobimo id spremenljivke
var orientation = $('#spremenljivka_content_'+spremenljivka).attr('spr_orientation'); //dobimo orientacijo iz dodanega parametra, ker iz prejsnje varianta ne gre, ko je urejevalno okno zaprto
@@ -688,36 +682,47 @@ function inline_nova_vrednost (_this) {
// radio, checkbox, roleta
if (tip <= 3) {
-
if(tip <= 3 && orientation != 7 && orientation != 8){
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>';
//if (tip <= 2)
if (tip <= 2 && orientation != 6)
- new_div += '<input id="foo_new" class="enka-admin-custom enka-inline" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" /><span class="enka-checkbox-radio"></span>';
-
+ new_div += '<input id="foo_new" class="enka-admin-custom enka-inline" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" /><span class="enka-checkbox-radio"></span>';
+
// Ikona za hiter upload slike (ce je vklopljena)
if($(_this).closest('.variabla').parent().find('.image_upload').length){
- new_div += '<span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>';
+ new_div += '<span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>';
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
+ (($(_this).closest('.variabla').parent().find('.correct').length) ? ' <span class="faicon correct inline" spr_id="'+spremenljivka+'" vre_id="new" title="'+lang['srv_vrednost_correct']+'"></span>' : '')+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
else{
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
+ (($(_this).closest('.variabla').parent().find('.correct').length) ? ' <span class="faicon correct inline" spr_id="'+spremenljivka+'" vre_id="new" title="'+lang['srv_vrednost_correct']+'"></span>' : '')+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
}
else if(tip <= 3 && orientation == 7){
@@ -727,14 +732,20 @@ function inline_nova_vrednost (_this) {
'<span class="faicon move_updown inline inline_move" title=""></span>';
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
' <input id="foo_new" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" />'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
}
else if(tip <= 2 && orientation == 8){ //ce imamo radio ali checkbox z drag-drop
@@ -742,21 +753,31 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">';
if($(_this).closest('.variabla').parent().find('.image_upload').length){
- new_div += '<span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>'+
+ new_div += '<span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
} else{
new_div += '<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
}
}
@@ -765,12 +786,10 @@ function inline_nova_vrednost (_this) {
//drag and drop grid
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- '</div>';
+
+ '</div>';
// ranking
} else if (tip == 17) {
@@ -779,14 +798,19 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
' <select style="width:50px; margin-top:0; float:left;"> '+
' <option></option> '+
' </select> '+
'<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
}
@@ -795,52 +819,90 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- '</div>';
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
// vsota
} else if (tip == 18) {
- var new_div = '<div id="variabla_new" class="variabla variabla_vsota after_'+$(_this).attr('vre_id')+'" style="width:100%">'+
+ var text_width = $(_this).closest('.variabla').find('.vrednost_inline_vsota')[0].style.width;
+
+ var new_div = '<div id="variabla_new" class="variabla variabla_vsota after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '<div id="vre_id_new" class="vrednost_inline" style="width:111px" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '<div id="vre_id_new" class="vrednost_inline vrednost_inline_vsota" style="width:'+text_width+'" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
' <input type="text" name="foo_" maxlength="8" size="5">'+
'</div>';
// tabele
} else {
-
var new_div = $( '<tr id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">' + $(_this).closest('.variabla').html() + '</tr>' );
new_div.find('*').removeAttr('id');
- new_div.find('div').attr('id', 'vre_id_new').attr('vre_id', 'new').attr('default', '1').html(lang['srv_new_vrednost']);
+ new_div.find('div.vrednost_inline').attr('id', 'vre_id_new').attr('vre_id', 'new').attr('default', '1').html(lang['srv_new_vrednost_grid']);
+ new_div.find('div.icons_holder').css('display', 'none');
// odstani input polje drugo, ce dodajamo za poljem drugo
- new_div.find('input[type=text]').remove();
+ new_div.find('input[type=text]:disabled').remove();
new_div.find('span.inline_other').remove();
new_div.find('span.red').remove();
+
+ //child pri maxDiff je drugi, ker prvi je radio
+ let child = (tip == 6 && enota == 5) ? 'td:nth-child(2)' : 'td:first-child';
// dodamo opcijo za drugo
- new_div.find('td:first-child').append(' <span class="inline_other pointer" onclick="vrednost_new(\''+$(_this).closest('.spremenljivka_content').attr('spr_id')+'\', \'1\', \'\');"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>');
+ new_div.find(child).append(' <span class="inline_other pointer" '+((tip == 24) ? 'style="margin-left:0px;" ' : '')
+ +'onclick="vrednost_new(\''+$(_this).closest('.spremenljivka_content').attr('spr_id')+'\', \'1\', \'\');">'+lang['srv_novavrednost_drugo']+'</span>');
if (new_div.find('div').length > 1){
//new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').html('');
- new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').attr('default', '1').html(lang['srv_new_vrednost']);
+ new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').attr('default', '1').html(lang['srv_new_vrednost_grid']);
}
+
+ let icons =
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit" style="margin-left:0;"></span>';
+
+ new_div.find('div.icons_holder').html(icons);
}
$(_this).closest('.variabla').parent().append(new_div);
+ //executed when DOM is ready, after manipulation
+ $(function(){
+ //pripni missinge v variabla_new
+ if (tip <= 3) {
+ $.post('ajax.php?t=branching&a=get_missing_block', {spremenljivka: spremenljivka, lang_id: srv_meta_lang_id, anketa: srv_meta_anketa_id}, function (data) {
+ if(data){
+ $('[id="missing_block_'+spremenljivka+'"]').last().html(data);
+ }
+ });
+ }
+ });
+
+ // Po potrebi izvedemo focus na novi variabli
+ if(focus === true)
+ $('#branching_'+spremenljivka).find('#vre_id_new').focus();
}
- }
+ }
}
// skrije (odstrani) polje za dodajanje vrednosti
@@ -863,45 +925,15 @@ function inline_nova_vrednost_hide (spr_id, vre_id) {
}
-// Pocisti text ce je bil pastan
-function inline_clear_paste(_this){
-
- // text ki je bil pastan
- var temp = $(_this).html();
-
- // pocistimo tage - dodamo <p> ce je slucajno prazen - drugace vrne prazen string
- temp = $('<p>'+temp+'</p>').text();
-
- // shranimo nazaj
- $(_this).html(temp);
-
- pasteFromWord = false;
-}
-
-// doda novo vrednost (mv = missing value)
-/*function inline_vrednost_new (spremenljivka, other, tip, mv) {
-
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_new', {spremenljivka: spremenljivka, other: other, anketa: srv_meta_anketa_id, mv:mv}, function (data) {
-
- if ( $('#vprasanje_preview').is(':visible') ) {
- $('#vprasanje_preview').html(data);
- } else {
- $('#branching_'+spremenljivka+'').html(data);
- }
- $('#spremenljivka_content_'+spremenljivka+' div.variable_holder div').last().click();
- //$('#vprasanje_edit').attr({scrollTop: $('#vprasanje_edit').height()});
- //if(tip == 17) edit_ranking_moznosti();
-
- });
-
-}*/
/**
* nastavi editor na contenteditable element za naslov
*/
function inline_load_editor (_this) {
+
$(_this).css('display', 'none');
var el = $(_this).parent().find('div[contenteditable].naslov_inline');
+
if (el.attr('contenteditable') == 'true') {
var spr_id = el.attr('spr_id');
@@ -911,38 +943,28 @@ function inline_load_editor (_this) {
var def_pogoj = 'default="'+def_text+'"';
el.replaceWith('<textarea name="naslov_'+spr_id+'" id="naslov_'+spr_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor(\''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
+ '<div class="button_holder editor_button_holder"><button class="small blue" onclick="inline_save_editor(\''+spr_id+'\'); return false;">'+lang['save']+'</button></div>');
editor_display(spr_id);
}
-
}
function inline_load_editor_hotspot (_this, vre_id) {
- //console.log(_this);
+
$(_this).css('display', 'none');
- //var el = $(_this).parent().find('div[contenteditable].naslov_inline');
-
-// echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline_hotspot " contenteditable="false" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_hot_spot_image'])!==false || strpos($row1['naslov'], $lang1['srv_hot_spot_image'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
-
+
var el = $(_this).parent().find('.vrednost_inline_hotspot');
- //if (el.attr('contenteditable') == 'true') {
- var spr_id = el.attr('spr_id');
- var def_text = el.attr('default');
- var def_pogoj = '';
- if(def_text == 1)
- var def_pogoj = 'default="'+def_text+'"';
-
- //el.replaceWith('<textarea name="hotspot_image_'+spr_id+'" id="hotspot_image_'+spr_id+'" style="width:99%">'+el.html()+'</textarea>'+
- //'<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor_hotspot(\''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
-
- el.replaceWith('<textarea name="hotspot_image_'+vre_id+'" id="hotspot_image_'+vre_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor_hotspot(\''+vre_id+'\', \''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
-
- editor_display_hotspot(vre_id);
- //}
- //console.log("HotSpot editor");
+ var spr_id = el.attr('spr_id');
+ var def_text = el.attr('default');
+ var def_pogoj = '';
+ if(def_text == 1)
+ var def_pogoj = 'default="'+def_text+'"';
+
+ el.replaceWith('<textarea name="hotspot_image_'+vre_id+'" id="hotspot_image_'+vre_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
+ '<div class="button_holder editor_button_holder"><button class="medium blue" onclick="inline_save_editor_hotspot(\''+vre_id+'\', \''+spr_id+'\'); return false;">'+lang['save']+'</button></div>');
+
+ editor_display_hotspot(vre_id);
}
function inline_save_editor_hotspot(vre_id, spr_id, postsave) {
@@ -953,7 +975,7 @@ function inline_save_editor_hotspot(vre_id, spr_id, postsave) {
var parent = el.parent();
el.replaceWith('<div id="vre_id_'+vre_id+'" vre_id="'+vre_id+'" class="vrednost_inline_hotspot " contenteditable="false" spr_id="'+spr_id+'" tabindex="1">'+el.val()+'</div>');
- parent.find('span.buttonwrapper').remove();
+ parent.find('div.button_holder').remove();
if ( postsave != false )
inline_hotspot(spr_id, parent.find('div.vrednost_inline_hotspot'));
@@ -972,12 +994,13 @@ function inline_save_editor(spr_id, postsave) {
var parent = el.parent();
el.replaceWith('<div class="naslov naslov_inline" contenteditable="true" spr_id="'+spr_id+'" tabindex="1">'+el.val()+'</div>');
- parent.find('span.buttonwrapper').remove();
+ parent.find('div.button_holder').remove();
if ( postsave != false )
inline_naslov(spr_id, parent.find('div.naslov_inline'));
$('#spremenljivka_content_'+spr_id+' span.display_editor').css('display', 'inline-block');
+ $('#spremenljivka_content_'+spr_id+' div.missing_dropdown_link').css('display', 'inline-block');
}
/**
@@ -1026,37 +1049,25 @@ function enterKeyPressHandler(evt) {
function inline_minmaxlabel (spremenljivka, _this, tiplabele) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
- //$.post('ajax.php?t=vprasanjeinline&a=inline_grid_naslov_save', {spremenljivka: spremenljivka, grid: $(_this).attr('grd_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, label: $(_this).html()});
$.post('ajax.php?t=vprasanjeinline&a=inline_label_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
- //vprasanje_save(true, spremenljivka);
- //vprasanje_save(true);
}
// shrani labele podrocij @ sliders
function inline_labele_podrocij(spremenljivka, _this, tiplabele){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
$.post('ajax.php?t=vprasanjeinline&a=inline_labele_podrocij_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
}
// shrani in posodobi custom opisne labele @ sliders
function inline_opisne_labele(spremenljivka, _this, tiplabele){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
$.post('ajax.php?t=vprasanjeinline&a=inline_opisne_labele_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
}
@@ -1065,12 +1076,7 @@ function inline_opisne_labele(spremenljivka, _this, tiplabele){
function inline_variabla_vsota (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
$.post('ajax.php?t=vprasanjeinline&a=inline_variabla_vsota_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, inline_variabla_vsota: $(_this).html()});
}
@@ -1108,9 +1114,7 @@ function inline_hotspot_delete_region(spr_id, region_index, vre_id){
});
//update variable in vrstni_red v srv_hotspot_regions
- //$.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_update_region', {spr_id: spr_id, vre_id: vre_id});
$.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_update_region', {spr_id: spr_id});
-
}
//funkcija za preurejanje obstojecega obmocja
@@ -1121,13 +1125,9 @@ function inline_hotspot_edit_region(spr_id, region_index, vre_id){
// shrani nadnaslove @ uporaba traku
function trak_inline_nadnaslov(spremenljivka, _this, tiplabele, grid){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
- //$.post('ajax.php?t=vprasanjeinline&a=inline_labele_podrocij_save', {anketa: srv_meta_anketa_id, grid: grid, spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
$.post('ajax.php?t=vprasanjeinline&a=inline_nadnaslov_save', {anketa: srv_meta_anketa_id, grid: grid, spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
-} \ No newline at end of file
+}
diff --git a/admin/survey/script/zankaProfiles.js b/admin/survey/script/zankaProfiles.js
index 43c0cc5..ff251a3 100644
--- a/admin/survey/script/zankaProfiles.js
+++ b/admin/survey/script/zankaProfiles.js
@@ -15,6 +15,7 @@ function changeViewZankaProfile(pid){
// funkcije ki skrbijo za profil zank
function zankaProfileAction(action) {
+
if (action == 'showProfiles') {
$('#fade').fadeTo('slow', 1);
// poiščemo center strani
@@ -26,19 +27,23 @@ function zankaProfileAction(action) {
var top = height / 2 - (msg.height() / 2);
}).show(200).draggable( { delay : 100, cancel : '#fs_list, input, .buttonwrapper, .select' });
- } else if (action == 'cancle') {
+ }
+ else if (action == 'cancle') {
$("#div_zanka_profiles").hide(200);
$('#fade').fadeOut('slow');
$("#div_zanka_profiles").html('');
return reloadData();
- } else if (action == 'newName') { // dodelimo novo ime profilu
+ }
+ else if (action == 'newName') { // dodelimo novo ime profilu
$("#zankaProfileCoverDiv").show();
$("#newProfileDiv").show();
- } else if (action == 'newCancle') { // preklicemo nov profil
+ }
+ else if (action == 'newCancle') { // preklicemo nov profil
$("#zankaProfileCoverDiv").hide();
$("#newProfileDiv").hide();
- } else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
var profileName = $("#newProfileName").val();
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -46,13 +51,16 @@ function zankaProfileAction(action) {
$.post('ajax.php?t=zankaProfile&a=createProfile', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, profileName:profileName, data:data, mnozenje:mnozenje }, function(newId) {
zankaProfileAction('showProfiles');
});
- } else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
+ }
+ else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
$("#zankaProfileCoverDiv").show();
$("#deleteProfileDiv").show();
- } else if (action == 'deleteCancle') { // preklicemo brisanje
+ }
+ else if (action == 'deleteCancle') { // preklicemo brisanje
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'deleteConfirm') { // izbrisemo profil
+ }
+ else if (action == 'deleteConfirm') { // izbrisemo profil
var pid = $("#zanka_profile .active").attr('value');
$.post('ajax.php?t=zankaProfile&a=delete_profile', { anketa : srv_meta_anketa_id, pid : pid }, function() {
$("#div_zanka_profiles").load(
@@ -64,13 +72,16 @@ function zankaProfileAction(action) {
});
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameAsk') { // vprašamo za preimenovanje
+ }
+ else if (action == 'renameAsk') { // vprašamo za preimenovanje
$("#renameProfileDiv").show();
$("#zankaProfileCoverDiv").fadeIn();
- } else if (action == 'renameCancle') { // preklicemo preimenovanje
+ }
+ else if (action == 'renameCancle') { // preklicemo preimenovanje
$("#renameProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameConfirm') { // preimenujemo profil
+ }
+ else if (action == 'renameConfirm') { // preimenujemo profil
var pid = $("#zanka_profile .active").attr('value');
var name = $("#renameProfileName").val();
@@ -84,7 +95,8 @@ function zankaProfileAction(action) {
$("#zankaProfileCoverDiv").fadeOut();
});
});
- } else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
var pid = $("#zanka_profile .active").attr('value');
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -92,24 +104,21 @@ function zankaProfileAction(action) {
// ce imamo mnozjenje pustimo max 2 variabli
if ( mnozenje * $("#fs_list_4 li").length > 2) {
- alert(lang['srv_loop_multiplication_error']);
+ genericAlertPopup('srv_loop_multiplication_error');
} else {
$.post('ajax.php?t=zankaProfile&a=run', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, data:data, mnozenje:mnozenje, run:action, pid:pid }, function() {
-// window.location.reload();
-// return '';
return reloadData('zanka');
});
}
- } else if (action == 'change') {
+ }
+ else if (action == 'change') {
$("#loading").show();
var pid = $("#current_zanka_profile").val();
$.post('ajax.php?t=zankaProfile&a=change_profile', { anketa : srv_meta_anketa_id, pid : pid}, function() {
-// window.location.reload();
-// return '';
return reloadData();
});
} else {
- alert('Missing action:'+action)
+ genericAlertPopup('alert_missing_action',action)
};
-} \ No newline at end of file
+}
diff --git a/admin/survey/script/zoom.js b/admin/survey/script/zoom.js
index d43700d..debc254 100644
--- a/admin/survey/script/zoom.js
+++ b/admin/survey/script/zoom.js
@@ -85,7 +85,7 @@ function zoomProfileAction(action) {
//$("#zoom_cover_div").show();
$("#zoom_div div#newProfileDiv").show();
} else {
- alert('Najprej izberite variable');
+ genericAlertPopup('alert_choose_variables');
}
} else if (action == 'newCancel'){
@@ -110,10 +110,10 @@ function zoomProfileAction(action) {
// dropdownu dodamo nov prodil in ga izberemo
//$("#current_condition_profile").append( $("<option></option>").attr("value", newId).attr( "selected", true).text(name));
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
//$("#zoom_cover_div").hide();
@@ -130,7 +130,7 @@ function zoomProfileAction(action) {
$("#zoom_div div#deleteProfileDiv").hide();
//$("#zoom_cover_div").fadeOut();
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
}
}
@@ -156,25 +156,14 @@ function toggleAllZoom(what) {
$.post('ajax.php?t=zoom&a=togleExtended', { anketa : srv_meta_anketa_id, what:what}, function() {
if (what == 0) {
- $("#div_zoom_condition ul").parent().show();
- $("#div_zoom_condition #zoomSpritesMinus").show();
- $("#div_zoom_condition #zoomSpritesPlus").hide();
+ $("#div_zoom_condition ul").parent().removeClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesMinus").removeClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesPlus").addClass('displayNone');
} else {
- $("#div_zoom_condition ul").parent().hide();
- $("#div_zoom_condition #zoomSpritesMinus").hide();
- $("#div_zoom_condition #zoomSpritesPlus").show();
+ $("#div_zoom_condition ul").parent().addClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesMinus").addClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesPlus").removeClass('displayNone');
}
- /*
- if (what == 0) {
- $("#div_zoom_condition ul li div:nth-child(2)").show();
- $("#div_zoom_condition #zoomSpritesMinus").show();
- $("#div_zoom_condition #zoomSpritesPlus").hide();
- } else {
- $("#div_zoom_condition ul li div:nth-child(2)").hide();
- $("#div_zoom_condition #zoomSpritesMinus").hide();
- $("#div_zoom_condition #zoomSpritesPlus").show();
- }
- */
});
}