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.

132 lines
3.8 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. <script language="javascript" type="text/javascript" src="$baseurl/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
  2. <script language="javascript" type="text/javascript">
  3. tinyMCE.init({
  4. theme : "advanced",
  5. mode : "specific_textareas",
  6. editor_selector: /(profile-jot-text|prvmail-text)/,
  7. plugins : "bbcode",
  8. theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect",
  9. theme_advanced_buttons2 : "",
  10. theme_advanced_buttons3 : "",
  11. theme_advanced_toolbar_location : "top",
  12. theme_advanced_toolbar_align : "center",
  13. theme_advanced_blockformats : "blockquote,code",
  14. entity_encoding : "raw",
  15. add_unload_trigger : false,
  16. remove_linebreaks : false,
  17. force_p_newlines : false,
  18. force_br_newlines : true,
  19. forced_root_block : '',
  20. convert_urls: false,
  21. content_css: "$baseurl/view/custom_tinymce.css",
  22. //Character count
  23. theme_advanced_path : false,
  24. setup : function(ed) {
  25. ed.onKeyUp.add(function(ed, e) {
  26. var txt = tinyMCE.activeEditor.getContent();
  27. var text = txt.length;
  28. if(txt.length <= 140) {
  29. $('#character-counter').removeClass('red');
  30. $('#character-counter').removeClass('orange');
  31. $('#character-counter').addClass('grey');
  32. }
  33. if((txt.length > 140) && (txt .length <= 420)) {
  34. $('#character-counter').removeClass('grey');
  35. $('#character-counter').removeClass('red');
  36. $('#character-counter').addClass('orange');
  37. }
  38. if(txt.length > 420) {
  39. $('#character-counter').removeClass('grey');
  40. $('#character-counter').removeClass('orange');
  41. $('#character-counter').addClass('red');
  42. }
  43. $('#character-counter').text(text);
  44. });
  45. }
  46. });
  47. </script>
  48. <script type="text/javascript" src="include/ajaxupload.js" ></script>
  49. <script>
  50. $(document).ready(function() {
  51. var uploader = new window.AjaxUpload(
  52. 'wall-image-upload',
  53. { action: 'wall_upload/$nickname',
  54. name: 'userfile',
  55. onSubmit: function(file,ext) { $('#profile-rotator').show(); },
  56. onComplete: function(file,response) {
  57. tinyMCE.execCommand('mceInsertRawHTML',false,response);
  58. $('#profile-rotator').hide();
  59. }
  60. }
  61. );
  62. $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
  63. var selstr;
  64. $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
  65. selstr = $(this).text();
  66. $('#profile-jot-perms img').attr('src', 'images/lock_icon.gif');
  67. });
  68. if(selstr == null)
  69. $('#profile-jot-perms img').attr('src', 'images/unlock_icon.gif');
  70. }).trigger('change');
  71. });
  72. function jotGetLink() {
  73. reply = prompt("Please enter a link URL:");
  74. if(reply && reply.length) {
  75. $('#profile-rotator').show();
  76. $.get('parse_url?url=' + reply, function(data) {
  77. tinyMCE.execCommand('mceInsertRawHTML',false,data);
  78. $('#profile-rotator').hide();
  79. });
  80. }
  81. }
  82. function jotGetVideo() {
  83. reply = prompt("Please enter a YouTube link:");
  84. if(reply && reply.length) {
  85. tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
  86. }
  87. }
  88. function jotGetLocation() {
  89. reply = prompt("Where are you right now?", $('#jot-location').val());
  90. if(reply && reply.length) {
  91. $('#jot-location').val(reply);
  92. }
  93. }
  94. function linkdropper(event) {
  95. var linkFound = event.dataTransfer.types.contains("text/uri-list");
  96. if(linkFound)
  97. event.preventDefault();
  98. }
  99. function linkdrop(event) {
  100. var reply = event.dataTransfer.getData("text/uri-list");
  101. event.target.textContent = reply;
  102. event.preventDefault();
  103. if(reply && reply.length) {
  104. $('#profile-rotator').show();
  105. $.get('parse_url?url=' + reply, function(data) {
  106. tinyMCE.execCommand('mceInsertRawHTML',false,data);
  107. $('#profile-rotator').hide();
  108. });
  109. }
  110. }
  111. function jotClearLocation() {
  112. $('#jot-coord').val('');
  113. $('#profile-nolocation-wrapper').hide();
  114. }
  115. $geotag
  116. </script>