cronapp-framework-js 3.0.0-SP.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/components/crn-dynamic-file.components.json +65 -34
  2. package/components/crn-dynamic-menu.components.json +0 -21
  3. package/components/crn-enterprise-combobox-multiple.components.json +6 -0
  4. package/components/crn-navbar.components.json +26 -1
  5. package/components/crn-start.components.json +3 -0
  6. package/components/cron-breadcrumbs.components.json +7 -3
  7. package/components/templates/Component_Container/crn-eight-four-container.template.html +2 -2
  8. package/components/templates/Component_Container/crn-four-eight-container.template.html +2 -2
  9. package/components/templates/Component_Container/crn-one-container.template.html +1 -1
  10. package/components/templates/Component_Container/crn-three-container.template.html +3 -3
  11. package/components/templates/Component_Container/crn-three-six-three-container.template.html +3 -3
  12. package/components/templates/Component_Container/crn-two-container.template.html +2 -2
  13. package/components/templates/cron-autocomplete.designtime.html +2 -2
  14. package/components/templates/cron-combobox-multiple.template.html +1 -1
  15. package/components/templates/cron-grid.designtime.html +5 -4
  16. package/components/templates/dynamicfile.designtime.html +5 -0
  17. package/components/templates/dynamicfile.template.html +20 -3
  18. package/css/app.css +5 -0
  19. package/css/fonts/nunito/nunito.css +270 -0
  20. package/css/themes/custom/aquamarine/custom-aquamarine.css +24 -10
  21. package/css/themes/custom/cerulean/custom-cerulean.css +1 -0
  22. package/css/themes/custom/cosmo/custom-cosmo.css +16 -16
  23. package/css/themes/custom/cosmo/panel-cosmo.css +1 -1
  24. package/css/themes/custom/cyborg/button-cyborg.css +67 -3
  25. package/css/themes/custom/cyborg/custom-cyborg.css +250 -69
  26. package/css/themes/custom/cyborg/navbar-cyborg.css +4 -4
  27. package/css/themes/custom/cyborg/panel-cyborg.css +6 -7
  28. package/css/themes/custom/darkly/custom-darkly.css +1 -8
  29. package/css/themes/custom/dsgov/button-dsgov.css +0 -1
  30. package/css/themes/custom/dsgov/custom-dsgov.css +12 -1
  31. package/css/themes/custom/dsgov/table-grid-dsgov.css +14 -9
  32. package/css/themes/custom/flatly/custom-flatly.css +1 -0
  33. package/css/themes/custom/fuse/custom-fuse.css +15 -19
  34. package/css/themes/custom/journal/custom-journal.css +1 -0
  35. package/css/themes/custom/krypton/custom-krypton.css +991 -236
  36. package/css/themes/custom/krypton/grid-krypton.css +253 -66
  37. package/css/themes/custom/krypton/navbar-krypton.css +13 -12
  38. package/css/themes/custom/krypton/panel-krypton.css +29 -26
  39. package/css/themes/custom/lumen/button-lumen.css +8 -8
  40. package/css/themes/custom/lumen/custom-lumen.css +46 -34
  41. package/css/themes/custom/lumen/navbar-lumen.css +1 -1
  42. package/css/themes/custom/lumen/panel-lumen.css +17 -13
  43. package/css/themes/custom/material/custom-material.css +12 -1
  44. package/css/themes/custom/material/grid-material.css +1 -1
  45. package/css/themes/custom/material/navbar-material.css +13 -0
  46. package/css/themes/custom/material-round/custom-material-round.css +187 -34
  47. package/css/themes/custom/material-round/grid-material-round.css +174 -18
  48. package/css/themes/custom/materialui/custom-materialui.css +1 -0
  49. package/css/themes/custom/nature/custom-nature.css +2131 -0
  50. package/css/themes/custom/nature/grid-nature.css +396 -0
  51. package/css/themes/custom/nature/navbar-nature.css +98 -0
  52. package/css/themes/custom/nature/panel-nature.css +72 -0
  53. package/css/themes/custom/navigator/custom-navigator.css +80 -21
  54. package/css/themes/custom/paper/custom-paper.css +284 -27
  55. package/css/themes/custom/readable/button-readable.css +61 -1
  56. package/css/themes/custom/readable/custom-readable.css +242 -26
  57. package/css/themes/custom/readable/navbar-readable.css +1 -2
  58. package/css/themes/custom/readable/panel-readable.css +6 -8
  59. package/css/themes/custom/sandstone/button-sandstone.css +12 -0
  60. package/css/themes/custom/sandstone/custom-sandstone.css +1 -0
  61. package/css/themes/custom/simplex/custom-simplex.css +1 -0
  62. package/css/themes/custom/slate/custom-slate.css +4 -3
  63. package/css/themes/custom/spacelab/custom-spacelab.css +1 -0
  64. package/css/themes/custom/superhero/button-superhero.css +1 -1
  65. package/css/themes/custom/superhero/custom-superhero.css +348 -45
  66. package/css/themes/custom/superhero/navbar-superhero.css +5 -1
  67. package/css/themes/custom/superhero/panel-superhero.css +4 -5
  68. package/css/themes/custom/superhero/tabs-superhero.css +1 -1
  69. package/css/themes/custom/theme-general/button.css +4 -0
  70. package/css/themes/custom/theme-general/menu-vertical-retratil.css +35 -23
  71. package/css/themes/custom/theme-general/menu.css +10 -2
  72. package/css/themes/custom/theme-general/table-grid.css +14 -2
  73. package/css/themes/custom/theme-general/theme-general.css +30 -0
  74. package/css/themes/custom/united/custom-united.css +1 -0
  75. package/css/themes/custom/yeti/custom-yeti.css +1 -0
  76. package/css/themes/nature.min.css +9 -0
  77. package/dist/components/js/format.min.js +1 -1
  78. package/dist/components/js/jquery.inputmask.bundle.js +1 -1
  79. package/dist/components/js/jquery.mask.min.js +1 -1
  80. package/dist/components/templates/Component_Container/crn-eight-four-container.template.html +1 -1
  81. package/dist/components/templates/Component_Container/crn-four-eight-container.template.html +1 -1
  82. package/dist/components/templates/Component_Container/crn-one-container.template.html +1 -1
  83. package/dist/components/templates/Component_Container/crn-three-container.template.html +1 -1
  84. package/dist/components/templates/Component_Container/crn-three-six-three-container.template.html +1 -1
  85. package/dist/components/templates/Component_Container/crn-two-container.template.html +1 -1
  86. package/dist/components/templates/cron-autocomplete.designtime.html +1 -1
  87. package/dist/components/templates/cron-combobox-multiple.template.html +1 -1
  88. package/dist/components/templates/cron-grid.designtime.html +1 -1
  89. package/dist/components/templates/dynamicfile.designtime.html +1 -0
  90. package/dist/components/templates/dynamicfile.template.html +1 -1
  91. package/dist/css/app.css +1 -1
  92. package/dist/css/themes/custom/aquamarine/custom-aquamarine.css +1 -1
  93. package/dist/css/themes/custom/cerulean/custom-cerulean.css +1 -1
  94. package/dist/css/themes/custom/cosmo/custom-cosmo.css +1 -1
  95. package/dist/css/themes/custom/cosmo/panel-cosmo.css +1 -1
  96. package/dist/css/themes/custom/cyborg/button-cyborg.css +1 -1
  97. package/dist/css/themes/custom/cyborg/custom-cyborg.css +1 -1
  98. package/dist/css/themes/custom/cyborg/navbar-cyborg.css +1 -1
  99. package/dist/css/themes/custom/cyborg/panel-cyborg.css +1 -1
  100. package/dist/css/themes/custom/darkly/custom-darkly.css +1 -1
  101. package/dist/css/themes/custom/dsgov/button-dsgov.css +1 -1
  102. package/dist/css/themes/custom/dsgov/custom-dsgov.css +1 -1
  103. package/dist/css/themes/custom/dsgov/table-grid-dsgov.css +1 -1
  104. package/dist/css/themes/custom/flatly/custom-flatly.css +1 -1
  105. package/dist/css/themes/custom/fuse/custom-fuse.css +1 -1
  106. package/dist/css/themes/custom/journal/custom-journal.css +1 -1
  107. package/dist/css/themes/custom/krypton/custom-krypton.css +1 -1
  108. package/dist/css/themes/custom/krypton/grid-krypton.css +1 -1
  109. package/dist/css/themes/custom/krypton/navbar-krypton.css +1 -1
  110. package/dist/css/themes/custom/krypton/panel-krypton.css +1 -1
  111. package/dist/css/themes/custom/lumen/button-lumen.css +1 -1
  112. package/dist/css/themes/custom/lumen/custom-lumen.css +1 -1
  113. package/dist/css/themes/custom/lumen/navbar-lumen.css +1 -1
  114. package/dist/css/themes/custom/lumen/panel-lumen.css +1 -1
  115. package/dist/css/themes/custom/material/custom-material.css +1 -1
  116. package/dist/css/themes/custom/material/grid-material.css +1 -1
  117. package/dist/css/themes/custom/material/navbar-material.css +1 -1
  118. package/dist/css/themes/custom/material-round/custom-material-round.css +1 -1
  119. package/dist/css/themes/custom/material-round/grid-material-round.css +1 -1
  120. package/dist/css/themes/custom/materialui/custom-materialui.css +1 -1
  121. package/dist/css/themes/custom/nature/custom-nature.css +1 -0
  122. package/dist/css/themes/custom/nature/grid-nature.css +1 -0
  123. package/dist/css/themes/custom/nature/navbar-nature.css +1 -0
  124. package/dist/css/themes/custom/nature/panel-nature.css +1 -0
  125. package/dist/css/themes/custom/navigator/custom-navigator.css +1 -1
  126. package/dist/css/themes/custom/paper/custom-paper.css +1 -1
  127. package/dist/css/themes/custom/readable/button-readable.css +1 -1
  128. package/dist/css/themes/custom/readable/custom-readable.css +1 -1
  129. package/dist/css/themes/custom/readable/navbar-readable.css +1 -1
  130. package/dist/css/themes/custom/readable/panel-readable.css +1 -1
  131. package/dist/css/themes/custom/sandstone/button-sandstone.css +1 -1
  132. package/dist/css/themes/custom/sandstone/custom-sandstone.css +1 -1
  133. package/dist/css/themes/custom/simplex/custom-simplex.css +1 -1
  134. package/dist/css/themes/custom/slate/custom-slate.css +1 -1
  135. package/dist/css/themes/custom/spacelab/custom-spacelab.css +1 -1
  136. package/dist/css/themes/custom/superhero/button-superhero.css +1 -1
  137. package/dist/css/themes/custom/superhero/custom-superhero.css +1 -1
  138. package/dist/css/themes/custom/superhero/navbar-superhero.css +1 -1
  139. package/dist/css/themes/custom/superhero/panel-superhero.css +1 -1
  140. package/dist/css/themes/custom/superhero/tabs-superhero.css +1 -1
  141. package/dist/css/themes/custom/theme-general/button.css +1 -1
  142. package/dist/css/themes/custom/theme-general/menu-vertical-retratil.css +1 -1
  143. package/dist/css/themes/custom/theme-general/menu.css +1 -1
  144. package/dist/css/themes/custom/theme-general/table-grid.css +1 -1
  145. package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
  146. package/dist/css/themes/custom/united/custom-united.css +1 -1
  147. package/dist/css/themes/custom/yeti/custom-yeti.css +1 -1
  148. package/dist/css/themes/nature.min.css +1 -0
  149. package/dist/js/app.js +1 -1
  150. package/dist/js/controllers.js +1 -1
  151. package/dist/js/directives.js +17 -12
  152. package/dist/js/reports/reports.service.js +1 -1
  153. package/dist/js/upload.service.js +1 -1
  154. package/js/app.js +5 -4
  155. package/js/controllers.js +43 -25
  156. package/js/directives.js +368 -77
  157. package/js/reports/reports.service.js +5 -5
  158. package/js/upload.service.js +7 -4
  159. package/package.json +1 -1
  160. package/postupdate.json +6 -0
