Dotclear


Ignore:
Timestamp:
03/02/18 15:55:06 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Use specialized input fields (color, email, url, number, …) where is relevant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcCKEditor/js/popup_media.js

    r3709 r3725  
    106106 
    107107      var align_video = $('input[name="alignment"]:checked', insert_form).val(); 
     108 
    108109      var title = insert_form.elements.title.value; 
    109  
    110       $('video', oplayer).attr('width', $('#video_w').val()); 
    111       $('video', oplayer).attr('height', $('#video_h').val()); 
    112  
    113110      if (title) { 
    114111        flashvars = 'title=' + encodeURI(title) + '&amp;' + flashvars; 
    115112      } 
    116       $('object', oplayer).attr('width', $('#video_w').val()); 
    117       $('object', oplayer).attr('height', $('#video_h').val()); 
    118       flashvars = flashvars.replace(/(width=\d*)/, 'width=' + $('#video_w').val()); 
    119       flashvars = flashvars.replace(/(height=\d*)/, 'height=' + $('#video_h').val()); 
     113 
     114      var vw = $('#video_w').val(); 
     115      var vh = $('#video_h').val(); 
     116 
     117      if (vw > 0) { 
     118        $('video', oplayer).attr('width', vw); 
     119        $('object', oplayer).attr('width', vw); 
     120        flashvars = flashvars.replace(/(width=\d*)/, 'width=' + vw); 
     121      } else { 
     122        $('video', oplayer).removeAttr('width'); 
     123        $('object', oplayer).removeAttr('width'); 
     124        flashvars = flashvars.replace(/(width=\d*)/, ''); 
     125      } 
     126      if (vh > 0) { 
     127        $('video', oplayer).attr('height', vh); 
     128        $('object', oplayer).attr('height', vh); 
     129        flashvars = flashvars.replace(/(height=\d*)/, 'height=' + vh); 
     130      } else { 
     131        $('video', oplayer).removeAttr('height'); 
     132        $('object', oplayer).removeAttr('height'); 
     133        flashvars = flashvars.replace(/(height=\d*)/, ''); 
     134      } 
    120135 
    121136      $('[name=FlashVars]', oplayer).val(flashvars); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map