Giter Site home page Giter Site logo

Comments (6)

ijgnd avatar ijgnd commented on August 17, 2024

general point

the add-on is not easy to setup. I plan to change this in a future version.

At the moment you have to follow the instructions from the addon decription on ankiweb under the heading # styling with "class". You need another add-on and set it up. I added a screencast. maybe it helps: https://streamable.com/xtjqt

when i paste the style text to another anki field.it doesn't woks

I can't reproduce this problem, see the end of my video.

If you still have this problem: Update to the latest which is 2.1.14 and try again without any other add-ons: Disable all other add-ons or delete them, restart Anki and try again.

Does this solve the problem?

If not share your config and maybe also share a screencast.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

parzivalliday avatar parzivalliday commented on August 17, 2024

The problem is i can copy the font color, but i can't copy the background color.. i really need this feature😭here is the screencast https://streamable.com/vj60p

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

parzivalliday avatar parzivalliday commented on August 17, 2024

https://streamable.com/vj60p

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on August 17, 2024

thank's for screencast. This bug report is very useful for me.

This problem is caused by Anki 2.1. When you copy and paste from one field to another Anki 2.1 removes the bavckground-color tag with the javascript function node.style.removeProperty("background-color"); (line 402 of the file editor.js from the folder web).

In Anki there's no way built in to change the background color so the fact that Anki removes it is not a problem of Anki. It's just that my add-on is not adjusted to Anki 2.1. I made this add-on for myself in 2.0 (where you can copy the background color) and so far I hadn't run into this limitation ...

A quick workaround would be to comment out the line I mentioned by adding // in front of it. But you would have to repeat it after every update.

A workaround would be to define a class background_yellow and set .backcolor_yellow{background-color: yellow;} in the template and _editor.css .

For existing code you could copy from the html source code view (ctrl+shift+x) and insert into the source code view in the other field. But this probably more time consuming than reapplying the styling ...

I need to think about this. Maybe the solution is to use only classes and make the configuration easier. But this might take some time. Maybe glutanimate will finally publish his html-cleaner add-on for 2.1 which allows an alternative paste which keeps more formatting.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

parzivalliday avatar parzivalliday commented on August 17, 2024

Thanks man.it works.
But when i use the anki2.0, I can't see the config.i cant set background color quickly with the keyboard shortcuts .sorry about my bad english..https://streamable.com/hj9rb

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on August 17, 2024

Only Anki 2.1 introduced the add-on configuration system.

In Anki 2.0 it's more complicated: You need to go to the add-on folder with the Finder (file manager), https://apps.ankiweb.net/docs/manual.html#file-locations . In the add-on folder there's a subfolder for my add-on and in it there's a file named config.json that you need to edit.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.