web/drupal/modules/fckeditor/plugins/imgassist/fck_imgassist.html
branchdrupal
changeset 74 0ff3ba646492
equal deleted inserted replaced
73:fcf75e232c5b 74:0ff3ba646492
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
       
     2 <!--
       
     3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
       
     4  * Copyright (C) 2003-2007 Frederico Caldeira Knabben
       
     5  *
       
     6  * == BEGIN LICENSE ==
       
     7  *
       
     8  * Licensed under the terms of any of the following licenses at your
       
     9  * choice:
       
    10  *
       
    11  *  - GNU General Public License Version 2 or later (the "GPL")
       
    12  *    http://www.gnu.org/licenses/gpl.html
       
    13  *
       
    14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
       
    15  *    http://www.gnu.org/licenses/lgpl.html
       
    16  *
       
    17  *  - Mozilla Public License Version 1.1 or later (the "MPL")
       
    18  *    http://www.mozilla.org/MPL/MPL-1.1.html
       
    19  *
       
    20  * == END LICENSE ==
       
    21  *
       
    22  * Link dialog window.
       
    23 -->
       
    24 <html>
       
    25 <head>
       
    26 	<title>Image Properties</title>
       
    27 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
    28 	<meta name="robots" content="noindex, nofollow" />
       
    29 	<script type="text/javascript">
       
    30 
       
    31 var oEditor		= window.parent.InnerDialogLoaded() ;
       
    32 var FCK			= oEditor.FCK ;
       
    33 var FCKLang		= oEditor.FCKLang ;
       
    34 var FCKConfig	= oEditor.FCKConfig ;
       
    35 var FCKRegexLib	= oEditor.FCKRegexLib ;
       
    36 var FCKTools	= oEditor.FCKTools ;
       
    37 
       
    38 document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' ) ;
       
    39 
       
    40 	</script>
       
    41 	<script type="text/javascript">
       
    42 
       
    43 // Get the selected flash embed (if available).
       
    44 var oFakeImage = FCK.Selection.GetSelectedElement() ;
       
    45 var oImgAssistNode ;
       
    46 
       
    47 if ( oFakeImage )
       
    48 {
       
    49 	if ( oFakeImage.tagName == 'IMG' && GetAttribute(oFakeImage, '_fckimgassist', false) )
       
    50 	if ( GetAttribute(oFakeImage, 'nid', false) ) oImgAssistNode = oFakeImage ;
       
    51 	else
       
    52 		oFakeImage = null ;
       
    53 }
       
    54 
       
    55 window.onload = function()
       
    56 {
       
    57 	// Translate the dialog box texts.
       
    58 	oEditor.FCKLanguageManager.TranslatePage(document) ;
       
    59 
       
    60 	// Load the selected link information (if any).
       
    61 	LoadSelection() ;
       
    62 
       
    63 	// Activate the "OK" button.
       
    64 	window.parent.SetOkButton( true ) ;
       
    65 	window.parent.SetAutoSize( true ) ;
       
    66 }
       
    67 
       
    68 function LoadSelection()
       
    69 {
       
    70 	if ( !oImgAssistNode ) return ;	
       
    71   if ( oImgAssistNode.getAttribute('nid') ) {
       
    72     var NodeContent = FCKTools.ImageAssistCode( oImgAssistNode );
       
    73     if( NodeContent ) GetE('xTemplateRaw').value = NodeContent;
       
    74   }
       
    75 }
       
    76 
       
    77 //#### The OK button was hit.
       
    78 function Ok()
       
    79 {
       
    80 	oEditor.FCKUndo.SaveUndoStep() ;
       
    81   var templateData = FCKTools.HTMLEncode( GetE('xTemplateRaw').value ).Trim().replace( /"/g, '&quot;' ) ;
       
    82 	if ( !( /^\[img_assist[^\[\]]+\]$/.test( templateData ) ) )
       
    83 	{
       
    84 		alert( 'Image tag must start with [img_assist and end with ]. Please check it.' ) ;
       
    85 		return false ;
       
    86 	}
       
    87 	
       
    88 	//if ( !oImgAssistNode )
       
    89     var oImgAssistNode1 = FCKTools.ImageAssistDecode( templateData );
       
    90     oImgAssistNode.parentNode.insertBefore(oImgAssistNode1, oImgAssistNode);
       
    91     oImgAssistNode.parentNode.removeChild(oImgAssistNode);
       
    92     oEditor.FCKSelection.SelectNode( oImgAssistNode1 ) ;
       
    93 //alert(a)
       
    94    // oImgAssistNode.appendNode(oImgAssistNode1);
       
    95 /*
       
    96 	FCKDragTableHandler
       
    97   
       
    98 	if ( !oFakeImage )
       
    99 	{
       
   100 		oFakeImage	= oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__ImgAssist', oImgAssistNode ) ;
       
   101         oFakeImage.setAttribute( "_fckimgassist", "true" ) ;
       
   102         oFakeImage.style.background="url(" + FCKConfig.PluginsPath + "imgassist/imgassist.gif);";
       
   103         oFakeImage.style.width=72;
       
   104         oFakeImage.style.height=50;
       
   105 		oFakeImage	= FCK.InsertElement( oFakeImage ) ;
       
   106 	}
       
   107 */
       
   108 	return true ;
       
   109 }
       
   110 
       
   111 	</script>
       
   112 </head>
       
   113 <body style="overflow: hidden">
       
   114 	<div id="divInfo">
       
   115 		<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
       
   116 			<tr>
       
   117 				<td>
       
   118 					<span>Image Assist raw definition (from <code>[img_assist</code> to <code>]</code>)</span><br />
       
   119 				</td>
       
   120 			</tr>
       
   121 			<tr>
       
   122 				<td height="100%">
       
   123 					<textarea id="xTemplateRaw" style="width: 100%; height: 100%; font-family: Monospace"
       
   124 						cols="50" rows="10"></textarea>
       
   125 				</td>
       
   126 			</tr>
       
   127 		</table>
       
   128 	</div>
       
   129 </body>
       
   130 </html>