Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- questionEditor = (WebView) findViewById(R.id.textfieldQuestion);
- questionEditor.setWebViewClient(new WebViewClient() {
- @Override
- public void onPageFinished(WebView view, String url) {
- super.onPageFinished(view, url);
- questionEditor.loadUrl("javascript:disableAllButtons();");
- }
- });
- questionEditor.getSettings().setJavaScriptEnabled(true);
- questionEditor.loadUrl("file:///android_asset/ckeditor/myeditor.html");
- questionEditor.addJavascriptInterface(
- new BYGetHtmlFromEditorJavaScriptInterface(questionEditor
- .getContext(), this), PRE_JAVASCRIPT_INTERFACE);
- function disableAllButtons(isPremium) {
- var editor_t = CKEDITOR.instances['by_textfield'];
- var toolbar_lenght = editor_t.toolbox.toolbars.length;
- for (i = 0; i < editor_t.toolbox.toolbars.length; i++) {
- var items_lenght = editor_t.toolbox.toolbars[i].items.length;
- for (j = 0; j < items_lenght; j++) {
- button = editor_t.toolbox.toolbars[i].items[j].button;
- button.setState(0);
- button.setState = function() {
- };
- button.click = function() {
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement