Dotclear


Ignore:
Timestamp:
03/02/18 15:55:06 (8 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/dcLegacyEditor/js/jsToolBar/popup_media.js

    r3709 r3725  
    6666 
    6767      align = $('input[name="alignment"]:checked', insert_form).val(); 
     68 
    6869      var title = insert_form.elements.title.value; 
    69  
    70       $('video', oplayer).attr('width', $('#video_w').val()); 
    71       $('video', oplayer).attr('height', $('#video_h').val()); 
    72  
    7370      if (title) { 
    7471        flashvars = 'title=' + encodeURI(title) + '&amp;' + flashvars; 
    7572      } 
    76       $('object', oplayer).attr('width', $('#video_w').val()); 
    77       $('object', oplayer).attr('height', $('#video_h').val()); 
    78       flashvars = flashvars.replace(/(width=\d*)/, 'width=' + $('#video_w').val()); 
    79       flashvars = flashvars.replace(/(height=\d*)/, 'height=' + $('#video_h').val()); 
     73 
     74      var vw = $('#video_w').val(); 
     75      var vh = $('#video_h').val(); 
     76 
     77      if (vw > 0) { 
     78        $('video', oplayer).attr('width', vw); 
     79        $('object', oplayer).attr('width', vw); 
     80        flashvars = flashvars.replace(/(width=\d*)/, 'width=' + vw); 
     81      } else { 
     82        $('video', oplayer).removeAttr('width'); 
     83        $('object', oplayer).removeAttr('width'); 
     84        flashvars = flashvars.replace(/(width=\d*)/, ''); 
     85      } 
     86      if (vh > 0) { 
     87        $('video', oplayer).attr('height', vh); 
     88        $('object', oplayer).attr('height', vh); 
     89        flashvars = flashvars.replace(/(height=\d*)/, 'height=' + vh); 
     90      } else { 
     91        $('video', oplayer).removeAttr('height'); 
     92        $('object', oplayer).removeAttr('height'); 
     93        flashvars = flashvars.replace(/(height=\d*)/, ''); 
     94      } 
    8095 
    8196      $('[name=FlashVars]', oplayer).val(flashvars); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map