Changeset 10307


Ignore:
Timestamp:
Apr 12, 2011, 1:12:51 PM (10 years ago)
Author:
patdenice
Message:

feature:2262
Replace editarea by Codemirror:
http://codemirror.net

Location:
trunk/plugins/LocalFilesEditor
Files:
40 added
1 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/admin.php

    r9359 r10307  
    7575$newfile_page = isset($_GET['newfile']) ? true : false;
    7676
    77 // Editarea options
    78 $editarea_options = array(
    79   'language' => substr($user['language'], 0, 2),
    80   'start_highlight' => true,
    81   'allow_toggle' => false,
    82   'toolbar' => 'search,fullscreen, |,select_font, |, undo, redo, change_smooth_selection, highlight, reset_highlight, |, help');
    83 
    8477// Edit selected file for CSS, template and language
    8578if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
     
    139132                . 'show_default.php?file=include/config_default.inc.php',
    140133              'FILE' => 'config_default.inc.php')));
    141     $editarea_options['syntax'] = 'php';
     134    $codemirror_mode = 'application/x-httpd-php';
    142135    break;
    143136
     
    160153        'OPTIONS' => $options,
    161154        'SELECTED' => $selected));
    162     $editarea_options['syntax'] = 'css';
     155    $codemirror_mode = 'text/css';
    163156    break;
    164157
     
    239232      'NEW_FILE_CLASS' => empty($edited_file) ? '' : 'top_right'));
    240233
    241     $editarea_options['syntax'] = 'html';
     234    $codemirror_mode = 'text/html';
    242235    break;
    243236
     
    267260        'OPTIONS' => $options,
    268261        'SELECTED' => $selected));
    269     $editarea_options['syntax'] = 'php';
     262    $codemirror_mode = 'application/x-httpd-php';
    270263    break;
    271264   
     
    274267    $content_file = file_exists($edited_file) ?
    275268      file_get_contents($edited_file) : $new_file['plug'];
    276     $editarea_options['syntax'] = 'php';
     269    $codemirror_mode = 'application/x-httpd-php';
    277270    break;
    278271}
     
    368361  'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin-LocalFilesEditor-'.$page['tab'],
    369362  'LOCALEDIT_PATH' => LOCALEDIT_PATH,
    370   'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
    371   'EDITAREA_OPTIONS' => $editarea_options));
     363  'LOAD_CODEMIRROR' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
     364  'CODEMIRROR_MODE' => @$codemirror_mode
     365  )
     366);
    372367
    373368$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
  • trunk/plugins/LocalFilesEditor/admin.tpl

    r9173 r10307  
    1 {html_head}<script type="text/javascript" src="{$ROOT_URL}plugins/LocalFilesEditor/editarea/edit_area_full.js"></script>{/html_head}
     1{combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"}
     2{combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"}
     3{combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"}
     4{combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"}
     5{combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"}
     6{combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"}
     7{combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"}
     8
     9{combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"}
     10{combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"}
     11{combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"}
     12{combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"}
     13{combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"}
    214{combine_css path="plugins/LocalFilesEditor/locfiledit.css"}
     15
    316{footer_script}
    4 function loadEditarea() {ldelim}
    5   editAreaLoader.init({ldelim}
    6     id: "text"
    7     {foreach from=$EDITAREA_OPTIONS key=option item=value}
    8     , {$option}: {$value|editarea_quote}
    9     {/foreach}
     17function loadCodemirror() {ldelim}
     18  editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim}
     19    matchBrackets: true,
     20    mode: "{$CODEMIRROR_MODE}",
     21    tabMode: "shift"
    1022  });
    11   jQuery("#showedit").hide();
    12   jQuery("#hideedit").show();
     23  jQuery("#showedit, #hideedit").toggle();
    1324  jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "on"});
    1425}
    1526
    16 function unloadEditarea() {ldelim}
    17   editAreaLoader.delete_instance("text");
    18   jQuery("#hideedit").hide();
    19   jQuery("#showedit").show();
     27function unloadCodemirror() {ldelim}
     28  editor.toTextArea();
     29  jQuery("#showedit, #hideedit").toggle();
    2030  jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "off"});
    2131}
    2232
    23 jQuery("#editarea_buttons").show();
    24 {if $LOAD_EDITAREA == 'on'}
    25 if (document.getElementById("text") != null) loadEditarea();
     33{if $LOAD_CODEMIRROR == 'on'}
     34if (document.getElementById("text") != null) loadCodemirror();
    2635{/if}
    2736{/footer_script}
     
    6776{/if}
    6877
     78<div style="overflow:auto;"> {* top bar buttons *}
    6979{if !empty($show_default)}
    7080{foreach from=$show_default item=file name=default_loop}
    7181<span class="top_right">
    72 <a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=600' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a>
     82<a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=700' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a>
    7383</span>
    7484{if !($smarty.foreach.default_loop.last)}<br>{/if}
     
    7989<b>{$zone_edit.FILE_NAME}</b>
    8090
     91</div> {* top bar buttons *}
     92
    8193<textarea rows="30" cols="90" name="text" id="text">{$zone_edit.CONTENT_FILE}</textarea>
    8294<div id="editarea_buttons">
    83 <a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
    84 <a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
     95<a href="javascript:loadCodemirror();" id="showedit">[{'locfiledit_enable_codemirror'|@translate}]</a>
     96<a href="javascript:unloadCodemirror();" id="hideedit">[{'locfiledit_disable_codemirror'|@translate}]</a>
    8597</div>
    8698
  • trunk/plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = 'يجب حفظه ليتم استعادته ';
    4242$lang['locfiledit_syntax_error'] = 'خطأ في تركيب الجمل ، لا / يمكن حفظ المف';
    43 $lang['locfiledit_enable_editarea'] = 'تمكين المحرر';
    44 $lang['locfiledit_disable_editarea'] = 'تعطيل المحرر';
    4543$lang['locfiledit_new_tpl'] = 'أنشأ ملف جديد';
    4644$lang['locfiledit_new_filename'] = 'أسم الملف';
     
    5452$lang['locfiledit_webmaster_only'] = 'فقط مدير الموقع يمكن استخدام محرر الملفات المحلي';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Musíte nejprve soubor uložit aby mohl být obnoven.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax error! Soubor nemůže být uložen.';
    44 $lang['locfiledit_enable_editarea'] = 'Povol editaci';
    45 $lang['locfiledit_disable_editarea'] = 'Zakázat editaci';
    4644$lang['locfiledit_new_tpl'] = 'Vytvořit nový soubor';
    4745$lang['locfiledit_new_filename'] = 'Název souboru';
     
    5553$lang['locfiledit_webmaster_only'] = 'Pouze webmaster může vytvářet nebo měnit lokální soubory.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Sie müssen die Datei speichern um sie wiederherstellen zu können.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax-Fehler! Datei kann nicht gespeichert werden.';
    44 $lang['locfiledit_enable_editarea'] = 'Aktiviere den Bearbeitungsbereich';
    45 $lang['locfiledit_disable_editarea'] = 'Deaktiviere den Bearbeitungsbereich';
    4644$lang['locfiledit_new_tpl'] = 'Erstelle eine neue Datei';
    4745$lang['locfiledit_new_filename'] = 'Dateiname';
     
    5553/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'You must save file to restore it.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax error! File can\'t be saved.';
    44 $lang['locfiledit_enable_editarea'] = 'Enable Editarea';
    45 $lang['locfiledit_disable_editarea'] = 'Disable Editarea';
    4644$lang['locfiledit_new_tpl'] = 'Create new file';
    4745$lang['locfiledit_new_filename'] = 'File name';
     
    5553$lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5654
     55$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php

    r10159 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Para conservar la la copia de seguridad debe guardar el archivo.';
    4343$lang['locfiledit_syntax_error'] = 'Error de sintaxis. No es posible guardar el archivo.';
    44 $lang['locfiledit_enable_editarea'] = 'Activar el texto editado';
    45 $lang['locfiledit_disable_editarea'] = 'Desactivar el área de edición';
    4644$lang['locfiledit_new_tpl'] = 'Crear un nuevo archivo ';
    4745$lang['locfiledit_new_filename'] = 'Nombre del archivo ';
     
    5553$lang['locfiledit_webmaster_only'] = 'Sólo los administradores pueden crear o modificar fichero locales.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php

    r9541 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Vous devez l\'enregistrer pour le sauvegarder.';
    4343$lang['locfiledit_syntax_error'] = 'Erreur de syntaxe! Impossible d\'enregistrer le fichier.';
    44 $lang['locfiledit_enable_editarea'] = 'Activer Editarea';
    45 $lang['locfiledit_disable_editarea'] = 'Désactiver Editarea';
    4644$lang['locfiledit_new_tpl'] = 'Créer un nouveau fichier';
    4745$lang['locfiledit_new_filename'] = 'Nom du fichier';
     
    5553$lang['locfiledit_webmaster_only'] = 'Seuls les webmasters sont autorisés à créer ou modifier les fichiers locaux.';
    5654
     55$lang['locfiledit_enable_codemirror'] = 'Activer Codemirror';
     56$lang['locfiledit_disable_codemirror'] = 'Désactiver Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/he_IL/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = 'אתה חייב לשמור את הקובץ בכדי לשחזר.';
    4242$lang['locfiledit_syntax_error'] = 'שגיאה תחבירית! לא ניתן לשמור את הקובץ.';
    43 $lang['locfiledit_enable_editarea'] = 'אפשר עריכה';
    44 $lang['locfiledit_disable_editarea'] = 'בטל עריכה';
    4543$lang['locfiledit_new_tpl'] = 'צור קובץ חדש';
    4644$lang['locfiledit_new_filename'] = 'שם הקובץ';
     
    5553$lang['locfiledit_filename_error'] = 'אסור להשתמש בתווים מסויימים בשם הקובץ.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php

    r8728 r10307  
    2020// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    2121// | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    24 
    25 $lang['locfiledit_onglet_localconf'] = 'Lokalno podešavanje';
     22// +-----------------------------------------------------------------------+$lang['locfiledit_onglet_localconf'] = 'Lokalno podešavanje';
    2623$lang['locfiledit_onglet_css'] = 'CSS';
    2724$lang['locfiledit_onglet_tpl'] = 'Predlošci';
     
    4340$lang['locfiledit_bak_loaded2'] = 'Morate snimiti datoteku kako bi je vratili u prijašnje stanje.';
    4441$lang['locfiledit_syntax_error'] = 'Greška u sintaksi! Datoteka ne može biti spremljena.';
    45 $lang['locfiledit_enable_editarea'] = 'Aktiviraj prostor za uredivanje';
    46 $lang['locfiledit_disable_editarea'] = 'Deaktiviraj prostor za uredivanje';
    4742$lang['locfiledit_new_tpl'] = 'Kreiraj novu datoteku';
    4843$lang['locfiledit_new_filename'] = 'Naziv datoteke';
     
    5651$lang['locfiledit_webmaster_only'] = 'Samo webmasteri mogu kreirati ili mijenjati lokalne datoteke.';
    5752
     53/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     54/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5855?>
  • trunk/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Mentett fájl visszaállítása.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax error! A fájl mentése meghiúsult.';
    44 $lang['locfiledit_enable_editarea'] = 'Szerkesztő megnyitása';
    45 $lang['locfiledit_disable_editarea'] = 'Szerkesztő bezárása';
    4644$lang['locfiledit_new_tpl'] = 'Új fájl létrehozása';
    4745$lang['locfiledit_new_filename'] = 'Fájl neve';
     
    5553/* TODO */ $lang['locfiledit_webmaster_only'] = 'Csak a webmesterek hozhatnak létre, vagy módosíthatnak helyi fájlokat.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Dovete registrarlo per salvarlo.';
    4343$lang['locfiledit_syntax_error'] = 'Errore di sintassi! Impossible salvare il file.';
    44 $lang['locfiledit_enable_editarea'] = 'Attivare Editarea';
    45 $lang['locfiledit_disable_editarea'] = 'Disattivare Editarea';
    4644$lang['locfiledit_new_tpl'] = 'Creare un nuovo file';
    4745$lang['locfiledit_new_filename'] = 'Nom file';
     
    5553$lang['locfiledit_webmaster_only'] = 'Solo i webmasters sono autorizzati a creare o modificare i file locali.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = '復元するために、ファイルを保存する必要があります。';
    4343$lang['locfiledit_syntax_error'] = 'エラー! ファイルは保存できません。';
    44 $lang['locfiledit_enable_editarea'] = 'Enable Editarea';
    45 $lang['locfiledit_disable_editarea'] = 'Disable Editarea';
    4644$lang['locfiledit_new_tpl'] = '新しいファイルを作成する';
    4745$lang['locfiledit_new_filename'] = 'ファイル名';
     
    5553$lang['locfiledit_webmaster_only'] = 'ローカルファイルはウェブマスターのみ作成するか、変更できます。';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'თქვენ უნდა შეინახოთ ფაილი, რომ აღდგინოთ.';
    4343$lang['locfiledit_syntax_error'] = 'სინტაქსური შეცდომა! ფაილი ვერ შეინახება.';
    44 $lang['locfiledit_enable_editarea'] = 'ჩავრთოთ გასასწორებელი ველი';
    45 $lang['locfiledit_disable_editarea'] = 'გამოვრთოთ გასასწორებელი ველი';
    4644$lang['locfiledit_new_tpl'] = 'შევქმნათ ახალი ფაილი';
    4745$lang['locfiledit_new_filename'] = 'ფაილის სახელი';
     
    5553$lang['locfiledit_webmaster_only'] = 'მხოლოდ ვებოსტატებს შეუძლიათ შექმნან ან გადააკეთონ ლოკალური ფაილები.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Jums jasaglaba fails lai to atjaunotu.';
    4343$lang['locfiledit_syntax_error'] = 'Sintakses kluda! Failu nav iespejams saglabat.';
    44 $lang['locfiledit_enable_editarea'] = 'Iespejot Redigešanas apgabalu';
    45 $lang['locfiledit_disable_editarea'] = 'Atspejot Redigešanas apgabalu';
    4644$lang['locfiledit_new_tpl'] = 'Izveidot jaunu failu';
    4745$lang['locfiledit_new_filename'] = 'Faila nosaukums';
     
    5553$lang['locfiledit_webmaster_only'] = 'Tikai webmasters var izveidot un modificet lokalos failus.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'U moet het bestand opslaan om te kunnen restoren.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax-fout! Bestand kan niet opgeslagen worden.';
    44 $lang['locfiledit_enable_editarea'] = 'Maak Edit-gebied atief';
    45 $lang['locfiledit_disable_editarea'] = 'Deactiveer Edit-gebied';
    4644$lang['locfiledit_new_tpl'] = 'Maak nieuw bestand aan';
    4745$lang['locfiledit_new_filename'] = 'Bestandsnaam';
     
    5553$lang['locfiledit_webmaster_only'] = 'Alleen webbeheerders kunnen lokale bestanden aanmaken of wijzigen.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/no_NO/plugin.lang.php

    r8728 r10307  
    2020// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    2121// | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    24 
    25 $lang['locfiledit_onglet_localconf'] = 'Lokal konfigurasjon';
     22// +-----------------------------------------------------------------------+$lang['locfiledit_onglet_localconf'] = 'Lokal konfigurasjon';
    2623$lang['locfiledit_onglet_css'] = 'CSS';
    2724$lang['locfiledit_onglet_tpl'] = 'Maler (templates)';
     
    4239$lang['locfiledit_bak_loaded2'] = 'Du må lagre filen for å gjennopprette den.';
    4340$lang['locfiledit_syntax_error'] = 'Syntax feil! Filen kan ikke bli lagret.';
    44 $lang['locfiledit_enable_editarea'] = 'Aktiver redigeringsområde ';
    45 $lang['locfiledit_disable_editarea'] = 'Deaktiver redigeringsområde';
    4641$lang['locfiledit_new_tpl'] = 'Lag ny fil';
    4742$lang['locfiledit_new_filename'] = 'Fil navn';
     
    5550$lang['locfiledit_webmaster_only'] = 'Kun webmaster kan lage eller endre lokale filer.';
    5651
     52/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     53/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5754?>
  • trunk/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Musisz zapisać plik aby go przywrócić.';
    4343$lang['locfiledit_syntax_error'] = 'Błąd skłądni! Plik nie może zostać zapisany.';
    44 $lang['locfiledit_enable_editarea'] = 'Włącz Pole Edycyjne';
    45 $lang['locfiledit_disable_editarea'] = 'Wyłącz Pole Edycyjne';
    4644$lang['locfiledit_new_tpl'] = 'Stwórz nowy plik';
    4745$lang['locfiledit_new_filename'] = 'Nazwa pliku';
     
    5553/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php

    r8921 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Deverá salvar o ficheiro para o restaurar.';
    4343$lang['locfiledit_syntax_error'] = 'Erro de sintaxe! Impossível salvar ficheiro.';
    44 $lang['locfiledit_enable_editarea'] = 'Activar Área de Edição';
    45 $lang['locfiledit_disable_editarea'] = 'Desactivar Área de Edição';
    4644$lang['locfiledit_new_tpl'] = 'Criar novo ficheiro';
    4745$lang['locfiledit_new_filename'] = 'Nome do ficheiro';
     
    5553$lang['locfiledit_webmaster_only'] = 'Apenas webmasters podem criar ou modificar ficheiros locais.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = 'Вы должны сохранить файл, чтобы восстановить его.';
    4242$lang['locfiledit_syntax_error'] = 'Синтаксическая ошибка! Невозможно сохранить файл.';
    43 $lang['locfiledit_enable_editarea'] = 'Активировать разметку области редактирования';
    44 $lang['locfiledit_disable_editarea'] = 'Дезактивировать разметку области редактирования';
    4543$lang['locfiledit_new_tpl'] = 'Создать новый файл';
    4644$lang['locfiledit_new_filename'] = 'Имя файла';
     
    5452$lang['locfiledit_webmaster_only'] = 'Только вэбмастеры могут создавать или редактировать локальные файлы.';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Musíte uložiť súbor na jeho obnovenie.';
    4343$lang['locfiledit_syntax_error'] = 'Syntaktický chyba! Súbor nemôže byť uložený.';
    44 $lang['locfiledit_enable_editarea'] = 'Povoliť editáciu';
    45 $lang['locfiledit_disable_editarea'] = 'Zakázať editáciu';
    4644$lang['locfiledit_new_tpl'] = 'Vytvorenie nového súboru';
    4745$lang['locfiledit_new_filename'] = 'Meno súboru';
     
    5553$lang['locfiledit_webmaster_only'] = 'Len webmasteri môžu vytvoriť alebo modifikovať lokálne súbory.';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2']         = 'Морате да запамтите датотеку пре обнављања.';
    4242$lang['locfiledit_syntax_error']        = 'Синтаксна грешка! Датотека не може бити снимљена.';
    43 $lang['locfiledit_enable_editarea']     = 'Омогући област промене';
    44 $lang['locfiledit_disable_editarea']    = 'Онемогући област промене';
    4543$lang['locfiledit_new_tpl']             = 'Направи нову датотеку';
    4644$lang['locfiledit_new_filename']        = 'Име датотеке';
     
    5452$lang['locfiledit_webmaster_only']      = 'Само уредник интернет страница може да направи или уреди локалне датотеке.';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = 'Du måste spara filen för att återställa den.';
    4242$lang['locfiledit_syntax_error'] = 'Syntax fel! Filen kan inte sparas.';
    43 $lang['locfiledit_enable_editarea'] = 'Aktivera Skrivfält';
    44 $lang['locfiledit_disable_editarea'] = 'Avaktivera Skrivfält';
    4543$lang['locfiledit_new_tpl'] = 'Skapa ny fil';
    4644$lang['locfiledit_new_filename'] = 'Fil namn';
     
    5452$lang['locfiledit_webmaster_only'] = 'Endast webmasters kan skapa eller ändra lokala filer.';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php

    r8728 r10307  
    4242$lang['locfiledit_bak_loaded2'] = 'Geri yükledikten sonra save etmeyi unutmayiniz.';
    4343$lang['locfiledit_syntax_error'] = 'Syntax error! Dosya kayit edilemiyor.';
    44 $lang['locfiledit_enable_editarea'] = 'Editleme açik';
    45 $lang['locfiledit_disable_editarea'] = 'Editleme kapali';
    4644$lang['locfiledit_new_tpl'] = 'Yeni Dosya Yarat';
    4745$lang['locfiledit_new_filename'] = 'Dosya Adi';
     
    5553$lang['locfiledit_webmaster_only'] = 'Sadece yöneticiler dosyalari degistirebilir .';
    5654
     55/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     56/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5757?>
  • trunk/plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = 'Bạn phải lưu lại tệp tin để phục hồi nó.';
    4242$lang['locfiledit_syntax_error'] = 'Lỗi cú pháp! Tệp tin không thể được lưu.';
    43 $lang['locfiledit_enable_editarea'] = 'Kích hoạt vùng nhập dữ liệu';
    44 $lang['locfiledit_disable_editarea'] = 'Tắt vùng nhập dữ liệu';
    4543$lang['locfiledit_new_tpl'] = 'Tạo tệp tin mới';
    4644$lang['locfiledit_new_filename'] = 'Tên tệp tin';
     
    5452$lang['locfiledit_webmaster_only'] = 'Chỉ có webmasters mới có thể tạo hoặc biên tập tệp tin trên máy.';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php

    r8728 r10307  
    4141$lang['locfiledit_bak_loaded2'] = '您必须保存文件以便将其恢复.';
    4242$lang['locfiledit_syntax_error'] = '语法错误! 文件不能被保存.';
    43 $lang['locfiledit_enable_editarea'] = '启用编辑区域';
    44 $lang['locfiledit_disable_editarea'] = '禁用编辑区域';
    4543$lang['locfiledit_new_tpl'] = '创建新文件';
    4644$lang['locfiledit_new_filename'] = '文件名';
     
    5452$lang['locfiledit_webmaster_only'] = '只有网站管理员才能创建或者修改本地文件.';
    5553
     54/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror';
     55/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror';
    5656?>
  • trunk/plugins/LocalFilesEditor/locfiledit.css

    r3282 r10307  
    1515#LocalFilesEditor TEXTAREA {
    1616  margin: 0.5em 0;
    17   width: 99.5%;
     17  width: 99%;
     18  height: 500px;
    1819  float: left;
    1920}
     
    2324  float: left;
    2425  text-align: left;
    25   display: none;
    2626}
    2727
     
    3333  padding: 0.5em;
    3434}
     35
     36.CodeMirror {
     37  background-color: #DDDDDD;
     38  font-size: 1.3em;
     39  border: 1px solid #999999;
     40  margin: 0.5em 0;
     41  width: 99%;
     42  min-height: 500px;
     43  height: auto;
     44}
  • trunk/plugins/LocalFilesEditor/show_default.php

    r8728 r10307  
    3939  $template->set_filename('show_default', dirname(__FILE__) . '/show_default.tpl');
    4040 
    41   // Editarea
    42   $editarea_options = array(
    43     'syntax' => 'php',
    44     'start_highlight' => true,
    45     'allow_toggle' => false,
    46     'is_editable' => false,
    47     'language' => substr($user['language'], 0, 2));
    48 
    4941  $file = file_get_contents(PHPWG_ROOT_PATH . $path);
    5042  $title = str_replace('/', ' / ', $path);
     
    5446    'DEFAULT_CONTENT' => $file,
    5547    'LOCALEDIT_PATH' => LOCALEDIT_PATH,
    56     'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'on',
    57     'EDITAREA_OPTIONS' => $editarea_options));
     48    'LOAD_CODEMIRROR' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'on',
     49    'CODEMIRROR_MODE' => 'application/x-httpd-php'
     50    )
     51  );
    5852
    5953  $page['body_id'] = 'thePopuphelpPage';
  • trunk/plugins/LocalFilesEditor/show_default.tpl

    r3283 r10307  
    11{html_head}
    2 <link rel="stylesheet" type="text/css" href="{$LOCALEDIT_PATH}locfiledit.css">
    32<style type="text/css">#headbranch, #theHeader, #copyright {ldelim} display: none; }</style>
    43{/html_head}
    5 {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
    6 {known_script id="editarea" src=$LOCALEDIT_PATH|@cat:"editarea/edit_area_full.js"}
    7 <script type="text/javascript">
    8 var editarea = "{$LOAD_EDITAREA}";
     4{combine_script id="jquery"}
    95
    10 function loadEditarea() {ldelim}
    11   editAreaLoader.init({ldelim}
    12     id: "text"
    13     {foreach from=$EDITAREA_OPTIONS key=option item=value}
    14     , {$option}: {$value|editarea_quote}
    15     {/foreach}
     6{combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"}
     7{combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"}
     8{combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"}
     9{combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"}
     10{combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"}
     11{combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"}
     12{combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"}
     13
     14{combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"}
     15{combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"}
     16{combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"}
     17{combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"}
     18{combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"}
     19{combine_css path="plugins/LocalFilesEditor/locfiledit.css"}
     20
     21{footer_script}
     22function loadCodemirror() {ldelim}
     23  editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim}
     24    matchBrackets: true,
     25    readOnly: true,
     26    mode: "{$CODEMIRROR_MODE}",
     27    tabMode: "shift"
    1628  });
    1729  jQuery("#showedit").hide();
    1830  jQuery("#hideedit").show();
     31  jQuery.post("update_config.php", {ldelim} editarea: "on"});
    1932}
    2033
    21 function unloadEditarea() {ldelim}
    22   editAreaLoader.delete_instance("text");
     34function unloadCodemirror() {ldelim}
     35  editor.toTextArea();
    2336  jQuery("#hideedit").hide();
    2437  jQuery("#showedit").show();
     38  jQuery.post("update_config.php", {ldelim} editarea: "off"});
    2539}
    26 </script>
     40
     41{if $LOAD_CODEMIRROR == 'on'}
     42if (document.getElementById("text") != null) loadCodemirror();
     43{/if}
     44{/footer_script}
    2745
    2846<div id="LocalFilesEditor">
    29 <h1>{$TITLE}</h1>
     47<div style="overflow:auto;"><b>{$TITLE}</b></div>
    3048
    3149<textarea id="text" rows="30" cols="90">{$DEFAULT_CONTENT}</textarea>
    3250
    3351<div id="editarea_buttons">
    34 <a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
    35 <a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
     52<a href="javascript:loadCodemirror();" id="showedit">[{'locfiledit_enable_codemirror'|@translate}]</a>
     53<a href="javascript:unloadCodemirror();" id="hideedit">[{'locfiledit_disable_codemirror'|@translate}]</a>
    3654</div>
    3755
    3856</div>
    39 
    40 <script type="text/javascript">
    41 jQuery("#editarea_buttons").show();
    42 if (editarea == "on") loadEditarea();
    43 </script>
Note: See TracChangeset for help on using the changeset viewer.