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.

87 lines
3.0 KiB

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