Changeset 1391 for trunk/modules


Ignore:
Timestamp:
02/08/18 23:51:08 (2 years ago)
Author:
gogo
Message:

Improve TableOperations? Table Properties border functionality. Remove the old "frames" and "rules" stuff, set all cells of the table to have the table properties border if you set it, automatically set a 1px solid border if you set a table border colour and hadn't set the style or width.

Location:
trunk/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/ColorPicker/ColorPicker.js

    r1370 r1391  
    924924 
    925925  pickerConfig = (pickerConfig) ? Xinha.cloneObject(pickerConfig) : { cellsize:'5px' }; 
    926   pickerConfig.callback = (pickerConfig.callback) ? pickerConfig.callback : function(color) {chooser.style.backgroundColor = color;input.value=color}; 
     926  pickerConfig.callback = (pickerConfig.callback) ? pickerConfig.callback : function(color) {chooser.style.backgroundColor = color;input.value=color;if(typeof input.oncolorpicked == 'function') input.oncolorpicked();}; 
    927927 
    928928  chooser.onclick = function()  
  • trunk/modules/InlineStyler/InlineStyler.js

    r1260 r1391  
    2424 
    2525// Applies the style found in "params" to the given element. 
    26 Xinha.InlineStyler.prototype.applyStyle = function(params) 
     26Xinha.InlineStyler.prototype.applyStyle = function(params, _ifMatchRe, _exceptMatchRe) 
    2727{ 
    2828  var element = this.element; 
     
    3535    if (params[i] != null) 
    3636      var val = params[i].value || params[i]; 
    37  
     37     
     38    if(_ifMatchRe && !i.match(_ifMatchRe))        continue; 
     39    if(_exceptMatchRe && i.match(_exceptMatchRe)) continue; 
     40     
    3841    switch (i) 
    3942    { 
     
    125128    } 
    126129  } 
     130}; 
     131 
     132Xinha.InlineStyler.prototype.applyStyleExceptMatch = function(params, exceptMatchRe) 
     133{ 
     134  return this.applyStyle(params, null, exceptMatchRe); 
     135}; 
     136 
     137Xinha.InlineStyler.prototype.applyStyleIfMatch    = function(params, ifMatchRe) 
     138{ 
     139  return this.applyStyle(params, ifMatchRe); 
    127140}; 
    128141 
     
    389402  tr.appendChild(td); 
    390403  input = doc.createElement("input"); 
     404  var borderColourInput = input; 
    391405  input.name = this.dialog.createId("borderColor"); 
    392406  input.value = Xinha._colorToRgb( el.style.borderColor ); 
     
    398412   
    399413  select = doc.createElement("select"); 
     414  var borderSelect = select;   
    400415  select.name = this.dialog.createId("borderStyle"); 
    401416  var borderFields = []; 
     
    435450  }; 
    436451   
    437   input = doc.createElement("input"); 
     452 
     453   
     454  input = doc.createElement("input"); 
     455  var borderWidthInput = input 
    438456  input.name = this.dialog.createId("borderWidth"); 
    439457  borderFields.push(input); 
     
    450468   
    451469  setBorderFieldsStatus(select.value == "none"); 
     470   
     471  // if somebody changes the border colour, and the border Style is not set, set it 
     472  // because otherwise they might not do that and get confused 
     473  borderColourInput.oncolorpicked = function(){ 
     474    if(borderSelect.selectedIndex == 0) 
     475    { 
     476      borderSelect.selectedIndex = 3; 
     477      borderSelect.onchange(); 
     478    }  
     479     
     480    if(!borderWidthInput.value.length)  
     481    { 
     482      borderWidthInput.value = 1; 
     483    } 
     484  }; 
    452485   
    453486  if (el.tagName.toLowerCase() == "table")  
Note: See TracChangeset for help on using the changeset viewer.