Changeset 1487

Show
Ignore:
Timestamp:
12/22/07 18:18:58 (10 months ago)
Author:
rho
Message:

patch #215, auto fill video size

Signed-off: Rolando Espinoza La fuente <rho@prosoftpeople.com>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/contenttoolbar/contenttoolbar_video_wizard.php

    r1081 r1487  
    2626 
    2727$explanation = __gettext("To embed videos from popular sites like Google Video and Youtube, obtain the embed HTML, paste it in the following form and configure your preferred size:"); 
    28 $video_url_label = __gettext("Video URL"); 
     28$video_url_label = __gettext("Video embed code"); 
    2929$video_size_label = __gettext("Video size"); 
    3030$video_button_label = __gettext("Insert video"); 
  • devel/mod/contenttoolbar/js/edit.js

    r1248 r1487  
    338338 
    339339/** 
     340 * Auto detect embed object size 
     341 * @author Rolando Espinoza La fuente <rho@prosoftpeople.com> 
     342 */ 
     343function parseSize(text, wid, hid) { 
     344var embedpattern = /<(embed|object)[\w\s\"=;:.&\?\/-]*>.*<\/(embed|object)>/; 
     345var sizew = /width=\"(\d+)\"/; 
     346var sizeh = /height=\"(\d+)\"/; 
     347var embed = text.match(embedpattern); 
     348 
     349if(embed==null) return null; 
     350 
     351width = sizew.exec(embed[0]); 
     352height = sizeh.exec(embed[0]); 
     353 
     354if (width!=null) {document.getElementById(wid).value=width[1];} 
     355if (height!=null) {document.getElementById(hid).value=height[1];} 
     356 
     357} 
     358 
     359/** 
    340360 * Called by to insert a new video string 
    341361 * @param string edid input_field id 
  • devel/mod/contenttoolbar/lib.php

    r1147 r1487  
    4949 
    5050function contenttoolbar_widget_edit($widget) { 
    51   global $CFG, $page_owner; 
     51  global $CFG, $page_owner, $metatags; 
     52 
     53  $metatags .= '<script type="text/javascript" src="'.$CFG->wwwroot.'mod/contenttoolbar/js/edit.js"><!-- edit.js --></script>'; 
    5254 
    5355  $video_url = widget_get_data("video_url",$widget->ident); 
     
    6062  $body = "<h2>" . __gettext("Video widget") . "</h2>"; 
    6163  $explanation = __gettext("To embed videos from popular sites like Google Video and Youtube, obtain the embed HTML, paste it in the following form and configure your preferred size:"); 
    62   $video_url_label = __gettext("Video URL"); 
     64  $video_url_label = __gettext("Video embed code"); 
    6365  $video_size_label = __gettext("Video size"); 
    6466  $video_button_label = __gettext("Insert Video"); 
  • devel/mod/contenttoolbar/templates/video_widget.html

    r1081 r1487  
    66                <tr> 
    77                        <td><label>{{video_url_label}}:</label></td> 
    8                         <td><textarea id="video_url" name="widget_data[video_url]" cols="50" rows="6">{{video_url}}</textarea></td> 
     8                        <td><textarea id="video_url" name="widget_data[video_url]" cols="50" rows="6" onblur="parseSize(this.value,'video_width','video_height');" >{{video_url}}</textarea></td> 
    99                </tr> 
    1010                <tr> 
  • devel/mod/contenttoolbar/templates/video_wizard.html

    r1081 r1487  
    1616                <tr> 
    1717                        <td><label>{{video_url_label}}:</label></td> 
    18                         <td><textarea id="video_url" cols="40" rows="5"></textarea></td> 
     18                        <td><textarea id="video_url" cols="40" rows="5" onblur="parseSize(this.value,'video_width','video_height');"></textarea></td> 
    1919                </tr> 
    2020                <tr>