2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Merging the Limesurvey 1.91+ branch of queXS in to the trunk

This commit is contained in:
azammitdcarf
2011-09-08 01:58:41 +00:00
parent dfa55a3b9e
commit eaa9578ab8
2312 changed files with 811461 additions and 597534 deletions

View File

@@ -1,313 +1,313 @@
body, html{
margin: 0;
padding: 0;
height: 100%;
border: none;
overflow: hidden;
background-color: #FFF;
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;
body,html,table,form,textarea {
font: 12px monospace, sans-serif;
}
#editor{
border: solid #D2E0F2 1px;
overflow: hidden;
#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 {
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;
#result.empty {
overflow: hidden;
}
#container{
overflow: hidden;
border: solid blue 0;
position: relative;
z-index: 10;
padding: 0 5px 0 45px;
/*padding-right: 5px;*/
#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 {
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 */
#textarea,#textarea:hover {
outline: none; /* safari outline fix */
}
#content_highlight{
white-space: pre;
margin: 0;
padding: 0;
position : absolute;
z-index: 4;
overflow: visible;
#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,#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;
z-index: 3;
background-color: #EDF9FC;
}
#selection_field strong{
font-weight:normal;
#selection_field strong {
font-weight: normal;
}
#selection_field.show_colors *, #selection_field_text * {
visibility: hidden;
#selection_field.show_colors *,#selection_field_text * {
visibility: hidden;
}
#selection_field_text{
background-color:transparent;
#selection_field_text {
background-color: transparent;
}
#selection_field_text strong{
font-weight:normal;
background-color:#3399FE;
color: #FFF;
visibility:visible;
#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%;
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;
#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;
#test_font_size {
padding: 0;
margin: 0;
visibility: hidden;
position: absolute;
white-space: pre;
}
pre{
margin: 0;
padding: 0;
pre {
margin: 0;
padding: 0;
}
.hidden{
opacity: 0.2;
filter:alpha(opacity=20);
.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_cursor {
position: absolute;
z-index: 6;
background-color: #FF6633;
top: -100px;
margin: 0;
}
#result .edit_area_selection_field .overline{
background-color: #996600;
#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 {
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,.editarea_popup table {
font-family: sans-serif;
font-size: 10pt;
}
.editarea_popup img{
border: 0;
.editarea_popup img {
border: 0;
}
.editarea_popup .close_popup{
float: right;
line-height: 16px;
border: 0;
padding: 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;
margin: 0;
padding: 0;
}
.editarea_popup .copyright{
text-align: right;
}
.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 img {
border: 0;
}
div#area_search_replace div.button{
text-align: center;
line-height: 1.7em;
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 .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;
background-color: #EDEDED;
}
div#area_search_replace #move_area_search_replace{
cursor: move;
border: solid 1px #888;
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 #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;
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 {
width: 350px;
}
#edit_area_help div.close_popup{
float: right;
#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;
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,.area_toolbar table {
font: 11px sans-serif;
}
.area_toolbar img{
border: 0;
vertical-align: middle;
.area_toolbar img {
border: 0;
vertical-align: middle;
}
.area_toolbar input{
margin: 0;
padding: 0;
.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;
.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%;
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.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.total {
text-align: right;
width: 50px;
padding: 0;
}
.area_toolbar td.resize{
text-align: right;
.area_toolbar td.resize {
text-align: right;
}
/*
.area_toolbar span{
@@ -316,215 +316,215 @@ table.statusbar{
margin: 0;
}*/
.area_toolbar span#resize_area{
cursor: nw-resize;
visibility: hidden;
.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;
margin-top: 0;
margin-left: 1px;
padding: 0;
}
.editAreaButtonNormal {
border: 1px solid #EEF6FF !important;
cursor: pointer;
border: 1px solid #EEF6FF !important;
cursor: pointer;
}
.editAreaButtonOver {
border: 1px solid #0A246A !important;
cursor: pointer;
background-color: #B6BDD2;
border: 1px solid #0A246A !important;
cursor: pointer;
background-color: #B6BDD2;
}
.editAreaButtonDown {
cursor: pointer;
border: 1px solid #0A246A !important;
background-color: #8592B5;
cursor: pointer;
border: 1px solid #0A246A !important;
background-color: #8592B5;
}
.editAreaButtonSelected {
border: 1px solid #C0C0BB !important;
cursor: pointer;
background-color: #F4F2E8;
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;
-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;
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 {
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;
#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_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;
padding: 0;
margin: 0;
list-style-type: none;
white-space: nowrap;
}
#tab_browsing_list li {
float: left;
margin: -1px;
float: left;
margin: -1px;
}
#tab_browsing_list a {
position: relative;
display: block;
text-decoration: none;
float: left;
cursor: pointer;
line-height:14px;
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 */
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;
display: block;
border-bottom: 2px solid #617994;
}
#tab_browsing_list a .edited {
display: none;
display: none;
}
#tab_browsing_list a.edited .edited {
display: inline;
display: inline;
}
#tab_browsing_list a img{
margin-left: 7px;
#tab_browsing_list a img {
margin-left: 7px;
}
#tab_browsing_list a.edited img{
margin-left: 3px;
#tab_browsing_list a.edited img {
margin-left: 3px;
}
#tab_browsing_list a:hover span {
background: #F4F2E8;
border-color: #0A246A;
background: #F4F2E8;
border-color: #0A246A;
}
#tab_browsing_list .selected a span{
background: #046380;
color: #FFF;
#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;
#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;
border-width: 0 1px;
}
.non_editable .area_toolbar
{
display: none;
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;
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;
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 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;
margin: 0;
padding: 0;
list-style: none inside;
}
#auto_completion_area li
{
padding: 0;
padding: 0;
}
#auto_completion_area .prefix
{
font-style: italic;
padding: 0 3px;
font-style: italic;
padding: 0 3px;
}

