[推薦][外掛]FI Colour Palette(調色盤)

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
NOFX
星球公民
星球公民
文章: 61
註冊時間: 2003-07-18 12:53
來自: MARS

[推薦][外掛]FI Colour Palette(調色盤)

文章 NOFX »

This MODification uses a few different methods than the usual approach to provide a visual colour picker for your phpBB forum.

phpBB Version: 2.0.4 :: Article Last Updated: August 31, 2003

FI Subsilver v2.11 Theme: fisubsilver.css, overall_header.tpl, posting_body.tpl

phpBB Subsilver Theme: overall_header.tpl, posting_body.tpl

Support: http://www.forumimages.com/info/mods/fi ... alette.php



代碼: 選擇全部

Mod Title: FI Colour Palette

# 
#-----[  OPEN ]------------------------------------------ 
# 

/templates/Your Templates .css

/* FI Colour Palette MOD - START */
.colouter,.col{border:1px solid #000;margin-left:10px}
.colouter{border-right-width:0;cursor:pointer}
.col{margin:0;padding:0 0 0 7px;display:inline;border-width:1px 1px 0 0;font-size:7px}
/* FI Colour Palette MOD - END */
# 
#-----[  OPEN ]------------------------------------------ 
# 
posting_body.tpl
 
# 
#-----[  FIND ]------------------------------------------ 
# 
<td nowrap="nowrap" class="genmed">  {L_FONT_COLOR}: 
<select name="addbbcodefontcolor" onchange="bbfontstyle('[color=' + this.form.addbbcodefontcolor.options[this.form.

addbbcodefontcolor.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onmouseover="helpline('s')">
<option value="{T_BODY_TEXT}">{L_COLOR_DEFAULT}</option>
<option style="color:darkred; background-color:transparent" value="darkred">{L_COLOR_DARK_RED}</option>
<option style="color:red; background-color:transparent" value="red">{L_COLOR_RED}</option>
<option style="color:orange; background-color:transparent" value="orange">{L_COLOR_ORANGE}</option>
<option style="color:brown; background-color:transparent" value="brown">{L_COLOR_BROWN}</option>
<option style="color:yellow; background-color:transparent" value="yellow">{L_COLOR_YELLOW}</option>
<option style="color:green; background-color:transparent" value="green">{L_COLOR_GREEN}</option>
<option style="color:olive; background-color:transparent" value="olive">{L_COLOR_OLIVE}</option>
<option style="color:cyan; background-color:transparent" value="cyan">{L_COLOR_CYAN}</option>
<option style="color:blue; background-color:transparent" value="blue">{L_COLOR_BLUE}</option>
<option style="color:darkblue; background-color:transparent" value="darkblue">{L_COLOR_DARK_BLUE}</option>
<option style="color:indigo; background-color:transparent" value="indigo">{L_COLOR_INDIGO}</option>
<option style="color:violet; background-color:transparent" value="violet">{L_COLOR_VIOLET}</option>
<option style="color:white; background-color:transparent" value="white">{L_COLOR_WHITE}</option>
<option style="color:black; background-color:transparent" value="black">{L_COLOR_BLACK}</option>
</select>
 {L_FONT_SIZE}: 
<select name="addbbcodefontsize" onchange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.

addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onmouseover="helpline('f')">
<option value="12" selected="selected">{L_FONT_NORMAL}</option>
<option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option>
<option value="18">{L_FONT_LARGE}</option>
<option  value="24">{L_FONT_HUGE}</option>
</select>
</td>
<td nowrap="nowrap" align="right" class="genmed"><a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">

{L_BBCODE_CLOSE_TAGS}</a> </td>
</tr>
</table>
</td>
</tr>
<SCRIPT language=JavaScript 
		src="templates/fisubsilver/color.js">
		</SCRIPT>

              <SCRIPT language=JavaScript>
		var height1 = 10;//define the height of the color bar
		var pas = 28;// define the number of color in the color bar
		var width1=Math.floor(-2/15*pas+6);//define the width of the color bar here automatic ajust for subsilver 

template.
		var text1=s_help.substring(0,search(s_help,"="));
		var text2=s_help.substring(search(s_help,"]"),search(s_help,"/"));
		</SCRIPT>

              <TR>
                <TD colSpan=12>
                  <TABLE id=ColorPanel cellSpacing=0 cellPadding=0 align=center 
                  border=0>
                    <TBODY>
                    <TR>
                      <TD id=ColorUsed onmouseover="helpline('s')" 
                      onclick="if(this.bgColor.length > 0) insertTag(this.bgColor)" 
                      vAlign=center align=middle BORDER-RIGHT: BORDER-TOP: 
                      BORDER-LEFT: ridge; CURSOR: default; BORDER-BOTTOM: 2px 
                      ridge?>
                        <SCRIPT language=JavaScript>
			document.write('<IMG height='+height1+' src="templates/subSilver/images/spacer.gif" width=10 

border=1></TD>');</SCRIPT>
			<TD width=5>
                        <SCRIPT language=JavaScript>
			document.write('<IMG height='+height1+' src="templates/subSilver/images/spacer.gif" width=5 

border=0></TD>');</SCRIPT>

			<TD id=ColorUsed1 onmouseover="helpline('s')" 
                      onclick="if(this.bgColor.length > 0) insertTag(this.bgColor)"
                      vAlign=center align=middle BORDER-RIGHT: BORDER-TOP: 
                      BORDER-LEFT: ridge; CURSOR: default; BORDER-BOTTOM: 2px 
                      ridge?>
                        <SCRIPT language=JavaScript>
			document.write('<IMG height='+height1+' src="templates/subSilver/images/spacer.gif" width=10 

border=1></TD>');</SCRIPT>


                      <TD width=5>
                        <SCRIPT language=JavaScript>
			document.write('<IMG height='+height1+' src="templates/subSilver/images/spacer.gif" width=5 

border=0></TD>');</SCRIPT>

                        <SCRIPT language=JavaScript>
                      <!--
                         rgb(pas,width1,height1,text1,text2)
                      // -->
                      </SCRIPT>
                      </TD></TR></TBODY></TABLE></TD></TR>
<tr>
<td colspan="9">
<input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="

{L_STYLES_TIP}" />
</td>
</tr>
<tr>
<td colspan="9">
<textarea name="message" rows="15" cols="35" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" 

onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
</td>
# 
#-----[  REPLACE, WITH ]----------------------------------------------------------------------------------
# 
<td nowrap="nowrap" class="genmed"> 
<script type="text/javascript">
<!--
fiColourPaletteEnable();
//-->
</script>
 {L_FONT_SIZE}: 
<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.

selectedIndex].value + ']', '[/size]')" onmouseover="helpline('f')">
<option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option>
<option value="12" selected="selected">{L_FONT_NORMAL}</option>
<option value="18">{L_FONT_LARGE}</option>
<option  value="24">{L_FONT_HUGE}</option>
</select>
</td>
<td nowrap="nowrap" align="right" class="genmed"><a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">

{L_BBCODE_CLOSE_TAGS}</a> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="9">
<input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="

{L_STYLES_TIP}" readonly="readonly" />
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><textarea class="post" id="message" name="message" rows="15" cols="35" style="width:450px;height:202px" tabindex="3" 

onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
</td>
<td onmousemove="document.forms.post.message.focus();" id="colorguide"> </td>
# 
#-----[  FIND ]------------------------------------------ 
# 

if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

# 
#-----[AFTER, ADD]------------------------------------------ 
# 

function fiColourPaletteEnable() {
if (!document.getElementById){
document.writeln('{L_FONT_COLOR}: ');
document.writeln('<select name="addbbcode18" onchange="bbfontstyle(\'[color=\' + this.form.addbbcode18.options[this.form.

addbbcode18.selectedIndex].value + \']\', \'[/color]\')" onmouseover="helpline(\'s\')">');
document.writeln('<option value="{T_BODY_TEXT}">{L_COLOR_DEFAULT}</option>');
document.writeln('<option style="color:darkred" value="darkred">{L_COLOR_DARK_RED}</option>');
document.writeln('<option style="color:red" value="red">{L_COLOR_RED}</option>');
document.writeln('<option style="color:orange" value="orange">{L_COLOR_ORANGE}</option>');
document.writeln('<option style="color:brown" value="brown">{L_COLOR_BROWN}</option>');
document.writeln('<option style="color:yellow" value="yellow">{L_COLOR_YELLOW}</option>');
document.writeln('<option style="color:green" value="green">{L_COLOR_GREEN}</option>');
document.writeln('<option style="color:olive" value="olive">{L_COLOR_OLIVE}</option>');
document.writeln('<option style="color:cyan" value="cyan">{L_COLOR_CYAN}</option>');
document.writeln('<option style="color:blue" value="blue">{L_COLOR_BLUE}</option>');
document.writeln('<option style="color:darkblue" value="darkblue">{L_COLOR_DARK_BLUE}</option>');
document.writeln('<option style="color:indigo" value="indigo">{L_COLOR_INDIGO}</option>');
document.writeln('<option style="color:violet" value="violet">{L_COLOR_VIOLET}</option>');
document.writeln('<option style="color:white" value="white">{L_COLOR_WHITE}</option>');
document.writeln('<option style="color:black" value="black">{L_COLOR_BLACK}</option>');
document.write('</select>');
} else
document.write('<input type="button" class="button" id="palette" name="palette" style="width:78px" value="{L_FONT_COLOR}" 

onclick="fiColourPalette();" onmouseover="helpline(\'s\');" />');
}

var numberList = new Array(5);
numberList[0] = '00';
numberList[1] = '40';
numberList[2] = '80';
numberList[3] = 'bf';
numberList[4] = 'ff';

function fiColourPalette() {
  var palette = '<div class="colouter" onmouseup="document.getElementById(\'message\').focus();">';
  for ( var r = 0; r < 5; r++ )
      {
    for ( var g = 0; g < 5; g++ )
            {
      for ( var b = 0; b < 5; b++ )
                  {
        color = numberList[r] + numberList[g] + numberList[b];
        palette += '<p class="col" title="#' + color + '" style="background: #' + color + ';" onmousedown="bbfontstyle(\'[color=#' + 

color + ']\', \'[/color]\');"> </p>';
      }
      palette += '<br />';
    }
  }
  palette += '</div>';
  document.getElementById('colorguide').innerHTML = palette;
}

# 
#-----[  OPEN ]------------------------------------------ 
#

Templates/Your Templates/overall_header.tpl

# 
#-----[  FIND ]------------------------------------------ 
#

<link rel="stylesheet" href="templates/fisubsilver/{T_HEAD_STYLESHEET}" type="text/css" />

# 
#-----[AFTER, ADD]------------------------------------------ 
# 

<!-- FI Colour Palette MOD - START -->
<!--[if IE]>
<style type="text/css">
.colouter{cursor:hand}
</style>
<![endif]-->
<!-- FI Colour Palette MOD - END -->

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
#EoM
主題已鎖定

回到「非官方認證外掛」