Want more timely Centmin Mod News Updates?
Become a Member

Testing custom CODEB tag

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

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
  3. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    9:20 AM
    1.9.9
    10.1.10
    Loving the CODEB tag (yes I like dark backgrounds :D)!
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    197
    42
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +71
    Local Time:
    3:20 PM
    1.17.x
    10.3.x
    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.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah not sure how i'd do that for custom bbcode CODEB tag though while maintaining CODE tag too
     
  7. BobbyWibowo

    BobbyWibowo Active Member

    197
    42
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +71
    Local Time:
    3:20 PM
    1.17.x
    10.3.x
    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).
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    197
    42
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +71
    Local Time:
    3:20 PM
    1.17.x
    10.3.x
    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
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    6:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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;
    }