1 // This program is free software; you can redistribute it and/or
2 // modify it under the terms of the GNU General Public License
3 // as published by the Free Software Foundation; either version 2
4 // of the License, or (at your option) any later version.
5 function moveOptions_11(theSelFrom, theSelTo){
6 document.getElementById(theSelFrom).style.color="red";
7 document.getElementById(theSelFrom).style.fontStyle="italic";
8 var str=document.getElementById(theSelFrom).innerHTML;
9 if(window.frames[0].document.body.innerHTML=='<br>')
10 window.frames[0].document.body.innerHTML="";
12 var result=patt.test(str);
14 url = 'quest_popup.php?content='+str;
15 window.open(url,'quest_pop','width=640,height=190,menubar=no,toolbar=0,location=0, directories=0, status=0,left=400,top=375');
19 CKEDITOR.instances.textarea1.insertText(val);
22 function movePD(val,theSelTo){
23 var textAreaContent = window.frames[0].document.body.innerHTML;
25 if(textAreaContent != '')
26 textAreaContent += " "+textFrom;
28 textAreaContent += textFrom;
29 window.frames[0].document.body.innerHTML=textAreaContent;
32 val=window.parent.document.getElementById(id).value;
33 arr=val.split("|*|*|*|");
34 document.getElementById('textarea1').value=arr[0];
36 function ascii_write(asc, theSelTo){
37 var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
38 var is_ie = navigator.userAgent.toLowerCase().indexOf('msie') > -1;
39 var is_apple = navigator.userAgent.toLowerCase().indexOf('apple') > -1;
43 var plugin = CKEDITOR.plugins.enterkey,
44 enterBr = plugin.enterBr,
45 editor=CKEDITOR.instances.textarea1;
46 forceMode = editor.config.forceEnterMode;
47 mode = editor.config.enterMode;
48 editor.fire( 'saveSnapshot' ); // Save undo step.
49 enterBr( editor, mode, null, forceMode );
50 if(is_chrome || is_apple)
51 enterBr( editor, mode, null, forceMode );
54 CKEDITOR.instances.textarea1.insertText('\r\n');
59 var textFrom = "\r\n\r\n";
60 CKEDITOR.instances.textarea1.insertText(textFrom);
61 if(is_chrome || is_apple)
62 CKEDITOR.instances.textarea1.insertText(textFrom);
69 var textFrom = String.fromCharCode(asc);
70 CKEDITOR.instances.textarea1.insertText(textFrom);
74 function SelectToSave(textara){
75 var textAreaContent = window.frames[0].document.body.innerHTML;
76 mainform=window.parent.document;
77 if(mainform.getElementById(textara+'_div'))
78 mainform.getElementById(textara+'_div').innerHTML = textAreaContent;
79 if(mainform.getElementById(textara+'_optionTD') && document.getElementById('options'))
80 mainform.getElementById(textara+'_optionTD').innerHTML =document.getElementById('options').innerHTML;
81 if(mainform.getElementById(textara)){
82 mainform.getElementById(textara).value = textAreaContent;
83 if(document.getElementById('options'))
84 mainform.getElementById(textara).value +="|*|*|*|"+document.getElementById('options').innerHTML;
86 parent.$.fn.fancybox.close();
88 function removeHTMLTags(strInputCode){
90 This line is optional, it replaces escaped brackets with real ones,
91 i.e. < is replaced with < and > is replaced with >
93 strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
94 return (p1 == "lt")? "<" : ">";
96 var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
98 function TemplateSentence(val){
100 document.getElementById('share').style.display='';
103 document.getElementById('share').style.display='none';
107 url: "ajax_code.php",
112 success: function(thedata){
114 document.getElementById('template_sentence').innerHTML = thedata;
122 function delete_item(id){
124 if(confirm("Do you really wants to delete this?")){
127 url: "ajax_code.php",
130 templateid: document.getElementById('template').value,
132 source: "delete_item"
134 success: function(thedata){
136 document.getElementById('template_sentence').innerHTML = thedata;
147 document.getElementById('new_item').style.display='';
148 document.getElementById('item').focus();
150 function cancel_item(id){
151 if(document.getElementById('new_item'))
152 document.getElementById('new_item').style.display='none';
153 if(document.getElementById('update_item'+id))
154 document.getElementById('update_item'+id).style.display='none';
156 function save_item(){
159 url: "ajax_code.php",
162 item: document.getElementById('item').value,
163 templateid: document.getElementById('template').value,
167 success: function(thedata){
169 document.getElementById('template_sentence').innerHTML = thedata;
178 function update_item_div(id){
179 document.getElementById('update_item'+id).style.display='';
180 document.getElementById('update_item_txt'+id).focus();
182 function update_item(id){
185 url: "ajax_code.php",
189 templateid: document.getElementById('template').value,
190 content: document.getElementById('update_item_txt'+id).value,
191 source: "update_item"
194 success: function(thedata){
196 document.getElementById('template_sentence').innerHTML = thedata;