Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
顯示
檢視
拆分
統一
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
比對精度
智能
語法
無
變更外觀
處理
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
8 年前
差異永不過期
清除
匯出
分享
解釋
60 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
352 行
全部複製
29 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
349 行
全部複製
複製
已複製
複製
已複製
/*##################################################
/**
* bbcode.js
*
@
copyright
©
2005
-2019 PHPBoost
* -------------------
*
@license
https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0
* begin : August 01, 2005
* @author
Regis VIARRE <
crowkait@phpboost.com
>
*
copyright
: (C)
2005
Viarre Régis
* @version PHPBoost 5.2 - last update: 2018 11 18
*
email
:
crowkait@phpboost.com
* @since PHPBoost 1.2 - 2005 08 01
*
* @contributor Julien BRISWALTER <j1.seth@phpboost.com>
*
* @contributor Arnaud GENET <elenwii@phpboost.com>
###################################################
* @contributor Sebastien LARTIGUE <babsolune@phpboost.com>
*
*/
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
function textarea_resize(id, px, type)
function textarea_resize(id, px, type)
{
{
var textarea = document.getElementById(id);
var textarea = document.getElementById(id);
if( type == 'height' )
if( type == 'height' )
{
{
var current_height = parseInt(textarea.style.height) ? parseInt(textarea.style.height) : 300;
var current_height = parseInt(textarea.style.height) ? parseInt(textarea.style.height) : 300;
var new_height = current_height + px;
var new_height = current_height + px;
複製
已複製
複製
已複製
if( new_height > 40 )
if( new_height > 40 )
textarea.style.height = new_height + "px";
textarea.style.height = new_height + "px";
}
}
else
else
{
{
var current_width = parseInt(textarea.style.width) ? parseInt(textarea.style.width) : 150;
var current_width = parseInt(textarea.style.width) ? parseInt(textarea.style.width) : 150;
var new_width = current_width + px;
var new_width = current_width + px;
複製
已複製
複製
已複製
if( new_width > 40 )
if( new_width > 40 )
textarea.style.width = new_width + "px";
textarea.style.width = new_width + "px";
}
}
複製
已複製
複製
已複製
return false;
return false;
}
}
//Insertion dans le champs.
//Insertion dans le champs.
function simple_insert(open_balise, close_balise, field)
function simple_insert(open_balise, close_balise, field)
{
{
var textarea = document.getElementById(field);
var textarea = document.getElementById(field);
var scroll = textarea.scrollTop;
var scroll = textarea.scrollTop;
複製
已複製
複製
已複製
if( close_balise != "" && close_balise != "smile" )
if( close_balise != "" && close_balise != "smile" )
textarea.value += '[' + open_balise + '][/' + close_balise + ']';
textarea.value += '[' + open_balise + '][/' + close_balise + ']';
else if( close_balise == "smile" )
else if( close_balise == "smile" )
textarea.value += ' ' + open_balise + ' ';
textarea.value += ' ' + open_balise + ' ';
複製
已複製
複製
已複製
textarea.focus();
textarea.focus();
textarea.scrollTop = scroll;
textarea.scrollTop = scroll;
return;
return;
}
}
//Récupération de la sélection sur netscape, ajout des balises autour.
//Récupération de la sélection sur netscape, ajout des balises autour.
function netscape_sel(target, open_balise, close_balise)
function netscape_sel(target, open_balise, close_balise)
{
{
var sel_length = target.textLength;
var sel_length = target.textLength;
var sel_start = target.selectionStart;
var sel_start = target.selectionStart;
var sel_end = target.selectionEnd;
var sel_end = target.selectionEnd;
var scroll = target.scrollTop; //Position verticale.
var scroll = target.scrollTop; //Position verticale.
複製
已複製
複製
已複製
if( sel_end == 1 || sel_end == 2 )
if( sel_end == 1 || sel_end == 2 )
{
{
sel_end = sel_length;
sel_end = sel_length;
}
}
var string_start = (target.value).substring(0, sel_start);
var string_start = (target.value).substring(0, sel_start);
var selection = (target.value).substring(sel_start, sel_end);
var selection = (target.value).substring(sel_start, sel_end);
var string_end = (target.value).substring(sel_end, sel_length);
var string_end = (target.value).substring(sel_end, sel_length);
if( close_balise != "" && selection == "" && close_balise != "smile" )
if( close_balise != "" && selection == "" && close_balise != "smile" )
{
{
target.value = string_start + open_balise + close_balise + string_end;
target.value = string_start + open_balise + close_balise + string_end;
target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length);
target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length);
target.focus();
target.focus();
}
}
else if( close_balise == "smile" )
else if( close_balise == "smile" )
{
{
複製
已複製
複製
已複製
target.value = string_start + selection + ' ' + open_balise + ' ' + string_end;
target.value = string_start + selection + ' ' + open_balise + ' ' + string_end;
target.setSelectionRange(string_start.length + open_balise.length + 2, target.value.length - string_end.length);
target.setSelectionRange(string_start.length + open_balise.length + 2, target.value.length - string_end.length);
target.focus();
target.focus();
}
}
else
else
{
{
target.value = string_start + open_balise + selection + close_balise + string_end;
target.value = string_start + open_balise + selection + close_balise + string_end;
target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length);
target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length);
target.focus();
target.focus();
}
}
複製
已複製
複製
已複製
target.scrollTop = scroll; //Remet à la bonne position le textarea.
target.scrollTop = scroll; //Remet à la bonne position le textarea.
return;
return;
}
}
//Récupération de la sélection sur IE, ajout des balises autour.
//Récupération de la sélection sur IE, ajout des balises autour.
function ie_sel(target, open_balise, close_balise)
function ie_sel(target, open_balise, close_balise)
{
{
selText = false;
selText = false;
var scroll = target.scrollTop; //Position verticale.
var scroll = target.scrollTop; //Position verticale.
複製
已複製
複製
已複製
selection = document.selection.createRange().text; // Sélection
selection = document.selection.createRange().text; // Sélection
if( close_balise != "" && selection == "" && close_balise != "smile" )
if( close_balise != "" && selection == "" && close_balise != "smile" )
document.selection.createRange().text = open_balise + close_balise;
document.selection.createRange().text = open_balise + close_balise;
else if( close_balise == "smile" )
else if( close_balise == "smile" )
document.selection.createRange().text = selection + open_balise + ' ';
document.selection.createRange().text = selection + open_balise + ' ';
else
else
複製
已複製
複製
已複製
document.selection.createRange().text = open_balise + selection + close_balise;
document.selection.createRange().text = open_balise + selection + close_balise;
target.scrollTop = scroll; //Remet à la bonne position le textarea.
target.scrollTop = scroll; //Remet à la bonne position le textarea.
selText = '';
selText = '';
複製
已複製
複製
已複製
return;
return;
}
}
已保存差異
原始文本
開啟檔案
/*################################################## * bbcode.js * ------------------- * begin : August 01, 2005 * copyright : (C) 2005 Viarre Régis * email : crowkait@phpboost.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ function textarea_resize(id, px, type) { var textarea = document.getElementById(id); if( type == 'height' ) { var current_height = parseInt(textarea.style.height) ? parseInt(textarea.style.height) : 300; var new_height = current_height + px; if( new_height > 40 ) textarea.style.height = new_height + "px"; } else { var current_width = parseInt(textarea.style.width) ? parseInt(textarea.style.width) : 150; var new_width = current_width + px; if( new_width > 40 ) textarea.style.width = new_width + "px"; } return false; } //Insertion dans le champs. function simple_insert(open_balise, close_balise, field) { var textarea = document.getElementById(field); var scroll = textarea.scrollTop; if( close_balise != "" && close_balise != "smile" ) textarea.value += '[' + open_balise + '][/' + close_balise + ']'; else if( close_balise == "smile" ) textarea.value += ' ' + open_balise + ' '; textarea.focus(); textarea.scrollTop = scroll; return; } //Récupération de la sélection sur netscape, ajout des balises autour. function netscape_sel(target, open_balise, close_balise) { var sel_length = target.textLength; var sel_start = target.selectionStart; var sel_end = target.selectionEnd; var scroll = target.scrollTop; //Position verticale. if( sel_end == 1 || sel_end == 2 ) { sel_end = sel_length; } var string_start = (target.value).substring(0, sel_start); var selection = (target.value).substring(sel_start, sel_end); var string_end = (target.value).substring(sel_end, sel_length); if( close_balise != "" && selection == "" && close_balise != "smile" ) { target.value = string_start + open_balise + close_balise + string_end; target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length); target.focus(); } else if( close_balise == "smile" ) { target.value = string_start + selection + ' ' + open_balise + ' ' + string_end; target.setSelectionRange(string_start.length + open_balise.length + 2, target.value.length - string_end.length); target.focus(); } else { target.value = string_start + open_balise + selection + close_balise + string_end; target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length); target.focus(); } target.scrollTop = scroll; //Remet à la bonne position le textarea. return; } //Récupération de la sélection sur IE, ajout des balises autour. function ie_sel(target, open_balise, close_balise) { selText = false; var scroll = target.scrollTop; //Position verticale. selection = document.selection.createRange().text; // Sélection if( close_balise != "" && selection == "" && close_balise != "smile" ) document.selection.createRange().text = open_balise + close_balise; else if( close_balise == "smile" ) document.selection.createRange().text = selection + open_balise + ' '; else document.selection.createRange().text = open_balise + selection + close_balise; target.scrollTop = scroll; //Remet à la bonne position le textarea. selText = ''; return; } //Fonction de remplacement des caractères spéciaux function url_encode_rewrite(link_name) { link_name = link_name.toLowerCase(link_name); var chars_special = new Array(/ /g, /é/g, /è/g, /ê/g, /à/g, /â/g, /ù/g, /ü/g, /û/g, /ï/g, /î/g, /ô/g, /ç/g); var chars_replace = new Array("-", "e", "e", "e", "a", "a", "u", "u", "u", "i", "i", "o", "c"); var nbr_chars = chars_special.length; for( var i = 0; i < nbr_chars; i++) { link_name = link_name.replace(chars_special[i], chars_replace[i]); } link_name = link_name.replace(/([^a-z0-9]|[\s])/g, '-'); link_name = link_name.replace(/([-]{2,})/g, '-'); return link_name.replace(/(^\s*)|(\s*$)/g,'').replace(/(^-)|(-$)/g,''); } //Fonction d'insertion du BBcode dans le champs, tient compte du navigateur utilisé. function insertbbcode(open_balise, close_balise, field) { var area = document.getElementById(field); var nav = navigator.appName; //Recupère le nom du navigateur area.focus(); if( nav == 'Microsoft Internet Explorer' ) // Internet Explorer ie_sel(area, open_balise, close_balise); else if( nav == 'Netscape' || nav == 'Opera' ) //Netscape ou opera netscape_sel(area, open_balise, close_balise); else //insertion normale (autres navigateurs) simple_insert(open_balise, close_balise, field); return; } //Insertion dans le champs des codes de type select. function insertbbcode_select(id_select, close_balise, field) { var select = document.getElementById(id_select + field); if( select.value != '' ) insertbbcode('[' + id_select + '=' + select.value + ']', close_balise, field); //On remet la valeur par défaut. select.options[0].selected = true; return; } //Insertion dans le champs des codes de type select. function insertbbcode_select2(id_select, field) { var select = document.getElementById(id_select + field); if( select.value != '' ) insertbbcode('[' + select.value + ']', '[/' + select.value + ']', field); //On remet la valeur par défaut. select.options[0].selected = true; return; } //Conserve la configuration de la barre bbcode. function set_bbcode_preference(divID) { if( getCookie('hide-bbcode') == 0 ) { jQuery('#bbcode-expanded').removeClass('expand'); jQuery( "." + divID).each(function(){ jQuery( "." + divID).hide(); }); } } //Masquage du div. function show_bbcode_div(divID) { if( getCookie('hide-bbcode') == 0 ) { jQuery('#bbcode-expanded').addClass('expand'); sendCookie('hide-bbcode', 1); //On envoi le cookie pour se souvenir du choix de l'utilisateur. jQuery( "." + divID).each(function(){ jQuery( "." + divID).fadeIn(300); }); } else { jQuery( "." + divID).each(function(){ jQuery( "." + divID).fadeOut(300); }); jQuery('#bbcode-expanded').removeClass('expand'); sendCookie('hide-bbcode', 0); //On envoi le cookie pour se souvenir du choix de l'utilisateur. } } function bbcode_color(divID, field, type) { var i; var br; var contents; var color = new Array( '#000000', '#433026', '#333300', '#003300', '#003366', '#000080', '#333399', '#333333', '#800000', '#FFA500', '#808000', '#008000', '#008080', '#0000FF', '#666699', '#808080', '#F04343', '#FF9900', '#99CC00', '#339966', '#33CCCC', '#3366FF', '#800080', '#ACA899', '#FFC0CB', '#FFCC00', '#FFFF00', '#00FF00', '#00FFFF', '#00CCFF', '#993366', '#C0C0C0', '#FF99CC', '#FFCC99', '#FFFF99', '#CCFFCC', '#CCFFFF', '#CC99FF', '#E3007B', '#FFFFFF'); contents = '<table><tr>'; for(i = 0; i < 40; i++) { br = (i+1) % 8; br = (br == 0 && i != 0 && i < 39) ? '</tr><tr>' : ''; contents += '<td><a href="" style="background:' + color[i] + ';" onclick="insertbbcode(\'[' + type + '=' + color[i] + ']\', \'[/' + type + ']\', \'' + field + '\');bb_hide_block(\'' + divID + '\', \'' + field + '\', 0);return false;"></a></td>' + br; } document.getElementById("bb-"+ type + field).innerHTML = contents + '</tr></table>'; } function bbcode_table(field, head_name) { var cols = document.getElementById('bb-cols' + field).value; var lines = document.getElementById('bb-lines' + field).value; var head = document.getElementById('bb-head' + field).checked; var code = ''; if( cols >= 0 && lines >= 0 ) { var colspan = cols > 1 ? ' colspan="' + cols + '"' : ''; var pointor = head ? (59 + colspan.length) : 22; code = head ? '[table]\n\t[row]\n\t\t[head' + colspan + ']'+ head_name +'[/head]\n\t[/row]\n' : '[table]\n'; for(var i = 0; i < lines; i++) { code += '\t[row]\n'; for(var j = 0; j < cols; j++) code += '\t\t[col][/col]\n'; code += '\t[/row]\n'; } code += '[/table]'; insertbbcode(code.substring(0, pointor), code.substring(pointor, code.length), field); } } function bbcode_list(field) { var elements = document.getElementById('bb_list' + field).value; var ordered_list = document.getElementById('bb_ordered_list' + field).checked; if( elements <= 0 ) elements = 1; var pointor = ordered_list ? 19 : 11; code = '[list' + (ordered_list ? '=ordered' : '') + ']\n'; for(var j = 0; j < elements; j++) code += '\t[*]\n'; code += '[/list]'; insertbbcode(code.substring(0, pointor), code.substring(pointor, code.length), field); } function bbcode_url(field, prompt_text) { var url = prompt(prompt_text, ''); if(url != '' && url != null) insertbbcode('[url=' + url + ']', '[/url]', field); } function bbcode_lightbox(field, prompt_text) { var url = prompt(prompt_text, ''); if(url != '' && url != null) insertbbcode('[lightbox=' + url + '][img style="max-width: 150px;"]' + url, '[/img][/lightbox]', field); } function bbcode_anchor(field, prompt_text) { var anchor = prompt(prompt_text, ''); if(anchor != '' && anchor != null) insertbbcode('[anchor=' + url_encode_rewrite(anchor) + ']', '[/anchor]', field); else insertbbcode('[anchor]', '[/anchor]', field); } function bbcode_abbr(field, prompt_text) { var desc = prompt(prompt_text, ''); if(desc != '' && desc != null) insertbbcode('[abbr=' + desc + ']', '[/abbr]', field); else insertbbcode('[abbr]', '[/abbr]', field); } function bbcode_acronym(field, prompt_text) { var desc = prompt(prompt_text, ''); if(desc != '' && desc != null) insertbbcode('[acronym=' + desc + ']', '[/acronym]', field); else insertbbcode('[acronym]', '[/acronym]', field); } function bbcode_fieldset(field, prompt_text) { var legend = prompt(prompt_text, ''); if(legend != '' && legend != null) insertbbcode('[fieldset legend="' + legend + '"]', '[/fieldset]', field); else insertbbcode('[fieldset]', '[/fieldset]', field); } function bbcode_mail(field, prompt_text) { var mail = prompt(prompt_text, ''); if(mail != '' && mail != null) insertbbcode('[mail=' + mail + ']', '[/mail]', field); } function bbcode_feed(field, prompt_text) { var feed = prompt(prompt_text, ''); if(feed != '' && feed != null) insertbbcode('[feed cat="0" number="5"]' + feed.toLowerCase(), '[/feed]', field); }
更改後文本
開啟檔案
/** * @copyright © 2005-2019 PHPBoost * @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0 * @author Regis VIARRE <crowkait@phpboost.com> * @version PHPBoost 5.2 - last update: 2018 11 18 * @since PHPBoost 1.2 - 2005 08 01 * @contributor Julien BRISWALTER <j1.seth@phpboost.com> * @contributor Arnaud GENET <elenwii@phpboost.com> * @contributor Sebastien LARTIGUE <babsolune@phpboost.com> */ function textarea_resize(id, px, type) { var textarea = document.getElementById(id); if( type == 'height' ) { var current_height = parseInt(textarea.style.height) ? parseInt(textarea.style.height) : 300; var new_height = current_height + px; if( new_height > 40 ) textarea.style.height = new_height + "px"; } else { var current_width = parseInt(textarea.style.width) ? parseInt(textarea.style.width) : 150; var new_width = current_width + px; if( new_width > 40 ) textarea.style.width = new_width + "px"; } return false; } //Insertion dans le champs. function simple_insert(open_balise, close_balise, field) { var textarea = document.getElementById(field); var scroll = textarea.scrollTop; if( close_balise != "" && close_balise != "smile" ) textarea.value += '[' + open_balise + '][/' + close_balise + ']'; else if( close_balise == "smile" ) textarea.value += ' ' + open_balise + ' '; textarea.focus(); textarea.scrollTop = scroll; return; } //Récupération de la sélection sur netscape, ajout des balises autour. function netscape_sel(target, open_balise, close_balise) { var sel_length = target.textLength; var sel_start = target.selectionStart; var sel_end = target.selectionEnd; var scroll = target.scrollTop; //Position verticale. if( sel_end == 1 || sel_end == 2 ) { sel_end = sel_length; } var string_start = (target.value).substring(0, sel_start); var selection = (target.value).substring(sel_start, sel_end); var string_end = (target.value).substring(sel_end, sel_length); if( close_balise != "" && selection == "" && close_balise != "smile" ) { target.value = string_start + open_balise + close_balise + string_end; target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length); target.focus(); } else if( close_balise == "smile" ) { target.value = string_start + selection + ' ' + open_balise + ' ' + string_end; target.setSelectionRange(string_start.length + open_balise.length + 2, target.value.length - string_end.length); target.focus(); } else { target.value = string_start + open_balise + selection + close_balise + string_end; target.setSelectionRange(string_start.length + open_balise.length, target.value.length - string_end.length - close_balise.length); target.focus(); } target.scrollTop = scroll; //Remet à la bonne position le textarea. return; } //Récupération de la sélection sur IE, ajout des balises autour. function ie_sel(target, open_balise, close_balise) { selText = false; var scroll = target.scrollTop; //Position verticale. selection = document.selection.createRange().text; // Sélection if( close_balise != "" && selection == "" && close_balise != "smile" ) document.selection.createRange().text = open_balise + close_balise; else if( close_balise == "smile" ) document.selection.createRange().text = selection + open_balise + ' '; else document.selection.createRange().text = open_balise + selection + close_balise; target.scrollTop = scroll; //Remet à la bonne position le textarea. selText = ''; return; } //Fonction de remplacement des caractères spéciaux function url_encode_rewrite(link_name) { link_name = link_name.toLowerCase(link_name); var chars_special = new Array(/ /g, /é/g, /è/g, /ê/g, /à/g, /â/g, /ù/g, /ü/g, /û/g, /ï/g, /î/g, /ô/g, /ç/g); var chars_replace = new Array("-", "e", "e", "e", "a", "a", "u", "u", "u", "i", "i", "o", "c"); var nbr_chars = chars_special.length; for( var i = 0; i < nbr_chars; i++) { link_name = link_name.replace(chars_special[i], chars_replace[i]); } link_name = link_name.replace(/([^a-z0-9]|[\s])/g, '-'); link_name = link_name.replace(/([-]{2,})/g, '-'); return link_name.replace(/(^\s*)|(\s*$)/g,'').replace(/(^-)|(-$)/g,''); } //Fonction d'insertion du BBcode dans le champs, tient compte du navigateur utilisé. function insertbbcode(open_balise, close_balise, field) { var area = document.getElementById(field); var nav = navigator.appName; //Recupère le nom du navigateur area.focus(); if( nav == 'Microsoft Internet Explorer' ) // Internet Explorer ie_sel(area, open_balise, close_balise); else if( nav == 'Netscape' || nav == 'Opera' ) //Netscape ou opera netscape_sel(area, open_balise, close_balise); else //insertion normale (autres navigateurs) simple_insert(open_balise, close_balise, field); return; } //Insertion dans le champs des codes de type select. function insertbbcode_select(id_select, close_balise, field) { var select = document.getElementById(id_select + field); if( select.value != '' ) insertbbcode('[' + id_select + '=' + select.value + ']', close_balise, field); //On remet la valeur par défaut. select.options[0].selected = true; return; } //Insertion dans le champs des codes de type select. function insertbbcode_select2(id_select, field) { var select = document.getElementById(id_select + field); if( select.value != '' ) insertbbcode('[' + select.value + ']', '[/' + select.value + ']', field); //On remet la valeur par défaut. select.options[0].selected = true; return; } //Conserve la configuration de la barre bbcode. function set_bbcode_preference(divID) { if( getCookie('hide-bbcode') == 0 ) { jQuery('#bbcode-expanded').removeClass('expand'); jQuery( "." + divID).each(function(){ jQuery( "." + divID).hide(); }); } } //Masquage du div. function show_bbcode_div(divID) { if( getCookie('hide-bbcode') == 0 ) { jQuery('#bbcode-expanded').addClass('expand'); sendCookie('hide-bbcode', 1); //On envoi le cookie pour se souvenir du choix de l'utilisateur. jQuery( "." + divID).each(function(){ jQuery( "." + divID).fadeIn(300); }); } else { jQuery( "." + divID).each(function(){ jQuery( "." + divID).fadeOut(300); }); jQuery('#bbcode-expanded').removeClass('expand'); sendCookie('hide-bbcode', 0); //On envoi le cookie pour se souvenir du choix de l'utilisateur. } } function bbcode_color(divID, field, type) { var i; var br; var contents; var color = new Array( '#000000', '#433026', '#333300', '#003300', '#003366', '#000080', '#333399', '#333333', '#800000', '#FFA500', '#808000', '#008000', '#008080', '#0000FF', '#666699', '#808080', '#F04343', '#FF9900', '#99CC00', '#339966', '#33CCCC', '#3366FF', '#800080', '#ACA899', '#FFC0CB', '#FFCC00', '#FFFF00', '#00FF00', '#00FFFF', '#00CCFF', '#993366', '#C0C0C0', '#FF99CC', '#FFCC99', '#FFFF99', '#CCFFCC', '#CCFFFF', '#CC99FF', '#E3007B', '#FFFFFF'); contents = '<table><tr>'; for(i = 0; i < 40; i++) { br = (i+1) % 8; br = (br == 0 && i != 0 && i < 39) ? '</tr><tr>' : ''; contents += '<td><a href="" aria-label="' + color[i] + '" title="' + color[i] + '" style="background-color:' + color[i] + ';" onclick="insertbbcode(\'[' + type + '=' + color[i] + ']\', \'[/' + type + ']\', \'' + field + '\');bb_hide_block(\'' + divID + '\', \'' + field + '\', 0);return false;"></a></td>' + br; } document.getElementById("bb-"+ type + field).innerHTML = contents + '</tr></table>'; } function bbcode_table(field, head_name) { var cols = document.getElementById('bb-cols' + field).value; var lines = document.getElementById('bb-lines' + field).value; var head = document.getElementById('bb-head' + field).checked; var code = ''; if( cols >= 0 && lines >= 0 ) { var colspan = cols > 1 ? ' colspan="' + cols + '"' : ''; var pointor = head ? (59 + colspan.length) : 22; code = head ? '[table]\n\t[row]\n\t\t[head' + colspan + ']'+ head_name +'[/head]\n\t[/row]\n' : '[table]\n'; for(var i = 0; i < lines; i++) { code += '\t[row]\n'; for(var j = 0; j < cols; j++) code += '\t\t[col][/col]\n'; code += '\t[/row]\n'; } code += '[/table]'; insertbbcode(code.substring(0, pointor), code.substring(pointor, code.length), field); } } function bbcode_list(field) { var elements = document.getElementById('bb_list' + field).value; var ordered_list = document.getElementById('bb_ordered_list' + field).checked; if( elements <= 0 ) elements = 1; var pointor = ordered_list ? 19 : 11; code = '[list' + (ordered_list ? '=ordered' : '') + ']\n'; for(var j = 0; j < elements; j++) code += '\t[*]\n'; code += '[/list]'; insertbbcode(code.substring(0, pointor), code.substring(pointor, code.length), field); } function bbcode_url(field, prompt_text) { var url = prompt(prompt_text, ''); if(url != '' && url != null) insertbbcode('[url=' + url + ']', '[/url]', field); } function bbcode_quote(field, prompt_text) { var author = prompt(prompt_text, ''); if(author != null) { if(author != '') insertbbcode('[quote=' + author + ']', '[/quote]', field); else insertbbcode('[quote]', '[/quote]', field); } } function bbcode_lightbox(field, prompt_text) { var url = prompt(prompt_text, ''); if(url != '' && url != null) insertbbcode('[lightbox=' + url + '][img style="max-width: 150px;"]' + url, '[/img][/lightbox]', field); } function bbcode_anchor(field, prompt_text) { var anchor = prompt(prompt_text, ''); if(anchor != '' && anchor != null) insertbbcode('[anchor=' + url_encode_rewrite(anchor) + ']', '[/anchor]', field); else insertbbcode('[anchor]', '[/anchor]', field); } function bbcode_abbr(field, prompt_text) { var desc = prompt(prompt_text, ''); if(desc != '' && desc != null) insertbbcode('[abbr=' + desc + ']', '[/abbr]', field); else insertbbcode('[abbr]', '[/abbr]', field); } function bbcode_acronym(field, prompt_text) { var desc = prompt(prompt_text, ''); if(desc != '' && desc != null) insertbbcode('[acronym=' + desc + ']', '[/acronym]', field); else insertbbcode('[acronym]', '[/acronym]', field); } function bbcode_fieldset(field, prompt_text) { var legend = prompt(prompt_text, ''); if(legend != '' && legend != null) insertbbcode('[fieldset legend="' + legend + '"]', '[/fieldset]', field); else insertbbcode('[fieldset]', '[/fieldset]', field); } function bbcode_mail(field, prompt_text) { var mail = prompt(prompt_text, ''); if(mail != '' && mail != null) insertbbcode('[mail=' + mail + ']', '[/mail]', field); } function bbcode_feed(field, prompt_text) { var feed = prompt(prompt_text, ''); if(feed != '' && feed != null) insertbbcode('[feed cat="0" number="5"]' + feed.toLowerCase(), '[/feed]', field); }
尋找差異