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

Fancy editor for "editor" router #3

Closed
paulo-carvalho opened this issue Feb 5, 2017 · 2 comments
Closed

Fancy editor for "editor" router #3

paulo-carvalho opened this issue Feb 5, 2017 · 2 comments

Comments

@paulo-carvalho
Copy link
Collaborator

Substitute textarea tag for something fancier (try searching for some bower-based framework).

@paulo-carvalho
Copy link
Collaborator Author

Suggestion: Ace ember install ember-ace - last commit 2 months ago

@paulo-carvalho
Copy link
Collaborator Author

paulo-carvalho commented Feb 17, 2017

How Ace Editor was used:

  1. ember-cli-build.js: pre-config
new EmberApp(defaults, {
  ace: {
      themes: [''],
      modes: [''],
      workers: ['']
    }
});
  1. app/templates/editor.hbs: layout
{{ember-ace id="div-id" mode="lang-highlighter" lines=30}}
  1. app/styles/editor.scss: font-size
.app-editor {

  pre.ace_editor {
    font-size: 20px;
  }
}
  1. app/controllers/editor.js: bind content
actions: {
  clear() {
    ace.edit("formatter").setValue("");
  },
  normalize() {
    const input = ace.edit("formatter").getValue();
  },
  buildEditor() {
    const bibtex = this.get('formatter').get('bibtex');
    ace.edit("formatter").setValue(bibtex.get('bibtex') || '');
  }
}

paulo-carvalho pushed a commit that referenced this issue Feb 17, 2017
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