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

Set default settings in "init" #141

Closed
FeBe95 opened this issue May 11, 2020 · 4 comments
Closed

Set default settings in "init" #141

FeBe95 opened this issue May 11, 2020 · 4 comments

Comments

@FeBe95
Copy link

FeBe95 commented May 11, 2020

A nice enhancement for this project could be the possibility to set custom default settings while initializing eruda, by adding a settings object next to container and tool. It could contain key/value pairs such as theme: 'Monokai Pro' and display-size: 50 etc.

surunzi added a commit that referenced this issue Jun 27, 2020
@surunzi
Copy link
Member

surunzi commented Sep 14, 2020

version 2.4.0

eruda.init({
  defaults: {
    displaySize: 50,
    transparency: 0.9,
    theme: 'Monokai Pro'
  }
})

@surunzi surunzi closed this as completed Sep 14, 2020
@Lruihao
Copy link

Lruihao commented Jul 21, 2022

@surunzi Excuse me, How can I to set the theme in the code after initialization?

All right,i got it!

eruda.util.evalCss.setTheme('Dark')

@RuralAnemone
Copy link

RuralAnemone commented Oct 31, 2022

is it possible to set more than just those 3 settings? if so, how are they initialized (i.e. what they're called or something)?

@Dhyfer1
Copy link

Dhyfer1 commented Mar 16, 2023

version 2.4.0

eruda.init({
  defaults: {
    displaySize: 50,
    transparency: 0.9,
    theme: 'Monokai Pro'
  }
})

@surunzi In the latest version 2.11.3 I would like to change the size of diplay to 50, but I don't know where to put it in the new version. Can you help me?

Where I place display-size: 50 in this script from the latest version?

javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init() } })();

Edit: Now I know how, adding the code between the brackets after eruda.init

javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init({defaults: {displaySize: 50, theme: 'Monokai Pro'}}) } })();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants