Changeset 305 for trunk/plugins


Ignore:
Timestamp:
09/02/05 23:01:37 (14 years ago)
Author:
mokhet
Message:

fix #364, make use of the colorpicker widget instead of the old colorpicker popup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/FullPage/popups/docprop.html

    r276 r305  
    33<title>Document properties</title> 
    44<script type="text/javascript" src="../../../popups/popup.js"></script> 
     5<script type="text/javascript" src="../../../popups/color_picker.js"></script> 
    56<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" /> 
    67<script type="text/javascript"> 
     
    3132  } 
    3233  editor = params.editor; 
     34 
     35  var bgCol_pick = document.getElementById('bgCol_pick'); 
     36  var f_body_bgcolor = document.getElementById('f_body_bgcolor'); 
     37  var bgColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_body_bgcolor.value=color;}}); 
     38  bgCol_pick.onclick = function() { bgColPicker.open('top,right', f_body_bgcolor ); } 
     39 
     40  var fgCol_pick = document.getElementById('fgCol_pick'); 
     41  var f_body_fgcolor = document.getElementById('f_body_fgcolor'); 
     42  var fgColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_body_fgcolor.value=color;}}); 
     43  fgCol_pick.onclick = function() { fgColPicker.open('top,right', f_body_fgcolor ); } 
     44 
    3345  document.getElementById("f_title").focus(); 
    3446  document.getElementById("f_title").select(); 
     
    6072  return false; 
    6173}; 
    62  
    63 function chooseColor(id) { 
    64   var old_window_name = window.name; 
    65   window.name = 'docprop'; 
    66   var input = document.getElementById(id); 
    67   editor._popupDialog("select_color.html", function(color) { 
    68     if (color && (typeof color == 'string') ) { 
    69       input.style.backgroundColor = "#" + color; 
    70       input.value = "#" + color; 
    71     } 
    72     window.name = old_window_name; 
    73   }, input.value); 
    74 } 
    7574</script> 
    7675<style type="text/css"> 
     
    7877.txt { width:200px; } 
    7978div { clear:both; } 
     79.picker { width:30px; } 
    8080</style> 
    8181</head> 
     
    8585<div class="title">Document properties</div> 
    8686 
    87      
    8887<div> 
    8988  <label class="fr" for="f_title">Document title:</label> 
     
    104103</div> 
    105104<div> 
    106   <label class="fr" for="f_base_style">Primary style-sheet:</label> 
    107   <input type="text" id="f_base_style" class="txt" /> 
    108 </div> 
    109  
    110 <div> 
    111   <label class="fr" for="f_alt_style">Alternate style-sheet:</label> 
    112   <input type="text" id="f_alt_style" class="txt" /> 
    113 </div> 
    114 <div> 
    115   <label class="fr" for="f_body_bgcolor">Background color:</label> 
    116   <input type="text" id="f_body_bgcolor" class="txt" autocomplete="off" onclick="chooseColor('f_body_bgcolor');" /> 
    117 </div> 
    118 <div> 
    119   <label class="fr" for="f_body_fgcolor">Text color:</label> 
    120   <input type="text" id="f_body_fgcolor" class="txt" autocomplete="off" onclick="chooseColor('f_body_fgcolor');" /> 
    121 </div> 
    122 <div> 
    123105  <label class="fr" for="f_charset">Character set:</label> 
    124106  <select id="f_charset" class="txt"> 
     
    132114  </select> 
    133115</div> 
    134    
     116<div> 
     117  <label class="fr" for="f_base_style">Primary style-sheet:</label> 
     118  <input type="text" id="f_base_style" class="txt" /> 
     119</div> 
     120<div> 
     121  <label class="fr" for="f_alt_style">Alternate style-sheet:</label> 
     122  <input type="text" id="f_alt_style" class="txt" /> 
     123</div> 
     124<div> 
     125  <label class="fr" for="f_body_bgcolor">Background color:</label> 
     126  <input name="f_body_bgcolor" type="text" id="f_body_bgcolor" size="7" /> 
     127  <button type="button" id="bgCol_pick" class="picker">...</button> 
     128</div> 
     129<div> 
     130  <label class="fr" for="f_body_fgcolor">Text color:</label> 
     131  <input name="f_body_fgcolor" type="text" id="f_body_fgcolor" size="7" /> 
     132  <button type="button" id="fgCol_pick" class="picker">...</button> 
     133</div> 
     134 
    135135<div id="buttons"> 
    136136  <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button> 
Note: See TracChangeset for help on using the changeset viewer.