Skip to content

Commit

Permalink
Tightened up a loose variable.
Browse files Browse the repository at this point in the history
This was called out by the Mozilla review.
  • Loading branch information
adam-p committed Aug 8, 2012
1 parent 42421a4 commit c6eafd7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/firefox/chrome/content/ff-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
* rendering services.
*/

var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);

Components.utils.import('resource://common/markdown-here.js');


var markdown_here = {

// Components.utils is somewhat more performant than mozIJSSubScriptLoader, so
// we'll use it when possible. However, Components.utils usually requires
// modifications to the source file, which isn't allowed for some 3rd party
// code (Highlight.js, in particular) -- in that case we use mozIJSSubScriptLoader.
// For details on the difference, see:
// https://developer.mozilla.org/en-US/docs/Components.utils.import
scriptLoader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader),

// Handle the menu-item click
onMenuItemCommand: function(e) {
var mdReturn, focusedElem, self = this;
Expand Down Expand Up @@ -122,7 +128,7 @@ var markdown_here = {
Components.utils.import('resource://common/markdown-render.js', markdownRender);
Components.utils.import('resource://common/marked.js', marked);
Components.utils.import('resource://common/jsHtmlToText.js', htmlToText);
scriptLoader.loadSubScript('resource://common/highlightjs/highlight.js', hljs);
this.scriptLoader.loadSubScript('resource://common/highlightjs/highlight.js', hljs);

var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
Expand Down

0 comments on commit c6eafd7

Please sign in to comment.