Added footnote support

This commit is contained in:
2016-03-06 23:25:13 +08:00
parent eda4250533
commit 041617f0b4
9 changed files with 228 additions and 8 deletions
@@ -140,6 +140,7 @@
var insert = function() { return Dand.textNode( "" ); };
var ModLevels = [];
var BindingBox = null;
ModLevels.Cands = function() { return ModLevels[0][0]; };
ModLevels.Action = function() { return ModLevels[0][1]; };
@@ -232,11 +233,11 @@
if( v == "" )
{
insert = function() { return Dand.textNode( "`" ); };
sender.BindingBox.close( true );
BindingBox.close( true );
break;
}
sender.BindingBox.close();
BindingBox.close();
// Insert the code snippet with inline flag
visualizer.insertSnippet( "code", { "inline": "on", "lang": "plain", "value": v } );
break;
@@ -249,7 +250,7 @@
if( ModLevels.Cands().Empty && 1 < ModLevels.length )
{
ModLevels.Action()( sender.value.substr( 1 ) );
sender.BindingBox.close();
BindingBox.close();
break;
}
@@ -259,19 +260,19 @@
{
insert = undefined;
var close = ModLevels.Action()( selected.getDAttribute( "key" ) );
if( close ) sender.BindingBox.close();
if( close ) BindingBox.close();
}
else
{
// Insert this text directly
var v = Dand.textNode( sender.value.substr( 1 ) );
insert = function() { return v; };
sender.BindingBox.close( true );
BindingBox.close( true );
}
break;
case 27: // Esc
sender.BindingBox.close();
BindingBox.close();
break;
case 9: // Tab
@@ -389,6 +390,7 @@
title( true );
stage()[0].value = "`";
stage()[0].setAttribute( "placeholder", ModLevels.Cands().desc );
BindingBox.show();
}
};
@@ -396,7 +398,7 @@
{
if( ModLevels.length == 1 )
{
sender.BindingBox.close();
BindingBox.close();
destructor.Destruct();
}
@@ -414,6 +416,7 @@
input.selectionStart = 1;
input.selectionEnd = input.value.length;
BindingBox.show();
}
};
@@ -434,7 +437,7 @@
MsgBox.show();
var Command = stage()[0];
Command.BindingBox = MsgBox;
BindingBox = MsgBox;
Command.focus();