@@ -1 +1 @@
1
- (function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){function g(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)}function h(a){window.open(a,"_blank")}var i=$("body"),j=angular.element(i.get(0)).scope(),k=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.css","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],l=[];this.getReport=function(b){var c={url:"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){if(a&&g())return void h(a);var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var k=$("#reportViewContext");k.get(0)||(i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),k=$("#reportViewContext"));var l=parseInt($(window).height()),m=l-200+"px",n="StiViewer"+app.common.generateId(),o=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,o.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(o)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(o.dictionary.dataSources,d.datasources);var p=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=m);var b=new Stimulsoft.Viewer.StiViewer(a,n,!1);return b.report=o,Stimulsoft.Viewer.StiJsViewer.prototype.IsTouchDevice()&&(b.options.appearance.interfaceType=Stimulsoft.Viewer.StiInterfaceType.Touch),b};if(e&&e.$element)p(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+n);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+n),clearInterval(f))},100)}function d(c){if(c&&g())return void h(c);var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(k),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?p(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+m+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var q=new Stimulsoft.Report.Export.StiPdfExportSettings,r=new Stimulsoft.Report.Export.StiPdfExportService,s=new Stimulsoft.System.IO.MemoryStream;o.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):r.exportToAsync(function(){var a=s.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},o,s,q)},!1)}}$(`#${n}`).find("img").attr("alt",""),$(`#${n}`).find("input").attr("aria-label",n)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b))if(d(b[c])){var e=Object.keys(b[c])[0];if(a==e)return Object.values(b[c])[0]}};let d=a=>{let b={}.constructor;return a&&b===a.constructor};for(var e in Object.keys(a)){var f=a[e].name,g=a[e].value,h=c(f,b);h?a[e].value=h:Array.isArray(b)&&!d(b[e])&&(a[e].value=b[e])}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){var b=!1;for(var c in Object.keys(a))if(!a[c].value)return!0;return!1},this.getDatasourcesInBandDashBoard=function(a){var b={hasParam:!1,datasources:[]},c=Stimulsoft.Report.StiReport.createNewDashboard();return c.load(a),c.pages&&c.pages.list&&0<c.pages.list.length&&c.pages.toList().forEach(function(a){a.components.toList().forEach(function(a){var c=a.getDataSources()||[];c.forEach(function(a){var c=stimulsoftHelper.getParamsFromFilter(a),d=stimulsoftHelper.getQueryName(a);b.datasources.push({name:a.name,customId:d,fieldParams:c,queryParams:[]}),c.length&&(b.hasParam=!0)})})}),b},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=k.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4;let e=setInterval(()=>Pace.restart(),2500);k.forEach(function(f,g){this.loadScript(f,function(f){d++,f||(b=!1),d==c&&(clearInterval(e),Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,l))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){l.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,l.push(a),b&&b(!0))}:d.onload=function(){l.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){if(a&&a.data){var e=a.data.reportName.endsWith(".report"),f=a.data.reportName.endsWith(".dashboard");e||f?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var g=this.getDatasourcesInBand(e.data);f&&(g=this.getDatasourcesInBandDashBoard(e.data)),this.getDataSourcesParams(g).then(function(f){g=f.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(g.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=g,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this))):j.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this)))}}.bind(this))}}])})(app);
1
+ (function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){function g(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)}function h(a){window.open(a,"_blank")}var i=$("body"),j=angular.element(i.get(0)).scope(),k=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.css","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],l=[];this.getReport=function(b){var c={url:window.hostApp+"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:window.hostApp+"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:window.hostApp+"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:window.hostApp+"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:window.hostApp+"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){if(a&&g())return void h(a);var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var k=$("#reportViewContext");k.get(0)||(i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),k=$("#reportViewContext"));var l=parseInt($(window).height()),m=l-200+"px",n="StiViewer"+app.common.generateId(),o=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,o.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(o)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(o.dictionary.dataSources,d.datasources);var p=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=m);var b=new Stimulsoft.Viewer.StiViewer(a,n,!1);return b.report=o,Stimulsoft.Viewer.StiJsViewer.prototype.IsTouchDevice()&&(b.options.appearance.interfaceType=Stimulsoft.Viewer.StiInterfaceType.Touch),b};if(e&&e.$element)p(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+n);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+n),clearInterval(f))},100)}function d(c){if(c&&g())return void h(c);var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(k),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?p(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+m+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var q=new Stimulsoft.Report.Export.StiPdfExportSettings,r=new Stimulsoft.Report.Export.StiPdfExportService,s=new Stimulsoft.System.IO.MemoryStream;o.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):r.exportToAsync(function(){var a=s.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},o,s,q)},!1)}}$(`#${n}`).find("img").attr("alt",""),$(`#${n}`).find("input").attr("aria-label",n)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b))if(d(b[c])){var e=Object.keys(b[c])[0];if(a==e)return Object.values(b[c])[0]}};let d=a=>{let b={}.constructor;return a&&b===a.constructor};for(var e in Object.keys(a)){var f=a[e].name,g=a[e].value,h=c(f,b);h?a[e].value=h:Array.isArray(b)&&!d(b[e])&&(a[e].value=b[e])}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){var b=!1;for(var c in Object.keys(a))if(!a[c].value)return!0;return!1},this.getDatasourcesInBandDashBoard=function(a){var b={hasParam:!1,datasources:[]},c=Stimulsoft.Report.StiReport.createNewDashboard();return c.load(a),c.pages&&c.pages.list&&0<c.pages.list.length&&c.pages.toList().forEach(function(a){a.components.toList().forEach(function(a){var c=a.getDataSources()||[];c.forEach(function(a){var c=stimulsoftHelper.getParamsFromFilter(a),d=stimulsoftHelper.getQueryName(a);b.datasources.push({name:a.name,customId:d,fieldParams:c,queryParams:[]}),c.length&&(b.hasParam=!0)})})}),b},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=k.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4;let e=setInterval(()=>Pace.restart(),2500);k.forEach(function(f,g){this.loadScript(f,function(f){d++,f||(b=!1),d==c&&(clearInterval(e),Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,l))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){l.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,l.push(a),b&&b(!0))}:d.onload=function(){l.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){if(a&&a.data){var e=a.data.reportName.endsWith(".report"),f=a.data.reportName.endsWith(".dashboard");e||f?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var g=this.getDatasourcesInBand(e.data);f&&(g=this.getDatasourcesInBandDashBoard(e.data)),this.getDataSourcesParams(g).then(function(f){g=f.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(g.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=g,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this))):j.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this)))}}.bind(this))}}])})(app);
@@ -1 +1 @@
1
- (function(){function a(a){var b=[].slice.call(arguments,1),c=0;return a.replace(/%s/g,function(){return b[c++]})}angular.module("upload.services",[]).service("UploadService",["$http","$compile","$modal","Upload",function(a,b,c){var d=$("body"),e=angular.element(d.get(0)).scope();this.ensureProps=a=>(a.filter&&(a.filter=a.filter.replace(/\s/g,"")),a),this.upload=function(a){let b=this.ensureProps(a);c.open({templateUrl:"node_modules/cronapp-framework-js/components/upload/upload.html",controller:"UploadController",resolve:{data:function(){return b}}})}.bind(this)}]),angular.module("custom.controllers").controller("UploadController",["$scope","$http","$translate","$stateParams","$location","$http","$modalInstance","data",function(b,c,d,e,f,c,g,h){app.registerEventsCronapi(b,d),b.params=e,b.$http=c;var i=f.search();for(var j in i)i.hasOwnProperty(j)&&(b.params[j]=i[j]);b.files=[],b.uploading=!1,b.uploaded=!0,b.progress=0,b.data=h,b.message=d.instant("Upload.oneFile"),"true"==h.multiple&&(b.message=d.instant("Upload.multipleFile")),h.description&&(b.message=h.description),b.safeApply=safeApply,b.uploadFile=function(e){var f=b.data.scope,g="api/cronapi/upload/"+h.id,j=new FormData;if(0==e.length)this.Notification.error(a(d.instant("Upload.errorValidation"),h.maxSize,h.filter));else{for(var k=0;k<e.length;k++)j.append("file",e[k]),console.log(e[k].$valid);var l=JSON.parse(localStorage.getItem("_u"));this.$promise=c({method:"POST",url:(window.hostApp||"")+g,data:j,headers:{"Content-Type":void 0,"X-AUTH-TOKEN":l?l.token:""},onProgress:function(a){this.safeApply(function(){if(a.lengthComputable){var c=0|100*(a.loaded/a.total);b.progress=c}b.uploading=!0,console.log(c)})}.bind(this)}).then(function(a){f.cronapi.evalInContext(JSON.stringify(a)).then(()=>{b.uploaded=!0,b.uploading=!1,b.close()})}.bind(this)).catch(function(a){let c=a.error;a&&a.data&&(c=a.data.error),this.Notification.error(c),b.uploading=!1,b.close()}.bind(this))}}.bind(b),b.close=function(){g.dismiss("cancel")}}])})(app);
1
+ (function(){function a(a){var b=[].slice.call(arguments,1),c=0;return a.replace(/%s/g,function(){return b[c++]})}angular.module("upload.services",[]).service("UploadService",["$http","$compile","$modal","Upload",function(a,b,c){var d=$("body"),e=angular.element(d.get(0)).scope();this.ensureProps=a=>(a.filter&&(a.filter=a.filter.replace(/\s/g,"")),a),this.upload=function(a){let b=this.ensureProps(a);c.open({templateUrl:"node_modules/cronapp-framework-js/components/upload/upload.html",controller:"UploadController",resolve:{data:function(){return b}}})}.bind(this)}]),angular.module("custom.controllers").controller("UploadController",["$scope","$http","$translate","$stateParams","$location","$http","$modalInstance","data",function(b,c,d,e,f,c,g,h){app.registerEventsCronapi(b,d),b.params=e,b.$http=c;var i=f.search();for(var j in i)i.hasOwnProperty(j)&&(b.params[j]=i[j]);b.files=[],b.uploading=!1,b.uploaded=!0,b.progress=0,b.data=h,b.message=d.instant("Upload.oneFile"),"true"==h.multiple&&(b.message=d.instant("Upload.multipleFile")),h.description&&(b.message=h.description),b.safeApply=safeApply,b.uploadFile=function(e){var f=b.data.scope,g="api/cronapi/upload/"+h.id,j=new FormData;if(0==e.length)this.Notification.error(a(d.instant("Upload.errorValidation"),h.maxSize,h.filter));else{for(var k=0;k<e.length;k++)j.append("file",e[k]),console.log(e[k].$valid);var l=JSON.parse(localStorage.getItem("_u"));let a=window.isUsingCookie()?{"Content-Type":void 0}:{"Content-Type":void 0,"X-AUTH-TOKEN":l?l.token:""};this.$promise=c({method:"POST",url:(window.hostApp||"")+g,data:j,headers:a,onProgress:function(a){this.safeApply(function(){if(a.lengthComputable){var c=0|100*(a.loaded/a.total);b.progress=c}b.uploading=!0,console.log(c)})}.bind(this)}).then(function(a){f.cronapi.evalInContext(JSON.stringify(a)).then(()=>{b.uploaded=!0,b.uploading=!1,b.close()})}.bind(this)).catch(function(a){let c=a.error;a&&a.data&&(c=a.data.error),this.Notification.error(c),b.uploading=!1,b.close()}.bind(this))}}.bind(b),b.close=function(){g.dismiss("cancel")}}])})(app);
package/js/app.js CHANGED
@@ -71,10 +71,11 @@ var app = (function() {
71
71
  function($q, $rootScope) {
72
72
  var service = {
73
73
  'request': function(config) {
74
- var _u = JSON.parse(localStorage.getItem('_u'));
75
- if (_u && _u.token) {
76
- config.headers['X-AUTH-TOKEN'] = _u.token;
77
- window.uToken = _u.token;
74
+ if (!window.isUsingCookie()) {
75
+ var _u = JSON.parse(localStorage.getItem('_u'));
76
+ if (_u && _u.token) {
77
+ config.headers['X-AUTH-TOKEN'] = _u.token;
78
+ }
78
79
  }
79
80
  return config;
80
81
  }
package/js/controllers.js CHANGED
@@ -1,3 +1,6 @@
1
+ if (!window.hostApp) {
2
+ window.hostApp = "";
3
+ }
1
4
  (function($app) {
2
5
  angular.module('custom.controllers', []);
3
6
 
@@ -5,9 +8,12 @@
5
8
  var refreshToken = function ($http, success, error) {
6
9
  $http({
7
10
  method: 'GET',
8
- url: 'auth/refresh'
11
+ url: window.hostApp + 'auth/refresh'
9
12
  }).then(function (data, status, headers, config) {
10
13
  data = getRequestData(data);
14
+ if (window.isUsingCookie()) {
15
+ delete data.token;
16
+ }
11
17
  //Keeping the user information, the auth/refresh only has name and username info
12
18
  if (localStorage.getItem("_u")) {
13
19
  let currentSession = JSON.parse(localStorage.getItem("_u"));
@@ -44,14 +50,17 @@
44
50
  return;
45
51
  }
46
52
 
53
+ let headerValues = window.isUsingCookie() ? {
54
+ 'Content-Type': 'application/x-www-form-urlencoded'
55
+ } : {
56
+ 'Content-Type': 'application/x-www-form-urlencoded',
57
+ 'X-AUTH-TOKEN' : $location.search().token
58
+ };
47
59
  $http({
48
60
  method: 'POST',
49
- url: 'auth/confirm-reset-password',
61
+ url: window.hostApp + 'auth/confirm-reset-password',
50
62
  data: $.param({password: passwordNew.value}),
51
- headers: {
52
- 'Content-Type': 'application/x-www-form-urlencoded',
53
- 'X-AUTH-TOKEN': $location.search().token
54
- }
63
+ headers: headerValues
55
64
  }).then(() => {
56
65
  Notification.info($translate.instant('ResetPasswordSuccess'));
57
66
  passwordNew.value = "";
@@ -71,6 +80,8 @@
71
80
 
72
81
  app.registerEventsCronapi($scope, $translate);
73
82
 
83
+ $rootScope.Notification = Notification; // Não remover, usado pelo cronapi.js para notificar erros de auto-cadastro.
84
+
74
85
  $scope.cronapi.screen.changeValueOfField('vars.signupEmail','');
75
86
  $scope.cronapi.screen.changeValueOfField('vars.signupUsername','');
76
87
  $scope.cronapi.screen.changeValueOfField('vars.signupPassword','');
@@ -131,6 +142,9 @@
131
142
  if ($cookies.get('_u')) {
132
143
  if (!localStorage.getItem('_u')) {
133
144
  var decodedUser = decodeURIComponent($cookies.get('_u'));
145
+ if (window.isUsingCookie()) {
146
+ delete decodedUser.token;
147
+ }
134
148
  localStorage.setItem("_u", decodedUser);
135
149
  }
136
150
  $scope.goHome();
@@ -166,13 +180,12 @@
166
180
  'Content-Type' : 'application/x-www-form-urlencoded'
167
181
  };
168
182
 
169
- if (token) {
170
- headerValues["X-AUTH-TOKEN"] = token;
171
- }
183
+ // Necessario para concluir a autenticação via SSO. Neste momento ainda não existe o cookie
184
+ headerValues["X-AUTH-TOKEN"] = token;
172
185
 
173
186
  $http({
174
187
  method : 'POST',
175
- url : 'auth',
188
+ url : window.hostApp + 'auth',
176
189
  data : $.param(user),
177
190
  headers : headerValues
178
191
  }).then(handleSuccess).catch(handleError);
@@ -191,7 +204,7 @@
191
204
 
192
205
  $http({
193
206
  method: 'POST',
194
- url: 'auth/reset-password',
207
+ url: window.hostApp + 'auth/reset-password',
195
208
  data: $.param({email: forgotPasswordEmail.value}),
196
209
  headers: {
197
210
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -209,6 +222,9 @@
209
222
  // The local storage will be cleaned when the browser window is closed
210
223
  if(typeof (Storage) !== "undefined") {
211
224
  // save the user data on localStorage
225
+ if (window.isUsingCookie()) {
226
+ delete data.token;
227
+ }
212
228
  localStorage.setItem("_u", JSON.stringify(data));
213
229
  $rootScope.session = JSON.parse(localStorage._u);
214
230
  }
@@ -232,8 +248,12 @@
232
248
  data = getRequestData(data);
233
249
  let error;
234
250
  if (data !== null && data.message) {
235
- let message = JSON.parse(data.message);
236
- error = message.exception
251
+ if (typeof data.message !== 'string') {
252
+ let message = JSON.parse(data.message);
253
+ error = message.exception;
254
+ } else {
255
+ error = data.message;
256
+ }
237
257
  } else if (typeof data === 'string' && status !== 502) {
238
258
  error = data;
239
259
  if (!error && status === 401) {
@@ -352,15 +372,15 @@
352
372
  $('#themeSytleSheet').attr('href', "node_modules/cronapp-framework-js/css/themes/" + value + ".min.css");
353
373
  }
354
374
  });
355
- if(localStorage.getItem('_u') && JSON.parse(localStorage.getItem('_u')).token){
356
- refreshToken($http,function(){},function(){
375
+ if (localStorage.getItem('_u') && (JSON.parse(localStorage.getItem('_u')).token || window.isUsingCookie())){
376
+ refreshToken($http, function() {},function() {
357
377
  localStorage.removeItem('_u');
358
378
  if (window.location.hash) {
359
379
  $state.go('loginReturnUrl', { "returnUrl" : window.location.hash });
360
380
  } else {
361
381
  $state.go('login');
362
382
  }
363
- })
383
+ });
364
384
  }
365
385
  }
366
386
  else {
@@ -377,7 +397,7 @@
377
397
  $rootScope.logout = function logout() {
378
398
  $http({
379
399
  method : 'GET',
380
- url : 'logout',
400
+ url : window.hostApp + 'logout',
381
401
  headers : {
382
402
  'Content-Type' : 'application/json'
383
403
  }
@@ -390,12 +410,7 @@
390
410
  localStorage.removeItem("_u");
391
411
  }
392
412
 
393
- // In case a logoutUri is defined, after Cronapp logout user is redirected to the logoutUri
394
- if (result && result.logoutUri) {
395
- window.location.href = result.logoutUri;
396
- } else {
397
- window.location.href = "";
398
- }
413
+ $scope.cronapi.util.changeViewLogout();
399
414
  }
400
415
  };
401
416
 
@@ -409,7 +424,7 @@
409
424
 
410
425
  $http({
411
426
  method : 'POST',
412
- url : 'changePassword',
427
+ url : window.hostApp + 'changePassword',
413
428
  data : $.param(user),
414
429
  headers : {
415
430
  'Content-Type' : 'application/x-www-form-urlencoded'
@@ -507,7 +522,7 @@
507
522
 
508
523
  $http({
509
524
  method : 'POST',
510
- url : 'changeTheme',
525
+ url : window.hostApp + 'changeTheme',
511
526
  data : $.param(user),
512
527
  headers : {
513
528
  'Content-Type' : 'application/x-www-form-urlencoded'
@@ -517,6 +532,9 @@
517
532
  function changeSuccess(data, status, headers, config) {
518
533
  $rootScope.session.theme = theme;
519
534
  $rootScope.session.user.theme = theme;
535
+ if (window.isUsingCookie()) {
536
+ delete $rootScope.session.token;
537
+ }
520
538
  localStorage.setItem("_u", JSON.stringify($rootScope.session));
521
539
  }
522
540