diff --git a/README.txt b/README.txt
deleted file mode 100644
index 72abfba..0000000
--- a/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-wysiwyg_syntaxhl.module is a WYSIWYG plugin that enables the TinyMCE
-syntaxhl plugin, which lets you create .
-
-Drupal module written Clifford Meece (meecect)
-http://cliffordmeece.com
-
-tinyMCE plugin based syntaxhl plugin written by Rich Guk
-http://27smiles.com/
-
diff --git a/plugins/syntaxhl/README b/plugins/syntaxhl/README
new file mode 100644
index 0000000..7ccd3d1
--- /dev/null
+++ b/plugins/syntaxhl/README
@@ -0,0 +1,39 @@
+
+SyntaxHL is a plugin for the Tinymce (http://tinymce.moxiecode.com/) javascript WYSIWYG editor 
+allowing you to insert highlighted code into the editor.
+The syntax highlighting is done using Syntax Highligher 
+(http://code.google.com/p/syntaxhighlighter/) 
+and the plugin simply produces the right syntax for this.
+
+================================================================================
+License
+
+Copyright (c) 2008 Richard Grundy.
+
+TinyMCE is released under the LGPL and therefore so is this plugin.
+
+http://www.opensource.org/licenses/lgpl-license.php
+
+Please feel free to modify the project and send pull requests with improvements, changes are welcome!
+
+If you have any problems at all contact me and I'll do the best I can to help.
+
+http://27smiles.com
+
+================================================================================
+
+Plugin modified in 2009 by Clifford Meece
+http://www.cliffordmeece.com
+
+Changes: 
+
+-Code was added to switch between the <pre> form to the {} form
+of syntaxhighlighter, otherwise, the HTML that is generated has illegal class names
+that conflict with some content filters.
+
+-Code was added to dialog.htm to dynamically discover the tinyMCE popup javascript library using drupal
+helper properties
+
+-Code was added to dialog.htm to dynamically determine the proper language choices based on the Drupal
+syntaxhighlighter module settings.
+
diff --git a/plugins/syntaxhl/dialog.php b/plugins/syntaxhl/dialog.php
new file mode 100755
index 0000000..3ec7307
--- /dev/null
+++ b/plugins/syntaxhl/dialog.php
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#syntaxhl_dlg.title}</title>
+
+	<style type="text/css" media="screen">
+		input {
+			vertical-align: middle;
+		}
+		label {
+			vertical-align: middle;
+		}
+		fieldset {
+			margin-bottom: 10px;
+		}
+	</style>
+<?php
+  $path = $_GET["path"];
+  print " <script type=\"text/javascript\" src=\"$path/tiny_mce_popup.js\"></script>";
+?>
+	<script type="text/javascript" src="js/dialog.js?<?php echo time(); ?>"></script>
+  
+</head>
+<body>
+<form name="syntaxhl" onsubmit="SyntaxHLDialog.insert(); return false;" action="#">
+	<fieldset id="syntaxhl_options">
+		<legend>{#syntaxhl_dlg.highlight_options}</legend>
+		<input type="checkbox" name="syntaxhl_nogutter" id="syntaxhl_nogutter" value="1" /><label for="syntaxhl_nogutter" >{#syntaxhl_dlg.nogutter}</label>	
+		<input type="checkbox" name="syntaxhl_light" id="syntaxhl_light" value="1" /><label for="syntaxhl_light">{#syntaxhl_dlg.light}</label>
+		<input type="checkbox" name="syntaxhl_collapse" id="syntaxhl_collapse" value="1" /><label for="syntaxhl_collapse">{#syntaxhl_dlg.collapse}</label>
+		<label for="syntaxhl_highlight">{#syntaxhl_dlg.highlight}</label><input type="text" name="syntaxhl_highlight" id="syntaxhl_highlight" style="width:50px;" /><br />
+		<label for="syntaxhl_language">{#syntaxhl_dlg.choose_lang}:</label>
+		<select name="syntaxhl_language" id="syntaxhl_language">
+		</select>
+		<label for="syntaxhl_firstline" style="margin-left: 15px;">{#syntaxhl_dlg.first_line}:</label><input type="textfield" name="syntaxhl_firstline" id="syntaxhl_firstline" value="1" style="width:20px;" />
+		<label for="syntaxhl_fontsize">{#syntaxhl_dlg.fontsize}</label><input type="text" name="syntaxhl_fontsize" id="syntaxhl_fontsize" value="100" style="width:25px;" />%
+	</fieldset>
+	<fieldset>
+		<legend>{#syntaxhl_dlg.paste}</legend>
+	<textarea name="syntaxhl_code" id="syntaxhl_code" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" class="mceFocus"></textarea>
+	</fieldset>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="submit" id="insert" name="insert" value="{#insert}" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
diff --git a/plugins/syntaxhl/editor_plugin.js b/plugins/syntaxhl/editor_plugin.js
new file mode 100644
index 0000000..9e9b9fc
--- /dev/null
+++ b/plugins/syntaxhl/editor_plugin.js
@@ -0,0 +1 @@
+(function(){tinymce.PluginManager.requireLangPack("syntaxhl");tinymce.create("tinymce.plugins.SyntaxHL",{init:function(a,b){var c=this;c.editor=a;c.url=b;function d(e){return/^(wysiwyg-syntaxhl)/.test(e.className)}a.addCommand("mceSyntaxHL",function(){a.windowManager.open({file:b+"/dialog.php?path="+escape(tinyMCE.baseURL)+"&random="+Math.random(),width:450+parseInt(a.getLang("syntaxhl.delta_width",0)),height:400+parseInt(a.getLang("syntaxhl.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("syntaxhl",{title:"syntaxhl.desc",cmd:"mceSyntaxHL",image:b+"/img/highlight.gif"});a.onNodeChange.add(function(f,e,h){var g=f.dom.getAttrib(h,"class");e.setActive("syntaxhl",h.nodeName=="PRE"&&g.match(/wysiwyg-syntaxhl/))});a.onInit.add(function(){if(a&&a.plugins.contextmenu){a.plugins.contextmenu.onContextMenu.add(function(h,f,i){var g=a.dom.getAttrib(i,"class");if(i.nodeName=="PRE"&&g.match(/wysiwyg-syntaxhl/)){f.add({title:"Edit Code",icon:"",cmd:"mceSyntax"})}})}});a.onBeforeSetContent.add(function(f,g){var e;if(tinymce.isIE){e="\r\n"}else{e="\n"}g.content=g.content.replace(/(<p>)?(<P>)?{syntaxhighlighter ([^}]*)}/g,'<pre class="wysiwyg-syntaxhl $3">');g.content=g.content.replace(/{\/syntaxhighlighter}(<\/p>)?(<\/P>)?/g,"</pre>")});a.onPostProcess.add(function(l,g){if(g.save){if(!tinymce.isIE){var j=l.dom.select("pre.wysiwyg-syntaxhl");for(var k=0;k<j.length;k++){var e=l.dom.getAttrib(j[k],"class");matchString=l.dom.getOuterHTML(j[k]);if(tinymce.isIE){matchString=matchString.replace(/^<PRE/,"<pre");matchString=matchString.replace(/PRE>$/,"pre>")}var f=g.content.indexOf(matchString);var h=l.dom.getOuterHTML(j[k]).length;e=e.replace(/(wysiwyg-syntaxhl\s*)/g,"");var m="{syntaxhighlighter "+e+"}"+l.dom.encode(c._getText(j[k]))+"{/syntaxhighlighter}";var n=g.content.substr(0,f);var p=g.content.substr(f+h);if(f!=-1){g.content=n+m+p}}}}})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Syntax Highlighter",author:"Clifford Meece",authorurl:"http://cliffordmeece.com",infourl:"http://drupal.org/project/wysiwyg_syntaxhl",version:"1.0"}},_getText:function(c){if(c.nodeType==3){return c.nodeValue}var a=new Array(),b=0;while(c.childNodes[b]){a[a.length]=this._getText(c.childNodes[b]);b++}return a.join("")}});tinymce.PluginManager.add("syntaxhl",tinymce.plugins.SyntaxHL)})();
\ No newline at end of file
diff --git a/plugins/syntaxhl/editor_plugin_src.js b/plugins/syntaxhl/editor_plugin_src.js
new file mode 100755
index 0000000..b4ad53b
--- /dev/null
+++ b/plugins/syntaxhl/editor_plugin_src.js
@@ -0,0 +1,208 @@
+/**
+ * Copied from tinymce example plugin and modifed to suite my needs.
+ *
+ * Clifford Meece
+ * http://cliffordmeece.com
+ * 
+ */
+
+ (function() {
+  // Load the language file.
+  tinymce.PluginManager.requireLangPack('syntaxhl');
+  
+  tinymce.create('tinymce.plugins.SyntaxHL', {
+    /**
+		 * Initializes the plugin, this will be executed after the plugin has been created.
+		 * This call is done before the editor instance has finished it's initialization so use the onInit event
+		 * of the editor instance to intercept that event.
+		 *
+		 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+		 * @param {string} url Absolute URL to where the plugin is located.
+		 */
+    init: function(ed, url) {
+      var t = this;
+ 
+      t.editor = ed;
+      t.url = url;
+      
+      function isSyntaxElm(n) {
+        return /^(wysiwyg-syntaxhl)/.test(n.className);
+      };
+      
+      // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+      ed.addCommand('mceSyntaxHL',
+      function() {
+        ed.windowManager.open({
+          file: url + '/dialog.php?path=' + escape(tinyMCE.baseURL) + '&random=' + Math.random(),
+          width: 450 + parseInt(ed.getLang('syntaxhl.delta_width', 0)),
+          height: 400 + parseInt(ed.getLang('syntaxhl.delta_height', 0)),
+          inline: 1
+        },
+        {
+          plugin_url: url
+          // Plugin absolute URL
+        });
+      });
+
+      // Register button
+      ed.addButton('syntaxhl', {
+        title: 'syntaxhl.desc',
+        cmd: 'mceSyntaxHL',
+        image: url + '/img/highlight.gif'
+      });
+
+      // Add a node change handler, selects the button in the UI when a <pre> element is selected
+      ed.onNodeChange.add(function(ed, cm, n) {
+        var style = ed.dom.getAttrib(n, 'class');
+        cm.setActive('syntaxhl', n.nodeName == 'PRE' && style.match(/wysiwyg-syntaxhl/));
+      });
+
+      // Fixme not all pre tags or even any pre tags
+      ed.onInit.add(function() {
+        if (ed && ed.plugins.contextmenu) {
+          ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
+            var style = ed.dom.getAttrib(e, 'class');
+            if (e.nodeName == 'PRE' && style.match(/wysiwyg-syntaxhl/)) {
+              m.add({
+                title: 'Edit Code',
+                icon: '',
+                cmd: 'mceSyntax'
+              });
+            }
+          });
+        }
+      });
+      
+      // convert any {}-macro tags to pre's
+      //ed.onBeforeSetContent.add(t._macroToPre, t);
+      ed.onBeforeSetContent.add(
+        function(ed, o) {
+          //console.log('before set');
+          
+          var nlChar;
+          if (tinymce.isIE)
+            nlChar = '\r\n';
+          else
+            nlChar = '\n';
+            
+          o.content = o.content.replace(/(<p>)?(<P>)?{syntaxhighlighter ([^}]*)}/g, '<pre class="wysiwyg-syntaxhl $3">');
+          o.content = o.content.replace(/{\/syntaxhighlighter}(<\/p>)?(<\/P>)?/g, '</pre>');
+        }
+      );
+      
+      ed.onPostProcess.add(
+        function(ed, o) {
+          //console.log('doing postprocess');
+          if (o.save) {
+            if (!tinymce.isIE) {
+              // IE is collapsing newlines somewhere, so I only to the pre-to-macro 
+              // conversion for non-ie browsers
+              
+              // This basic regex works, but it would match every non syntaxhl </pre> element
+              //o.content = o.content.replace(/<pre class="wysiwyg-syntaxhl ([^"]*)">/g,'{syntaxhighlighter $1}' );
+              //o.content = o.content.replace(/<\/pre>/g,'{/syntaxhighlighter}' );
+              // better to use dom utilities...
+              var syntaxElements = ed.dom.select('pre.wysiwyg-syntaxhl');
+              //console.log(syntaxElements);
+
+              for (var i = 0; i < syntaxElements.length; i++) {
+                //console.log('in loop');
+                //console.log('element:' + syntaxElements[i]);
+                //console.log(syntaxElements[i].toString());
+                //console.log(syntaxElements[i]);
+                //console.log(ed.dom.getOuterHTML(syntaxElements[i]));
+                //console.log('element text: '+ t._getText(syntaxElements[i]));
+                var style = ed.dom.getAttrib(syntaxElements[i], 'class');
+
+                matchString = ed.dom.getOuterHTML(syntaxElements[i]);
+                if (tinymce.isIE) {
+                  //console.log('is ie');
+                  matchString = matchString.replace(/^<PRE/, '<pre' );
+                  matchString = matchString.replace(/PRE>$/, 'pre>' );
+                } 
+                //console.log('matchString: '+ matchString);
+                var start = o.content.indexOf(matchString);
+                //var start = o.content.indexOf(t._getText(syntaxElements[i]));
+                //console.log('match starts on: ' + start);
+
+                var length = ed.dom.getOuterHTML(syntaxElements[i]).length;
+                //var length = t._getText(syntaxElements[i]).length;
+                //console.log('length of match is: ' + length );
+
+                style = style.replace(/(wysiwyg-syntaxhl\s*)/g, '');
+
+                // always use the _getText function, because innerHTML causes ie to remove whitespace
+                var macroString = '{syntaxhighlighter ' + style + '}' + ed.dom.encode(t._getText(syntaxElements[i])) + '{/syntaxhighlighter}';
+                //console.log("macro:" + macroString);
+
+                var startString = o.content.substr(0, start);
+                var endString = o.content.substr(start+length);
+
+                if (start != -1) {
+                  o.content = startString + macroString + endString;
+                } 
+
+                // The below should be all I need, but it doesn't work, which is why I jump through all the hoops above.
+                // I suspect it is because at this point in the program flow, using the domutils form the tinyMCE
+                // library no longer update o.content, so whatever I need to do, I need to do directly to
+                // o.content
+                //ed.dom.setOuterHTML(syntaxElements[i], macroString);
+              }
+            }
+          }
+        }
+      );
+
+      //ed.onSaveContent.add(function(ed, o) {
+      //  window.alert('on savecontent');
+      //});
+    },
+
+    /**
+		 * Creates control instances based in the incomming name. This method is normally not
+		 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
+		 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
+		 * method can be used to create those.
+		 *
+		 * @param {String} n Name of the control to create.
+		 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
+		 * @return {tinymce.ui.Control} New control instance or null if no control was created.
+		 */
+    createControl: function(n, cm) {
+      return null;
+    },
+
+    /**
+		 * Returns information about the plugin as a name/value array.
+		 * The current keys are longname, author, authorurl, infourl and version.
+		 *
+		 * @return {Object} Name/value array containing information about the plugin.
+		 */
+    getInfo: function() {
+      return {
+        longname: 'Syntax Highlighter',
+        author: 'Clifford Meece',
+        authorurl: 'http://cliffordmeece.com',
+        infourl: 'http://drupal.org/project/wysiwyg_syntaxhl',
+        version: "1.0"
+      };
+    },
+
+    _getText: function(obj) {
+      // return the data of obj if its a text node
+      if (obj.nodeType == 3) return obj.nodeValue;
+      var txt = new Array(),
+      i = 0;
+      // loop over the children of obj and recursively pass them back to this function
+      while (obj.childNodes[i]) {
+        txt[txt.length] = this._getText(obj.childNodes[i]);
+        i++;
+      }
+      // return the array as a string
+      return txt.join("");
+    }
+  });
+
+  // Register plugin
+  tinymce.PluginManager.add('syntaxhl', tinymce.plugins.SyntaxHL);
+})();
\ No newline at end of file
diff --git a/plugins/syntaxhl/img/highlight.gif b/plugins/syntaxhl/img/highlight.gif
new file mode 100755
index 0000000..9e5ce04
Binary files /dev/null and b/plugins/syntaxhl/img/highlight.gif differ
diff --git a/plugins/syntaxhl/js/dialog.js b/plugins/syntaxhl/js/dialog.js
new file mode 100755
index 0000000..7480b54
--- /dev/null
+++ b/plugins/syntaxhl/js/dialog.js
@@ -0,0 +1,162 @@
+tinyMCEPopup.requireLangPack();
+var SyntaxHLDialog = {
+
+
+  init : function() {
+
+    var f = document.forms[0], textarea_output, options = '';
+    ed = tinyMCEPopup.editor;
+    n = ed.selection.getNode();
+    var languages;
+    if (ed && ed.plugins.inlinepopups) {
+      languages = parent.Drupal.settings.wysiwyg_syntaxhl.languages;
+    } else {
+      languages = window.opener.Drupal.settings.wysiwyg_syntaxhl.languages;
+    }
+      
+    for (i=0; i < languages.length;++i){
+      var optn = document.createElement("OPTION");
+      optn.text = languages[i]['text'];
+      optn.value = languages[i]['value'];
+      document.syntaxhl.syntaxhl_language.options.add(optn);
+    }
+    
+    if (n.nodeName == 'PRE') {
+      // remove placeholder class name and split remaining portion by ';'
+      var style = ed.dom.getAttrib(n, 'class');
+      style = style.replace(/wysiwyg-syntaxhl\s*/g,'')
+      var a = style.split(';');
+      for (var i = 0; i < a.length; i++) {
+        // Remove unnecessary whitespace
+        a[i] = a[i].replace(/\s+/g, ''); 
+        if (a[i] != '') {
+          // split name and value pairs
+          var b = a[i].split(':');
+          switch (b[0]) {
+      			case "brush":
+      			  // loop through select box looking for proper place to put selected index
+              for (var j=0; j < f.syntaxhl_language.options.length; j++) {
+            		if (f.syntaxhl_language.options[j].value == b[1]) {
+            			f.syntaxhl_language.selectedIndex = j;
+            		}
+            	} 
+            break;			
+      			case "first-line":
+      			  f.syntaxhl_firstline.value = b[1];
+    			  break;
+      			case "fontsize":
+      			  f.syntaxhl_fontsize.value = b[1];
+    			  break;
+      			case "gutter":
+      			  if (b[1] == 'true' ) {
+      			    f.syntaxhl_nogutter.checked = false;
+      			  } else if (b[1] == 'false' ) {
+      			    f.syntaxhl_nogutter.checked = true;
+      			  } else {f.syntaxhl_nogutter.checked = false;}
+    			  break;
+      			case "light":
+      			  if (b[1] == 'true' ) {
+      			    f.syntaxhl_light.checked = true;
+      			  } else if (b[1] == 'false' ) {
+      			    f.syntaxhl_light.checked = false;
+      			  } else {f.syntaxhl_light.checked = false;}
+    			  break;
+      			case "collapse":
+      			  if (b[1] == 'true' ) {
+      			    f.syntaxhl_collapse.checked = true;
+      			  } else if (b[1] == 'false' ) {
+      			    f.syntaxhl_collapse.checked = false;
+      			  } else {f.syntaxhl_collapse.checked = false;}
+    			  break;
+      			case "highlight":
+      			  f.syntaxhl_highlight.value = b[1];
+      			break;
+      		}        
+        }     
+      }
+            
+      // this is a total hack, but by running getContent, we force the 
+      // preelementfix plugin to do it's cleanup routine
+      // which fixes any <br> or tabs that may be in our pre elements.
+      // The preelementfix plugin should probably do this work on the 
+      // selection.getContent event as well, which would take care of it for us,
+      // but it doesn't so we have to grab the whole content, which incidentally, will
+      // clean all the pre's on the page, not just the one we are selecting
+      // the other option is we implement the <br> conversion ourselves, but
+      // I had a hell of time figuring out how to do that on just a selection
+      ed.getContent();
+      // FIXME, this may cause ie to modify the content when setting textarea value 
+      // and screwing up whitespace
+      f.syntaxhl_code.value = ed.dom.decode(this._getText(n));
+
+
+    }// end if (fe.nodeName == 'PRE')
+    
+  },
+  
+  insert : function() {
+    var n, f = document.forms[0], textarea_output, options = '';
+
+    tinyMCEPopup.restoreSelection();
+    n = ed.selection.getNode();
+
+    if(f.syntaxhl_nogutter.checked) {
+      options += 'gutter: false; ';
+    }
+    if(f.syntaxhl_light.checked) {
+      options += 'light: true; ';
+    }
+    if(f.syntaxhl_collapse.checked) {
+      options += 'collapse: true; ';
+    }
+    if(f.syntaxhl_fontsize.value != '') {
+      var fontsize=parseInt(f.syntaxhl_fontsize.value);
+      options += 'fontsize: ' + fontsize + '; ';
+    }
+    if(f.syntaxhl_firstline.value != '') {
+      var linenumber = parseInt(f.syntaxhl_firstline.value);
+      options += 'first-line: ' + linenumber + '; ';
+    }
+    if(f.syntaxhl_highlight.value != '') {
+      options += 'highlight: [' + f.syntaxhl_highlight.value + ']; ';
+    }
+
+    if (n != null && n.nodeName == 'PRE') {
+      style = 'wysiwyg-syntaxhl brush: ' + f.syntaxhl_language.value + ';' + options;
+      ed.dom.setOuterHTML(n,'<pre class="' + style + '">' + ed.dom.encode(f.syntaxhl_code.value)+'</pre>');
+      ed.dom.setAttrib(n,'class',style);
+    } else {      
+      //If no code just return.
+      if(f.syntaxhl_code.value == '') {
+        tinyMCEPopup.close();
+        return false;
+      } else {
+        textarea_output = '<pre class="wysiwyg-syntaxhl brush: ';
+        textarea_output += f.syntaxhl_language.value + ';' + options + '">';
+        textarea_output +=  tinyMCEPopup.editor.dom.encode(f.syntaxhl_code.value);
+        textarea_output += '</pre>'; 
+        tinyMCEPopup.editor.execCommand('mceInsertContent', false, textarea_output);      
+      }
+    }
+    
+    tinyMCEPopup.close();
+
+  },
+  
+  _getText : function(obj) {
+    // return the data of obj if its a text node
+    if (obj.nodeType == 3) return obj.nodeValue;
+    var txt = new Array(),i=0;
+    // loop over the children of obj and recursively pass them back to this function
+    while(obj.childNodes[i]) {
+  		txt[txt.length] = this._getText(obj.childNodes[i]);
+  		i++;
+  	}
+    // return the array as a string
+    return txt.join("");
+  }
+
+  
+};
+
+tinyMCEPopup.onInit.add(SyntaxHLDialog.init, SyntaxHLDialog);
diff --git a/plugins/syntaxhl/langs/en.js b/plugins/syntaxhl/langs/en.js
new file mode 100755
index 0000000..785f41e
--- /dev/null
+++ b/plugins/syntaxhl/langs/en.js
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.syntaxhl',{
+	desc : 'Insert code using Syntaxhighlighter'
+});
diff --git a/plugins/syntaxhl/langs/en_dlg.js b/plugins/syntaxhl/langs/en_dlg.js
new file mode 100755
index 0000000..e3079b4
--- /dev/null
+++ b/plugins/syntaxhl/langs/en_dlg.js
@@ -0,0 +1,12 @@
+tinyMCE.addI18n('en.syntaxhl_dlg',{
+	title : 'Insert code using SyntaxHighlighter',
+	highlight_options : 'Highlighter Options',
+	paste : 'Paste Code',
+	choose_lang : 'Choose Language',
+	nogutter : 'No Gutter',
+	light : 'Light',
+	collapse : 'Collapse',
+	fontsize : 'Font size',
+	first_line : 'First line',
+	highlight : 'Highlight'
+});
diff --git a/plugins/syntaxhl/langs/zh.js b/plugins/syntaxhl/langs/zh.js
new file mode 100755
index 0000000..02af365
--- /dev/null
+++ b/plugins/syntaxhl/langs/zh.js
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('zh.syntaxhl',{
+	desc : '用Syntaxhighlighter插入代码'
+});
diff --git a/plugins/syntaxhl/langs/zh_dlg.js b/plugins/syntaxhl/langs/zh_dlg.js
new file mode 100755
index 0000000..778164f
--- /dev/null
+++ b/plugins/syntaxhl/langs/zh_dlg.js
@@ -0,0 +1,12 @@
+tinyMCE.addI18n('zh.syntaxhl_dlg',{
+	title : '用SyntaxHighlighter插入代码',
+	highlight_options : '高亮选项',
+	paste : '粘贴代码',
+	choose_lang : '选择语言',
+	nogutter : '无装订线',
+	light : '精简模式',
+	collapse : '折叠代码',
+	fontsize : '字体大小',
+	first_line : '起始行的值',
+	highlight : '高亮行'
+});
diff --git a/tinymce/syntaxhl/README b/tinymce/syntaxhl/README
deleted file mode 100644
index 7ccd3d1..0000000
--- a/tinymce/syntaxhl/README
+++ /dev/null
@@ -1,39 +0,0 @@
-
-SyntaxHL is a plugin for the Tinymce (http://tinymce.moxiecode.com/) javascript WYSIWYG editor 
-allowing you to insert highlighted code into the editor.
-The syntax highlighting is done using Syntax Highligher 
-(http://code.google.com/p/syntaxhighlighter/) 
-and the plugin simply produces the right syntax for this.
-
-================================================================================
-License
-
-Copyright (c) 2008 Richard Grundy.
-
-TinyMCE is released under the LGPL and therefore so is this plugin.
-
-http://www.opensource.org/licenses/lgpl-license.php
-
-Please feel free to modify the project and send pull requests with improvements, changes are welcome!
-
-If you have any problems at all contact me and I'll do the best I can to help.
-
-http://27smiles.com
-
-================================================================================
-
-Plugin modified in 2009 by Clifford Meece
-http://www.cliffordmeece.com
-
-Changes: 
-
--Code was added to switch between the <pre> form to the {} form
-of syntaxhighlighter, otherwise, the HTML that is generated has illegal class names
-that conflict with some content filters.
-
--Code was added to dialog.htm to dynamically discover the tinyMCE popup javascript library using drupal
-helper properties
-
--Code was added to dialog.htm to dynamically determine the proper language choices based on the Drupal
-syntaxhighlighter module settings.
-
diff --git a/tinymce/syntaxhl/dialog.php b/tinymce/syntaxhl/dialog.php
deleted file mode 100755
index 3ec7307..0000000
--- a/tinymce/syntaxhl/dialog.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{#syntaxhl_dlg.title}</title>
-
-	<style type="text/css" media="screen">
-		input {
-			vertical-align: middle;
-		}
-		label {
-			vertical-align: middle;
-		}
-		fieldset {
-			margin-bottom: 10px;
-		}
-	</style>
-<?php
-  $path = $_GET["path"];
-  print " <script type=\"text/javascript\" src=\"$path/tiny_mce_popup.js\"></script>";
-?>
-	<script type="text/javascript" src="js/dialog.js?<?php echo time(); ?>"></script>
-  
-</head>
-<body>
-<form name="syntaxhl" onsubmit="SyntaxHLDialog.insert(); return false;" action="#">
-	<fieldset id="syntaxhl_options">
-		<legend>{#syntaxhl_dlg.highlight_options}</legend>
-		<input type="checkbox" name="syntaxhl_nogutter" id="syntaxhl_nogutter" value="1" /><label for="syntaxhl_nogutter" >{#syntaxhl_dlg.nogutter}</label>	
-		<input type="checkbox" name="syntaxhl_light" id="syntaxhl_light" value="1" /><label for="syntaxhl_light">{#syntaxhl_dlg.light}</label>
-		<input type="checkbox" name="syntaxhl_collapse" id="syntaxhl_collapse" value="1" /><label for="syntaxhl_collapse">{#syntaxhl_dlg.collapse}</label>
-		<label for="syntaxhl_highlight">{#syntaxhl_dlg.highlight}</label><input type="text" name="syntaxhl_highlight" id="syntaxhl_highlight" style="width:50px;" /><br />
-		<label for="syntaxhl_language">{#syntaxhl_dlg.choose_lang}:</label>
-		<select name="syntaxhl_language" id="syntaxhl_language">
-		</select>
-		<label for="syntaxhl_firstline" style="margin-left: 15px;">{#syntaxhl_dlg.first_line}:</label><input type="textfield" name="syntaxhl_firstline" id="syntaxhl_firstline" value="1" style="width:20px;" />
-		<label for="syntaxhl_fontsize">{#syntaxhl_dlg.fontsize}</label><input type="text" name="syntaxhl_fontsize" id="syntaxhl_fontsize" value="100" style="width:25px;" />%
-	</fieldset>
-	<fieldset>
-		<legend>{#syntaxhl_dlg.paste}</legend>
-	<textarea name="syntaxhl_code" id="syntaxhl_code" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" class="mceFocus"></textarea>
-	</fieldset>
-	<div class="mceActionPanel">
-		<div style="float: left">
-			<input type="submit" id="insert" name="insert" value="{#insert}" />
-		</div>
-		<div style="float: right">
-			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
-		</div>
-	</div>
-</form>
-</body>
-</html>
diff --git a/tinymce/syntaxhl/editor_plugin.js b/tinymce/syntaxhl/editor_plugin.js
deleted file mode 100644
index 9e9b9fc..0000000
--- a/tinymce/syntaxhl/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.PluginManager.requireLangPack("syntaxhl");tinymce.create("tinymce.plugins.SyntaxHL",{init:function(a,b){var c=this;c.editor=a;c.url=b;function d(e){return/^(wysiwyg-syntaxhl)/.test(e.className)}a.addCommand("mceSyntaxHL",function(){a.windowManager.open({file:b+"/dialog.php?path="+escape(tinyMCE.baseURL)+"&random="+Math.random(),width:450+parseInt(a.getLang("syntaxhl.delta_width",0)),height:400+parseInt(a.getLang("syntaxhl.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("syntaxhl",{title:"syntaxhl.desc",cmd:"mceSyntaxHL",image:b+"/img/highlight.gif"});a.onNodeChange.add(function(f,e,h){var g=f.dom.getAttrib(h,"class");e.setActive("syntaxhl",h.nodeName=="PRE"&&g.match(/wysiwyg-syntaxhl/))});a.onInit.add(function(){if(a&&a.plugins.contextmenu){a.plugins.contextmenu.onContextMenu.add(function(h,f,i){var g=a.dom.getAttrib(i,"class");if(i.nodeName=="PRE"&&g.match(/wysiwyg-syntaxhl/)){f.add({title:"Edit Code",icon:"",cmd:"mceSyntax"})}})}});a.onBeforeSetContent.add(function(f,g){var e;if(tinymce.isIE){e="\r\n"}else{e="\n"}g.content=g.content.replace(/(<p>)?(<P>)?{syntaxhighlighter ([^}]*)}/g,'<pre class="wysiwyg-syntaxhl $3">');g.content=g.content.replace(/{\/syntaxhighlighter}(<\/p>)?(<\/P>)?/g,"</pre>")});a.onPostProcess.add(function(l,g){if(g.save){if(!tinymce.isIE){var j=l.dom.select("pre.wysiwyg-syntaxhl");for(var k=0;k<j.length;k++){var e=l.dom.getAttrib(j[k],"class");matchString=l.dom.getOuterHTML(j[k]);if(tinymce.isIE){matchString=matchString.replace(/^<PRE/,"<pre");matchString=matchString.replace(/PRE>$/,"pre>")}var f=g.content.indexOf(matchString);var h=l.dom.getOuterHTML(j[k]).length;e=e.replace(/(wysiwyg-syntaxhl\s*)/g,"");var m="{syntaxhighlighter "+e+"}"+l.dom.encode(c._getText(j[k]))+"{/syntaxhighlighter}";var n=g.content.substr(0,f);var p=g.content.substr(f+h);if(f!=-1){g.content=n+m+p}}}}})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Syntax Highlighter",author:"Clifford Meece",authorurl:"http://cliffordmeece.com",infourl:"http://drupal.org/project/wysiwyg_syntaxhl",version:"1.0"}},_getText:function(c){if(c.nodeType==3){return c.nodeValue}var a=new Array(),b=0;while(c.childNodes[b]){a[a.length]=this._getText(c.childNodes[b]);b++}return a.join("")}});tinymce.PluginManager.add("syntaxhl",tinymce.plugins.SyntaxHL)})();
\ No newline at end of file
diff --git a/tinymce/syntaxhl/editor_plugin_src.js b/tinymce/syntaxhl/editor_plugin_src.js
deleted file mode 100755
index b4ad53b..0000000
--- a/tinymce/syntaxhl/editor_plugin_src.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/**
- * Copied from tinymce example plugin and modifed to suite my needs.
- *
- * Clifford Meece
- * http://cliffordmeece.com
- * 
- */
-
- (function() {
-  // Load the language file.
-  tinymce.PluginManager.requireLangPack('syntaxhl');
-  
-  tinymce.create('tinymce.plugins.SyntaxHL', {
-    /**
-		 * Initializes the plugin, this will be executed after the plugin has been created.
-		 * This call is done before the editor instance has finished it's initialization so use the onInit event
-		 * of the editor instance to intercept that event.
-		 *
-		 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
-		 * @param {string} url Absolute URL to where the plugin is located.
-		 */
-    init: function(ed, url) {
-      var t = this;
- 
-      t.editor = ed;
-      t.url = url;
-      
-      function isSyntaxElm(n) {
-        return /^(wysiwyg-syntaxhl)/.test(n.className);
-      };
-      
-      // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
-      ed.addCommand('mceSyntaxHL',
-      function() {
-        ed.windowManager.open({
-          file: url + '/dialog.php?path=' + escape(tinyMCE.baseURL) + '&random=' + Math.random(),
-          width: 450 + parseInt(ed.getLang('syntaxhl.delta_width', 0)),
-          height: 400 + parseInt(ed.getLang('syntaxhl.delta_height', 0)),
-          inline: 1
-        },
-        {
-          plugin_url: url
-          // Plugin absolute URL
-        });
-      });
-
-      // Register button
-      ed.addButton('syntaxhl', {
-        title: 'syntaxhl.desc',
-        cmd: 'mceSyntaxHL',
-        image: url + '/img/highlight.gif'
-      });
-
-      // Add a node change handler, selects the button in the UI when a <pre> element is selected
-      ed.onNodeChange.add(function(ed, cm, n) {
-        var style = ed.dom.getAttrib(n, 'class');
-        cm.setActive('syntaxhl', n.nodeName == 'PRE' && style.match(/wysiwyg-syntaxhl/));
-      });
-
-      // Fixme not all pre tags or even any pre tags
-      ed.onInit.add(function() {
-        if (ed && ed.plugins.contextmenu) {
-          ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
-            var style = ed.dom.getAttrib(e, 'class');
-            if (e.nodeName == 'PRE' && style.match(/wysiwyg-syntaxhl/)) {
-              m.add({
-                title: 'Edit Code',
-                icon: '',
-                cmd: 'mceSyntax'
-              });
-            }
-          });
-        }
-      });
-      
-      // convert any {}-macro tags to pre's
-      //ed.onBeforeSetContent.add(t._macroToPre, t);
-      ed.onBeforeSetContent.add(
-        function(ed, o) {
-          //console.log('before set');
-          
-          var nlChar;
-          if (tinymce.isIE)
-            nlChar = '\r\n';
-          else
-            nlChar = '\n';
-            
-          o.content = o.content.replace(/(<p>)?(<P>)?{syntaxhighlighter ([^}]*)}/g, '<pre class="wysiwyg-syntaxhl $3">');
-          o.content = o.content.replace(/{\/syntaxhighlighter}(<\/p>)?(<\/P>)?/g, '</pre>');
-        }
-      );
-      
-      ed.onPostProcess.add(
-        function(ed, o) {
-          //console.log('doing postprocess');
-          if (o.save) {
-            if (!tinymce.isIE) {
-              // IE is collapsing newlines somewhere, so I only to the pre-to-macro 
-              // conversion for non-ie browsers
-              
-              // This basic regex works, but it would match every non syntaxhl </pre> element
-              //o.content = o.content.replace(/<pre class="wysiwyg-syntaxhl ([^"]*)">/g,'{syntaxhighlighter $1}' );
-              //o.content = o.content.replace(/<\/pre>/g,'{/syntaxhighlighter}' );
-              // better to use dom utilities...
-              var syntaxElements = ed.dom.select('pre.wysiwyg-syntaxhl');
-              //console.log(syntaxElements);
-
-              for (var i = 0; i < syntaxElements.length; i++) {
-                //console.log('in loop');
-                //console.log('element:' + syntaxElements[i]);
-                //console.log(syntaxElements[i].toString());
-                //console.log(syntaxElements[i]);
-                //console.log(ed.dom.getOuterHTML(syntaxElements[i]));
-                //console.log('element text: '+ t._getText(syntaxElements[i]));
-                var style = ed.dom.getAttrib(syntaxElements[i], 'class');
-
-                matchString = ed.dom.getOuterHTML(syntaxElements[i]);
-                if (tinymce.isIE) {
-                  //console.log('is ie');
-                  matchString = matchString.replace(/^<PRE/, '<pre' );
-                  matchString = matchString.replace(/PRE>$/, 'pre>' );
-                } 
-                //console.log('matchString: '+ matchString);
-                var start = o.content.indexOf(matchString);
-                //var start = o.content.indexOf(t._getText(syntaxElements[i]));
-                //console.log('match starts on: ' + start);
-
-                var length = ed.dom.getOuterHTML(syntaxElements[i]).length;
-                //var length = t._getText(syntaxElements[i]).length;
-                //console.log('length of match is: ' + length );
-
-                style = style.replace(/(wysiwyg-syntaxhl\s*)/g, '');
-
-                // always use the _getText function, because innerHTML causes ie to remove whitespace
-                var macroString = '{syntaxhighlighter ' + style + '}' + ed.dom.encode(t._getText(syntaxElements[i])) + '{/syntaxhighlighter}';
-                //console.log("macro:" + macroString);
-
-                var startString = o.content.substr(0, start);
-                var endString = o.content.substr(start+length);
-
-                if (start != -1) {
-                  o.content = startString + macroString + endString;
-                } 
-
-                // The below should be all I need, but it doesn't work, which is why I jump through all the hoops above.
-                // I suspect it is because at this point in the program flow, using the domutils form the tinyMCE
-                // library no longer update o.content, so whatever I need to do, I need to do directly to
-                // o.content
-                //ed.dom.setOuterHTML(syntaxElements[i], macroString);
-              }
-            }
-          }
-        }
-      );
-
-      //ed.onSaveContent.add(function(ed, o) {
-      //  window.alert('on savecontent');
-      //});
-    },
-
-    /**
-		 * Creates control instances based in the incomming name. This method is normally not
-		 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
-		 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
-		 * method can be used to create those.
-		 *
-		 * @param {String} n Name of the control to create.
-		 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
-		 * @return {tinymce.ui.Control} New control instance or null if no control was created.
-		 */
-    createControl: function(n, cm) {
-      return null;
-    },
-
-    /**
-		 * Returns information about the plugin as a name/value array.
-		 * The current keys are longname, author, authorurl, infourl and version.
-		 *
-		 * @return {Object} Name/value array containing information about the plugin.
-		 */
-    getInfo: function() {
-      return {
-        longname: 'Syntax Highlighter',
-        author: 'Clifford Meece',
-        authorurl: 'http://cliffordmeece.com',
-        infourl: 'http://drupal.org/project/wysiwyg_syntaxhl',
-        version: "1.0"
-      };
-    },
-
-    _getText: function(obj) {
-      // return the data of obj if its a text node
-      if (obj.nodeType == 3) return obj.nodeValue;
-      var txt = new Array(),
-      i = 0;
-      // loop over the children of obj and recursively pass them back to this function
-      while (obj.childNodes[i]) {
-        txt[txt.length] = this._getText(obj.childNodes[i]);
-        i++;
-      }
-      // return the array as a string
-      return txt.join("");
-    }
-  });
-
-  // Register plugin
-  tinymce.PluginManager.add('syntaxhl', tinymce.plugins.SyntaxHL);
-})();
\ No newline at end of file
diff --git a/tinymce/syntaxhl/img/highlight.gif b/tinymce/syntaxhl/img/highlight.gif
deleted file mode 100755
index 9e5ce04..0000000
Binary files a/tinymce/syntaxhl/img/highlight.gif and /dev/null differ
diff --git a/tinymce/syntaxhl/js/dialog.js b/tinymce/syntaxhl/js/dialog.js
deleted file mode 100755
index 7480b54..0000000
--- a/tinymce/syntaxhl/js/dialog.js
+++ /dev/null
@@ -1,162 +0,0 @@
-tinyMCEPopup.requireLangPack();
-var SyntaxHLDialog = {
-
-
-  init : function() {
-
-    var f = document.forms[0], textarea_output, options = '';
-    ed = tinyMCEPopup.editor;
-    n = ed.selection.getNode();
-    var languages;
-    if (ed && ed.plugins.inlinepopups) {
-      languages = parent.Drupal.settings.wysiwyg_syntaxhl.languages;
-    } else {
-      languages = window.opener.Drupal.settings.wysiwyg_syntaxhl.languages;
-    }
-      
-    for (i=0; i < languages.length;++i){
-      var optn = document.createElement("OPTION");
-      optn.text = languages[i]['text'];
-      optn.value = languages[i]['value'];
-      document.syntaxhl.syntaxhl_language.options.add(optn);
-    }
-    
-    if (n.nodeName == 'PRE') {
-      // remove placeholder class name and split remaining portion by ';'
-      var style = ed.dom.getAttrib(n, 'class');
-      style = style.replace(/wysiwyg-syntaxhl\s*/g,'')
-      var a = style.split(';');
-      for (var i = 0; i < a.length; i++) {
-        // Remove unnecessary whitespace
-        a[i] = a[i].replace(/\s+/g, ''); 
-        if (a[i] != '') {
-          // split name and value pairs
-          var b = a[i].split(':');
-          switch (b[0]) {
-      			case "brush":
-      			  // loop through select box looking for proper place to put selected index
-              for (var j=0; j < f.syntaxhl_language.options.length; j++) {
-            		if (f.syntaxhl_language.options[j].value == b[1]) {
-            			f.syntaxhl_language.selectedIndex = j;
-            		}
-            	} 
-            break;			
-      			case "first-line":
-      			  f.syntaxhl_firstline.value = b[1];
-    			  break;
-      			case "fontsize":
-      			  f.syntaxhl_fontsize.value = b[1];
-    			  break;
-      			case "gutter":
-      			  if (b[1] == 'true' ) {
-      			    f.syntaxhl_nogutter.checked = false;
-      			  } else if (b[1] == 'false' ) {
-      			    f.syntaxhl_nogutter.checked = true;
-      			  } else {f.syntaxhl_nogutter.checked = false;}
-    			  break;
-      			case "light":
-      			  if (b[1] == 'true' ) {
-      			    f.syntaxhl_light.checked = true;
-      			  } else if (b[1] == 'false' ) {
-      			    f.syntaxhl_light.checked = false;
-      			  } else {f.syntaxhl_light.checked = false;}
-    			  break;
-      			case "collapse":
-      			  if (b[1] == 'true' ) {
-      			    f.syntaxhl_collapse.checked = true;
-      			  } else if (b[1] == 'false' ) {
-      			    f.syntaxhl_collapse.checked = false;
-      			  } else {f.syntaxhl_collapse.checked = false;}
-    			  break;
-      			case "highlight":
-      			  f.syntaxhl_highlight.value = b[1];
-      			break;
-      		}        
-        }     
-      }
-            
-      // this is a total hack, but by running getContent, we force the 
-      // preelementfix plugin to do it's cleanup routine
-      // which fixes any <br> or tabs that may be in our pre elements.
-      // The preelementfix plugin should probably do this work on the 
-      // selection.getContent event as well, which would take care of it for us,
-      // but it doesn't so we have to grab the whole content, which incidentally, will
-      // clean all the pre's on the page, not just the one we are selecting
-      // the other option is we implement the <br> conversion ourselves, but
-      // I had a hell of time figuring out how to do that on just a selection
-      ed.getContent();
-      // FIXME, this may cause ie to modify the content when setting textarea value 
-      // and screwing up whitespace
-      f.syntaxhl_code.value = ed.dom.decode(this._getText(n));
-
-
-    }// end if (fe.nodeName == 'PRE')
-    
-  },
-  
-  insert : function() {
-    var n, f = document.forms[0], textarea_output, options = '';
-
-    tinyMCEPopup.restoreSelection();
-    n = ed.selection.getNode();
-
-    if(f.syntaxhl_nogutter.checked) {
-      options += 'gutter: false; ';
-    }
-    if(f.syntaxhl_light.checked) {
-      options += 'light: true; ';
-    }
-    if(f.syntaxhl_collapse.checked) {
-      options += 'collapse: true; ';
-    }
-    if(f.syntaxhl_fontsize.value != '') {
-      var fontsize=parseInt(f.syntaxhl_fontsize.value);
-      options += 'fontsize: ' + fontsize + '; ';
-    }
-    if(f.syntaxhl_firstline.value != '') {
-      var linenumber = parseInt(f.syntaxhl_firstline.value);
-      options += 'first-line: ' + linenumber + '; ';
-    }
-    if(f.syntaxhl_highlight.value != '') {
-      options += 'highlight: [' + f.syntaxhl_highlight.value + ']; ';
-    }
-
-    if (n != null && n.nodeName == 'PRE') {
-      style = 'wysiwyg-syntaxhl brush: ' + f.syntaxhl_language.value + ';' + options;
-      ed.dom.setOuterHTML(n,'<pre class="' + style + '">' + ed.dom.encode(f.syntaxhl_code.value)+'</pre>');
-      ed.dom.setAttrib(n,'class',style);
-    } else {      
-      //If no code just return.
-      if(f.syntaxhl_code.value == '') {
-        tinyMCEPopup.close();
-        return false;
-      } else {
-        textarea_output = '<pre class="wysiwyg-syntaxhl brush: ';
-        textarea_output += f.syntaxhl_language.value + ';' + options + '">';
-        textarea_output +=  tinyMCEPopup.editor.dom.encode(f.syntaxhl_code.value);
-        textarea_output += '</pre>'; 
-        tinyMCEPopup.editor.execCommand('mceInsertContent', false, textarea_output);      
-      }
-    }
-    
-    tinyMCEPopup.close();
-
-  },
-  
-  _getText : function(obj) {
-    // return the data of obj if its a text node
-    if (obj.nodeType == 3) return obj.nodeValue;
-    var txt = new Array(),i=0;
-    // loop over the children of obj and recursively pass them back to this function
-    while(obj.childNodes[i]) {
-  		txt[txt.length] = this._getText(obj.childNodes[i]);
-  		i++;
-  	}
-    // return the array as a string
-    return txt.join("");
-  }
-
-  
-};
-
-tinyMCEPopup.onInit.add(SyntaxHLDialog.init, SyntaxHLDialog);
diff --git a/tinymce/syntaxhl/langs/en.js b/tinymce/syntaxhl/langs/en.js
deleted file mode 100755
index 785f41e..0000000
--- a/tinymce/syntaxhl/langs/en.js
+++ /dev/null
@@ -1,3 +0,0 @@
-tinyMCE.addI18n('en.syntaxhl',{
-	desc : 'Insert code using Syntaxhighlighter'
-});
diff --git a/tinymce/syntaxhl/langs/en_dlg.js b/tinymce/syntaxhl/langs/en_dlg.js
deleted file mode 100755
index e3079b4..0000000
--- a/tinymce/syntaxhl/langs/en_dlg.js
+++ /dev/null
@@ -1,12 +0,0 @@
-tinyMCE.addI18n('en.syntaxhl_dlg',{
-	title : 'Insert code using SyntaxHighlighter',
-	highlight_options : 'Highlighter Options',
-	paste : 'Paste Code',
-	choose_lang : 'Choose Language',
-	nogutter : 'No Gutter',
-	light : 'Light',
-	collapse : 'Collapse',
-	fontsize : 'Font size',
-	first_line : 'First line',
-	highlight : 'Highlight'
-});
diff --git a/tinymce/syntaxhl/langs/zh.js b/tinymce/syntaxhl/langs/zh.js
deleted file mode 100755
index 02af365..0000000
--- a/tinymce/syntaxhl/langs/zh.js
+++ /dev/null
@@ -1,3 +0,0 @@
-tinyMCE.addI18n('zh.syntaxhl',{
-	desc : '用Syntaxhighlighter插入代码'
-});
diff --git a/tinymce/syntaxhl/langs/zh_dlg.js b/tinymce/syntaxhl/langs/zh_dlg.js
deleted file mode 100755
index 778164f..0000000
--- a/tinymce/syntaxhl/langs/zh_dlg.js
+++ /dev/null
@@ -1,12 +0,0 @@
-tinyMCE.addI18n('zh.syntaxhl_dlg',{
-	title : '用SyntaxHighlighter插入代码',
-	highlight_options : '高亮选项',
-	paste : '粘贴代码',
-	choose_lang : '选择语言',
-	nogutter : '无装订线',
-	light : '精简模式',
-	collapse : '折叠代码',
-	fontsize : '字体大小',
-	first_line : '起始行的值',
-	highlight : '高亮行'
-});
diff --git a/wysiwyg_syntaxhl.info b/wysiwyg_syntaxhl.info
index 7720886..3d818f0 100644
--- a/wysiwyg_syntaxhl.info
+++ b/wysiwyg_syntaxhl.info
@@ -1,7 +1,6 @@
 name = "Wysiwyg SyntaxHighlighter Plugin"
 description = "Wysiwyg editor plugin that integrates syntax highlighting into a normal &lt;pre&gt; element"
 dependencies[] = wysiwyg
-;dependencies[] = wysiwyg_preelementfix
 dependencies[] = syntaxhighlighter
 package = "User interface"
-core = 6.x
+core = 7.x
\ No newline at end of file
diff --git a/wysiwyg_syntaxhl.module b/wysiwyg_syntaxhl.module
index 40bc7c9..966671d 100644
--- a/wysiwyg_syntaxhl.module
+++ b/wysiwyg_syntaxhl.module
@@ -19,34 +19,81 @@ function wysiwyg_syntaxhl_help($path, $arg) {
 * Implementation of hook_wysiwyg_plugin().
 */
 function wysiwyg_syntaxhl_wysiwyg_plugin($editor) {
-  // The folowing variable is needed to make sure drupal_add_js isn't called twice
-  // taken from the example in imce.module
-  static $integrated;
+  
+  
   switch ($editor) {
-    case 'tinymce':
-      if (!isset($integrated)) {
-        $integrated = TRUE;
-        $languages=array();
-        foreach ( variable_get('syntaxhighlighter_enabled_languages', array('shBrushPhp.js')) as $ind=>$val) {
-          if ($val) {
-            $languages[]=array('value' => strtolower(substr(substr($ind, 7),0,-3)), 
-              'text' => substr(substr($val, 7),0,-3)
-            );            
+    case 'tinymce':     
+      
+      
+      $path = drupal_get_path('module', 'wysiwyg_syntaxhl') . '/plugins/syntaxhl';
+      if (file_exists("$path/editor_plugin.js")) {
+        
+        static $js_added = FALSE;
+        
+        if (!$js_added) {
+          $js_added = TRUE;
+                             
+          $libs = variable_get('syntaxhighlighter_enabled_languages', array('shBrushPhp.js'));        
+          $libs = array_filter($libs);
+          
+          foreach ($libs as $lib) {
+            $str = str_replace('shBrush', '', $lib);
+            $str = str_replace('.js', '', $str);
+            
+            $langs[] = array(
+              'value' => drupal_strtolower($str),
+              'text' => $str,
+            );                    
           }
+          
+          if ($langs) {
+            $settings = array(
+              'wysiwyg_syntaxhl' => array(
+                'languages' => $langs,
+              ),
+            );
+            
+            drupal_add_js($settings, 'setting');
+          }
+          
         }
-        $settings = array(
-          'wysiwyg_syntaxhl' =>  array('languages' => $languages)
+                      
+        return array(
+          'syntaxhl' => array(
+            'path' => $path,
+            'filename' => 'editor_plugin.js',
+            'buttons' => array('syntaxhl' => t('SyntaxHighlighter')),
+            'url' => 'http://drupal.org/project/wysiwyg_syntaxhl',
+            'internal' => FALSE, 
+            'load' => TRUE,
+          ),
         );
-      drupal_add_js($settings, 'setting');
-    }
-    $path = drupal_get_path('module', 'wysiwyg_syntaxhl') . '/tinymce/syntaxhl/editor_plugin.js';
-    return array(
-        'syntaxhl' => array(
-          'path' => $path,
-          'buttons' => array('syntaxhl' => t('SyntaxHighlighter')),
-          'url' => 'http://drupal.org/project/wysiwyg_syntaxhl',
-          'load' => TRUE,
-        ),
-    );
+      }
+    
+    
   }
 }
+
+function wysiwyg_syntaxhl_wysiwyg_include_directory($type) {
+
+  switch ($type) {
+    case 'plugins':
+      return $type;
+  }
+}
+
+
+function wysiwyg_syntaxhl_wysiwyg_editor_settings_alter(&$settings, $context) {
+
+  
+  // Each editor has its own collection of native settings that may be extended
+  // or overridden. Please consult the respective official vendor documentation
+  // for details.
+  if ($context['profile']->editor == 'tinymce') {
+    // Supported values to JSON data types.
+   // $settings['cleanup_on_startup'] = TRUE;
+  }
+}
+
+
+
