Skip to content

Commit

Permalink
fix: fixup previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Sep 4, 2024
1 parent ca93fb8 commit f0cf2a7
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions init.js → html-gpt-hack.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
/*
Serve it locally:
Terminal 1:
$ python -m http.server 8080
Terminal 2:
$ ssh -R omardotesting:80:localhost:18000 serveo.net
Embed me into Open edX using the following script snippet:
<script src="https://raw.githubusercontent.com/Zeit-Labs/HackGPTforHTML/main/init.js"></script>
<script src="https://omardotesting.serveo.net/html-gpt-hack.js"></script>
*/


(function () {
console.log('Hello it the snippet!');
console.log('tinymce: Hello it the snippet!');
const apiCall = function(prompt, callback) {
setTimeout(() => {
callback(
Expand Down Expand Up @@ -94,6 +104,16 @@ Embed me into Open edX using the following script snippet:
basePrompter(promptTemplate(prompt));
}

if (!tinymce._openedxNeLCHijacked) {
console.log('tinymce: hacking the init script');
tinymce._openedxNeLCHijacked = true;
const originalTinyMCEInit = tinymce.init.bind(tinymce);
tinymce.init = function(params) {
console.log('tinymce: hijacked params', params);
// originalTinyMCEInit(params);
};
}

let inputer = `
<div class="wrapper-comp-setting">
<input class="input setting-input" type="text" id="prompt-html" value="">
Expand Down

0 comments on commit f0cf2a7

Please sign in to comment.