[svn r21752] FS#2867 - The FCKEditor, the youtube plugin: Minor changes, code cosmetics.

skala
Ivan Tcholakov 17 years ago
parent 52522153e1
commit 542a6d8d6c
  1. 36
      main/inc/lib/fckeditor/editor/plugins/youtube/youtube.js

@ -7,7 +7,7 @@ var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
var FCKTools = oEditor.FCKTools ;
//security RegExp
// Security RegExp
var REG_SCRIPT = new RegExp( "< *script.*>|< *style.*>|< *link.*>|< *body .*>", "i" ) ;
var REG_PROTOCOL = new RegExp( "javascript:|vbscript:|about:", "i" ) ;
var REG_CALL_SCRIPT = new RegExp( "&\{.*\};", "i" ) ;
@ -116,8 +116,9 @@ function Ok()
return false ;
}
// check security
if (checkCode(GetE('txtUrl').value) == false) {
// Check security
if ( checkCode( GetE( 'txtUrl' ).value ) == false )
{
alert( oEditor.FCKLang.DlgYouTubeSecurity ) ;
return false ;
}
@ -150,39 +151,48 @@ function UpdateEmbed( e )
SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ;
SetAttribute( e, 'pluginspage', 'http://www.macromedia.com/go/getflashplayer' ) ;
SetAttribute( e, 'allowfullscreen', 'true' ) ;
if ( GetE('radioHigh').checked ) {
if ( GetE( 'radioHigh' ).checked )
{
SetAttribute( e, 'src', YoutubeSite + YoutubeId + HighQualityString ) ;
} else {
}
else
{
SetAttribute( e, 'src', YoutubeSite + YoutubeId + LowQualityString ) ;
}
SetAttribute( e, "width" , GetE('txtWidth').value == '' ? 425 : GetE('txtWidth').value ) ;
SetAttribute( e, "height" , GetE('txtHeight').value == '' ? 344 : GetE('txtHeight').value ) ;
SetAttribute( e, 'width' , GetE( 'txtWidth' ).value == '' ? 425 : GetE( 'txtWidth' ).value ) ;
SetAttribute( e, 'height', GetE( 'txtHeight' ).value == '' ? 344 : GetE( 'txtHeight' ).value ) ;
}
function checkCode( code )
{
if (code.search(REG_SCRIPT) != -1) {
if ( code.search( REG_SCRIPT ) != -1 )
{
return false ;
}
if (code.search(REG_PROTOCOL) != -1) {
if ( code.search( REG_PROTOCOL ) != -1 )
{
return false ;
}
if (code.search(REG_CALL_SCRIPT) != -1) {
if ( code.search( REG_CALL_SCRIPT ) != -1 )
{
return false ;
}
if (code.search(REG_EVENT) != -1) {
if ( code.search( REG_EVENT ) != -1 )
{
return false ;
}
if (code.search(REG_AUTH) != -1) {
if ( code.search( REG_AUTH ) != -1 )
{
return false ;
}
if (code.search(REG_NEWLINE) != -1) {
if ( code.search( REG_NEWLINE ) != -1 )
{
return false ;
}
}

Loading…
Cancel
Save