"use strict";(function(){tinymce.PluginManager.requireLangPack('insert_tag');tinymce.create('tinymce.plugins.Insert_tagPlugin',{init:function(ed,url){var placeCursor=function(){ed.selection.select(ed.dom.select('span#remove_me')[0]);ed.dom.remove(ed.dom.select('span#remove_me')[0])};var insertionFunction=function(insertionString){return function(){if(ed.selection.isCollapsed()){ed.selection.setContent('['+insertionString+']<span id="remove_me"></span>[/'+insertionString+']');placeCursor()}else{ed.selection.setContent('['+insertionString+']'+ed.selection.getContent()+'[/'+insertionString+']')}}};ed.addCommand('mceInsertTermTag',insertionFunction("?"));ed.addButton('insert_term_tag',{title:'insert_tag.termdesc',cmd:'mceInsertTermTag',image:url+'/img/term.png'});ed.addCommand('mceInsertCodeTag',insertionFunction("code"));ed.addButton('insert_code_tag',{title:'insert_tag.codedesc',cmd:'mceInsertCodeTag',image:url+'/img/code.png'});ed.addCommand('mceInsertTexTag',insertionFunction("tex"));ed.addButton('insert_tex_tag',{title:'insert_tag.texdesc',cmd:'mceInsertTexTag',image:url+'/img/tex.png'});ed.addCommand('mceInsertMediaTag',function(){if(ed.selection.isCollapsed()){ed.selection.setContent('[media|640|480]http://<span id="remove_me"></span>[/media]');placeCursor()}else{ed.selection.setContent('[media|640|480]http://'+ed.selection.getContent()+'[/media]')}});ed.addButton('insert_media_tag',{title:'insert_tag.mediadesc',cmd:'mceInsertMediaTag',image:url+'/img/media.png'})},getInfo:function(){return{longname:'Insert tag plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"0.9beta"}}});tinymce.PluginManager.add('insert_tag',tinymce.plugins.Insert_tagPlugin)})();