diff --git a/Darwin/Applications/Open Media Library.app/Contents/Info.plist b/Darwin/Applications/Open Media Library.app/Contents/Info.plist index 068c940..288d200 100644 --- a/Darwin/Applications/Open Media Library.app/Contents/Info.plist +++ b/Darwin/Applications/Open Media Library.app/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 15C50 + 15D21 CFBundleDevelopmentRegion en CFBundleExecutable @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5 + 0.6 CFBundleSignature ???? CFBundleSupportedPlatforms diff --git a/Darwin/Applications/Open Media Library.app/Contents/MacOS/Open Media Library b/Darwin/Applications/Open Media Library.app/Contents/MacOS/Open Media Library index 07b2e29..c579dd8 100755 Binary files a/Darwin/Applications/Open Media Library.app/Contents/MacOS/Open Media Library and b/Darwin/Applications/Open Media Library.app/Contents/MacOS/Open Media Library differ diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/Assets.car b/Darwin/Applications/Open Media Library.app/Contents/Resources/Assets.car index 0ebbb58..950959d 100644 Binary files a/Darwin/Applications/Open Media Library.app/Contents/Resources/Assets.car and b/Darwin/Applications/Open Media Library.app/Contents/Resources/Assets.car differ diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/index.html b/Darwin/Applications/Open Media Library.app/Contents/Resources/index.html index cb02249..dcda6dc 100644 --- a/Darwin/Applications/Open Media Library.app/Contents/Resources/index.html +++ b/Darwin/Applications/Open Media Library.app/Contents/Resources/index.html @@ -1,10 +1,11 @@ + Open Media Library + + + + - - Installing Open Media Library...
-
- - + diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/install.py b/Darwin/Applications/Open Media Library.app/Contents/Resources/install.py index 32a379d..1d5b7cc 100755 --- a/Darwin/Applications/Open Media Library.app/Contents/Resources/install.py +++ b/Darwin/Applications/Open Media Library.app/Contents/Resources/install.py @@ -40,6 +40,13 @@ class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(path) as fd: content = fd.read() self.send_response(200, 'OK') + content_type = { + 'html': 'text/html', + 'png': 'image/png', + 'svg': 'image/svg+xml', + 'txt': 'text/plain', + }.get(path.split('.')[-1], 'txt') + self.send_header('Content-Type', content_type) else: self.send_response(404, 'not found') content = '404 not found' @@ -52,7 +59,9 @@ class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): class Install(Thread): release_url = "http://downloads.openmedialibrary.com/release.json" - status = {} + status = { + 'step': 'Downloading...' + } def __init__(self, target, httpd): target = os.path.normpath(os.path.join(os.path.abspath(target))) @@ -66,35 +75,30 @@ class Install(Thread): target = self.target makedirs(target) os.chdir(target) + self.status["step"] = 'Downloading...' release = self.get_release() self.status["release"] = release - for module in release['modules']: - self.status["step"] = 'downloading %s' % module - self.status["progress"] = 0 - self.status["size"] = 0 + self.status["progress"] = 0 + for module in sorted(release['modules']): package_tar = release['modules'][module]['name'] url = self.release_url.replace('release.json', package_tar) self.download(url, package_tar) - self.status["step"] = 'extracting %s' % module - self.status["progress"] = 0 + self.status["step"] = 'Installing...' + for module in sorted(release['modules']): + package_tar = release['modules'][module]['name'] tar = tarfile.open(package_tar) tar.extractall() tar.close() os.unlink(package_tar) os.symlink('openmedialibrary/ctl', 'ctl') - self.status["progress"] = 0 - self.status["step"] = "setup" - os.system("./ctl setup") - self.status["progress"] = 1 makedirs('data') with open('data/release.json', 'w') as fd: json.dump(release, fd, indent=2) - self.status = {"installation finished. starting...": True} + self.status = {"relaunch": True} os.system("./ctl start &") - time.sleep(1) + time.sleep(5) self.httpd.shutdown() - def download(self, url, filename): dirname = os.path.dirname(filename) if dirname: @@ -108,7 +112,6 @@ class Install(Thread): while data: if size: available += len(data) - self.status["progress"] = available/size f.write(data) data = u.read(4096) @@ -118,7 +121,6 @@ class Install(Thread): return data - if __name__ == '__main__': if len(sys.argv) == 1: target = os.path.expanduser("~/Library/Application Support/Open Media Library") diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/js/install.js b/Darwin/Applications/Open Media Library.app/Contents/Resources/js/install.js index 2bc80e2..1a5f7e6 100644 --- a/Darwin/Applications/Open Media Library.app/Contents/Resources/js/install.js +++ b/Darwin/Applications/Open Media Library.app/Contents/Resources/js/install.js @@ -1,44 +1,148 @@ -function load() { - var base = '//127.0.0.1:9842', - ws = new WebSocket('ws:' + base + '/ws'); - ws.onopen = function(event) { - document.location.href = 'http:' + base; - }; - ws.onerror = function(event) { - ws.close(); - setTimeout(load, 500); - }; - ws.onclose = function(event) { - setTimeout(load, 500); - }; -}; +'use strict'; -function update() { - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - var response = JSON.parse(this.responseText); - if (response.step) { - var status = response.step; - if (response.progress) { - status = parseInt(response.progress * 100) + '% ' + status; - } - document.getElementById('status').innerHTML = status; - setTimeout(update, 1000); - } else { - document.getElementById('status').innerHTML = "done"; - setTimeout(load, 500); - } - }; - xhr.onerror = function() { - var status = document.getElementById('status').innerHTML; - if (['done', 'setup'].indexOf(status) == -1) { - document.getElementById('status').innerHTML = "error"; - } - load(); +(function() { + + loadImages(function(images) { + loadScreen(images); + initUpdate(); + }); + + function initUpdate(browserSupported) { + window.update = {}; + update.status = document.createElement('div'); + update.status.className = 'OxElement'; + update.status.style.position = 'absolute'; + update.status.style.left = '16px'; + update.status.style.top = '336px'; + update.status.style.right = 0; + update.status.style.bottom = 0; + update.status.style.width = '512px'; + update.status.style.height = '16px'; + update.status.style.margin = 'auto'; + update.status.style.textAlign = 'center'; + update.status.style.color = 'rgb(16, 16, 16)'; + update.status.style.fontFamily = 'Lucida Grande, Segoe UI, DejaVu Sans, Lucida Sans Unicode, Helvetica, Arial, sans-serif'; + update.status.style.fontSize = '11px'; + document.querySelector('#loadingScreen').appendChild(update.status); + update.status.innerHTML = ''; + updateStatus(); } - xhr.open('get', '/status'); - xhr.send(); -} + function load() { + var base = '//127.0.0.1:9842', + ws = new WebSocket('ws:' + base + '/ws'); + ws.onopen = function(event) { + document.location.href = 'http:' + base; + }; + ws.onerror = function(event) { + ws.close(); + setTimeout(load, 500); + }; + ws.onclose = function(event) { + setTimeout(load, 500); + }; + } -update(); + function loadImages(callback) { + var images = {}; + images.logo = document.createElement('img'); + images.logo.onload = function() { + images.logo.style.position = 'absolute'; + images.logo.style.left = 0; + images.logo.style.top = 0; + images.logo.style.right = 0; + images.logo.style.bottom = '96px'; + images.logo.style.width = '256px'; + images.logo.style.height = '256px'; + images.logo.style.margin = 'auto'; + images.logo.style.MozUserSelect = 'none'; + images.logo.style.MSUserSelect = 'none'; + images.logo.style.OUserSelect = 'none'; + images.logo.style.WebkitUserSelect = 'none'; + images.loadingIcon = document.createElement('img'); + images.loadingIcon.setAttribute('id', 'loadingIcon'); + images.loadingIcon.style.position = 'absolute'; + images.loadingIcon.style.left = '16px'; + images.loadingIcon.style.top = '256px' + images.loadingIcon.style.right = 0; + images.loadingIcon.style.bottom = 0; + images.loadingIcon.style.width = '32px'; + images.loadingIcon.style.height = '32px'; + images.loadingIcon.style.margin = 'auto'; + images.loadingIcon.style.MozUserSelect = 'none'; + images.loadingIcon.style.MSUserSelect = 'none'; + images.loadingIcon.style.OUserSelect = 'none'; + images.loadingIcon.style.WebkitUserSelect = 'none'; + images.loadingIcon.src = '/svg/symbolLoading.svg'; + callback(images); + }; + images.logo.src = '/png/oml.png'; + } + + function loadScreen(images) { + var loadingScreen = document.createElement('div'); + loadingScreen.setAttribute('id', 'loadingScreen'); + loadingScreen.className = 'OxScreen'; + loadingScreen.style.position = 'absolute'; + loadingScreen.style.width = '100%'; + loadingScreen.style.height = '100%'; + loadingScreen.style.backgroundColor = 'rgb(224, 224, 224)'; + loadingScreen.style.zIndex = '1002'; + loadingScreen.appendChild(images.logo); + loadingScreen.appendChild(images.loadingIcon); + // FF3.6 document.body can be undefined here + window.onload = function() { + document.body.style.margin = 0; + document.body.appendChild(loadingScreen); + startAnimation(); + }; + // IE8 does not call onload if already loaded before set + document.body && window.onload(); + } + + + function startAnimation() { + var css, deg = 0, loadingIcon = document.getElementById('loadingIcon'), + previousTime = +new Date(); + var animationInterval = setInterval(function() { + var currentTime = +new Date(), + delta = (currentTime - previousTime) / 1000; + previousTime = currentTime; + deg = Math.round((deg + delta * 360) % 360 / 30) * 30; + css = 'rotate(' + deg + 'deg)'; + loadingIcon.style.MozTransform = css; + loadingIcon.style.MSTransform = css; + loadingIcon.style.OTransform = css; + loadingIcon.style.WebkitTransform = css; + loadingIcon.style.transform = css; + }, 83); + } + + function updateStatus() { + var xhr = new XMLHttpRequest(); + xhr.onload = function() { + var response = JSON.parse(this.responseText); + if (response.step) { + var status = response.step; + if (response.progress) { + status = parseInt(response.progress * 100) + '% ' + status; + } + update.status.innerHTML = status; + setTimeout(updateStatus, 1000); + } else { + update.status.innerHTML = 'Relaunching...'; + setTimeout(load, 500); + } + }; + xhr.onerror = function() { + var status = update.status.innerHTML; + if (['Relaunching...', ''].indexOf(status) == -1) { + update.status.innerHTML = 'Installation failed'; + } + load(); + } + xhr.open('get', '/status'); + xhr.send(); + } + +}()); diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/png/oml.png b/Darwin/Applications/Open Media Library.app/Contents/Resources/png/oml.png new file mode 100644 index 0000000..9bf0dc7 Binary files /dev/null and b/Darwin/Applications/Open Media Library.app/Contents/Resources/png/oml.png differ diff --git a/Darwin/Applications/Open Media Library.app/Contents/Resources/svg/symbolLoading.svg b/Darwin/Applications/Open Media Library.app/Contents/Resources/svg/symbolLoading.svg new file mode 100644 index 0000000..eca747e --- /dev/null +++ b/Darwin/Applications/Open Media Library.app/Contents/Resources/svg/symbolLoading.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Darwin/Applications/Open Media Library.app/Contents/_CodeSignature/CodeResources b/Darwin/Applications/Open Media Library.app/Contents/_CodeSignature/CodeResources index 82676cf..e8b84ef 100644 --- a/Darwin/Applications/Open Media Library.app/Contents/_CodeSignature/CodeResources +++ b/Darwin/Applications/Open Media Library.app/Contents/_CodeSignature/CodeResources @@ -10,7 +10,7 @@ Resources/Assets.car - ODsO+3BxiGNQy86C/peDRQ8Ibi0= + J0bcbd6bu3teEBZKNEEQTcykNSI= Resources/Base.lproj/MainMenu.nib @@ -23,7 +23,7 @@ Resources/index.html - uuFF5PL3dHePhuXYRTqVqKH3NUM= + JIBakF3URAgkk7dR8veswSN9zLI= Resources/install.html @@ -31,11 +31,19 @@ Resources/install.py - J2O109peIBDCRUOCjyOTdnJYQVQ= + 8P8EjUEoWuHCRIRvQTi7vbDhGoM= Resources/js/install.js - kfsT9KBHf6VW5yoK9UpGWDo0nuM= + Vm6iTydoG1DWT+GNOLDV51fPEaA= + + Resources/png/oml.png + + yAW1cp8HHJoIRTYucCTGeG575vM= + + Resources/svg/symbolLoading.svg + + bp9z14AgWlNHFY+FF4dBnbl127s=
files2 @@ -127,7 +135,7 @@ Resources/Assets.car - ODsO+3BxiGNQy86C/peDRQ8Ibi0= + J0bcbd6bu3teEBZKNEEQTcykNSI= Resources/Base.lproj/MainMenu.nib @@ -140,7 +148,7 @@ Resources/index.html - uuFF5PL3dHePhuXYRTqVqKH3NUM= + JIBakF3URAgkk7dR8veswSN9zLI= Resources/install.html @@ -148,11 +156,19 @@ Resources/install.py - J2O109peIBDCRUOCjyOTdnJYQVQ= + 8P8EjUEoWuHCRIRvQTi7vbDhGoM= Resources/js/install.js - kfsT9KBHf6VW5yoK9UpGWDo0nuM= + Vm6iTydoG1DWT+GNOLDV51fPEaA= + + Resources/png/oml.png + + yAW1cp8HHJoIRTYucCTGeG575vM= + + Resources/svg/symbolLoading.svg + + bp9z14AgWlNHFY+FF4dBnbl127s= rules diff --git a/Darwin/lib/libexslt.0.dylib b/Darwin/lib/libexslt.0.dylib index d569d1b..761e623 100644 Binary files a/Darwin/lib/libexslt.0.dylib and b/Darwin/lib/libexslt.0.dylib differ diff --git a/Darwin/lib/libssl.1.0.0.dylib b/Darwin/lib/libssl.1.0.0.dylib index 7c2b076..cc6c473 100644 Binary files a/Darwin/lib/libssl.1.0.0.dylib and b/Darwin/lib/libssl.1.0.0.dylib differ diff --git a/Darwin/lib/libxslt.1.dylib b/Darwin/lib/libxslt.1.dylib index b768347..ec4806a 100644 Binary files a/Darwin/lib/libxslt.1.dylib and b/Darwin/lib/libxslt.1.dylib differ