Last active
July 29, 2019 15:39
-
-
Save cmfcmf/7154536 to your computer and use it in GitHub Desktop.
Creating and developing own tumblr themes has always been a pitty. However, this single line of javascript will help you A LOT. Follow the instuctions in the first comment below to get your own live version of your theme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function() { | |
jQuery.ajax('YOUR-URL-TO-THE-THEME-FILE', {cache: false}).success(function(html) { | |
var btn = jQuery("div[data-action='update_preview']").first(); | |
if (html!=ace.edit('editor').getValue()) { | |
ace.edit('editor').setValue(html); | |
if (!btn.hasClass('disabled')) | |
btn.click() | |
} | |
}); | |
},1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function(){jQuery.ajax('YOUR-URL-TO-THE-THEME-FILE',{cache:false}).success(function(html){var btn=jQuery("div[data-action='update_preview']").first();if(html!=ace.edit('editor').getValue()){ace.edit('editor').setValue(html);if(!btn.hasClass('disabled'))btn.click()}});},1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In chrome, you can allow mixed content by clicking on the shield in the right side of the address bar and selecting "allow insecure scripts to run"
Hope this helps!