fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
039f0ed
)
linting
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 1 Jul 2013 13:45:27 +0000
(15:45 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 1 Jul 2013 13:45:27 +0000
(15:45 +0200)
modules/documentCanvas/canvasNode.js
patch
|
blob
|
history
modules/documentCanvas/documentCanvas.js
patch
|
blob
|
history
modules/documentCanvas/tests/canvasNode.test.js
patch
|
blob
|
history
modules/nodePane/metaWidget/metaWidget.js
patch
|
blob
|
history
diff --git
a/modules/documentCanvas/canvasNode.js
b/modules/documentCanvas/canvasNode.js
index
d9475cb
..
a57c10a
100644
(file)
--- a/
modules/documentCanvas/canvasNode.js
+++ b/
modules/documentCanvas/canvasNode.js
@@
-85,7
+85,7
@@
CanvasNode.prototype.isOfClass = function(klass) {
CanvasNode.prototype.getMetaAttr = function(attr) {
return this.dom.attr('wlxml-meta-'+attr);
CanvasNode.prototype.getMetaAttr = function(attr) {
return this.dom.attr('wlxml-meta-'+attr);
-}
+}
;
CanvasNode.prototype.getMetaAttrs = function() {
var toret = [];
CanvasNode.prototype.getMetaAttrs = function() {
var toret = [];
@@
-99,11
+99,11
@@
CanvasNode.prototype.getMetaAttrs = function() {
}
}
return toret;
}
}
return toret;
-}
+}
;
CanvasNode.prototype.setMetaAttr = function(attr, value) {
this.dom.attr('wlxml-meta-'+attr, value);
CanvasNode.prototype.setMetaAttr = function(attr, value) {
this.dom.attr('wlxml-meta-'+attr, value);
-}
+}
;
return {
create: function(desc) {
return {
create: function(desc) {
diff --git
a/modules/documentCanvas/documentCanvas.js
b/modules/documentCanvas/documentCanvas.js
index
c47b8bb
..
50a3777
100644
(file)
--- a/
modules/documentCanvas/documentCanvas.js
+++ b/
modules/documentCanvas/documentCanvas.js
@@
-36,6
+36,7
@@
return function(sandbox) {
manager.currentNode.setMetaAttr(attr, value);
}
sandbox.publish('contentChanged');
manager.currentNode.setMetaAttr(attr, value);
}
sandbox.publish('contentChanged');
+ sandbox.publish('currentNodeChanged', manager.currentNode);
}
},
highlightNode: function(canvasNode) {
}
},
highlightNode: function(canvasNode) {
diff --git
a/modules/documentCanvas/tests/canvasNode.test.js
b/modules/documentCanvas/tests/canvasNode.test.js
index
5dccf7b
..
f944d90
100644
(file)
--- a/
modules/documentCanvas/tests/canvasNode.test.js
+++ b/
modules/documentCanvas/tests/canvasNode.test.js
@@
-78,7
+78,7
@@
suite('meta attributes', function() {
var node = canvasNode.create({tag: 'tag', meta: {a:'1'}});
node.setMetaAttr('a', '2');
assert.equal(node.dom.attr('wlxml-meta-a'), '2');
var node = canvasNode.create({tag: 'tag', meta: {a:'1'}});
node.setMetaAttr('a', '2');
assert.equal(node.dom.attr('wlxml-meta-a'), '2');
- })
-})
+ })
;
+})
;
});
\ No newline at end of file
});
\ No newline at end of file
diff --git
a/modules/nodePane/metaWidget/metaWidget.js
b/modules/nodePane/metaWidget/metaWidget.js
index
569153d
..
c1d7c94
100644
(file)
--- a/
modules/nodePane/metaWidget/metaWidget.js
+++ b/
modules/nodePane/metaWidget/metaWidget.js
@@
-9,13
+9,13
@@
define([
var templates = {
string: _.template(stringFieldTpl)
var templates = {
string: _.template(stringFieldTpl)
-}
+}
;
var getAttrElement = function(attr) {
var toret = $('<div>');
toret.append(templates.string({name: attr.name, value: attr.value}));
return toret;
var getAttrElement = function(attr) {
var toret = $('<div>');
toret.append(templates.string({name: attr.name, value: attr.value}));
return toret;
-}
+}
;
var MetaWidget = Backbone.View.extend({
events: {
var MetaWidget = Backbone.View.extend({
events: {
@@
-25,7
+25,7
@@
var MetaWidget = Backbone.View.extend({
var view = this;
this.options.attrs.forEach(function(attr) {
view.$el.append(getAttrElement(attr));
var view = this;
this.options.attrs.forEach(function(attr) {
view.$el.append(getAttrElement(attr));
- })
+ })
;
},
onMetaFieldChange: function(e) {
var target = $(e.target);
},
onMetaFieldChange: function(e) {
var target = $(e.target);
@@
-38,6
+38,6
@@
return {
create: function(options) {
return new MetaWidget(options);
}
create: function(options) {
return new MetaWidget(options);
}
-}
+}
;
});
\ No newline at end of file
});
\ No newline at end of file