Advertisement
stucco

Fix jsfiddle window config when draggable bars are gone

Apr 22nd, 2013
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Fix jsfiddle window configuration when the draggable bars are gone.
  2.  
  3. // Somehow there was a spaz-out while dragging the horizontal bar between the html and js windows, and the html window became >100%, with net effect it obscured the menu bar, and more importantly the drag bar was not visible.  Took me a while of poking around, but I finally fixed it.
  4.  
  5. // From chrome JS console:
  6.  
  7. decodeURIComponent(window.document.cookie)   // this is the 'broken' value:
  8.  
  9. "window_sizes={"w":["48.72495446265938%","51.27504553734062%"],"h":["29.33709449929478%","113.11475409836066%","37.19298245614035%","62.80701754385965%"]}; csrftoken=qHTiwV95S7vlt4VBeRQqeebW6LYeHOU9"
  10.  
  11. // Note above:  one of the window heights is 113% !   .. does not add up.
  12. // set it with the below, then close the tab.  If a dialog box pops up, you fail.
  13. // Alternatively, you can visit a jsfiddle.net URL with "/show" at the end which will not have all the other windows and scripts loaded, but will let you access the cookies.
  14. // set the new value, close tab, then open a new tab on jsfiddle.net.
  15.  
  16. // these numbers don't add up either, but after you drag the h/v window adjustment they will be fixed.
  17.  
  18. document.cookie = "window_sizes=" + encodeURIComponent('{"w":["48%","35%"],"h":["29%","58%","37%","62%"]}') + ";path=/;domain=.jsfiddle.net;";
  19.  
  20. // Edit:
  21. // the cookies appear to be session cookies, so it should be sufficient to close your browser.
  22. // Or the tabs, and delete cookies.  But I swear Chrome saved the session cookies cross session...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement