Learn about Centmin Mod LEMP Stack today
Register Now

Testing custom CODEB tag

Discussion in 'Forum Feedback & Suggestions' started by eva2000, Nov 23, 2015.

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    Added a new custom bbcode tag called CODEB which is same as CODE tag just different background and font colour and a wider margin

    regular CODE tag
    Code:
    ECDHE-RSA-AES128-GCM-SHA256 6574
    ECDHE-RSA-CHACHA20-POLY1305 5016
    ECDHE-RSA-AES128-SHA 254
    DHE-RSA-AES128-SHA 238
    ECDHE-RSA-AES128-SHA256 77
    DHE-RSA-AES128-GCM-SHA256 38
    CODEB tag
    Code (Text):
    ECDHE-RSA-AES128-GCM-SHA256 6574
    ECDHE-RSA-CHACHA20-POLY1305 5016
    ECDHE-RSA-AES128-SHA 254
    DHE-RSA-AES128-SHA 238
    ECDHE-RSA-AES128-SHA256 77
    DHE-RSA-AES128-GCM-SHA256 38

     
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    hmm testing formatting comparison between CODE and CODEB tags

    Code:
    map $http_user_agent $nobots {
        default 1;
        ~'Mozilla/4.0' 0;
        "~MSIE 7.0" 0;
        ~'Mediapartners-Google' 0;
        "~Y!J-ASR" 0;
        ~AhrefsBot 0;
        ~Baiduspider 0;
        ~bingbot 0;
        ~DuckDuckGo-Favicons-Bot 0;
        ~Feedly 0;
        ~FlipboardRSS 0;
        ~FlipboardProxy 0;
        ~Googlebot-Imag 0;
        ~Googlebot 0;
        ~Google 0;
        ~GrapeshotCrawler 0;
        ~linkdexbot 0;
        ~NewRelicPinger 0;
        ~Pingdom 0;
        ~proximic 0;
        ~Qwantify 0;
        ~R6_CommentReader 0;
        ~TweetmemeBot 0;
        ~UptimeRobot 0;
        ~www.radian6.com 0;
        ~Yahoo 0;
        ~YandexBot 0;
        ~YandexImages 0;
    }
    missing preformatting !
    Code (Text):
    map $http_user_agent $nobots {
        default 1;
        ~'Mozilla/4.0' 0;
        "~MSIE 7.0" 0;
        ~'Mediapartners-Google' 0;
        "~Y!J-ASR" 0;
        ~AhrefsBot 0;
        ~Baiduspider 0;
        ~bingbot 0;
        ~DuckDuckGo-Favicons-Bot 0;
        ~Feedly 0;
        ~FlipboardRSS 0;
        ~FlipboardProxy 0;
        ~Googlebot-Imag 0;
        ~Googlebot 0;
        ~Google 0;
        ~GrapeshotCrawler 0;
        ~linkdexbot 0;
        ~NewRelicPinger 0;
        ~Pingdom 0;
        ~proximic 0;
        ~Qwantify 0;
        ~R6_CommentReader 0;
        ~TweetmemeBot 0;
        ~UptimeRobot 0;
        ~www.radian6.com 0;
        ~Yahoo 0;
        ~YandexBot 0;
        ~YandexImages 0;
    }


    XF 1.4 - duplication the CODE tag but in a different colour ? | XenForo Community
     
    Last edited: Nov 28, 2015
    • Like Like x 1
  3. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    11:37 PM
    1.9.9
    10.1.10
    Loving the CODEB tag (yes I like dark backgrounds :D)!
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    indeed !

    found another bug in CSS quoted CODEB tags loose their background colour - need to figure this out heh

    Code (Text):
    test code
    

    edit: fixed :D
     
    Last edited: Nov 24, 2015
  5. BobbyWibowo

    BobbyWibowo Active Member

    166
    36
    28
    Jul 30, 2015
    Medan, Indonesia
    Ratings:
    +57
    Local Time:
    5:37 AM
    Code (Text):
    class ...
    {
        private static function ...
    }

    EDIT: Default content of bb_code_tag_code template:
    HTML:
    <xen:require css="bb_code.css" />
    
    <div class="bbCodeBlock bbCodeCode">
        <div class="type">{xen:phrase code}:</div>
        <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
    </div>
    As you can see, it uses <pre></pre> for the content. Thus tabs could work.
     
    • Informative Informative x 1
  6. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    yeah not sure how i'd do that for custom bbcode CODEB tag though while maintaining CODE tag too
     
  7. BobbyWibowo

    BobbyWibowo Active Member

    166
    36
    28
    Jul 30, 2015
    Medan, Indonesia
    Ratings:
    +57
    Local Time:
    5:37 AM
    How did you add the custom bbcode? I made a quick CODEB tag with simple HTML replacement and I simply copied the HTML used for the default CODE tag:
    codeb_something.png
    Unlike the default CODe tag, it doesn't have language and line number support though (I'm using GeSHi Syntax Highlighter for the default CODE tag).
     
    • Informative Informative x 1
  8. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    went the hard way with hardcoded separate cloned CODE tag for CODEB tag heh

    what was your html replacement code ?
     
  9. BobbyWibowo

    BobbyWibowo Active Member

    166
    36
    28
    Jul 30, 2015
    Medan, Indonesia
    Ratings:
    +57
    Local Time:
    5:37 AM
    HTML Replacement:
    Code:
    <div class="bbCodeBlock bbCodeCode bbCodeCodeB">
        <div class="type">Code (Text):</div>
        <pre>{text}</pre>
    </div>
    Pretty much an exact copy of CODE tag, except I added bbCodeCodeB class to add the dark styling.
    Supports Option Parameter set to No because I can't really add language support with mere HTML replacement.
    I also enabled these options on Advanced Options tab:
    • Disable smilies
    • Disable line break conversion
    • Disable auto-linking
    • Stop parsing BB code
     
    • Informative Informative x 1
  10. eva2000

    eva2000 Administrator Staff Member

    30,882
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,400
    Local Time:
    8:37 AM
    Nginx 1.13.x
    MariaDB 5.5
    cheers @BobbyWibowo seems to work !

    Code (Text):
    map $http_user_agent $nobots {
        default 1;
        ~'Mozilla/4.0' 0;
        "~MSIE 7.0" 0;
        ~'Mediapartners-Google' 0;
        "~Y!J-ASR" 0;
        ~AhrefsBot 0;
        ~Baiduspider 0;
        ~bingbot 0;
        ~DuckDuckGo-Favicons-Bot 0;
        ~Feedly 0;
        ~FlipboardRSS 0;
        ~FlipboardProxy 0;
        ~Googlebot-Imag 0;
        ~Googlebot 0;
        ~Google 0;
        ~GrapeshotCrawler 0;
        ~linkdexbot 0;
        ~NewRelicPinger 0;
        ~Pingdom 0;
        ~proximic 0;
        ~Qwantify 0;
        ~R6_CommentReader 0;
        ~TweetmemeBot 0;
        ~UptimeRobot 0;
        ~www.radian6.com 0;
        ~Yahoo 0;
        ~YandexBot 0;
        ~YandexImages 0;
    }
     
    • Like Like x 1