View File

@@ -118,7 +118,8 @@
option.value= syntax;
if(syntax==s['syntax'])
option.selected= "selected";
option.innerHTML= t.get_translation("syntax_" + syntax, "word");
dispSyntax = parent.editAreaLoader.syntax_display_name[ syntax ];
option.innerHTML= typeof( dispSyntax ) == 'undefined' ? syntax.substring( 0, 1 ).toUpperCase() + syntax.substring( 1 ) : dispSyntax;//t.get_translation("syntax_" + syntax, "word");
syntax_selec.appendChild(option);
}
}
@@ -226,6 +227,7 @@
if( t.isSafari ){
t.editor_area.style.position = "absolute";
if( t.isSafari < 5)
a.style.marginLeft ="-3px";
if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
a.style.marginTop ="1px";
@@ -381,9 +383,10 @@
this.line_number++;
}
destDiv.innerHTML= destDiv.innerHTML + newLines;
if(this.settings['word_wrap']){
this.fixLinesHeight( this.textarea.value, start, -1 );
}
}
//4) be sure the text is well displayed
this.textarea.scrollTop="0px";
@@ -523,3 +526,5 @@
function init(){
setTimeout("editArea.init(); ", 10);
};

View File

@@ -1,217 +1,237 @@
<?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);
}
}
/******
*
* EditArea PHP compressor
* Developped by Christophe Dolivet
* Released under LGPL, Apache and BSD licenses
* v1.1.3 (2007/01/18)
*
******/
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);
// 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
$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)
$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);
// replace languages names
$reg_path= $this->path."reg_syntax/";
$a_displayName = array();
if (($dir = @opendir($reg_path)) !== false)
{
$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)
{
while (($file = readdir($dir)) !== false)
if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false )
{
if ($file !== "." && $file !== "..")
$jsContent = $this->file_get_contents( $reg_path.$file );
if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) )
{
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
$sub_scripts_list[]= "plugins/".$file."/".$file.".js";
$a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'";
}
}
closedir($dir);
}
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',
$loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $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',
@@ -224,185 +244,185 @@
'Ë' => '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."[];";
}
'Î' => '"',
'Ï' => "\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";
/* 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);
}
}
// 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);
}
}
?>

File diff suppressed because one or more lines are too long

View File

@@ -646,7 +646,7 @@
t.scroll_to_view();
t.focus();
}else{
setTimeout("p.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
setTimeout("parent.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
}
@@ -795,8 +795,7 @@
// open a new tab for the given file
EditArea.prototype.set_word_wrap= function(to){
var t=this, a= t.textarea;
if( t.isOpera )
if( t.isOpera && t.isOpera < 9.8 )
{
this.settings['word_wrap']= false;
t.switchClassSticky( _$("word_wrap"), 'editAreaButtonDisabled', true );
@@ -1072,7 +1071,7 @@
t.set_font(new_file['font_family'], new_file['font_size']);
// restore selection and scroll
t.area_select(new_file['last_selection']['selection_start'], new_file['last_selection']['selection_end'] - new_file['last_selection']['selection_start']);
t.area_select(new_file['selection_start'], new_file['selection_end'] - new_file['selection_start']);
t.manage_size(true);
t.result.scrollTop= new_file['scroll_top'];
t.result.scrollLeft= new_file['scroll_left'];

View File

@@ -8,7 +8,7 @@
function EditAreaLoader(){
var t=this;
t.version= "0.8.1.1";
t.version= "0.8.2";
date= new Date();
t.start_time=date.getTime();
t.win= "loading"; // window loading state
@@ -24,6 +24,7 @@ function EditAreaLoader(){
// scripts that must be loaded in the iframe
t.scripts_to_load= ["elements_functions", "resize_area", "reg_syntax"];
t.sub_scripts_to_load= ["edit_area", "manage_area" ,"edit_area_functions", "keyboard", "search_replace", "highlight", "regexp"];
t.syntax_display_name= { /*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/ };
t.resize= []; // contain resizing datas
t.hidden= {}; // store datas of the hidden textareas
@@ -347,7 +348,7 @@ EditAreaLoader.prototype ={
}
// get toolbar content
area=editAreas[id];
var area=editAreas[id];
for(i=0; i<area["settings"]["tab_toolbar"].length; i++){
// alert(this.tab_toolbar[i]+"\n"+ this.get_control_html(this.tab_toolbar[i]));
@@ -598,7 +599,7 @@ EditAreaLoader.prototype ={
for( i=0; i<elems.length; i++ ){
if (elems[i].src && elems[i].src.match(/edit_area_[^\\\/]*$/i) ) {
var src = elems[i].src;
var src = unescape( elems[i].src ); // use unescape for utf-8 encoded urls
src = src.substring(0, src.lastIndexOf('/'));
this.baseURL = src;
this.file_name= elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);

View File

@@ -230,7 +230,7 @@
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
if( nav.isOpera && nav.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
t.selectionEnd = 1;
t.selectionStart = 0;
t.selectionEnd = 1;
@@ -240,7 +240,7 @@
t.selectionEnd = end;
//textarea.setSelectionRange(start, end);
if(isIE)
if(nav.isIE)
set_IE_selection(t);
};
@@ -299,7 +299,10 @@
}
catch(e){}
}
if( t && t.id )
{
setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
}
};
function IE_textarea_focus(){

View File

@@ -186,7 +186,9 @@
* The goal here will be to find the text node concerned by the modification and to update it
*/
//-------------------------------------------
//
// disable latest optimization tricks (introduced in 0.8.1 and removed in 0.8.2), TODO: check for another try later
doSyntaxOpti = doHtmlOpti = false;
if( doSyntaxOpti )
{
try
@@ -207,12 +209,11 @@
{
}
nbEnd = i;
//console.log( nbStart, nbEnd, replacedBloc, updated_highlight );
// 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 )
@@ -220,6 +221,8 @@
var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
doHtmlOpti = true;
beginStr = t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
// fix special chars
newHtml = newHtml.replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&');
nbOpendedSpan = beginStr.split('<span').length - 1;
nbClosedSpan = beginStr.split('</span').length - 1;
@@ -313,11 +316,23 @@
// update the textNode content
// number of caracters after the last opened of closed span
nbUnchangedChars = beginStr.length - Math.max( 0, beginStr.lastIndexOf( '>' ) + 1 );
//nbUnchangedChars = ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 ? beginStr.length : beginStr.length - ( lastIndex + 1 );
//nbUnchangedChars = ? beginStr.length : beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
if( ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 )
{
nbUnchangedChars = beginStr.length;
}
else
{
nbUnchangedChars = beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
//nbUnchangedChars += beginStr.substr( ).replace( /&/g, '&amp;').replace( /</g, '&lt;').replace( />/g, '&gt;').length - beginStr.length;
}
//alert( nbUnchangedChars );
// 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 );
// console.log( nbUnchangedChars, lastIndex, beginStr.length, beginStr.replace(/&/g, '&amp;'), lastHtml.length, '|', newHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/g, 'r'), lastHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/, 'r') );
// console.log( textNode.data.replace(/&/g, '&amp;') );
// IE only manage \r for cariage return in textNode and not \n or \r\n
if( t.isIE )
{
@@ -341,6 +356,7 @@
}
}
/*** END HTML update's optimisation ***/
// end test

