Changeset 442 for trunk/plugins


Ignore:
Timestamp:
12/22/05 12:05:50 (14 years ago)
Author:
gocher
Message:

Ticket #622
At first preparing the mistake: If you click outside of the editor area before clicking on the button to launch the plugin, it will paste the HTML outside the editor.
And further change the plugin that the css is loaded on generating the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/InsertSnippet/insert-snippet.js

    r439 r442  
    5454}; 
    5555 
     56InsertSnippet.prototype.onGenerate = function() { 
     57  var style_id = "IS-style"; 
     58  var style = this.editor._doc.getElementById(style_id); 
     59  if (style == null) { 
     60    style = this.editor._doc.createElement("link"); 
     61    style.id = style_id; 
     62    style.rel = 'stylesheet'; 
     63    style.href = _editor_url + 'plugins/InsertSnippet/InsertSnippet.css'; 
     64    this.editor._doc.getElementsByTagName("HEAD")[0].appendChild(style); 
     65  } 
     66}; 
     67 
    5668HTMLArea.Config.prototype.InsertSnippet = 
    5769{ 
     
    7082                                            
    7183                eval(HTMLArea._geturlcontent(editor.config.InsertSnippet.snippets)); 
     84                editor.focusEditor(); 
    7285                if (param['how'] == 'variable') { 
    7386                        editor.insertHTML('{'+snippets[param["snippetnum"]].id+'}'); 
Note: See TracChangeset for help on using the changeset viewer.