1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4
5	<title>insertHtml</title>
6
7	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8	<meta name="robots" content="noindex, nofollow" />
9
10
11		<script type="text/javascript">
12
13var oEditor = window.parent.InnerDialogLoaded() ;
14
15var FCKGeshi = oEditor.FCKGeshi ;
16var FCKLang = oEditor.FCKLang ;
17var selectedText="";
18window.onload = function()
19{
20
21if(FCKGeshi.isIE) {
22    document.getElementById('i_panel').style.width="400px";
23}
24
25    oEditor.FCKLanguageManager.TranslatePage( document );
26	document.body.style.padding = '0px' ;
27	window.parent.SetOkButton( true ) ;
28	window.parent.SetAutoSize( true ) ;
29
30   var sel_opts = document.getElementById('langs');
31
32
33    if(oEditor.FCKConfig && oEditor.FCKConfig.Geshi_Types) {
34       var lang_opts = oEditor.FCKConfig.Geshi_Types;
35       sel_opts.options[0] = new Option(FCKLang.DlgCellBtnSelect,'none',true,false);
36       for(var i=0; i < lang_opts.length; i++) {
37           sel_opts.options[sel_opts.options.length] = new Option(lang_opts[i],lang_opts[i],false,false);
38       }
39    }
40   var text = FCKGeshi.CheckForText();
41   var formObj = document.geshi_form;
42   if(text) formObj.text_in.value = text;
43
44    var select = document.getElementById('langs');
45    var restoredLang = gshReadLang();
46    if (select && restoredLang) {
47        select.selectedIndex = restoredLang;
48    }
49}
50
51function Ok()
52{
53    var select = document.getElementById('langs');
54    var selection = select.selectedIndex;
55    if(selection < 1) {
56       alert(FCKLang.geshiAlertLanguage || "Please Select a Language");
57       return;
58    }
59    var formObj = document.geshi_form;
60    var code_type = '';
61    var fname = '';
62    if(formObj['gtype'][1].checked) {
63      code_type = formObj['gtype'][1].value;
64      fname = formObj['snip_fn'].value;
65      if(!fname) {
66       alert(FCKLang.geshiAlertSnippet ||"Please Enter a File Name for this Snippet");
67       return;
68      }
69    }
70    else {
71     code_type = formObj['gtype'][0].value;
72    }
73     gshSaveLang(selection);
74
75   //alert(formObj.text_in.value);
76   if(formObj.text_in.value)  {
77      FCKGeshi.InsertText(code_type, select.options[selection].value, fname,formObj.text_in.value);
78   }
79   else {
80     FCKGeshi.Insert(code_type, select.options[selection].value, fname);
81   }
82
83	return true ;
84}
85
86function gshSaveLang(selection) {
87    gshCreateCookie("fckg_geshi_lang", selection, 365 * 3);
88}
89
90
91function gshReadLang() {
92    return gshReadCookie("fckg_geshi_lang");
93}
94
95function toggle_i_panel(which) {
96    var p = document.getElementById('i_panel');
97    p.style.display=which;
98    var i_help =  document.getElementById('i_help');
99    if(which == 'block') {
100       i_help.style.display = 'none';
101    }
102    else i_help.style.display = 'block';
103}
104
105
106function gshCreateCookie(name,value,days) {
107    if (days) {
108        var date = new Date();
109        date.setTime(date.getTime()+(days*24*60*60*1000));
110        var expires = "; expires="+date.toGMTString();
111    }
112    else var expires = "";
113    document.cookie = name+"="+value+expires+"; path=/";
114}
115
116function gshReadCookie(name) {
117    var nameEQ = name + "=";
118    var ca = document.cookie.split(';');
119    for(var i=0;i < ca.length;i++) {
120        var c = ca[i];
121        while (c.charAt(0)==' ') c = c.substring(1,c.length);
122        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
123    }
124    return null;
125}
126
127		</script>
128
129<style type="text/css">
130option, select { font-size: 9pt; }
131#geshi_types,#i_panel { padding: 10px; font-size: 9pt; margin:0; }
132#i_panel {
133   border: 2px solid silver;
134   position: fixed; top: 40px; left: 20px;
135   background-color: #fff; width: 460px;
136   display: none;
137}
138#i_help { display: inline; }
139</style>
140
141
142</head>
143<body style="padding-bottom: 0px">
144
145<div id='geshi_types' >
146
147     <div id="i_panel">
148      <button onclick="toggle_i_panel('none');" ><span fckLang="DlgBtnClose">close</span></button><br />
149      <span fckLang="geshiHelp" id="geshiHelp">help</span>
150       <span fckLang = "GeshiInstructionList"</span></span>
151       </div>
152       <button id="i_help" onclick="toggle_i_panel('block');"><span fckLang="geshiHelpButton" id="geshiHelpButton">Instructions</span></button><br />
153
154     <form name='geshi_form'>
155     <br />
156     <b><span fckLang="DlgButtonType"></span>: </b><input type='radio' name='gtype' value='code' checked>
157        <span fckLang="GeshiCodeBlock"></span>
158       <input type='radio' name='gtype' value='file'><span fckLang="GeshiDownloadable"></span>
159
160       <br />
161       <span fckLang="geshiSnippetFileName">Snippet file name</span><input type="text" name="snip_fn">
162     <p>
163			<select id="langs">
164             <!-- option value="none"><span fckLang='DlgCellBtnSelect'></span  -->
165
166           </select>
167   </p>
168     <br />
169     <center>
170    <textarea name = "text_in" rows="15" cols = "60"></textarea>
171     </center>
172    </form>
173</div>
174</body>
175</html>
176