View File

@@ -27,10 +27,10 @@ function keyDown(e){
var low_letter= letter.toLowerCase();
if(letter=="Page up" && !editArea.isOpera){
if(letter=="Page up" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
use=true;
}else if(letter=="Page down" && !editArea.isOpera){
}else if(letter=="Page down" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
use=true;
}else if(editArea.is_editable==false){

View File

@@ -50,24 +50,5 @@ 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: "Затвори файла"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ esc: "Esk",
processing: "&#349;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"
};

View File

@@ -44,21 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ esc: "Esc",
processing: "chargement...",
fullscreen: "plein &eacute;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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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: "Избери датотека"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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: "Закрыть файл"
};

View File

@@ -44,24 +44,5 @@ 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"
};

View File

@@ -44,24 +44,5 @@ 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: "关闭文件"
};

View File

@@ -1,5 +1,6 @@
editAreaLoader.load_syntax["css"] = {
'COMMENT_SINGLE' : {1 : '@'}
'DISPLAY_NAME' : 'CSS'
,'COMMENT_SINGLE' : {1 : '@'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : ['"', "'"]
,'KEYWORD_CASE_SENSITIVE' : false

View File

@@ -3,7 +3,8 @@
*/
editAreaLoader.load_syntax["html"] = {
'COMMENT_SINGLE' : {}
'DISPLAY_NAME' : 'HTML'
,'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'<!--' : '-->'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false

View File

@@ -1,5 +1,6 @@
editAreaLoader.load_syntax["js"] = {
'COMMENT_SINGLE' : {1 : '//'}
'DISPLAY_NAME' : 'Javascript'
,'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false

View File

@@ -1,100 +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" >
<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"/>
<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 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'>&nbsp;</div>
<div id='end_bracket' class='edit_area_cursor'>&nbsp;</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>
<div id='result'>
<div id='no_file_selected'></div>
<div id='container'>
<div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
<div id='end_bracket' class='edit_area_cursor'>&nbsp;</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>
<div class='area_toolbar' id='toolbar_2'>
<table class='statusbar' cellspacing='0' cellpadding='0'>
<tr>
<td class='total' selec='none'>{$position}:</td>
<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='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'>
</tr>
</table>
</div>
</div>
<div id='processing'>
<div id='processing_text'>
{$processing}
</div>
</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>
<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 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>
</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_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>
<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 />
<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'>&copy; Christophe Dolivet 2007-2009</div>
</div>
</div>
<br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div>
</div>
</div>
</body>
</html>