Skip to content

Commit

Permalink
1.6.0 qa 리포트 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorkim committed Nov 22, 2017
1 parent 1204fbc commit 5b6200f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 20 deletions.
41 changes: 24 additions & 17 deletions src/renderer/src/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ angular.module('workspace').controller('HeaderController', ['$scope', '$rootScop

$scope.setWorkspaceMode = function (type) {
var isPracticalCourse = localStorage.getItem('isPracticalCourse') === 'true';
saveLocalStorageProject();
if (isPracticalCourse && type === 'default') {
localStorage.setItem('isPracticalCourse', false);
Entry.plugin.reloadApplication(true);
} else if (!isPracticalCourse && type !== 'default') {
localStorage.setItem('isPracticalCourse', true);
Entry.plugin.reloadApplication(true);
if ((isPracticalCourse && type === 'default') || (!isPracticalCourse && type !== 'default')) {
$scope.setMode(0, ()=> {
localStorage.setItem('isPracticalCourse', !isPracticalCourse);
saveLocalStorageProject();
Entry.plugin.reloadApplication(true);
});
}
}

Expand Down Expand Up @@ -133,18 +132,26 @@ angular.module('workspace').controller('HeaderController', ['$scope', '$rootScop
}
}

$scope.setMode = function (mode) {
if (myProject.programmingMode === mode) return;
applied = true;
if (mode === 1) {
var isShown = localStorage.getItem('python_manual');
if (!isShown) {
$scope.showPythonTooltip();
localStorage.setItem('python_manual', true);
$scope.setMode = function (mode, callback) {
var checkChange = true;
if (myProject.programmingMode !== mode) {
applied = true;
if (mode === 1) {
var isShown = localStorage.getItem('python_manual');
if (!isShown) {
$scope.showPythonTooltip();
localStorage.setItem('python_manual', true);
}
}
$scope._setMode(mode);
applied = false;
if (mode !== Entry.getMainWS().getMode()) {
checkChange = false;
}
}
$scope._setMode(mode);
applied = false;
if (checkChange && callback) {
callback();
}
};

$scope._setMode = function (mode) {
Expand Down
16 changes: 14 additions & 2 deletions src/renderer/src/native_controll.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,32 @@ Entry.plugin = (function () {
});
});

localStorage.setItem('isPracticalCourse', jsonObj.isPracticalCourse);
var isPracticalCourse = !!jsonObj.isPracticalCourse;
if (isPracticalCourse) {
$('html').removeClass('default_mode');
$('html').addClass('practical_course_mode');
window.EntryStatic = require('./bower_components/entryjs/extern/util/static_mini.js').EntryStatic;
} else {
$('html').removeClass('practical_course_mode');
$('html').addClass('default_mode');
window.EntryStatic = require('./bower_components/entryjs/extern/util/static.js').EntryStatic;
}

if (jsonObj.objects[0] &&
jsonObj.objects[0].script.substr(0,4) === "<xml") {
blockConverter.convert(jsonObj, function(result) {
localStorage.setItem('nativeLoadProject', JSON.stringify(result));
Entry.dispatchEvent('hideLoadingPopup');
if($.isFunction(cb)) {
cb();
cb(isPracticalCourse);
}
});
} else {
localStorage.setItem('nativeLoadProject', JSON.stringify(jsonObj));
Entry.dispatchEvent('hideLoadingPopup');
if($.isFunction(cb)) {
cb();
cb(isPracticalCourse);
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/renderer/src/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@ angular.module('workspace').controller("WorkspaceController", ['$scope', '$rootS
}

// 기본 초기화를 수행수 동작한다.
Entry.plugin.init(function() {
Entry.plugin.init(function(isPracticalCourseMode) {
if (isPracticalCourseMode === true) {
isPracticalCourse = true;
addPracticalNoticePopup();
myProject.setMode('practical_course');
settingForMini();
} else if (isPracticalCourseMode === false) {
isPracticalCourse = false;
myProject.setMode('default');
}

myProject.isSavedPath = storage.getItem('defaultPath') || '';
var workspace = document.getElementById("workspace");
var initOptions = {
Expand Down

0 comments on commit 5b6200f

Please sign in to comment.