' ) ; if ( ( closeTagIndex != -1 && startTagIndex != -1 && closeTagIndex < startTagIndex ) || ( closeTagIndex != -1 && startTagIndex == -1 ) ) { var prefix = sText.substr( 0, closeTagIndex ) ; sText = sText.substr( closeTagIndex + 4 ) ; this.InsertHtml( prefix ) ; } // Insert the resulting data in the editor. FCKUndo.SaveLocked = true ; this.InsertHtml( sText ) ; FCKUndo.SaveLocked = false ; } } FCK._CheckIsPastingEnabled = function( returnContents ) { // The following seams to be the only reliable way to check is script // pasting operations are enabled in the security settings of IE6 and IE7. // It adds a little bit of overhead to the check, but so far that's the // only way, mainly because of IE7. FCK._PasteIsEnabled = false ; document.body.attachEvent( 'onpaste', FCK_CheckPasting_Listener ) ; // The execCommand in GetClipboardHTML will fire the "onpaste", only if the // security settings are enabled. var oReturn = FCK.GetClipboardHTML() ; document.body.detachEvent( 'onpaste', FCK_CheckPasting_Listener ) ; if ( FCK._PasteIsEnabled ) { if ( !returnContents ) oReturn = true ; } else oReturn = false ; delete FCK._PasteIsEnabled ; return oReturn ; } function FCK_CheckPasting_Listener() { FCK._PasteIsEnabled = true ; } FCK.GetClipboardHTML = function() { var oDiv = document.getElementById( '___FCKHiddenDiv' ) ; if ( !oDiv ) { oDiv = document.createElement( 'DIV' ) ; oDiv.id = '___FCKHiddenDiv' ; var oDivStyle = oDiv.style ; oDivStyle.position = 'absolute' ; oDivStyle.visibility = oDivStyle.overflow = 'hidden' ; oDivStyle.width = oDivStyle.height = 1 ; document.body.appendChild( oDiv ) ; } oDiv.innerHTML = '' ; var oTextRange = document.body.createTextRange() ; oTextRange.moveToElementText( oDiv ) ; oTextRange.execCommand( 'Paste' ) ; var sData = oDiv.innerHTML ; oDiv.innerHTML = '' ; return sData ; } FCK.CreateLink = function( url, noUndo ) { // Creates the array that will be returned. It contains one or more created links (see #220). var aCreatedLinks = new Array() ; // Remove any existing link in the selection. FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; if ( url.length > 0 ) { // If there are several images, and you try to link each one, all the images get inside the link: // -> -> due to the call to 'CreateLink' (bug in IE) if (FCKSelection.GetType() == 'Control') { // Create a link var oLink = this.EditorDocument.createElement( 'A' ) ; oLink.href = url ; // Get the selected object var oControl = FCKSelection.GetSelectedElement() ; // Put the link just before the object oControl.parentNode.insertBefore(oLink, oControl) ; // Move the object inside the link oControl.parentNode.removeChild( oControl ) ; oLink.appendChild( oControl ) ; return [ oLink ] ; } // Generate a temporary name for the link. var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ; // Use the internal "CreateLink" command to create the link. FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl, false, !!noUndo ) ; // Look for the just create link. var oLinks = this.EditorDocument.links ; for ( i = 0 ; i < oLinks.length ; i++ ) { var oLink = oLinks[i] ; // Check it this a newly created link. // getAttribute must be used. oLink.url may cause problems with IE7 (#555). if ( oLink.getAttribute( 'href', 2 ) == sTempUrl ) { var sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL). oLink.href = url ; oLink.innerHTML = sInnerHtml ; // Restore the innerHTML. // If the last child is a move it outside the link or it // will be too easy to select this link again #388. var oLastChild = oLink.lastChild ; if ( oLastChild && oLastChild.nodeName == 'BR' ) { // Move the BR after the link. FCKDomTools.InsertAfterNode( oLink, oLink.removeChild( oLastChild ) ) ; } aCreatedLinks.push( oLink ) ; } } } return aCreatedLinks ; } function _FCK_RemoveDisabledAtt() { this.removeAttribute( 'disabled' ) ; } function Doc_OnMouseDown( evt ) { var e = evt.srcElement ; // Radio buttons and checkboxes should not be allowed to be triggered in IE // in editable mode. Otherwise the whole browser window may be locked by // the buttons. (#1782) if ( e.nodeName.IEquals( 'input' ) && e.type.IEquals( ['radio', 'checkbox'] ) && !e.disabled ) { e.disabled = true ; FCKTools.SetTimeout( _FCK_RemoveDisabledAtt, 1, e ) ; } }