Skip to content

Commit

Permalink
debug on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokidaichi committed Apr 13, 2016
1 parent 2c23558 commit 8ef3bb5
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 7 deletions.
3 changes: 3 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ gulp.task("package:win32", function(done) {
ignore: "/package($|/)",
asar: true,
}, function(err) {
if (err) {
console.error(err);
}
done();
});
});
Expand Down
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ var fileMenu = {
accelerator: 'CmdOrCtrl+O',
click: function() {
dialog.showOpenDialog({
properties: ['openFile', 'openDirectory']
defaultPath: app.getPath('userDesktop'),
properties: ['openFile'],
filters: [{
name: 'Documents',
extensions: ['txt', 'md', 'text']
}, ],
}, function(fileNames) {
if (fileNames) {
createWindow(fileNames[0]);
Expand Down
2 changes: 1 addition & 1 deletion js/diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var refresh = function(data) {
$(this).find("ellipse").attr("stroke-width", "4");
});
svg.find("g.node").on("click", function(e) {
var text = $(this).find("title").text();
var text = $(this).find("title").text().trim();
if ($(this).find("ellipse").length === 0) {
var lines = metaData[text].lines;
emitter.emit("page-click", lines);
Expand Down
6 changes: 5 additions & 1 deletion js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ var getFileName = function(forceDialog) {
return ok(EDITOR_FILE_NAME);
} else {
dialog.showSaveDialog({
title: "save file"
title: "save file",
filters: [{
name: 'Documents',
extensions: ['txt', 'md', 'text']
}, ],
}, function(fileName) {
if (fileName) {
ok(fileName);
Expand Down
25 changes: 21 additions & 4 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
var $ = require("./js/jquery-2.1.4.min");
//process.env.NODE_PATH = "./";
if (process.platform == "win32") {
//modulePaths.push();
var p = process.resourcesPath + "\\app.asar";
console.log(p);
module.paths.push(p);
}
var resolvePath = function(p) {
if (process.platform == "win32") {
return p.replace(/^\.\//, '');
} else {
return p;
}
};
var ipcRenderer = require("electron").ipcRenderer;
var remote = require("remote");
var fs = require("fs");
var uiflow = remote.require("./app/uiflow");
var editor = require("./js/editor");
var diagram = require("./js/diagram");
var flumine = require("flumine");
var $ = require(resolvePath("./js/jquery-2.1.4.min"));
var uiflow = remote.require("./app/uiflow");
var editor = require(resolvePath("./js/editor"));
var diagram = require(resolvePath("./js/diagram"));

[
"open",
"save",
Expand Down Expand Up @@ -86,6 +101,8 @@ $(function() {
cElement.width = width * 2;
cElement.height = height * 2;
var cContext = cElement.getContext("2d");
cContext.fillStyle = "#fff";
cContext.fillRect(-10, -10, width * 3, height * 3);
cContext.drawImage(image, 0, 0, width * 2, height * 2);
var png = cElement.toDataURL("image/png");

Expand Down
Binary file not shown.
Binary file modified package/linux/guiflow-linux-x64/resources/app.asar
Binary file not shown.
Binary file modified package/win32/guiflow-win32-x64/resources/app.asar
Binary file not shown.

0 comments on commit 8ef3bb5

Please sign in to comment.