Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Auto View Dashboard Smarrtis
- // @namespace eurogarden
- // @description Autologin and click the view dashboard button Smarrtis
- // @include https://smarrtis.savaco.com/vsaPres/Web20/core/KHome.aspx*
- // @version 1
- // @grant none
- // @author Jonas Willaeys
- // @require http://code.jquery.com/jquery-3.2.1.min.js
- // ==/UserScript==
- $(document).ready(function(){
- console.log("Starting view dashboard script...");
- setTimeout(function(){
- console.log("Opening dashboard..");
- //OpenDashboard(1002,371,1928,1350,701,'view');
- //window.open(","_self","toolbar=no,scrollbars=no,resizeable=yes,top=10,left=100,width=960,height=400");
- var dashId = 1002;
- var width = 1200;
- var height = 600;
- var top = 10;
- var left = 80;
- var mode = 'view';
- //var winName = "myDashboard_" + dashId;
- var winName = "_self";
- var url = "https://smarrtis.savaco.com/Dashboard/DashboardView.aspx?id=" + dashId + "&mode=" + mode;
- var winVars = "dependent,toolbar=no,scrollbars=auto,resizable=yes,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
- dashWin = window.open(url, winName, winVars);
- if (!dashWin) alert('Error loading dashboard!');
- else dashWin.focus();
- window.resizeTo(1200,600);
- window.moveTo(10,80);
- //dashWin.resizeTo(1200,600);
- //dashWin.moveTo(10,80);
- //close the current window
- //setTimeout(function(){var ww = window.open(window.location, '_self'); ww.close();},1000);
- //https://smarrtis.savaco.com/vsaPres/Web20/core/DashboardView.aspx?id=1002&mode=view
- //https://smarrtis.savaco.com/Dashboard/DashboardView.aspx?id=1002&mode=view
- }
- ,10000);
- });
- /*
- if($("#viewDash").length){
- setTimeout(function(){
- $("#viewDash").click();
- console.log("Clicking the dashView button...");
- }
- ,2000);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement