mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge branch 'master' of github.com:neocities/neocities
This commit is contained in:
commit
6925c21d2b
2 changed files with 38 additions and 33 deletions
|
@ -163,8 +163,12 @@
|
|||
|
||||
var editor = {}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$.get("/site_files/download/<%= Addressable::URI.parse(@filename).normalized_path.to_s %>", function(resp) {
|
||||
$.ajax({
|
||||
url: "/site_files/download/<%= Addressable::URI.parse(@filename).normalized_path.to_s %>",
|
||||
cache: false,
|
||||
success: function(resp) {
|
||||
editor = ace.edit("editor")
|
||||
setTheme()
|
||||
<% if @ace_mode %>
|
||||
|
@ -197,8 +201,9 @@
|
|||
saveTextFile(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
if(unsavedChanges == true)
|
||||
|
|
|
@ -47,7 +47,7 @@ class ScreenshotWorker
|
|||
base_image_tmpfile_path = "/tmp/#{SecureRandom.uuid}.png"
|
||||
|
||||
http_resp = HTTP.basic_auth(user: api_user, pass: api_password).get(uri)
|
||||
BlackBox.new(site, path).check_uri(http_resp.headers['X-URL'])
|
||||
BlackBox.new(site, path).check_uri(http_resp.headers['X-URL']) if defined?(BlackBox)
|
||||
File.write base_image_tmpfile_path, http_resp.to_s
|
||||
|
||||
user_screenshots_path = File.join SCREENSHOTS_PATH, Site.sharding_dir(username), username
|
||||
|
@ -72,7 +72,7 @@ class ScreenshotWorker
|
|||
rescue => e
|
||||
raise e
|
||||
ensure
|
||||
FileUtils.rm base_image_tmpfile_path
|
||||
FileUtils.rm base_image_tmpfile_path if File.exist?(base_image_tmpfile_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue