<commit_before><%############################

NOTES

There are some plugins that might be nice, but they do not have language files,
which causes xinha to pop up a really annoying error message when you are not using english.

For now, just disable all the plugins that come with xinha.

TODO

* We should figure out how to disable xinha's tmp cache of the html content.
  This can cause havok with the tabs, because both tabs are loaded with data.

CODE ATTIC

It would be nice to use these eventually:

    "strikethrough", "removeformat", "selectall"

    config.registerButton("cg-toggleadvanced", "Show/Hide Advanced Options", [_editor_url + "iconsets/Tango/ed_buttons_main.png",2,8], false, function(e) {
      $$('.toolbarRow')[1].toggle();
      e.sizeEditor();
    });

    config.formatblock = {
      "&mdash; Paragraph &mdash;": "",
      "Normal"     : "p",
      "Heading 1"  : "h1",
      "Heading 2"  : "h2",
      "Heading 3"  : "h3",
      "Heading 4"  : "h4",
      "Preformatted" : "pre"
    };


#############################%>

<% content_for :html_head do -%>
  <% javascript_tag do -%>
    _editor_lang = "<%= html_editor_language_code %>";
  <% end -%>
<% end -%>

<% content_for :script do -%>
  xinha_init = function() {
    var editors = ["<%= wiki_body_html_id(@wiki)%>"];

    var config = new Xinha.Config();

    config.registerButton("cg-insertimage", "Insert/Modify Image", [_editor_url + "images/ed_buttons_main.png",6,3], false, <%=toolbar_insert_image_function(@wiki)%>);

    config.registerButton("cg-createlink", "Insert Web Link", [_editor_url + "images/ed_buttons_main.png",6,1], false, <%=toolbar_create_link_function(@wiki)%>);

    config.toolbar = [
      ["formatblock", "bold", "italic"],
      ["separator", "insertorderedlist", "insertunorderedlist", "outdent", "indent"],
      ["separator", "cg-insertimage", "cg-createlink"]
    ];

    config.formatblock = {
      "&mdash; Paragraph &mdash;": "",
      "Normal"     : "p",
      "Heading 2"  : "h2",
      "Heading 3"  : "h3"
    };

    config.showLoading = false;
    config.autofocus = true;
    config.flowToolbars = false;
    config.pageStyleSheets = ["/stylesheets/html_editor/editable_html.css"];
    config.height = "450px";

    editors = Xinha.makeEditors(editors, config);
    Xinha.startEditors(editors);
  };<commit_msg>adding more buttons to the wiki editor<commit_after><%############################

NOTES

There are some plugins that might be nice, but they do not have language files,
which causes xinha to pop up a really annoying error message when you are not using english.

For now, just disable all the plugins that come with xinha.

TODO

* We should figure out how to disable xinha's tmp cache of the html content.
  This can cause havok with the tabs, because both tabs are loaded with data.

CODE ATTIC

It would be nice to use these eventually:

    "strikethrough", "removeformat", "selectall"

    config.registerButton("cg-toggleadvanced", "Show/Hide Advanced Options", [_editor_url + "iconsets/Tango/ed_buttons_main.png",2,8], false, function(e) {
      $$('.toolbarRow')[1].toggle();
      e.sizeEditor();
    });

    config.formatblock = {
      "&mdash; Paragraph &mdash;": "",
      "Normal"     : "p",
      "Heading 1"  : "h1",
      "Heading 2"  : "h2",
      "Heading 3"  : "h3",
      "Heading 4"  : "h4",
      "Preformatted" : "pre"
    };


#############################%>

<% content_for :html_head do -%>
  <% javascript_tag do -%>
    _editor_lang = "<%= html_editor_language_code %>";
  <% end -%>
<% end -%>

<% content_for :script do -%>
  xinha_init = function() {
    var editors = ["<%= wiki_body_html_id(@wiki)%>"];

    var config = new Xinha.Config();

    config.registerButton("cg-insertimage", "Insert/Modify Image", [_editor_url + "images/ed_buttons_main.png",6,3], false, <%=toolbar_insert_image_function(@wiki)%>);

    config.registerButton("cg-createlink", "Insert Web Link", [_editor_url + "images/ed_buttons_main.png",6,1], false, <%=toolbar_create_link_function(@wiki)%>);

    config.toolbar = [
      ["formatblock", "bold", "italic", "hilitecolor"],
      ["separator", "insertorderedlist", "insertunorderedlist", "outdent", "indent"],
      ["separator", "cg-insertimage", "cg-createlink", "inserttable"],
      ["separator", "undo", "redo"],
      ["separator", "killword"]
    ];

    config.formatblock = {
      "&mdash; Paragraph &mdash;": "",
      "Normal"     : "p",
      "Heading 2"  : "h2",
      "Heading 3"  : "h3"
    };

    config.showLoading = false;
    config.autofocus = true;
    config.flowToolbars = false;
    config.pageStyleSheets = ["/stylesheets/html_editor/editable_html.css"];
    config.height = "450px";

    editors = Xinha.makeEditors(editors, config);
    Xinha.startEditors(editors);
  };
{'fraction_non_alphanumeric': 0.17669094693028095, 'fraction_numerical': 0.009157127991675338, 'mean_word_length': 3.58587786259542, 'pattern_counts': {'":': 4, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6343573', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1573, 'n_words': 395}