fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84196c8
)
wip: adding footnodes, first approach
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 5 Aug 2013 07:20:43 +0000
(09:20 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 5 Aug 2013 10:20:07 +0000
(12:20 +0200)
modules/documentCanvas/canvas/documentElement.js
patch
|
blob
|
history
modules/documentCanvas/canvas/wlxmlManagers.js
patch
|
blob
|
history
modules/documentCanvas/commands.js
patch
|
blob
|
history
modules/documentToolbar/template.html
patch
|
blob
|
history
diff --git
a/modules/documentCanvas/canvas/documentElement.js
b/modules/documentCanvas/canvas/documentElement.js
index
0cf2e2c
..
e1d3203
100644
(file)
--- a/
modules/documentCanvas/canvas/documentElement.js
+++ b/
modules/documentCanvas/canvas/documentElement.js
@@
-362,6
+362,13
@@
$.extend(DocumentNodeElement.prototype, {
toggleHighlight: function(toogle) {
this._container().toggleClass('highlighted-element');
toggleHighlight: function(toogle) {
this._container().toggleClass('highlighted-element');
+ },
+
+ toggle: function(toggle) {
+ var mng = this.data('_wlxmlManager');
+ if(mng) {
+ mng.toggle(toggle);
+ }
}
});
}
});
diff --git
a/modules/documentCanvas/canvas/wlxmlManagers.js
b/modules/documentCanvas/canvas/wlxmlManagers.js
index
75d8c67
..
0a48fdc
100644
(file)
--- a/
modules/documentCanvas/canvas/wlxmlManagers.js
+++ b/
modules/documentCanvas/canvas/wlxmlManagers.js
@@
-53,7
+53,11
@@
$.extend(GenericManager.prototype, {
this.el.clearWidgets();
this.el.addWidget(widgets.labelWidget(this.el.tag(), this.el.klass()));
this.el.clearWidgets();
this.el.addWidget(widgets.labelWidget(this.el.tag(), this.el.klass()));
+ },
+ toggle: function(toggle) {
+ this.el.toggle(toggle);
}
}
+
})
var managers = {
})
var managers = {
@@
-78,21
+82,21
@@
$.extend(FootnoteManager.prototype, {
this.el.clearWidgets();
var clickHandler = function() {
this.el.clearWidgets();
var clickHandler = function() {
- this.
_toggleFootnot
e(true);
+ this.
toggl
e(true);
}.bind(this);
this.footnoteHandler = widgets.footnoteHandler(clickHandler);
this.el.addWidget(this.footnoteHandler);
var closeHandler = function() {
}.bind(this);
this.footnoteHandler = widgets.footnoteHandler(clickHandler);
this.el.addWidget(this.footnoteHandler);
var closeHandler = function() {
- this.
_toggleFootnot
e(false);
+ this.
toggl
e(false);
}.bind(this);
this.hideButton = widgets.hideButton(closeHandler);
this.el.addWidget(this.hideButton);
}.bind(this);
this.hideButton = widgets.hideButton(closeHandler);
this.el.addWidget(this.hideButton);
- this.
_toggleFootnot
e(false);
+ this.
toggl
e(false);
},
},
-
_toggleFootnot
e: function(toggle) {
+
toggl
e: function(toggle) {
this.hideButton.toggle(toggle);
this.footnoteHandler.toggle(!toggle);
this.hideButton.toggle(toggle);
this.footnoteHandler.toggle(!toggle);
diff --git
a/modules/documentCanvas/commands.js
b/modules/documentCanvas/commands.js
index
0e48de1
..
b08348e
100644
(file)
--- a/
modules/documentCanvas/commands.js
+++ b/
modules/documentCanvas/commands.js
@@
-99,6
+99,16
@@
commands.register('newNodeRequested', function(canvas, params) {
}
});
}
});
+commands.register('footnote', function(canvas, params) {
+ var position = canvas.getCursor().getPosition();
+
+ var asideElement = position.element.divide({tag: 'aside', klass: 'footnote', offset: position.offset});
+
+ asideElement.append({text: ''});
+ asideElement.toggle(true);
+ canvas.setCurrentElement(asideElement);
+});
+
return {
run: function(name, params, canvas) {
return {
run: function(name, params, canvas) {
diff --git
a/modules/documentToolbar/template.html
b/modules/documentToolbar/template.html
index
45e6351
..
e521f25
100644
(file)
--- a/
modules/documentToolbar/template.html
+++ b/
modules/documentToolbar/template.html
@@
-26,6
+26,9
@@
<button data-name="list" data-btn-type="toggle" data-meta="bullets" class="btn btn-mini"><i class="icon-list"></i></button>
<button data-name="createList" data-btn-type="cmd" data-meta="enum" class="btn btn-mini"><i class="icon-th-list"></i></button>
</div>
<button data-name="list" data-btn-type="toggle" data-meta="bullets" class="btn btn-mini"><i class="icon-list"></i></button>
<button data-name="createList" data-btn-type="cmd" data-meta="enum" class="btn btn-mini"><i class="icon-th-list"></i></button>
</div>
+ <div class="rng-module-documentToolbar-toolbarGroup">
+ <button data-name="footnote" data-btn-type="cmd" class="btn btn-mini"><i class="icon-comment"></i></button>
+ </div>
<div class="rng-module-documentToolbar-toolbarGroup">
<button data-name="grid" data-btn-type="toggle" class="btn btn-mini"><i class="icon-th-large"></i></button>
</div>
<div class="rng-module-documentToolbar-toolbarGroup">
<button data-name="grid" data-btn-type="toggle" class="btn btn-mini"><i class="icon-th-large"></i></button>
</div>