Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.3 KiB

  1. <?php
  2. /**
  3. * Name: Vier
  4. * Version: 1.2
  5. * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
  6. * Author: Ike <http://pirati.ca/profile/heluecht>
  7. * Author: Beanow <https://fc.oscp.info/profile/beanow>
  8. * Maintainer: Ike <http://pirati.ca/profile/heluecht>
  9. * Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
  10. */
  11. function vier_init(&$a) {
  12. $a->theme_events_in_profile = false;
  13. set_template_engine($a, 'smarty3');
  14. $baseurl = $a->get_baseurl();
  15. $a->theme_info = array();
  16. $a->page['htmlhead'] .= <<< EOT
  17. <script type="text/javascript">
  18. function insertFormatting(comment,BBcode,id) {
  19. var tmpStr = $("#comment-edit-text-" + id).val();
  20. if(tmpStr == comment) {
  21. tmpStr = "";
  22. $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
  23. $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
  24. openMenu("comment-edit-submit-wrapper-" + id);
  25. $("#comment-edit-text-" + id).val(tmpStr);
  26. }
  27. textarea = document.getElementById("comment-edit-text-" +id);
  28. if (document.selection) {
  29. textarea.focus();
  30. selected = document.selection.createRange();
  31. if (BBcode == "url"){
  32. selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
  33. } else
  34. selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
  35. } else if (textarea.selectionStart || textarea.selectionStart == "0") {
  36. var start = textarea.selectionStart;
  37. var end = textarea.selectionEnd;
  38. if (BBcode == "url"){
  39. textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
  40. } else
  41. textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
  42. }
  43. return true;
  44. }
  45. function showThread(id) {
  46. $("#collapsed-comments-" + id).show()
  47. $("#collapsed-comments-" + id + " .collapsed-comments").show()
  48. }
  49. function hideThread(id) {
  50. $("#collapsed-comments-" + id).hide()
  51. $("#collapsed-comments-" + id + " .collapsed-comments").hide()
  52. }
  53. function cmtBbOpen(id) {
  54. $("#comment-edit-bb-" + id).show();
  55. }
  56. function cmtBbClose(id) {
  57. $("#comment-edit-bb-" + id).hide();
  58. }
  59. </script>
  60. EOT;
  61. }