![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-brace/ |
Upload File : |
<html> <head> <title>Brace Demo</title> <!-- <script src="./dist/absol.dependents.js"></script>--> <script src="./dist/absol-brace.js"></script> </head> <body> <style> .test0 { height: 80%; background-color: rgba(230, 230, 230, 0.9) } .test1 { height: 500px; } </style> <div class="test0"></div> <div class="test1"></div> <script> var differ = AbsolBrace.BraceDiff({ element: '.test0',//required option: { mode: 'ace/mode/javascript' }, left: { value: 'function BraceDiff(props) {\r\n if (!(this instanceof BraceDiff)) return new BraceDiff(props);\r\n EventEmitter.call(this);\r\n this.ready = false;\r\n this.props = props;\r\n this.props.left = this.props.left||{};\r\n this.props.right = this.props.right||{};\r\n\r\n this.editorLeft = null;\r\n this.editorRight = null;\r\n this.$element = null;\r\n this.diffWorker = props.diffWorker;\r\n if (!this.diffWorker) {\r\n var workerUrl = (URL || webkitURL).createObjectURL(new Blob([diffWorker_js_txt], { type: \'application\/javascript\' }));\r\n this.diffWorker = new IFrameBridge(new Worker(workerUrl));\r\n }\r\n this.lastFocusEditor = null;\r\n this._changeTimeOut = false;\r\n this._attachedTo(props.element);\r\n\r\n}' }, right: { value: 'function BraceDiff(option) {\r\n if (!(this instanceof BraceDiff)) return new BraceDiff(option);\r\n EventEmitter.call(this);\r\n this.ready = false;\r\n this._option = option;\r\n this.editorLeft = null;\r\n this.editorRight = null;\r\n this.$element = null;\r\n this.diffWorker = option.diffWorker;\r\n if (!this.diffWorker) {\r\n var workerUrl = (URL || webkitURL).createObjectURL(new Blob([diffWorker_js_txt], { type: \'application\/javascript\' }));\r\n this.diffWorker = new IFrameBridge(new Worker(workerUrl));\r\n }\r\n this.lastFocusEditor = null;\r\n this._changeTimeOut = false;\r\n this._attachedTo(option.element);\r\n\r\n}' } }); differ.editorLeft.on('change', function (){ console.log(differ.editorLeft.getValue()); }); differ.editorRight.on('change', function (){ console.log(differ.editorRight.getValue()); }) var editor = AbsolBrace.BraceEditor({ element: '.test1', option: { mode: 'ace/mode/javascript' } }); editor.setValue('function BraceDiff(option) {\r\n if (!(this instanceof BraceDiff)) return new BraceDiff(option);\r\n EventEmitter.call(this);\r\n this.ready = false;\r\n this._option = option;\r\n this.editorLeft = null;\r\n this.editorRight = null;\r\n this.$element = null;\r\n this.diffWorker = option.diffWorker;\r\n if (!this.diffWorker) {\r\n var workerUrl = (URL || webkitURL).createObjectURL(new Blob([diffWorker_js_txt], { type: \'application\/javascript\' }));\r\n this.diffWorker = new IFrameBridge(new Worker(workerUrl));\r\n }\r\n this.lastFocusEditor = null;\r\n this._changeTimeOut = false;\r\n this._attachedTo(option.element);\r\n\r\n}') editor.on('change', function () { console.log(editor.getValue()) }) </script> </body> </html>