Changeset 82
- Timestamp:
- 04/05/07 22:44:34 (2 years ago)
- Files:
-
- contenttoolbar/contenttoolbar_init.php (modified) (2 diffs)
- contenttoolbar/contenttoolbar_video_wizard.php (modified) (3 diffs)
- contenttoolbar/default_template.php (modified) (1 diff)
- contenttoolbar/js/edit.js (modified) (2 diffs)
- contenttoolbar/templates/contenttoolbar.html (modified) (1 diff)
- contenttoolbar/templates/video_widget.html (modified) (1 diff)
- contenttoolbar/templates/video_wizard.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contenttoolbar/contenttoolbar_init.php
r81 r82 17 17 global $metatags,$CFG,$contenttoolbarbuttons; 18 18 19 if(!empty($parameter)){ 20 $field = $parameter; 21 } 22 else { 23 $field = 'new_weblog_post'; 24 } 25 19 26 $url= substr($CFG->wwwroot, 0, -1); 20 27 $metatags .= "<script language=\"javascript\" type=\"text/javascript\" src=\"$url/mod/contenttoolbar/js/helpers.js\"></script>"; … … 33 40 $run_result .= templates_draw(array('context'=>'contenttoolbar', 34 41 'js_buttons'=> $js_buttons, 35 'buttons'=> $buttons 42 'buttons'=> $buttons, 43 'input_field'=>$field 36 44 ) 37 45 ); contenttoolbar/contenttoolbar_video_wizard.php
r81 r82 17 17 templates_page_setup(); 18 18 19 $field = optional_param('input_field','new_weblog_post'); 20 19 21 $url= substr($CFG->wwwroot, 0, -1); 20 22 $metatags .= "<script language=\"javascript\" type=\"text/javascript\" src=\"$url/mod/contenttoolbar/js/helpers.js\"></script>"; … … 27 29 $video_size_label = __gettext("Video size"); 28 30 $video_button_label = __gettext("Insert Video"); 31 $error_msg = __gettext("You must to specify a valid and not empty video string"); 29 32 30 33 $run_result = templates_draw(array('context'=>'video_wizard', … … 33 36 'video_url_label' => $video_url_label, 34 37 'video_size_label' => $video_size_label, 35 'video_button_label' => $video_button_label 38 'video_button_label' => $video_button_label, 39 'error_msg' => $error_msg, 40 'input_field' => $field 36 41 ) 37 42 ); contenttoolbar/default_template.php
r81 r82 34 34 '{{video_url_label}}' => __gettext("Video URL label"), 35 35 '{{video_size_label}}' => __gettext("Video size label"), 36 '{{video_button_label}}' => __gettext("Video insert button label") 36 '{{video_button_label}}' => __gettext("Video insert button label"), 37 '{{input_field}}' => __gettext("Input field for the video tag"), 38 '{{error_msg}}' => __gettext("Invalid embed object error message") 37 39 ) 38 40 ); contenttoolbar/js/edit.js
r81 r82 173 173 case 'mediapopup': 174 174 eval("btn.onclick = function(){window.open('"+ 175 jsEscape(tb[i]['url'])+" ','"+175 jsEscape(tb[i]['url'])+"?input_field="+jsEscape(edid)+"','"+ 176 176 jsEscape(tb[i]['name'])+"','"+ 177 177 jsEscape(tb[i]['options'])+ … … 339 339 /** 340 340 * Called by picker buttons to insert Text and close the picker again 341 * 341 * @param string edid input_field id 342 * @param string err_msg error message 342 343 * @author Diego Andrés Ramírez Aragón <diego@somosmas.org> 343 344 */ 344 function insertVideo(edid ){345 function insertVideo(edid,err_msg){ 345 346 var text = $('video_url'); 346 347 if(!text.value){ 347 alert( "You must to specify the video URL");348 alert(err_msg); 348 349 return false; 349 350 } 350 alert(text.value);351 351 var value = parseEmbed(text.value); 352 352 if(value===null){ 353 alert( "You must to specify the video URL");353 alert(err_msg); 354 354 return false; 355 355 } 356 alert(value);357 356 var w = $('video_width'); 358 357 var h = $('video_height'); contenttoolbar/templates/contenttoolbar.html
r81 r82 6 6 {{js_buttons}} 7 7 8 initToolbar('content_toolbar',' new_weblog_post',toolbar);8 initToolbar('content_toolbar','{{input_field}}',toolbar); 9 9 </script> contenttoolbar/templates/video_widget.html
r81 r82 6 6 <tr> 7 7 <td><label>{{video_url_label}}:</label></td> 8 <td><textarea id="video_url" name="widget_data[video_url]" cols=" 25" rows="5">{{video_url}}</textarea></td>8 <td><textarea id="video_url" name="widget_data[video_url]" cols="50" rows="6">{{video_url}}</textarea></td> 9 9 </tr> 10 10 <tr> contenttoolbar/templates/video_wizard.html
r81 r82 10 10 11 11 <form> 12 <table id="wizard_form" cellpadding="2" cellspacing=" 1">12 <table id="wizard_form" cellpadding="2" cellspacing="2"> 13 13 <tbody> 14 14 <tr> … … 17 17 <tr> 18 18 <td><label>{{video_url_label}}:</label></td> 19 <td><textarea id="video_url" cols=" 25" rows="5"></textarea></td>19 <td><textarea id="video_url" cols="40" rows="5"></textarea></td> 20 20 </tr> 21 21 <tr> … … 26 26 </tr> 27 27 <tr> 28 <td colspan="2" align="center"><input type="button" onclick="insertVideo(' new_weblog_post'); window.close()" value="{{video_button_label}}"/></td>28 <td colspan="2" align="center"><input type="button" onclick="insertVideo('{{input_field}}','{{error_msg}}');" value="{{video_button_label}}"/></td> 29 29 </tr> 30 30 </tbody>
