diff --git a/src/Config.py b/src/Config.py index 18a37786..414be610 100644 --- a/src/Config.py +++ b/src/Config.py @@ -8,7 +8,7 @@ class Config(object): def __init__(self, argv): self.version = "0.3.2" - self.rev = 351 + self.rev = 357 self.argv = argv self.action = None self.createParser() diff --git a/src/Debug/DebugMedia.py b/src/Debug/DebugMedia.py index 27ad7a59..b345ecbe 100644 --- a/src/Debug/DebugMedia.py +++ b/src/Debug/DebugMedia.py @@ -17,6 +17,20 @@ def findfiles(path, find_ext): yield file_path.replace("\\", "/") +# Try to find coffeescript compiler in path +def findCoffeescriptCompiler(): + coffeescript_compiler = None + try: + import distutils.spawn + coffeescript_compiler = distutils.spawn.find_executable("coffee") + " --no-header -p" + except: + pass + if coffeescript_compiler: + return coffeescript_compiler + else: + return False + + # Generates: all.js: merge *.js, compile coffeescript, all.css: merge *.css, vendor prefix features def merge(merged_path): merge_dir = os.path.dirname(merged_path) @@ -53,10 +67,15 @@ def merge(merged_path): parts.append("\n\n/* ---- %s ---- */\n\n" % file_path) if file_path.endswith(".coffee"): # Compile coffee script if file_path in changed or file_path not in old_parts: # Only recompile if changed or its not compiled before + if config.coffeescript_compiler is None: + config.coffeescript_compiler = findCoffeescriptCompiler() if not config.coffeescript_compiler: logging.error("No coffeescript compiler definied, skipping compiling %s" % merged_path) return False # No coffeescript compiler, skip this file - command = config.coffeescript_compiler % os.path.join(*file_path.split("/")) # Fix os path separator + if "%s" in config.coffeescript_compiler: # Replace %s with coffeescript file + command = config.coffeescript_compiler % os.path.join(*file_path.split("/")) + else: # Put coffeescript file to end + command = config.coffeescript_compiler + " " + os.path.join(*file_path.split("/")) s = time.time() compiler = subprocess.Popen(command, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) out = compiler.stdout.read().decode("utf8") diff --git a/src/Ui/media/Notifications.coffee b/src/Ui/media/Notifications.coffee index 5175317d..1a7f94fa 100644 --- a/src/Ui/media/Notifications.coffee +++ b/src/Ui/media/Notifications.coffee @@ -13,6 +13,7 @@ class Notifications add: (id, type, body, timeout=0) -> + id = id.replace /[^A-Za-z0-9]/g, "" # Close notifications with same id for elem in $(".notification-#{id}") @close $(elem) diff --git a/src/Ui/media/Wrapper.coffee b/src/Ui/media/Wrapper.coffee index 5d244977..9c30d592 100644 --- a/src/Ui/media/Wrapper.coffee +++ b/src/Ui/media/Wrapper.coffee @@ -31,9 +31,6 @@ class Wrapper src = $("#inner-iframe").attr("src").replace(/#.*/, "")+window.location.hash $("#inner-iframe").attr("src", src) - ###setInterval (-> - console.log document.hasFocus() - ), 1000### $("#inner-iframe").focus() @ @@ -303,7 +300,7 @@ class Wrapper @notifications.add("size_limit", "done", res, 5000) return false - if @loading.screen_visible and @inner_loaded and site_info.settings.size < site_info.size_limit*1024*1024 # Loading screen still visible, but inner loaded + if @loading.screen_visible and @inner_loaded and site_info.settings.size < site_info.size_limit*1024*1024 and site_info.settings.size > 0 # Loading screen still visible, but inner loaded @loading.hideScreen() if site_info.tasks > 0 and site_info.started_task_num > 0 diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 570edfd6..eeef93ec 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -666,6 +666,7 @@ jQuery.extend( jQuery.easing, if (timeout == null) { timeout = 0; } + id = id.replace(/[^A-Za-z0-9]/g, ""); _ref = $(".notification-" + id); for (_i = 0, _len = _ref.length; _i < _len; _i++) { elem = _ref[_i]; @@ -801,11 +802,6 @@ jQuery.extend( jQuery.easing, } }; })(this)); - - /*setInterval (-> - console.log document.hasFocus() - ), 1000 - */ $("#inner-iframe").focus(); this; } @@ -1160,7 +1156,7 @@ jQuery.extend( jQuery.easing, })(this)); } } - if (this.loading.screen_visible && this.inner_loaded && site_info.settings.size < site_info.size_limit * 1024 * 1024) { + if (this.loading.screen_visible && this.inner_loaded && site_info.settings.size < site_info.size_limit * 1024 * 1024 && site_info.settings.size > 0) { this.loading.hideScreen(); } if (site_info.tasks > 0 && site_info.started_task_num > 0) {