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.
 
 
 
 
 
 

130 lines
3.7 KiB

  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. convert_urls: false,
  18. content_css: "$baseurl/view/custom_tinymce.css",
  19. //Character count
  20. theme_advanced_path : false,
  21. setup : function(ed) {
  22. ed.onKeyUp.add(function(ed, e) {
  23. var txt = tinyMCE.activeEditor.getContent();
  24. var text = txt.length;
  25. if(txt.length <= 140) {
  26. $('#character-counter').removeClass('red');
  27. $('#character-counter').removeClass('orange');
  28. $('#character-counter').addClass('grey');
  29. }
  30. if((txt.length > 140) && (txt .length <= 420)) {
  31. $('#character-counter').removeClass('grey');
  32. $('#character-counter').removeClass('red');
  33. $('#character-counter').addClass('orange');
  34. }
  35. if(txt.length > 420) {
  36. $('#character-counter').removeClass('grey');
  37. $('#character-counter').removeClass('orange');
  38. $('#character-counter').addClass('red');
  39. }
  40. $('#character-counter').text(text);
  41. });
  42. }
  43. });
  44. </script>
  45. <script type="text/javascript" src="include/ajaxupload.js" ></script>
  46. <script>
  47. $(document).ready(function() {
  48. var uploader = new window.AjaxUpload(
  49. 'wall-image-upload',
  50. { action: 'wall_upload',
  51. name: 'userfile',
  52. onSubmit: function(file,ext) { $('#profile-rotator').show(); },
  53. onComplete: function(file,response) {
  54. tinyMCE.execCommand('mceInsertRawHTML',false,response);
  55. $('#profile-rotator').hide();
  56. }
  57. }
  58. );
  59. $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
  60. var selstr;
  61. $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
  62. selstr = $(this).text();
  63. $('#profile-jot-perms img').attr('src', 'images/lock_icon.gif');
  64. });
  65. if(selstr == null)
  66. $('#profile-jot-perms img').attr('src', 'images/unlock_icon.gif');
  67. }).trigger('change');
  68. });
  69. function jotGetLink() {
  70. reply = prompt("Please enter a link URL:");
  71. if(reply && reply.length) {
  72. $('#profile-rotator').show();
  73. $.get('parse_url?url=' + reply, function(data) {
  74. tinyMCE.execCommand('mceInsertRawHTML',false,data);
  75. $('#profile-rotator').hide();
  76. });
  77. }
  78. }
  79. function jotGetVideo() {
  80. reply = prompt("Please enter a YouTube link:");
  81. if(reply && reply.length) {
  82. tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
  83. }
  84. }
  85. function jotGetLocation() {
  86. reply = prompt("Where are you right now?", $('#jot-location').val());
  87. if(reply && reply.length) {
  88. $('#jot-location').val(reply);
  89. }
  90. }
  91. function linkdropper(event) {
  92. var linkFound = event.dataTransfer.types.contains("text/uri-list");
  93. if(linkFound)
  94. event.preventDefault();
  95. }
  96. function linkdrop(event) {
  97. var reply = event.dataTransfer.getData("text/uri-list");
  98. event.target.textContent = reply;
  99. event.preventDefault();
  100. if(reply && reply.length) {
  101. $('#profile-rotator').show();
  102. $.get('parse_url?url=' + reply, function(data) {
  103. tinyMCE.execCommand('mceInsertRawHTML',false,data);
  104. $('#profile-rotator').hide();
  105. });
  106. }
  107. }
  108. function jotClearLocation() {
  109. $('#jot-coord').val('');
  110. $('#profile-nolocation-wrapper').hide();
  111. }
  112. $geotag
  113. </script>