Merge remote-tracking branch 'remotes/cyberalien/ticket/11275' into develop

This commit is contained in:
Nathaniel Guse 2013-04-25 16:33:30 -05:00
commit c057141ea6
2 changed files with 44 additions and 39 deletions

View file

@ -298,9 +298,12 @@ function storeCaret(textEl) {
* Color pallette * Color pallette
*/ */
function colorPalette(dir, width, height) { function colorPalette(dir, width, height) {
var r = 0, g = 0, b = 0; var r = 0,
var numberList = new Array(6); g = 0,
var color = ''; b = 0,
numberList = new Array(6);
color = '',
html = '';
numberList[0] = '00'; numberList[0] = '00';
numberList[1] = '40'; numberList[1] = '40';
@ -308,37 +311,46 @@ function colorPalette(dir, width, height) {
numberList[3] = 'BF'; numberList[3] = 'BF';
numberList[4] = 'FF'; numberList[4] = 'FF';
document.writeln('<table cellspacing="1" cellpadding="0" border="0">'); html += '<table cellspacing="1" cellpadding="0" border="0">';
for (r = 0; r < 5; r++) { for (r = 0; r < 5; r++) {
if (dir === 'h') { if (dir == 'h') {
document.writeln('<tr>'); html += '<tr>';
} }
for (g = 0; g < 5; g++) { for (g = 0; g < 5; g++) {
if (dir === 'v') { if (dir == 'v') {
document.writeln('<tr>'); html += '<tr>';
} }
for (b = 0; b < 5; b++) { for (b = 0; b < 5; b++) {
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">'); html += '<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">';
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); html += '<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" style="display: block; width: ' + width + 'px; height: ' + height + 'px; " alt="#' + color + '" title="#' + color + '"></a>';
document.writeln('</td>'); html += '</td>';
} }
if (dir === 'v') { if (dir == 'v') {
document.writeln('</tr>'); html += '</tr>';
} }
} }
if (dir === 'h') { if (dir == 'h') {
document.writeln('</tr>'); html += '</tr>';
} }
} }
document.writeln('</table>'); html += '</table>';
return html;
} }
(function($) {
$(document).ready(function() {
$('#color_palette_placeholder').each(function() {
$(this).html(colorPalette('h', 15, 12));
});
});
})(jQuery);
/** /**
* Caret Position object * Caret Position object
*/ */

View file

@ -35,18 +35,6 @@
var panels = new Array('options-panel', 'attach-panel', 'poll-panel'); var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
var show_panel = 'options-panel'; var show_panel = 'options-panel';
// ]]>
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
<dl style="clear: left;">
<dt><label>{L_FONT_COLOR}{L_COLON}</label></dt>
<dd>
<script type="text/javascript">
// <![CDATA[
function change_palette() function change_palette()
{ {
dE('colour_palette'); dE('colour_palette');
@ -62,10 +50,15 @@
} }
} }
colorPalette('h', 15, 10); // ]]>
// ]]> </script>
</script> <!-- INCLUDEJS template/editor.js -->
</dd>
<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
<dl style="clear: left;">
<dt><label>{L_FONT_COLOR}{L_COLON}</label></dt>
<dd id="color_palette_placeholder"></dd>
</dl> </dl>
</div> </div>