Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Orion Editor] Doesn't work since Firefox 27.0a1 (2013-09-24) #17

Open
Infocatcher opened this issue Sep 25, 2013 · 0 comments
Open

[Orion Editor] Doesn't work since Firefox 27.0a1 (2013-09-24) #17

Infocatcher opened this issue Sep 25, 2013 · 0 comments

Comments

@Infocatcher
Copy link
Owner

https://bugzilla.mozilla.org/show_bug.cgi?id=816756
See chrome://browser/content/devtools/scratchpad.js
Old:

Cu.import("resource:///modules/source-editor.jsm");
    this.editor = new SourceEditor();

    let config = {
      mode: SourceEditor.MODES.JAVASCRIPT,
      showLineNumbers: true,
      initialText: initialText,
      contextMenu: "scratchpad-text-popup",
    };

    let editorPlaceholder = document.getElementById("scratchpad-editor");
    this.editor.init(editorPlaceholder, config,
                     this._onEditorLoad.bind(this, state));

New:

const require   = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
// ...
const Editor    = require("devtools/sourceeditor/editor");
    this.editor = new Editor({
      mode: Editor.modes.js,
      value: initialText,
      lineNumbers: true,
      contextMenu: "scratchpad-text-popup"
    });

    this.editor.appendTo(document.querySelector("#scratchpad-editor")).then(() => {
      var lines = initialText.split("\n");

      this.editor.on("change", this._onChanged);
      this.editor.focus();
      this.editor.setCursor({ line: lines.length, ch: lines.pop().length });

      if (state)
        this.dirty = !state.saved;

      this.initialized = true;
      this._triggerObservers("Ready");
      this.populateRecentFilesMenu();
      PreferenceObserver.init();
    }).then(null, (err) => console.log(err.message));

Also seems like this isn't Eclipse Orion anymore:
resource:///modules/devtools/sourceeditor/editor.js

/**
 * A very thin wrapper around CodeMirror. [...]
 * CodeMirror docs: http://codemirror.net/doc/manual.html
 */
Infocatcher added a commit that referenced this issue Sep 25, 2013
(at least context menu doesn't work)
(WIP for #17)
Infocatcher added a commit that referenced this issue Sep 25, 2013
…nly "orion editor"

(I hope, all correct here...)
(WIP for #17)
Infocatcher added a commit that referenced this issue Oct 6, 2013
Note: undo/redo currently works strange even in Scratchpad
(WIP for #17)
Infocatcher added a commit that referenced this issue Oct 10, 2013
Infocatcher added a commit that referenced this issue Oct 10, 2013
Infocatcher added a commit that referenced this issue Oct 10, 2013
Infocatcher added a commit that referenced this issue Oct 22, 2013
Infocatcher added a commit that referenced this issue Oct 22, 2013
Infocatcher added a commit that referenced this issue Oct 23, 2013
Infocatcher added a commit that referenced this issue Dec 16, 2013
Note: "Find" and "Find Again" doesn't work even in Scratchpad's Edit menu, so I can't fix it for now
(WIP for #17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant