Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, May 20, 10:23 PM

in-portal

Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js (revision 1485)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js (revision 1486)
@@ -1,78 +1,104 @@
// color Selector
var aColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';
+ var $color_selector_field = '';
function InitColorSelector()
{
var $selector = document.getElementById('colorSelector_div');
if( !isset($selector) )
{
var $selector = document.createElement('DIV');
$selector.id = 'colorSelector_div';
$selector.className = 'table_color1';
$selector.style.width = '178px';
$selector.style.borderWidth = '1px';
$selector.style.borderColor = '#000000';
$selector.style.display = 'none';
$selector.style.position = 'absolute';
$selector.style.borderStyle = 'solid';
var $s_table = document.createElement('TABLE');
$s_table.id = 'colorSelector';
$selector.appendChild($s_table);
document.body.appendChild($selector);
var oTable = document.getElementById('colorSelector');
var iCounter = 0;
aColors = aColors.split(',');
while(iCounter < aColors.length)
{
var oRow = oTable.insertRow(-1);
for(var i = 0; i < 8 && iCounter < aColors.length; i++, iCounter++)
{
var $cell = document.createElement('TD');
$cell.innerHTML = '<div class="ColorBox" style="background-color: #'+aColors[iCounter]+'"></div>';
$cell.onmouseover = this.colorMouseOver;
$cell.onmouseout = this.colorMouseOut;
$cell.onclick = this.colorClick;
$cell.setAttribute('ColorIndex', iCounter);
var oDiv=oRow.insertCell(-1).appendChild($cell);
};
}
}
}
function updateColor($event,$color_id)
{
document.getElementById('color_'+$color_id).style.backgroundColor = document.getElementById($color_id).value;
}
function colorMouseOver($e)
{
if(!$e) $e = window.event;
//print_pre(this);
this.parentNode.style.backgroundColor = '#C8D3E2';
this.parentNode.style.borderColor = '#7196CC';
}
- function colorMouseOut($e)
+ function colorMouseOut($e, $element)
{
if(!$e) $e = window.event;
- this.parentNode.style.backgroundColor = '#F6F6F6';
- this.parentNode.style.borderColor = '#F6F6F6';
+ if(!$element) $element = this;
+ $element.parentNode.style.backgroundColor = '#F6F6F6';
+ $element.parentNode.style.borderColor = '#F6F6F6';
}
function colorClick($e)
{
if(!$e) $e = window.event;
var $color = aColors[ this.getAttribute('ColorIndex') ];
- document.getElementById('color_'+$input_name).style.backgroundColor = $color;
- document.getElementById($input_name).value = '#' + $color;
+ document.getElementById('color_'+$color_selector_field).style.backgroundColor = $color;
+ document.getElementById($color_selector_field).value = '#' + $color;
document.getElementById('colorSelector_div').style.display = 'none';
- colorMouseOut($e);
- }
\ No newline at end of file
+ colorMouseOut($e, this);
+ }
+
+ function openColorSelector($e, $field)
+ {
+ $color_selector_field = $field;
+ var $div = document.getElementById('colorSelector_div');
+
+ var posx = 0;
+ var posy = 0;
+ if (!$e) var $e = window.event;
+ if ($e.pageX || $e.pageY)
+ {
+ posx = $e.pageX;
+ posy = $e.pageY;
+ }
+ else if ($e.clientX || $e.clientY)
+ {
+ posx = $e.clientX + document.body.scrollLeft;
+ posy = $e.clientY + document.body.scrollTop;
+ }
+
+ $div.style.left = posx;
+ $div.style.top = posy;
+ $div.style.display = 'block';
+ }
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl (revision 1485)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl (revision 1486)
@@ -1,132 +1,109 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="style_edit" module="in-commerce" icon="icon46_style"/>
<script src="incs/colorselector.js" type="text/javascript" language="javascript"></script>
<style type="text/css">
.ColorBox
{
font-size: 1px;
border: #808080 1px solid;
width: 10px;
position: static;
height: 10px;
}
</style>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
submit_event('selectors','OnSaveStyle');
}
) );
+
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
window.close();
}
) );
- a_toolbar.Render();
-
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- function openColorSelector($e, $field)
- {
- var $div = document.getElementById('colorSelector_div');
- if($div)
- {
- alert('div - ok');
- var posx = 0;
- var posy = 0;
- if (!$e) var $e = window.event;
- if ($e.pageX || $e.pageY)
- {
- posx = $e.pageX;
- posy = $e.pageY;
- }
- else if ($e.clientX || $e.clientY)
- {
- posx = $e.clientX + document.body.scrollLeft;
- posy = $e.clientY + document.body.scrollTop;
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
+ submit_event('selectors','OnResetToBase');
}
-
- $div.style.left = posx;
- $div.style.top = posy;
- $div.style.display = 'block';
- }
- else
- {
- alert('div not defined');
- }
- }
+ ) );
+
+ a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_block name="inp_edit_color"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
<td>
<input type="text"
name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>"
id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>"
value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>"
tabindex="<inp2:m_get param="tab_index"/>"
size="<inp2:m_param name="size"/>"
maxlength="<inp2:m_param name="maxlength"/>"
class="<inp2:m_param name="class"/>"
onkeyup="updateColor(event,'<inp2:$prefix_InputName field="$field" subfield="$subfield"/>')"
onblur="<inp2:m_Param name="onblur"/>">
<div id="color_<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" style="display: inline; border: 1px solid #000000;" onclick="openColorSelector(event,'<inp2:$prefix_InputName field="$field" subfield="$subfield"/>');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<script language="javascript">
updateColor(null,'<inp2:$prefix_InputName field="$field" subfield="$subfield"/>');
</script>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_options_style"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
<td>
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:$prefix_PredefinedOptions field="$value_field" block="inp_option_item" selected="selected"/>
</select>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
</tr>
<inp2:m_blockend/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_ParseBlock name="subsection" title="!la_FontAttributes!"/>
<inp2:m_ParseBlock name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="color" title="!la_fld_FontColor!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-size" title="!la_fld_FontSize!"/>
<inp2:m_ParseBlock name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-style" value_field="FontStyle" title="!la_fld_FontStyle!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-weight" title="!la_fld_FontWeight!"/>
<inp2:m_ParseBlock name="subsection" title="!la_BackgroundAndBorders!"/>
<inp2:m_ParseBlock name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="background-color" title="!la_fld_BackgroundColor!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border" title="!la_fld_Border!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding" title="!la_fld_Padding!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin" title="!la_fld_Margins!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-top" title="!la_fld_MarginTop!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-right" title="!la_fld_MarginRight!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-bottom" title="!la_fld_MarginBottom!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-left" title="!la_fld_MarginLeft!"/>
</table>
<script language="javascript" type="text/javascript">
InitColorSelector();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl (revision 1485)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl (revision 1486)
@@ -1,111 +1,112 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="block_style_edit" module="in-commerce" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
submit_event('selectors','<inp2:selectors_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
submit_event('selectors','OnCancel');
}
) );
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
+ submit_event('selectors','OnResetToBase');
+ }
+ ) );
+
a_toolbar.Render();
function ValidateRequired()
{
var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
'<inp2:selectors_InputName field="SelectorName"/>');
var $ret = true;
var $i = 0;
var $value = '';
while($i < $fields.length)
{
$value = document.getElementById( $fields[$i] ).value;
$value = $value.replace(' ','');
if($value.length == 0)
{
$ret = false;
break;
}
$i++;
}
return $ret;
}
function editStyle()
{
if( ValidateRequired() )
{
openSelector('selectors','<inp2:m_t t="in-commerce/stylesheets/style_editor" pass="all"/>',null,850,460,'OnOpenStyleEditor');
}
else
{
alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
}
}
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
<inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
<input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="2">
<inp2:m_ParseBlock name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
<inp2:m_ParseBlock name="inp_edit_options" prefix="selectors" field="ParentId" title="!la_fld_SelectorBase!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
<inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" valign="top">
<inp2:m_phrase name="la_fld_SelectorData"/>:<br>
<a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<table width="100%">
<tr>
<td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
<td>
<inp2:selectors_PrintStyle field="SelectorData"/>
</td>
<td><inp2:m_phrase name="la_StylePreview"/>:</td>
<td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
<inp2:m_phrase name="la_SampleText"/>
</td>
</tr>
</table>
</td>
<td class="error">&nbsp;</td>
</tr>
- <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td colspan="3">
- <input type="button" class="button" onclick="submit_event('selectors','OnResetToBase');" value="<inp2:m_phrase name="la_reset_to_base"/>">
- </td>
- </tr>
</table>
<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property

Event Timeline