Merge ArticleContent & ArticleReference together

This commit is contained in:
斟酌 鵬兄 2016-05-09 15:49:02 +08:00
parent 047d82d3bb
commit a6c6de2407
2 changed files with 18 additions and 25 deletions

View File

@ -1,25 +0,0 @@
(function ()
{
var ns = __namespace( "Astro.Blog.AstroEdit.SmartInput.CandidateAction" );
var ArticleRefs = ns[ NS_INVOKE ]( "ArticleReference" );
/** @type {Astro.Blog.AstroEdit.SmartInput.ICandidateAction} */
var ArticleContent = function ( visualizer, key )
{
ArticleRefs.call( this, visualizer, key );
};
__extends( ArticleContent, ArticleRefs );
ArticleContent.prototype.Process = function( key )
{
var cand = this.__cands[ key ];
if( !cand ) return false;
this.visualizer.insertSnippet( "articlecontent", { value: cand.id } );
return true;
};
ns[ NS_EXPORT ]( EX_CLASS, "ArticleContent", ArticleContent );
})();

View File

@ -49,5 +49,23 @@
return sender.value == "" && e.keyCode == 8; // Backspace return sender.value == "" && e.keyCode == 8; // Backspace
}; };
/** @type {Astro.Blog.AstroEdit.SmartInput.ICandidateAction} */
var ArticleContent = function ( visualizer, key )
{
ArticleRefs.call( this, visualizer, key );
};
__extends( ArticleContent, ArticleRefs );
ArticleContent.prototype.Process = function( key )
{
var cand = this.__cands[ key ];
if( !cand ) return false;
this.visualizer.insertSnippet( "articlecontent", { value: cand.id } );
return true;
};
ns[ NS_EXPORT ]( EX_CLASS, "ArticleContent", ArticleContent );
ns[ NS_EXPORT ]( EX_CLASS, "ArticleReference", ArticleRefs ); ns[ NS_EXPORT ]( EX_CLASS, "ArticleReference", ArticleRefs );
})(); })();