DEV: Bump uglifyjs (#7834)
* Rewrite uglifyjs command to work with 3.x * Use ES5 syntax in plain JS files * Use the older command if uglifyJS V2.x is installed
This commit is contained in:
parent
939a746dcd
commit
10478cb395
app/assets/javascripts
lib/tasks
vendor/assets/javascripts
|
@ -7,7 +7,7 @@ workbox.setConfig({
|
||||||
debug: false
|
debug: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const cacheVersion = "1";
|
var cacheVersion = "1";
|
||||||
|
|
||||||
// Cache all GET requests, so Discourse can be used while offline
|
// Cache all GET requests, so Discourse can be used while offline
|
||||||
workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
|
@ -24,7 +24,7 @@ workbox.routing.registerRoute(
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const idleThresholdTime = 1000 * 10; // 10 seconds
|
var idleThresholdTime = 1000 * 10; // 10 seconds
|
||||||
var lastAction = -1;
|
var lastAction = -1;
|
||||||
|
|
||||||
function isIdle() {
|
function isIdle() {
|
||||||
|
|
|
@ -78,7 +78,15 @@ def compress_node(from, to)
|
||||||
source_map_root = assets + ((d = File.dirname(from)) == "." ? "" : "/#{d}")
|
source_map_root = assets + ((d = File.dirname(from)) == "." ? "" : "/#{d}")
|
||||||
source_map_url = cdn_path "/assets/#{to}.map"
|
source_map_url = cdn_path "/assets/#{to}.map"
|
||||||
|
|
||||||
cmd = "uglifyjs '#{assets_path}/#{from}' -p relative -m -c -o '#{to_path}' --source-map-root '#{source_map_root}' --source-map '#{assets_path}/#{to}.map' --source-map-url '#{source_map_url}'"
|
cmd = if `uglifyjs -V`.match?(/2(.\d*){2}/)
|
||||||
|
<<~EOS
|
||||||
|
uglifyjs '#{assets_path}/#{from}' -p relative -m -c -o '#{to_path}' --source-map-root '#{source_map_root}' --source-map '#{assets_path}/#{to}.map' --source-map-url '#{source_map_url}'
|
||||||
|
EOS
|
||||||
|
else
|
||||||
|
<<~EOS
|
||||||
|
uglifyjs '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "root='#{source_map_root}',url='#{source_map_url}'" --output '#{to_path}'
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
STDERR.puts cmd
|
STDERR.puts cmd
|
||||||
result = `#{cmd} 2>&1`
|
result = `#{cmd} 2>&1`
|
||||||
|
|
|
@ -69,7 +69,7 @@ $.fn.caretPosition = function(options) {
|
||||||
clone = $("<div><p></p></div>").appendTo("body");
|
clone = $("<div><p></p></div>").appendTo("body");
|
||||||
p = clone.find("p");
|
p = clone.find("p");
|
||||||
|
|
||||||
const isRTL = $("html").hasClass("rtl");
|
var isRTL = $("html").hasClass("rtl");
|
||||||
clone.css({
|
clone.css({
|
||||||
border: "1px solid black",
|
border: "1px solid black",
|
||||||
padding: important("padding"),
|
padding: important("padding"),
|
||||||
|
|
Loading…
Reference in New Issue