Merged from McMasterReports branch
@@ -1,5 +1,136 @@
|
||||
<script type='text/javascript'>
|
||||
<!--
|
||||
$(document).ready(function(){
|
||||
setupAllTabs();
|
||||
if(typeof(userdateformat) !== 'undefined')
|
||||
{
|
||||
$(".popupdate").datepicker({ dateFormat: userdateformat,
|
||||
showOn: 'button',
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
duration: 'fast'
|
||||
}, $.datepicker.regional[userlanguage]);
|
||||
$(".popupdatetime").datepicker({ dateFormat: userdateformat+' 00:00',
|
||||
showOn: 'button',
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
duration: 'fast'
|
||||
}, $.datepicker.regional[userlanguage]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//We have form validation and other stuff..
|
||||
|
||||
function validatefilename (form, strmessage )
|
||||
{
|
||||
if (form.the_file.value == "") {
|
||||
alert( strmessage );
|
||||
form.the_file.focus();
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
// If the length of the element's string is 0 then display helper message
|
||||
function isEmpty(elem, helperMsg)
|
||||
{
|
||||
if(elem.value.length == 0){
|
||||
alert(helperMsg);
|
||||
elem.focus(); // set the focus to this input
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function codeCheck(prefix, elementcount, helperMsg)
|
||||
{
|
||||
var i, j;
|
||||
var X = new Array();
|
||||
|
||||
for (i=0; i<=elementcount; i++) {
|
||||
j = document.getElementById(prefix+i);
|
||||
if (j != undefined)
|
||||
{
|
||||
j.value=trim(j.value);
|
||||
X.push(j.value);
|
||||
}
|
||||
}
|
||||
if (arrHasDupes(X))
|
||||
{
|
||||
alert(helperMsg);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function arrHasDupes( A ) { // finds any duplicate array elements using the fewest possible comparison
|
||||
var i, j, n;
|
||||
n=A.length;
|
||||
// to ensure the fewest possible comparisons
|
||||
for (i=0; i<n; i++) { // outer loop uses each item i at 0 through n
|
||||
for (j=i+1; j<n; j++) { // inner loop only compares items j at i+1 to n
|
||||
if (A[i]==A[j]) return true;
|
||||
} }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// (c) 2006 Simon Wunderlin, License: GPL, hacks want to be free ;)
|
||||
// This fix forces Firefox to fire the onchange event if someone changes select box with cursor keys
|
||||
function ev_gecko_select_keyup_ev(Ev) {
|
||||
// prevent tab, alt, ctrl keys from fireing the event
|
||||
if (Ev.keyCode && (Ev.keyCode == 1 || Ev.keyCode == 9 ||
|
||||
Ev.keyCode == 16 || Ev.altKey || Ev.ctrlKey))
|
||||
return true;
|
||||
Ev.target.onchange();
|
||||
return true;
|
||||
}
|
||||
|
||||
function init_gecko_select_hack() {
|
||||
var selects = document.getElementsByTagName("SELECT");
|
||||
for(i=0; i<selects.length; i++)
|
||||
selects.item(i).addEventListener("keyup", ev_gecko_select_keyup_ev, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function getkey(e)
|
||||
{
|
||||
if (window.event) return window.event.keyCode;
|
||||
else
|
||||
if (e) return e.which;
|
||||
else return null;
|
||||
}
|
||||
|
||||
function goodchars(e, goods)
|
||||
{
|
||||
var key, keychar;
|
||||
key = getkey(e);
|
||||
if (key == null) return true;
|
||||
|
||||
// get character
|
||||
keychar = String.fromCharCode(key);
|
||||
keychar = keychar.toLowerCase();
|
||||
goods = goods.toLowerCase();
|
||||
|
||||
// check goodkeys
|
||||
if (goods.indexOf(keychar) != -1)
|
||||
return true;
|
||||
|
||||
// control keys
|
||||
if ( key==null || key==0 || key==8 || key==9 || key==27 )
|
||||
return true;
|
||||
|
||||
// else return false
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function trim(stringToTrim) {
|
||||
return stringToTrim.replace(/^\s+|\s+$/g,"");
|
||||
}
|
||||
|
||||
function DoAdd()
|
||||
{
|
||||
if (document.getElementById("available_languages").selectedIndex>-1)
|
||||
@@ -84,22 +215,26 @@ function compareText (option1, option2) {
|
||||
return option1.text < option2.text ? -1 :
|
||||
option1.text > option2.text ? 1 : 0;
|
||||
}
|
||||
|
||||
function compareValue (option1, option2) {
|
||||
return option1.value < option2.value ? -1 :
|
||||
option1.value > option2.value ? 1 : 0;
|
||||
}
|
||||
|
||||
function compareTextAsFloat (option1, option2) {
|
||||
var value1 = parseFloat(option1.text);
|
||||
var value2 = parseFloat(option2.text);
|
||||
return value1 < value2 ? -1 :
|
||||
value1 > value2 ? 1 : 0;
|
||||
}
|
||||
|
||||
function compareValueAsFloat (option1, option2) {
|
||||
var value1 = parseFloat(option1.value);
|
||||
var value2 = parseFloat(option2.value);
|
||||
return value1 < value2 ? -1 :
|
||||
value1 > value2 ? 1 : 0;
|
||||
}
|
||||
|
||||
function sortSelect (select, compareFunction) {
|
||||
if (!compareFunction)
|
||||
compareFunction = compareText;
|
||||
@@ -138,6 +273,3 @@ function checklangs(mylangs)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//-->
|
||||
</script>
|
||||
56
include/limesurvey/admin/scripts/assessments.js
Normal file
@@ -0,0 +1,56 @@
|
||||
function jquery_goodchars(e, goods)
|
||||
{
|
||||
var key, keychar;
|
||||
key = e.which;
|
||||
if (key == null) return true;
|
||||
|
||||
// get character
|
||||
keychar = String.fromCharCode(key);
|
||||
keychar = keychar.toLowerCase();
|
||||
goods = goods.toLowerCase();
|
||||
|
||||
// check goodkeys
|
||||
if (goods.indexOf(keychar) != -1)
|
||||
return true;
|
||||
|
||||
// control keys
|
||||
if ( key==null || key==0 || key==8 || key==9 || key==27 )
|
||||
return true;
|
||||
|
||||
// else return false
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#languagetabs').tabs();
|
||||
$('#radiototal,#radiogroup').change(
|
||||
function()
|
||||
{
|
||||
if ($('#radiototal').attr('checked')==true)
|
||||
{
|
||||
$('#newgroupselect').attr('disabled','disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($('#newgroupselect>option').length==0){
|
||||
$('#radiototal').attr('checked',true);
|
||||
alert (strnogroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#newgroupselect').attr('disabled',false);
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
$('#radiototal,#radiogroup').change();
|
||||
$('.numbersonly').keypress(
|
||||
function(e){
|
||||
return jquery_goodchars(e,'1234567890-');
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
/************************************************************************************************************
|
||||
(C) www.dhtmlgoodies.com, October 2005
|
||||
|
||||
This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.
|
||||
|
||||
Terms of use:
|
||||
You are free to use this script as long as the copyright message is kept intact. However, you may not
|
||||
redistribute, sell or repost it without our permission.
|
||||
|
||||
Thank you!
|
||||
|
||||
www.dhtmlgoodies.com
|
||||
Alf Magne Kalleland
|
||||
|
||||
************************************************************************************************************/
|
||||
|
||||
var offsetYInsertDiv = -3; // Y offset for the little arrow indicating where the node should be inserted.
|
||||
if(!document.all)offsetYInsertDiv = offsetYInsertDiv - 7; // No IE
|
||||
|
||||
|
||||
var arrParent = false;
|
||||
var arrMoveCont = false;
|
||||
var arrMoveCounter = -1;
|
||||
var arrTarget = false;
|
||||
var arrNextSibling = false;
|
||||
var leftPosArrangableNodes = false;
|
||||
var widthArrangableNodes = false;
|
||||
var nodePositionsY = new Array();
|
||||
var nodeHeights = new Array();
|
||||
var arrInsertDiv = false;
|
||||
var insertAsFirstNode = false;
|
||||
var arrNodesDestination = false;
|
||||
function cancelEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
function getTopPos(inputObj)
|
||||
{
|
||||
|
||||
var returnValue = inputObj.offsetTop;
|
||||
while((inputObj = inputObj.offsetParent) != null){
|
||||
returnValue += inputObj.offsetTop;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
function getLeftPos(inputObj)
|
||||
{
|
||||
var returnValue = inputObj.offsetLeft;
|
||||
while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
function clearMovableDiv()
|
||||
{
|
||||
if(arrMoveCont.getElementsByTagName('LI').length>0){
|
||||
if(arrNextSibling)arrParent.insertBefore(arrTarget,arrNextSibling); else arrParent.appendChild(arrTarget);
|
||||
}
|
||||
|
||||
}
|
||||
function testjs()
|
||||
{
|
||||
alert('JavaScript includes supported!');
|
||||
}
|
||||
|
||||
function initMoveNode(e)
|
||||
{
|
||||
clearMovableDiv();
|
||||
if(document.all)e = event;
|
||||
arrMoveCounter = 0;
|
||||
arrTarget = this;
|
||||
if(this.nextSibling)arrNextSibling = this.nextSibling; else arrNextSibling = false;
|
||||
timerMoveNode();
|
||||
arrMoveCont.parentNode.style.left = e.clientX + 'px';
|
||||
arrMoveCont.parentNode.style.top = e.clientY + 'px';
|
||||
return false;
|
||||
|
||||
}
|
||||
function timerMoveNode()
|
||||
{
|
||||
if(arrMoveCounter>=0 && arrMoveCounter<10){
|
||||
arrMoveCounter = arrMoveCounter +1;
|
||||
setTimeout('timerMoveNode()',20);
|
||||
}
|
||||
if(arrMoveCounter>=10){
|
||||
arrMoveCont.appendChild(arrTarget);
|
||||
}
|
||||
}
|
||||
|
||||
function arrangeNodeMove(e)
|
||||
{
|
||||
if(document.all)e = event;
|
||||
if(arrMoveCounter<10)return;
|
||||
if(document.all && arrMoveCounter>=10 && e.button!=1){
|
||||
arrangeNodeStopMove();
|
||||
}
|
||||
|
||||
arrMoveCont.parentNode.style.left = e.clientX + 'px';
|
||||
arrMoveCont.parentNode.style.top = e.clientY + 'px';
|
||||
|
||||
var tmpY = e.clientY;
|
||||
arrInsertDiv.style.display='none';
|
||||
arrNodesDestination = false;
|
||||
|
||||
|
||||
if(e.clientX<leftPosArrangableNodes || e.clientX>leftPosArrangableNodes + widthArrangableNodes)return;
|
||||
|
||||
var subs = arrParent.getElementsByTagName('LI');
|
||||
for(var no=0;no<subs.length;no++){
|
||||
var topPos =getTopPos(subs[no]);
|
||||
var tmpHeight = subs[no].offsetHeight;
|
||||
|
||||
if(no==0){
|
||||
if(tmpY<=topPos && tmpY>=topPos-5){
|
||||
arrInsertDiv.style.top = (topPos + offsetYInsertDiv) + 'px';
|
||||
arrInsertDiv.style.display = 'block';
|
||||
arrNodesDestination = subs[no];
|
||||
insertAsFirstNode = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(tmpY>=topPos && tmpY<=(topPos+tmpHeight)){
|
||||
arrInsertDiv.style.top = (topPos+tmpHeight + offsetYInsertDiv) + 'px';
|
||||
arrInsertDiv.style.display = 'block';
|
||||
arrNodesDestination = subs[no];
|
||||
insertAsFirstNode = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function arrangeNodeStopMove()
|
||||
{
|
||||
arrMoveCounter = -1;
|
||||
arrInsertDiv.style.display='none';
|
||||
|
||||
if(arrNodesDestination){
|
||||
var subs = arrParent.getElementsByTagName('LI');
|
||||
if(arrNodesDestination==subs[0] && insertAsFirstNode){
|
||||
arrParent.insertBefore(arrTarget,arrNodesDestination);
|
||||
}else{
|
||||
if(arrNodesDestination.nextSibling){
|
||||
arrParent.insertBefore(arrTarget,arrNodesDestination.nextSibling);
|
||||
}else{
|
||||
arrParent.appendChild(arrTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
arrNodesDestination = false;
|
||||
clearMovableDiv();
|
||||
}
|
||||
|
||||
function saveArrangableNodes()
|
||||
{
|
||||
var nodes = arrParent.getElementsByTagName('LI');
|
||||
var string = "";
|
||||
for(var no=0;no<nodes.length;no++){
|
||||
if(string.length>0)string = string + ',';
|
||||
string = string + nodes[no].id;
|
||||
}
|
||||
|
||||
document.forms[0].hiddenNodeIds.value = string;
|
||||
|
||||
// Just for testing
|
||||
//document.getElementById('arrDebug').innerHTML = 'Ready to save these nodes:<br>' + string.replace(/,/g,',<BR>');
|
||||
|
||||
document.forms[0].submit(); // Remove the comment in front of this line when you have set an action to the form.
|
||||
//return string ;
|
||||
}
|
||||
|
||||
function initArrangableNodes()
|
||||
{
|
||||
arrParent = document.getElementById('arrangableNodes');
|
||||
arrMoveCont = document.getElementById('movableNode').getElementsByTagName('UL')[0];
|
||||
arrInsertDiv = document.getElementById('arrDestInditcator');
|
||||
|
||||
leftPosArrangableNodes = getLeftPos(arrParent);
|
||||
arrInsertDiv.style.left = leftPosArrangableNodes - 5 + 'px';
|
||||
widthArrangableNodes = arrParent.offsetWidth;
|
||||
|
||||
var subs = arrParent.getElementsByTagName('LI');
|
||||
for(var no=0;no<subs.length;no++){
|
||||
subs[no].onmousedown = initMoveNode;
|
||||
subs[no].onselectstart = cancelEvent;
|
||||
}
|
||||
|
||||
document.documentElement.onmouseup = arrangeNodeStopMove;
|
||||
document.documentElement.onmousemove = arrangeNodeMove;
|
||||
document.documentElement.onselectstart = cancelEvent;
|
||||
|
||||
}
|
||||
window.onload = initArrangableNodes;
|
||||
|
||||
491
include/limesurvey/admin/scripts/edit_area/autocompletion.js
Normal file
@@ -0,0 +1,491 @@
|
||||
/**
|
||||
* Autocompletion class
|
||||
*
|
||||
* An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
|
||||
*
|
||||
* Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
|
||||
* But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
|
||||
* and add a too important feature that many people would miss if included as a plugin
|
||||
*
|
||||
* - init param: autocompletion_start
|
||||
* - Button name: "autocompletion"
|
||||
*/
|
||||
|
||||
var EditArea_autocompletion= {
|
||||
|
||||
/**
|
||||
* Get called once this file is loaded (editArea still not initialized)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
init: function(){
|
||||
// alert("test init: "+ this._someInternalFunction(2, 3));
|
||||
|
||||
if(editArea.settings["autocompletion"])
|
||||
this.enabled= true;
|
||||
else
|
||||
this.enabled= false;
|
||||
this.current_word = false;
|
||||
this.shown = false;
|
||||
this.selectIndex = -1;
|
||||
this.forceDisplay = false;
|
||||
this.isInMiddleWord = false;
|
||||
this.autoSelectIfOneResult = false;
|
||||
this.delayBeforeDisplay = 100;
|
||||
this.checkDelayTimer = false;
|
||||
this.curr_syntax_str = '';
|
||||
|
||||
this.file_syntax_datas = {};
|
||||
}
|
||||
/**
|
||||
* Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
|
||||
* A control can be a button, select list or any other HTML item to present in the EditArea user interface.
|
||||
* Language variables such as {$lang_somekey} will also be replaced with contents from
|
||||
* the language packs.
|
||||
*
|
||||
* @param {string} ctrl_name: the name of the control to add
|
||||
* @return HTML code for a specific control or false.
|
||||
* @type string or boolean
|
||||
*/
|
||||
/*,get_control_html: function(ctrl_name){
|
||||
switch( ctrl_name ){
|
||||
case 'autocompletion':
|
||||
// Control id, button img, command
|
||||
return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
/**
|
||||
* Get called once EditArea is fully loaded and initialised
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
,onload: function(){
|
||||
if(this.enabled)
|
||||
{
|
||||
var icon= document.getElementById("autocompletion");
|
||||
if(icon)
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
|
||||
}
|
||||
|
||||
this.container = document.createElement('div');
|
||||
this.container.id = "auto_completion_area";
|
||||
editArea.container.insertBefore( this.container, editArea.container.firstChild );
|
||||
|
||||
// add event detection for hiding suggestion box
|
||||
parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
|
||||
parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called each time the user touch a keyboard key.
|
||||
*
|
||||
* @param (event) e: the keydown event
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,onkeydown: function(e){
|
||||
if(!this.enabled)
|
||||
return true;
|
||||
|
||||
if (EA_keys[e.keyCode])
|
||||
letter=EA_keys[e.keyCode];
|
||||
else
|
||||
letter=String.fromCharCode(e.keyCode);
|
||||
// shown
|
||||
if( this._isShown() )
|
||||
{
|
||||
// if escape, hide the box
|
||||
if(letter=="Esc")
|
||||
{
|
||||
this._hide();
|
||||
return false;
|
||||
}
|
||||
// Enter
|
||||
else if( letter=="Entrer")
|
||||
{
|
||||
var as = this.container.getElementsByTagName('A');
|
||||
// select a suggested entry
|
||||
if( this.selectIndex >= 0 && this.selectIndex < as.length )
|
||||
{
|
||||
as[ this.selectIndex ].onmousedown();
|
||||
return false
|
||||
}
|
||||
// simply add an enter in the code
|
||||
else
|
||||
{
|
||||
this._hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if( letter=="Tab" || letter=="Down")
|
||||
{
|
||||
this._selectNext();
|
||||
return false;
|
||||
}
|
||||
else if( letter=="Up")
|
||||
{
|
||||
this._selectBefore();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// hidden
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
|
||||
if( letter=="Space" && CtrlPressed(e) )
|
||||
{
|
||||
//parent.console.log('SHOW SUGGEST');
|
||||
this.forceDisplay = true;
|
||||
this.autoSelectIfOneResult = true;
|
||||
this._checkLetter();
|
||||
return false;
|
||||
}
|
||||
|
||||
// wait a short period for check that the cursor isn't moving
|
||||
setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
|
||||
this.checkDelayTimer = false;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Executes a specific command, this function handles plugin commands.
|
||||
*
|
||||
* @param {string} cmd: the name of the command being executed
|
||||
* @param {unknown} param: the parameter of the command
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,execCommand: function(cmd, param){
|
||||
switch( cmd ){
|
||||
case 'toggle_autocompletion':
|
||||
var icon= document.getElementById("autocompletion");
|
||||
if(!this.enabled)
|
||||
{
|
||||
if(icon != null){
|
||||
editArea.restoreClass(icon);
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
|
||||
}
|
||||
this.enabled= true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.enabled= false;
|
||||
if(icon != null)
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
,_checkDelayAndCursorBeforeDisplay: function()
|
||||
{
|
||||
this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();", this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
|
||||
}
|
||||
// hide the suggested box
|
||||
,_hide: function(){
|
||||
this.container.style.display="none";
|
||||
this.selectIndex = -1;
|
||||
this.shown = false;
|
||||
this.forceDisplay = false;
|
||||
this.autoSelectIfOneResult = false;
|
||||
}
|
||||
// display the suggested box
|
||||
,_show: function(){
|
||||
if( !this._isShown() )
|
||||
{
|
||||
this.container.style.display="block";
|
||||
this.selectIndex = -1;
|
||||
this.shown = true;
|
||||
}
|
||||
}
|
||||
// is the suggested box displayed?
|
||||
,_isShown: function(){
|
||||
return this.shown;
|
||||
}
|
||||
// setter and getter
|
||||
,_isInMiddleWord: function( new_value ){
|
||||
if( typeof( new_value ) == "undefined" )
|
||||
return this.isInMiddleWord;
|
||||
else
|
||||
this.isInMiddleWord = new_value;
|
||||
}
|
||||
// select the next element in the suggested box
|
||||
,_selectNext: function()
|
||||
{
|
||||
var as = this.container.getElementsByTagName('A');
|
||||
|
||||
// clean existing elements
|
||||
for( var i=0; i<as.length; i++ )
|
||||
{
|
||||
if( as[i].className )
|
||||
as[i].className = as[i].className.replace(/ focus/g, '');
|
||||
}
|
||||
|
||||
this.selectIndex++;
|
||||
this.selectIndex = ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex;
|
||||
as[ this.selectIndex ].className += " focus";
|
||||
}
|
||||
// select the previous element in the suggested box
|
||||
,_selectBefore: function()
|
||||
{
|
||||
var as = this.container.getElementsByTagName('A');
|
||||
|
||||
// clean existing elements
|
||||
for( var i=0; i<as.length; i++ )
|
||||
{
|
||||
if( as[i].className )
|
||||
as[i].className = as[ i ].className.replace(/ focus/g, '');
|
||||
}
|
||||
|
||||
this.selectIndex--;
|
||||
|
||||
this.selectIndex = ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex;
|
||||
as[ this.selectIndex ].className += " focus";
|
||||
}
|
||||
,_select: function( content )
|
||||
{
|
||||
cursor_forced_position = content.indexOf( '{@}' );
|
||||
content = content.replace(/{@}/g, '' );
|
||||
editArea.getIESelection();
|
||||
|
||||
// retrive the number of matching characters
|
||||
var start_index = Math.max( 0, editArea.textarea.selectionEnd - content.length );
|
||||
|
||||
line_string = editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1);
|
||||
limit = line_string.length -1;
|
||||
nbMatch = 0;
|
||||
for( i =0; i<limit ; i++ )
|
||||
{
|
||||
if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
|
||||
nbMatch = i + 1;
|
||||
}
|
||||
// if characters match, we should include them in the selection that will be replaced
|
||||
if( nbMatch > 0 )
|
||||
parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd);
|
||||
|
||||
parent.editAreaLoader.setSelectedText(editArea.id, content );
|
||||
range= parent.editAreaLoader.getSelectionRange(editArea.id);
|
||||
|
||||
if( cursor_forced_position != -1 )
|
||||
new_pos = range["end"] - ( content.length-cursor_forced_position );
|
||||
else
|
||||
new_pos = range["end"];
|
||||
parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos);
|
||||
this._hide();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the AUTO_COMPLETION part of syntax definition files
|
||||
*/
|
||||
,_parseSyntaxAutoCompletionDatas: function(){
|
||||
//foreach syntax loaded
|
||||
for(var lang in parent.editAreaLoader.load_syntax)
|
||||
{
|
||||
if(!parent.editAreaLoader.syntax[lang]['autocompletion']) // init the regexp if not already initialized
|
||||
{
|
||||
parent.editAreaLoader.syntax[lang]['autocompletion']= {};
|
||||
// the file has auto completion datas
|
||||
if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
|
||||
{
|
||||
// parse them
|
||||
for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
|
||||
{
|
||||
datas = parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i];
|
||||
tmp = {};
|
||||
if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false)
|
||||
tmp["modifiers"]="i";
|
||||
else
|
||||
tmp["modifiers"]="";
|
||||
tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"];
|
||||
tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]);
|
||||
tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]);
|
||||
tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]);
|
||||
tmp["keywords"]= {};
|
||||
//console.log( datas["KEYWORDS"] );
|
||||
for( var prefix in datas["KEYWORDS"] )
|
||||
{
|
||||
tmp["keywords"][prefix]= {
|
||||
prefix: prefix,
|
||||
prefix_name: prefix,
|
||||
prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ),
|
||||
datas: []
|
||||
};
|
||||
for( var j=0; j<datas["KEYWORDS"][prefix].length; j++ )
|
||||
{
|
||||
tmp["keywords"][prefix]['datas'][j]= {
|
||||
is_typing: datas["KEYWORDS"][prefix][j][0],
|
||||
// if replace with is empty, replace with the is_typing value
|
||||
replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('§', datas["KEYWORDS"][prefix][j][0] ) : '',
|
||||
comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : ''
|
||||
};
|
||||
|
||||
// the replace with shouldn't be empty
|
||||
if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
|
||||
tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
|
||||
|
||||
// if the comment is empty, display the replace_with value
|
||||
if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
|
||||
tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
|
||||
}
|
||||
|
||||
}
|
||||
tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
|
||||
parent.editAreaLoader.syntax[lang]['autocompletion'][i] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
,_checkLetter: function(){
|
||||
// check that syntax hasn't changed
|
||||
if( this.curr_syntax_str != editArea.settings['syntax'] )
|
||||
{
|
||||
if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
|
||||
this._parseSyntaxAutoCompletionDatas();
|
||||
this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
|
||||
this.curr_syntax_str = editArea.settings['syntax'];
|
||||
//console.log( this.curr_syntax );
|
||||
}
|
||||
|
||||
if( editArea.is_editable )
|
||||
{
|
||||
time=new Date;
|
||||
t1= time.getTime();
|
||||
editArea.getIESelection();
|
||||
this.selectIndex = -1;
|
||||
start=editArea.textarea.selectionStart;
|
||||
var str = editArea.textarea.value;
|
||||
var results= [];
|
||||
|
||||
|
||||
for(var i in this.curr_syntax)
|
||||
{
|
||||
var last_chars = str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
|
||||
var matchNextletter = str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
|
||||
// if not writting in the middle of a word or if forcing display
|
||||
if( matchNextletter || this.forceDisplay )
|
||||
{
|
||||
// check if the last chars match a separator
|
||||
var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
|
||||
|
||||
// check if it match a possible word
|
||||
var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
|
||||
|
||||
//console.log( match_word );
|
||||
if( match_word )
|
||||
{
|
||||
var begin_word= match_word[1];
|
||||
var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
|
||||
//console.log( match_curr_word );
|
||||
for(var prefix in this.curr_syntax[i]["keywords"])
|
||||
{
|
||||
// parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
|
||||
for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
|
||||
{
|
||||
// parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
|
||||
// the key word match or force display
|
||||
if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
|
||||
{
|
||||
// parent.console.log('match');
|
||||
hasMatch = false;
|
||||
var before = last_chars.substr( 0, last_chars.length - begin_word.length );
|
||||
|
||||
// no prefix to match => it's valid
|
||||
if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
|
||||
{
|
||||
if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
|
||||
hasMatch = true;
|
||||
}
|
||||
// we still need to check the prefix if there is one
|
||||
else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
|
||||
{
|
||||
if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
|
||||
hasMatch = true;
|
||||
}
|
||||
|
||||
if( hasMatch )
|
||||
results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// it doesn't match any possible word but we want to display something
|
||||
// we'll display to list of all available words
|
||||
else if( this.forceDisplay || match_prefix_separator )
|
||||
{
|
||||
for(var prefix in this.curr_syntax[i]["keywords"])
|
||||
{
|
||||
for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
|
||||
{
|
||||
hasMatch = false;
|
||||
// no prefix to match => it's valid
|
||||
if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
|
||||
{
|
||||
hasMatch = true;
|
||||
}
|
||||
// we still need to check the prefix if there is one
|
||||
else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
|
||||
{
|
||||
var before = last_chars; //.substr( 0, last_chars.length );
|
||||
if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
|
||||
hasMatch = true;
|
||||
}
|
||||
|
||||
if( hasMatch )
|
||||
results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// there is only one result, and we can select it automatically
|
||||
if( results.length == 1 && this.autoSelectIfOneResult )
|
||||
{
|
||||
// console.log( results );
|
||||
this._select( results[0][1]['replace_with'] );
|
||||
}
|
||||
else if( results.length == 0 )
|
||||
{
|
||||
this._hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
// build the suggestion box content
|
||||
var lines=[];
|
||||
for(var i=0; i<results.length; i++)
|
||||
{
|
||||
var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), """) +"');return false;\">"+ results[i][1]['comment'];
|
||||
if(results[i][0]['prefix_name'].length>0)
|
||||
line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
|
||||
line+='</a></li>';
|
||||
lines[lines.length]=line;
|
||||
}
|
||||
// sort results
|
||||
this.container.innerHTML = '<ul>'+ lines.sort().join('') +'</ul>';
|
||||
|
||||
var cursor = _$("cursor_pos");
|
||||
this.container.style.top = ( cursor.cursor_top + editArea.lineHeight ) +"px";
|
||||
this.container.style.left = ( cursor.cursor_left + 8 ) +"px";
|
||||
this._show();
|
||||
}
|
||||
|
||||
this.autoSelectIfOneResult = false;
|
||||
time=new Date;
|
||||
t2= time.getTime();
|
||||
|
||||
//parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Load as a plugin
|
||||
editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion';
|
||||
editArea.add_plugin('autocompletion', EditArea_autocompletion);
|
||||
530
include/limesurvey/admin/scripts/edit_area/edit_area.css
Normal file
@@ -0,0 +1,530 @@
|
||||
body, html{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
body, html, table, form, textarea{
|
||||
font: 12px monospace, sans-serif;
|
||||
}
|
||||
|
||||
#editor{
|
||||
border: solid #D2E0F2 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#result{
|
||||
z-index: 4;
|
||||
overflow-x: auto;
|
||||
overflow-y: scroll;
|
||||
border-top: solid #888 1px;
|
||||
border-bottom: solid #888 1px;
|
||||
position: relative;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#result.empty{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#container{
|
||||
overflow: hidden;
|
||||
border: solid blue 0;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
padding: 0 5px 0 45px;
|
||||
/*padding-right: 5px;*/
|
||||
}
|
||||
|
||||
#textarea{
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 7;
|
||||
border-width: 0;
|
||||
background-color: transparent;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#textarea, #textarea:hover{
|
||||
outline: none; /* safari outline fix */
|
||||
}
|
||||
|
||||
#content_highlight{
|
||||
white-space: pre;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position : absolute;
|
||||
z-index: 4;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
|
||||
#selection_field, #selection_field_text{
|
||||
margin: 0;
|
||||
background-color: #E1F2F9;
|
||||
/* height: 1px; */
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
top: -100px;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#selection_field.show_colors {
|
||||
z-index: 3;
|
||||
background-color:#EDF9FC;
|
||||
|
||||
}
|
||||
|
||||
#selection_field strong{
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
#selection_field.show_colors *, #selection_field_text * {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#selection_field_text{
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
#selection_field_text strong{
|
||||
font-weight:normal;
|
||||
background-color:#3399FE;
|
||||
color: #FFF;
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
#container.word_wrap #content_highlight,
|
||||
#container.word_wrap #selection_field,
|
||||
#container.word_wrap #selection_field_text,
|
||||
#container.word_wrap #test_font_size{
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#line_number{
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
border-right: solid black 1px;
|
||||
z-index:8;
|
||||
width: 38px;
|
||||
padding: 0 5px 0 0;
|
||||
margin: 0 0 0 -45px;
|
||||
text-align: right;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
#test_font_size{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
pre{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
opacity: 0.2;
|
||||
filter:alpha(opacity=20);
|
||||
}
|
||||
|
||||
#result .edit_area_cursor{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
background-color: #FF6633;
|
||||
top: -100px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#result .edit_area_selection_field .overline{
|
||||
background-color: #996600;
|
||||
}
|
||||
|
||||
|
||||
/* area popup */
|
||||
.editarea_popup{
|
||||
border: solid 1px #888888;
|
||||
background-color: #EEF6FF;
|
||||
width: 250px;
|
||||
padding: 4px;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
z-index: 15;
|
||||
top: -500px;
|
||||
}
|
||||
|
||||
.editarea_popup, .editarea_popup table{
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.editarea_popup img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.editarea_popup .close_popup{
|
||||
float: right;
|
||||
line-height: 16px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editarea_popup .copyright{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Area_search */
|
||||
div#area_search_replace{
|
||||
/*width: 250px;*/
|
||||
}
|
||||
|
||||
div#area_search_replace img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
div#area_search_replace div.button{
|
||||
text-align: center;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
div#area_search_replace .button a{
|
||||
cursor: pointer;
|
||||
border: solid 1px #888888;
|
||||
background-color: #DEDEDE;
|
||||
text-decoration: none;
|
||||
padding: 0 2px;
|
||||
color: #000000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace a:hover{
|
||||
/*border: solid 1px #888888;*/
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
div#area_search_replace #move_area_search_replace{
|
||||
cursor: move;
|
||||
border: solid 1px #888;
|
||||
}
|
||||
|
||||
div#area_search_replace #close_area_search_replace{
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace #area_search_msg{
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
border-top: solid 1px #888;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* area help */
|
||||
#edit_area_help{
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#edit_area_help div.close_popup{
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* area_toolbar */
|
||||
.area_toolbar{
|
||||
/*font: 11px sans-serif;*/
|
||||
width: 100%;
|
||||
/*height: 21px; */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #EEF6FF;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.area_toolbar, .area_toolbar table{
|
||||
font: 11px sans-serif;
|
||||
}
|
||||
|
||||
.area_toolbar img{
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.area_toolbar input{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar select{
|
||||
font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
|
||||
font-size: 7pt;
|
||||
font-weight: normal;
|
||||
margin: 2px 0 0 0 ;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
background-color: #F0F0EE;
|
||||
}
|
||||
|
||||
table.statusbar{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area_toolbar td.infos{
|
||||
text-align: center;
|
||||
width: 130px;
|
||||
border-right: solid 1px #D2E0F2;
|
||||
border-width: 0 1px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.total{
|
||||
text-align: right;
|
||||
width: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.resize{
|
||||
text-align: right;
|
||||
}
|
||||
/*
|
||||
.area_toolbar span{
|
||||
line-height: 1px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}*/
|
||||
|
||||
.area_toolbar span#resize_area{
|
||||
cursor: nw-resize;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* toolbar buttons */
|
||||
.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
|
||||
border: 0; margin: 0; padding: 0; background: transparent;
|
||||
margin-top: 0;
|
||||
margin-left: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editAreaButtonNormal {
|
||||
border: 1px solid #EEF6FF !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaButtonOver {
|
||||
border: 1px solid #0A246A !important;
|
||||
cursor: pointer;
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.editAreaButtonDown {
|
||||
cursor: pointer;
|
||||
border: 1px solid #0A246A !important;
|
||||
background-color: #8592B5;
|
||||
}
|
||||
|
||||
.editAreaButtonSelected {
|
||||
border: 1px solid #C0C0BB !important;
|
||||
cursor: pointer;
|
||||
background-color: #F4F2E8;
|
||||
}
|
||||
|
||||
.editAreaButtonDisabled {
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
|
||||
-moz-opacity:0.3;
|
||||
opacity: 0.3;
|
||||
border: 1px solid #F0F0EE !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaSeparatorLine {
|
||||
margin: 1px 2px;
|
||||
background-color: #C0C0BB;
|
||||
width: 2px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
/* waiting screen */
|
||||
#processing{
|
||||
display: none;
|
||||
background-color:#ECE9D8;
|
||||
border: solid #888 1px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#processing_text{
|
||||
position:absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
margin-left: -100px;
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
}
|
||||
/* end */
|
||||
|
||||
|
||||
/**** tab browsing area ****/
|
||||
#tab_browsing_area{
|
||||
display: none;
|
||||
background-color: #CCC9A8;
|
||||
border-top: 1px solid #888;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#tab_browsing_list {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#tab_browsing_list li {
|
||||
float: left;
|
||||
margin: -1px;
|
||||
}
|
||||
#tab_browsing_list a {
|
||||
position: relative;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
line-height:14px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a span {
|
||||
display: block;
|
||||
color: #000;
|
||||
background: #EEF6FF;
|
||||
border: 1px solid #888;
|
||||
border-width: 1px 1px 0;
|
||||
text-align: center;
|
||||
padding: 2px 2px 1px 4px;
|
||||
position: relative; /*IE 6 hack */
|
||||
}
|
||||
|
||||
#tab_browsing_list a b {
|
||||
display: block;
|
||||
border-bottom: 2px solid #617994;
|
||||
}
|
||||
|
||||
#tab_browsing_list a .edited {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab_browsing_list a.edited .edited {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#tab_browsing_list a img{
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a.edited img{
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a:hover span {
|
||||
background: #F4F2E8;
|
||||
border-color: #0A246A;
|
||||
}
|
||||
|
||||
#tab_browsing_list .selected a span{
|
||||
background: #046380;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
#no_file_selected{
|
||||
height: 100%;
|
||||
width: 150%; /* Opera need more than 100% */
|
||||
background: #CCC;
|
||||
display: none;
|
||||
z-index: 20;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/*** Non-editable mode ***/
|
||||
.non_editable #editor
|
||||
{
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.non_editable .area_toolbar
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*** Auto completion ***/
|
||||
#auto_completion_area
|
||||
{
|
||||
background: #FFF;
|
||||
border: solid 1px #888;
|
||||
position: absolute;
|
||||
z-index: 15;
|
||||
width: 280px;
|
||||
height: 180px;
|
||||
overflow: auto;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#auto_completion_area a, #auto_completion_area a:visited
|
||||
{
|
||||
display: block;
|
||||
padding: 0 2px 1px;
|
||||
color: #000;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
|
||||
{
|
||||
background: #D6E1FE;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#auto_completion_area ul
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none inside;
|
||||
}
|
||||
#auto_completion_area li
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
#auto_completion_area .prefix
|
||||
{
|
||||
font-style: italic;
|
||||
padding: 0 3px;
|
||||
}
|
||||
525
include/limesurvey/admin/scripts/edit_area/edit_area.js
Normal file
@@ -0,0 +1,525 @@
|
||||
/******
|
||||
*
|
||||
* EditArea
|
||||
* Developped by Christophe Dolivet
|
||||
* Released under LGPL, Apache and BSD licenses (use the one you want)
|
||||
*
|
||||
******/
|
||||
|
||||
function EditArea(){
|
||||
var t=this;
|
||||
t.error= false; // to know if load is interrrupt
|
||||
|
||||
t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
|
||||
{popup_id: "edit_area_help", icon_id: "help"}];
|
||||
t.plugins= {};
|
||||
|
||||
t.line_number=0;
|
||||
|
||||
parent.editAreaLoader.set_browser_infos(t); // navigator identification
|
||||
// fix IE8 detection as we run in IE7 emulate mode through X-UA <meta> tag
|
||||
if( t.isIE >= 8 )
|
||||
t.isIE = 7;
|
||||
|
||||
t.last_selection={};
|
||||
t.last_text_to_highlight="";
|
||||
t.last_hightlighted_text= "";
|
||||
t.syntax_list= [];
|
||||
t.allready_used_syntax= {};
|
||||
t.check_line_selection_timer= 50; // the timer delay for modification and/or selection change detection
|
||||
|
||||
t.textareaFocused= false;
|
||||
t.highlight_selection_line= null;
|
||||
t.previous= [];
|
||||
t.next= [];
|
||||
t.last_undo="";
|
||||
t.files= {};
|
||||
t.filesIdAssoc= {};
|
||||
t.curr_file= '';
|
||||
//t.loaded= false;
|
||||
t.assocBracket={};
|
||||
t.revertAssocBracket= {};
|
||||
// bracket selection init
|
||||
t.assocBracket["("]=")";
|
||||
t.assocBracket["{"]="}";
|
||||
t.assocBracket["["]="]";
|
||||
for(var index in t.assocBracket){
|
||||
t.revertAssocBracket[t.assocBracket[index]]=index;
|
||||
}
|
||||
t.is_editable= true;
|
||||
|
||||
|
||||
/*t.textarea="";
|
||||
|
||||
t.state="declare";
|
||||
t.code = []; // store highlight syntax for languagues*/
|
||||
// font datas
|
||||
t.lineHeight= 16;
|
||||
/*t.default_font_family= "monospace";
|
||||
t.default_font_size= 10;*/
|
||||
t.tab_nb_char= 8; //nb of white spaces corresponding to a tabulation
|
||||
if(t.isOpera)
|
||||
t.tab_nb_char= 6;
|
||||
|
||||
t.is_tabbing= false;
|
||||
|
||||
t.fullscreen= {'isFull': false};
|
||||
|
||||
t.isResizing=false; // resize var
|
||||
|
||||
// init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
|
||||
t.id= area_id;
|
||||
t.settings= editAreas[t.id]["settings"];
|
||||
|
||||
if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
|
||||
{
|
||||
t.tab_nb_char= t.settings['replace_tab_by_spaces'];
|
||||
t.tabulation="";
|
||||
for(var i=0; i<t.tab_nb_char; i++)
|
||||
t.tabulation+=" ";
|
||||
}else{
|
||||
t.tabulation="\t";
|
||||
}
|
||||
|
||||
// retrieve the init parameter for syntax
|
||||
if(t.settings["syntax_selection_allow"] && t.settings["syntax_selection_allow"].length>0)
|
||||
t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
|
||||
|
||||
if(t.settings['syntax'])
|
||||
t.allready_used_syntax[t.settings['syntax']]=true;
|
||||
|
||||
|
||||
};
|
||||
EditArea.prototype.init= function(){
|
||||
var t=this, a, s=t.settings;
|
||||
t.textarea = _$("textarea");
|
||||
t.container = _$("container");
|
||||
t.result = _$("result");
|
||||
t.content_highlight = _$("content_highlight");
|
||||
t.selection_field = _$("selection_field");
|
||||
t.selection_field_text= _$("selection_field_text");
|
||||
t.processing_screen = _$("processing");
|
||||
t.editor_area = _$("editor");
|
||||
t.tab_browsing_area = _$("tab_browsing_area");
|
||||
t.test_font_size = _$("test_font_size");
|
||||
a = t.textarea;
|
||||
|
||||
if(!s['is_editable'])
|
||||
t.set_editable(false);
|
||||
|
||||
t.set_show_line_colors( s['show_line_colors'] );
|
||||
|
||||
if(syntax_selec= _$("syntax_selection"))
|
||||
{
|
||||
// set up syntax selection lsit in the toolbar
|
||||
for(var i=0; i<t.syntax_list.length; i++) {
|
||||
var syntax= t.syntax_list[i];
|
||||
var option= document.createElement("option");
|
||||
option.value= syntax;
|
||||
if(syntax==s['syntax'])
|
||||
option.selected= "selected";
|
||||
option.innerHTML= t.get_translation("syntax_" + syntax, "word");
|
||||
syntax_selec.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
// add plugins buttons in the toolbar
|
||||
spans= parent.getChildren(_$("toolbar_1"), "span", "", "", "all", -1);
|
||||
|
||||
for(var i=0; i<spans.length; i++){
|
||||
|
||||
id=spans[i].id.replace(/tmp_tool_(.*)/, "$1");
|
||||
if(id!= spans[i].id){
|
||||
for(var j in t.plugins){
|
||||
if(typeof(t.plugins[j].get_control_html)=="function" ){
|
||||
html=t.plugins[j].get_control_html(id);
|
||||
if(html!=false){
|
||||
html= t.get_translation(html, "template");
|
||||
var new_span= document.createElement("span");
|
||||
new_span.innerHTML= html;
|
||||
var father= spans[i].parentNode;
|
||||
spans[i].parentNode.replaceChild(new_span, spans[i]);
|
||||
break; // exit the for loop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// init datas
|
||||
//a.value = 'a';//editAreas[t.id]["textarea"].value;
|
||||
|
||||
if(s["debug"])
|
||||
{
|
||||
t.debug=parent.document.getElementById("edit_area_debug_"+t.id);
|
||||
}
|
||||
// init size
|
||||
//this.update_size();
|
||||
|
||||
if(_$("redo") != null)
|
||||
t.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
|
||||
|
||||
// insert css rules for highlight mode
|
||||
if(typeof(parent.editAreaLoader.syntax[s["syntax"]])!="undefined"){
|
||||
for(var i in parent.editAreaLoader.syntax){
|
||||
if (typeof(parent.editAreaLoader.syntax[i]["styles"]) != "undefined"){
|
||||
t.add_style(parent.editAreaLoader.syntax[i]["styles"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// init key events
|
||||
if(t.isOpera)
|
||||
_$("editor").onkeypress = keyDown;
|
||||
else
|
||||
_$("editor").onkeydown = keyDown;
|
||||
|
||||
for(var i=0; i<t.inlinePopup.length; i++){
|
||||
if(t.isOpera)
|
||||
_$(t.inlinePopup[i]["popup_id"]).onkeypress = keyDown;
|
||||
else
|
||||
_$(t.inlinePopup[i]["popup_id"]).onkeydown = keyDown;
|
||||
}
|
||||
|
||||
if(s["allow_resize"]=="both" || s["allow_resize"]=="x" || s["allow_resize"]=="y")
|
||||
t.allow_resize(true);
|
||||
|
||||
parent.editAreaLoader.toggle(t.id, "on");
|
||||
//a.focus();
|
||||
// line selection init
|
||||
t.change_smooth_selection_mode(editArea.smooth_selection);
|
||||
// highlight
|
||||
t.execCommand("change_highlight", s["start_highlight"]);
|
||||
|
||||
// get font size datas
|
||||
t.set_font(editArea.settings["font_family"], editArea.settings["font_size"]);
|
||||
|
||||
// set unselectable text
|
||||
children= parent.getChildren(document.body, "", "selec", "none", "all", -1);
|
||||
for(var i=0; i<children.length; i++){
|
||||
if(t.isIE)
|
||||
children[i].unselectable = true; // IE
|
||||
else
|
||||
children[i].onmousedown= function(){return false};
|
||||
/* children[i].style.MozUserSelect = "none"; // Moz
|
||||
children[i].style.KhtmlUserSelect = "none"; // Konqueror/Safari*/
|
||||
}
|
||||
|
||||
a.spellcheck= s["gecko_spellcheck"];
|
||||
|
||||
/** Browser specific style fixes **/
|
||||
|
||||
// fix rendering bug for highlighted lines beginning with no tabs
|
||||
if( t.isFirefox >= '3' ) {
|
||||
t.content_highlight.style.paddingLeft= "1px";
|
||||
t.selection_field.style.paddingLeft= "1px";
|
||||
t.selection_field_text.style.paddingLeft= "1px";
|
||||
}
|
||||
|
||||
if(t.isIE && t.isIE < 8 ){
|
||||
a.style.marginTop= "-1px";
|
||||
}
|
||||
/*
|
||||
if(t.isOpera){
|
||||
t.editor_area.style.position= "absolute";
|
||||
}*/
|
||||
|
||||
if( t.isSafari ){
|
||||
t.editor_area.style.position = "absolute";
|
||||
a.style.marginLeft ="-3px";
|
||||
if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
|
||||
a.style.marginTop ="1px";
|
||||
}
|
||||
|
||||
// si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
|
||||
parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);} });
|
||||
|
||||
if(s['is_multi_files']!=false)
|
||||
t.open_file({'id': t.curr_file, 'text': ''});
|
||||
|
||||
t.set_word_wrap( s['word_wrap'] );
|
||||
|
||||
setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);
|
||||
//start checkup routine
|
||||
t.check_undo();
|
||||
t.check_line_selection(true);
|
||||
t.scroll_to_view();
|
||||
|
||||
for(var i in t.plugins){
|
||||
if(typeof(t.plugins[i].onload)=="function")
|
||||
t.plugins[i].onload();
|
||||
}
|
||||
if(s['fullscreen']==true)
|
||||
t.toggle_full_screen(true);
|
||||
|
||||
parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(window, "unload", function(){
|
||||
// in case where editAreaLoader have been already cleaned
|
||||
if( parent.editAreaLoader )
|
||||
{
|
||||
parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
|
||||
}
|
||||
if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
|
||||
editArea.execCommand("EA_unload");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*date= new Date();
|
||||
alert(date.getTime()- parent.editAreaLoader.start_time);*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
//called by the toggle_on
|
||||
EditArea.prototype.update_size= function(){
|
||||
var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
|
||||
|
||||
if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
|
||||
if(editArea.fullscreen['isFull']){
|
||||
pd.getElementById("frame_"+editArea.id).style.width = pd.getElementsByTagName("html")[0].clientWidth + "px";
|
||||
pd.getElementById("frame_"+editArea.id).style.height = pd.getElementsByTagName("html")[0].clientHeight + "px";
|
||||
}
|
||||
|
||||
if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
|
||||
{
|
||||
editArea.tab_browsing_area.style.height = "0px";
|
||||
editArea.tab_browsing_area.style.height = (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
|
||||
}
|
||||
|
||||
height = d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
|
||||
editArea.result.style.height = height +"px";
|
||||
|
||||
width = d.body.offsetWidth -2;
|
||||
editArea.result.style.width = width+"px";
|
||||
//alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
|
||||
|
||||
// check that the popups don't get out of the screen
|
||||
for( i=0; i < editArea.inlinePopup.length; i++ )
|
||||
{
|
||||
popup = _$(editArea.inlinePopup[i]["popup_id"]);
|
||||
maxLeft = d.body.offsetWidth - popup.offsetWidth;
|
||||
maxTop = d.body.offsetHeight - popup.offsetHeight;
|
||||
if( popup.offsetTop > maxTop )
|
||||
popup.style.top = maxTop+"px";
|
||||
if( popup.offsetLeft > maxLeft )
|
||||
popup.style.left = maxLeft+"px";
|
||||
}
|
||||
|
||||
editArea.manage_size( true );
|
||||
editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.manage_size= function(onlyOneTime){
|
||||
if(!editAreas[this.id])
|
||||
return false;
|
||||
|
||||
if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
|
||||
{
|
||||
var area_height,resized= false;
|
||||
|
||||
//1) Manage display width
|
||||
//1.1) Calc the new width to use for display
|
||||
if( !this.settings['word_wrap'] )
|
||||
{
|
||||
var area_width= this.textarea.scrollWidth;
|
||||
area_height= this.textarea.scrollHeight;
|
||||
// bug on old opera versions
|
||||
if(this.isOpera && this.isOpera < 9.6 ){
|
||||
area_width=10000;
|
||||
}
|
||||
//1.2) the width is not the same, we must resize elements
|
||||
if(this.textarea.previous_scrollWidth!=area_width)
|
||||
{
|
||||
this.container.style.width= area_width+"px";
|
||||
this.textarea.style.width= area_width+"px";
|
||||
this.content_highlight.style.width= area_width+"px";
|
||||
this.textarea.previous_scrollWidth=area_width;
|
||||
resized=true;
|
||||
}
|
||||
}
|
||||
// manage wrap width
|
||||
if( this.settings['word_wrap'] )
|
||||
{
|
||||
newW=this.textarea.offsetWidth;
|
||||
if( this.isFirefox || this.isIE )
|
||||
newW-=2;
|
||||
if( this.isSafari )
|
||||
newW-=6;
|
||||
this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
|
||||
}
|
||||
|
||||
//2) Manage display height
|
||||
//2.1) Calc the new height to use for display
|
||||
if( this.isOpera || this.isFirefox || this.isSafari ) {
|
||||
area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
|
||||
} else {
|
||||
area_height = this.textarea.scrollHeight;
|
||||
}
|
||||
//2.2) the width is not the same, we must resize elements
|
||||
if(this.textarea.previous_scrollHeight!=area_height)
|
||||
{
|
||||
this.container.style.height= (area_height+2)+"px";
|
||||
this.textarea.style.height= area_height+"px";
|
||||
this.content_highlight.style.height= area_height+"px";
|
||||
this.textarea.previous_scrollHeight= area_height;
|
||||
resized=true;
|
||||
}
|
||||
|
||||
//3) if there is new lines, we add new line numbers in the line numeration area
|
||||
if(this.last_selection["nb_line"] >= this.line_number)
|
||||
{
|
||||
var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
|
||||
for( i = start+1; i < end; i++ )
|
||||
{
|
||||
newLines+='<div id="line_'+ i +'">'+i+"</div>";
|
||||
this.line_number++;
|
||||
}
|
||||
destDiv.innerHTML= destDiv.innerHTML + newLines;
|
||||
|
||||
this.fixLinesHeight( this.textarea.value, start, -1 );
|
||||
}
|
||||
|
||||
//4) be sure the text is well displayed
|
||||
this.textarea.scrollTop="0px";
|
||||
this.textarea.scrollLeft="0px";
|
||||
if(resized==true){
|
||||
this.scroll_to_view();
|
||||
}
|
||||
}
|
||||
|
||||
if(!onlyOneTime)
|
||||
setTimeout("editArea.manage_size();", 100);
|
||||
};
|
||||
|
||||
EditArea.prototype.execCommand= function(cmd, param){
|
||||
|
||||
for(var i in this.plugins){
|
||||
if(typeof(this.plugins[i].execCommand)=="function"){
|
||||
if(!this.plugins[i].execCommand(cmd, param))
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(cmd){
|
||||
case "save":
|
||||
if(this.settings["save_callback"].length>0)
|
||||
eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
|
||||
break;
|
||||
case "load":
|
||||
if(this.settings["load_callback"].length>0)
|
||||
eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "onchange":
|
||||
if(this.settings["change_callback"].length>0)
|
||||
eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "EA_load":
|
||||
if(this.settings["EA_load_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "EA_unload":
|
||||
if(this.settings["EA_unload_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "toggle_on":
|
||||
if(this.settings["EA_toggle_on_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "toggle_off":
|
||||
if(this.settings["EA_toggle_off_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "re_sync":
|
||||
if(!this.do_highlight)
|
||||
break;
|
||||
case "file_switch_on":
|
||||
if(this.settings["EA_file_switch_on_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
|
||||
break;
|
||||
case "file_switch_off":
|
||||
if(this.settings["EA_file_switch_off_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
|
||||
break;
|
||||
case "file_close":
|
||||
if(this.settings["EA_file_close_callback"].length>0)
|
||||
return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
|
||||
break;
|
||||
|
||||
default:
|
||||
if(typeof(eval("editArea."+cmd))=="function")
|
||||
{
|
||||
if(this.settings["debug"])
|
||||
eval("editArea."+ cmd +"(param);");
|
||||
else
|
||||
try{eval("editArea."+ cmd +"(param);");}catch(e){};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.get_translation= function(word, mode){
|
||||
if(mode=="template")
|
||||
return parent.editAreaLoader.translate(word, this.settings["language"], mode);
|
||||
else
|
||||
return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
|
||||
};
|
||||
|
||||
EditArea.prototype.add_plugin= function(plug_name, plug_obj){
|
||||
for(var i=0; i<this.settings["plugins"].length; i++){
|
||||
if(this.settings["plugins"][i]==plug_name){
|
||||
this.plugins[plug_name]=plug_obj;
|
||||
plug_obj.baseURL=parent.editAreaLoader.baseURL + "plugins/" + plug_name + "/";
|
||||
if( typeof(plug_obj.init)=="function" )
|
||||
plug_obj.init();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.load_css= function(url){
|
||||
try{
|
||||
link = document.createElement("link");
|
||||
link.type = "text/css";
|
||||
link.rel= "stylesheet";
|
||||
link.media="all";
|
||||
link.href = url;
|
||||
head = document.getElementsByTagName("head");
|
||||
head[0].appendChild(link);
|
||||
}catch(e){
|
||||
document.write("<link href='"+ url +"' rel='stylesheet' type='text/css' />");
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.load_script= function(url){
|
||||
try{
|
||||
script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.src = url;
|
||||
script.charset= "UTF-8";
|
||||
head = document.getElementsByTagName("head");
|
||||
head[0].appendChild(script);
|
||||
}catch(e){
|
||||
document.write("<script type='text/javascript' src='" + url + "' charset=\"UTF-8\"><"+"/script>");
|
||||
}
|
||||
};
|
||||
|
||||
// add plugin translation to language translation array
|
||||
EditArea.prototype.add_lang= function(language, values){
|
||||
if(!parent.editAreaLoader.lang[language])
|
||||
parent.editAreaLoader.lang[language]={};
|
||||
for(var i in values)
|
||||
parent.editAreaLoader.lang[language][i]= values[i];
|
||||
};
|
||||
|
||||
// short cut for document.getElementById()
|
||||
function _$(id){return document.getElementById( id );};
|
||||
|
||||
var editArea = new EditArea();
|
||||
parent.editAreaLoader.add_event(window, "load", init);
|
||||
|
||||
function init(){
|
||||
setTimeout("editArea.init(); ", 10);
|
||||
};
|
||||
@@ -0,0 +1,408 @@
|
||||
<?php
|
||||
/******
|
||||
*
|
||||
* EditArea PHP compressor
|
||||
* Developped by Christophe Dolivet
|
||||
* Released under LGPL, Apache and BSD licenses
|
||||
* v1.1.3 (2007/01/18)
|
||||
*
|
||||
******/
|
||||
|
||||
// CONFIG
|
||||
$param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires
|
||||
$param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false)
|
||||
$param['debug'] = false; // Enable this option if you need debuging info
|
||||
$param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk.
|
||||
$param['use_gzip']= true; // Enable gzip compression
|
||||
// END CONFIG
|
||||
|
||||
$compressor= new Compressor($param);
|
||||
|
||||
class Compressor{
|
||||
|
||||
|
||||
function compressor($param)
|
||||
{
|
||||
$this->__construct($param);
|
||||
}
|
||||
|
||||
function __construct($param)
|
||||
{
|
||||
$this->start_time= $this->get_microtime();
|
||||
$this->file_loaded_size=0;
|
||||
$this->param= $param;
|
||||
$this->script_list="";
|
||||
$this->path= dirname(__FILE__)."/";
|
||||
if(isset($_GET['plugins'])){
|
||||
$this->load_all_plugins= true;
|
||||
$this->full_cache_file= $this->path."edit_area_full_with_plugins.js";
|
||||
$this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz";
|
||||
}else{
|
||||
$this->load_all_plugins= false;
|
||||
$this->full_cache_file= $this->path."edit_area_full.js";
|
||||
$this->gzip_cache_file= $this->path."edit_area_full.gz";
|
||||
}
|
||||
|
||||
$this->check_gzip_use();
|
||||
$this->send_headers();
|
||||
$this->check_cache();
|
||||
$this->load_files();
|
||||
$this->send_datas();
|
||||
}
|
||||
|
||||
function send_headers()
|
||||
{
|
||||
header("Content-type: text/javascript; charset: UTF-8");
|
||||
header("Vary: Accept-Encoding"); // Handle proxies
|
||||
header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) );
|
||||
if($this->use_gzip)
|
||||
header("Content-Encoding: ".$this->gzip_enc_header);
|
||||
}
|
||||
|
||||
function check_gzip_use()
|
||||
{
|
||||
$encodings = array();
|
||||
$desactivate_gzip=false;
|
||||
|
||||
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
|
||||
$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
|
||||
|
||||
// desactivate gzip for IE version < 7
|
||||
if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie))
|
||||
{
|
||||
if($ie[1]<7)
|
||||
$desactivate_gzip=true;
|
||||
}
|
||||
|
||||
// Check for gzip header or northon internet securities
|
||||
if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
|
||||
$this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
|
||||
$this->use_gzip=true;
|
||||
$this->cache_file=$this->gzip_cache_file;
|
||||
}else{
|
||||
$this->use_gzip=false;
|
||||
$this->cache_file=$this->full_cache_file;
|
||||
}
|
||||
}
|
||||
|
||||
function check_cache()
|
||||
{
|
||||
// Only gzip the contents if clients and server support it
|
||||
if (file_exists($this->cache_file)) {
|
||||
// check if cache file must be updated
|
||||
$cache_date=0;
|
||||
if ($dir = opendir($this->path)) {
|
||||
while (($file = readdir($dir)) !== false) {
|
||||
if(is_file($this->path.$file) && $file!="." && $file!="..")
|
||||
$cache_date= max($cache_date, filemtime($this->path.$file));
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
if($this->load_all_plugins){
|
||||
$plug_path= $this->path."plugins/";
|
||||
if (($dir = @opendir($plug_path)) !== false)
|
||||
{
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
if ($file !== "." && $file !== "..")
|
||||
{
|
||||
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
|
||||
$cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js"));
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
if(filemtime($this->cache_file) >= $cache_date){
|
||||
// if cache file is up to date
|
||||
$last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT";
|
||||
if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0)
|
||||
{
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
header("Last-modified: ".$last_modified);
|
||||
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
|
||||
header("Pragma:"); // Tells HTTP 1.0 clients to cache
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Last-modified: ".$last_modified);
|
||||
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
|
||||
header("Pragma:"); // Tells HTTP 1.0 clients to cache
|
||||
header('Content-Length: '.filesize($this->cache_file));
|
||||
echo file_get_contents($this->cache_file);
|
||||
}
|
||||
die;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function load_files()
|
||||
{
|
||||
$loader= $this->get_content("edit_area_loader.js")."\n";
|
||||
|
||||
// get the list of other files to load
|
||||
$loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e"
|
||||
, "\$this->replace_scripts('script_list', '\\1', '\\2')"
|
||||
, $loader);
|
||||
|
||||
$loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e"
|
||||
, "\$this->replace_scripts('sub_script_list', '\\1', '\\2')"
|
||||
, $loader);
|
||||
|
||||
$this->datas= $loader;
|
||||
$this->compress_javascript($this->datas);
|
||||
|
||||
// load other scripts needed for the loader
|
||||
preg_match_all('/"([^"]*)"/', $this->script_list, $match);
|
||||
foreach($match[1] as $key => $value)
|
||||
{
|
||||
$content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js");
|
||||
$this->compress_javascript($content);
|
||||
$this->datas.= $content."\n";
|
||||
}
|
||||
//$this->datas);
|
||||
//$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas);
|
||||
|
||||
// improved compression step 1/2
|
||||
$this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas);
|
||||
//$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas);
|
||||
$this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;";
|
||||
|
||||
// load sub scripts
|
||||
$sub_scripts="";
|
||||
$sub_scripts_list= array();
|
||||
preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match);
|
||||
foreach($match[1] as $value){
|
||||
$sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js";
|
||||
}
|
||||
|
||||
if($this->load_all_plugins){
|
||||
// load plugins scripts
|
||||
$plug_path= $this->path."plugins/";
|
||||
if (($dir = @opendir($plug_path)) !== false)
|
||||
{
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
if ($file !== "." && $file !== "..")
|
||||
{
|
||||
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
|
||||
$sub_scripts_list[]= "plugins/".$file."/".$file.".js";
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($sub_scripts_list as $value){
|
||||
$sub_scripts.= $this->get_javascript_content($value);
|
||||
}
|
||||
// improved compression step 2/2
|
||||
$sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
|
||||
// $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
|
||||
$sub_scripts.= "var editArea= eA;EditArea=EA;";
|
||||
|
||||
|
||||
// add the scripts
|
||||
// $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\n", $sub_scripts);
|
||||
|
||||
|
||||
// add the script and use a last compression
|
||||
if( $this->param['compress'] )
|
||||
{
|
||||
$last_comp = array( 'Á' => 'this',
|
||||
'Â' => 'textarea',
|
||||
'Ã' => 'function',
|
||||
'Ä' => 'prototype',
|
||||
'Å' => 'settings',
|
||||
'Æ' => 'length',
|
||||
'Ç' => 'style',
|
||||
'È' => 'parent',
|
||||
'É' => 'last_selection',
|
||||
'Ê' => 'value',
|
||||
'Ë' => 'true',
|
||||
'Ì' => 'false'
|
||||
/*,
|
||||
'Î' => '"',
|
||||
'Ï' => "\n",
|
||||
'À' => "\r"*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_comp = array();
|
||||
}
|
||||
|
||||
$js_replace= '';
|
||||
foreach( $last_comp as $key => $val )
|
||||
$js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')";
|
||||
|
||||
$this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n",
|
||||
str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ),
|
||||
$js_replace);
|
||||
|
||||
if($this->load_all_plugins)
|
||||
$this->datas.="editAreaLoader.all_plugins_loaded=true;\n";
|
||||
|
||||
|
||||
// load the template
|
||||
$this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html"));
|
||||
// load the css
|
||||
$this->datas.= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css"));
|
||||
|
||||
// $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();";
|
||||
|
||||
}
|
||||
|
||||
function send_datas()
|
||||
{
|
||||
if($this->param['debug']){
|
||||
$header=sprintf("/* USE PHP COMPRESSION\n");
|
||||
$header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas));
|
||||
if($this->use_gzip){
|
||||
$gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
|
||||
$header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas));
|
||||
$ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0);
|
||||
}else{
|
||||
$ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0);
|
||||
}
|
||||
$header.=sprintf(", reduced by %s%%\n", $ratio);
|
||||
$header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time);
|
||||
$header.=sprintf("%s\n", implode("\n", $this->infos));
|
||||
$header.=sprintf("*/\n");
|
||||
$this->datas= $header.$this->datas;
|
||||
}
|
||||
$mtime= time(); // ensure that the 2 disk files will have the same update time
|
||||
// generate gzip file and cahce it if using disk cache
|
||||
if($this->use_gzip){
|
||||
$this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
|
||||
if($this->param['use_disk_cache'])
|
||||
$this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime);
|
||||
}
|
||||
|
||||
// generate full js file and cache it if using disk cache
|
||||
if($this->param['use_disk_cache'])
|
||||
$this->file_put_contents($this->full_cache_file, $this->datas, $mtime);
|
||||
|
||||
// generate output
|
||||
if($this->use_gzip)
|
||||
echo $this->gzip_datas;
|
||||
else
|
||||
echo $this->datas;
|
||||
|
||||
// die;
|
||||
}
|
||||
|
||||
|
||||
function get_content($end_uri)
|
||||
{
|
||||
$end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security)
|
||||
$file= $this->path.$end_uri;
|
||||
if(file_exists($file)){
|
||||
$this->infos[]=sprintf("'%s' loaded", $end_uri);
|
||||
/*$fd = fopen($file, 'rb');
|
||||
$content = fread($fd, filesize($file));
|
||||
fclose($fd);
|
||||
return $content;*/
|
||||
return $this->file_get_contents($file);
|
||||
}else{
|
||||
$this->infos[]=sprintf("'%s' not loaded", $end_uri);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function get_javascript_content($end_uri)
|
||||
{
|
||||
$val=$this->get_content($end_uri);
|
||||
|
||||
$this->compress_javascript($val);
|
||||
$this->prepare_string_for_quotes($val);
|
||||
return $val;
|
||||
}
|
||||
|
||||
function compress_javascript(&$code)
|
||||
{
|
||||
if($this->param['compress'])
|
||||
{
|
||||
// remove all comments
|
||||
// (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))
|
||||
$code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
|
||||
// remove line return, empty line and tabulation
|
||||
$code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
|
||||
// add line break before "else" otherwise navigators can't manage to parse the file
|
||||
$code= preg_replace('/(\b(else)\b)/', "\n$1", $code);
|
||||
// remove unnecessary spaces
|
||||
$code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code);
|
||||
}
|
||||
}
|
||||
|
||||
function get_css_content($end_uri){
|
||||
$code=$this->get_content($end_uri);
|
||||
// remove comments
|
||||
$code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code);
|
||||
// remove spaces
|
||||
$code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code);
|
||||
// remove spaces
|
||||
$code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code);
|
||||
|
||||
$this->prepare_string_for_quotes($code);
|
||||
return $code;
|
||||
}
|
||||
|
||||
function get_html_content($end_uri){
|
||||
$code=$this->get_content($end_uri);
|
||||
//$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
|
||||
$code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
|
||||
$this->prepare_string_for_quotes($code);
|
||||
return $code;
|
||||
}
|
||||
|
||||
function prepare_string_for_quotes(&$str){
|
||||
// prepare the code to be putted into quotes
|
||||
/*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
|
||||
$replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/
|
||||
$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
|
||||
if($this->param['compress'])
|
||||
$replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n');
|
||||
else
|
||||
$replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\"");
|
||||
$str= preg_replace($pattern, $replace, $str);
|
||||
}
|
||||
|
||||
function replace_scripts($var, $param1, $param2)
|
||||
{
|
||||
$this->$var=stripslashes($param2);
|
||||
return $param1."[];";
|
||||
}
|
||||
|
||||
/* for php version that have not thoses functions */
|
||||
function file_get_contents($file)
|
||||
{
|
||||
$fd = fopen($file, 'rb');
|
||||
$content = fread($fd, filesize($file));
|
||||
fclose($fd);
|
||||
$this->file_loaded_size+= strlen($content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
function file_put_contents($file, &$content, $mtime=-1)
|
||||
{
|
||||
if($mtime==-1)
|
||||
$mtime=time();
|
||||
$fp = @fopen($file, "wb");
|
||||
if ($fp) {
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
touch($file, $mtime);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function get_microtime()
|
||||
{
|
||||
list($usec, $sec) = explode(" ", microtime());
|
||||
return ((float)$usec + (float)$sec);
|
||||
}
|
||||
}
|
||||
?>
|
||||
BIN
include/limesurvey/admin/scripts/edit_area/edit_area_full.gz
Normal file
38
include/limesurvey/admin/scripts/edit_area/edit_area_full.js
Normal file
1203
include/limesurvey/admin/scripts/edit_area/edit_area_functions.js
Normal file
1080
include/limesurvey/admin/scripts/edit_area/edit_area_loader.js
Normal file
333
include/limesurvey/admin/scripts/edit_area/elements_functions.js
Normal file
@@ -0,0 +1,333 @@
|
||||
/****
|
||||
* This page contains some general usefull functions for javascript
|
||||
*
|
||||
****/
|
||||
|
||||
|
||||
// need to redefine this functiondue to IE problem
|
||||
function getAttribute( elm, aName ) {
|
||||
var aValue,taName,i;
|
||||
try{
|
||||
aValue = elm.getAttribute( aName );
|
||||
}catch(exept){}
|
||||
|
||||
if( ! aValue ){
|
||||
for( i = 0; i < elm.attributes.length; i ++ ) {
|
||||
taName = elm.attributes[i] .name.toLowerCase();
|
||||
if( taName == aName ) {
|
||||
aValue = elm.attributes[i] .value;
|
||||
return aValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return aValue;
|
||||
};
|
||||
|
||||
// need to redefine this function due to IE problem
|
||||
function setAttribute( elm, attr, val ) {
|
||||
if(attr=="class"){
|
||||
elm.setAttribute("className", val);
|
||||
elm.setAttribute("class", val);
|
||||
}else{
|
||||
elm.setAttribute(attr, val);
|
||||
}
|
||||
};
|
||||
|
||||
/* return a child element
|
||||
elem: element we are searching in
|
||||
elem_type: type of the eleemnt we are searching (DIV, A, etc...)
|
||||
elem_attribute: attribute of the searched element that must match
|
||||
elem_attribute_match: value that elem_attribute must match
|
||||
option: "all" if must return an array of all children, otherwise return the first match element
|
||||
depth: depth of search (-1 or no set => unlimited)
|
||||
*/
|
||||
function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth)
|
||||
{
|
||||
if(!option)
|
||||
var option="single";
|
||||
if(!depth)
|
||||
var depth=-1;
|
||||
if(elem){
|
||||
var children= elem.childNodes;
|
||||
var result=null;
|
||||
var results= [];
|
||||
for (var x=0;x<children.length;x++) {
|
||||
strTagName = new String(children[x].tagName);
|
||||
children_class="?";
|
||||
if(strTagName!= "undefined"){
|
||||
child_attribute= getAttribute(children[x],elem_attribute);
|
||||
if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
|
||||
if(option=="all"){
|
||||
results.push(children[x]);
|
||||
}else{
|
||||
return children[x];
|
||||
}
|
||||
}
|
||||
if(depth!=0){
|
||||
result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
|
||||
if(option=="all"){
|
||||
if(result.length>0){
|
||||
results= results.concat(result);
|
||||
}
|
||||
}else if(result!=null){
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(option=="all")
|
||||
return results;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
function isChildOf(elem, parent){
|
||||
if(elem){
|
||||
if(elem==parent)
|
||||
return true;
|
||||
while(elem.parentNode != 'undefined'){
|
||||
return isChildOf(elem.parentNode, parent);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function getMouseX(e){
|
||||
|
||||
if(e!=null && typeof(e.pageX)!="undefined"){
|
||||
return e.pageX;
|
||||
}else{
|
||||
return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;
|
||||
}
|
||||
};
|
||||
|
||||
function getMouseY(e){
|
||||
if(e!=null && typeof(e.pageY)!="undefined"){
|
||||
return e.pageY;
|
||||
}else{
|
||||
return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;
|
||||
}
|
||||
};
|
||||
|
||||
function calculeOffsetLeft(r){
|
||||
return calculeOffset(r,"offsetLeft")
|
||||
};
|
||||
|
||||
function calculeOffsetTop(r){
|
||||
return calculeOffset(r,"offsetTop")
|
||||
};
|
||||
|
||||
function calculeOffset(element,attr){
|
||||
var offset=0;
|
||||
while(element){
|
||||
offset+=element[attr];
|
||||
element=element.offsetParent
|
||||
}
|
||||
return offset;
|
||||
};
|
||||
|
||||
/** return the computed style
|
||||
* @param: elem: the reference to the element
|
||||
* @param: prop: the name of the css property
|
||||
*/
|
||||
function get_css_property(elem, prop)
|
||||
{
|
||||
if(document.defaultView)
|
||||
{
|
||||
return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
|
||||
}
|
||||
else if(elem.currentStyle)
|
||||
{
|
||||
var prop = prop.replace(/-\D/gi, function(sMatch)
|
||||
{
|
||||
return sMatch.charAt(sMatch.length - 1).toUpperCase();
|
||||
});
|
||||
return elem.currentStyle[prop];
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
|
||||
/****
|
||||
* Moving an element
|
||||
***/
|
||||
|
||||
var _mCE; // currently moving element
|
||||
|
||||
/* allow to move an element in a window
|
||||
e: the event
|
||||
id: the id of the element
|
||||
frame: the frame of the element
|
||||
ex of use:
|
||||
in html: <img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>
|
||||
or
|
||||
in javascript: document.getElementById("my_div").onmousedown= start_move_element
|
||||
*/
|
||||
function start_move_element(e, id, frame){
|
||||
var elem_id=(e.target || e.srcElement).id;
|
||||
if(id)
|
||||
elem_id=id;
|
||||
if(!frame)
|
||||
frame=window;
|
||||
if(frame.event)
|
||||
e=frame.event;
|
||||
|
||||
_mCE= frame.document.getElementById(elem_id);
|
||||
_mCE.frame=frame;
|
||||
frame.document.onmousemove= move_element;
|
||||
frame.document.onmouseup= end_move_element;
|
||||
/*_mCE.onmousemove= move_element;
|
||||
_mCE.onmouseup= end_move_element;*/
|
||||
|
||||
//alert(_mCE.frame.document.body.offsetHeight);
|
||||
|
||||
mouse_x= getMouseX(e);
|
||||
mouse_y= getMouseY(e);
|
||||
//window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
|
||||
_mCE.start_pos_x = mouse_x - (_mCE.style.left.replace("px","") || calculeOffsetLeft(_mCE));
|
||||
_mCE.start_pos_y = mouse_y - (_mCE.style.top.replace("px","") || calculeOffsetTop(_mCE));
|
||||
return false;
|
||||
};
|
||||
|
||||
function end_move_element(e){
|
||||
_mCE.frame.document.onmousemove= "";
|
||||
_mCE.frame.document.onmouseup= "";
|
||||
_mCE=null;
|
||||
};
|
||||
|
||||
function move_element(e){
|
||||
var newTop,newLeft,maxLeft;
|
||||
|
||||
if( _mCE.frame && _mCE.frame.event )
|
||||
e=_mCE.frame.event;
|
||||
newTop = getMouseY(e) - _mCE.start_pos_y;
|
||||
newLeft = getMouseX(e) - _mCE.start_pos_x;
|
||||
|
||||
maxLeft = _mCE.frame.document.body.offsetWidth- _mCE.offsetWidth;
|
||||
max_top = _mCE.frame.document.body.offsetHeight- _mCE.offsetHeight;
|
||||
newTop = Math.min(Math.max(0, newTop), max_top);
|
||||
newLeft = Math.min(Math.max(0, newLeft), maxLeft);
|
||||
|
||||
_mCE.style.top = newTop+"px";
|
||||
_mCE.style.left = newLeft+"px";
|
||||
return false;
|
||||
};
|
||||
|
||||
/***
|
||||
* Managing a textarea (this part need the navigator infos from editAreaLoader
|
||||
***/
|
||||
|
||||
var nav= editAreaLoader.nav;
|
||||
|
||||
// allow to get infos on the selection: array(start, end)
|
||||
function getSelectionRange(textarea){
|
||||
return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
|
||||
};
|
||||
|
||||
// allow to set the selection
|
||||
function setSelectionRange(t, start, end){
|
||||
t.focus();
|
||||
|
||||
start = Math.max(0, Math.min(t.value.length, start));
|
||||
end = Math.max(start, Math.min(t.value.length, end));
|
||||
|
||||
if( this.isOpera && this.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
|
||||
t.selectionEnd = 1;
|
||||
t.selectionStart = 0;
|
||||
t.selectionEnd = 1;
|
||||
t.selectionStart = 0;
|
||||
}
|
||||
t.selectionStart = start;
|
||||
t.selectionEnd = end;
|
||||
//textarea.setSelectionRange(start, end);
|
||||
|
||||
if(isIE)
|
||||
set_IE_selection(t);
|
||||
};
|
||||
|
||||
|
||||
// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
|
||||
function get_IE_selection(t){
|
||||
var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;
|
||||
if(t && t.focused)
|
||||
{
|
||||
if(!t.ea_line_height)
|
||||
{ // calculate the lineHeight
|
||||
div= d.createElement("div");
|
||||
div.style.fontFamily= get_css_property(t, "font-family");
|
||||
div.style.fontSize= get_css_property(t, "font-size");
|
||||
div.style.visibility= "hidden";
|
||||
div.innerHTML="0";
|
||||
d.body.appendChild(div);
|
||||
t.ea_line_height= div.offsetHeight;
|
||||
d.body.removeChild(div);
|
||||
}
|
||||
//t.focus();
|
||||
range = d.selection.createRange();
|
||||
try
|
||||
{
|
||||
stored_range = range.duplicate();
|
||||
stored_range.moveToElementText( t );
|
||||
stored_range.setEndPoint( 'EndToEnd', range );
|
||||
if(stored_range.parentElement() == t){
|
||||
// the range don't take care of empty lines in the end of the selection
|
||||
elem = t;
|
||||
scrollTop = 0;
|
||||
while(elem.parentNode){
|
||||
scrollTop+= elem.scrollTop;
|
||||
elem = elem.parentNode;
|
||||
}
|
||||
|
||||
// var scrollTop= t.scrollTop + document.body.scrollTop;
|
||||
|
||||
// var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
|
||||
relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
|
||||
// alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
|
||||
line_start = Math.round((relative_top / t.ea_line_height) +1);
|
||||
|
||||
line_nb = Math.round(range.boundingHeight / t.ea_line_height);
|
||||
|
||||
range_start = stored_range.text.length - range.text.length;
|
||||
tab = t.value.substr(0, range_start).split("\n");
|
||||
range_start += (line_start - tab.length)*2; // add missing empty lines to the selection
|
||||
t.selectionStart = range_start;
|
||||
|
||||
range_end = t.selectionStart + range.text.length;
|
||||
tab = t.value.substr(0, range_start + range.text.length).split("\n");
|
||||
range_end += (line_start + line_nb - 1 - tab.length)*2;
|
||||
t.selectionEnd = range_end;
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
|
||||
};
|
||||
|
||||
function IE_textarea_focus(){
|
||||
event.srcElement.focused= true;
|
||||
}
|
||||
|
||||
function IE_textarea_blur(){
|
||||
event.srcElement.focused= false;
|
||||
}
|
||||
|
||||
// select the text for IE (take into account the \r difference)
|
||||
function set_IE_selection( t ){
|
||||
var nbLineStart,nbLineStart,nbLineEnd,range;
|
||||
if(!window.closed){
|
||||
nbLineStart=t.value.substr(0, t.selectionStart).split("\n").length - 1;
|
||||
nbLineEnd=t.value.substr(0, t.selectionEnd).split("\n").length - 1;
|
||||
try
|
||||
{
|
||||
range = document.selection.createRange();
|
||||
range.moveToElementText( t );
|
||||
range.setEndPoint( 'EndToStart', range );
|
||||
range.moveStart('character', t.selectionStart - nbLineStart);
|
||||
range.moveEnd('character', t.selectionEnd - nbLineEnd - (t.selectionStart - nbLineStart) );
|
||||
range.select();
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";
|
||||
391
include/limesurvey/admin/scripts/edit_area/highlight.js
Normal file
@@ -0,0 +1,391 @@
|
||||
// change_to: "on" or "off"
|
||||
EditArea.prototype.change_highlight= function(change_to){
|
||||
if(this.settings["syntax"].length==0 && change_to==false){
|
||||
this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
|
||||
this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.do_highlight==change_to)
|
||||
return false;
|
||||
|
||||
|
||||
this.getIESelection();
|
||||
var pos_start= this.textarea.selectionStart;
|
||||
var pos_end= this.textarea.selectionEnd;
|
||||
|
||||
if(this.do_highlight===true || change_to==false)
|
||||
this.disable_highlight();
|
||||
else
|
||||
this.enable_highlight();
|
||||
this.textarea.focus();
|
||||
this.textarea.selectionStart = pos_start;
|
||||
this.textarea.selectionEnd = pos_end;
|
||||
this.setIESelection();
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.disable_highlight= function(displayOnly){
|
||||
var t= this, a=t.textarea, new_Obj, old_class, new_class;
|
||||
|
||||
t.selection_field.innerHTML="";
|
||||
t.selection_field_text.innerHTML="";
|
||||
t.content_highlight.style.visibility="hidden";
|
||||
// replacing the node is far more faster than deleting it's content in firefox
|
||||
new_Obj= t.content_highlight.cloneNode(false);
|
||||
new_Obj.innerHTML= "";
|
||||
t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
|
||||
t.content_highlight.parentNode.removeChild(t.content_highlight);
|
||||
t.content_highlight= new_Obj;
|
||||
old_class= parent.getAttribute( a,"class" );
|
||||
if(old_class){
|
||||
new_class= old_class.replace( "hidden","" );
|
||||
parent.setAttribute( a, "class", new_class );
|
||||
}
|
||||
|
||||
a.style.backgroundColor="transparent"; // needed in order to see the bracket finders
|
||||
|
||||
//var icon= document.getElementById("highlight");
|
||||
//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
|
||||
//t.restoreClass(icon);
|
||||
//t.switchClass(icon,'editAreaButtonNormal');
|
||||
t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
|
||||
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
|
||||
|
||||
t.do_highlight=false;
|
||||
|
||||
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
|
||||
if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
|
||||
t.change_smooth_selection_mode(false);
|
||||
}
|
||||
|
||||
// this.textarea.style.backgroundColor="#FFFFFF";
|
||||
};
|
||||
|
||||
EditArea.prototype.enable_highlight= function(){
|
||||
var t=this, a=t.textarea, new_class;
|
||||
t.show_waiting_screen();
|
||||
|
||||
t.content_highlight.style.visibility="visible";
|
||||
new_class =parent.getAttribute(a,"class")+" hidden";
|
||||
parent.setAttribute( a, "class", new_class );
|
||||
|
||||
// IE can't manage mouse click outside text range without this
|
||||
if( t.isIE )
|
||||
a.style.backgroundColor="#FFFFFF";
|
||||
|
||||
t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
|
||||
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
|
||||
|
||||
t.smooth_selection_before_highlight=t.smooth_selection;
|
||||
if(!t.smooth_selection)
|
||||
t.change_smooth_selection_mode(true);
|
||||
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
|
||||
|
||||
|
||||
t.do_highlight=true;
|
||||
t.resync_highlight();
|
||||
|
||||
t.hide_waiting_screen();
|
||||
};
|
||||
|
||||
/**
|
||||
* Ask to update highlighted text
|
||||
* @param Array infos - Array of datas returned by EditArea.get_selection_infos()
|
||||
*/
|
||||
EditArea.prototype.maj_highlight= function(infos){
|
||||
// for speed mesure
|
||||
var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
|
||||
var t=this, hightlighted_text, updated_highlight;
|
||||
var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
|
||||
|
||||
if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
|
||||
return;
|
||||
|
||||
// OPTIMISATION: will search to update only changed lines
|
||||
if(t.reload_highlight===true){
|
||||
t.reload_highlight=false;
|
||||
}else if(textToHighlight.length==0){
|
||||
textToHighlight="\n ";
|
||||
}else{
|
||||
// get text change datas
|
||||
changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
|
||||
|
||||
// check if it can only reparse the changed text
|
||||
trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
|
||||
trace_last = t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
|
||||
doSyntaxOpti = ( trace_new == trace_last );
|
||||
|
||||
// check if the difference comes only from a new line created
|
||||
// => we have to remember that the editor can automaticaly add tabulation or space after the new line)
|
||||
if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
|
||||
{
|
||||
doSyntaxOpti = true;
|
||||
}
|
||||
|
||||
// we do the syntax optimisation
|
||||
if( doSyntaxOpti ){
|
||||
|
||||
tps_middle_opti=new Date().getTime();
|
||||
|
||||
stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
|
||||
if(changes.lineStart>0)
|
||||
stay_begin+= "\n";
|
||||
stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
|
||||
if(stay_end.length>0)
|
||||
stay_end= "\n"+stay_end;
|
||||
|
||||
// Final check to see that we're not in the middle of span tags
|
||||
if( stay_begin.split('<span').length != stay_begin.split('</span').length
|
||||
|| stay_end.split('<span').length != stay_end.split('</span').length )
|
||||
{
|
||||
doSyntaxOpti = false;
|
||||
stay_end = '';
|
||||
stay_begin = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
if(stay_begin.length==0 && changes.posLastEnd==-1)
|
||||
changes.newTextLine+="\n";
|
||||
textToHighlight=changes.newTextLine;
|
||||
}
|
||||
}
|
||||
if(t.settings["debug"]){
|
||||
var ch =changes;
|
||||
debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
|
||||
+" start: "+ch.posStart +"("+ch.lineStart+")"
|
||||
+" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
|
||||
+" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
|
||||
+"\nchanged_text: "+ch.newText+" => trace: "+trace_new
|
||||
+"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
|
||||
//debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
|
||||
+ "\nchanged_line: "+ch.newTextLine
|
||||
+ "\nlast_changed_line: "+ch.lastTextLine
|
||||
+"\nstay_begin: "+ stay_begin.slice(-100)
|
||||
+"\nstay_end: "+ stay_end.substr( 0, 100 );
|
||||
//debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
|
||||
//debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
|
||||
|
||||
//debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
|
||||
+"\n";
|
||||
}
|
||||
|
||||
|
||||
// END OPTIMISATION
|
||||
}
|
||||
|
||||
tps_end_opti = new Date().getTime();
|
||||
|
||||
// apply highlight
|
||||
updated_highlight = t.colorize_text(textToHighlight);
|
||||
tpsAfterReg = new Date().getTime();
|
||||
|
||||
/***
|
||||
* see if we can optimize for updating only the required part of the HTML code
|
||||
*
|
||||
* The goal here will be to find the text node concerned by the modification and to update it
|
||||
*/
|
||||
//-------------------------------------------
|
||||
//
|
||||
if( doSyntaxOpti )
|
||||
{
|
||||
try
|
||||
{
|
||||
var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
|
||||
replacedBloc = t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
|
||||
|
||||
lengthOld = replacedBloc.length;
|
||||
lengthNew = updated_highlight.length;
|
||||
|
||||
// find the identical caracters at the beginning
|
||||
for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
|
||||
{
|
||||
}
|
||||
nbStart = i;
|
||||
// find the identical caracters at the end
|
||||
for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
|
||||
{
|
||||
}
|
||||
nbEnd = i;
|
||||
|
||||
// get the changes
|
||||
lastHtml = replacedBloc.substring( nbStart, lengthOld - nbEnd );
|
||||
newHtml = updated_highlight.substring( nbStart, lengthNew - nbEnd );
|
||||
|
||||
|
||||
// We can do the optimisation only if we havn't touch to span elements
|
||||
if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1
|
||||
&& lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
|
||||
{
|
||||
var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
|
||||
doHtmlOpti = true;
|
||||
beginStr = t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
|
||||
|
||||
nbOpendedSpan = beginStr.split('<span').length - 1;
|
||||
nbClosedSpan = beginStr.split('</span').length - 1;
|
||||
// retrieve the previously opened span (Add 1 for the first level span?)
|
||||
span = t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
|
||||
|
||||
//--------[
|
||||
// get the textNode to update
|
||||
|
||||
// if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
|
||||
parentSpan = span;
|
||||
maxStartOffset = maxEndOffset = 0;
|
||||
|
||||
// it will be in the child of the root node
|
||||
if( nbOpendedSpan == nbClosedSpan )
|
||||
{
|
||||
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
|
||||
{
|
||||
parentSpan = parentSpan.parentNode;
|
||||
}
|
||||
}
|
||||
// get the last opened span
|
||||
else
|
||||
{
|
||||
maxStartOffset = maxEndOffset = beginStr.length + 1;
|
||||
// move to parent node for each closed span found after the lastest open span
|
||||
nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
|
||||
while( nbClosed > 0 )
|
||||
{
|
||||
nbClosed--;
|
||||
parentSpan = parentSpan.parentNode;
|
||||
}
|
||||
|
||||
// find the position of the last opended tag
|
||||
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
|
||||
{
|
||||
maxStartOffset = tmpMaxStartOffset;
|
||||
maxEndOffset = tmpMaxEndOffset;
|
||||
}
|
||||
}
|
||||
// Note: maxEndOffset is no more used but maxStartOffset will be used
|
||||
|
||||
if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
|
||||
{
|
||||
maxStartOffset = Math.max( 0, beginStr.indexOf( '<span' ) );
|
||||
}
|
||||
|
||||
// find the matching text node (this will be one that will be at the end of the beginStr
|
||||
if( maxStartOffset == beginStr.length )
|
||||
{
|
||||
nbSubSpanBefore = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastEndPos = Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
|
||||
|
||||
// count the number of sub spans
|
||||
nbSubSpanBefore = beginStr.substr( lastEndPos ).split('<span').length-1;
|
||||
}
|
||||
|
||||
// there is no sub-span before
|
||||
if( nbSubSpanBefore == 0 )
|
||||
{
|
||||
textNode = parentSpan.firstChild;
|
||||
}
|
||||
// we need to find where is the text node modified
|
||||
else
|
||||
{
|
||||
// take the last direct child (no sub-child)
|
||||
lastSubSpan = parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
|
||||
while( lastSubSpan.parentNode != parentSpan )
|
||||
{
|
||||
lastSubSpan = lastSubSpan.parentNode;
|
||||
}
|
||||
|
||||
// associate to next text node following the last sub span
|
||||
if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
|
||||
{
|
||||
textNode = document.createTextNode('');
|
||||
lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
|
||||
}
|
||||
else
|
||||
{
|
||||
textNode = lastSubSpan.nextSibling;
|
||||
}
|
||||
}
|
||||
//--------]
|
||||
|
||||
|
||||
//--------[
|
||||
// update the textNode content
|
||||
|
||||
// number of caracters after the last opened of closed span
|
||||
nbUnchangedChars = beginStr.length - Math.max( 0, beginStr.lastIndexOf( '>' ) + 1 );
|
||||
|
||||
// console.log( span, textNode, nbOpendedSpan,nbClosedSpan, span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
|
||||
// alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length );
|
||||
|
||||
// IE only manage \r for cariage return in textNode and not \n or \r\n
|
||||
if( t.isIE )
|
||||
{
|
||||
nbUnchangedChars -= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
|
||||
//alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n'));
|
||||
textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
|
||||
}
|
||||
else
|
||||
{
|
||||
textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
|
||||
}
|
||||
//--------]
|
||||
}
|
||||
}
|
||||
// an exception shouldn't occured but if replaceData failed at least it won't break everything
|
||||
catch( e )
|
||||
{
|
||||
// throw e;
|
||||
// console.log( e );
|
||||
doHtmlOpti = false;
|
||||
}
|
||||
|
||||
}
|
||||
/*** END HTML update's optimisation ***/
|
||||
// end test
|
||||
|
||||
// console.log( (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
|
||||
// get the new highlight content
|
||||
tpsAfterOpti2 = new Date().getTime();
|
||||
hightlighted_text = stay_begin + updated_highlight + stay_end;
|
||||
if( !doHtmlOpti )
|
||||
{
|
||||
// update the content of the highlight div by first updating a clone node (as there is no display in the same time for t node it's quite faster (5*))
|
||||
var new_Obj= t.content_highlight.cloneNode(false);
|
||||
if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
|
||||
new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";
|
||||
else
|
||||
new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
|
||||
|
||||
t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
|
||||
|
||||
t.content_highlight= new_Obj;
|
||||
}
|
||||
|
||||
t.last_text_to_highlight= infos["full_text"];
|
||||
t.last_hightlighted_text= hightlighted_text;
|
||||
|
||||
tps3=new Date().getTime();
|
||||
|
||||
if(t.settings["debug"]){
|
||||
//lineNumber=tab_text.length;
|
||||
//t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
|
||||
|
||||
t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
|
||||
+" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
|
||||
+" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
|
||||
+" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
|
||||
+" | tpsTotal: "+ (tps3-tps_start)
|
||||
+ "("+tps3+")\n"+ debug_opti;
|
||||
// t.debug.value+= "highlight\n"+hightlighted_text;*/
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.resync_highlight= function(reload_now){
|
||||
this.reload_highlight=true;
|
||||
this.last_text_to_highlight="";
|
||||
this.focus();
|
||||
if(reload_now)
|
||||
this.check_line_selection(false);
|
||||
};
|
||||
|
After Width: | Height: | Size: 359 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/close.gif
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/fullscreen.gif
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/go_to_line.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
include/limesurvey/admin/scripts/edit_area/images/help.gif
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/highlight.gif
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/load.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
include/limesurvey/admin/scripts/edit_area/images/move.gif
Normal file
|
After Width: | Height: | Size: 257 B |
|
After Width: | Height: | Size: 170 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/opacity.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/processing.gif
Normal file
|
After Width: | Height: | Size: 825 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/redo.gif
Normal file
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 168 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/save.gif
Normal file
|
After Width: | Height: | Size: 285 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/search.gif
Normal file
|
After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 174 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/spacer.gif
Normal file
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 79 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/undo.gif
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
include/limesurvey/admin/scripts/edit_area/images/word_wrap.gif
Normal file
|
After Width: | Height: | Size: 951 B |
145
include/limesurvey/admin/scripts/edit_area/keyboard.js
Normal file
@@ -0,0 +1,145 @@
|
||||
var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Space",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Left",38:"Up",39:"Right",40:"Down",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"};
|
||||
|
||||
|
||||
|
||||
function keyDown(e){
|
||||
if(!e){ // if IE
|
||||
e=event;
|
||||
}
|
||||
|
||||
// send the event to the plugins
|
||||
for(var i in editArea.plugins){
|
||||
if(typeof(editArea.plugins[i].onkeydown)=="function"){
|
||||
if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
|
||||
if(editArea.isIE)
|
||||
e.keyCode=0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var target_id=(e.target || e.srcElement).id;
|
||||
var use=false;
|
||||
if (EA_keys[e.keyCode])
|
||||
letter=EA_keys[e.keyCode];
|
||||
else
|
||||
letter=String.fromCharCode(e.keyCode);
|
||||
|
||||
var low_letter= letter.toLowerCase();
|
||||
|
||||
if(letter=="Page up" && !editArea.isOpera){
|
||||
editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
|
||||
use=true;
|
||||
}else if(letter=="Page down" && !editArea.isOpera){
|
||||
editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
|
||||
use=true;
|
||||
}else if(editArea.is_editable==false){
|
||||
// do nothing but also do nothing else (allow to navigate with page up and page down)
|
||||
return true;
|
||||
}else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){
|
||||
if(ShiftPressed(e))
|
||||
editArea.execCommand("invert_tab_selection");
|
||||
else
|
||||
editArea.execCommand("tab_selection");
|
||||
|
||||
use=true;
|
||||
if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) ) // opera && firefox mac can't cancel tabulation events...
|
||||
setTimeout("editArea.execCommand('focus');", 1);
|
||||
}else if(letter=="Entrer" && target_id=="textarea"){
|
||||
if(editArea.press_enter())
|
||||
use=true;
|
||||
}else if(letter=="Entrer" && target_id=="area_search"){
|
||||
editArea.execCommand("area_search");
|
||||
use=true;
|
||||
}else if(letter=="Esc"){
|
||||
editArea.execCommand("close_all_inline_popup", e);
|
||||
use=true;
|
||||
}else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
|
||||
switch(low_letter){
|
||||
case "f":
|
||||
editArea.execCommand("area_search");
|
||||
use=true;
|
||||
break;
|
||||
case "r":
|
||||
editArea.execCommand("area_replace");
|
||||
use=true;
|
||||
break;
|
||||
case "q":
|
||||
editArea.execCommand("close_all_inline_popup", e);
|
||||
use=true;
|
||||
break;
|
||||
case "h":
|
||||
editArea.execCommand("change_highlight");
|
||||
use=true;
|
||||
break;
|
||||
case "g":
|
||||
setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise
|
||||
use=true;
|
||||
break;
|
||||
case "e":
|
||||
editArea.execCommand("show_help");
|
||||
use=true;
|
||||
break;
|
||||
case "z":
|
||||
use=true;
|
||||
editArea.execCommand("undo");
|
||||
break;
|
||||
case "y":
|
||||
use=true;
|
||||
editArea.execCommand("redo");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check to disable the redo possibility if the textarea content change
|
||||
if(editArea.next.length > 0){
|
||||
setTimeout("editArea.check_redo();", 10);
|
||||
}
|
||||
|
||||
setTimeout("editArea.check_file_changes();", 10);
|
||||
|
||||
|
||||
if(use){
|
||||
// in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
|
||||
if(editArea.isIE)
|
||||
e.keyCode=0;
|
||||
return false;
|
||||
}
|
||||
//alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
|
||||
|
||||
return true;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// return true if Alt key is pressed
|
||||
function AltPressed(e) {
|
||||
if (window.event) {
|
||||
return (window.event.altKey);
|
||||
} else {
|
||||
if(e.modifiers)
|
||||
return (e.altKey || (e.modifiers % 2));
|
||||
else
|
||||
return e.altKey;
|
||||
}
|
||||
};
|
||||
|
||||
// return true if Ctrl key is pressed
|
||||
function CtrlPressed(e) {
|
||||
if (window.event) {
|
||||
return (window.event.ctrlKey);
|
||||
} else {
|
||||
return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
|
||||
}
|
||||
};
|
||||
|
||||
// return true if Shift key is pressed
|
||||
function ShiftPressed(e) {
|
||||
if (window.event) {
|
||||
return (window.event.shiftKey);
|
||||
} else {
|
||||
return (e.shiftKey || (e.modifiers>3));
|
||||
}
|
||||
};
|
||||
73
include/limesurvey/admin/scripts/edit_area/langs/bg.js
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Bulgarian translation
|
||||
* Author: Valentin Hristov
|
||||
* Company: SOFTKIT Bulgarian
|
||||
* Site: http://www.softkit-bg.com
|
||||
*/
|
||||
editAreaLoader.lang["bg"]={
|
||||
new_document: "нов документ",
|
||||
search_button: "търсене и замяна",
|
||||
search_command: "търси следващия / отвори прозорец с търсачка",
|
||||
search: "търсене",
|
||||
replace: "замяна",
|
||||
replace_command: "замяна / отвори прозорец с търсачка",
|
||||
find_next: "намери следващия",
|
||||
replace_all: "замени всички",
|
||||
reg_exp: "реголярни изрази",
|
||||
match_case: "чуствителен към регистъра",
|
||||
not_found: "няма резултат.",
|
||||
occurrence_replaced: "замяната е осъществена.",
|
||||
search_field_empty: "Полето за търсене е празно",
|
||||
restart_search_at_begin: "До края на документа. Почни с началото.",
|
||||
move_popup: "премести прозореца с търсачката",
|
||||
font_size: "--Размер на шрифта--",
|
||||
go_to_line: "премени към реда",
|
||||
go_to_line_prompt: "премени към номера на реда:",
|
||||
undo: "отмени",
|
||||
redo: "върни",
|
||||
change_smooth_selection: "включи/изключи някой от функциите за преглед (по красиво, но повече натоварва)",
|
||||
highlight: "превключване на оцветяване на синтаксиса включена/изключена",
|
||||
reset_highlight: "въстанови оцветяване на синтаксиса (ако не е синхронизиран с текста)",
|
||||
word_wrap: "режим на пренасяне на дълги редове",
|
||||
help: "за програмата",
|
||||
save: "съхрани",
|
||||
load: "зареди",
|
||||
line_abbr: "Стр",
|
||||
char_abbr: "Стлб",
|
||||
position: "Позиция",
|
||||
total: "Всичко",
|
||||
close_popup: "затвори прозореца",
|
||||
shortcuts: "Бързи клавиши",
|
||||
add_tab: "добави табулация в текста",
|
||||
remove_tab: "премахни табулацията в текста",
|
||||
about_notice: "Внимание: използвайте функцията оцветяване на синтаксиса само за малки текстове",
|
||||
toggle: "Превключи редактор",
|
||||
accesskey: "Бърз клавиш",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Зареждане...",
|
||||
fullscreen: "на цял екран",
|
||||
syntax_selection: "--Синтаксис--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "PHP",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "XML",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "C++",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Затвори файла"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/cs.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["cs"]={
|
||||
new_document: "Nový dokument",
|
||||
search_button: "Najdi a nahraď",
|
||||
search_command: "Hledej další / otevři vyhledávací pole",
|
||||
search: "Hledej",
|
||||
replace: "Nahraď",
|
||||
replace_command: "Nahraď / otevři vyhledávací pole",
|
||||
find_next: "Najdi další",
|
||||
replace_all: "Nahraď vše",
|
||||
reg_exp: "platné výrazy",
|
||||
match_case: "vyhodnocené výrazy",
|
||||
not_found: "nenalezené.",
|
||||
occurrence_replaced: "výskyty nahrazené.",
|
||||
search_field_empty: "Pole vyhledávání je prázdné",
|
||||
restart_search_at_begin: "Dosažen konec souboru, začínám od začátku.",
|
||||
move_popup: "Přesuň vyhledávací okno",
|
||||
font_size: "--Velikost textu--",
|
||||
go_to_line: "Přejdi na řádek",
|
||||
go_to_line_prompt: "Přejdi na řádek:",
|
||||
undo: "krok zpět",
|
||||
redo: "znovu",
|
||||
change_smooth_selection: "Povolit nebo zakázat některé ze zobrazených funkcí (účelnější zobrazení požaduje větší zatížení procesoru)",
|
||||
highlight: "Zvýrazňování syntaxe zap./vyp.",
|
||||
reset_highlight: "Obnovit zvýraznění (v případě nesrovnalostí)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "O programu",
|
||||
save: "Uložit",
|
||||
load: "Otevřít",
|
||||
line_abbr: "Ř.",
|
||||
char_abbr: "S.",
|
||||
position: "Pozice",
|
||||
total: "Celkem",
|
||||
close_popup: "Zavřít okno",
|
||||
shortcuts: "Zkratky",
|
||||
add_tab: "Přidat tabulování textu",
|
||||
remove_tab: "Odtsranit tabulování textu",
|
||||
about_notice: "Upozornění! Funkce zvýrazňování textu je k dispozici pouze pro malý text",
|
||||
toggle: "Přepnout editor",
|
||||
accesskey: "Přístupová klávesa",
|
||||
tab: "Záložka",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Zpracovávám ...",
|
||||
fullscreen: "Celá obrazovka",
|
||||
syntax_selection: "--vyber zvýrazňovač--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/de.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["de"]={
|
||||
new_document: "Neues Dokument",
|
||||
search_button: "Suchen und Ersetzen",
|
||||
search_command: "Weitersuchen / öffne Suchfeld",
|
||||
search: "Suchen",
|
||||
replace: "Ersetzen",
|
||||
replace_command: "Ersetzen / öffne Suchfeld",
|
||||
find_next: "Weitersuchen",
|
||||
replace_all: "Ersetze alle Treffer",
|
||||
reg_exp: "reguläre Ausdrücke",
|
||||
match_case: "passt auf den Begriff<br />",
|
||||
not_found: "Nicht gefunden.",
|
||||
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
|
||||
search_field_empty: "Leeres Suchfeld",
|
||||
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
|
||||
move_popup: "Suchfenster bewegen",
|
||||
font_size: "--Schriftgröße--",
|
||||
go_to_line: "Gehe zu Zeile",
|
||||
go_to_line_prompt: "Gehe zu Zeilennummmer:",
|
||||
undo: "Rückgängig",
|
||||
redo: "Wiederherstellen",
|
||||
change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
|
||||
highlight: "Syntax Highlighting an- und ausschalten",
|
||||
reset_highlight: "Highlighting zurücksetzen (falls mit Text nicht konform)",
|
||||
word_wrap: "Toggle word wrapping mode",
|
||||
help: "Info",
|
||||
save: "Speichern",
|
||||
load: "Öffnen",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Gesamt",
|
||||
close_popup: "Popup schließen",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "Tab zum Text hinzufügen",
|
||||
remove_tab: "Tab aus Text entfernen",
|
||||
about_notice: "Bemerkung: Syntax Highlighting ist nur für kurze Texte",
|
||||
toggle: "Editor an- und ausschalten",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "In Bearbeitung...",
|
||||
fullscreen: "Full-Screen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/dk.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["dk"]={
|
||||
new_document: "nyt tomt dokument",
|
||||
search_button: "søg og erstat",
|
||||
search_command: "find næste / åben søgefelt",
|
||||
search: "søg",
|
||||
replace: "erstat",
|
||||
replace_command: "erstat / åben søgefelt",
|
||||
find_next: "find næste",
|
||||
replace_all: "erstat alle",
|
||||
reg_exp: "regular expressions",
|
||||
match_case: "forskel på store/små bogstaver<br />",
|
||||
not_found: "not found.",
|
||||
occurrence_replaced: "occurences replaced.",
|
||||
search_field_empty: "Search field empty",
|
||||
restart_search_at_begin: "End of area reached. Restart at begin.",
|
||||
move_popup: "flyt søgepopup",
|
||||
font_size: "--Skriftstørrelse--",
|
||||
go_to_line: "gå til linie",
|
||||
go_to_line_prompt: "gå til linienummer:",
|
||||
undo: "fortryd",
|
||||
redo: "gentag",
|
||||
change_smooth_selection: "slå display funktioner til/fra (smartere display men mere CPU krævende)",
|
||||
highlight: "slå syntax highlight til/fra",
|
||||
reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "om",
|
||||
save: "gem",
|
||||
load: "hent",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "luk popup",
|
||||
shortcuts: "Genveje",
|
||||
add_tab: "tilføj tabulation til tekst",
|
||||
remove_tab: "fjern tabulation fra tekst",
|
||||
about_notice: "Husk: syntax highlight funktionen bør kun bruge til små tekster",
|
||||
toggle: "Slå editor til / fra",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Skift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processing...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/en.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["en"]={
|
||||
new_document: "new empty document",
|
||||
search_button: "search and replace",
|
||||
search_command: "search next / open search area",
|
||||
search: "search",
|
||||
replace: "replace",
|
||||
replace_command: "replace / open search area",
|
||||
find_next: "find next",
|
||||
replace_all: "replace all",
|
||||
reg_exp: "regular expressions",
|
||||
match_case: "match case",
|
||||
not_found: "not found.",
|
||||
occurrence_replaced: "occurences replaced.",
|
||||
search_field_empty: "Search field empty",
|
||||
restart_search_at_begin: "End of area reached. Restart at begin.",
|
||||
move_popup: "move search popup",
|
||||
font_size: "--Font size--",
|
||||
go_to_line: "go to line",
|
||||
go_to_line_prompt: "go to line number:",
|
||||
undo: "undo",
|
||||
redo: "redo",
|
||||
change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
|
||||
highlight: "toggle syntax highlight on/off",
|
||||
reset_highlight: "reset highlight (if desyncronized from text)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "about",
|
||||
save: "save",
|
||||
load: "load",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "close popup",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "add tabulation to text",
|
||||
remove_tab: "remove tabulation to text",
|
||||
about_notice: "Notice: syntax highlight function is only for small text",
|
||||
toggle: "Toggle editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processing...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/eo.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["eo"]={
|
||||
new_document: "nova dokumento (vakigas la enhavon)",
|
||||
search_button: "serĉi / anstataŭigi",
|
||||
search_command: "pluserĉi / malfermi la serĉo-fenestron",
|
||||
search: "serĉi",
|
||||
replace: "anstataŭigi",
|
||||
replace_command: "anstataŭigi / malfermi la serĉo-fenestron",
|
||||
find_next: "serĉi",
|
||||
replace_all: "anstataŭigi ĉion",
|
||||
reg_exp: "regula esprimo",
|
||||
match_case: "respekti la usklecon",
|
||||
not_found: "ne trovita.",
|
||||
occurrence_replaced: "anstataŭigoj plenumitaj.",
|
||||
search_field_empty: "La kampo estas malplena.",
|
||||
restart_search_at_begin: "Fino de teksto ĝisrirata, ĉu daŭrigi el la komenco?",
|
||||
move_popup: "movi la serĉo-fenestron",
|
||||
font_size: "--Tipara grando--",
|
||||
go_to_line: "iri al la linio",
|
||||
go_to_line_prompt: "iri al la linio numero:",
|
||||
undo: "rezigni",
|
||||
redo: "refari",
|
||||
change_smooth_selection: "ebligi/malebligi la funkcioj de vidigo (pli bona vidigo, sed pli da ŝarĝo de la ĉeforgano)",
|
||||
highlight: "ebligi/malebligi la sintaksan kolorigon",
|
||||
reset_highlight: "repravalorizi la sintaksan kolorigon (se malsinkronigon de la teksto)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "pri",
|
||||
save: "registri",
|
||||
load: "ŝarĝi",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Sg",
|
||||
position: "Pozicio",
|
||||
total: "Sumo",
|
||||
close_popup: "fermi la ŝprucfenestron",
|
||||
shortcuts: "Fulmoklavo",
|
||||
add_tab: "aldoni tabon en la tekston",
|
||||
remove_tab: "forigi tablon el la teksto",
|
||||
about_notice: "Noto: la sintaksa kolorigo estas nur prikalkulita por mallongaj tekstoj.",
|
||||
toggle: "baskuligi la redaktilon",
|
||||
accesskey: "Fulmoklavo",
|
||||
tab: "Tab",
|
||||
shift: "Maj",
|
||||
ctrl: "Ktrl",
|
||||
esc: "Esk",
|
||||
processing: "ŝargante...",
|
||||
fullscreen: "plenekrane",
|
||||
syntax_selection: "--Sintakso--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Pitono",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Fermi la dosieron"
|
||||
};
|
||||
64
include/limesurvey/admin/scripts/edit_area/langs/es.js
Normal file
@@ -0,0 +1,64 @@
|
||||
editAreaLoader.lang["es"]={
|
||||
new_document: "nuevo documento vacío",
|
||||
search_button: "buscar y reemplazar",
|
||||
search_command: "buscar siguiente / abrir área de búsqueda",
|
||||
search: "buscar",
|
||||
replace: "reemplazar",
|
||||
replace_command: "reemplazar / abrir área de búsqueda",
|
||||
find_next: "encontrar siguiente",
|
||||
replace_all: "reemplazar todos",
|
||||
reg_exp: "expresiones regulares",
|
||||
match_case: "coincidir capitalización",
|
||||
not_found: "no encontrado.",
|
||||
occurrence_replaced: "ocurrencias reemplazadas.",
|
||||
search_field_empty: "Campo de búsqueda vacío",
|
||||
restart_search_at_begin: "Se ha llegado al final del área. Se va a seguir desde el principio.",
|
||||
move_popup: "mover la ventana de búsqueda",
|
||||
font_size: "--Tamaño de la fuente--",
|
||||
go_to_line: "ir a la línea",
|
||||
go_to_line_prompt: "ir a la línea número:",
|
||||
undo: "deshacer",
|
||||
redo: "rehacer",
|
||||
change_smooth_selection: "activar/desactivar algunas características de visualización (visualización más inteligente pero más carga de CPU)",
|
||||
highlight: "intercambiar resaltado de sintaxis",
|
||||
reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "acerca",
|
||||
save: "guardar",
|
||||
load: "cargar",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Posición",
|
||||
total: "Total",
|
||||
close_popup: "recuadro de cierre",
|
||||
shortcuts: "Atajos",
|
||||
add_tab: "añadir tabulado al texto",
|
||||
remove_tab: "borrar tabulado del texto",
|
||||
about_notice: "Aviso: el resaltado de sintaxis sólo funciona para texto pequeño",
|
||||
toggle: "Cambiar editor",
|
||||
accesskey: "Tecla de acceso",
|
||||
tab: "Tab",
|
||||
shift: "Mayúsc",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Procesando...",
|
||||
fullscreen: "pantalla completa",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/fi.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["fi"]={
|
||||
new_document: "uusi tyhjä dokumentti",
|
||||
search_button: "etsi ja korvaa",
|
||||
search_command: "etsi seuraava / avaa etsintävalikko",
|
||||
search: "etsi",
|
||||
replace: "korvaa",
|
||||
replace_command: "korvaa / avaa etsintävalikko",
|
||||
find_next: "etsi seuraava",
|
||||
replace_all: "korvaa kaikki",
|
||||
reg_exp: "säännölliset lausekkeet",
|
||||
match_case: "täsmää kirjainkokoon",
|
||||
not_found: "ei löytynyt.",
|
||||
occurrence_replaced: "esiintymää korvattu.",
|
||||
search_field_empty: "Haettava merkkijono on tyhjä",
|
||||
restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
|
||||
move_popup: "siirrä etsintävalikkoa",
|
||||
font_size: "--Fontin koko--",
|
||||
go_to_line: "siirry riville",
|
||||
go_to_line_prompt: "mene riville:",
|
||||
undo: "peruuta",
|
||||
redo: "tee uudelleen",
|
||||
change_smooth_selection: "kytke/sammuta joitakin näyttötoimintoja (Älykkäämpi toiminta, mutta suurempi CPU kuormitus)",
|
||||
highlight: "kytke syntaksikorostus päälle/pois",
|
||||
reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "tietoja",
|
||||
save: "tallenna",
|
||||
load: "lataa",
|
||||
line_abbr: "Rv",
|
||||
char_abbr: "Pos",
|
||||
position: "Paikka",
|
||||
total: "Yhteensä",
|
||||
close_popup: "sulje valikko",
|
||||
shortcuts: "Pikatoiminnot",
|
||||
add_tab: "lisää sisennys tekstiin",
|
||||
remove_tab: "poista sisennys tekstistä",
|
||||
about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
|
||||
toggle: "Kytke editori",
|
||||
accesskey: "Pikanäppäin",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Odota...",
|
||||
fullscreen: "koko ruutu",
|
||||
syntax_selection: "--Syntaksi--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Sulje tiedosto"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/fr.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["fr"]={
|
||||
new_document: "nouveau document (efface le contenu)",
|
||||
search_button: "rechercher / remplacer",
|
||||
search_command: "rechercher suivant / ouvrir la fenêtre de recherche",
|
||||
search: "rechercher",
|
||||
replace: "remplacer",
|
||||
replace_command: "remplacer / ouvrir la fenêtre de recherche",
|
||||
find_next: "rechercher",
|
||||
replace_all: "tout remplacer",
|
||||
reg_exp: "expr. régulière",
|
||||
match_case: "respecter la casse",
|
||||
not_found: "pas trouvé.",
|
||||
occurrence_replaced: "remplacements éffectués.",
|
||||
search_field_empty: "Le champ de recherche est vide.",
|
||||
restart_search_at_begin: "Fin du texte atteint, poursuite au début.",
|
||||
move_popup: "déplacer la fenêtre de recherche",
|
||||
font_size: "--Taille police--",
|
||||
go_to_line: "aller à la ligne",
|
||||
go_to_line_prompt: "aller a la ligne numero:",
|
||||
undo: "annuler",
|
||||
redo: "refaire",
|
||||
change_smooth_selection: "activer/désactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
|
||||
highlight: "activer/désactiver la coloration syntaxique",
|
||||
reset_highlight: "réinitialiser la coloration syntaxique (si désyncronisée du texte)",
|
||||
word_wrap: "activer/désactiver les retours à la ligne automatiques",
|
||||
help: "à propos",
|
||||
save: "sauvegarder",
|
||||
load: "charger",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "fermer le popup",
|
||||
shortcuts: "Racourcis clavier",
|
||||
add_tab: "ajouter une tabulation dans le texte",
|
||||
remove_tab: "retirer une tabulation dans le texte",
|
||||
about_notice: "Note: la coloration syntaxique n'est prévue que pour de courts textes.",
|
||||
toggle: "basculer l'éditeur",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Maj",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "chargement...",
|
||||
fullscreen: "plein écran",
|
||||
syntax_selection: "--Syntaxe--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Fermer le fichier"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/hr.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["hr"]={
|
||||
new_document: "Novi dokument",
|
||||
search_button: "Traži i izmijeni",
|
||||
search_command: "Traži dalje / Otvori prozor za traženje",
|
||||
search: "Traži",
|
||||
replace: "Izmijeni",
|
||||
replace_command: "Izmijeni / Otvori prozor za traženje",
|
||||
find_next: "Traži dalje",
|
||||
replace_all: "Izmjeni sve",
|
||||
reg_exp: "Regularni izrazi",
|
||||
match_case: "Bitna vel. slova",
|
||||
not_found: "nije naðeno.",
|
||||
occurrence_replaced: "izmjenjenih.",
|
||||
search_field_empty: "Prazno polje za traženje!",
|
||||
restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
|
||||
move_popup: "Pomakni prozor",
|
||||
font_size: "--Velièina teksta--",
|
||||
go_to_line: "Odi na redak",
|
||||
go_to_line_prompt: "Odi na redak:",
|
||||
undo: "Vrati natrag",
|
||||
redo: "Napravi ponovo",
|
||||
change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
|
||||
highlight: "Ukljuèi/iskljuèi bojanje sintakse",
|
||||
reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "O edit_area",
|
||||
save: "Spremi",
|
||||
load: "Uèitaj",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Zn",
|
||||
position: "Pozicija",
|
||||
total: "Ukupno",
|
||||
close_popup: "Zatvori prozor",
|
||||
shortcuts: "Kratice",
|
||||
add_tab: "Dodaj tabulaciju",
|
||||
remove_tab: "Makni tabulaciju",
|
||||
about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
|
||||
toggle: "Prebaci naèin ureðivanja",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Procesiram...",
|
||||
fullscreen: "Cijeli prozor",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/it.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["it"]={
|
||||
new_document: "nuovo documento vuoto",
|
||||
search_button: "cerca e sostituisci",
|
||||
search_command: "trova successivo / apri finestra di ricerca",
|
||||
search: "cerca",
|
||||
replace: "sostituisci",
|
||||
replace_command: "sostituisci / apri finestra di ricerca",
|
||||
find_next: "trova successivo",
|
||||
replace_all: "sostituisci tutti",
|
||||
reg_exp: "espressioni regolari",
|
||||
match_case: "confronta maiuscole/minuscole<br />",
|
||||
not_found: "non trovato.",
|
||||
occurrence_replaced: "occorrenze sostituite.",
|
||||
search_field_empty: "Campo ricerca vuoto",
|
||||
restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
|
||||
move_popup: "sposta popup di ricerca",
|
||||
font_size: "-- Dimensione --",
|
||||
go_to_line: "vai alla linea",
|
||||
go_to_line_prompt: "vai alla linea numero:",
|
||||
undo: "annulla",
|
||||
redo: "ripeti",
|
||||
change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
|
||||
highlight: "abilita/disabilita colorazione della sintassi",
|
||||
reset_highlight: "aggiorna colorazione (se non sincronizzata)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "informazioni su...",
|
||||
save: "salva",
|
||||
load: "carica",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Posizione",
|
||||
total: "Totale",
|
||||
close_popup: "chiudi popup",
|
||||
shortcuts: "Scorciatoie",
|
||||
add_tab: "aggiungi tabulazione",
|
||||
remove_tab: "rimuovi tabulazione",
|
||||
about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
|
||||
toggle: "Abilita/disabilita editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "In corso...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/ja.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["ja"]={
|
||||
new_document: "新規作成",
|
||||
search_button: "検索・置換",
|
||||
search_command: "次を検索 / 検索窓を表示",
|
||||
search: "検索",
|
||||
replace: "置換",
|
||||
replace_command: "置換 / 置換窓を表示",
|
||||
find_next: "次を検索",
|
||||
replace_all: "全置換",
|
||||
reg_exp: "正規表現",
|
||||
match_case: "大文字小文字の区別",
|
||||
not_found: "見つかりません。",
|
||||
occurrence_replaced: "置換しました。",
|
||||
search_field_empty: "検索対象文字列が空です。",
|
||||
restart_search_at_begin: "終端に達しました、始めに戻ります",
|
||||
move_popup: "検索窓を移動",
|
||||
font_size: "--フォントサイズ--",
|
||||
go_to_line: "指定行へ移動",
|
||||
go_to_line_prompt: "指定行へ移動します:",
|
||||
undo: "元に戻す",
|
||||
redo: "やり直し",
|
||||
change_smooth_selection: "スムース表示の切り替え(CPUを使います)",
|
||||
highlight: "構文強調表示の切り替え",
|
||||
reset_highlight: "構文強調表示のリセット",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "ヘルプを表示",
|
||||
save: "保存",
|
||||
load: "読み込み",
|
||||
line_abbr: "行",
|
||||
char_abbr: "文字",
|
||||
position: "位置",
|
||||
total: "合計",
|
||||
close_popup: "ポップアップを閉じる",
|
||||
shortcuts: "ショートカット",
|
||||
add_tab: "タブを挿入する",
|
||||
remove_tab: "タブを削除する",
|
||||
about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
|
||||
toggle: "テキストエリアとeditAreaの切り替え",
|
||||
accesskey: "アクセスキー",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "処理中です...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/mk.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["mk"]={
|
||||
new_document: "Нов документ",
|
||||
search_button: "Најди и замени",
|
||||
search_command: "Барај следно / Отвори нов прозорец за пребарување",
|
||||
search: "Барај",
|
||||
replace: "Замени",
|
||||
replace_command: "Замени / Отвори прозорец за пребарување",
|
||||
find_next: "најди следно",
|
||||
replace_all: "Замени ги сите",
|
||||
reg_exp: "Регуларни изрази",
|
||||
match_case: "Битна е големината на буквите",
|
||||
not_found: "не е пронајдено.",
|
||||
occurrence_replaced: "замени.",
|
||||
search_field_empty: "Полето за пребарување е празно",
|
||||
restart_search_at_begin: "Крај на областа. Стартувај од почеток.",
|
||||
move_popup: "Помести го прозорецот",
|
||||
font_size: "--Големина на текстот--",
|
||||
go_to_line: "Оди на линија",
|
||||
go_to_line_prompt: "Оди на линија со број:",
|
||||
undo: "Врати",
|
||||
redo: "Повтори",
|
||||
change_smooth_selection: "Вклучи/исклучи некои карактеристики за приказ (попаметен приказ, но поголемо оптеретување за процесорот)",
|
||||
highlight: "Вклучи/исклучи осветлување на синтакса",
|
||||
reset_highlight: "Ресетирај го осветлувањето на синтакса (доколку е десинхронизиранo со текстот)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "За",
|
||||
save: "Зачувај",
|
||||
load: "Вчитај",
|
||||
line_abbr: "Лн",
|
||||
char_abbr: "Зн",
|
||||
position: "Позиција",
|
||||
total: "Вкупно",
|
||||
close_popup: "Затвори го прозорецот",
|
||||
shortcuts: "Кратенки",
|
||||
add_tab: "Додај табулација на текстот",
|
||||
remove_tab: "Отстрани ја табулацијата",
|
||||
about_notice: "Напомена: Осветлувањето на синтанса е само за краток текст",
|
||||
toggle: "Смени начин на уредување",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Обработувам...",
|
||||
fullscreen: "Цел прозорец",
|
||||
syntax_selection: "--Синтакса--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Избери датотека"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/nl.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["nl"]={
|
||||
new_document: "nieuw leeg document",
|
||||
search_button: "zoek en vervang",
|
||||
search_command: "zoek volgende / zoekscherm openen",
|
||||
search: "zoek",
|
||||
replace: "vervang",
|
||||
replace_command: "vervang / zoekscherm openen",
|
||||
find_next: "volgende vinden",
|
||||
replace_all: "alles vervangen",
|
||||
reg_exp: "reguliere expressies",
|
||||
match_case: "hoofdletter gevoelig",
|
||||
not_found: "niet gevonden.",
|
||||
occurrence_replaced: "object vervangen.",
|
||||
search_field_empty: "Zoek veld leeg",
|
||||
restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
|
||||
move_popup: "versleep zoek scherm",
|
||||
font_size: "--Letter grootte--",
|
||||
go_to_line: "Ga naar regel",
|
||||
go_to_line_prompt: "Ga naar regel nummer:",
|
||||
undo: "Ongedaan maken",
|
||||
redo: "Opnieuw doen",
|
||||
change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
|
||||
highlight: "zet syntax highlight aan/uit",
|
||||
reset_highlight: "reset highlight (indien gedesynchronizeerd)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "informatie",
|
||||
save: "opslaan",
|
||||
load: "laden",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Positie",
|
||||
total: "Totaal",
|
||||
close_popup: "Popup sluiten",
|
||||
shortcuts: "Snelkoppelingen",
|
||||
add_tab: "voeg tabs toe in tekst",
|
||||
remove_tab: "verwijder tabs uit tekst",
|
||||
about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
|
||||
toggle: "geavanceerde bewerkingsopties",
|
||||
accesskey: "Accessknop",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Verwerken...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/pl.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["pl"]={
|
||||
new_document: "nowy dokument",
|
||||
search_button: "znajdź i zamień",
|
||||
search_command: "znajdź następny",
|
||||
search: "znajdź",
|
||||
replace: "zamień",
|
||||
replace_command: "zamień",
|
||||
find_next: "następny",
|
||||
replace_all: "zamień wszystko",
|
||||
reg_exp: "wyrażenie regularne",
|
||||
match_case: "uwzględnij wielkość liter<br />",
|
||||
not_found: "nie znaleziono.",
|
||||
occurrence_replaced: "wystąpień zamieniono.",
|
||||
search_field_empty: "Nie wprowadzono tekstu",
|
||||
restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
|
||||
move_popup: "przesuń okienko wyszukiwania",
|
||||
font_size: "Rozmiar",
|
||||
go_to_line: "idź do linii",
|
||||
go_to_line_prompt: "numer linii:",
|
||||
undo: "cofnij",
|
||||
redo: "przywróć",
|
||||
change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
|
||||
highlight: "włącz/wyłącz podświetlanie składni",
|
||||
reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "o programie",
|
||||
save: "zapisz",
|
||||
load: "otwórz",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Zn",
|
||||
position: "Pozycja",
|
||||
total: "W sumie",
|
||||
close_popup: "zamknij okienko",
|
||||
shortcuts: "Skróty klawiaturowe",
|
||||
add_tab: "dodaj wcięcie do zaznaczonego tekstu",
|
||||
remove_tab: "usuń wcięcie",
|
||||
about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
|
||||
toggle: "Włącz/wyłącz edytor",
|
||||
accesskey: "Alt+",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Przetwarzanie...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/pt.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["pt"]={
|
||||
new_document: "Novo documento",
|
||||
search_button: "Localizar e substituir",
|
||||
search_command: "Localizar próximo",
|
||||
search: "Localizar",
|
||||
replace: "Substituir",
|
||||
replace_command: "Substituir",
|
||||
find_next: "Localizar",
|
||||
replace_all: "Subst. tudo",
|
||||
reg_exp: "Expressões regulares",
|
||||
match_case: "Diferenciar maiúsculas e minúsculas",
|
||||
not_found: "Não encontrado.",
|
||||
occurrence_replaced: "Ocorrências substituidas",
|
||||
search_field_empty: "Campo localizar vazio.",
|
||||
restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
|
||||
move_popup: "Mover janela",
|
||||
font_size: "--Tamanho da fonte--",
|
||||
go_to_line: "Ir para linha",
|
||||
go_to_line_prompt: "Ir para a linha:",
|
||||
undo: "Desfazer",
|
||||
redo: "Refazer",
|
||||
change_smooth_selection: "Opções visuais",
|
||||
highlight: "Cores de sintaxe",
|
||||
reset_highlight: "Resetar cores (se não sincronizado)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "Sobre",
|
||||
save: "Salvar",
|
||||
load: "Carregar",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Posição",
|
||||
total: "Total",
|
||||
close_popup: "Fechar",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "Adicionar tabulação",
|
||||
remove_tab: "Remover tabulação",
|
||||
about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
|
||||
toggle: "Exibir editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processando...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/ru.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["ru"]={
|
||||
new_document: "новый пустой документ",
|
||||
search_button: "поиск и замена",
|
||||
search_command: "искать следующий / открыть панель поиска",
|
||||
search: "поиск",
|
||||
replace: "замена",
|
||||
replace_command: "заменить / открыть панель поиска",
|
||||
find_next: "найти следующее",
|
||||
replace_all: "заменить все",
|
||||
reg_exp: "регулярное выражение",
|
||||
match_case: "учитывать регистр",
|
||||
not_found: "не найдено.",
|
||||
occurrence_replaced: "вхождение заменено.",
|
||||
search_field_empty: "Поле поиска пустое",
|
||||
restart_search_at_begin: "Достигнут конец документа. Начинаю с начала.",
|
||||
move_popup: "переместить окно поиска",
|
||||
font_size: "--Размер шрифта--",
|
||||
go_to_line: "перейти к строке",
|
||||
go_to_line_prompt: "перейти к строке номер:",
|
||||
undo: "отменить",
|
||||
redo: "вернуть",
|
||||
change_smooth_selection: "включить/отключить некоторые функции просмотра (более красиво, но больше использует процессор)",
|
||||
highlight: "переключить подсветку синтаксиса включена/выключена",
|
||||
reset_highlight: "восстановить подсветку (если разсинхронизирована от текста)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "о программе",
|
||||
save: "сохранить",
|
||||
load: "загрузить",
|
||||
line_abbr: "Стр",
|
||||
char_abbr: "Стлб",
|
||||
position: "Позиция",
|
||||
total: "Всего",
|
||||
close_popup: "закрыть всплывающее окно",
|
||||
shortcuts: "Горячие клавиши",
|
||||
add_tab: "добавить табуляцию в текст",
|
||||
remove_tab: "убрать табуляцию из текста",
|
||||
about_notice: "Внимание: функция подсветки синтаксиса только для небольших текстов",
|
||||
toggle: "Переключить редактор",
|
||||
accesskey: "Горячая клавиша",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Обработка...",
|
||||
fullscreen: "полный экран",
|
||||
syntax_selection: "--Синтакс--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Закрыть файл"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/sk.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["sk"]={
|
||||
new_document: "nový prázdy dokument",
|
||||
search_button: "vyhľadaj a nahraď",
|
||||
search_command: "hľadaj ďalsšie / otvor vyhľadávacie pole",
|
||||
search: "hľadaj",
|
||||
replace: "nahraď",
|
||||
replace_command: "nahraď / otvor vyhľadávacie pole",
|
||||
find_next: "nájdi ďalšie",
|
||||
replace_all: "nahraď všetko",
|
||||
reg_exp: "platné výrazy",
|
||||
match_case: "zhodujúce sa výrazy",
|
||||
not_found: "nenájdené.",
|
||||
occurrence_replaced: "výskyty nahradené.",
|
||||
search_field_empty: "Pole vyhľadávanie je prádzne",
|
||||
restart_search_at_begin: "End of area reached. Restart at begin.",
|
||||
move_popup: "presuň vyhľadávacie okno",
|
||||
font_size: "--Veľkosť textu--",
|
||||
go_to_line: "prejdi na riadok",
|
||||
go_to_line_prompt: "prejdi na riadok:",
|
||||
undo: "krok späť",
|
||||
redo: "prepracovať",
|
||||
change_smooth_selection: "povoliť/zamietnúť niektoré zo zobrazených funkcií (účelnejšie zobrazenie vyžaduje väčšie zaťaženie procesora CPU)",
|
||||
highlight: "prepnúť zvýrazňovanie syntaxe zap/vyp",
|
||||
reset_highlight: "zrušiť zvýrazňovanie (ak je nesynchronizované s textom)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "o programe",
|
||||
save: "uložiť",
|
||||
load: "načítať",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Pozícia",
|
||||
total: "Spolu",
|
||||
close_popup: "zavrieť okno",
|
||||
shortcuts: "Skratky",
|
||||
add_tab: "pridať tabulovanie textu",
|
||||
remove_tab: "odstrániť tabulovanie textu",
|
||||
about_notice: "Upozornenie: funkcia zvýrazňovania syntaxe je dostupná iba pre malý text",
|
||||
toggle: "Prepnúť editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Záložka",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Spracúvam...",
|
||||
fullscreen: "cel=a obrazovka",
|
||||
syntax_selection: "--Vyber Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
67
include/limesurvey/admin/scripts/edit_area/langs/zh.js
Normal file
@@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["zh"]={
|
||||
new_document: "新建空白文档",
|
||||
search_button: "查找与替换",
|
||||
search_command: "查找下一个 / 打开查找框",
|
||||
search: "查找",
|
||||
replace: "替换",
|
||||
replace_command: "替换 / 打开查找框",
|
||||
find_next: "查找下一个",
|
||||
replace_all: "全部替换",
|
||||
reg_exp: "正则表达式",
|
||||
match_case: "匹配大小写",
|
||||
not_found: "未找到.",
|
||||
occurrence_replaced: "处被替换.",
|
||||
search_field_empty: "查找框没有内容",
|
||||
restart_search_at_begin: "已到到文档末尾. 从头重新查找.",
|
||||
move_popup: "移动查找对话框",
|
||||
font_size: "--字体大小--",
|
||||
go_to_line: "转到行",
|
||||
go_to_line_prompt: "转到行:",
|
||||
undo: "恢复",
|
||||
redo: "重做",
|
||||
change_smooth_selection: "启用/禁止一些显示特性(更好看但更耗费资源)",
|
||||
highlight: "启用/禁止语法高亮",
|
||||
reset_highlight: "重置语法高亮(当文本显示不同步时)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "关于",
|
||||
save: "保存",
|
||||
load: "加载",
|
||||
line_abbr: "行",
|
||||
char_abbr: "字符",
|
||||
position: "位置",
|
||||
total: "总计",
|
||||
close_popup: "关闭对话框",
|
||||
shortcuts: "快捷键",
|
||||
add_tab: "添加制表符(Tab)",
|
||||
remove_tab: "移除制表符(Tab)",
|
||||
about_notice: "注意:语法高亮功能仅用于较少内容的文本(文件内容太大会导致浏览器反应慢)",
|
||||
toggle: "切换编辑器",
|
||||
accesskey: "快捷键",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "正在处理中...",
|
||||
fullscreen: "全屏编辑",
|
||||
syntax_selection: "--语法--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "关闭文件"
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
Copyright 2008 Christophe Dolivet
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
10
include/limesurvey/admin/scripts/edit_area/license_bsd.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Copyright (c) 2008, Christophe Dolivet
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
458
include/limesurvey/admin/scripts/edit_area/license_lgpl.txt
Normal file
@@ -0,0 +1,458 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
623
include/limesurvey/admin/scripts/edit_area/manage_area.js
Normal file
@@ -0,0 +1,623 @@
|
||||
EditArea.prototype.focus = function() {
|
||||
this.textarea.focus();
|
||||
this.textareaFocused=true;
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.check_line_selection= function(timer_checkup){
|
||||
var changes, infos, new_top, new_width,i;
|
||||
|
||||
var t1=t2=t2_1=t3=tLines=tend= new Date().getTime();
|
||||
// l'editeur n'existe plus => on quitte
|
||||
if(!editAreas[this.id])
|
||||
return false;
|
||||
|
||||
if(!this.smooth_selection && !this.do_highlight)
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
else if(this.textareaFocused && editAreas[this.id]["displayed"]==true && this.isResizing==false)
|
||||
{
|
||||
infos = this.get_selection_infos();
|
||||
changes = this.checkTextEvolution( typeof( this.last_selection['full_text'] ) == 'undefined' ? '' : this.last_selection['full_text'], infos['full_text'] );
|
||||
|
||||
t2= new Date().getTime();
|
||||
|
||||
// if selection change
|
||||
if(this.last_selection["line_start"] != infos["line_start"] || this.last_selection["line_nb"] != infos["line_nb"] || infos["full_text"] != this.last_selection["full_text"] || this.reload_highlight || this.last_selection["selectionStart"] != infos["selectionStart"] || this.last_selection["selectionEnd"] != infos["selectionEnd"] || !timer_checkup )
|
||||
{
|
||||
// move and adjust text selection elements
|
||||
new_top = this.getLinePosTop( infos["line_start"] );
|
||||
new_width = Math.max(this.textarea.scrollWidth, this.container.clientWidth -50);
|
||||
this.selection_field.style.top=this.selection_field_text.style.top=new_top+"px";
|
||||
if(!this.settings['word_wrap']){
|
||||
this.selection_field.style.width=this.selection_field_text.style.width=this.test_font_size.style.width=new_width+"px";
|
||||
}
|
||||
|
||||
// usefull? => _$("cursor_pos").style.top=new_top+"px";
|
||||
|
||||
if(this.do_highlight==true)
|
||||
{
|
||||
// fill selection elements
|
||||
var curr_text = infos["full_text"].split("\n");
|
||||
var content = "";
|
||||
//alert("length: "+curr_text.length+ " i: "+ Math.max(0,infos["line_start"]-1)+ " end: "+Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1)+ " line: "+infos["line_start"]+" [0]: "+curr_text[0]+" [1]: "+curr_text[1]);
|
||||
var start = Math.max(0,infos["line_start"]-1);
|
||||
var end = Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1);
|
||||
|
||||
//curr_text[start]= curr_text[start].substr(0,infos["curr_pos"]-1) +"¤_overline_¤"+ curr_text[start].substr(infos["curr_pos"]-1);
|
||||
for(i=start; i< end; i++){
|
||||
content+= curr_text[i]+"\n";
|
||||
}
|
||||
|
||||
// add special chars arround selected characters
|
||||
selLength = infos['selectionEnd'] - infos['selectionStart'];
|
||||
content = content.substr( 0, infos["curr_pos"] - 1 ) + "\r\r" + content.substr( infos["curr_pos"] - 1, selLength ) + "\r\r" + content.substr( infos["curr_pos"] - 1 + selLength );
|
||||
content = '<span>'+ content.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace("\r\r", '</span><strong>').replace("\r\r", '</strong><span>') +'</span>';
|
||||
|
||||
if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
this.selection_field.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
this.selection_field.innerHTML= content;
|
||||
}
|
||||
this.selection_field_text.innerHTML = this.selection_field.innerHTML;
|
||||
t2_1 = new Date().getTime();
|
||||
// check if we need to update the highlighted background
|
||||
if(this.reload_highlight || (infos["full_text"] != this.last_text_to_highlight && (this.last_selection["line_start"]!=infos["line_start"] || this.show_line_colors || this.settings['word_wrap'] || this.last_selection["line_nb"]!=infos["line_nb"] || this.last_selection["nb_line"]!=infos["nb_line"]) ) )
|
||||
{
|
||||
this.maj_highlight(infos);
|
||||
}
|
||||
}
|
||||
}
|
||||
t3= new Date().getTime();
|
||||
|
||||
// manage line heights
|
||||
if( this.settings['word_wrap'] && infos["full_text"] != this.last_selection["full_text"])
|
||||
{
|
||||
// refresh only 1 line if text change concern only one line and that the total line number has not changed
|
||||
if( changes.newText.split("\n").length == 1 && this.last_selection['nb_line'] && infos['nb_line'] == this.last_selection['nb_line'] )
|
||||
{
|
||||
this.fixLinesHeight( infos['full_text'], changes.lineStart, changes.lineStart );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fixLinesHeight( infos['full_text'], changes.lineStart, -1 );
|
||||
}
|
||||
}
|
||||
|
||||
tLines= new Date().getTime();
|
||||
// manage bracket finding
|
||||
if( infos["line_start"] != this.last_selection["line_start"] || infos["curr_pos"] != this.last_selection["curr_pos"] || infos["full_text"].length!=this.last_selection["full_text"].length || this.reload_highlight || !timer_checkup )
|
||||
{
|
||||
// move _cursor_pos
|
||||
var selec_char= infos["curr_line"].charAt(infos["curr_pos"]-1);
|
||||
var no_real_move=true;
|
||||
if(infos["line_nb"]==1 && (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]) ){
|
||||
|
||||
no_real_move=false;
|
||||
//findEndBracket(infos["line_start"], infos["curr_pos"], selec_char);
|
||||
if(this.findEndBracket(infos, selec_char) === true){
|
||||
_$("end_bracket").style.visibility ="visible";
|
||||
_$("cursor_pos").style.visibility ="visible";
|
||||
_$("cursor_pos").innerHTML = selec_char;
|
||||
_$("end_bracket").innerHTML = (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]);
|
||||
}else{
|
||||
_$("end_bracket").style.visibility ="hidden";
|
||||
_$("cursor_pos").style.visibility ="hidden";
|
||||
}
|
||||
}else{
|
||||
_$("cursor_pos").style.visibility ="hidden";
|
||||
_$("end_bracket").style.visibility ="hidden";
|
||||
}
|
||||
//alert("move cursor");
|
||||
this.displayToCursorPosition("cursor_pos", infos["line_start"], infos["curr_pos"]-1, infos["curr_line"], no_real_move);
|
||||
if(infos["line_nb"]==1 && infos["line_start"]!=this.last_selection["line_start"])
|
||||
this.scroll_to_view();
|
||||
}
|
||||
this.last_selection=infos;
|
||||
}
|
||||
|
||||
tend= new Date().getTime();
|
||||
//if( (tend-t1) > 7 )
|
||||
// console.log( "tps total: "+ (tend-t1) + " tps get_infos: "+ (t2-t1)+ " tps selec: "+ (t2_1-t2)+ " tps highlight: "+ (t3-t2_1) +" tps lines: "+ (tLines-t3) +" tps cursor+lines: "+ (tend-tLines)+" \n" );
|
||||
|
||||
|
||||
if(timer_checkup){
|
||||
setTimeout("editArea.check_line_selection(true)", this.check_line_selection_timer);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.get_selection_infos= function(){
|
||||
var sel={}, start, end, len, str;
|
||||
|
||||
this.getIESelection();
|
||||
start = this.textarea.selectionStart;
|
||||
end = this.textarea.selectionEnd;
|
||||
|
||||
if( this.last_selection["selectionStart"] == start && this.last_selection["selectionEnd"] == end && this.last_selection["full_text"] == this.textarea.value )
|
||||
{
|
||||
return this.last_selection;
|
||||
}
|
||||
|
||||
if(this.tabulation!="\t" && this.textarea.value.indexOf("\t")!=-1)
|
||||
{ // can append only after copy/paste
|
||||
len = this.textarea.value.length;
|
||||
this.textarea.value = this.replace_tab(this.textarea.value);
|
||||
start = end = start+(this.textarea.value.length-len);
|
||||
this.area_select( start, 0 );
|
||||
}
|
||||
|
||||
sel["selectionStart"] = start;
|
||||
sel["selectionEnd"] = end;
|
||||
sel["full_text"] = this.textarea.value;
|
||||
sel["line_start"] = 1;
|
||||
sel["line_nb"] = 1;
|
||||
sel["curr_pos"] = 0;
|
||||
sel["curr_line"] = "";
|
||||
sel["indexOfCursor"] = 0;
|
||||
sel["selec_direction"] = this.last_selection["selec_direction"];
|
||||
|
||||
//return sel;
|
||||
var splitTab= sel["full_text"].split("\n");
|
||||
var nbLine = Math.max(0, splitTab.length);
|
||||
var nbChar = Math.max(0, sel["full_text"].length - (nbLine - 1)); // (remove \n caracters from the count)
|
||||
if( sel["full_text"].indexOf("\r") != -1 )
|
||||
nbChar = nbChar - ( nbLine - 1 ); // (remove \r caracters from the count)
|
||||
sel["nb_line"] = nbLine;
|
||||
sel["nb_char"] = nbChar;
|
||||
|
||||
if(start>0){
|
||||
str = sel["full_text"].substr(0,start);
|
||||
sel["curr_pos"] = start - str.lastIndexOf("\n");
|
||||
sel["line_start"] = Math.max(1, str.split("\n").length);
|
||||
}else{
|
||||
sel["curr_pos"]=1;
|
||||
}
|
||||
if(end>start){
|
||||
sel["line_nb"]=sel["full_text"].substring(start,end).split("\n").length;
|
||||
}
|
||||
sel["indexOfCursor"]=start;
|
||||
sel["curr_line"]=splitTab[Math.max(0,sel["line_start"]-1)];
|
||||
|
||||
// determine in which direction the selection grow
|
||||
if(sel["selectionStart"] == this.last_selection["selectionStart"]){
|
||||
if(sel["selectionEnd"]>this.last_selection["selectionEnd"])
|
||||
sel["selec_direction"]= "down";
|
||||
else if(sel["selectionEnd"] == this.last_selection["selectionStart"])
|
||||
sel["selec_direction"]= this.last_selection["selec_direction"];
|
||||
}else if(sel["selectionStart"] == this.last_selection["selectionEnd"] && sel["selectionEnd"]>this.last_selection["selectionEnd"]){
|
||||
sel["selec_direction"]= "down";
|
||||
}else{
|
||||
sel["selec_direction"]= "up";
|
||||
}
|
||||
|
||||
_$("nbLine").innerHTML = nbLine;
|
||||
_$("nbChar").innerHTML = nbChar;
|
||||
_$("linePos").innerHTML = sel["line_start"];
|
||||
_$("currPos").innerHTML = sel["curr_pos"];
|
||||
|
||||
return sel;
|
||||
};
|
||||
|
||||
// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd)
|
||||
EditArea.prototype.getIESelection= function(){
|
||||
var selectionStart, selectionEnd, range, stored_range;
|
||||
|
||||
if( !this.isIE )
|
||||
return false;
|
||||
|
||||
// make it work as nowrap mode (easier for range manipulation with lineHeight)
|
||||
if( this.settings['word_wrap'] )
|
||||
this.textarea.wrap='off';
|
||||
|
||||
try{
|
||||
range = document.selection.createRange();
|
||||
stored_range = range.duplicate();
|
||||
stored_range.moveToElementText( this.textarea );
|
||||
stored_range.setEndPoint( 'EndToEnd', range );
|
||||
if( stored_range.parentElement() != this.textarea )
|
||||
throw "invalid focus";
|
||||
|
||||
// the range don't take care of empty lines in the end of the selection
|
||||
var scrollTop = this.result.scrollTop + document.body.scrollTop;
|
||||
var relative_top= range.offsetTop - parent.calculeOffsetTop(this.textarea) + scrollTop;
|
||||
var line_start = Math.round((relative_top / this.lineHeight) +1);
|
||||
var line_nb = Math.round( range.boundingHeight / this.lineHeight );
|
||||
|
||||
selectionStart = stored_range.text.length - range.text.length;
|
||||
selectionStart += ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length)*2; // count missing empty \r to the selection
|
||||
selectionStart -= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length ) * 2;
|
||||
|
||||
selectionEnd = selectionStart + range.text.length;
|
||||
selectionEnd += (line_start + line_nb - 1 - this.textarea.value.substr(0, selectionEnd ).split("\n").length)*2;
|
||||
|
||||
this.textarea.selectionStart = selectionStart;
|
||||
this.textarea.selectionEnd = selectionEnd;
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
// restore wrap mode
|
||||
if( this.settings['word_wrap'] )
|
||||
this.textarea.wrap='soft';
|
||||
};
|
||||
|
||||
// select the text for IE (and take care of \r caracters)
|
||||
EditArea.prototype.setIESelection= function(){
|
||||
var a = this.textarea, nbLineStart, nbLineEnd, range;
|
||||
|
||||
if( !this.isIE )
|
||||
return false;
|
||||
|
||||
nbLineStart = a.value.substr(0, a.selectionStart).split("\n").length - 1;
|
||||
nbLineEnd = a.value.substr(0, a.selectionEnd).split("\n").length - 1;
|
||||
range = document.selection.createRange();
|
||||
range.moveToElementText( a );
|
||||
range.setEndPoint( 'EndToStart', range );
|
||||
|
||||
range.moveStart('character', a.selectionStart - nbLineStart);
|
||||
range.moveEnd('character', a.selectionEnd - nbLineEnd - (a.selectionStart - nbLineStart) );
|
||||
range.select();
|
||||
};
|
||||
|
||||
|
||||
|
||||
EditArea.prototype.checkTextEvolution=function(lastText,newText){
|
||||
// ch will contain changes datas
|
||||
var ch={},baseStep=200, cpt=0, end, step,tStart=new Date().getTime();
|
||||
|
||||
end = Math.min(newText.length, lastText.length);
|
||||
step = baseStep;
|
||||
// find how many chars are similar at the begin of the text
|
||||
while( cpt<end && step>=1 ){
|
||||
if(lastText.substr(cpt, step) == newText.substr(cpt, step)){
|
||||
cpt+= step;
|
||||
}else{
|
||||
step= Math.floor(step/2);
|
||||
}
|
||||
}
|
||||
|
||||
ch.posStart = cpt;
|
||||
ch.lineStart= newText.substr(0, ch.posStart).split("\n").length -1;
|
||||
|
||||
cpt_last = lastText.length;
|
||||
cpt = newText.length;
|
||||
step = baseStep;
|
||||
// find how many chars are similar at the end of the text
|
||||
while( cpt>=0 && cpt_last>=0 && step>=1 ){
|
||||
if(lastText.substr(cpt_last-step, step) == newText.substr(cpt-step, step)){
|
||||
cpt-= step;
|
||||
cpt_last-= step;
|
||||
}else{
|
||||
step= Math.floor(step/2);
|
||||
}
|
||||
}
|
||||
|
||||
ch.posNewEnd = cpt;
|
||||
ch.posLastEnd = cpt_last;
|
||||
if(ch.posNewEnd<=ch.posStart){
|
||||
if(lastText.length < newText.length){
|
||||
ch.posNewEnd= ch.posStart + newText.length - lastText.length;
|
||||
ch.posLastEnd= ch.posStart;
|
||||
}else{
|
||||
ch.posLastEnd= ch.posStart + lastText.length - newText.length;
|
||||
ch.posNewEnd= ch.posStart;
|
||||
}
|
||||
}
|
||||
ch.newText = newText.substring(ch.posStart, ch.posNewEnd);
|
||||
ch.lastText = lastText.substring(ch.posStart, ch.posLastEnd);
|
||||
|
||||
ch.lineNewEnd = newText.substr(0, ch.posNewEnd).split("\n").length -1;
|
||||
ch.lineLastEnd = lastText.substr(0, ch.posLastEnd).split("\n").length -1;
|
||||
|
||||
ch.newTextLine = newText.split("\n").slice(ch.lineStart, ch.lineNewEnd+1).join("\n");
|
||||
ch.lastTextLine = lastText.split("\n").slice(ch.lineStart, ch.lineLastEnd+1).join("\n");
|
||||
//console.log( ch );
|
||||
return ch;
|
||||
};
|
||||
|
||||
EditArea.prototype.tab_selection= function(){
|
||||
if(this.is_tabbing)
|
||||
return;
|
||||
this.is_tabbing=true;
|
||||
//infos=getSelectionInfos();
|
||||
//if( document.selection ){
|
||||
this.getIESelection();
|
||||
/* Insertion du code de formatage */
|
||||
var start = this.textarea.selectionStart;
|
||||
var end = this.textarea.selectionEnd;
|
||||
var insText = this.textarea.value.substring(start, end);
|
||||
|
||||
/* Insert tabulation and ajust cursor position */
|
||||
var pos_start=start;
|
||||
var pos_end=end;
|
||||
if (insText.length == 0) {
|
||||
// if only one line selected
|
||||
this.textarea.value = this.textarea.value.substr(0, start) + this.tabulation + this.textarea.value.substr(end);
|
||||
pos_start = start + this.tabulation.length;
|
||||
pos_end=pos_start;
|
||||
} else {
|
||||
start= Math.max(0, this.textarea.value.substr(0, start).lastIndexOf("\n")+1);
|
||||
endText=this.textarea.value.substr(end);
|
||||
startText=this.textarea.value.substr(0, start);
|
||||
tmp= this.textarea.value.substring(start, end).split("\n");
|
||||
insText= this.tabulation+tmp.join("\n"+this.tabulation);
|
||||
this.textarea.value = startText + insText + endText;
|
||||
pos_start = start;
|
||||
pos_end= this.textarea.value.indexOf("\n", startText.length + insText.length);
|
||||
if(pos_end==-1)
|
||||
pos_end=this.textarea.value.length;
|
||||
//pos = start + repdeb.length + insText.length + ;
|
||||
}
|
||||
this.textarea.selectionStart = pos_start;
|
||||
this.textarea.selectionEnd = pos_end;
|
||||
|
||||
//if( document.selection ){
|
||||
if(this.isIE)
|
||||
{
|
||||
this.setIESelection();
|
||||
setTimeout("editArea.is_tabbing=false;", 100); // IE can't accept to make 2 tabulation without a little break between both
|
||||
}
|
||||
else
|
||||
{
|
||||
this.is_tabbing=false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.invert_tab_selection= function(){
|
||||
var t=this, a=this.textarea;
|
||||
if(t.is_tabbing)
|
||||
return;
|
||||
t.is_tabbing=true;
|
||||
//infos=getSelectionInfos();
|
||||
//if( document.selection ){
|
||||
t.getIESelection();
|
||||
|
||||
var start = a.selectionStart;
|
||||
var end = a.selectionEnd;
|
||||
var insText = a.value.substring(start, end);
|
||||
|
||||
/* Tab remove and cursor seleciton adjust */
|
||||
var pos_start=start;
|
||||
var pos_end=end;
|
||||
if (insText.length == 0) {
|
||||
if(a.value.substring(start-t.tabulation.length, start)==t.tabulation)
|
||||
{
|
||||
a.value = a.value.substr(0, start-t.tabulation.length) + a.value.substr(end);
|
||||
pos_start = Math.max(0, start-t.tabulation.length);
|
||||
pos_end = pos_start;
|
||||
}
|
||||
/*
|
||||
a.value = a.value.substr(0, start) + t.tabulation + insText + a.value.substr(end);
|
||||
pos_start = start + t.tabulation.length;
|
||||
pos_end=pos_start;*/
|
||||
} else {
|
||||
start = a.value.substr(0, start).lastIndexOf("\n")+1;
|
||||
endText = a.value.substr(end);
|
||||
startText = a.value.substr(0, start);
|
||||
tmp = a.value.substring(start, end).split("\n");
|
||||
insText = "";
|
||||
for(i=0; i<tmp.length; i++){
|
||||
for(j=0; j<t.tab_nb_char; j++){
|
||||
if(tmp[i].charAt(0)=="\t"){
|
||||
tmp[i]=tmp[i].substr(1);
|
||||
j=t.tab_nb_char;
|
||||
}else if(tmp[i].charAt(0)==" ")
|
||||
tmp[i]=tmp[i].substr(1);
|
||||
}
|
||||
insText+=tmp[i];
|
||||
if(i<tmp.length-1)
|
||||
insText+="\n";
|
||||
}
|
||||
//insText+="_";
|
||||
a.value = startText + insText + endText;
|
||||
pos_start = start;
|
||||
pos_end = a.value.indexOf("\n", startText.length + insText.length);
|
||||
if(pos_end==-1)
|
||||
pos_end=a.value.length;
|
||||
//pos = start + repdeb.length + insText.length + ;
|
||||
}
|
||||
a.selectionStart = pos_start;
|
||||
a.selectionEnd = pos_end;
|
||||
|
||||
//if( document.selection ){
|
||||
if(t.isIE){
|
||||
// select the text for IE
|
||||
t.setIESelection();
|
||||
setTimeout("editArea.is_tabbing=false;", 100); // IE can accept to make 2 tabulation without a little break between both
|
||||
}else
|
||||
t.is_tabbing=false;
|
||||
};
|
||||
|
||||
EditArea.prototype.press_enter= function(){
|
||||
if(!this.smooth_selection)
|
||||
return false;
|
||||
this.getIESelection();
|
||||
var scrollTop= this.result.scrollTop;
|
||||
var scrollLeft= this.result.scrollLeft;
|
||||
var start=this.textarea.selectionStart;
|
||||
var end= this.textarea.selectionEnd;
|
||||
var start_last_line= Math.max(0 , this.textarea.value.substring(0, start).lastIndexOf("\n") + 1 );
|
||||
var begin_line= this.textarea.value.substring(start_last_line, start).replace(/^([ \t]*).*/gm, "$1");
|
||||
var lineStart = this.textarea.value.substring(0, start).split("\n").length;
|
||||
if(begin_line=="\n" || begin_line=="\r" || begin_line.length==0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ){
|
||||
begin_line="\r\n"+ begin_line;
|
||||
}else{
|
||||
begin_line="\n"+ begin_line;
|
||||
}
|
||||
//alert(start_last_line+" strat: "+start +"\n"+this.textarea.value.substring(start_last_line, start)+"\n_"+begin_line+"_")
|
||||
this.textarea.value= this.textarea.value.substring(0, start) + begin_line + this.textarea.value.substring(end);
|
||||
|
||||
this.area_select(start+ begin_line.length ,0);
|
||||
// during this process IE scroll back to the top of the textarea
|
||||
if(this.isIE){
|
||||
this.result.scrollTop = scrollTop;
|
||||
this.result.scrollLeft = scrollLeft;
|
||||
}
|
||||
return true;
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.findEndBracket= function(infos, bracket){
|
||||
|
||||
var start=infos["indexOfCursor"];
|
||||
var normal_order=true;
|
||||
//curr_text=infos["full_text"].split("\n");
|
||||
if(this.assocBracket[bracket])
|
||||
endBracket=this.assocBracket[bracket];
|
||||
else if(this.revertAssocBracket[bracket]){
|
||||
endBracket=this.revertAssocBracket[bracket];
|
||||
normal_order=false;
|
||||
}
|
||||
var end=-1;
|
||||
var nbBracketOpen=0;
|
||||
|
||||
for(var i=start; i<infos["full_text"].length && i>=0; ){
|
||||
if(infos["full_text"].charAt(i)==endBracket){
|
||||
nbBracketOpen--;
|
||||
if(nbBracketOpen<=0){
|
||||
//i=infos["full_text"].length;
|
||||
end=i;
|
||||
break;
|
||||
}
|
||||
}else if(infos["full_text"].charAt(i)==bracket)
|
||||
nbBracketOpen++;
|
||||
if(normal_order)
|
||||
i++;
|
||||
else
|
||||
i--;
|
||||
}
|
||||
|
||||
//end=infos["full_text"].indexOf("}", start);
|
||||
if(end==-1)
|
||||
return false;
|
||||
var endLastLine=infos["full_text"].substr(0, end).lastIndexOf("\n");
|
||||
if(endLastLine==-1)
|
||||
line=1;
|
||||
else
|
||||
line= infos["full_text"].substr(0, endLastLine).split("\n").length + 1;
|
||||
|
||||
var curPos= end - endLastLine - 1;
|
||||
var endLineLength = infos["full_text"].substring(end).split("\n")[0].length;
|
||||
this.displayToCursorPosition("end_bracket", line, curPos, infos["full_text"].substring(endLastLine +1, end + endLineLength));
|
||||
return true;
|
||||
};
|
||||
|
||||
EditArea.prototype.displayToCursorPosition= function(id, start_line, cur_pos, lineContent, no_real_move){
|
||||
var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;
|
||||
|
||||
elem = this.test_font_size;
|
||||
dest = _$(id);
|
||||
content = "<span id='test_font_size_inner'>"+lineContent.substr(0, cur_pos).replace(/&/g,"&").replace(/</g,"<")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&").replace(/</g,"<")+"</span>";
|
||||
if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
elem.innerHTML= content;
|
||||
}
|
||||
|
||||
|
||||
endElem = _$('endTestFont');
|
||||
topOffset = endElem.offsetTop;
|
||||
fixPadding = parseInt( this.content_highlight.style.paddingLeft.replace("px", "") );
|
||||
posLeft = 45 + endElem.offsetLeft + ( !isNaN( fixPadding ) && topOffset > 0 ? fixPadding : 0 );
|
||||
posTop = this.getLinePosTop( start_line ) + topOffset;// + Math.floor( ( endElem.offsetHeight - 1 ) / this.lineHeight ) * this.lineHeight;
|
||||
|
||||
// detect the case where the span start on a line but has no display on it
|
||||
if( this.isIE && cur_pos > 0 && endElem.offsetLeft == 0 )
|
||||
{
|
||||
posTop += this.lineHeight;
|
||||
}
|
||||
if(no_real_move!=true){ // when the cursor is hidden no need to move him
|
||||
dest.style.top=posTop+"px";
|
||||
dest.style.left=posLeft+"px";
|
||||
}
|
||||
// usefull for smarter scroll
|
||||
dest.cursor_top=posTop;
|
||||
dest.cursor_left=posLeft;
|
||||
// _$(id).style.marginLeft=posLeft+"px";
|
||||
};
|
||||
|
||||
EditArea.prototype.getLinePosTop= function(start_line){
|
||||
var elem= _$('line_'+ start_line), posTop=0;
|
||||
if( elem )
|
||||
posTop = elem.offsetTop;
|
||||
else
|
||||
posTop = this.lineHeight * (start_line-1);
|
||||
return posTop;
|
||||
};
|
||||
|
||||
|
||||
// return the dislpayed height of a text (take word-wrap into account)
|
||||
EditArea.prototype.getTextHeight= function(text){
|
||||
var t=this,elem,height;
|
||||
elem = t.test_font_size;
|
||||
content = text.replace(/&/g,"&").replace(/</g,"<");
|
||||
if( t.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
elem.innerHTML= content;
|
||||
}
|
||||
height = elem.offsetHeight;
|
||||
height = Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight;
|
||||
return height;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fix line height for the given lines
|
||||
* @param Integer linestart
|
||||
* @param Integer lineEnd End line or -1 to cover all lines
|
||||
*/
|
||||
EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){
|
||||
var aText = textValue.split("\n");
|
||||
if( lineEnd == -1 )
|
||||
lineEnd = aText.length-1;
|
||||
for( var i = Math.max(0, lineStart); i <= lineEnd; i++ )
|
||||
{
|
||||
if( elem = _$('line_'+ ( i+1 ) ) )
|
||||
{
|
||||
elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.area_select= function(start, length){
|
||||
this.textarea.focus();
|
||||
|
||||
start = Math.max(0, Math.min(this.textarea.value.length, start));
|
||||
end = Math.max(start, Math.min(this.textarea.value.length, start+length));
|
||||
|
||||
if(this.isIE)
|
||||
{
|
||||
this.textarea.selectionStart = start;
|
||||
this.textarea.selectionEnd = end;
|
||||
this.setIESelection();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Opera bug when moving selection start and selection end
|
||||
if(this.isOpera && this.isOpera < 9.6 )
|
||||
{
|
||||
this.textarea.setSelectionRange(0, 0);
|
||||
}
|
||||
this.textarea.setSelectionRange(start, end);
|
||||
}
|
||||
this.check_line_selection();
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.area_get_selection= function(){
|
||||
var text="";
|
||||
if( document.selection ){
|
||||
var range = document.selection.createRange();
|
||||
text=range.text;
|
||||
}else{
|
||||
text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd);
|
||||
}
|
||||
return text;
|
||||
};
|
||||
166
include/limesurvey/admin/scripts/edit_area/reg_syntax.js
Normal file
@@ -0,0 +1,166 @@
|
||||
EditAreaLoader.prototype.get_regexp= function(text_array){
|
||||
//res="( |=|\\n|\\r|\\[|\\(|µ|)(";
|
||||
res="(\\b)(";
|
||||
for(i=0; i<text_array.length; i++){
|
||||
if(i>0)
|
||||
res+="|";
|
||||
//res+="("+ tab_text[i] +")";
|
||||
//res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
|
||||
res+=this.get_escaped_regexp(text_array[i]);
|
||||
}
|
||||
//res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
|
||||
res+=")(\\b)";
|
||||
reg= new RegExp(res);
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
EditAreaLoader.prototype.get_escaped_regexp= function(str){
|
||||
return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
|
||||
};
|
||||
|
||||
EditAreaLoader.prototype.init_syntax_regexp= function(){
|
||||
var lang_style= {};
|
||||
for(var lang in this.load_syntax){
|
||||
if(!this.syntax[lang]) // init the regexp if not already initialized
|
||||
{
|
||||
this.syntax[lang]= {};
|
||||
this.syntax[lang]["keywords_reg_exp"]= {};
|
||||
this.keywords_reg_exp_nb=0;
|
||||
|
||||
if(this.load_syntax[lang]['KEYWORDS']){
|
||||
param="g";
|
||||
if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
|
||||
param+="i";
|
||||
for(var i in this.load_syntax[lang]['KEYWORDS']){
|
||||
if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
|
||||
this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
|
||||
this.keywords_reg_exp_nb++;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.load_syntax[lang]['OPERATORS']){
|
||||
var str="";
|
||||
var nb=0;
|
||||
for(var i in this.load_syntax[lang]['OPERATORS']){
|
||||
if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
|
||||
if(nb>0)
|
||||
str+="|";
|
||||
str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
|
||||
nb++;
|
||||
}
|
||||
if(str.length>0)
|
||||
this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
|
||||
}
|
||||
|
||||
if(this.load_syntax[lang]['DELIMITERS']){
|
||||
var str="";
|
||||
var nb=0;
|
||||
for(var i in this.load_syntax[lang]['DELIMITERS']){
|
||||
if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
|
||||
if(nb>0)
|
||||
str+="|";
|
||||
str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
|
||||
nb++;
|
||||
}
|
||||
if(str.length>0)
|
||||
this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
|
||||
}
|
||||
|
||||
|
||||
// /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
|
||||
var syntax_trace=[];
|
||||
|
||||
// /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
|
||||
|
||||
this.syntax[lang]["quotes"]={};
|
||||
var quote_tab= [];
|
||||
if(this.load_syntax[lang]['QUOTEMARKS']){
|
||||
for(var i in this.load_syntax[lang]['QUOTEMARKS']){
|
||||
if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
|
||||
var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
|
||||
this.syntax[lang]["quotes"][x]=x;
|
||||
//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
|
||||
//previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
|
||||
quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
|
||||
|
||||
syntax_trace.push(x);
|
||||
}
|
||||
}
|
||||
|
||||
this.syntax[lang]["comments"]={};
|
||||
if(this.load_syntax[lang]['COMMENT_SINGLE']){
|
||||
for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
|
||||
if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
|
||||
var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
|
||||
quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
|
||||
syntax_trace.push(x);
|
||||
this.syntax[lang]["comments"][x]="\n";
|
||||
}
|
||||
}
|
||||
// (/\*(.|[\r\n])*?\*/)
|
||||
if(this.load_syntax[lang]['COMMENT_MULTI']){
|
||||
for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
|
||||
if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;
|
||||
var start=this.get_escaped_regexp(i);
|
||||
var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
|
||||
quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
|
||||
syntax_trace.push(start);
|
||||
syntax_trace.push(end);
|
||||
this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
|
||||
}
|
||||
}
|
||||
if(quote_tab.length>0)
|
||||
this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
|
||||
|
||||
if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
|
||||
this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
|
||||
|
||||
if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
|
||||
this.syntax[lang]["script_delimiters"]= {};
|
||||
for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
|
||||
if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
|
||||
this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
|
||||
}
|
||||
}
|
||||
|
||||
this.syntax[lang]["custom_regexp"]= {};
|
||||
if(this.load_syntax[lang]['REGEXPS']){
|
||||
for(var i in this.load_syntax[lang]['REGEXPS']){
|
||||
if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
|
||||
var val= this.load_syntax[lang]['REGEXPS'][i];
|
||||
if(!this.syntax[lang]["custom_regexp"][val['execute']])
|
||||
this.syntax[lang]["custom_regexp"][val['execute']]= {};
|
||||
this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
|
||||
, 'class' : val['class']};
|
||||
}
|
||||
}
|
||||
|
||||
if(this.load_syntax[lang]['STYLES']){
|
||||
lang_style[lang]= {};
|
||||
for(var i in this.load_syntax[lang]['STYLES']){
|
||||
if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
|
||||
if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
|
||||
for(var j in this.load_syntax[lang]['STYLES'][i]){
|
||||
lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
|
||||
}
|
||||
}else{
|
||||
lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
// build style string
|
||||
var style="";
|
||||
for(var i in lang_style[lang]){
|
||||
if(lang_style[lang][i].length>0){
|
||||
style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
|
||||
style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";
|
||||
}
|
||||
}
|
||||
this.syntax[lang]["styles"]=style;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";
|
||||
84
include/limesurvey/admin/scripts/edit_area/reg_syntax/css.js
Normal file
@@ -0,0 +1,84 @@
|
||||
editAreaLoader.load_syntax["css"] = {
|
||||
'COMMENT_SINGLE' : {1 : '@'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : ['"', "'"]
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'attributes' : [
|
||||
'aqua', 'azimuth', 'background-attachment', 'background-color',
|
||||
'background-image', 'background-position', 'background-repeat',
|
||||
'background', 'border-bottom-color', 'border-bottom-style',
|
||||
'border-bottom-width', 'border-left-color', 'border-left-style',
|
||||
'border-left-width', 'border-right', 'border-right-color',
|
||||
'border-right-style', 'border-right-width', 'border-top-color',
|
||||
'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
|
||||
'border-left', 'border-width', 'border-color', 'border-spacing',
|
||||
'border-style', 'border-top', 'border', 'caption-side',
|
||||
'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
|
||||
'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
|
||||
'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
|
||||
'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
|
||||
'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
|
||||
'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
|
||||
'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
|
||||
'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
|
||||
'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
|
||||
'outline-width', 'overflow', 'padding-bottom', 'padding-left',
|
||||
'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
|
||||
'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
|
||||
'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
|
||||
'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
|
||||
'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
|
||||
'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
|
||||
'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
|
||||
'width', 'word-spacing', 'z-index', 'bottom', 'left'
|
||||
]
|
||||
,'values' : [
|
||||
'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
|
||||
'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
|
||||
'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
|
||||
'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
|
||||
'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
|
||||
'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
|
||||
'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
|
||||
'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
|
||||
'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
|
||||
'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
|
||||
'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
|
||||
'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
|
||||
'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
|
||||
'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
|
||||
'pointer', 'portrait', 'purple', 'px',
|
||||
'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
|
||||
's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
|
||||
'static', 'status-bar', 'super', 'sw-resize',
|
||||
'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
|
||||
'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
|
||||
'visible',
|
||||
'w-resize', 'wait', 'white', 'wider',
|
||||
'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
|
||||
'yellow', 'yes'
|
||||
]
|
||||
,'specials' : [
|
||||
'important'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
':', ';', '!', '.', '#'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'attributes' : 'color: #48BDDF;'
|
||||
,'values' : 'color: #2B60FF;'
|
||||
,'specials' : 'color: #FF0000;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #60CA00;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* last update: 2006-08-24
|
||||
*/
|
||||
|
||||
editAreaLoader.load_syntax["html"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'<!--' : '-->'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'doctype' : {
|
||||
'search' : '()(<!DOCTYPE[^>]*>)()'
|
||||
,'class' : 'doctype'
|
||||
,'modifiers' : ''
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'tags' : {
|
||||
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
|
||||
,'class' : 'tags'
|
||||
,'modifiers' : 'gi'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'attributes' : {
|
||||
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
|
||||
,'class' : 'attributes'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' : 'color: #E775F0;'
|
||||
,'DELIMITERS' : ''
|
||||
,'REGEXPS' : {
|
||||
'attributes': 'color: #B1AC41;'
|
||||
,'tags': 'color: #E62253;'
|
||||
,'doctype': 'color: #8DCFB5;'
|
||||
,'test': 'color: #00FF00;'
|
||||
}
|
||||
}
|
||||
};
|
||||
93
include/limesurvey/admin/scripts/edit_area/reg_syntax/js.js
Normal file
@@ -0,0 +1,93 @@
|
||||
editAreaLoader.load_syntax["js"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
|
||||
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
|
||||
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
|
||||
'while', 'write', 'with'
|
||||
]
|
||||
,'keywords' : [
|
||||
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
|
||||
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
|
||||
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
|
||||
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
|
||||
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
|
||||
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
|
||||
'arguments', 'locationbar', 'pageXoffset', 'Form',
|
||||
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
|
||||
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
|
||||
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
|
||||
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
|
||||
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
|
||||
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
|
||||
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
|
||||
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
|
||||
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
|
||||
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
|
||||
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
|
||||
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
|
||||
]
|
||||
,'functions' : [
|
||||
// common functions for Window object
|
||||
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
|
||||
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
|
||||
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
|
||||
'stop'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'statements' : 'color: #60CA00;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #2B60FF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #0038E1;'
|
||||
|
||||
}
|
||||
,'AUTO_COMPLETION' : {
|
||||
"default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
|
||||
"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
|
||||
,"possible_words_letters": "[a-zA-Z0-9_]+"
|
||||
,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
|
||||
,"prefix_separator": "\\."
|
||||
}
|
||||
,"CASE_SENSITIVE": true
|
||||
,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
|
||||
,"KEYWORDS": {
|
||||
'': [ // the prefix of thoses items
|
||||
/**
|
||||
* 0 : the keyword the user is typing
|
||||
* 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
|
||||
* If empty the keyword will be displayed
|
||||
* 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
|
||||
*/
|
||||
['Array', '§()', '']
|
||||
,['alert', '§({@})', 'alert(String message)']
|
||||
,['document']
|
||||
,['window']
|
||||
]
|
||||
,'window' : [
|
||||
['location']
|
||||
,['document']
|
||||
,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
|
||||
]
|
||||
,'location' : [
|
||||
['href']
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
139
include/limesurvey/admin/scripts/edit_area/regexp.js
Normal file
@@ -0,0 +1,139 @@
|
||||
/*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
|
||||
new_class="quotes";
|
||||
if(v6 && v6 != undefined && v6!="")
|
||||
new_class="comments";
|
||||
return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
|
||||
|
||||
};*/
|
||||
|
||||
/* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
|
||||
res="<span class=htmlTag>"+v2;
|
||||
alert("v2: "+v2+" v3: "+v3);
|
||||
tab=v3.split("=");
|
||||
attributes="";
|
||||
if(tab.length>1){
|
||||
attributes="<span class=attribute>"+tab[0]+"</span>=";
|
||||
for(i=1; i<tab.length-1; i++){
|
||||
cut=tab[i].lastIndexOf(" ");
|
||||
attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
|
||||
attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
|
||||
}
|
||||
attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
|
||||
}
|
||||
res+=attributes+v5+"</span>";
|
||||
return res;
|
||||
};*/
|
||||
|
||||
// determine if the selected text if a comment or a quoted text
|
||||
EditArea.prototype.comment_or_quote= function(){
|
||||
var new_class="", close_tag="", sy, arg, i;
|
||||
sy = parent.editAreaLoader.syntax[editArea.current_code_lang];
|
||||
arg = EditArea.prototype.comment_or_quote.arguments[0];
|
||||
|
||||
for( i in sy["quotes"] ){
|
||||
if(arg.indexOf(i)==0){
|
||||
new_class="quotesmarks";
|
||||
close_tag=sy["quotes"][i];
|
||||
}
|
||||
}
|
||||
if(new_class.length==0)
|
||||
{
|
||||
for(var i in sy["comments"]){
|
||||
if( arg.indexOf(i)==0 ){
|
||||
new_class="comments";
|
||||
close_tag=sy["comments"][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
// for single line comment the \n must not be included in the span tags
|
||||
if(close_tag=="\n"){
|
||||
return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
|
||||
}else{
|
||||
// the closing tag must be set only if the comment or quotes is closed
|
||||
reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
|
||||
if( arg.search(reg)!=-1 )
|
||||
return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
|
||||
else
|
||||
return "µ__"+ new_class +"__µ"+ arg;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
// apply special tags arround text to highlight
|
||||
EditArea.prototype.custom_highlight= function(){
|
||||
res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
|
||||
if(EditArea.prototype.custom_highlight.arguments.length>5)
|
||||
res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
|
||||
return res;
|
||||
};
|
||||
*/
|
||||
|
||||
// return identication that allow to know if revalidating only the text line won't make the syntax go mad
|
||||
EditArea.prototype.get_syntax_trace= function(text){
|
||||
if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
|
||||
return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.colorize_text= function(text){
|
||||
//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
|
||||
/*
|
||||
if(this.isOpera){
|
||||
// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
|
||||
text= this.replace_tab(text);
|
||||
}*/
|
||||
|
||||
text= " "+text; // for easier regExp
|
||||
|
||||
/*if(this.do_html_tags)
|
||||
text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
|
||||
if(this.settings["syntax"].length>0)
|
||||
text= this.apply_syntax(text, this.settings["syntax"]);
|
||||
|
||||
// remove the first space added
|
||||
return text.substr(1).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
|
||||
};
|
||||
|
||||
EditArea.prototype.apply_syntax= function(text, lang){
|
||||
var sy;
|
||||
this.current_code_lang=lang;
|
||||
|
||||
if(!parent.editAreaLoader.syntax[lang])
|
||||
return text;
|
||||
|
||||
sy = parent.editAreaLoader.syntax[lang];
|
||||
if(sy["custom_regexp"]['before']){
|
||||
for( var i in sy["custom_regexp"]['before']){
|
||||
var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
|
||||
text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
|
||||
}
|
||||
}
|
||||
|
||||
if(sy["comment_or_quote_reg_exp"]){
|
||||
//setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
|
||||
text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
|
||||
}
|
||||
|
||||
if(sy["keywords_reg_exp"]){
|
||||
for(var i in sy["keywords_reg_exp"]){
|
||||
text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
|
||||
}
|
||||
}
|
||||
|
||||
if(sy["delimiters_reg_exp"]){
|
||||
text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
|
||||
}
|
||||
|
||||
if(sy["operators_reg_exp"]){
|
||||
text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
|
||||
}
|
||||
|
||||
if(sy["custom_regexp"]['after']){
|
||||
for( var i in sy["custom_regexp"]['after']){
|
||||
var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
|
||||
text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
};
|
||||
73
include/limesurvey/admin/scripts/edit_area/resize_area.js
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
EditAreaLoader.prototype.start_resize_area= function(){
|
||||
var d=document,a,div,width,height,father;
|
||||
|
||||
d.onmouseup= editAreaLoader.end_resize_area;
|
||||
d.onmousemove= editAreaLoader.resize_area;
|
||||
editAreaLoader.toggle(editAreaLoader.resize["id"]);
|
||||
|
||||
a = editAreas[editAreaLoader.resize["id"]]["textarea"];
|
||||
div = d.getElementById("edit_area_resize");
|
||||
if(!div){
|
||||
div= d.createElement("div");
|
||||
div.id="edit_area_resize";
|
||||
div.style.border="dashed #888888 1px";
|
||||
}
|
||||
width = a.offsetWidth -2;
|
||||
height = a.offsetHeight -2;
|
||||
|
||||
div.style.display = "block";
|
||||
div.style.width = width+"px";
|
||||
div.style.height = height+"px";
|
||||
father= a.parentNode;
|
||||
father.insertBefore(div, a);
|
||||
|
||||
a.style.display="none";
|
||||
|
||||
editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
|
||||
editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
|
||||
};
|
||||
|
||||
EditAreaLoader.prototype.end_resize_area= function(e){
|
||||
var d=document,div,a,width,height;
|
||||
|
||||
d.onmouseup="";
|
||||
d.onmousemove="";
|
||||
|
||||
div = d.getElementById("edit_area_resize");
|
||||
a= editAreas[editAreaLoader.resize["id"]]["textarea"];
|
||||
width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
|
||||
height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
|
||||
if(editAreaLoader.isIE==6){
|
||||
width-=2;
|
||||
height-=2;
|
||||
}
|
||||
a.style.width = width+"px";
|
||||
a.style.height = height+"px";
|
||||
div.style.display = "none";
|
||||
a.style.display = "inline";
|
||||
a.selectionStart = editAreaLoader.resize["selectionStart"];
|
||||
a.selectionEnd = editAreaLoader.resize["selectionEnd"];
|
||||
editAreaLoader.toggle(editAreaLoader.resize["id"]);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
EditAreaLoader.prototype.resize_area= function(e){
|
||||
var allow,newHeight,newWidth;
|
||||
allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
|
||||
if(allow=="both" || allow=="y")
|
||||
{
|
||||
newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
|
||||
document.getElementById("edit_area_resize").style.height= newHeight+"px";
|
||||
}
|
||||
if(allow=="both" || allow=="x")
|
||||
{
|
||||
newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
|
||||
document.getElementById("edit_area_resize").style.width= newWidth+"px";
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
editAreaLoader.waiting_loading["resize_area.js"]= "loaded";
|
||||
174
include/limesurvey/admin/scripts/edit_area/search_replace.js
Normal file
@@ -0,0 +1,174 @@
|
||||
EditArea.prototype.show_search = function(){
|
||||
if(_$("area_search_replace").style.visibility=="visible"){
|
||||
this.hidden_search();
|
||||
}else{
|
||||
this.open_inline_popup("area_search_replace");
|
||||
var text= this.area_get_selection();
|
||||
var search= text.split("\n")[0];
|
||||
_$("area_search").value= search;
|
||||
_$("area_search").focus();
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.hidden_search= function(){
|
||||
/*_$("area_search_replace").style.visibility="hidden";
|
||||
this.textarea.focus();
|
||||
var icon= _$("search");
|
||||
setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
|
||||
this.close_inline_popup("area_search_replace");
|
||||
};
|
||||
|
||||
EditArea.prototype.area_search= function(mode){
|
||||
|
||||
if(!mode)
|
||||
mode="search";
|
||||
_$("area_search_msg").innerHTML="";
|
||||
var search=_$("area_search").value;
|
||||
|
||||
this.textarea.focus();
|
||||
this.textarea.textareaFocused=true;
|
||||
|
||||
var infos= this.get_selection_infos();
|
||||
var start= infos["selectionStart"];
|
||||
var pos=-1;
|
||||
var pos_begin=-1;
|
||||
var length=search.length;
|
||||
|
||||
if(_$("area_search_replace").style.visibility!="visible"){
|
||||
this.show_search();
|
||||
return;
|
||||
}
|
||||
if(search.length==0){
|
||||
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
||||
return;
|
||||
}
|
||||
// advance to the next occurence if no text selected
|
||||
if(mode!="replace" ){
|
||||
if(_$("area_search_reg_exp").checked)
|
||||
start++;
|
||||
else
|
||||
start+= search.length;
|
||||
}
|
||||
|
||||
//search
|
||||
if(_$("area_search_reg_exp").checked){
|
||||
// regexp search
|
||||
var opt="m";
|
||||
if(!_$("area_search_match_case").checked)
|
||||
opt+="i";
|
||||
var reg= new RegExp(search, opt);
|
||||
pos= infos["full_text"].substr(start).search(reg);
|
||||
pos_begin= infos["full_text"].search(reg);
|
||||
if(pos!=-1){
|
||||
pos+=start;
|
||||
length=infos["full_text"].substr(start).match(reg)[0].length;
|
||||
}else if(pos_begin!=-1){
|
||||
length=infos["full_text"].match(reg)[0].length;
|
||||
}
|
||||
}else{
|
||||
if(_$("area_search_match_case").checked){
|
||||
pos= infos["full_text"].indexOf(search, start);
|
||||
pos_begin= infos["full_text"].indexOf(search);
|
||||
}else{
|
||||
pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start);
|
||||
pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
// interpret result
|
||||
if(pos==-1 && pos_begin==-1){
|
||||
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
||||
return;
|
||||
}else if(pos==-1 && pos_begin != -1){
|
||||
begin= pos_begin;
|
||||
_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
|
||||
}else
|
||||
begin= pos;
|
||||
|
||||
//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
|
||||
if(mode=="replace" && pos==infos["indexOfCursor"]){
|
||||
var replace= _$("area_replace").value;
|
||||
var new_text="";
|
||||
if(_$("area_search_reg_exp").checked){
|
||||
var opt="m";
|
||||
if(!_$("area_search_match_case").checked)
|
||||
opt+="i";
|
||||
var reg= new RegExp(search, opt);
|
||||
new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
|
||||
}else{
|
||||
new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
|
||||
}
|
||||
this.textarea.value=new_text;
|
||||
this.area_select(begin, length);
|
||||
this.area_search();
|
||||
}else
|
||||
this.area_select(begin, length);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
EditArea.prototype.area_replace= function(){
|
||||
this.area_search("replace");
|
||||
};
|
||||
|
||||
EditArea.prototype.area_replace_all= function(){
|
||||
/* this.area_select(0, 0);
|
||||
_$("area_search_msg").innerHTML="";
|
||||
while(_$("area_search_msg").innerHTML==""){
|
||||
this.area_replace();
|
||||
}*/
|
||||
|
||||
var base_text= this.textarea.value;
|
||||
var search= _$("area_search").value;
|
||||
var replace= _$("area_replace").value;
|
||||
if(search.length==0){
|
||||
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
||||
return ;
|
||||
}
|
||||
|
||||
var new_text="";
|
||||
var nb_change=0;
|
||||
if(_$("area_search_reg_exp").checked){
|
||||
// regExp
|
||||
var opt="mg";
|
||||
if(!_$("area_search_match_case").checked)
|
||||
opt+="i";
|
||||
var reg= new RegExp(search, opt);
|
||||
nb_change= infos["full_text"].match(reg).length;
|
||||
new_text= infos["full_text"].replace(reg, replace);
|
||||
|
||||
}else{
|
||||
|
||||
if(_$("area_search_match_case").checked){
|
||||
var tmp_tab=base_text.split(search);
|
||||
nb_change= tmp_tab.length -1 ;
|
||||
new_text= tmp_tab.join(replace);
|
||||
}else{
|
||||
// case insensitive
|
||||
var lower_value=base_text.toLowerCase();
|
||||
var lower_search=search.toLowerCase();
|
||||
|
||||
var start=0;
|
||||
var pos= lower_value.indexOf(lower_search);
|
||||
while(pos!=-1){
|
||||
nb_change++;
|
||||
new_text+= this.textarea.value.substring(start , pos)+replace;
|
||||
start=pos+ search.length;
|
||||
pos= lower_value.indexOf(lower_search, pos+1);
|
||||
}
|
||||
new_text+= this.textarea.value.substring(start);
|
||||
}
|
||||
}
|
||||
if(new_text==base_text){
|
||||
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
||||
}else{
|
||||
this.textarea.value= new_text;
|
||||
_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
|
||||
// firefox and opera doesn't manage with the focus if it's done directly
|
||||
//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
|
||||
setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
100
include/limesurvey/admin/scripts/edit_area/template.html
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
|
||||
<head>
|
||||
<title>EditArea</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
|
||||
[__CSSRULES__]
|
||||
[__JSCODE__]
|
||||
</head>
|
||||
<body>
|
||||
<div id='editor'>
|
||||
<div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
|
||||
<div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
|
||||
<div id='result'>
|
||||
<div id='no_file_selected'></div>
|
||||
<div id='container'>
|
||||
<div id='cursor_pos' class='edit_area_cursor'> </div>
|
||||
<div id='end_bracket' class='edit_area_cursor'> </div>
|
||||
<div id='selection_field'></div>
|
||||
<div id='line_number' selec='none'></div>
|
||||
<div id='content_highlight'></div>
|
||||
<div id='test_font_size'></div>
|
||||
<div id='selection_field_text'></div>
|
||||
<textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
|
||||
</textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class='area_toolbar' id='toolbar_2'>
|
||||
<table class='statusbar' cellspacing='0' cellpadding='0'>
|
||||
<tr>
|
||||
<td class='total' selec='none'>{$position}:</td>
|
||||
<td class='infos' selec='none'>
|
||||
{$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
|
||||
</td>
|
||||
<td class='total' selec='none'>{$total}:</td>
|
||||
<td class='infos' selec='none'>
|
||||
{$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
|
||||
</td>
|
||||
<td class='resize'>
|
||||
<span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id='processing'>
|
||||
<div id='processing_text'>
|
||||
{$processing}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='area_search_replace' class='editarea_popup'>
|
||||
<table cellspacing='2' cellpadding='0' style='width: 100%'>
|
||||
<tr>
|
||||
<td selec='none'>{$search}</td>
|
||||
<td><input type='text' id='area_search' /></td>
|
||||
<td id='close_area_search_replace'>
|
||||
<a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
|
||||
</tr><tr>
|
||||
<td selec='none'>{$replace}</td>
|
||||
<td><input type='text' id='area_replace' /></td>
|
||||
<td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='button'>
|
||||
<input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
|
||||
<input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
|
||||
<br />
|
||||
<a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
|
||||
<a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
|
||||
<a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
|
||||
</div>
|
||||
<div id='area_search_msg' selec='none'></div>
|
||||
</div>
|
||||
<div id='edit_area_help' class='editarea_popup'>
|
||||
<div class='close_popup'>
|
||||
<a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
|
||||
</div>
|
||||
<div><h2>Editarea [__EA_VERSION__]</h2><br />
|
||||
<h3>{$shortcuts}:</h3>
|
||||
{$tab}: {$add_tab}<br />
|
||||
{$shift}+{$tab}: {$remove_tab}<br />
|
||||
{$ctrl}+f: {$search_command}<br />
|
||||
{$ctrl}+r: {$replace_command}<br />
|
||||
{$ctrl}+h: {$highlight}<br />
|
||||
{$ctrl}+g: {$go_to_line}<br />
|
||||
{$ctrl}+z: {$undo}<br />
|
||||
{$ctrl}+y: {$redo}<br />
|
||||
{$ctrl}+e: {$help}<br />
|
||||
{$ctrl}+q, {$esc}: {$close_popup}<br />
|
||||
{$accesskey} E: {$toggle}<br />
|
||||
<br />
|
||||
<em>{$about_notice}</em>
|
||||
<br /><div class='copyright'>© Christophe Dolivet 2007-2009</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,293 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>FCKeditor ChangeLog - What's New?</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
body { font-family: arial, verdana, sans-serif }
|
||||
p { margin-left: 20px }
|
||||
h1 { border-bottom: solid 1px gray; padding-bottom: 20px }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
FCKeditor ChangeLog - What's New?</h1>
|
||||
<h3>
|
||||
Version 2.6</h3>
|
||||
<p>
|
||||
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
|
||||
<h3>
|
||||
Version 2.6 RC</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
|
||||
object can now be used to access all FCKeditor instances available in the page.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
|
||||
style="color: #ff0000">Attention:</span> By default, the editor now produces <strong>
|
||||
and <em> instead of <b> and <i>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog
|
||||
close button is now correctly positioned in IE in RTL languages.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder
|
||||
dialog will now display the placeholder value correctly in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing
|
||||
Enter or typing after a placeholder with the placeholder plugin will no longer generate
|
||||
colored text.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed
|
||||
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
|
||||
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed
|
||||
permission denied errors during opening popup menus in IE6 under domain relaxation
|
||||
mode.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
|
||||
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
|
||||
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
|
||||
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
|
||||
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
|
||||
Fixed XHTML source formatting errors in non-IE browsers.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
|
||||
character is now properly encoded in file names returned by the File Browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
|
||||
and file names are now properly sanitized against control characters. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
|
||||
character is now disallowed in current folder path.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
|
||||
logic to override JavaScript errors occurring inside the editing frame due to user
|
||||
added JavaScript code.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
|
||||
ENTER on list items containing block elements will now create new list item elements,
|
||||
instead of adding further blocks to the same list item.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
|
||||
only combos now get properly grayed out when moving to source view.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
|
||||
an important bug regarding styles removal on styled text boundaries, introduced
|
||||
with the 2.6 Beta 1. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
|
||||
CSS <style> tags where being outputted when FullPage=true.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
|
||||
dialog now properly selects the first field when opening it to modify mailto or
|
||||
anchor links. This problem was also throwing an error in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
|
||||
will no longer remain behind in the editing area when the placeholder dialog is
|
||||
opened.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
|
||||
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
|
||||
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
|
||||
the issue where context menus sometimes don't disappear after selecting an option.
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed
|
||||
JavaScript error when EnterMode=br and user tries to insert a page break.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed
|
||||
the issue where the maximize editor button does not vertically expand the editing
|
||||
area in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
|
||||
fixed filename encoding problems in file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
|
||||
FCK.InsertHtml() in non-IE browsers would now activate the document processor as
|
||||
expected.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
|
||||
XMLHttpRequest class is now used in IE, whenever it is available.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
|
||||
the browser was able to enter in an infinite loop when working with multiple editors
|
||||
in the same page. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
|
||||
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
|
||||
having problems with SpellerPages, causing some errors to be thrown when completing
|
||||
the spell checking in some situations.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
|
||||
command was throwing an error if executed in an editor where its relative button
|
||||
is not present in the toolbar.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
|
||||
a generic document processor for <OBJECT> and <EMBED> tags.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
|
||||
the issue where the placeholder icon for <EMBED> tags does not always show
|
||||
up in IE7.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
|
||||
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
|
||||
the caret will not any more move to the previous line when selecting a Format style
|
||||
inside an empty paragraph.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
|
||||
dialogs using API calls which deals with the selection, like InsertHtml now can
|
||||
be sure the selection will be placed in the correct position.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
|
||||
IE, the first character of table captions where being lost on table creation.</li>
|
||||
<li>The selection and cursor position was not being properly handled when creating some
|
||||
elements like forms and tables.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
|
||||
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6 Beta 1</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New
|
||||
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers
|
||||
and enhancing the editor usability.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong>
|
||||
Adobe AIR</strong> compatibility.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support
|
||||
for <strong>document.domain</strong> with automatic domain detection.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong>
|
||||
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS
|
||||
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS,
|
||||
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|<minified
|
||||
CSS styles". All internal CSS links are already using this feature. </li>
|
||||
<li>New language file for <strong>Canadian French</strong>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved
|
||||
several "strict warning" messages in Firefox when running FCKeditor.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER
|
||||
key will now work properly in IE with the cursor at the start of a formatted block.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's
|
||||
possible to define in the Styles that a Style (with an empty class) must be shown
|
||||
selected only when no class is present in the current element, and selecting that
|
||||
item will clear the current class (it does apply to any attribute, not only classes).</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars
|
||||
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden
|
||||
div.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned
|
||||
<li> elements now get properly enclosed in a <ul> on output.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER
|
||||
key will not any more break <button> elements at the beginning of paragraphs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor
|
||||
was not loading on a specific unknown situation. The breaking point has been removed.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor
|
||||
no longer hangs when operating on documents imported from Microsoft Word.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating
|
||||
panels attached to a shared toolbar among multiple FCKeditor instances are no longer
|
||||
misplaced when the editing areas are absolutely or relatively positioned.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog
|
||||
is now enforced only when ForcePasteAsPlainText = true.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes
|
||||
the autogrow plugin didn't work properly in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External
|
||||
toolbars are now properly sized in Opera.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking
|
||||
on radio buttons or checkboxes in the editor in IE will no longer cause lockups
|
||||
in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes
|
||||
commands where executed even if the command itself was disabled.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button
|
||||
to empty the box in the "Paste from Word" has been removed as it leads to confusion
|
||||
for some users.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing
|
||||
control elements in Firefox, Opera and Safari now works properly.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor
|
||||
was surrounded by a <div> element that wasn't really needed.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form
|
||||
control was moved in IE after creating it, then it did lose its name.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't
|
||||
possible to change the type of an existing button.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation
|
||||
now works inside table cells.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor
|
||||
was entering on looping on some specific cases when dealing with invalid source
|
||||
markup.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting
|
||||
text into the "Find what" fields in the Find and Replace dialog would now activate
|
||||
the find and replace buttons.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace
|
||||
dialog will no longer display wrong starting positions for the match when there
|
||||
are multiple and identical characters preceding the character at the real starting
|
||||
point of the match.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
|
||||
a JavaScript error which occurs in the Find/Replace dialog when the user presses
|
||||
"Find" or "Replace" after the "No match found" message has appeared.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
|
||||
breaks and spaces are now conserved when converting to and from the "Formatted"
|
||||
format.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
|
||||
the background color behind smiley icons and special characters in their corresponding
|
||||
dialogs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
|
||||
error messages are now properly displayed in the file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
|
||||
and value fields in the selection box dialog will no longer extend beyond the dialog
|
||||
limits when the user inputs a very long text or value for one of the selection options.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
|
||||
issue where pressing Enter in an <o:p> tag in IE does not generate line breaks.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
|
||||
issue where the image preview in image dialog sometimes doesn't display after selecting
|
||||
the image from server browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
|
||||
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
|
||||
of depreciated "var").</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
|
||||
removed closing tag: "?>", so no additional whitespace added when files are included.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
|
||||
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
|
||||
browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
|
||||
file browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
|
||||
file browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
|
||||
integration: fixed issues with setting the editor height.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
|
||||
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
|
||||
returning an empty string.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
|
||||
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
|
||||
in IE will no longer turn the preceding normal whitespace into &nbsp;.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
|
||||
method now has an additional fifth parameter "customData" that will be sent to the
|
||||
Execute method of the command for that menu item, allowing a single command to be
|
||||
used for different menu items..</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
|
||||
command now also removes the attributes from the cleaned text. The list of attributes
|
||||
is configurable with FCKConfig.RemoveAttributes.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
|
||||
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
|
||||
warning message on Copy and Cut operation failure on IE due to paste permission
|
||||
settings.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
|
||||
to file browser has been changed to avoid requests containing double dots.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
|
||||
multiple contiguous paragraphs to Formatted will now be merged into a single <PRE>
|
||||
block.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
|
||||
failed to load from local filesystem in IE7.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a href="_whatsnew_history.html">See previous versions history</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Debug window control and operations.
|
||||
*/
|
||||
|
||||
var FCKDebug = new Object() ;
|
||||
|
||||
FCKDebug._GetWindow = function()
|
||||
{
|
||||
if ( !this.DebugWindow || this.DebugWindow.closed )
|
||||
this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
|
||||
|
||||
return this.DebugWindow ;
|
||||
}
|
||||
|
||||
FCKDebug.Output = function( message, color, noParse )
|
||||
{
|
||||
if ( ! FCKConfig.Debug )
|
||||
return ;
|
||||
|
||||
try
|
||||
{
|
||||
this._GetWindow().Output( message, color ) ;
|
||||
}
|
||||
catch ( e ) {} // Ignore errors
|
||||
}
|
||||
|
||||
FCKDebug.OutputObject = function( anyObject, color )
|
||||
{
|
||||
if ( ! FCKConfig.Debug )
|
||||
return ;
|
||||
|
||||
try
|
||||
{
|
||||
this._GetWindow().OutputObject( anyObject, color ) ;
|
||||
}
|
||||
catch ( e ) {} // Ignore errors
|
||||
}
|
||||
|
Before Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 293 B |
|
Before Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 236 B |
@@ -1,530 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* "Find" and "Replace" dialog box window.
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta content="noindex, nofollow" name="robots" />
|
||||
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var dialog = window.parent ;
|
||||
var oEditor = dialog.InnerDialogLoaded() ;
|
||||
var dialogArguments = dialog.Args() ;
|
||||
|
||||
var FCKLang = oEditor.FCKLang ;
|
||||
|
||||
dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ;
|
||||
dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ;
|
||||
var idMap = {} ;
|
||||
|
||||
function OnDialogTabChange( tabCode )
|
||||
{
|
||||
ShowE( 'divFind', ( tabCode == 'Find' ) ) ;
|
||||
ShowE( 'divReplace', ( tabCode == 'Replace' ) ) ;
|
||||
idMap['FindText'] = 'txtFind' + tabCode ;
|
||||
idMap['CheckCase'] = 'chkCase' + tabCode ;
|
||||
idMap['CheckWord'] = 'chkWord' + tabCode ;
|
||||
|
||||
if ( tabCode == 'Replace' )
|
||||
dialog.SetAutoSize( true ) ;
|
||||
}
|
||||
|
||||
// Place a range at the start of document.
|
||||
// This will be the starting point of our search.
|
||||
var GlobalRange = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
|
||||
|
||||
function ResetGlobalRange()
|
||||
{
|
||||
GlobalRange.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ;
|
||||
GlobalRange.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ;
|
||||
GlobalRange.Collapse( true ) ;
|
||||
}
|
||||
ResetGlobalRange() ;
|
||||
|
||||
var HighlightRange = null ;
|
||||
function Highlight()
|
||||
{
|
||||
if ( HighlightRange )
|
||||
ClearHighlight() ;
|
||||
var cloneRange = GlobalRange.Clone() ;
|
||||
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).ApplyToRange( cloneRange, false, true ) ;
|
||||
HighlightRange = cloneRange ;
|
||||
GlobalRange = HighlightRange.Clone() ;
|
||||
}
|
||||
|
||||
function ClearHighlight()
|
||||
{
|
||||
if ( HighlightRange )
|
||||
{
|
||||
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).RemoveFromRange( HighlightRange, false, true ) ;
|
||||
HighlightRange = null ;
|
||||
}
|
||||
}
|
||||
|
||||
function OnLoad()
|
||||
{
|
||||
// First of all, translate the dialog box texts.
|
||||
oEditor.FCKLanguageManager.TranslatePage( document ) ;
|
||||
|
||||
// Show the appropriate tab at startup.
|
||||
if ( dialogArguments.CustomValue == 'Find' )
|
||||
{
|
||||
dialog.SetSelectedTab( 'Find' ) ;
|
||||
dialog.SetAutoSize( true ) ;
|
||||
}
|
||||
else
|
||||
dialog.SetSelectedTab( 'Replace' ) ;
|
||||
|
||||
SelectField( 'txtFind' + dialogArguments.CustomValue ) ;
|
||||
}
|
||||
|
||||
function btnStat()
|
||||
{
|
||||
GetE('btnReplace').disabled =
|
||||
GetE('btnReplaceAll').disabled =
|
||||
GetE('btnFind').disabled =
|
||||
( GetE(idMap["FindText"]).value.length == 0 ) ;
|
||||
}
|
||||
|
||||
function btnStatDelayed()
|
||||
{
|
||||
setTimeout( btnStat, 1 ) ;
|
||||
}
|
||||
|
||||
function GetSearchString()
|
||||
{
|
||||
return GetE(idMap['FindText']).value ;
|
||||
}
|
||||
|
||||
function GetReplaceString()
|
||||
{
|
||||
return GetE("txtReplace").value ;
|
||||
}
|
||||
|
||||
function GetCheckCase()
|
||||
{
|
||||
return !! ( GetE(idMap['CheckCase']).checked ) ;
|
||||
}
|
||||
|
||||
function GetMatchWord()
|
||||
{
|
||||
return !! ( GetE(idMap['CheckWord']).checked ) ;
|
||||
}
|
||||
|
||||
// Get the data pointed to by a bookmark.
|
||||
function GetData( bookmark )
|
||||
{
|
||||
var cursor = oEditor.FCK.EditorDocument.documentElement ;
|
||||
for ( var i = 0 ; i < bookmark.length ; i++ )
|
||||
{
|
||||
var target = bookmark[i] ;
|
||||
var currentIndex = -1 ;
|
||||
if ( cursor.nodeType != 3 )
|
||||
{
|
||||
for (var j = 0 ; j < cursor.childNodes.length ; j++ )
|
||||
{
|
||||
var candidate = cursor.childNodes[j] ;
|
||||
if ( candidate.nodeType == 3 &&
|
||||
candidate.previousSibling &&
|
||||
candidate.previousSibling.nodeType == 3 )
|
||||
continue ;
|
||||
currentIndex++ ;
|
||||
if ( currentIndex == target )
|
||||
{
|
||||
cursor = candidate ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if ( currentIndex < target )
|
||||
return null ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( i != bookmark.length - 1 )
|
||||
return null ;
|
||||
while ( target >= cursor.length && cursor.nextSibling && cursor.nextSibling.nodeType == 3 )
|
||||
{
|
||||
target -= cursor.length ;
|
||||
cursor = cursor.nextSibling ;
|
||||
}
|
||||
cursor = cursor.nodeValue.charAt( target ) ;
|
||||
if ( cursor == "" )
|
||||
cursor = null ;
|
||||
}
|
||||
}
|
||||
return cursor ;
|
||||
}
|
||||
|
||||
// With this function, we can treat the bookmark as an iterator for DFS.
|
||||
function NextPosition( bookmark )
|
||||
{
|
||||
// See if there's anything further down the tree.
|
||||
var next = bookmark.concat( [0] ) ;
|
||||
if ( GetData( next ) != null )
|
||||
return next ;
|
||||
|
||||
// Nothing down there? See if there's anything next to me.
|
||||
var next = bookmark.slice( 0, bookmark.length - 1 ).concat( [ bookmark[ bookmark.length - 1 ] + 1 ] ) ;
|
||||
if ( GetData( next ) != null )
|
||||
return next ;
|
||||
|
||||
// Nothing even next to me? See if there's anything next to my ancestors.
|
||||
for ( var i = bookmark.length - 1 ; i > 0 ; i-- )
|
||||
{
|
||||
var next = bookmark.slice( 0, i - 1 ).concat( [ bookmark[ i - 1 ] + 1 ] ) ;
|
||||
if ( GetData( next ) != null )
|
||||
return next ;
|
||||
}
|
||||
|
||||
// There's absolutely nothing left to walk, return null.
|
||||
return null ;
|
||||
}
|
||||
|
||||
// Is this character a unicode whitespace?
|
||||
// Reference: http://unicode.org/Public/UNIDATA/PropList.txt
|
||||
function CheckIsWhitespace( c )
|
||||
{
|
||||
var code = c.charCodeAt( 0 );
|
||||
if ( code >= 9 && code <= 0xd )
|
||||
return true;
|
||||
if ( code >= 0x2000 && code <= 0x200a )
|
||||
return true;
|
||||
switch ( code )
|
||||
{
|
||||
case 0x20:
|
||||
case 0x85:
|
||||
case 0xa0:
|
||||
case 0x1680:
|
||||
case 0x180e:
|
||||
case 0x2028:
|
||||
case 0x2029:
|
||||
case 0x202f:
|
||||
case 0x205f:
|
||||
case 0x3000:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Knuth-Morris-Pratt Algorithm for stream input
|
||||
KMP_NOMATCH = 0 ;
|
||||
KMP_ADVANCED = 1 ;
|
||||
KMP_MATCHED = 2 ;
|
||||
function KmpMatch( pattern, ignoreCase )
|
||||
{
|
||||
var overlap = [ -1 ] ;
|
||||
for ( var i = 0 ; i < pattern.length ; i++ )
|
||||
{
|
||||
overlap.push( overlap[i] + 1 ) ;
|
||||
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
|
||||
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
|
||||
}
|
||||
this._Overlap = overlap ;
|
||||
this._State = 0 ;
|
||||
this._IgnoreCase = ( ignoreCase === true ) ;
|
||||
if ( ignoreCase )
|
||||
this.Pattern = pattern.toLowerCase();
|
||||
else
|
||||
this.Pattern = pattern ;
|
||||
}
|
||||
KmpMatch.prototype = {
|
||||
"FeedCharacter" : function( c )
|
||||
{
|
||||
if ( this._IgnoreCase )
|
||||
c = c.toLowerCase();
|
||||
|
||||
while ( true )
|
||||
{
|
||||
if ( c == this.Pattern.charAt( this._State ) )
|
||||
{
|
||||
this._State++ ;
|
||||
if ( this._State == this.Pattern.length )
|
||||
{
|
||||
// found a match, start over, don't care about partial matches involving the current match
|
||||
this._State = 0;
|
||||
return KMP_MATCHED;
|
||||
}
|
||||
return KMP_ADVANCED ;
|
||||
}
|
||||
else if ( this._State == 0 )
|
||||
return KMP_NOMATCH;
|
||||
else
|
||||
this._State = this._Overlap[ this._State ];
|
||||
}
|
||||
|
||||
return null ;
|
||||
},
|
||||
"Reset" : function()
|
||||
{
|
||||
this._State = 0 ;
|
||||
}
|
||||
};
|
||||
|
||||
function _Find()
|
||||
{
|
||||
// Start from the end of the current selection.
|
||||
var matcher = new KmpMatch( GetSearchString(), ! GetCheckCase() ) ;
|
||||
var cursor = GlobalRange.CreateBookmark2().End ;
|
||||
var matchState = KMP_NOMATCH ;
|
||||
var matchBookmark = null ;
|
||||
var matchBookmarkStart = [] ;
|
||||
|
||||
// Match finding.
|
||||
while ( true )
|
||||
{
|
||||
// Perform KMP stream matching.
|
||||
// - Reset KMP matcher if we encountered a block element.
|
||||
var data = GetData( cursor ) ;
|
||||
if ( data )
|
||||
{
|
||||
if ( data.tagName )
|
||||
{
|
||||
if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] )
|
||||
{
|
||||
matcher.Reset();
|
||||
matchBookmarkStart = [] ;
|
||||
}
|
||||
}
|
||||
else if ( data.charAt != undefined )
|
||||
{
|
||||
matchState = matcher.FeedCharacter(data) ;
|
||||
|
||||
// No possible match of any useful substring in the pattern for the currently scanned character.
|
||||
// So delete any positional information.
|
||||
if ( matchState == KMP_NOMATCH )
|
||||
matchBookmarkStart = [] ;
|
||||
// We've matched something, but it's not a complete match, so let's just mark down the position for backtracking later.
|
||||
else if ( matchState == KMP_ADVANCED )
|
||||
{
|
||||
matchBookmarkStart.push( cursor.concat( [] ) ) ;
|
||||
if ( matchBookmarkStart.length > matcher._State )
|
||||
matchBookmarkStart.shift() ;
|
||||
}
|
||||
// Found a complete match! Mark down the ending position as well.
|
||||
else if ( matchState == KMP_MATCHED )
|
||||
{
|
||||
// It is possible to get a KMP_MATCHED without KMP_ADVANCED when the match pattern is only 1 character.
|
||||
// So need to check and mark down the starting position as well.
|
||||
if ( matchBookmarkStart.length == 0 )
|
||||
matchBookmarkStart = [cursor.concat( [] )] ;
|
||||
|
||||
matchBookmark = { 'Start' : matchBookmarkStart.shift(), 'End' : cursor.concat( [] ) } ;
|
||||
matchBookmark.End[ matchBookmark.End.length - 1 ]++;
|
||||
|
||||
// Wait, do we have to match a whole word?
|
||||
// If yes, carry out additional checks on what we've got.
|
||||
if ( GetMatchWord() )
|
||||
{
|
||||
var startOk = false ;
|
||||
var endOk = false ;
|
||||
var start = matchBookmark.Start ;
|
||||
var end = matchBookmark.End ;
|
||||
if ( start[ start.length - 1 ] == 0 )
|
||||
startOk = true ;
|
||||
else
|
||||
{
|
||||
var cursorBeforeStart = start.slice( 0, start.length - 1 ) ;
|
||||
cursorBeforeStart.push( start[ start.length - 1 ] - 1 ) ;
|
||||
var dataBeforeStart = GetData( cursorBeforeStart ) ;
|
||||
if ( dataBeforeStart == null || dataBeforeStart.charAt == undefined )
|
||||
startOk = true ;
|
||||
else if ( CheckIsWhitespace( dataBeforeStart ) )
|
||||
startOk = true ;
|
||||
}
|
||||
|
||||
// this is already one character beyond the last char, no need to move
|
||||
var cursorAfterEnd = end ;
|
||||
var dataAfterEnd = GetData( cursorAfterEnd );
|
||||
if ( dataAfterEnd == null || dataAfterEnd.charAt == undefined )
|
||||
endOk = true ;
|
||||
else if ( CheckIsWhitespace( dataAfterEnd ) )
|
||||
endOk = true ;
|
||||
|
||||
if ( startOk && endOk )
|
||||
break ;
|
||||
else
|
||||
matcher.Reset() ;
|
||||
}
|
||||
else
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Perform DFS across the document, until we've reached the end.
|
||||
cursor = NextPosition( cursor ) ;
|
||||
if ( cursor == null )
|
||||
break;
|
||||
}
|
||||
|
||||
// If we've found a match, highlight the match.
|
||||
if ( matchState == KMP_MATCHED )
|
||||
{
|
||||
GlobalRange.MoveToBookmark2( matchBookmark ) ;
|
||||
Highlight() ;
|
||||
var focus = GlobalRange._Range.endContainer ;
|
||||
while ( focus && focus.nodeType != 1 )
|
||||
focus = focus.parentNode ;
|
||||
|
||||
if ( focus )
|
||||
{
|
||||
if ( oEditor.FCKBrowserInfo.IsSafari )
|
||||
oEditor.FCKDomTools.ScrollIntoView( focus, false ) ;
|
||||
else
|
||||
focus.scrollIntoView( false ) ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetGlobalRange() ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
function Find()
|
||||
{
|
||||
if ( ! _Find() )
|
||||
{
|
||||
ClearHighlight() ;
|
||||
alert( FCKLang.DlgFindNotFoundMsg ) ;
|
||||
}
|
||||
}
|
||||
|
||||
function Replace()
|
||||
{
|
||||
if ( GlobalRange.CheckIsCollapsed() )
|
||||
{
|
||||
if (! _Find() )
|
||||
{
|
||||
ClearHighlight() ;
|
||||
alert( FCKLang.DlgFindNotFoundMsg ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oEditor.FCKUndo.SaveUndoStep() ;
|
||||
GlobalRange.DeleteContents() ;
|
||||
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ;
|
||||
GlobalRange.Collapse( false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
function ReplaceAll()
|
||||
{
|
||||
oEditor.FCKUndo.SaveUndoStep() ;
|
||||
var replaceCount = 0 ;
|
||||
|
||||
while ( _Find() )
|
||||
{
|
||||
dialog.Selection.EnsureSelection() ;
|
||||
GlobalRange.DeleteContents() ;
|
||||
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ;
|
||||
GlobalRange.Collapse( false ) ;
|
||||
replaceCount++ ;
|
||||
}
|
||||
if ( replaceCount == 0 )
|
||||
{
|
||||
ClearHighlight() ;
|
||||
alert( FCKLang.DlgFindNotFoundMsg ) ;
|
||||
}
|
||||
dialog.Cancel() ;
|
||||
}
|
||||
|
||||
window.onunload = function(){ ClearHighlight() ; }
|
||||
</script>
|
||||
</head>
|
||||
<body onload="OnLoad()" style="overflow: hidden">
|
||||
<div id="divFind" style="display: none">
|
||||
<table cellspacing="3" cellpadding="2" width="100%" border="0">
|
||||
<tr>
|
||||
<td nowrap="nowrap">
|
||||
<label for="txtFindFind" fcklang="DlgReplaceFindLbl">
|
||||
Find what:</label>
|
||||
</td>
|
||||
<td width="100%">
|
||||
<input id="txtFindFind" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
|
||||
type="text" />
|
||||
</td>
|
||||
<td>
|
||||
<input id="btnFind" style="width: 80px" disabled="disabled" onclick="Find();"
|
||||
type="button" value="Find" fcklang="DlgFindFindBtn" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="3">
|
||||
<input id="chkCaseFind" tabindex="3" type="checkbox" /><label for="chkCaseFind" fcklang="DlgReplaceCaseChk">Match
|
||||
case</label>
|
||||
<br />
|
||||
<input id="chkWordFind" tabindex="4" type="checkbox" /><label for="chkWordFind" fcklang="DlgReplaceWordChk">Match
|
||||
whole word</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="divReplace" style="display:none">
|
||||
<table cellspacing="3" cellpadding="2" width="100%" border="0">
|
||||
<tr>
|
||||
<td nowrap="nowrap">
|
||||
<label for="txtFindReplace" fcklang="DlgReplaceFindLbl">
|
||||
Find what:</label>
|
||||
</td>
|
||||
<td width="100%">
|
||||
<input id="txtFindReplace" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
|
||||
type="text" />
|
||||
</td>
|
||||
<td>
|
||||
<input id="btnReplace" style="width: 80px" disabled="disabled" onclick="Replace();"
|
||||
type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<label for="txtReplace" fcklang="DlgReplaceReplaceLbl">
|
||||
Replace with:</label>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<input id="txtReplace" style="width: 100%" tabindex="2" type="text" />
|
||||
</td>
|
||||
<td>
|
||||
<input id="btnReplaceAll" style="width: 80px" disabled="disabled" onclick="ReplaceAll()" type="button"
|
||||
value="Replace All" fcklang="DlgReplaceReplAllBtn" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="3">
|
||||
<input id="chkCaseReplace" tabindex="3" type="checkbox" /><label for="chkCaseReplace" fcklang="DlgReplaceCaseChk">Match
|
||||
case</label>
|
||||
<br />
|
||||
<input id="chkWordReplace" tabindex="4" type="checkbox" /><label for="chkWordReplace" fcklang="DlgReplaceWordChk">Match
|
||||
whole word</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Translations Status.
|
||||
*/
|
||||
|
||||
af.js Found: 396 Missing: 15
|
||||
ar.js Found: 411 Missing: 0
|
||||
bg.js Found: 373 Missing: 38
|
||||
bn.js Found: 380 Missing: 31
|
||||
bs.js Found: 226 Missing: 185
|
||||
ca.js Found: 411 Missing: 0
|
||||
cs.js Found: 411 Missing: 0
|
||||
da.js Found: 381 Missing: 30
|
||||
de.js Found: 411 Missing: 0
|
||||
el.js Found: 396 Missing: 15
|
||||
en-au.js Found: 411 Missing: 0
|
||||
en-ca.js Found: 411 Missing: 0
|
||||
en-uk.js Found: 411 Missing: 0
|
||||
eo.js Found: 346 Missing: 65
|
||||
es.js Found: 411 Missing: 0
|
||||
et.js Found: 411 Missing: 0
|
||||
eu.js Found: 411 Missing: 0
|
||||
fa.js Found: 397 Missing: 14
|
||||
fi.js Found: 411 Missing: 0
|
||||
fo.js Found: 396 Missing: 15
|
||||
fr-ca.js Found: 411 Missing: 0
|
||||
fr.js Found: 411 Missing: 0
|
||||
gl.js Found: 381 Missing: 30
|
||||
he.js Found: 411 Missing: 0
|
||||
hi.js Found: 411 Missing: 0
|
||||
hr.js Found: 411 Missing: 0
|
||||
hu.js Found: 411 Missing: 0
|
||||
it.js Found: 396 Missing: 15
|
||||
ja.js Found: 411 Missing: 0
|
||||
km.js Found: 370 Missing: 41
|
||||
ko.js Found: 390 Missing: 21
|
||||
lt.js Found: 376 Missing: 35
|
||||
lv.js Found: 381 Missing: 30
|
||||
mn.js Found: 411 Missing: 0
|
||||
ms.js Found: 352 Missing: 59
|
||||
nb.js Found: 395 Missing: 16
|
||||
nl.js Found: 411 Missing: 0
|
||||
no.js Found: 395 Missing: 16
|
||||
pl.js Found: 411 Missing: 0
|
||||
pt-br.js Found: 411 Missing: 0
|
||||
pt.js Found: 381 Missing: 30
|
||||
ro.js Found: 410 Missing: 1
|
||||
ru.js Found: 411 Missing: 0
|
||||
sk.js Found: 396 Missing: 15
|
||||
sl.js Found: 411 Missing: 0
|
||||
sr-latn.js Found: 368 Missing: 43
|
||||
sr.js Found: 368 Missing: 43
|
||||
sv.js Found: 396 Missing: 15
|
||||
th.js Found: 393 Missing: 18
|
||||
tr.js Found: 396 Missing: 15
|
||||
uk.js Found: 397 Missing: 14
|
||||
vi.js Found: 396 Missing: 15
|
||||
zh-cn.js Found: 411 Missing: 0
|
||||
zh.js Found: 411 Missing: 0
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Plugin: automatically resizes the editor until a configurable maximun
|
||||
* height (FCKConfig.AutoGrowMax), based on its contents.
|
||||
*/
|
||||
|
||||
var FCKAutoGrow_Min = window.frameElement.offsetHeight ;
|
||||
|
||||
function FCKAutoGrow_Check()
|
||||
{
|
||||
var oInnerDoc = FCK.EditorDocument ;
|
||||
|
||||
var iFrameHeight, iInnerHeight ;
|
||||
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
{
|
||||
iFrameHeight = FCK.EditorWindow.frameElement.offsetHeight ;
|
||||
iInnerHeight = oInnerDoc.body.scrollHeight ;
|
||||
}
|
||||
else
|
||||
{
|
||||
iFrameHeight = FCK.EditorWindow.innerHeight ;
|
||||
iInnerHeight = oInnerDoc.body.offsetHeight ;
|
||||
}
|
||||
|
||||
var iDiff = iInnerHeight - iFrameHeight ;
|
||||
|
||||
if ( iDiff != 0 )
|
||||
{
|
||||
var iMainFrameSize = window.frameElement.offsetHeight ;
|
||||
|
||||
if ( iDiff > 0 && iMainFrameSize < FCKConfig.AutoGrowMax )
|
||||
{
|
||||
iMainFrameSize += iDiff ;
|
||||
if ( iMainFrameSize > FCKConfig.AutoGrowMax )
|
||||
iMainFrameSize = FCKConfig.AutoGrowMax ;
|
||||
}
|
||||
else if ( iDiff < 0 && iMainFrameSize > FCKAutoGrow_Min )
|
||||
{
|
||||
iMainFrameSize += iDiff ;
|
||||
if ( iMainFrameSize < FCKAutoGrow_Min )
|
||||
iMainFrameSize = FCKAutoGrow_Min ;
|
||||
}
|
||||
else
|
||||
return ;
|
||||
|
||||
window.frameElement.height = iMainFrameSize ;
|
||||
|
||||
// Gecko browsers use an onresize handler to update the innermost
|
||||
// IFRAME's height. If the document is modified before the onresize
|
||||
// is triggered, the plugin will miscalculate the new height. Thus,
|
||||
// forcibly trigger onresize. #1336
|
||||
if ( typeof window.onresize == 'function' )
|
||||
window.onresize() ;
|
||||
}
|
||||
}
|
||||
|
||||
FCK.AttachToOnSelectionChange( FCKAutoGrow_Check ) ;
|
||||
|
||||
function FCKAutoGrow_SetListeners()
|
||||
{
|
||||
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
|
||||
return ;
|
||||
|
||||
FCK.EditorWindow.attachEvent( 'onscroll', FCKAutoGrow_Check ) ;
|
||||
FCK.EditorDocument.attachEvent( 'onkeyup', FCKAutoGrow_Check ) ;
|
||||
}
|
||||
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
{
|
||||
// FCKAutoGrow_SetListeners() ;
|
||||
FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAutoGrow_SetListeners ) ;
|
||||
}
|
||||
|
||||
function FCKAutoGrow_CheckEditorStatus( sender, status )
|
||||
{
|
||||
if ( status == FCK_STATUS_COMPLETE )
|
||||
FCKAutoGrow_Check() ;
|
||||
}
|
||||
|
||||
FCK.Events.AttachEvent( 'OnStatusChange', FCKAutoGrow_CheckEditorStatus ) ;
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
177
include/limesurvey/admin/scripts/fckeditor.2641/_whatsnew.html
Normal file
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>FCKeditor ChangeLog - What's New?</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
body { font-family: arial, verdana, sans-serif }
|
||||
p { margin-left: 20px }
|
||||
h1 { border-bottom: solid 1px gray; padding-bottom: 20px }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
FCKeditor ChangeLog - What's New?</h1>
|
||||
<h3>
|
||||
Version 2.6.4.1</h3>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li><strong>Security release, upgrade is highly recommended.</strong></li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6.4</h3>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2777">#2777</a>] Merging
|
||||
cells between table header and body is no longer possible.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2815">#2815</a>] Fixed
|
||||
WSC issues at slow connection speed. Added SSL support.</li>
|
||||
<li>Language file updates for the following languages:
|
||||
<ul>
|
||||
<li>Chinese (Traditional)</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2846">#2846</a>] French</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2801">#2801</a>] Hebrew</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2824">#2824</a>] Russian</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2811">#2811</a>] Turkish</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2757">#2757</a>] Fixed
|
||||
a minor bug which causes selection positions to be improperly restored during undos
|
||||
and redos.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6.4 Beta</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2685">#2685</a>] Integration
|
||||
with "WebSpellChecker", a <strong>zero installation and free spell checker</strong>
|
||||
provided by SpellChecker.net. This is now the default spell checker in the editor
|
||||
(requires internet connection). All previous spell checking solutions are still
|
||||
available.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2430">#2430</a>] In the
|
||||
table dialog it's possible to create header cells in the first row (included in
|
||||
a thead element) or the first column of the table. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/822">#822</a>] The table
|
||||
cell dialog allows switching between normal data cells or header cells (TD vs. TH).
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2515">#2515</a>] New language
|
||||
file for Icelandic.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2381">#2381</a>] Protected
|
||||
the editor from duplicate iframes</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1752">#1752</a>] Fixed
|
||||
the issue with tablecommands plugin and undefined tagName.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2333">#2333</a>] The &gt;
|
||||
character inside text wasn't encoded in Opera and Safari.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2467">#2467</a>] Fixed
|
||||
JavaScript error with the fit window command in source mode.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2472">#2472</a>] Splitting
|
||||
a TH will create a two TH, not a TH and a TD.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1891">#1891</a>] Removed
|
||||
unnecessary name attributes in dialogs. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/798">#798</a>, <a target="_blank"
|
||||
href="http://dev.fckeditor.net/ticket/2495">#2495</a>] If an image was placed inside
|
||||
a container with dimensions or floating it wasn't possible to edit its properties
|
||||
from the toolbar or context menu.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1982">#1982</a>] Submenus
|
||||
in IE7 now are shown properly.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2496">#2496</a>] Using
|
||||
the Paste dialogs in IE might insert the content at the start of the editor.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2349">#2496</a>] Fixed
|
||||
RTL dialog layout in Internet Explorer.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2488">#2488</a>] Fixed
|
||||
the issue where email links in IE would take the browser to a new page in addition
|
||||
to calling up the email client.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2519">#2519</a>] Fixed
|
||||
race condition at registering the FCKeditorAPI object in multiple editor scenarios.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2525">#2525</a>] Fixed
|
||||
JavaScript error in Google Chrome when StartupShowBlocks is set to true.</li>
|
||||
<li>Language file updates for the following languages:
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2440">#2440</a>] Dutch</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2451">#2451</a>] Basque</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2451">#2650</a>] Danish</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2208">#2535</a>] German
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2531">#2531</a>] The ENTER
|
||||
key will properly scroll to the cursor position when breaking long paragraphs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2573">#2573</a>] The type
|
||||
name in configurations for the ASP connector are now case sensitive.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2503">#2503</a>] DL, DT
|
||||
and DD where missing the formatting in the generated HTML.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2516">#2516</a>] Replaced
|
||||
the extension AddItem of Array with the standard "push" method.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2486">#2486</a>] Vertically
|
||||
splitting cell with colspan > 1 breaks table layout.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2597">#2597</a>] Fixed
|
||||
the issue where dropping contents from outside of the editor doesn't work in Safari.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2412">#2412</a>] Fixed
|
||||
the issue where FCK.InsertHtml() is no longer removing selected contents after content
|
||||
insertion in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2407">#2407</a>] Fixed
|
||||
the issue where the Div container command and the blockquote command would break
|
||||
lists.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2469">#2469</a>] Fixed
|
||||
a minor issue where FCK.SetData() may cause the editor to become unresponsive to
|
||||
the first click after being defocused.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2611">#2611</a>] Fixed
|
||||
an extra slash on quickupload of the asp connector.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2616">#2616</a>] Fixed
|
||||
another situation where new elements were inserted at the beginning of the content
|
||||
in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2634">#2634</a>] Fixed
|
||||
two obsolete references to Array::AddItem() instances still in the code.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2679">#2679</a>] Fixed
|
||||
infinite loop problems with FCKDomRangeIterator class which causes some commands
|
||||
to hang when applied to certain document structures.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2649">#2649</a>] Fixed
|
||||
a JavaScript error in IE when user tries to search with the "Match whole word" option
|
||||
enabled and the matched word is at exactly the end of document.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2603">#2603</a>] Changed
|
||||
the <a href="http://docs.fckeditor.net/EMailProtection">EMailProtection</a> to "none"
|
||||
for better compatibility.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2612">#2612</a>] The 'ForcePasteAsPlainText'
|
||||
configuration option didn't work correctly in Safari and Chrome.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2696">#2696</a>] Fixed
|
||||
non-working autogrow plugin.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2753">#2753</a>] Fixed
|
||||
occasional exceptions in the dragersizetable plugin with IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2653">#2653</a>] and [<a
|
||||
target="_blank" href="http://dev.fckeditor.net/ticket/2733">#2733</a>] Enable undo
|
||||
of changes to tables and table cells.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1865">#1865</a>] The context
|
||||
menu is now working properly over the last row in a table with thead. Thanks to
|
||||
Koen Willems.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a href="_whatsnew_history.html">See previous versions history</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!--
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -32,6 +32,549 @@
|
||||
<body>
|
||||
<h1>
|
||||
FCKeditor ChangeLog - What's New?</h1>
|
||||
<h3>
|
||||
Version 2.6.3</h3>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2412">#2412</a>] FCK.InsertHtml()
|
||||
is now properly removing selected contents after content insertion in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2420">#2420</a>] Spelling
|
||||
mistake corrections made by the spell checking dialog are now undoable. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2411">#2411</a>] Insert
|
||||
anchor was not working for non-empty selections.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2426">#2426</a>] It was
|
||||
impossible to switch between editor areas with a single click.</li>
|
||||
<li>Language file updates for the following languages:
|
||||
<ul>
|
||||
<li>Canadian French</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2402">#2402</a>] Catalan
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2400">#2400</a>] Chinese
|
||||
(Simplified and Traditional)</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2401">#2401</a>] Croatian</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2422">#2422</a>] Czech</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2417">#2417</a>] Dutch</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2428">#2428</a>] French</li>
|
||||
<li>German</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2427">#2427</a>] Hebrew</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2410">#2410</a>] Hindi</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2405">#2405</a>] Japanese</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2409">#2409</a>] Norwegian
|
||||
and Norwegian Bokmål</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2429">#2429</a>] Spanish</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2406">#2406</a>] Vietnamese</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
This version has been sponsored by <a href="http://www.dataillusion.com/fs/">Data Illusion
|
||||
survey software solutions</a>.</p>
|
||||
<h3>
|
||||
Version 2.6.3 Beta</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/439">#439</a>] Added a
|
||||
new <strong>context menu option for opening links</strong> in the editor.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2220">#2220</a>] <strong>
|
||||
Email links</strong> from the Link dialog <strong>are now encoded</strong> by default
|
||||
to prevent being harvested by spammers. (Kudos to asuter for proposing the patch)
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2234">#2234</a>] Added
|
||||
the ability to create, modify and remove <strong>DIV containers</strong>. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2247">#2247</a>] The <strong>
|
||||
SHIFT+SPACE</strong> keystroke will now <strong>produce a &nbsp;</strong> character.
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2252">#2252</a>] It's
|
||||
now possible to enable the browsers default menu using the configuration file (FCKConfig.BrowserContextMenu
|
||||
option). </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2032">#2032</a>] Added
|
||||
HTML samples for legacy HTML and Flash HTML. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/234">#234</a>] Introduced
|
||||
the "PreventSubmitHandler" setting, which makes it possible to instruct the editor
|
||||
to not handle the hidden field update on form submit events.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2319">#2319</a>] On Opera
|
||||
and Firefox 3, the entire page was scrolling on SHIFT+ENTER, or when EnterMode='br'.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2321">#2321</a>] On Firefox
|
||||
3, the entire page was scrolling when inserting block elements with the FCK.InsertElement
|
||||
function, used by the Table and Horizontal Rule buttons.. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/692">#692</a>] Added some
|
||||
hints in editor/css/fck_editorarea.css on how to handle style items that would break
|
||||
the style combo. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2263">#2263</a>] Fixed
|
||||
a JavaScript error in IE which occurs when there are placeholder elements in the
|
||||
document and the user has pressed the Source button.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2314">#2314</a>] Corrected
|
||||
mixed up Chinese translations for the blockquote command.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2323">#2323</a>] Fixed
|
||||
the issue where the show blocks command loses the current selection from the view
|
||||
area when editing a long document.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2322">#2322</a>] Fixed
|
||||
the issue where the fit window command loses the current selection and scroll position
|
||||
in the editing area.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1917">#1917</a>] Fixed
|
||||
the issue where the merge down command for tables cells does not work in IE for
|
||||
more than two cells.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2320">#2320</a>] Fixed
|
||||
the issue where the Find/Replace dialog scrolls the entire page.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1645">#1645</a>] Added
|
||||
warning message about Firefox 3's strict origin policy.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2272">#2272</a>] Improved
|
||||
the garbage filter in Paste from Word dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2327">#2327</a>] Fixed
|
||||
invalid HTML in the Paste dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1907">#1907</a>] Fixed
|
||||
sporadic "FCKeditorAPI is not defined" errors in Firefox 3.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2356">#2356</a>] Fixed
|
||||
access denied error in IE7 when FCKeditor is launched from local filesystem.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1150">#1150</a>] Fixed
|
||||
the type="_moz" attribute that sometimes appear in <br> tags in non-IE browsers.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
|
||||
multiple contiguous paragraphs to Formatted will now be merged into a single <PRE>
|
||||
block.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2363">#2363</a>] There
|
||||
were some sporadic "Permission Denied" errors with IE on some situations.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2135">#2135</a>] Fixed
|
||||
a data loss bug in IE when there are @import statements in the editor's CSS files,
|
||||
and IE's cache is set to "Check for newer versions on every visit".</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2376">#2376</a>] FCK.InsertHtml()
|
||||
will now insert to the last selected position after the user has selected things
|
||||
outside of FCKeditor, in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2368">#2368</a>] Fixed
|
||||
broken protect source logic for comments in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2387">#2387</a>] Fixed
|
||||
JavaScript error with list commands when the editable document is selected with
|
||||
Ctrl-A.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2390">#2390</a>] Fixed
|
||||
the issue where indent styles in JavaScript-generated <p> blocks are erased
|
||||
in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2394">#2394</a>] Fixed
|
||||
JavaScript error with the "split vertically" command in IE when attempting to split
|
||||
cells in the last row of a table.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2316">#2316</a>] The sample
|
||||
posted data page has now the table fixed at 100% width. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2396">#2396</a>] SpellerPages
|
||||
was causing a "Permission Denied" error in some situations. </li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6.2</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2043">#2043</a>] The debug
|
||||
script is not any more part of the compressed files. If FCKeditor native debugging
|
||||
features (FCKDebug) are required, the _source folder must be present in your installation.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2248">#2248</a>] Calling
|
||||
FCK.InsertHtml( 'nbsp;') was inserting a plain space instead of a non breaking space
|
||||
character.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2273">#2273</a>] The dragresizetable
|
||||
plugin now works in Firefox 3 as well.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2254">#2254</a>] Minor
|
||||
fix in FCKSelection for nodeTagName object.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1614">#1614</a>] Unified
|
||||
FCKConfig.FullBasePath with FCKConfig.BasePath.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2127">#2127</a>] Changed
|
||||
floating dialogs to use fixed positioning so that they are no longer affected by
|
||||
scrolling.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2018">#2018</a>] Reversed
|
||||
the fix for <a target="_blank" href="http://dev.fckeditor.net/ticket/183">#183</a>
|
||||
which broke FCKeditorAPI's cleanup logic. A new configuration directive <strong>MsWebBrowserControlCompat</strong>
|
||||
has been added for those who wish to force the #183 fix to be enabled.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2276">#2276</a>] [<a
|
||||
target="_blank" href="http://dev.fckeditor.net/ticket/2279">#2279</a>] On Opera
|
||||
and Firefox 3, the entire page was scrolling on ENTER.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2149</a>] CSS urls
|
||||
with querystring parameters were not being accepted for CSS values in the configuration
|
||||
file (like EditorAreaCSS).</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] On some
|
||||
specific cases, with Firefox 2, some extra spacing was appearing in the final HTML
|
||||
on posting, if inserting two successive tables.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] Block
|
||||
elements (like tables or horizontal rules) will be inserted correctly now when the
|
||||
cursor is at the start or the end of blocks. No extra paragraphs will be included
|
||||
in this operation.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2197</a>] The TAB
|
||||
key will now have the default browser behavior if TabSpaces=0. It will move the
|
||||
focus out of the editor (expect on Safari).</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2296">#2296</a>] Fixed
|
||||
permission denied error on clicking on files in the file browser.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6.1</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2150">#2150</a>] The searching
|
||||
speed of the Find/Replace dialog has been vastly improved.</li>
|
||||
<li>New language file for <strong>Gujarati</strong> (by Nilam Doctor).</li>
|
||||
<li>A new TabIndex property has been added to the JavaScript integration files.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2215">#2215</a>] Following
|
||||
the above new feature, the ReplaceTextarea method will now copy the textarea.tabIndex
|
||||
value if available.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2163">#2163</a>] If the
|
||||
FCKConfig.DocType setting points to a HTML DocType then the output won't generate
|
||||
self-closing tags (it will output <img > instead of <img />).</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2173">#2173</a>] A throbber
|
||||
will be shown in the Quick Uploads.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2142">#2142</a>] HTML
|
||||
samples will now use sampleposteddata.php in action parameter inside a form.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/768">#768</a>] It is no
|
||||
longer possible for an image to have its width and height defined with both HTML
|
||||
attributes and inline CSS styles in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1426">#1426</a>] Fixed
|
||||
the error loading fckstyles.xml in servers which cannot return the correct content
|
||||
type header for .xml files.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2102">#2102</a>] Fixed
|
||||
FCKConfig.DocType which stopped working in FCKeditor 2.6.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2039">#2039</a>] Fixed
|
||||
the locking up issue in the Find/Replace dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2124">#2124</a>] PHP File
|
||||
Browser: fixed issue with resolving paths on Windows servers with PHP 5.2.4/5.2.5.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2059">#2059</a>] Fixed
|
||||
the error in the toolbar name in fckeditor.py.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2065">#2065</a>] Floating
|
||||
dialogs will now block the user from re-selecting the editing area by pressing Tab.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2114">#2114</a>] Added
|
||||
a workaround for an IE6 bug which causes floating dialogs to appear blank after
|
||||
opening it for the first time.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2136">#2136</a>] Fixed
|
||||
JavaScript error in IE when opening the bullet list properties dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1633">#1633</a>] External
|
||||
styles should no longer interfere with the appearance of the editor and floating
|
||||
panels now.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2113">#2113</a>] Fixed
|
||||
unneeded <span class="Apple-style-span"> created after inserting
|
||||
special characters.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2170">#2170</a>] Fixed
|
||||
Ctrl-Insert hotkey for copying.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2125">#2125</a>] Fixed
|
||||
the issue that FCK.InsertHtml() doesn't insert contents at the caret position when
|
||||
dialogs are opened in IE. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1764">#1764</a>] FCKeditor
|
||||
will no longer catch focus in IE on load when StartupFocus is false and the initial
|
||||
content is empty.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2126">#2126</a>] Opening
|
||||
and closing floating dialogs will no longer cause toolbar button states to become
|
||||
frozen.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2159">#2159</a>] Selection
|
||||
are now correctly restored when undoing changes made by the Replace dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2160">#2160</a>] "Match
|
||||
whole word" in the Find and Replace dialog will now find words next to punctuation
|
||||
marks as well.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2162">#2162</a>] If the
|
||||
configuration is set to work including the <head> (FullPage), references to
|
||||
stylesheets added by Firefox extensions won't be added to the output.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2168">#2168</a>] Comments
|
||||
won't generate new paragraphs in the output.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2184">#2184</a>] Fixed
|
||||
several validation errors in the File Browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed
|
||||
an IE issue where pressing backspace may merge a hyperlink on the previous line
|
||||
with the text on the current line.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1691">#1691</a>] Creation
|
||||
of links in Safari failed if there was no selection.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2188">#2188</a>] PreserveSessionOnFileBrowser
|
||||
is now removed as it was made obsolete with 2.6.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/898">#898</a>] The styles
|
||||
for the editing area are applied in the image preview dialog.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2056">#2056</a>] Fixed
|
||||
several validation errors in the dialogs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2063">#2063</a>] Fixed
|
||||
some problems in asp related to the use of network paths for the location of the
|
||||
uploaded files.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1593">#1593</a>] The "Sample
|
||||
Posted Data" page will now properly wrap the text.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2239">#2239</a>] The PHP
|
||||
code in sampleposteddata.php has been changed from "<?=" to "<? echo".</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2241">#2241</a>] Fixed
|
||||
404 error in floating panels when FCKeditor is installed to a different domain.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2066">#2066</a>] Added
|
||||
a workaround for a Mac Safari 3.1 browser bug which caused the Fit Window button
|
||||
to give a blank screen.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2218">#2218</a>] Improved
|
||||
Gecko based browser detection to accept Epiphany/Gecko as well.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2193">#2193</a>] Fixed
|
||||
the issue where the caret cannot reach the last character of a paragraph in Opera
|
||||
9.50.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2264">#2264</a>] Fixed
|
||||
empty spaces that appear at the top of the editor in Opera 9.50.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2238">#2238</a>] The <object>
|
||||
placeholder was not being properly displayed in the compressed distribution version
|
||||
and nightly builds.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2115">#2115</a>] Fixed
|
||||
JavaScript (permission denied) error in Firefox when file has been uploaded.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6</h3>
|
||||
<p>
|
||||
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
|
||||
<h3>
|
||||
Version 2.6 RC</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
|
||||
object can now be used to access all FCKeditor instances available in the page.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
|
||||
style="color: #ff0000">Attention:</span> By default, the editor now produces <strong>
|
||||
and <em> instead of <b> and <i>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog
|
||||
close button is now correctly positioned in IE in RTL languages.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder
|
||||
dialog will now display the placeholder value correctly in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing
|
||||
Enter or typing after a placeholder with the placeholder plugin will no longer generate
|
||||
colored text.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed
|
||||
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
|
||||
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed
|
||||
permission denied errors during opening popup menus in IE6 under domain relaxation
|
||||
mode.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
|
||||
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
|
||||
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
|
||||
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
|
||||
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
|
||||
Fixed XHTML source formatting errors in non-IE browsers.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
|
||||
character is now properly encoded in file names returned by the File Browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
|
||||
and file names are now properly sanitized against control characters. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
|
||||
character is now disallowed in current folder path.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
|
||||
logic to override JavaScript errors occurring inside the editing frame due to user
|
||||
added JavaScript code.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
|
||||
ENTER on list items containing block elements will now create new list item elements,
|
||||
instead of adding further blocks to the same list item.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
|
||||
only combos now get properly grayed out when moving to source view.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
|
||||
an important bug regarding styles removal on styled text boundaries, introduced
|
||||
with the 2.6 Beta 1. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
|
||||
CSS <style> tags where being outputted when FullPage=true.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
|
||||
dialog now properly selects the first field when opening it to modify mailto or
|
||||
anchor links. This problem was also throwing an error in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
|
||||
will no longer remain behind in the editing area when the placeholder dialog is
|
||||
opened.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
|
||||
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
|
||||
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
|
||||
the issue where context menus sometimes don't disappear after selecting an option.
|
||||
</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed
|
||||
JavaScript error when EnterMode=br and user tries to insert a page break.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed
|
||||
the issue where the maximize editor button does not vertically expand the editing
|
||||
area in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
|
||||
fixed filename encoding problems in file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
|
||||
FCK.InsertHtml() in non-IE browsers would now activate the document processor as
|
||||
expected.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
|
||||
XMLHttpRequest class is now used in IE, whenever it is available.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
|
||||
the browser was able to enter in an infinite loop when working with multiple editors
|
||||
in the same page. </li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
|
||||
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
|
||||
having problems with SpellerPages, causing some errors to be thrown when completing
|
||||
the spell checking in some situations.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
|
||||
command was throwing an error if executed in an editor where its relative button
|
||||
is not present in the toolbar.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
|
||||
a generic document processor for <OBJECT> and <EMBED> tags.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
|
||||
the issue where the placeholder icon for <EMBED> tags does not always show
|
||||
up in IE7.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
|
||||
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
|
||||
the caret will not any more move to the previous line when selecting a Format style
|
||||
inside an empty paragraph.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
|
||||
dialogs using API calls which deals with the selection, like InsertHtml now can
|
||||
be sure the selection will be placed in the correct position.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
|
||||
IE, the first character of table captions where being lost on table creation.</li>
|
||||
<li>The selection and cursor position was not being properly handled when creating some
|
||||
elements like forms and tables.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
|
||||
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2208">#2208</a>] Added
|
||||
missing translations in Italian language file.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2096">#2096</a>] Added
|
||||
the codepage to basexml file. Filenames with special chars should now display properly.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.6 Beta 1</h3>
|
||||
<p>
|
||||
New Features and Improvements:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New
|
||||
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers
|
||||
and enhancing the editor usability.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong>
|
||||
Adobe AIR</strong> compatibility.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support
|
||||
for <strong>document.domain</strong> with automatic domain detection.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong>
|
||||
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS
|
||||
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS,
|
||||
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|<minified
|
||||
CSS styles". All internal CSS links are already using this feature. </li>
|
||||
<li>New language file for <strong>Canadian French</strong>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved
|
||||
several "strict warning" messages in Firefox when running FCKeditor.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER
|
||||
key will now work properly in IE with the cursor at the start of a formatted block.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's
|
||||
possible to define in the Styles that a Style (with an empty class) must be shown
|
||||
selected only when no class is present in the current element, and selecting that
|
||||
item will clear the current class (it does apply to any attribute, not only classes).</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars
|
||||
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden
|
||||
div.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned
|
||||
<li> elements now get properly enclosed in a <ul> on output.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER
|
||||
key will not any more break <button> elements at the beginning of paragraphs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor
|
||||
was not loading on a specific unknown situation. The breaking point has been removed.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor
|
||||
no longer hangs when operating on documents imported from Microsoft Word.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating
|
||||
panels attached to a shared toolbar among multiple FCKeditor instances are no longer
|
||||
misplaced when the editing areas are absolutely or relatively positioned.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog
|
||||
is now enforced only when ForcePasteAsPlainText = true.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes
|
||||
the autogrow plugin didn't work properly in Firefox.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External
|
||||
toolbars are now properly sized in Opera.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking
|
||||
on radio buttons or checkboxes in the editor in IE will no longer cause lockups
|
||||
in IE.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes
|
||||
commands where executed even if the command itself was disabled.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button
|
||||
to empty the box in the "Paste from Word" has been removed as it leads to confusion
|
||||
for some users.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing
|
||||
control elements in Firefox, Opera and Safari now works properly.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor
|
||||
was surrounded by a <div> element that wasn't really needed.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form
|
||||
control was moved in IE after creating it, then it did lose its name.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't
|
||||
possible to change the type of an existing button.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation
|
||||
now works inside table cells.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor
|
||||
was entering on looping on some specific cases when dealing with invalid source
|
||||
markup.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting
|
||||
text into the "Find what" fields in the Find and Replace dialog would now activate
|
||||
the find and replace buttons.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace
|
||||
dialog will no longer display wrong starting positions for the match when there
|
||||
are multiple and identical characters preceding the character at the real starting
|
||||
point of the match.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
|
||||
a JavaScript error which occurs in the Find/Replace dialog when the user presses
|
||||
"Find" or "Replace" after the "No match found" message has appeared.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
|
||||
breaks and spaces are now conserved when converting to and from the "Formatted"
|
||||
format.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
|
||||
the background color behind smiley icons and special characters in their corresponding
|
||||
dialogs.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
|
||||
error messages are now properly displayed in the file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
|
||||
and value fields in the selection box dialog will no longer extend beyond the dialog
|
||||
limits when the user inputs a very long text or value for one of the selection options.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
|
||||
issue where pressing Enter in an <o:p> tag in IE does not generate line breaks.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
|
||||
issue where the image preview in image dialog sometimes doesn't display after selecting
|
||||
the image from server browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
|
||||
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
|
||||
of depreciated "var").</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
|
||||
removed closing tag: "?>", so no additional whitespace added when files are included.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
|
||||
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
|
||||
browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
|
||||
file browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
|
||||
file browser: permissions applied with the chmod command are now configurable.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
|
||||
integration: fixed issues with setting the editor height.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
|
||||
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
|
||||
returning an empty string.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
|
||||
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
|
||||
in IE will no longer turn the preceding normal whitespace into &nbsp;.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
|
||||
method now has an additional fifth parameter "customData" that will be sent to the
|
||||
Execute method of the command for that menu item, allowing a single command to be
|
||||
used for different menu items..</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
|
||||
command now also removes the attributes from the cleaned text. The list of attributes
|
||||
is configurable with FCKConfig.RemoveAttributes.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
|
||||
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
|
||||
warning message on Copy and Cut operation failure on IE due to paste permission
|
||||
settings.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
|
||||
to file browser has been changed to avoid requests containing double dots.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
|
||||
multiple contiguous paragraphs to Formatted will now be merged into a single <PRE>
|
||||
block.</li>
|
||||
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
|
||||
failed to load from local filesystem in IE7.</li>
|
||||
</ul>
|
||||
<h3>
|
||||
Version 2.5.1</h3>
|
||||
<p>
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -89,6 +89,9 @@ FCKContextMenu.prototype.AttachToElement = function( element )
|
||||
|
||||
function FCKContextMenu_Document_OnContextMenu( e )
|
||||
{
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var el = e.target ;
|
||||
|
||||
while ( el )
|
||||
@@ -114,6 +117,9 @@ function FCKContextMenu_Document_OnMouseDown( e )
|
||||
if( !e || e.button != 2 )
|
||||
return false ;
|
||||
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var el = e.target ;
|
||||
|
||||
while ( el )
|
||||
@@ -145,6 +151,9 @@ function FCKContextMenu_Document_OnMouseDown( e )
|
||||
|
||||
function FCKContextMenu_Document_OnMouseUp( e )
|
||||
{
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var overrideButton = FCKContextMenu_OverrideButton ;
|
||||
|
||||
if ( overrideButton )
|
||||
@@ -164,7 +173,7 @@ function FCKContextMenu_Document_OnMouseUp( e )
|
||||
|
||||
function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
|
||||
{
|
||||
if ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) )
|
||||
if ( ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) || FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var eTarget = el || this ;
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -39,6 +39,13 @@ FCKDocumentFragment.prototype =
|
||||
targetNode.appendChild( this.RootNode ) ;
|
||||
},
|
||||
|
||||
AppendHtml : function( html )
|
||||
{
|
||||
var eTmpDiv = this.RootNode.ownerDocument.createElement( 'div' ) ;
|
||||
eTmpDiv.innerHTML = html ;
|
||||
FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
|
||||
},
|
||||
|
||||
InsertAfterNode : function( existingNode )
|
||||
{
|
||||
FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ;
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -41,7 +41,6 @@ FCKDomRange.prototype =
|
||||
{
|
||||
// For text nodes, the node itself is the StartNode.
|
||||
var eStart = innerRange.startContainer ;
|
||||
var eEnd = innerRange.endContainer ;
|
||||
|
||||
var oElementPath = new FCKElementPath( eStart ) ;
|
||||
this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ;
|
||||
@@ -49,28 +48,40 @@ FCKDomRange.prototype =
|
||||
this.StartBlock = oElementPath.Block ;
|
||||
this.StartBlockLimit = oElementPath.BlockLimit ;
|
||||
|
||||
if ( eStart != eEnd )
|
||||
oElementPath = new FCKElementPath( eEnd ) ;
|
||||
|
||||
// The innerRange.endContainer[ innerRange.endOffset ] is not
|
||||
// usually part of the range, but the marker for the range end. So,
|
||||
// let's get the previous available node as the real end.
|
||||
var eEndNode = eEnd ;
|
||||
if ( innerRange.endOffset == 0 )
|
||||
if ( innerRange.collapsed )
|
||||
{
|
||||
while ( eEndNode && !eEndNode.previousSibling )
|
||||
eEndNode = eEndNode.parentNode ;
|
||||
|
||||
if ( eEndNode )
|
||||
eEndNode = eEndNode.previousSibling ;
|
||||
this.EndNode = this.StartNode ;
|
||||
this.EndContainer = this.StartContainer ;
|
||||
this.EndBlock = this.StartBlock ;
|
||||
this.EndBlockLimit = this.StartBlockLimit ;
|
||||
}
|
||||
else if ( eEndNode.nodeType == 1 )
|
||||
eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
|
||||
else
|
||||
{
|
||||
var eEnd = innerRange.endContainer ;
|
||||
|
||||
this.EndNode = eEndNode ;
|
||||
this.EndContainer = eEnd ;
|
||||
this.EndBlock = oElementPath.Block ;
|
||||
this.EndBlockLimit = oElementPath.BlockLimit ;
|
||||
if ( eStart != eEnd )
|
||||
oElementPath = new FCKElementPath( eEnd ) ;
|
||||
|
||||
// The innerRange.endContainer[ innerRange.endOffset ] is not
|
||||
// usually part of the range, but the marker for the range end. So,
|
||||
// let's get the previous available node as the real end.
|
||||
var eEndNode = eEnd ;
|
||||
if ( innerRange.endOffset == 0 )
|
||||
{
|
||||
while ( eEndNode && !eEndNode.previousSibling )
|
||||
eEndNode = eEndNode.parentNode ;
|
||||
|
||||
if ( eEndNode )
|
||||
eEndNode = eEndNode.previousSibling ;
|
||||
}
|
||||
else if ( eEndNode.nodeType == 1 )
|
||||
eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
|
||||
|
||||
this.EndNode = eEndNode ;
|
||||
this.EndContainer = eEnd ;
|
||||
this.EndBlock = oElementPath.Block ;
|
||||
this.EndBlockLimit = oElementPath.BlockLimit ;
|
||||
}
|
||||
}
|
||||
|
||||
this._Cache = {} ;
|
||||
@@ -458,13 +469,13 @@ FCKDomRange.prototype =
|
||||
// Also note that the node that we use for "address base" would change during backtracking.
|
||||
var addrStart = this._Range.startContainer ;
|
||||
var addrEnd = this._Range.endContainer ;
|
||||
while ( curStart && curStart.nodeType == 3 )
|
||||
while ( curStart && curStart.nodeType == 3 && addrStart.nodeType == 3 )
|
||||
{
|
||||
bookmark.Start[0] += curStart.length ;
|
||||
addrStart = curStart ;
|
||||
curStart = curStart.previousSibling ;
|
||||
}
|
||||
while ( curEnd && curEnd.nodeType == 3 )
|
||||
while ( curEnd && curEnd.nodeType == 3 && addrEnd.nodeType == 3 )
|
||||
{
|
||||
bookmark.End[0] += curEnd.length ;
|
||||
addrEnd = curEnd ;
|
||||
@@ -863,6 +874,12 @@ FCKDomRange.prototype =
|
||||
this.ExtractContents().AppendTo( oFixedBlock ) ;
|
||||
FCKDomTools.TrimNode( oFixedBlock ) ;
|
||||
|
||||
// If the fixed block is empty (not counting bookmark nodes)
|
||||
// Add a <br /> inside to expand it.
|
||||
if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
|
||||
&& FCKBrowserInfo.IsGeckoLike )
|
||||
FCKTools.AppendBogusBr( oFixedBlock ) ;
|
||||
|
||||
// Insert the fixed block into the DOM.
|
||||
this.InsertNode( oFixedBlock ) ;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -136,7 +136,7 @@ FCKDomRangeIterator.prototype =
|
||||
// The found boundary must be set as the next one at this
|
||||
// point. (#1717)
|
||||
if ( nodeName != 'br' )
|
||||
this._NextNode = currentNode ;
|
||||
this._NextNode = FCKDomTools.GetNextSourceNode( currentNode, true, null, lastNode ) || currentNode ;
|
||||
}
|
||||
|
||||
closeRange = true ;
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -96,11 +96,11 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
|
||||
var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ;
|
||||
|
||||
oIFrame.frameBorder = 0 ;
|
||||
oIFrame.width = oIFrame.height = '100%' ;
|
||||
oIFrame.style.width = oIFrame.style.height = '100%' ;
|
||||
|
||||
if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
|
||||
{
|
||||
window._FCKHtmlToLoad = sOverrideError + html ;
|
||||
window._FCKHtmlToLoad = html.replace( /<head>/i, '<head>' + sOverrideError ) ;
|
||||
oIFrame.src = 'javascript:void( (function(){' +
|
||||
'document.open() ;' +
|
||||
'document.domain="' + document.domain + '" ;' +
|
||||
@@ -132,7 +132,7 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
|
||||
var oDoc = this.Window.document ;
|
||||
|
||||
oDoc.open() ;
|
||||
oDoc.write( sOverrideError + html ) ;
|
||||
oDoc.write( html.replace( /<head>/i, '<head>' + sOverrideError ) ) ;
|
||||
oDoc.close() ;
|
||||
}
|
||||
|
||||
@@ -150,18 +150,23 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
|
||||
if ( oIFrame.readyState && oIFrame.readyState != 'completed' )
|
||||
{
|
||||
var editArea = this ;
|
||||
( oIFrame.onreadystatechange = function()
|
||||
{
|
||||
if ( oIFrame.readyState == 'complete' )
|
||||
{
|
||||
oIFrame.onreadystatechange = null ;
|
||||
editArea.Window._FCKEditingArea = editArea ;
|
||||
FCKEditingArea_CompleteStart.call( editArea.Window ) ;
|
||||
}
|
||||
// It happened that IE changed the state to "complete" after the
|
||||
// "if" and before the "onreadystatechange" assignement, making we
|
||||
// lost the event call, so we do a manual call just to be sure.
|
||||
} )() ;
|
||||
|
||||
// Using a IE alternative for DOMContentLoaded, similar to the
|
||||
// solution proposed at http://javascript.nwbox.com/IEContentLoaded/
|
||||
setTimeout( function()
|
||||
{
|
||||
try
|
||||
{
|
||||
editArea.Window.document.documentElement.doScroll("left") ;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
setTimeout( arguments.callee, 0 ) ;
|
||||
return ;
|
||||
}
|
||||
editArea.Window._FCKEditingArea = editArea ;
|
||||
FCKEditingArea_CompleteStart.call( editArea.Window ) ;
|
||||
}, 0 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,6 +251,7 @@ FCKEditingArea.prototype.MakeEditable = function()
|
||||
if ( this._BodyHTML )
|
||||
{
|
||||
oDoc.body.innerHTML = this._BodyHTML ;
|
||||
oDoc.body.offsetLeft ; // Don't remove, this is a hack to fix Opera 9.50, see #2264.
|
||||
this._BodyHTML = null ;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -43,17 +43,21 @@ var FCKEnterKey = function( targetWindow, enterMode, shiftEnterMode, tabSpaces )
|
||||
oKeystrokeHandler.SetKeystrokes( [
|
||||
[ 13 , 'Enter' ],
|
||||
[ SHIFT + 13, 'ShiftEnter' ],
|
||||
[ 9 , 'Tab' ],
|
||||
[ 8 , 'Backspace' ],
|
||||
[ CTRL + 8 , 'CtrlBackspace' ],
|
||||
[ CTRL + 8 , 'CtrlBackspace' ],
|
||||
[ 46 , 'Delete' ]
|
||||
] ) ;
|
||||
|
||||
if ( tabSpaces > 0 )
|
||||
this.TabText = '' ;
|
||||
|
||||
// Safari by default inserts 4 spaces on TAB, while others make the editor
|
||||
// loose focus. So, we need to handle it here to not include those spaces.
|
||||
if ( tabSpaces > 0 || FCKBrowserInfo.IsSafari )
|
||||
{
|
||||
this.TabText = '' ;
|
||||
while ( tabSpaces-- > 0 )
|
||||
while ( tabSpaces-- )
|
||||
this.TabText += '\xa0' ;
|
||||
|
||||
oKeystrokeHandler.SetKeystrokes( [ 9, 'Tab' ] );
|
||||
}
|
||||
|
||||
oKeystrokeHandler.AttachToElement( targetWindow.document ) ;
|
||||
@@ -163,6 +167,28 @@ FCKEnterKey.prototype.DoBackspace = function()
|
||||
return false ;
|
||||
}
|
||||
|
||||
// On IE, it is better for us handle the deletion if the caret is preceeded
|
||||
// by a <br> (#1383).
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
{
|
||||
var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ;
|
||||
|
||||
if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' )
|
||||
{
|
||||
// Create a range that starts after the <br> and ends at the
|
||||
// current range position.
|
||||
var testRange = oRange.Clone() ;
|
||||
testRange.SetStart( previousElement, 4 ) ;
|
||||
|
||||
// If that range is empty, we can proceed cleaning that <br> manually.
|
||||
if ( testRange.CheckIsEmpty() )
|
||||
{
|
||||
previousElement.parentNode.removeChild( previousElement ) ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var oStartBlock = oRange.StartBlock ;
|
||||
var oEndBlock = oRange.EndBlock ;
|
||||
|
||||
@@ -504,10 +530,28 @@ FCKEnterKey.prototype._ExecuteEnterBlock = function( blockTag, range )
|
||||
oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ;
|
||||
}
|
||||
|
||||
if ( FCKBrowserInfo.IsSafari )
|
||||
FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
|
||||
else if ( FCKBrowserInfo.IsGeckoLike )
|
||||
( eNextBlock || eNewBlock ).scrollIntoView( false ) ;
|
||||
if ( FCKBrowserInfo.IsGeckoLike )
|
||||
{
|
||||
if ( eNextBlock )
|
||||
{
|
||||
// If we have split the block, adds a temporary span at the
|
||||
// range position and scroll relatively to it.
|
||||
var tmpNode = this.Window.document.createElement( 'span' ) ;
|
||||
|
||||
// We need some content for Safari.
|
||||
tmpNode.innerHTML = ' ';
|
||||
|
||||
oRange.InsertNode( tmpNode ) ;
|
||||
FCKDomTools.ScrollIntoView( tmpNode, false ) ;
|
||||
oRange.DeleteContents() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We may use the above scroll logic for the new block case
|
||||
// too, but it gives some weird result with Opera.
|
||||
FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
oRange.Select() ;
|
||||
}
|
||||
@@ -590,10 +634,7 @@ FCKEnterKey.prototype._ExecuteEnterBr = function( blockTag )
|
||||
|
||||
eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ;
|
||||
|
||||
if ( FCKBrowserInfo.IsSafari )
|
||||
FCKDomTools.ScrollIntoView( dummy, false ) ;
|
||||
else
|
||||
dummy.scrollIntoView( false ) ;
|
||||
FCKDomTools.ScrollIntoView( dummy, false ) ;
|
||||
|
||||
dummy.parentNode.removeChild( dummy ) ;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -71,7 +71,7 @@ FCKHtmlIterator.prototype =
|
||||
} ;
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||