ImaginarySense / Imaginary-Teleprompter

Easy to use, free software, teleprompter app.
http://imaginary.tech/teleprompter
GNU General Public License v3.0
269 stars 54 forks source link

How to fetch from API and show in prompter? #76

Closed c0d33py closed 3 years ago

c0d33py commented 3 years ago

Hello there!

i need some help!

I want to use Imaginary Teleprompter with API. I have integrate the Imaginary Teleprompter into Django. Can anybody tell me how can i fetch data from API and show in prompter or CKeditor. basically i don't want to use the ckedito or etc.

Problem I am faceing an issue when i get data from api. The API is working fine but prompter need to refresh the page multiple time then i it will show my data in editor i dont want to use the CKeditor or any othere Editor becuase my data is comming from API. I just want to fetch data from API

Cuperino commented 3 years ago

What you're doing sounds interesting. What are you working on?

You could modify teleprompter.js to load your data straight from the API and make teleprompter.html the launch point instead of editor.html (beta-v branch) or index.html (all other branches).

teleprompter.js gets its contents from the browser's localstorage. The content is placed there by editor.js. You can modify teleprompter.js to load the contents from the API instead of localstorage. The function used to the load contents is updateDatamanager(), you shoulld re-implement that function to make your API call.

The function updateContents() reads the values loaded by updateDatamanager(). I suggest you console.log() the values in updateContents from a working Imaginary Teleprompter, so that you see what "editor" values need to be provided, and in what format, for teleprompter.js to work.

By making use of Imaginary Teleprompter's code in your program, you're creating what is called derivative code. Remember to comply with the terms of the General Public License.

If you have any questions with regards to the code, feel free to write.

Cuperino commented 3 years ago

Closing because it's been a week. Feel free to re-open if you need any more help.