Oº°‘¨ [C]hia [S]ẻ [O]nline ¨‘°ºO
♥️Chào Mừng Các Bạn Ghé Thăm Forum Chia Sẻ Online♥️
Rất mong các bạn đăng ký làm thành viên để cùng
nhau chia sẻ mọi nỗi buồn vui
Chúc các bạn có những phút thư giãn vui vẻ
♥️Welcome to forum Chia Sẻ Online♥️
Oº°‘¨ [C]hia [S]ẻ [O]nline ¨‘°ºO
♥️Chào Mừng Các Bạn Ghé Thăm Forum Chia Sẻ Online♥️
Rất mong các bạn đăng ký làm thành viên để cùng
nhau chia sẻ mọi nỗi buồn vui
Chúc các bạn có những phút thư giãn vui vẻ
♥️Welcome to forum Chia Sẻ Online♥️
Welcome Guest, is this your first visit? Register
All times are GMT. The time now is 07:28 AM.

You are not connected. Please login or register

[Codes] Tô màu Javascript cho mọi phiên bản

Go down  Thông điệp [Trang 1 trong tổng số 1 trang]

Yuni

Yuni
Moderator
Moderator

[Codes] Tô màu Javascript cho mọi phiên bản Flag_r10Nguồn: view source http://forum.forumactif.com ( có chính sửa class pun và viết cho phpBB2 )
Bước 1: ACP - Display - Pictures and Colors - Colors - CSS Stylesheet:
Code:
.prettyprint .pln{color:#000}.prettyprint .str{color:#080}.prettyprint .kwd{color:#008}.prettyprint .com{color:#800}.prettyprint .typ{color:#606}.prettyprint .lit{color:#066}.prettyprint .fmvip{color:#660}.prettyprint .tag{color:#008}.prettyprint .atn{color:#606}.prettyprint .atv{color:#080}.prettyprint .dec{color:#606}.prettyprint .linenums li{border-left:3px solid #EBEFF9;padding-left:5px}.prettyprint{font-family:Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;font-size:13px;padding:2px}.prettyprint ol.linenums{margin-bottom:0;margin-top:0}ol.linenums:hover{list-style-type:none}

Bước 2: ACP - Modules - HTML & JAVASCRIPT - Javascript codes management:
  • Title * : prettyprint for code forumotion
  • Placement : In the topics
  • Javascript Code * :
    • phpBB3 - punBB - Invision
      Code:
      $(function () {
         if ($("code").filter(function () {
            var a = $(this).text().indexOf("["),
               b = $(this).text().indexOf("]"),
               c = $(this).text().indexOf("[/"),
               d = $(this).text().indexOf("<"),
               e = $(this).text().indexOf('"'),
               f = $(this).text().indexOf("'"),
               g = $(this).text().indexOf("/");
            return a == -1 || b == -1 || c == -1 || a > b || b > c || d != -1 && d < a || e != -1 && e < a || f != -1 && f < a || g != -1 && g < a
         }).each(function () {
            $(this).wrapInner('<pre class="prettyprint' + ($(this).text().indexOf("<") == -1 && /[\s\S]+{[\s\S]+:[\s\S]+}/.test($(this).text()) ? " lang-css" : "") + ' linenums" />')
         }).length) {
            var s = document.createElement("script");
            s.type = "text/javascript";
            s.async = !0;
            s.src = "http://fmvi-group.googlecode.com/files/fmvi-color-code.js";
            document.getElementsByTagName("head")[0].appendChild(s)
         };
      });
    • phpBB2
      Code:
      $(function () {
         if ($("div.cont_code").filter(function () {
            var a = $(this).text().indexOf("["),
               b = $(this).text().indexOf("]"),
               c = $(this).text().indexOf("[/"),
               d = $(this).text().indexOf("<"),
               e = $(this).text().indexOf('"'),
               f = $(this).text().indexOf("'"),
               g = $(this).text().indexOf("/");
            return a == -1 || b == -1 || c == -1 || a > b || b > c || d != -1 && d < a || e != -1 && e < a || f != -1 && f < a || g != -1 && g < a
         }).each(function () {
            $(this).wrapInner('<pre class="prettyprint' + ($(this).text().indexOf("<") == -1 && /[\s\S]+{[\s\S]+:[\s\S]+}/.test($(this).text()) ? " lang-css" : "") + ' linenums" />')
         }).length) {
            var s = document.createElement("script");
            s.type = "text/javascript";
            s.async = !0;
            s.src = "http://fmvi-group.googlecode.com/files/fmvi-color-code.js";
            document.getElementsByTagName("head")[0].appendChild(s)
         };
      });

Lưu ý: Để sử dụng Javascript codes management bạn phải cập nhật Templates: http://help.forumotion.com/t92693-new-update-javascript-code-management
Thêm chức năng Select Content http://help.forumotion.com/t93456-select-content-button
Viết bởi baivong - www.FMvi.org

http://4allvn.ucoz.net

Về Đầu Trang  Thông điệp [Trang 1 trong tổng số 1 trang]

Permissions in this forum:
Bạn không có quyền trả lời bài viết