Advertisement
Guest User

dashViewSmarrtis

a guest
Jul 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Auto View Dashboard Smarrtis
  3. // @namespace eurogarden
  4. // @description Autologin and click the view dashboard button Smarrtis
  5. // @include https://smarrtis.savaco.com/vsaPres/Web20/core/KHome.aspx*
  6. // @version 1
  7. // @grant none
  8. // @author Jonas Willaeys
  9. // @require http://code.jquery.com/jquery-3.2.1.min.js
  10. // ==/UserScript==
  11.  
  12. $(document).ready(function(){
  13. console.log("Starting view dashboard script...");
  14. setTimeout(function(){
  15. console.log("Opening dashboard..");
  16. //OpenDashboard(1002,371,1928,1350,701,'view');
  17. //window.open(","_self","toolbar=no,scrollbars=no,resizeable=yes,top=10,left=100,width=960,height=400");
  18. var dashId = 1002;
  19. var width = 1200;
  20. var height = 600;
  21. var top = 10;
  22. var left = 80;
  23. var mode = 'view';
  24. //var winName = "myDashboard_" + dashId;
  25. var winName = "_self";
  26. var url = "https://smarrtis.savaco.com/Dashboard/DashboardView.aspx?id=" + dashId + "&mode=" + mode;
  27. var winVars = "dependent,toolbar=no,scrollbars=auto,resizable=yes,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
  28. dashWin = window.open(url, winName, winVars);
  29. if (!dashWin) alert('Error loading dashboard!');
  30. else dashWin.focus();
  31. window.resizeTo(1200,600);
  32. window.moveTo(10,80);
  33. //dashWin.resizeTo(1200,600);
  34. //dashWin.moveTo(10,80);
  35. //close the current window
  36. //setTimeout(function(){var ww = window.open(window.location, '_self'); ww.close();},1000);
  37. //https://smarrtis.savaco.com/vsaPres/Web20/core/DashboardView.aspx?id=1002&mode=view
  38. //https://smarrtis.savaco.com/Dashboard/DashboardView.aspx?id=1002&mode=view
  39. }
  40. ,10000);
  41. });
  42.  
  43.  
  44. /*
  45. if($("#viewDash").length){
  46. setTimeout(function(){
  47. $("#viewDash").click();
  48. console.log("Clicking the dashView button...");
  49. }
  50. ,2000);
  51. }
  52. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement