Skip to content

Commit fa296d5

Browse files
committed
upgrade electron to 1.4.14
1 parent 6bb326a commit fa296d5

15 files changed

+2648
-35
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Thumbs.db
99
*.autogenerated
1010
tmp
1111
.electron-cache
12+
.vscode

Diff for: app/lib/font-manager/linux/fontmanager.node

-3.96 KB
Binary file not shown.

Diff for: app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Pencil",
33
"productName": "Pencil",
44
"description": "An open-source GUI prototyping tool that is available for ALL platforms.",
5-
"version": "3.0.0-rc.1",
5+
"version": "3.0.0-rc.2",
66
"author": {
77
"name": "Evolus",
88
"url": "http://evolus.vn",
@@ -48,7 +48,7 @@
4848
"nugget": "^2.0.0",
4949
"q": "^1.4.1",
5050
"rimraf": "^2.5.2",
51-
"tmp": "0.0.28",
51+
"tmp": "0.0.31",
5252
"unzip2": "^0.2.5"
5353
},
5454
"private": true

Diff for: app/pencil-core/common/Canvas.js

+1
Original file line numberDiff line numberDiff line change
@@ -2887,6 +2887,7 @@ Canvas.prototype.__dragover = function (event) {
28872887
Canvas.prototype.__drop = function (event) {
28882888
var thiz =this;
28892889
var data = event.dataTransfer.getData("collectionId");
2890+
var data = nsDragAndDrop.getData("collectionId");
28902891
var collections = CollectionManager.shapeDefinition.collections;
28912892
// for (var i = 0; i < collections.length; i ++) {
28922893
// if (collections[i].id == data) {

Diff for: app/pencil-core/common/nsDragAndDrop2.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ FlavourSet.prototype.appendFlavour = function (f) {
77
};
88

99
var nsDragAndDrop = {
10+
setData(key, value) {
11+
this.dragData[key] = value;
12+
},
13+
14+
getData(key) {
15+
return this.dragData[key];
16+
},
17+
18+
dragStart: function(event) {
19+
this.dragData = {};
20+
},
21+
1022
dragOver: function (event, observer) {
1123
},
1224

@@ -16,12 +28,12 @@ var nsDragAndDrop = {
1628
//gives the observer the ability to actively tell that it accepts the drag, bybass type-based checking below
1729
if (observer.acceptsDataTransfer && observer.acceptsDataTransfer(event.dataTransfer)) return true;
1830
if (!observer.getSupportedFlavours) return false;
19-
31+
2032
var flavours = observer.getSupportedFlavours().flavours;
2133
for (var i = 0; i < flavours.length; i ++) {
2234
var f = flavours[i];
23-
var data = event.dataTransfer.getData(f);
24-
if (data) {
35+
var types = event.dataTransfer.types;
36+
if (types && types.includes(f)) {
2537
if (observer.onDragEnter) observer.onDragEnter(event);
2638
event.stopPropagation();
2739
return true;
@@ -49,6 +61,7 @@ var nsDragAndDrop = {
4961
for (var i = 0; i < flavours.length; i ++) {
5062
var f = flavours[i];
5163
var data = event.dataTransfer.getData(f);
64+
var data = nsDragAndDrop.getData(f);
5265
if (data) {
5366
observer.onDrop(event, { data: data });
5467
event.stopPropagation();
@@ -58,6 +71,5 @@ var nsDragAndDrop = {
5871
} else {
5972
observer.onDrop(event, event.dataTransfer);
6073
}
61-
6274
}
6375
};

Diff for: app/pencil-core/xferHelper/dragObservers.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ShapeDefDragObserver.prototype = {
3131
this.lastDragEnterExitEventTS = now;
3232

3333
var defId = event.dataTransfer.getData("pencil/def");
34+
var defId = nsDragAndDrop.getData("pencil/def");
3435

3536
this.dragStart = false;
3637

@@ -154,6 +155,7 @@ PrivateShapeDefDragObserver.prototype = {
154155
// }
155156

156157
var defId = event.dataTransfer.getData("pencil/privatedef");
158+
var defId = nsDragAndDrop.getData("pencil/privatedef");
157159

158160
var def = PrivateCollectionManager.locateShapeDefinition(defId);
159161

@@ -262,6 +264,7 @@ ShapeShortcutDragObserver.prototype = {
262264
this.lastDragEnterExitEventTS = now;
263265

264266
var defId = event.dataTransfer.getData("pencil/shortcut");
267+
var defId = nsDragAndDrop.getData("pencil/shortcut");
265268

266269
var shortcut = CollectionManager.shapeDefinition.locateShortcut(defId);
267270
var def = shortcut.shape;

Diff for: app/views/collections/BaseCollectionPane.js

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function BaseCollectionPane() {
3030
}, this.clearTextButton);
3131

3232
this.shapeList.addEventListener("dragstart", function (event) {
33+
nsDragAndDrop.dragStart(event);
3334
var n = Dom.findUpwardForNodeWithData(Dom.getTarget(event), "_def");
3435
var def = n._def;
3536
thiz.addDefDataToDataTransfer(def, event);

Diff for: app/views/collections/CollectionManagementDialog.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,21 @@ function CollectionManagementDialog (collectionPanel) {
4343
}, false);
4444

4545
this.bind("dragstart", function (ev) {
46+
nsDragAndDrop.dragStart(ev);
4647
var node = Dom.findUpwardForNodeWithData(event.target, "_collection");
4748
if (!node) return;
4849
ev.dataTransfer.setData("collectionId", node._collection.id);
4950
ev.dataTransfer.setData("dragType", "collection");
51+
nsDragAndDrop.setData("collectionId", node._collection.id);
52+
nsDragAndDrop.setData("dragType", "collection");
5053
if (this.currentDraggedObject) this.currentDraggedObject.removeAttribute("dragged");
5154
this.currentDraggedObject = node;
5255
this.currentDraggedObject.setAttribute("dragged", "true");
5356
}, this.collectionContainer);
5457

5558
this.bind("dragover", function (ev) {
56-
if (event.dataTransfer.getData("dragType") != "collection") return;
59+
// if (event.dataTransfer.getData("dragType") != "collection") return;
60+
if (nsDragAndDrop.getData("dragType") != "collection") return;
5761
if (this.hoverNode) {
5862
this.hoverNode.removeAttribute("hover");
5963
this.hoverNode = null;
@@ -67,14 +71,17 @@ function CollectionManagementDialog (collectionPanel) {
6771
}, this.collectionContainer);
6872

6973
this.bind("drop", function (ev) {
70-
if (event.dataTransfer.getData("dragType") != "collection") return;
74+
// if (event.dataTransfer.getData("dragType") != "collection") return;
75+
if (nsDragAndDrop.getData("dragType") != "collection") return;
76+
7177
if (this.hoverNode) {
7278
this.hoverNode.removeAttribute("hover");
7379
this.hoverNode = null;
7480
}
7581
var node = Dom.findUpwardForNodeWithData(event.target, "_collection");
7682
if (!node) return;
7783
var draggedCollectionId = ev.dataTransfer.getData("collectionId");
84+
var draggedCollectionId = nsDragAndDrop.getData("collectionId");
7885
var targetCollectionId = node._collection.id;
7986
if (node._collection.id != draggedCollectionId) {
8087
CollectionManager.reorderCollections(draggedCollectionId, targetCollectionId);

Diff for: app/views/collections/CollectionPane.js

+3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ CollectionPane.prototype.handleCollectionContextMenu = function (collection, eve
3434
CollectionPane.prototype.addDefDataToDataTransfer = function (def, event) {
3535
if (def.shape) {
3636
event.dataTransfer.setData("pencil/shortcut", def.id);
37+
nsDragAndDrop.setData("pencil/shortcut", def.id);
3738
} else {
3839
event.dataTransfer.setData("pencil/def", def.id);
40+
nsDragAndDrop.setData("pencil/def", def.id);
3941
}
4042
// event.dataTransfer.setData("pencil/def", def.id);
4143
event.dataTransfer.setData("collectionId", def.collection ? def.collection.id : 0);
44+
nsDragAndDrop.setData("collectionId", def.collection ? def.collection.id : 0);
4245
};
4346
CollectionPane.prototype.getCollections = function () {
4447
return CollectionManager.shapeDefinition.collections;

Diff for: app/views/common/PageListView.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,20 @@ function PageListView() {
166166
}
167167

168168
this.bind("dragstart", function (event) {
169+
nsDragAndDrop.dragStart(event);
169170
var n = Dom.findUpwardForNodeWithData(Dom.getTarget(event), "_index");
170171
if (!n) return;
171172

172173
event.dataTransfer.setDragImage(this.dndImage, 8, 8);
173174
event.dataTransfer.setData("dragType", "page");
174175
event.dataTransfer.setData("text/html", "");
176+
nsDragAndDrop.setData("dragType", "page");
177+
nsDragAndDrop.setData("text/html", "");
175178
if (n.__widget && n.__widget.page && n.__widget.page.thumbPath) {
176179
event.dataTransfer.setData("text/html", "");
177180
event.dataTransfer.setData("pencil/png", n.__widget.page.thumbPath);
181+
nsDragAndDrop.setData("text/html", "");
182+
nsDragAndDrop.setData("pencil/png", n.__widget.page.thumbPath);
178183
}
179184

180185
if (this.currentDraggedObject) this.currentDraggedObject.removeAttribute("dragged");
@@ -183,7 +188,8 @@ function PageListView() {
183188
}, this.node());
184189

185190
this.bind("drop", function (event) {
186-
if (event.dataTransfer.getData("dragType") != "page") return;
191+
// if (event.dataTransfer.getData("dragType") != "page") return;
192+
if (nsDragAndDrop.getData("dragType") != "page") return;
187193
if (!this.lastDropCandidateObject || !this.currentDraggedObject) return;
188194

189195
var pageId = findPageIdFromUINode(this.currentDraggedObject);
@@ -194,7 +200,8 @@ function PageListView() {
194200
}, this.node());
195201

196202
this.bind("dragover", function (event) {
197-
if (event.dataTransfer.getData("dragType") != "page") return;
203+
// if (event.dataTransfer.getData("dragType") != "page") return;
204+
if (nsDragAndDrop.getData("dragType") != "page") return;
198205
var container = Dom.findUpwardForNodeWithData(Dom.getTarget(event), "_isDropZone");
199206
if (!container) return;
200207

@@ -269,6 +276,7 @@ PageListView.prototype.validateFilterBox = function() {
269276
}
270277

271278
PageListView.prototype.filterPages = function() {
279+
if (!this.controller.activePage) { return; }
272280
var filterName = this.controller.activePage.parentPage ? this.controller.activePage.parentPage.name : "Root";
273281
var value = this.filterCache[filterName];
274282

Diff for: app/views/tools/OpenClipartPane.js

+4
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ function OpenClipartPane() {
1313
}
1414
}
1515
this.shapeList.addEventListener("dragstart", function (event) {
16+
nsDragAndDrop.dragStart(event);
1617
var n = Dom.findUpwardForNodeWithData(Dom.getTarget(event), "_def");
1718
var def = n._def;
1819
if (def._svg) {
1920
var svg = injectSvgInfo(def._svg);
2021
event.dataTransfer.setData("image/svg+xml", svg);
22+
nsDragAndDrop.setData("image/svg+xml", svg);
2123
} else {
2224
event.dataTransfer.setData("pencil/png", def.src);
25+
nsDragAndDrop.setData("pencil/png", def.src);
2326
}
2427

2528
event.dataTransfer.setData("text/html", "");
29+
nsDragAndDrop.setData("text/html", "");
2630
event.dataTransfer.setDragImage(thiz.dndImage, 8, 8);
2731
event.target.collection = def;
2832
});

0 commit comments

Comments
 (0)