Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. questionEditor = (WebView) findViewById(R.id.textfieldQuestion);
  2.  
  3. questionEditor.setWebViewClient(new WebViewClient() {
  4. @Override
  5. public void onPageFinished(WebView view, String url) {
  6. super.onPageFinished(view, url);
  7. questionEditor.loadUrl("javascript:disableAllButtons();");
  8. }
  9. });
  10.  
  11. questionEditor.getSettings().setJavaScriptEnabled(true);
  12. questionEditor.loadUrl("file:///android_asset/ckeditor/myeditor.html");
  13. questionEditor.addJavascriptInterface(
  14. new BYGetHtmlFromEditorJavaScriptInterface(questionEditor
  15. .getContext(), this), PRE_JAVASCRIPT_INTERFACE);
  16.  
  17. function disableAllButtons(isPremium) {
  18.  
  19. var editor_t = CKEDITOR.instances['by_textfield'];
  20. var toolbar_lenght = editor_t.toolbox.toolbars.length;
  21. for (i = 0; i < editor_t.toolbox.toolbars.length; i++) {
  22. var items_lenght = editor_t.toolbox.toolbars[i].items.length;
  23. for (j = 0; j < items_lenght; j++) {
  24. button = editor_t.toolbox.toolbars[i].items[j].button;
  25. button.setState(0);
  26. button.setState = function() {
  27. };
  28. button.click = function() {
  29. };
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement