Expand/Collapse nodes in ASIDE.IO

Perform Code Folding in ASIDE.IO (A cloud based Salesforce IDE)

  1. // ==UserScript==
  2. // @name Expand/Collapse nodes in ASIDE.IO
  3. // @version 1.0
  4. // @description Perform Code Folding in ASIDE.IO (A cloud based Salesforce IDE)
  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. jQuery( document ).ready(
  14. function() {
  15. jQuery( "#sub-controls").prepend(
  16. jQuery( "<div/>" )
  17. .attr( "class", "sub-button" )
  18. .html( "- collapse" )
  19. .click(
  20. function() {
  21. unsafeWindow.editor.getSession().foldAll();
  22. }
  23. )
  24. );
  25. jQuery( "#sub-controls").prepend(
  26. jQuery( "<div/>" )
  27. .attr( "class", "sub-button" )
  28. .html( "+ expand" )
  29. .click(
  30. function() {
  31. unsafeWindow.editor.getSession().unfold();
  32. }
  33. )
  34. );
  35. }
  36. );
  37. })();