Skip to content

Commit

Permalink
file load error 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorkim committed May 30, 2016
1 parent 607238b commit 0aa54c9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/entry_offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script type="text/javascript" src="./src/main.js"></script>
<script type="text/javascript" src="./src/ws.js"></script>
<script type="text/javascript" src="./src/require.js"></script>
<script type='text/javascript' src='./node_modules/socket.io-client/socket.io.js'></script>
<!-- <script type='text/javascript' src='./node_modules/socket.io-client/socket.io.js'></script> -->
<script type='text/javascript' src='./bower_components/jquery/dist/jquery.min.js'></script>
<script type='text/javascript' src='./bower_components/jquery-ui/jquery-ui.min.js'></script>
<script type='text/javascript' src='./bower_components/angular/angular.min.js'></script>
Expand Down
15 changes: 15 additions & 0 deletions app/entry_offline.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@ app.on('window-all-closed', function() {
process.exit(0);
});

var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// 어플리케이션을 중복 실행했습니다. 주 어플리케이션 인스턴스를 활성화 합니다.
if (mainWindow) {
if (mainWindow.isMinimized())
mainWindow.restore();
mainWindow.focus();
}
return true;
});

if (shouldQuit) {
app.quit();
return;
}

app.once('ready', function() {
language = app.getLocale();
var title = packageJson.version;
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "git",
"url": "git+https://[email protected]/entrylabs/entry-offline.git"
},
"version": "1.2.1",
"version": "1.2.2",
"chromium-args": "--disable-web-security --allow-file-access-from-files --enable-decoder=aac,h264,mp3 --enable-demuxer=mp3,mov --enable-parser=aac,h264,mpegaudio",
"nodejs": "true",
"webkit": {
Expand Down
33 changes: 20 additions & 13 deletions app/src/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,19 @@ angular.module('workspace').controller("WorkspaceController",
jsonObj.objects.forEach(function (object) {
var sprite = object.sprite;
sprite.pictures.forEach(function (picture) {
picture.fileurl.replace(/\\/gi, path.sep);
if(picture.fileurl && picture.fileurl.indexOf('bower_components') === -1) {
picture.fileurl = path.join('.', picture.fileurl.substr(picture.fileurl.lastIndexOf('temp')))
if(picture.fileurl) {
picture.fileurl.replace(/\\/gi, path.sep);
if(picture.fileurl && picture.fileurl.indexOf('bower_components') === -1) {
picture.fileurl = path.join('.', picture.fileurl.substr(picture.fileurl.lastIndexOf('temp')))
}
}

});
sprite.sounds.forEach(function (sound) {
sound.fileurl.replace(/\\/gi, path.sep);
if(sound.fileurl && sound.fileurl.indexOf('bower_components') === -1) {
sound.fileurl = path.join('.', sound.fileurl.substr(sound.fileurl.lastIndexOf('temp')))
if(sound.fileurl) {
sound.fileurl.replace(/\\/gi, path.sep);
if(sound.fileurl && sound.fileurl.indexOf('bower_components') === -1) {
sound.fileurl = path.join('.', sound.fileurl.substr(sound.fileurl.lastIndexOf('temp')))
}
}
});
});
Expand Down Expand Up @@ -498,16 +501,20 @@ angular.module('workspace').controller("WorkspaceController",
jsonObj.objects.forEach(function (object) {
var sprite = object.sprite;
sprite.pictures.forEach(function (picture) {
picture.fileurl.replace(/\\/gi, path.sep);
if(picture.fileurl && picture.fileurl.indexOf('bower_components') === -1) {
picture.fileurl = path.join('.', picture.fileurl.substr(picture.fileurl.lastIndexOf('temp')))
if(picture.fileurl) {
picture.fileurl.replace(/\\/gi, path.sep);
if(picture.fileurl && picture.fileurl.indexOf('bower_components') === -1) {
picture.fileurl = path.join('.', picture.fileurl.substr(picture.fileurl.lastIndexOf('temp')))
}
}

});
sprite.sounds.forEach(function (sound) {
sound.fileurl.replace(/\\/gi, path.sep);
if(sound.fileurl && sound.fileurl.indexOf('bower_components') === -1) {
sound.fileurl = path.join('.', sound.fileurl.substr(sound.fileurl.lastIndexOf('temp')))
if(sound.fileurl) {
sound.fileurl.replace(/\\/gi, path.sep);
if(sound.fileurl && sound.fileurl.indexOf('bower_components') === -1) {
sound.fileurl = path.join('.', sound.fileurl.substr(sound.fileurl.lastIndexOf('temp')))
}
}
});
});
Expand Down

0 comments on commit 0aa54c9

Please sign in to comment.