OSDN Git Service

Ver 0.5.9.2
[nucleus-jp/nucleus-plugins.git] / trunk / NP_MitasNom / mitasnom / editor / plugins / nucleus / fckplugin.js
1 /*
2  * NucleusTag plugin for FCKeditor
3  * The license of this file is GPL.
4  */
5
6 // Nucleus Tag
7 var FCKNucleusTagProcessor = new Object() ;
8 FCKNucleusTagProcessor.ProcessDocument = function( document )
9 {
10         var aLinks = document.getElementsByTagName( 'mitasnom' ) ;
11         var oLink ;
12         var i = aLinks.length - 1 ;
13         while ( i >= 0 && ( oLink = aLinks[i--] ) ) {
14                 if (oLink.title=='nucleustag') {
15                         var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__NucleusTag', oLink.cloneNode(true) ) ;
16                         oImg.setAttribute( '_fcknucleustag', 'true', 0 ) ;
17                         oLink.parentNode.insertBefore( oImg, oLink ) ;
18                         oLink.parentNode.removeChild( oLink ) ;
19                 }
20         }
21 }
22
23 FCKDocumentProcessors.addItem( FCKNucleusTagProcessor ) ;
24
25 // Refresh the document
26 FCK.SetHTML( FCK.GetXHTML( FCKConfig.FormatSource ), true ) ;