Preview a Visualforce page in ASIDE.IO

Preview a Visualforce page in ASIDE.IO by clicking the 'Preview' button at the bottom of the page.

  1. // ==UserScript==
  2. // @name Preview a Visualforce page in ASIDE.IO
  3. // @version 1.0.2
  4. // @description Preview a Visualforce page in ASIDE.IO by clicking the 'Preview' button at the bottom of the page.
  5. // @author Shruti Sridharan
  6. // @match https://www.aside.io/*
  7. // @grant https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js
  8. // @namespace https://greasyfork.org/users/56475
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. jQuery( document ).ready(
  15. function() {
  16. jQuery( ".cf-section" ).first().append(
  17. jQuery( "<span/>" )
  18. .attr( "class", "button gen-btn keep-left thin-btn unselectable" )
  19. .attr( "style", "display: inline" )
  20. .attr( "title", "Click here to get a preview of the page." )
  21. .html( "Preview" )
  22. .click(
  23. function() {
  24. var fileName = currentFile;
  25. if( fileName.indexOf( ".page" ) !== -1 ) {
  26. var replaceFileName = fileName.replace( ".page", '' ).toLowerCase();
  27. var link = d3vUtil.getFrontdoorURL();
  28. var replacedLink = link.replace( undefined, "/apex/" + replaceFileName );
  29. window.open( replacedLink, "_blank" );
  30. }
  31. }
  32. )
  33. );
  34. }
  35. );
  36. })();