The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Strange problem with editor & toolbar and a script

    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Strange problem with editor & toolbar and a script

    Post by darki August 21st 2015, 11:29 pm

    Hello,

    since one day we (the other admin and I) have the problem that all bbcodes (b, i, u, center, quote, youtube, ...) in editor don't appear, but only for us, the users can see them. Also, in threads, the avatar in toolbar and the chat in toolbar don't appear - since one day aswell.

    In Firefox I pressed STRG + SHIFT + K to get the console. Then I choosed "JS". After that error messages appeared. In this error messages were named a script. This script is not in the list of scripts in ACP.
    Spoiler:

    I don't know whether the error messages correlate with my problem.
    I deactivated JS codes one after the other. Also I deactivated the JS code management to see, whether a script is the reason. But the problems with editor and toolbar are still there.
    Furthermore, the last days I haven't done changes at editor or toolbar.

    As I said in the console there appears an error message with a JS code which is not in the JS code list in ACP.
    This and the error messages can you see in spoiler above.
    What is that code? Why it's not in JS code list in ACP? Is that the reason for my problems?

    I would be very grateful to get an answer!

    Greetings


    forum:
    schiggysboard.com
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Strange problem with editor & toolbar and a script

    Post by SLGray August 21st 2015, 11:37 pm

    Does this happen in all browsers and devices?



    Strange problem with editor & toolbar and a script Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 21st 2015, 11:38 pm

    SLGray wrote:Does this happen in all browsers and devices?
    Yes
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19432
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ape August 22nd 2015, 12:21 am

    clear your browser cookies and see if you still have the problem



    Strange problem with editor & toolbar and a script Left1212Strange problem with editor & toolbar and a script Center11Strange problem with editor & toolbar and a script Right112
    Strange problem with editor & toolbar and a script Ape_b110
    Strange problem with editor & toolbar and a script Ape1010
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 22nd 2015, 12:23 am

    Did it and problems have been still there.
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19432
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ape August 22nd 2015, 12:27 am

    can you please give a screen shot of what you see please



    Strange problem with editor & toolbar and a script Left1212Strange problem with editor & toolbar and a script Center11Strange problem with editor & toolbar and a script Right112
    Strange problem with editor & toolbar and a script Ape_b110
    Strange problem with editor & toolbar and a script Ape1010
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ange Tuteur August 22nd 2015, 10:37 am

    I do see one error :
    TypeError: frame.getElementById(...) is null 99742.js:1:4079

    which is related to this script :
    Code:
    $(function () {
      $(function () {
        var config = {
          width: '700px',
          height: '350px',
          mod_icon: 'default',
          msgnotif: true,
          timestamp: true,
          connection_logs: true
        },
        fa_chat = cre('IFRAME'),
        fa_button = cre('A'),
        fa_members = cre('SPAN'),
        fa_style = cre('STYLE'),
        fa_right = getId('fa_right'),
        frame,
        css = '#fa_chat_button{line-height:30px;padding:0 5px;color:#FFF;cursor:pointer;} .fa_actif{background:#FFF !important;color:#000 !important;} .fa_new{background:#FF8 !important;color:#000 !important;} #fa_chat{background:#FFF;width:' + config.width + ';height:' + config.height + ';border:1px solid #000;border-top:none;position:absolute;top:30px;right:39px;}';
        if (!fa_right || !_userdata.session_logged_in) return;
        fa_style.type = 'text/css';
        if (fa_style.styleSheet) fa_style.styleSheet.cssText = css;
        else fa_style.appendChild(document.createTextNode(css));
        document.getElementsByTagName('HEAD') [0].appendChild(fa_style);
        fa_members.id = 'fa_members';
        fa_members.innerHTML = '(0)';
        fa_button.innerHTML = 'Chat ';
        fa_button.id = 'fa_chat_button';
        fa_button.className = 'rightHeaderLink';
        fa_button.appendChild(fa_members);
        fa_right.insertBefore(fa_button, fa_right.lastChild);
        fa_chat.id = 'fa_chat';
        fa_chat.src = '/chatbox';
        fa_chat.style.display = 'none';
        fa_right.insertBefore(fa_chat, fa_right.lastChild);
        fa_chat.onload = function () {
          if (fa_chat.contentDocument) frame = fa_chat.contentDocument;
          else if (fa_chat.contentWindow) frame = fa_chat.contentWindow.document;
          var memb_thn = getLength('chatbox_members', 'LI'),
          memb_now = memb_thn,
          msg_thn = getLength('chatbox', 'P'),
          msg_now = msg_thn;
          fa_members.innerHTML = '(' + memb_thn + ')';
          var a = frame.getElementsByTagName('A');
          for (i = 0; i < a.length; i++) if (/archives/.test(a[i].href)) a[i].onclick = function () {
            window.clearInterval(fa_chat_refresh)
          };
          fa_chat_refresh = window.setInterval(function () {
            memb_now = getLength('chatbox_members', 'LI'),
            msg_now = getLength('chatbox', 'P');
            if (memb_now > memb_thn || memb_now < memb_thn) {
              memb_thn = memb_now;
              fa_members.innerHTML = '(' + memb_now + ')'
            }
            if (config.msgnotif) {
              if (msg_now > msg_thn || msg_now < msg_thn) {
                if (!/fa_new/.test(fa_button.className) && chatState(/none/) && !/none/.test(frame.getElementById('chatbox_option_autorefresh').style.display)) fa_button.className += ' fa_new';
                msg_thn = msg_now
              }
            }
            if (!config.timestamp) {
              var date = frame.getElementsByTagName('SPAN'),
              i;
              for (i = 0; i < date.length; i++) if (/date-and-time/.test(date[i].className) && date[i].style.display != 'none') date[i].style.display = 'none'
            }
            if (!config.connection_logs) {
              var logs = frame.getElementsByTagName('SPAN'),
              i;
              for (i = 0; i < logs.length; i++) if (/red/i.test(logs[i].style.color) || /green/i.test(logs[i].style.color)) if (!/none/.test(logs[i].parentNode.parentNode.style.display)) logs[i].parentNode.parentNode.style.display = 'none'
            }
            if (config.mod_icon.toLowerCase() != 'default') {
              var s = frame.getElementsByTagName('STRONG'),
              i;
              for (i = 0; i < s.length; i++) if (/@/.test(s[i].innerHTML) && s[i].innerHTML.length === 1 && !/msg/.test(s[i].parentNode.parentNode.className)) s[i].innerHTML = config.mod_icon
            }
          }, 1)
        };
        fa_button.onclick = function () {
          if (/welcome/.test(fa_right.className)) removeClass(fa_right, /welcome/);
          if (/notification/.test(fa_right.className)) removeClass(fa_right, /notification/);
          if (chatState(/none/)) {
            fa_chat.style.display = 'block';
            fa_button.className += ' fa_actif';
            if (/fa_new/.test(fa_button.className)) removeClass(fa_button, /fa_new/);
            frame.getElementById('chatbox').scrollTop = 99999
          } else hideChat()
        };
        getId('fa_welcome').onclick = function () {
          hideChat()
        };
        getId('fa_notifications').onclick = function () {
          hideChat()
        };
        getId('fa_hide').onclick = function () {
          hideChat()
        };
        function hideChat() {
          if (chatState(/block/)) fa_chat.style.display = 'none';
          removeClass(fa_button, /fa_actif/)
        };
        function chatState(reg) {
          return reg.test(fa_chat.style.display)
        };
        function getLength(id, tag) {
          return frame.getElementById(id).getElementsByTagName(tag).length
        };
        function getId(id) {
          return document.getElementById(id)
        };
        function cre(el) {
          return document.createElement(el)
        };
        function removeClass(el, reg) {
          el.className = el.className.replace(reg, '')
        }
      })
    });

    Have you removed that one ?
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 22nd 2015, 10:47 am

    @Ange Tuteur The problem ist that this script is not in JS code list in ACP.
    That's a script for chat in toolbar, but it has not the same content as the installed one. Also the JS number 99742 is not in thie list.
    Two or three weeks ago I changed the content of this script (chat in toolbar). But that doesn't explain why a JS code makes an error message, which is not to find in ACP.

    And yes, I deactivated and removed the installed script without succes.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ange Tuteur August 22nd 2015, 10:53 am

    99742.js refers to all scripts installed with the placement "in all the pages." Every script installed there is combined into the aforementioned file.

    Could you provide me an account with similar rights that experiences the same problems ? Otherwise, I'm afraid we'll keep going in circles if I don't experience the problem firsthand.. Razz
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 22nd 2015, 10:56 am

    Oh, ok... ^-^

    Of course, you got a PM. Wink
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ange Tuteur August 22nd 2015, 12:25 pm

    Thanks Smile

    While viewing a topic and using the full editor I got an error from this script, saying "document.getElementById('user_avatar')" was null. ( doesn't exist )
    Code:
    $(function() {
      var avatars = $(_userdata.avatar).attr('src');
      document.getElementById('user_avatar').src = avatars;
    });


    This script was also referenced in a widget titled "moderationstools," I already fixed the error for you by adding a condition to check if the specified element exists before taking action.

    Updated :
    Code:
    $(function() {
      var avatars = $(_userdata.avatar).attr('src'), ava = document.getElementById('user_avatar');
      if (ava) ava.src = avatars;
    });
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 22nd 2015, 12:31 pm

    @Ange Tuteur Thanks for editing this script, but the problems with editor and toolbar are still present. :/
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ange Tuteur August 22nd 2015, 1:06 pm

    It appears to be working for me. blackeye
    Strange problem with editor & toolbar and a script Screen15
    avatar
    darki
    Forumember


    Posts : 254
    Reputation : 10
    Language : German, english

    Solved Re: Strange problem with editor & toolbar and a script

    Post by darki August 22nd 2015, 1:14 pm

    @Ange Tuteur Oh sorry, you are right. I just reloaded the page. After clearing cache it works. Very Happy

    Thank you for your support!
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19432
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Strange problem with editor & toolbar and a script

    Post by Ape August 22nd 2015, 7:22 pm

    Topic solved and archived



    Strange problem with editor & toolbar and a script Left1212Strange problem with editor & toolbar and a script Center11Strange problem with editor & toolbar and a script Right112
    Strange problem with editor & toolbar and a script Ape_b110
    Strange problem with editor & toolbar and a script Ape1010

      Current date/time is November 11th 2024, 8:31 pm