Add basic File Manager optimisations

This commit is contained in:
Ilia Rostovtsev
2021-10-30 17:53:26 +03:00
parent 9f0fc2e485
commit ce765d28bb
432 changed files with 119 additions and 69885 deletions

View File

@@ -17,6 +17,9 @@ if(!-e "$confdir/.config") {
&read_file("$confdir/.config", \%config);
}
# Load module config user custom manually due to non-standard config
&load_module_preferences($module_name, \%config);
if(!-e "$confdir/.bookmarks") {
$bookmarks = '';
} else {
@@ -38,8 +41,6 @@ print &ui_table_row($text{'config_columns_to_display'},
&ui_checkbox('columns', 'last_mod_time', $text{'last_mod_time'}, $config{'columns'} =~ /last_mod_time/)
);
print &ui_table_row($text{'config_per_page'}, ui_textbox("per_page", $config{'per_page'}, 80));
print &ui_table_row($text{'config_disable_pagination'}, &ui_checkbox('disable_pagination', 1, '', $config{'disable_pagination'}));
print &ui_table_row($text{'config_toolbar_style'}, &ui_yesno_radio('menu_style', $config{'menu_style'}, 1, 0));
print &ui_table_row($text{'file_detect_encoding'}, &ui_yesno_radio('config_portable_module_filemanager_editor_detect_encoding', $config{'config_portable_module_filemanager_editor_detect_encoding'}, 'true', 'false'));
print &ui_table_row($text{'config_bookmarks'}, &ui_textarea("bookmarks", $bookmarks, 5, 40));

View File

@@ -1,5 +1,3 @@
columns=size,owner_user,permissions,last_mod_time
per_page=50
disable_pagination=0
menu_style=1
config_portable_module_filemanager_editor_detect_encoding=true

View File

@@ -31,37 +31,16 @@ if ($userconfig{'config_portable_module_filemanager_editor_detect_encoding'} ne
}
my $file_binary = -s $file >= 128 && -B $file;
my %tinfo = &get_theme_info($current_theme);
&ui_print_header(undef, $text{'edit_file'}, "");
$head = "<link rel='stylesheet' type='text/css' href='unauthenticated/css/style.css' />";
if ($current_theme ne 'authentic-theme') {
$head .= "<script type='text/javascript' src='unauthenticated/jquery/jquery.min.js'></script>";
$head .= "<script type='text/javascript' src='unauthenticated/jquery/jquery-ui.min.js'></script>";
$head .= "<link rel='stylesheet' type='text/css' href='unauthenticated/jquery/jquery-ui.min.css' />";
# Include Codemirror specific files
$head .= "<link rel='stylesheet' href='unauthenticated/js/lib/codemirror/lib/codemirror.css' />";
$head .= "<script src='unauthenticated/js/lib/codemirror/lib/codemirror.js'></script>";
$head .= "<script src='unauthenticated/js/lib/codemirror/addon/mode/loadmode.js'></script>";
$head .= "<script src='unauthenticated/js/lib/codemirror/mode/meta.js'></script>";
$head .= "<script src='unauthenticated/js/lib/codemirror/mode/javascript/javascript.js'></script>";
$head .= "<script src='unauthenticated/js/lib/codemirror/mode/scheme/scheme.js'></script>";
$head .= "<style type='text/css'>.CodeMirror {height: auto;}</style>";
}
print $head;
print ui_table_start(&html_escape("$path/$in{'file'}"), undef, 1);
print "<style>textarea {padding: 4px;}</style>"
if (!$tinfo{'bootstrap'});
print &ui_table_start(&html_escape("$path/$in{'file'}"), "width=100%;", 1);
print &ui_form_start("save_file.cgi", "post", undef, "data-encoding=\"$encoding_name\" data-binary=\"$file_binary\"");
print &ui_hidden("file", $in{'file'}), "\n";
print &ui_hidden("encoding", $encoding_name), "\n";
print &ui_textarea("data", $data, 20, 80, undef, undef, "style='width: 100%' id='data'");
print &ui_textarea("data", $data, 30, undef, undef, undef, " style='width: 100%' id='data'");
print &ui_hidden("path", $path);
print &ui_form_end([[save, $text{'save'}], [save_close, $text{'save_close'}]]);
print ui_table_end();
print "<script type='text/javascript' src='unauthenticated/js/cmauto.js'></script>";
print "<script type='text/javascript'>\$(document).ready( function() { change('" . $in{'file'} . "'); });</script>";
print &ui_table_end();
&ui_print_footer("index.cgi?path=" . &urlize($path), $text{'previous_page'});

View File

@@ -169,11 +169,11 @@ sub print_interface {
$bookmarks = get_bookmarks();
@allowed_for_edit = split(/\s+/, $access{'allowed_for_edit'});
%allowed_for_edit = map { $_ => 1} @allowed_for_edit;
my %tinfo = &get_theme_info($current_theme);
# Set things up according to currently used theme
if ($current_theme eq 'authentic-theme' or $current_theme eq 'bootstrap') {
# Interface for Bootstrap powered themes
if ($tinfo{'bootstrap'}) {
# Interface for Bootstrap 3 powered themes
# Set icons variables
$edit_icon = "<i class='fa fa-edit' alt='$text{'edit'}'></i>";
$rename_icon = "<i class='fa fa-font' title='$text{'rename'}'></i>";
@@ -205,17 +205,17 @@ sub print_interface {
}
print "</ol>";
# And toolbar
if($userconfig{'menu_style'} || $current_theme eq 'authentic-theme') {
print_template("unauthenticated/templates/menu.html");
} else {
print_template("unauthenticated/templates/quicks.html");
}
$page = 1;
$pagelimit = 4294967295; # The number of maximum files in a directory for EXT4. 9000+ is way to little
# And toolbar
print_template("unauthenticated/templates/menu.html");
print_template("unauthenticated/templates/dialogs.html");
} else {
# Interface for legacy themes
}
# Interface for legacy themes
else {
# Set icons variables
$edit_icon = "<img src='images/icons/quick/edit.png' alt='$text{'edit'}' />";
$rename_icon = "<img src='images/icons/quick/rename.png' alt='$text{'rename'}' />";
@@ -275,7 +275,7 @@ sub print_interface {
# And toolbar
print_template("unauthenticated/templates/legacy_quicks.html");
print_template("unauthenticated/templates/legacy_dialogs.html");
}
}
my $info_total;
my $info_files = scalar @files;
my $info_folders = scalar @folders;

View File

@@ -143,9 +143,7 @@ search_insensitive=Gevoelensensitiewe soektog
goto_folder=Gaan na die gids bevat
module_config=Modulekonfigurasie
config_columns_to_display=Kolomme wat vertoon moet word
config_per_page=Items om per bladsy te vertoon (slegs vir ou temas)
config_disable_pagination=Deaktiveer paginering (slegs vir gebruikers van 'Authentic Theme')
config_toolbar_style=Stel die werkbalkstyl in op die menu-aanskouing, met dropdowns... en koekies (slegs vir outentieke tema-gebruikers)
config_per_page=Items om per bladsy te vertoon
config_bookmarks=boekmerke
no_bookmarks=Nog geen boekmerke nie
menu_file=lêer
@@ -165,3 +163,4 @@ ownership=Eienaar
acls=Toegangsbeheerlys
file_detect_encoding=Bespeur lêerkodering outomaties
index_return=lêerlys
upload_dirs=Gids oplaai

View File

@@ -142,9 +142,6 @@ search_insensitive=بحث غير حساس لحالة الأحرف
goto_folder=انتقل إلى الدليل الذي يحتوي على
module_config=تكوين الوحدة
config_columns_to_display=الأعمدة المراد عرضها
config_per_page=العناصر المطلوب عرضها لكل صفحة (للمواضيع القديمة فقط)
config_disable_pagination=تعطيل ترقيم الصفحات (لمستخدمي Theme Authentic فقط)
config_toolbar_style=تعيين نمط شريط الأدوات على طريقة عرض تشبه القائمة ، <br> مع القوائم المنسدلة ... وملفات تعريف الارتباط (لمستخدمي Theme Authentic فقط)
config_bookmarks=الإشارات المرجعية
no_bookmarks=لا توجد إشارات مرجعية بعد
menu_file=ملف

View File

@@ -1,5 +1,7 @@
acl_allowed_paths_explain=بالنسبة إلى المستخدم القادر على الوصول إلى الجذر ، إذا تم تعيين الدليل المسموح به على $HOME فقط ، فسيكون مكافئًا لـ / (الوصول الكامل إلى القرص)
config_per_page=العناصر المراد عرضها في كل صفحة
acls=قائمة نظام الدخول
file_detect_encoding=كشف ملف ترميز تلقائيا
index_return=قائمة الملفات
upload_dirs=تحميل الدليل

View File

@@ -143,9 +143,7 @@ search_insensitive=Справа неадчувальны пошук
goto_folder=Перайдзіце ў каталог, які змяшчае
module_config=Канфігурацыя модуля
config_columns_to_display=Калоны для адлюстравання
config_per_page=Элементы для адлюстравання на старонцы (толькі для старых тэм)
config_disable_pagination=Адключыць старонку старонкі (толькі для карыстальнікаў "Аўтэнтычная тэма")
config_toolbar_style=Усталюйце стыль панэлі інструментаў у выглядзе меню, прагляду з выпадальнымі меню... і кукі (толькі для карыстальнікаў аўтэнтычнай тэмы)
config_per_page=Элементы для адлюстравання на старонцы
config_bookmarks=Закладкі
no_bookmarks=Закладкі пакуль няма
menu_file=Файл
@@ -165,3 +163,4 @@ ownership=Уладальнік
acls=Спіс кантролю доступу
file_detect_encoding=Аўтаматычнае вызначэнне кадавання файлаў
index_return=спіс файлаў
upload_dirs=Загрузка каталога

View File

@@ -143,9 +143,7 @@ search_insensitive=Търсене безчувствено търсене
goto_folder=Отидете на съдържаща директория
module_config=Конфигурация на модул
config_columns_to_display=Колони за показване
config_per_page=Елементи за показване на страница (само за стари теми)
config_disable_pagination=Деактивиране на страници (само за потребители с „Автентична тема“)
config_toolbar_style=Задайте стил на лентата с инструменти на изглед, подобен на менюто, <br> с падащи менюта и бисквитки (само за потребители на автентична тема)
config_per_page=Елементи за показване на страница
config_bookmarks=Bookmarks
no_bookmarks=Все още няма отметки
menu_file=досие
@@ -165,3 +163,4 @@ ownership=собственик
acls=Списък за контрол на достъпа
file_detect_encoding=Автоматично откриване на кодиране на файлове
index_return=списък с файлове
upload_dirs=Качване на директория

View File

@@ -142,9 +142,6 @@ search_insensitive=Cerca insensitiva a caixa
goto_folder=Ves al directori contenidor
module_config=Configuració del mòdul
config_columns_to_display=Columnes a mostrar
config_per_page=Ítems a mostrar per pàgina (només per a temes antics)
config_disable_pagination=Desactiva la paginació (només per a usuaris del Tema Authentic)
config_toolbar_style=Estableix l'estil de la barra d'eines al d'una vista de menú,<br>amb desplegables... i galetes (només per a usuaris del Tema Autèntic)
config_bookmarks=Preferits
no_bookmarks=Encara no hi ha cap preferit
menu_file=Fitxer

View File

@@ -1,5 +1,7 @@
acl_allowed_paths_explain=Per a usuaris capaços d'arrel, si el directori permès només s'estableix a $HOME, serà equivalent a / (accés complet al disc)
config_per_page=Elements per mostrar per pàgina
acls=Llista de control daccés
file_detect_encoding=Detecta automàticament la codificació de fitxers
index_return=llistat de fitxers
upload_dirs=Càrrega del directori

View File

@@ -143,9 +143,7 @@ search_insensitive=Hledání bez rozlišování velkých a malých písmen
goto_folder=Přejít do adresáře obsahujícího
module_config=Konfigurace modulu
config_columns_to_display=Sloupce k zobrazení
config_per_page=Položky, které se mají zobrazit na stránce (pouze pro stará témata)
config_disable_pagination=Zakázat stránkování (pouze pro uživatele „Autentického motivu“)
config_toolbar_style=Nastavit styl panelu nástrojů na zobrazení podobné nabídce, <br> s rozevíracími seznamy... a soubory cookie (pouze pro uživatele Autentického motivu)
config_per_page=Položky k zobrazení na stránce
config_bookmarks=Záložky
no_bookmarks=Zatím žádné záložky
menu_file=Soubor
@@ -165,3 +163,4 @@ ownership=Majitel
acls=Seznam řízení přístupu
file_detect_encoding=Automaticky detekovat kódování souborů
index_return=seznam souborů
upload_dirs=Nahrání adresáře

View File

@@ -143,9 +143,7 @@ search_insensitive=Sags ufølsom søgning
goto_folder=Gå til indeholder bibliotek
module_config=Modulkonfiguration
config_columns_to_display=Kolonner, der skal vises
config_per_page=Elementer, der skal vises pr. Side (kun for gamle temaer)
config_disable_pagination=Deaktiver pagination (kun for brugere af "Autentisk tema")
config_toolbar_style=Indstil værktøjslinjestil til menulignende visning, <br> med dropdowns... og cookies (kun til brugere af autentisk tema)
config_per_page=Elementer, der skal vises pr. side
config_bookmarks=bogmærker
no_bookmarks=Der er endnu ingen bogmærker
menu_file=Fil
@@ -165,3 +163,4 @@ ownership=Ejer
acls=Adgangskontroliste
file_detect_encoding=Registrer automatisk filkodning
index_return=filoversigt
upload_dirs=Directory upload

View File

@@ -142,9 +142,6 @@ search_insensitive=Groß- und Kleinschreibung bei Suche beachten
goto_folder=Gehe zum enthaltenden Ordner
module_config=Modul-Konfiguration
config_columns_to_display=Anzuzeigende Spalten
config_per_page=Einträge zum Anzeigen pro Seite (nur für alte Themes)
config_disable_pagination=Seitennummerierung deaktivieren (nur für Authentic Theme-Benutzer)
config_toolbar_style=Setze 'toolbar style' für Menü,<br>mit Dropdowns ... und Cookies (nur für Authentic Theme-Benutzer)
config_bookmarks=Lesezeichen
no_bookmarks=Noch keine Lesezeichen
menu_file=Datei

View File

@@ -1,5 +1,7 @@
acl_allowed_paths_explain=Wenn für einen Root-fähigen Benutzer das zulässige Verzeichnis nur auf $HOME festgelegt ist, entspricht es / (vollständiger Festplattenzugriff).
config_per_page=Elemente, die pro Seite angezeigt werden
acls=Zugriffskontrollliste
file_detect_encoding=Dateicodierung automatisch erkennen
index_return=Dateiliste
upload_dirs=Verzeichnis-Upload

View File

@@ -143,9 +143,7 @@ search_insensitive=Ανίχνευση ανιχνεύσιμων περιπτώσ
goto_folder=Μεταβείτε στον κατάλογο που περιέχει
module_config=Διαμόρφωση μονάδας
config_columns_to_display=Στήλες για προβολή
config_per_page=Στοιχεία που εμφανίζονται ανά σελίδα (μόνο για παλιά θέματα)
config_disable_pagination=Απενεργοποίηση σελίδας (μόνο για τους χρήστες "Αυθεντικής Θέματος")
config_toolbar_style=Ορίστε στυλ γραμμής εργαλείων σε προβολή που μοιάζει με μενού, με αναπτυσσόμενα μενού... και cookies (μόνο για χρήστες με αυθεντικό θέμα)
config_per_page=Στοιχεία προς εμφάνιση ανά σελίδα
config_bookmarks=Σελιδοδείκτες
no_bookmarks=Δεν υπάρχουν ακόμα σελιδοδείκτες
menu_file=Αρχείο
@@ -165,3 +163,4 @@ ownership=Ιδιοκτήτης
acls=Λίστα ελέγχου πρόσβασης
file_detect_encoding=Αυτόματη ανίχνευση κωδικοποίησης αρχείων
index_return=λίστα αρχείων
upload_dirs=Μεταφόρτωση καταλόγου

View File

@@ -143,9 +143,7 @@ search_insensitive=Case insensitive search
goto_folder=Go to containing directory
module_config=Module configuration
config_columns_to_display=Columns to display
config_per_page=Items to display per page (for old themes only)
config_disable_pagination=Disable pagination (for 'Authentic Theme' users only)
config_toolbar_style=Set toolbar style to menu-like view,<br>with dropdowns ... and cookies (for Authentic Theme users only)
config_per_page=Items to display per page
config_bookmarks=Bookmarks
no_bookmarks=No bookmarks yet
menu_file=File

View File

@@ -143,9 +143,7 @@ search_insensitive=Búsqueda insensible a mayúsculas y minúsculas
goto_folder=Ir al directorio contenedor
module_config=Configuración del módulo
config_columns_to_display=Columnas para mostrar
config_per_page=Elementos para mostrar por página (solo para temas antiguos)
config_disable_pagination=Desactivar paginación (solo para usuarios de 'Tema auténtico')
config_toolbar_style=Establezca el estilo de la barra de herramientas en vista de menú, <br> con menús desplegables... y cookies (solo para usuarios de Authentic Theme)
config_per_page=Elementos para mostrar por página
config_bookmarks=Marcadores
no_bookmarks=Aún no hay marcadores
menu_file=Archivo
@@ -165,3 +163,4 @@ ownership=Propietario
acls=Lista de control de acceso
file_detect_encoding=Detecta automáticamente la codificación de archivos
index_return=listado de archivos
upload_dirs=Carga de directorio

View File

@@ -143,9 +143,7 @@ search_insensitive=Bilaketarik gabeko kasuak
goto_folder=Joan direktorio direktoriora
module_config=Moduluaren konfigurazioa
config_columns_to_display=Bistaratzeko zutabeak
config_per_page=Orrialde bakoitzeko bistaratzeko elementuak (gai zaharrak soilik)
config_disable_pagination=Desgaitu paginazioa ('Benetako Gaia' erabiltzaileentzat bakarrik)
config_toolbar_style=Ezarri tresna barrako estiloa menuko itxurako ikuspegian, goitibeherakoekin... eta cookieekin (benetako gaikako erabiltzaileentzat bakarrik)
config_per_page=Orrialde bakoitzeko bistaratzeko elementuak
config_bookmarks=Bookmarks
no_bookmarks=Laster-markarik ez dago oraindik
menu_file=file
@@ -165,3 +163,4 @@ ownership=Jabea
acls=Sarbide Kontrol Zerrenda
file_detect_encoding=Automatikoki detektatu fitxategien kodeketa
index_return=fitxategi zerrenda
upload_dirs=Direktorioa igotzea

View File

@@ -143,9 +143,7 @@ search_insensitive=مورد بی عیب و نقص مورد
goto_folder=به پوشه حاوی فهرست بروید
module_config=پیکربندی ماژول
config_columns_to_display=ستون ها برای نمایش
config_per_page=موارد برای نمایش در هر صفحه (فقط برای مضامین قدیمی)
config_disable_pagination=غیرفعال کردن صفحه بندی (فقط برای کاربران "موضوع معتبر")
config_toolbar_style=سبک نوار ابزار را برای نمایش مانند منو ، <br> با بازشوها... و کوکی ها تنظیم کنید (فقط برای کاربران معتبر تم)
config_per_page=موارد برای نمایش در هر صفحه
config_bookmarks=نشانک ها
no_bookmarks=هنوز هیچ نشانک وجود ندارد
menu_file=فایل
@@ -165,3 +163,4 @@ ownership=صاحب
acls=لیست کنترل دسترسی
file_detect_encoding=به طور خودکار رمزگذاری فایل را شناسایی کنید
index_return=لیست پرونده
upload_dirs=آپلود دایرکتوری

View File

@@ -143,9 +143,7 @@ search_insensitive=Isojen ja pienten kirjainten haku
goto_folder=Siirry hakemistoon, joka sisältää
module_config=Moduulin kokoonpano
config_columns_to_display=Näytettävät sarakkeet
config_per_page=Sivua kohden näytettävät kohteet (vain vanhoille teemoille)
config_disable_pagination=Poista sivutus käytöstä (vain 'Aito teema' -käyttäjille)
config_toolbar_style=Aseta työkalurivityyli valikkomaiseen näkymään, <br> avattavilla... ja evästeillä (vain aitoja teemoja käyttäville)
config_per_page=Sivua kohden näytettävät kohteet
config_bookmarks=kirjanmerkit
no_bookmarks=Ei vielä kirjanmerkkejä
menu_file=tiedosto
@@ -165,3 +163,4 @@ ownership=Omistaja
acls=Kulunvalvontaluettelo
file_detect_encoding=Tunnista tiedostojen koodaus automaattisesti
index_return=tiedostoluettelo
upload_dirs=Hakemiston lataus

View File

@@ -142,9 +142,6 @@ search_insensitive=Recherche insensible à la casse
goto_folder=Accéder au répertoire contenant
module_config=Configuration du module
config_columns_to_display=Colonnes à afficher
config_per_page=Éléments à afficher par page (pour les anciens thèmes uniquement)
config_disable_pagination=Désactiver la pagination (pour les utilisateurs du thème authentique uniquement)
config_toolbar_style=Définissez le style de la barre d'outils sur une vue semblable à un menu, <br> avec des listes déroulantes... et des cookies (pour les utilisateurs Authentic Theme uniquement)
config_bookmarks=Signets
no_bookmarks=Pas encore de signets
menu_file=Fichier

View File

@@ -1,5 +1,7 @@
acl_allowed_paths_explain=Pour un utilisateur compatible root, si le répertoire autorisé est uniquement défini sur $HOME, il sera équivalent à / (accès complet au disque)
config_per_page=Éléments à afficher par page
acls=Liste de contrôle d'accès
file_detect_encoding=Détecter automatiquement le codage des fichiers
index_return=liste de fichiers
upload_dirs=Téléchargement d'annuaire

View File

@@ -143,9 +143,7 @@ search_insensitive=חיפוש חסר רגישות
goto_folder=עבור לספרייה המכילה
module_config=תצורת מודול
config_columns_to_display=עמודות לתצוגה
config_per_page=פריטים להצגה בעמוד (לנושאים ישנים בלבד)
config_disable_pagination=השבת עימוד (למשתמשים 'נושא אותנטי' בלבד)
config_toolbar_style=הגדר את סגנון סרגל הכלים לתצוגה דמוית תפריט, עם התפריטים הנפתחים... ועוגיות (למשתמשי נושא אותנטי בלבד)
config_per_page=פריטים להצגה בכל עמוד
config_bookmarks=סימניות
no_bookmarks=אין עדיין סימניות
menu_file=קובץ
@@ -165,3 +163,4 @@ ownership=בעלים
acls=גש לרשימת השליטה
file_detect_encoding=זיהוי אוטומטי של קידוד קבצים
index_return=רישום קבצים
upload_dirs=העלאת ספריה

View File

@@ -143,9 +143,7 @@ search_insensitive=Pretraga neosjetljiva
goto_folder=Idite na mapu koja sadrži
module_config=Konfiguracija modula
config_columns_to_display=Stupci za prikaz
config_per_page=Stavke za prikaz na stranici (samo za stare teme)
config_disable_pagination=Onemogući paginaciju (samo za korisnike "Autentične teme")
config_toolbar_style=Podesite stil alatne trake na prikaz u obliku izbornika, <br> s padajućim izbornicima... i kolačiće (samo za korisnike Autentične teme)
config_per_page=Stavke za prikaz po stranici
config_bookmarks=Oznake
no_bookmarks=Još nema oznaka
menu_file=Datoteka
@@ -165,3 +163,4 @@ ownership=Vlasnik
acls=Popis kontrole pristupa
file_detect_encoding=Automatski otkrij kodiranje datoteka
index_return=popis datoteka
upload_dirs=Prijenos imenika

View File

@@ -143,9 +143,7 @@ search_insensitive=A kis- és nagybetűk közötti érzékeny keresés
goto_folder=Ugrás a könyvtár tárolására
module_config=Modul konfiguráció
config_columns_to_display=Megjelenítendő oszlopok
config_per_page=Megjelenítendő elemek oldalanként (csak régi témákhoz)
config_disable_pagination=A lapozás letiltása (csak az „Authentic Theme” felhasználók számára)
config_toolbar_style=Állítsa az eszköztár stílusát menüszerű nézetre, <br> legördülő listákra... és sütikre (csak hiteles témájú felhasználók számára)
config_per_page=Oldalanként megjelenítendő elemek
config_bookmarks=Könyvjelzők
no_bookmarks=Még nincs könyvjelző
menu_file=fájl
@@ -165,3 +163,4 @@ ownership=Tulajdonos
acls=Beléptető lista
file_detect_encoding=A fájlkódolás automatikus észlelése
index_return=fájl felsorolása
upload_dirs=Címtár feltöltése

View File

@@ -143,9 +143,6 @@ search_insensitive=Ricerca senza distinzione tra maiuscole e minuscole
goto_folder=Vai alla cartella contenitore
module_config=Configurazione del modulo
config_columns_to_display=Colonne da visualizzare
config_per_page=Elementi da visualizzare per pagina (solo per vecchi temi)
config_disable_pagination=Disattiva l'impaginazione (solo per utenti che utilizzano il "Tema autentico")
config_toolbar_style=Imposta lo stile della barra degli strumenti su una vista simile a un menu,<br>con menu a discesa... e cookie (solo per utenti che utilizzano il "Tema Autentico")
config_bookmarks=Segnalibri
no_bookmarks=Ancora nessun segnalibro
menu_file=File

3
filemin/lang/it.auto Normal file
View File

@@ -0,0 +1,3 @@
config_per_page=Elementi da visualizzare per pagina
upload_dirs=Caricamento directory

View File

@@ -143,9 +143,7 @@ search_insensitive=大文字と小文字を区別しない検索
goto_folder=含まれているディレクトリに移動する
module_config=モジュール構成
config_columns_to_display=表示する列
config_per_page=ページごとに表示するアイテム(古いテーマのみ)
config_disable_pagination=ページネーションを無効にする「Authentic Theme」ユーザーのみ
config_toolbar_style=ツールバーのスタイルをメニューのようなビューに設定します。<br>ドロップダウン...およびCookieAuthentic Themeユーザーのみ
config_per_page=ページごとに表示するアイテム
config_bookmarks=しおり
no_bookmarks=まだブックマークがありません
menu_file=ファイル
@@ -165,3 +163,4 @@ ownership=オーナー
acls=アクセス制御リスト
file_detect_encoding=ファイルエンコーディングを自動的に検出
index_return=ファイルリスト
upload_dirs=ディレクトリのアップロード

View File

@@ -143,9 +143,7 @@ search_insensitive=대소 문자를 구분하지 않는 검색
goto_folder=포함 디렉토리로 이동
module_config=모듈 구성
config_columns_to_display=표시 할 열
config_per_page=페이지 당 표시 할 항목 (이전 테마 만 해당)
config_disable_pagination=페이지 매김 사용 안함 ('Authentic Theme'사용자 만 해당)
config_toolbar_style=툴바 스타일을 메뉴와 같은보기, 드롭 다운 메뉴 및 쿠키로 설정 (정통 테마 사용자 만 해당)
config_per_page=페이지당 표시할 항목
config_bookmarks=북마크
no_bookmarks=아직 북마크가 없습니다
menu_file=파일
@@ -165,3 +163,4 @@ ownership=소유자
acls=액세스 제어 목록
file_detect_encoding=파일 인코딩 자동 감지
index_return=파일 목록
upload_dirs=디렉토리 업로드

View File

@@ -143,9 +143,7 @@ search_insensitive=Didelė ir maža raidžių paieška
goto_folder=Eikite į katalogą, kuriame yra
module_config=Modulio konfigūracija
config_columns_to_display=Rodomi stulpeliai
config_per_page=Viename puslapyje rodomi elementai (tik senoms temoms)
config_disable_pagination=Išjungti puslapių spausdinimą (tik „Autentiškos temos“ vartotojams)
config_toolbar_style=Įrankių juostos stilių nustatykite į meniu panašų vaizdą, „<br>“ su išskleidžiamaisiais meniu... ir slapukus (tik autentiškos temos vartotojams)
config_per_page=Viename puslapyje rodomi elementai
config_bookmarks=Žymos
no_bookmarks=Žymių dar nėra
menu_file=Byla
@@ -165,3 +163,4 @@ ownership=Savininkas
acls=Prieigos kontrolės sąrašas
file_detect_encoding=Automatiškai aptikti failų kodavimą
index_return=failų sąrašas
upload_dirs=Katalogo įkėlimas

View File

@@ -143,9 +143,7 @@ search_insensitive=Burtu nejūtīga meklēšana
goto_folder=Iet uz saturošo direktoriju
module_config=Moduļa konfigurācija
config_columns_to_display=Parādāmās kolonnas
config_per_page=Vienumi, kas tiek parādīti vienā lapā (tikai vecām tēmām)
config_disable_pagination=Atspējot lapas veidošanu (tikai lietotājiem “Autentiska tēma”)
config_toolbar_style=Rīkjoslas stila iestatīšana izvēlnei līdzīgam skatam, <br> ar nolaižamajām izvēlnēm... un sīkdatnēm (tikai autentiskas motīva lietotājiem)
config_per_page=Vienumi, kas parāda vienā lapā
config_bookmarks=Grāmatzīmes
no_bookmarks=Pagaidām nav grāmatzīmju
menu_file=Fails
@@ -165,3 +163,4 @@ ownership=Īpašnieks
acls=Piekļuves kontroles saraksts
file_detect_encoding=Automātiski noteikt failu kodējumu
index_return=failu saraksts
upload_dirs=Direktorija augšupielāde

View File

@@ -143,9 +143,7 @@ search_insensitive=Carian insensitif kes
goto_folder=Pergi ke direktori yang mengandungi
module_config=Konfigurasi modul
config_columns_to_display=Lajur untuk dipaparkan
config_per_page=Item untuk dipaparkan setiap halaman (untuk tema lama sahaja)
config_disable_pagination=Lumpuhkan pagination (untuk pengguna 'Hanya Tema Sah')
config_toolbar_style=Tetapkan gaya bar alat ke menu seperti menu, dengan dropdowns... dan cookies (untuk pengguna Tema Sah sahaja)
config_per_page=Item untuk dipaparkan setiap halaman
config_bookmarks=Penanda buku
no_bookmarks=Tiada penanda buku lagi
menu_file=Fail
@@ -165,3 +163,4 @@ ownership=Pemilik
acls=Senarai Kawalan Akses
file_detect_encoding=Mengesan pengekodan fail secara automatik
index_return=senarai fail
upload_dirs=Muat Naik Direktori

View File

@@ -143,9 +143,7 @@ search_insensitive=Tiftix insensittiv mill-każ
goto_folder=Mur fid-direttorju li fih
module_config=Konfigurazzjoni tal-Modulu
config_columns_to_display=Kolonni li juru
config_per_page=Oġġetti li jintwerew għal kull paġna (għal temi antiki biss)
config_disable_pagination=Itfi l-paginazzjoni (għal utenti ta '' Tema Awtentika 'biss)
config_toolbar_style=Issettja l-istil tal-istrument tal-għodda għal fehma li tixbah il-menu, bil-menu li jinżel... u l-cookies (għal utenti tat-Tema Awtentika biss)
config_per_page=Oġġetti li għandhom jintwerew għal kull paġna
config_bookmarks=Bookmarks
no_bookmarks=M'hemm l-ebda bookmarks għalissa
menu_file=Fajl
@@ -165,3 +163,4 @@ ownership=Sid il-prodott
acls=Lista tal-Kontroll tal-Aċċess
file_detect_encoding=Skopri awtomatikament il-kodifikazzjoni tal-fajl
index_return=elenkar tal-fajl
upload_dirs=Direttorju Upload

View File

@@ -143,9 +143,7 @@ search_insensitive=Hoofdletterongevoelig zoeken
goto_folder=Ga naar de directory
module_config=Module configuratie
config_columns_to_display=Weer te geven kolommen
config_per_page=Weer te geven items per pagina (alleen voor oude thema's)
config_disable_pagination=Paginering uitschakelen (alleen voor 'Authentic Theme'-gebruikers)
config_toolbar_style=Werkbalkstijl instellen op menu-achtige weergave, <br> met dropdowns... en cookies (alleen voor Authentic Theme-gebruikers)
config_per_page=Items om per pagina weer te geven
config_bookmarks=Bladwijzers
no_bookmarks=Nog geen bladwijzers
menu_file=het dossier
@@ -165,3 +163,4 @@ ownership=Eigenaar
acls=Toegangscontrole lijst
file_detect_encoding=Automatisch bestandscodering detecteren
index_return=bestandslijst
upload_dirs=Directory uploaden

View File

@@ -142,9 +142,6 @@ search_insensitive=Case-insensitivt søk
goto_folder=Gå til mappen den er i
module_config=Modul konfigurasjon
config_columns_to_display=Kolonner som skal vises
config_per_page=Elementer som skal vises per side (kun for gamle temaer)
config_disable_pagination=Deaktiver paginering (kun for brukere av Authentic tema)
config_toolbar_style=Sett verktøylinje-stil til meny-lignende,<br>med nedtrekk... og info.kapsler (kun for brukere av Authentic tema)
config_bookmarks=Bokmerker
no_bookmarks=Ingen bokmerker enda
menu_file=Fil

View File

@@ -1,5 +1,7 @@
acl_allowed_paths_explain=For rotkompatibel bruker, hvis tillatt katalog bare er satt til $HOME, vil den være ekvivalent med / (full disktilgang)
config_per_page=Elementer som skal vises per side
acls=Tilgangskontrolliste
file_detect_encoding=Registrer filkoding automatisk
index_return=filoppføring
upload_dirs=Katalogopplasting

View File

@@ -143,9 +143,7 @@ search_insensitive=Wyszukiwanie bez rozróżniania wielkości liter
goto_folder=Przejdź do zawierającego katalog
module_config=Konfiguracja modułu
config_columns_to_display=Kolumny do wyświetlenia
config_per_page=Elementy do wyświetlenia na stronie (tylko dla starych motywów)
config_disable_pagination=Wyłącz podział na strony (tylko dla użytkowników „Motywu autentycznego”)
config_toolbar_style=Ustaw styl paska narzędzi na widok podobny do menu, <br> z rozwijanymi menu... i plikami cookie (tylko dla użytkowników motywów autentycznych)
config_per_page=Pozycje do wyświetlenia na stronie
config_bookmarks=Zakładki
no_bookmarks=Brak zakładek
menu_file=Plik
@@ -165,3 +163,4 @@ ownership=Właściciel
acls=Lista kontroli dostępu
file_detect_encoding=Automatycznie wykrywaj kodowanie plików
index_return=lista plików
upload_dirs=Przesyłanie katalogu

View File

@@ -143,9 +143,7 @@ search_insensitive=Pesquisa sem distinção entre maiúsculas e minúsculas
goto_folder=Vá para o diretório que contém
module_config=Configuração do módulo
config_columns_to_display=Colunas a serem exibidas
config_per_page=Itens a serem exibidos por página (apenas para temas antigos)
config_disable_pagination=Desativar paginação (apenas para usuários do 'Tema Autêntico')
config_toolbar_style=Defina o estilo da barra de ferramentas para uma visualização semelhante a menu, <br> com menus suspensos... e cookies (somente para usuários com Tema Autêntico)
config_per_page=Itens para exibir por página
config_bookmarks=Favoritos
no_bookmarks=Ainda não há favoritos
menu_file=Arquivo
@@ -165,3 +163,4 @@ ownership=Proprietário
acls=Lista de controle de acesso
file_detect_encoding=Detectar automaticamente a codificação do arquivo
index_return=lista de arquivos
upload_dirs=Upload de diretório

View File

@@ -143,9 +143,7 @@ search_insensitive=Pesquisa sem distinção entre maiúsculas e minúsculas
goto_folder=Vá para o diretório que contém
module_config=Configuração do módulo
config_columns_to_display=Colunas a serem exibidas
config_per_page=Itens a serem exibidos por página (apenas para temas antigos)
config_disable_pagination=Desativar paginação (apenas para usuários do 'Tema Autêntico')
config_toolbar_style=Defina o estilo da barra de ferramentas para uma visualização semelhante a menu, <br> com menus suspensos... e cookies (somente para usuários com Tema Autêntico)
config_per_page=Itens para exibir por página
config_bookmarks=Favoritos
no_bookmarks=Ainda não há favoritos
menu_file=Arquivo
@@ -165,3 +163,4 @@ ownership=Proprietário
acls=Lista de controle de acesso
file_detect_encoding=Detectar automaticamente a codificação do arquivo
index_return=lista de arquivos
upload_dirs=Upload de diretório

View File

@@ -143,9 +143,7 @@ search_insensitive=Căutare insensibilă din caz
goto_folder=Accesați directorul care conține
module_config=Configurația modulului
config_columns_to_display=Coloane de afișat
config_per_page=Elemente de afișat pe pagină (doar pentru teme vechi)
config_disable_pagination=Dezactivați paginarea (doar pentru utilizatorii „Temă autentică”)
config_toolbar_style=Setați stilul barei de instrumente la vizualizarea asemănătoare cu meniul, <br> cu meniuri derulante... și cookie-uri (doar pentru utilizatorii cu temă autentică)
config_per_page=Elemente de afișat pe pagină
config_bookmarks=Marcaje
no_bookmarks=Nu există marcaje încă
menu_file=Fişier
@@ -165,3 +163,4 @@ ownership=Proprietar
acls=Lista de control acces
file_detect_encoding=Detectează automat codificarea fișierului
index_return=listarea fișierelor
upload_dirs=Încărcare director

View File

@@ -143,9 +143,7 @@ search_insensitive=Поиск без учета регистра
goto_folder=Перейти в каталог, содержащий
module_config=Конфигурация модуля
config_columns_to_display=Столбцы для отображения
config_per_page=Элементы для отображения на странице (только для старых тем)
config_disable_pagination=Отключить нумерацию страниц (только для пользователей «Аутентичные темы»)
config_toolbar_style=Установить стиль панели инструментов в виде меню, просмотра с выпадающими меню и файлов cookie (только для пользователей Authentic Theme)
config_per_page=Элементы для отображения на странице
config_bookmarks=закладки
no_bookmarks=Еще нет закладок
menu_file=файл
@@ -165,3 +163,4 @@ ownership=владелец
acls=Список контроля доступа
file_detect_encoding=Автоматически определять кодировку файлов
index_return=список файлов
upload_dirs=Загрузка каталога

View File

@@ -143,9 +143,7 @@ search_insensitive=Vyhľadávanie bez rozlišovania veľkých a malých písmen
goto_folder=Prejdite do obsahujúceho adresára
module_config=Konfigurácia modulu
config_columns_to_display=Stĺpce na zobrazenie
config_per_page=Položky, ktoré sa majú zobraz na stránke (iba pre staré témy)
config_disable_pagination=Zakázať stránkovanie (iba pre používateľov „Autentického motívu“)
config_toolbar_style=Nastaviť štýl panela s nástrojmi na zobrazenie podobné menu, <br> pomocou rozbaľovacích zoznamov... a súborov cookie (iba pre používateľov Authentic Theme)
config_per_page=Položky na zobrazenie na stránke
config_bookmarks=záložky
no_bookmarks=Zatiaľ žiadne záložky
menu_file=súbor
@@ -165,3 +163,4 @@ ownership=vlastník
acls=Zoznam riadenia prístupu
file_detect_encoding=Automaticky zistiť kódovanie súborov
index_return=zoznam súborov
upload_dirs=Nahranie adresára

View File

@@ -143,9 +143,7 @@ search_insensitive=Iskanje neobčutljivo
goto_folder=Pojdite na imenik, ki vsebuje
module_config=Konfiguracija modula
config_columns_to_display=Stolpci za prikaz
config_per_page=Elementi za prikaz na strani (samo za stare teme)
config_disable_pagination=Onemogoči paginacijo (samo za uporabnike avtentične teme)
config_toolbar_style=Nastavite slog orodne vrstice na prikaz v obliki menija, <br> s spustnimi padajočimi mesti... in piškotki (samo za uporabnike avtentične teme)
config_per_page=Elementi za prikaz na stran
config_bookmarks=Zaznamki
no_bookmarks=Zaznamkov še ni
menu_file=mapa
@@ -165,3 +163,4 @@ ownership=Lastnik
acls=Seznam nadzora dostopa
file_detect_encoding=Samodejno zaznaj kodiranje datotek
index_return=seznam datotek
upload_dirs=Nalaganje imenika

View File

@@ -143,9 +143,7 @@ search_insensitive=Ärenden känslig sökning
goto_folder=Gå till innehåller katalog
module_config=Modulkonfiguration
config_columns_to_display=Kolumner som ska visas
config_per_page=Objekt som ska visas per sida (endast för gamla teman)
config_disable_pagination=Inaktivera pagination (endast för användare av "Autentiskt tema")
config_toolbar_style=Ställ in verktygsfältstil på menyliknande vy, med dropdowns... och cookies (endast för autentiska teman användare)
config_per_page=Objekt att visa per sida
config_bookmarks=bokmärken
no_bookmarks=Inga bokmärken än
menu_file=Fil
@@ -165,3 +163,4 @@ ownership=Ägare
acls=Åtkomstkontrollista
file_detect_encoding=Identifiera filkodning automatiskt
index_return=fillista
upload_dirs=Kataloguppladdning

View File

@@ -143,9 +143,7 @@ search_insensitive=การค้นหาแบบคำนึงถึงข
goto_folder=ไปที่ไดเรกทอรีที่มี
module_config=การกำหนดค่าโมดูล
config_columns_to_display=คอลัมน์ที่จะแสดง
config_per_page=รายการที่จะแสดงต่อหน้า (สำหรับธีมเก่าเท่านั้น)
config_disable_pagination=ปิดการแบ่งหน้า (สำหรับผู้ใช้ 'ธีมของแท้' เท่านั้น)
config_toolbar_style=ตั้งค่าสไตล์แถบเครื่องมือให้เป็นมุมมองที่เหมือนเมนู <br> ที่มีดรอปดาวน์... และคุกกี้ (สำหรับผู้ใช้ธีมแท้เท่านั้น)
config_per_page=รายการที่จะแสดงต่อหน้า
config_bookmarks=ที่คั่น
no_bookmarks=ยังไม่มีบุ๊คมาร์ค
menu_file=ไฟล์
@@ -165,3 +163,4 @@ ownership=เจ้าของ
acls=รายการควบคุมการเข้าถึง
file_detect_encoding=ตรวจจับการเข้ารหัสไฟล์โดยอัตโนมัติ
index_return=รายชื่อไฟล์
upload_dirs=อัพโหลดไดเร็กทอรี

View File

@@ -143,9 +143,7 @@ search_insensitive=Büyük / küçük harfe duyarlı olmayan arama
goto_folder=İçeren dizine git
module_config=Modül yapılandırması
config_columns_to_display=Görüntülenecek sütunlar
config_per_page=Sayfa başına görüntülenecek öğeler (yalnızca eski temalar için)
config_disable_pagination=Sayfalandırmayı devre dışı bırak (yalnızca 'Otantik Tema' kullanıcıları için)
config_toolbar_style=Araç çubuğu stilini menü benzeri görünüme, açılan menüleri... ve çerezleri kullanarak ayarlayın (yalnızca Otantik Tema kullanıcıları için)
config_per_page=Sayfa başına görüntülenecek öğeler
config_bookmarks=Yer imleri
no_bookmarks=Henüz yer işareti yok
menu_file=Dosya
@@ -165,3 +163,4 @@ ownership=Sahip
acls=Erişim kontrol Listesi
file_detect_encoding=Dosya kodlamasını otomatik olarak algıla
index_return=dosya listesi
upload_dirs=Dizin Yükleme

View File

@@ -143,9 +143,7 @@ search_insensitive=Пошук нечутливий
goto_folder=Перейдіть до каталогу, що містить
module_config=Конфігурація модуля
config_columns_to_display=Стовпці для відображення
config_per_page=Елементи для відображення на сторінці (лише для старих тем)
config_disable_pagination=Вимкнути пагинацію (лише для користувачів "Автентична тема")
config_toolbar_style=Встановіть стиль панелі інструментів для перегляду у вигляді меню, <br> зі спадними меню та файлами cookie (лише для користувачів Автентичної теми)
config_per_page=Елементи для відображення на сторінці
config_bookmarks=Закладки
no_bookmarks=Закладки ще немає
menu_file=Файл
@@ -165,3 +163,4 @@ ownership=Власник
acls=Список контролю доступу
file_detect_encoding=Автоматично виявляти кодування файлів
index_return=список файлів
upload_dirs=Завантаження каталогу

View File

@@ -143,9 +143,7 @@ search_insensitive=کیس بے حس تلاش
goto_folder=مشتمل ڈائرکٹری پر جائیں
module_config=ماڈیول ترتیب
config_columns_to_display=کالمز کو ظاہر کرنے کے لئے
config_per_page=آئٹمز فی صفحہ ظاہر کرنے کے لئے (صرف پرانے موضوعات کیلئے)
config_disable_pagination=صفحہ بندی کو غیر فعال کریں (صرف 'مستند تھیم' صارفین کے لئے)
config_toolbar_style=Set toolbar style to menu-like view,<br>with dropdowns ... and cookies (for Authentic Theme users only)
config_per_page=فی صفحہ ظاہر کرنے کے لیے آئٹمز
config_bookmarks=بُک مارکس
no_bookmarks=ابھی تک کوئی بُک مارکس نہیں ہے
menu_file=فائل
@@ -165,3 +163,4 @@ ownership=مالک
acls=رسائی کی فہرست تک رسائی حاصل کریں
file_detect_encoding=خود کار طریقے سے فائل انکوڈنگ کا پتہ لگائیں
index_return=فائل کی فہرست
upload_dirs=ڈائرکٹری اپ لوڈ

View File

@@ -143,9 +143,7 @@ search_insensitive=Trường hợp tìm kiếm không nhạy cảm
goto_folder=Đi đến thư mục chứa
module_config=Cấu hình mô-đun
config_columns_to_display=Cột để hiển thị
config_per_page=Các mục để hiển thị trên mỗi trang (chỉ dành cho chủ đề cũ)
config_disable_pagination=Vô hiệu hóa phân trang (chỉ dành cho người dùng 'Authentic Theme')
config_toolbar_style=Đặt kiểu thanh công cụ thành chế độ xem giống như menu, <br> với danh sách thả xuống... và cookie (chỉ dành cho người dùng Theme xác thực)
config_per_page=Các mục hiển thị trên mỗi trang
config_bookmarks=Dấu trang
no_bookmarks=Chưa có dấu trang nào
menu_file=Tập tin
@@ -165,3 +163,4 @@ ownership=Chủ nhân
acls=Danh sách điều khiển truy cập
file_detect_encoding=Tự động phát hiện mã hóa tệp
index_return=danh sách hồ sơ
upload_dirs=Tải lên thư mục

View File

@@ -143,9 +143,7 @@ search_insensitive=不区分大小写的搜索
goto_folder=转到包含目录
module_config=模块配置
config_columns_to_display=要显示的列
config_per_page=每页显示的项目(仅适用于旧主题)
config_disable_pagination=禁用分页(仅适用于“正宗主题”用户)
config_toolbar_style=将工具栏样式设置为类似于菜单的视图并带有下拉菜单和Cookie仅适用于Authentic Theme用户
config_per_page=每页显示的项目
config_bookmarks=书签
no_bookmarks=尚无书签
menu_file=文件
@@ -165,3 +163,4 @@ ownership=所有者
acls=访问控制列表
file_detect_encoding=自动检测文件编码
index_return=文件清单
upload_dirs=目录上传

View File

@@ -143,9 +143,7 @@ search_insensitive=不區分大小寫的搜索
goto_folder=轉到包含目錄
module_config=模塊配置
config_columns_to_display=要顯示的列
config_per_page=每頁顯示的項目(僅適用於舊主題)
config_disable_pagination=禁用分頁(僅適用於“正宗主題”用戶)
config_toolbar_style=將工具欄樣式設置為類似於菜單的視圖並帶有下拉菜單和Cookie僅適用於Authentic Theme用戶
config_per_page=每頁顯示的項目
config_bookmarks=書籤
no_bookmarks=尚無書籤
menu_file=文件
@@ -165,3 +163,4 @@ ownership=所有者
acls=訪問控制列表
file_detect_encoding=自動檢測文件編碼
index_return=文件清單
upload_dirs=目錄上傳

View File

@@ -1,6 +1,7 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
require '../config-lib.pl';
&ReadParse();
get_paths();
@@ -11,8 +12,6 @@ $columns =~ s/\0/,/g;
%config = (
'columns' => $columns,
'per_page' => $in{'per_page'},
'disable_pagination' => $in{'disable_pagination'},
'menu_style' => $in{'menu_style'},
'config_portable_module_filemanager_editor_detect_encoding' => $in{'config_portable_module_filemanager_editor_detect_encoding'},
);
my $max_allowed = $in{'max_allowed'};
@@ -21,6 +20,7 @@ if($max_allowed) {
}
&write_file("$confdir/.config", \%config);
&save_module_preferences($module_name, \%config);
$bookmarks = $in{'bookmarks'};
$bookmarks =~ s/\r\n/\n/g;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,47 +0,0 @@
if (typeof $__theme_name__ != 'undefined' && $__theme_name__ == 'authentic')
{
function looksLikeScheme(a) {}
function update() {}
function change(a) {}
}
else
{
CodeMirror.modeURL = "unauthenticated/js/lib/codemirror/mode/%N/%N.js";
var editor = CodeMirror.fromTextArea(document.getElementById("data"), {
mode: "scheme",
lineNumbers: true,
viewportMargin: Infinity
});
var pending;
function looksLikeScheme(code) {
return !/^\s*\(\s*function\b/.test(code) && /^\s*[;\(]/.test(code);
}
function update() {
editor.setOption("mode", looksLikeScheme(editor.getValue()) ? "scheme" : "javascript");
}
function change(val) {
if (typeof $__theme_name__ != 'undefined' && $__theme_name__ == 'authentic')
{
return;
}
if (m = /.+\.([^.]+)$/.exec(val))
{
var info = CodeMirror.findModeByExtension(m[1]);
if (info) {
mode = info.mode;
spec = info.mime;
editor.setOption("mode", spec);
CodeMirror.autoLoadMode(editor, mode);
} else {
update();
}
} else {
update();
}
}
}

View File

@@ -1,474 +0,0 @@
List of CodeMirror contributors. Updated before every release.
4r2r
Aaron Brooks
Abdelouahab
Abe Fettig
Adam Ahmed
Adam King
adanlobato
Adán Lobato
Adrian Aichner
aeroson
Ahmad Amireh
Ahmad M. Zawawi
ahoward
Akeksandr Motsjonov
Alberto González Palomo
Alberto Pose
Albert Xing
Alexander Pavlov
Alexander Schepanovski
Alexander Shvets
Alexander Solovyov
Alexandre Bique
alexey-k
Alex Piggott
Aliaksei Chapyzhenka
Amin Shali
Amsul
amuntean
Amy
Ananya Sen
anaran
AndersMad
Anders Nawroth
Anderson Mesquita
Andrea G
Andreas Reischuck
Andre von Houck
Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov
Andy Joslin
Andy Kimball
Andy Li
Angelo
angelozerr
angelo.zerr@gmail.com
Ankit
Ankit Ahuja
Ansel Santosa
Anthony Dugois
Anthony Grimes
Anton Kovalyov
AQNOUCH Mohammed
areos
as3boyan
AtomicPages LLC
Atul Bhouraskar
Aurelian Oancea
Bastian Müller
belhaj
Bem Jones-Bey
benbro
Beni Cherniavsky-Paskin
Benjamin DeCoste
Ben Keen
Bernhard Sirlinger
Bert Chang
Billy Moon
binny
B Krishna Chaitanya
Blaine G
blukat29
boomyjee
borawjm
Brad Metcalf
Brandon Frohs
Brandon Wamboldt
Brett Zamir
Brian Grinstead
Brian Sletten
Bruce Mitchener
Calin Barbat
Chandra Sekhar Pydi
Charles Skelton
Cheah Chu Yeow
Chris Coyier
Chris Granger
Chris Houseknecht
Chris Lohfink
Chris Morgan
Christian Oyarzun
Christian Petrov
Christopher Brown
Christopher Mitchell
Christopher Pfohl
ciaranj
CodeAnimal
coderaiser
ComFreek
Curtis Gagliardi
dagsta
daines
Dale Jung
Dan Bentley
Dan Heberden
Daniel, Dao Quang Minh
Daniele Di Sarli
Daniel Faust
Daniel Huigens
Daniel KJ
Daniel Neel
Daniel Parnell
Danny Yoo
darealshinji
Darius Roberts
Dave Myers
David Barnett
David Mignot
David Pathakjee
David Vázquez
deebugger
Deep Thought
Devon Carew
dignifiedquire
Dimage Sapelkin
Dmitry Kiselyov
domagoj412
Dominator008
Domizio Demichelis
Doug Wikle
Drew Bratcher
Drew Hintz
Drew Khoury
Dror BG
duralog
eborden
edsharp
ekhaled
Enam Mijbah Noor
Eric Allam
eustas
Fabien O'Carroll
Fabio Zendhi Nagao
Faiza Alsaied
Fauntleroy
fbuchinger
feizhang365
Felipe Lalanne
Felix Raab
Filip Noetzel
flack
ForbesLindesay
Forbes Lindesay
Ford_Lawnmower
Forrest Oliphant
Frank Wiegand
Gabriel Gheorghian
Gabriel Horner
Gabriel Nahmias
galambalazs
Gautam Mehta
gekkoe
Gerard Braad
Gergely Hegykozi
Giovanni Calò
Glenn Jorde
Glenn Ruehle
Golevka
Gordon Smith
Grant Skinner
greengiant
Gregory Koberger
Guillaume Massé
Guillaume Massé
Gustavo Rodrigues
Hakan Tunc
Hans Engel
Hardest
Hasan Karahan
Hector Oswaldo Caballero
Herculano Campos
Hiroyuki Makino
hitsthings
Hocdoc
Ian Beck
Ian Dickinson
Ian Wehrman
Ian Wetherbee
Ice White
ICHIKAWA, Yuji
ilvalle
Ingo Richter
Irakli Gozalishvili
Ivan Kurnosov
Ivoah
Jacob Lee
Jakob Miland
Jakub Vrana
Jakub Vrána
James Campos
James Thorne
Jamie Hill
Jan Jongboom
jankeromnes
Jan Keromnes
Jan Odvarko
Jan T. Sott
Jared Forsyth
Jason
Jason Barnabe
Jason Grout
Jason Johnston
Jason San Jose
Jason Siefken
Jaydeep Solanki
Jean Boussier
Jeff Blaisdell
jeffkenton
Jeff Pickhardt
jem (graphite)
Jeremy Parmenter
Jochen Berger
Johan Ask
John Connor
John Lees-Miller
John Snelson
John Van Der Loo
Jonas Döbertin
Jonathan Malmaud
jongalloway
Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn
Joseph Pecoraro
Joshua Newman
Josh Watzman
jots
jsoojeon
ju1ius
Juan Benavides Romero
Jucovschi Constantin
Juho Vuori
Justin Hileman
jwallers@gmail.com
kaniga
Ken Newman
Ken Rockot
Kevin Earls
Kevin Sawicki
Kevin Ushey
Klaus Silveira
Koh Zi Han, Cliff
komakino
Konstantin Lopuhin
koops
ks-ifware
kubelsmieci
KwanEsq
Lanfei
Lanny
Laszlo Vidacs
leaf corcoran
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
Liam Newman
Libo Cannici
LloydMilligan
LM
lochel
Lorenzo Stoakes
Luciano Longo
Luke Stagner
lynschinzer
M1cha
Madhura Jayaratne
Maksim Lin
Maksym Taran
Malay Majithia
Manuel Rego Casasnovas
Marat Dreizin
Marcel Gerber
Marco Aurélio
Marco Munizaga
Marcus Bointon
Marek Rudnicki
Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Lentczner
Marko Bonaci
Martin Balek
Martín Gaitán
Martin Hasoň
Martin Hunt
Mason Malone
Mateusz Paprocki
Mathias Bynens
mats cronqvist
Matthew Beale
Matthew Rathbone
Matthias Bussonnier
Matthias BUSSONNIER
Matt McDonald
Matt Pass
Matt Sacks
mauricio
Maximilian Hils
Maxim Kraev
Max Kirsch
Max Schaefer
Max Xiantu
mbarkhau
Metatheos
Micah Dubinko
Michael Grey
Michael Kaminsky
Michael Lehenbauer
Michael Zhou
Michal Dorner
Mighty Guava
Miguel Castillo
mihailik
Mike
Mike Brevoort
Mike Diaz
Mike Ivanov
Mike Kadin
MinRK
Miraculix87
misfo
mkaminsky11
mloginov
Moritz Schwörer
mps
ms
mtaran-google
Narciso Jaramillo
Nathan Williams
ndr
nerbert
nextrevision
ngn
nguillaumin
Ng Zhi An
Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Kreeger
Nick Small
Niels van Groningen
nightwing
Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
nilp0inter
Nisarg Jhaveri
nlwillia
noragrossman
Norman Rzepka
Oreoluwa Onatemowo
pablo
Page
Panupong Pasupat
paris
Paris
Patil Arpith
Patrick Stoica
Patrick Strawderman
Paul Garvin
Paul Ivanov
Pavel Feldman
Pavel Strashkin
Paweł Bartkiewicz
peteguhl
Peter Flynn
peterkroon
Peter Kroon
prasanthj
Prasanth J
Radek Piórkowski
Rahul
Randall Mason
Randy Burden
Randy Edmunds
Rasmus Erik Voel Jensen
ray ratchup
Ray Ratchup
Richard van der Meer
Richard Z.H. Wang
Robert Crossfield
Roberto Abdelkader Martínez Pérez
robertop23
Robert Plummer
Rrandom
Ruslan Osmanov
Ryan Prior
sabaca
Samuel Ainsworth
sandeepshetty
Sander AKA Redsandro
santec
Sascha Peilicke
satamas
satchmorun
sathyamoorthi
SCLINIC\jdecker
Scott Aikin
Scott Goodhew
Sebastian Zaha
shaund
shaun gilchrist
Shawn A
sheopory
Shiv Deepak
Shmuel Englard
Shubham Jain
silverwind
snasa
soliton4
sonson
spastorelli
srajanpaliwal
Stanislav Oaserele
Stas Kobzar
Stefan Borsje
Steffen Beyer
Steve O'Hara
stoskov
Sungho Kim
Taha Jahangir
Takuji Shimokawa
Tarmil
tel
tfjgeorge
Thaddee Tyl
TheHowl
think
Thomas Dvornik
Thomas Schmid
Tim Alby
Tim Baumann
Timothy Farrell
Timothy Hatcher
TobiasBg
Tomas-A
Tomas Varaneckas
Tom Erik Støwer
Tom MacWright
Tony Jian
Travis Heppe
Triangle717
twifkak
Vestimir Markov
vf
Vincent Woo
Volker Mische
wenli
Wesley Wiser
Will Binns-Smith
William Jamieson
William Stein
Willy
Wojtek Ptak
Xavier Mendez
Yassin N. Hassan
YNH Webdev
Yunchi Luo
Yuvi Panda
Zachary Dremann
Zhang Hao
zziuni
魏鹏刚

View File

@@ -1,88 +0,0 @@
# How to contribute
- [Getting help](#getting-help-)
- [Submitting bug reports](#submitting-bug-reports-)
- [Contributing code](#contributing-code-)
## Getting help
Community discussion, questions, and informal bug reporting is done on the
[discuss.CodeMirror forum](http://discuss.codemirror.net).
## Submitting bug reports
The preferred way to report bugs is to use the
[GitHub issue tracker](http://github.com/codemirror/CodeMirror/issues). Before
reporting a bug, read these pointers.
**Note:** The issue tracker is for *bugs*, not requests for help. Questions
should be asked on the
[discuss.CodeMirror forum](http://discuss.codemirror.net) instead.
### Reporting bugs effectively
- CodeMirror is maintained by volunteers. They don't owe you anything, so be
polite. Reports with an indignant or belligerent tone tend to be moved to the
bottom of the pile.
- Include information about **the browser in which the problem occurred**. Even
if you tested several browsers, and the problem occurred in all of them,
mention this fact in the bug report. Also include browser version numbers and
the operating system that you're on.
- Mention which release of CodeMirror you're using. Preferably, try also with
the current development snapshot, to ensure the problem has not already been
fixed.
- Mention very precisely what went wrong. "X is broken" is not a good bug
report. What did you expect to happen? What happened instead? Describe the
exact steps a maintainer has to take to make the problem occur. We can not
fix something that we can not observe.
- If the problem can not be reproduced in any of the demos included in the
CodeMirror distribution, please provide an HTML document that demonstrates
the problem. The best way to do this is to go to
[jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
include the resulting link in your bug report.
## Contributing code
- Make sure you have a [GitHub Account](https://github.com/signup/free)
- Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
([how to fork a repo](https://help.github.com/articles/fork-a-repo))
- Make your changes
- If your changes are easy to test or likely to regress, add tests.
Tests for the core go into `test/test.js`, some modes have their own
test suite under `mode/XXX/test.js`. Feel free to add new test
suites to modes that don't have one yet (be sure to link the new
tests into `test/index.html`).
- Follow the general code style of the rest of the project (see
below). Run `bin/lint` to verify that the linter is happy.
- Make sure all tests pass. Visit `test/index.html` in your browser to
run them.
- Submit a pull request
([how to create a pull request](https://help.github.com/articles/fork-a-repo)).
Don't put more than one feature/fix in a single pull request.
By contributing code to CodeMirror you
- agree to license the contributed code under CodeMirror's [MIT
license](http://codemirror.net/LICENSE).
- confirm that you have the right to contribute and license the code
in question. (Either you hold all rights on the code, or the rights
holder has explicitly granted the right to use it like this,
through a compatible open source license or through a direct
agreement with you.)
### Coding standards
- 2 spaces per indentation level, no tabs.
- Include semicolons after statements.
- Note that the linter (`bin/lint`) which is run after each commit
complains about unused variables and functions. Prefix their names
with an underscore to muffle it.
- CodeMirror does *not* follow JSHint or JSLint prescribed style.
Patches that try to 'fix' code to pass one of these linters will be
unceremoniously discarded.

View File

@@ -1,19 +0,0 @@
Copyright (C) 2015 by Marijn Haverbeke <marijnh@gmail.com> and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,27 +0,0 @@
# CodeMirror
[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/)
CodeMirror is a versatile text editor implemented in JavaScript for
the browser. It is specialized for editing code, and comes with over
100 language modes and various addons that implement more advanced
editing functionality.
A rich programming API and a CSS theming system are available for
customizing CodeMirror to fit your application, and extending it with
new functionality.
You can find more information (and the
[manual](http://codemirror.net/doc/manual.html)) on the [project
page](http://codemirror.net). For questions and discussion, use the
[discussion forum](http://discuss.codemirror.net/).
See
[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
for contributing guidelines.
The CodeMirror community aims to be welcoming to everybody. We use the
[Contributor Covenant
(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
conduct.

View File

@@ -1,183 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var noOptions = {};
var nonWS = /[^\s\u00a0]/;
var Pos = CodeMirror.Pos;
function firstNonWS(str) {
var found = str.search(nonWS);
return found == -1 ? 0 : found;
}
CodeMirror.commands.toggleComment = function(cm) {
var minLine = Infinity, ranges = cm.listSelections(), mode = null;
for (var i = ranges.length - 1; i >= 0; i--) {
var from = ranges[i].from(), to = ranges[i].to();
if (from.line >= minLine) continue;
if (to.line >= minLine) to = Pos(minLine, 0);
minLine = from.line;
if (mode == null) {
if (cm.uncomment(from, to)) mode = "un";
else { cm.lineComment(from, to); mode = "line"; }
} else if (mode == "un") {
cm.uncomment(from, to);
} else {
cm.lineComment(from, to);
}
}
};
CodeMirror.defineExtension("lineComment", function(from, to, options) {
if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from);
var commentString = options.lineComment || mode.lineComment;
if (!commentString) {
if (options.blockCommentStart || mode.blockCommentStart) {
options.fullLines = true;
self.blockComment(from, to, options);
}
return;
}
var firstLine = self.getLine(from.line);
if (firstLine == null) return;
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
var pad = options.padding == null ? " " : options.padding;
var blankLines = options.commentBlankLines || from.line == to.line;
self.operation(function() {
if (options.indent) {
var baseString = firstLine.slice(0, firstNonWS(firstLine));
for (var i = from.line; i < end; ++i) {
var line = self.getLine(i), cut = baseString.length;
if (!blankLines && !nonWS.test(line)) continue;
if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
}
} else {
for (var i = from.line; i < end; ++i) {
if (blankLines || nonWS.test(self.getLine(i)))
self.replaceRange(commentString + pad, Pos(i, 0));
}
}
});
});
CodeMirror.defineExtension("blockComment", function(from, to, options) {
if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from);
var startString = options.blockCommentStart || mode.blockCommentStart;
var endString = options.blockCommentEnd || mode.blockCommentEnd;
if (!startString || !endString) {
if ((options.lineComment || mode.lineComment) && options.fullLines != false)
self.lineComment(from, to, options);
return;
}
var end = Math.min(to.line, self.lastLine());
if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
var pad = options.padding == null ? " " : options.padding;
if (from.line > end) return;
self.operation(function() {
if (options.fullLines != false) {
var lastLineHasText = nonWS.test(self.getLine(end));
self.replaceRange(pad + endString, Pos(end));
self.replaceRange(startString + pad, Pos(from.line, 0));
var lead = options.blockCommentLead || mode.blockCommentLead;
if (lead != null) for (var i = from.line + 1; i <= end; ++i)
if (i != end || lastLineHasText)
self.replaceRange(lead + pad, Pos(i, 0));
} else {
self.replaceRange(endString, to);
self.replaceRange(startString, from);
}
});
});
CodeMirror.defineExtension("uncomment", function(from, to, options) {
if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from);
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
// Try finding line comments
var lineString = options.lineComment || mode.lineComment, lines = [];
var pad = options.padding == null ? " " : options.padding, didSomething;
lineComment: {
if (!lineString) break lineComment;
for (var i = start; i <= end; ++i) {
var line = self.getLine(i);
var found = line.indexOf(lineString);
if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
lines.push(line);
}
self.operation(function() {
for (var i = start; i <= end; ++i) {
var line = lines[i - start];
var pos = line.indexOf(lineString), endPos = pos + lineString.length;
if (pos < 0) continue;
if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
didSomething = true;
self.replaceRange("", Pos(i, pos), Pos(i, endPos));
}
});
if (didSomething) return true;
}
// Try block comments
var startString = options.blockCommentStart || mode.blockCommentStart;
var endString = options.blockCommentEnd || mode.blockCommentEnd;
if (!startString || !endString) return false;
var lead = options.blockCommentLead || mode.blockCommentLead;
var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end);
var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString);
if (close == -1 && start != end) {
endLine = self.getLine(--end);
close = endLine.lastIndexOf(endString);
}
if (open == -1 || close == -1 ||
!/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
!/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
return false;
// Avoid killing block comments completely outside the selection.
// Positions of the last startString before the start of the selection, and the first endString after it.
var lastStart = startLine.lastIndexOf(startString, from.ch);
var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);
if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;
// Positions of the first endString after the end of the selection, and the last startString before it.
firstEnd = endLine.indexOf(endString, to.ch);
var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);
lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;
if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;
self.operation(function() {
self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
Pos(end, close + endString.length));
var openEnd = open + startString.length;
if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
self.replaceRange("", Pos(start, open), Pos(start, openEnd));
if (lead) for (var i = start + 1; i <= end; ++i) {
var line = self.getLine(i), found = line.indexOf(lead);
if (found == -1 || nonWS.test(line.slice(0, found))) continue;
var foundEnd = found + lead.length;
if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
}
});
return true;
});
});

View File

@@ -1,85 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
var modes = ["clike", "css", "javascript"];
for (var i = 0; i < modes.length; ++i)
CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
function continueComment(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), mode, inserts = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head, token = cm.getTokenAt(pos);
if (token.type != "comment") return CodeMirror.Pass;
var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode;
if (!mode) mode = modeHere;
else if (mode != modeHere) return CodeMirror.Pass;
var insert = null;
if (mode.blockCommentStart && mode.blockCommentContinue) {
var end = token.string.indexOf(mode.blockCommentEnd);
var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) {
// Comment ended, don't continue it
} else if (token.string.indexOf(mode.blockCommentStart) == 0) {
insert = full.slice(0, token.start);
if (!/^\s*$/.test(insert)) {
insert = "";
for (var j = 0; j < token.start; ++j) insert += " ";
}
} else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
found + mode.blockCommentContinue.length > token.start &&
/^\s*$/.test(full.slice(0, found))) {
insert = full.slice(0, found);
}
if (insert != null) insert += mode.blockCommentContinue;
}
if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) {
var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
if (found > -1) {
insert = line.slice(0, found);
if (/\S/.test(insert)) insert = null;
else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0];
}
}
if (insert == null) return CodeMirror.Pass;
inserts[i] = "\n" + insert;
}
cm.operation(function() {
for (var i = ranges.length - 1; i >= 0; i--)
cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert");
});
}
function continueLineCommentEnabled(cm) {
var opt = cm.getOption("continueComments");
if (opt && typeof opt == "object")
return opt.continueLineComment !== false;
return true;
}
CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
if (prev && prev != CodeMirror.Init)
cm.removeKeyMap("continueComment");
if (val) {
var key = "Enter";
if (typeof val == "string")
key = val;
else if (typeof val == "object" && val.key)
key = val.key;
var map = {name: "continueComment"};
map[key] = continueComment;
cm.addKeyMap(map);
}
});
});

View File

@@ -1,32 +0,0 @@
.CodeMirror-dialog {
position: absolute;
left: 0; right: 0;
background: inherit;
z-index: 15;
padding: .1em .8em;
overflow: hidden;
color: inherit;
}
.CodeMirror-dialog-top {
border-bottom: 1px solid #eee;
top: 0;
}
.CodeMirror-dialog-bottom {
border-top: 1px solid #eee;
bottom: 0;
}
.CodeMirror-dialog input {
border: none;
outline: none;
background: transparent;
width: 20em;
color: inherit;
font-family: monospace;
}
.CodeMirror-dialog button {
font-size: 70%;
}

View File

@@ -1,157 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Open simple dialogs on top of an editor. Relies on dialog.css.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
function dialogDiv(cm, template, bottom) {
var wrap = cm.getWrapperElement();
var dialog;
dialog = wrap.appendChild(document.createElement("div"));
if (bottom)
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
else
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
if (typeof template == "string") {
dialog.innerHTML = template;
} else { // Assuming it's a detached DOM element.
dialog.appendChild(template);
}
return dialog;
}
function closeNotification(cm, newVal) {
if (cm.state.currentNotificationClose)
cm.state.currentNotificationClose();
cm.state.currentNotificationClose = newVal;
}
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
if (!options) options = {};
closeNotification(this, null);
var dialog = dialogDiv(this, template, options.bottom);
var closed = false, me = this;
function close(newVal) {
if (typeof newVal == 'string') {
inp.value = newVal;
} else {
if (closed) return;
closed = true;
dialog.parentNode.removeChild(dialog);
me.focus();
if (options.onClose) options.onClose(dialog);
}
}
var inp = dialog.getElementsByTagName("input")[0], button;
if (inp) {
if (options.value) {
inp.value = options.value;
if (options.selectValueOnOpen !== false) {
inp.select();
}
}
if (options.onInput)
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
if (options.onKeyUp)
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
CodeMirror.on(inp, "keydown", function(e) {
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
inp.blur();
CodeMirror.e_stop(e);
close();
}
if (e.keyCode == 13) callback(inp.value, e);
});
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
inp.focus();
} else if (button = dialog.getElementsByTagName("button")[0]) {
CodeMirror.on(button, "click", function() {
close();
me.focus();
});
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
button.focus();
}
return close;
});
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
closeNotification(this, null);
var dialog = dialogDiv(this, template, options && options.bottom);
var buttons = dialog.getElementsByTagName("button");
var closed = false, me = this, blurring = 1;
function close() {
if (closed) return;
closed = true;
dialog.parentNode.removeChild(dialog);
me.focus();
}
buttons[0].focus();
for (var i = 0; i < buttons.length; ++i) {
var b = buttons[i];
(function(callback) {
CodeMirror.on(b, "click", function(e) {
CodeMirror.e_preventDefault(e);
close();
if (callback) callback(me);
});
})(callbacks[i]);
CodeMirror.on(b, "blur", function() {
--blurring;
setTimeout(function() { if (blurring <= 0) close(); }, 200);
});
CodeMirror.on(b, "focus", function() { ++blurring; });
}
});
/*
* openNotification
* Opens a notification, that can be closed with an optional timer
* (default 5000ms timer) and always closes on click.
*
* If a notification is opened while another is opened, it will close the
* currently opened one and open the new one immediately.
*/
CodeMirror.defineExtension("openNotification", function(template, options) {
closeNotification(this, close);
var dialog = dialogDiv(this, template, options && options.bottom);
var closed = false, doneTimer;
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
function close() {
if (closed) return;
closed = true;
clearTimeout(doneTimer);
dialog.parentNode.removeChild(dialog);
}
CodeMirror.on(dialog, 'click', function(e) {
CodeMirror.e_preventDefault(e);
close();
});
if (duration)
doneTimer = setTimeout(close, duration);
return close;
});
});

View File

@@ -1,6 +0,0 @@
.CodeMirror-fullscreen {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
height: auto;
z-index: 9;
}

View File

@@ -1,41 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
if (old == CodeMirror.Init) old = false;
if (!old == !val) return;
if (val) setFullscreen(cm);
else setNormal(cm);
});
function setFullscreen(cm) {
var wrap = cm.getWrapperElement();
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
width: wrap.style.width, height: wrap.style.height};
wrap.style.width = "";
wrap.style.height = "auto";
wrap.className += " CodeMirror-fullscreen";
document.documentElement.style.overflow = "hidden";
cm.refresh();
}
function setNormal(cm) {
var wrap = cm.getWrapperElement();
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
document.documentElement.style.overflow = "";
var info = cm.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrollTo(info.scrollLeft, info.scrollTop);
cm.refresh();
}
});

View File

@@ -1,112 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
CodeMirror.defineExtension("addPanel", function(node, options) {
options = options || {};
if (!this.state.panels) initPanels(this);
var info = this.state.panels;
var wrapper = info.wrapper;
var cmWrapper = this.getWrapperElement();
if (options.after instanceof Panel && !options.after.cleared) {
wrapper.insertBefore(node, options.before.node.nextSibling);
} else if (options.before instanceof Panel && !options.before.cleared) {
wrapper.insertBefore(node, options.before.node);
} else if (options.replace instanceof Panel && !options.replace.cleared) {
wrapper.insertBefore(node, options.replace.node);
options.replace.clear();
} else if (options.position == "bottom") {
wrapper.appendChild(node);
} else if (options.position == "before-bottom") {
wrapper.insertBefore(node, cmWrapper.nextSibling);
} else if (options.position == "after-top") {
wrapper.insertBefore(node, cmWrapper);
} else {
wrapper.insertBefore(node, wrapper.firstChild);
}
var height = (options && options.height) || node.offsetHeight;
this._setSize(null, info.heightLeft -= height);
info.panels++;
return new Panel(this, node, options, height);
});
function Panel(cm, node, options, height) {
this.cm = cm;
this.node = node;
this.options = options;
this.height = height;
this.cleared = false;
}
Panel.prototype.clear = function() {
if (this.cleared) return;
this.cleared = true;
var info = this.cm.state.panels;
this.cm._setSize(null, info.heightLeft += this.height);
info.wrapper.removeChild(this.node);
if (--info.panels == 0) removePanels(this.cm);
};
Panel.prototype.changed = function(height) {
var newHeight = height == null ? this.node.offsetHeight : height;
var info = this.cm.state.panels;
this.cm._setSize(null, info.height += (newHeight - this.height));
this.height = newHeight;
};
function initPanels(cm) {
var wrap = cm.getWrapperElement();
var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle;
var height = parseInt(style.height);
var info = cm.state.panels = {
setHeight: wrap.style.height,
heightLeft: height,
panels: 0,
wrapper: document.createElement("div")
};
wrap.parentNode.insertBefore(info.wrapper, wrap);
var hasFocus = cm.hasFocus();
info.wrapper.appendChild(wrap);
if (hasFocus) cm.focus();
cm._setSize = cm.setSize;
if (height != null) cm.setSize = function(width, newHeight) {
if (newHeight == null) return this._setSize(width, newHeight);
info.setHeight = newHeight;
if (typeof newHeight != "number") {
var px = /^(\d+\.?\d*)px$/.exec(newHeight);
if (px) {
newHeight = Number(px[1]);
} else {
info.wrapper.style.height = newHeight;
newHeight = info.wrapper.offsetHeight;
info.wrapper.style.height = "";
}
}
cm._setSize(width, info.heightLeft += (newHeight - height));
height = newHeight;
};
}
function removePanels(cm) {
var info = cm.state.panels;
cm.state.panels = null;
var wrap = cm.getWrapperElement();
info.wrapper.parentNode.replaceChild(wrap, info.wrapper);
wrap.style.height = info.setHeight;
cm.setSize = cm._setSize;
cm.setSize();
}
});

View File

@@ -1,58 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
var prev = old && old != CodeMirror.Init;
if (val && !prev) {
cm.on("blur", onBlur);
cm.on("change", onChange);
onChange(cm);
} else if (!val && prev) {
cm.off("blur", onBlur);
cm.off("change", onChange);
clearPlaceholder(cm);
var wrapper = cm.getWrapperElement();
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
}
if (val && !cm.hasFocus()) onBlur(cm);
});
function clearPlaceholder(cm) {
if (cm.state.placeholder) {
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
cm.state.placeholder = null;
}
}
function setPlaceholder(cm) {
clearPlaceholder(cm);
var elt = cm.state.placeholder = document.createElement("pre");
elt.style.cssText = "height: 0; overflow: visible";
elt.className = "CodeMirror-placeholder";
elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
}
function onBlur(cm) {
if (isEmpty(cm)) setPlaceholder(cm);
}
function onChange(cm) {
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
if (empty) setPlaceholder(cm);
else clearPlaceholder(cm);
}
function isEmpty(cm) {
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
}
});

View File

@@ -1,63 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("rulers", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
clearRulers(cm);
cm.off("refresh", refreshRulers);
}
if (val && val.length) {
setRulers(cm);
cm.on("refresh", refreshRulers);
}
});
function clearRulers(cm) {
for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) {
var node = cm.display.lineSpace.childNodes[i];
if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className))
node.parentNode.removeChild(node);
}
}
function setRulers(cm) {
var val = cm.getOption("rulers");
var cw = cm.defaultCharWidth();
var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left;
var minH = cm.display.scroller.offsetHeight + 30;
for (var i = 0; i < val.length; i++) {
var elt = document.createElement("div");
elt.className = "CodeMirror-ruler";
var col, conf = val[i];
if (typeof conf == "number") {
col = conf;
} else {
col = conf.column;
if (conf.className) elt.className += " " + conf.className;
if (conf.color) elt.style.borderColor = conf.color;
if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;
if (conf.width) elt.style.borderLeftWidth = conf.width;
}
elt.style.left = (left + col * cw) + "px";
elt.style.top = "-50px";
elt.style.bottom = "-20px";
elt.style.minHeight = minH + "px";
cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv);
}
}
function refreshRulers(cm) {
clearRulers(cm);
setRulers(cm);
}
});

View File

@@ -1,185 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
var defaults = {
pairs: "()[]{}''\"\"",
triples: "",
explode: "[]{}"
};
var Pos = CodeMirror.Pos;
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.removeKeyMap(keyMap);
cm.state.closeBrackets = null;
}
if (val) {
cm.state.closeBrackets = val;
cm.addKeyMap(keyMap);
}
});
function getOption(conf, name) {
if (name == "pairs" && typeof conf == "string") return conf;
if (typeof conf == "object" && conf[name] != null) return conf[name];
return defaults[name];
}
var bind = defaults.pairs + "`";
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
for (var i = 0; i < bind.length; i++)
keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
function handler(ch) {
return function(cm) { return handleChar(cm, ch); };
}
function getConfig(cm) {
var deflt = cm.state.closeBrackets;
if (!deflt) return null;
var mode = cm.getModeAt(cm.getCursor());
return mode.closeBrackets || deflt;
}
function handleBackspace(cm) {
var conf = getConfig(cm);
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
var pairs = getOption(conf, "pairs");
var ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
if (!ranges[i].empty()) return CodeMirror.Pass;
var around = charsAround(cm, ranges[i].head);
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
}
for (var i = ranges.length - 1; i >= 0; i--) {
var cur = ranges[i].head;
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
}
}
function handleEnter(cm) {
var conf = getConfig(cm);
var explode = conf && getOption(conf, "explode");
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
if (!ranges[i].empty()) return CodeMirror.Pass;
var around = charsAround(cm, ranges[i].head);
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
}
cm.operation(function() {
cm.replaceSelection("\n\n", null);
cm.execCommand("goCharLeft");
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
var line = ranges[i].head.line;
cm.indentLine(line, null, true);
cm.indentLine(line + 1, null, true);
}
});
}
function handleChar(cm, ch) {
var conf = getConfig(cm);
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
var pairs = getOption(conf, "pairs");
var pos = pairs.indexOf(ch);
if (pos == -1) return CodeMirror.Pass;
var triples = getOption(conf, "triples");
var identical = pairs.charAt(pos + 1) == ch;
var ranges = cm.listSelections();
var opening = pos % 2 == 0;
var type, next;
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i], cur = range.head, curType;
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
if (opening && !range.empty()) {
curType = "surround";
} else if ((identical || !opening) && next == ch) {
if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
curType = "skipThree";
else
curType = "skip";
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
curType = "addFour";
} else if (identical) {
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
else return CodeMirror.Pass;
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
isClosingBracket(next, pairs) ||
/\s/.test(next))) {
curType = "both";
} else {
return CodeMirror.Pass;
}
if (!type) type = curType;
else if (type != curType) return CodeMirror.Pass;
}
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
cm.operation(function() {
if (type == "skip") {
cm.execCommand("goCharRight");
} else if (type == "skipThree") {
for (var i = 0; i < 3; i++)
cm.execCommand("goCharRight");
} else if (type == "surround") {
var sels = cm.getSelections();
for (var i = 0; i < sels.length; i++)
sels[i] = left + sels[i] + right;
cm.replaceSelections(sels, "around");
} else if (type == "both") {
cm.replaceSelection(left + right, null);
cm.triggerElectric(left + right);
cm.execCommand("goCharLeft");
} else if (type == "addFour") {
cm.replaceSelection(left + left + left + left, "before");
cm.execCommand("goCharRight");
}
});
}
function isClosingBracket(ch, pairs) {
var pos = pairs.lastIndexOf(ch);
return pos > -1 && pos % 2 == 1;
}
function charsAround(cm, pos) {
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
Pos(pos.line, pos.ch + 1));
return str.length == 2 ? str : null;
}
// Project the token type that will exists after the given char is
// typed, and use it to determine whether it would cause the start
// of a string token.
function enteringString(cm, pos, ch) {
var line = cm.getLine(pos.line);
var token = cm.getTokenAt(pos);
if (/\bstring2?\b/.test(token.type)) return false;
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
stream.pos = stream.start = token.start;
for (;;) {
var type1 = cm.getMode().token(stream, token.state);
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
stream.start = stream.pos;
}
}
});

View File

@@ -1,169 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/**
* Tag-closer extension for CodeMirror.
*
* This extension adds an "autoCloseTags" option that can be set to
* either true to get the default behavior, or an object to further
* configure its behavior.
*
* These are supported options:
*
* `whenClosing` (default true)
* Whether to autoclose when the '/' of a closing tag is typed.
* `whenOpening` (default true)
* Whether to autoclose the tag when the final '>' of an opening
* tag is typed.
* `dontCloseTags` (default is empty tags for HTML, none for XML)
* An array of tag names that should not be autoclosed.
* `indentTags` (default is block tags for HTML, none for XML)
* An array of tag names that should, when opened, cause a
* blank line to be added inside the tag, and the blank line and
* closing line to be indented.
*
* See demos/closetag.html for a usage example.
*/
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
if (old != CodeMirror.Init && old)
cm.removeKeyMap("autoCloseTags");
if (!val) return;
var map = {name: "autoCloseTags"};
if (typeof val != "object" || val.whenClosing)
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
if (typeof val != "object" || val.whenOpening)
map["'>'"] = function(cm) { return autoCloseGT(cm); };
cm.addKeyMap(map);
});
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
"source", "track", "wbr"];
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
function autoCloseGT(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), replacements = [];
for (var i = 0; i < ranges.length; i++) {
if (!ranges[i].empty()) return CodeMirror.Pass;
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
var tagName = state.tagName;
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
var lowerTagName = tagName.toLowerCase();
// Don't process the '>' at the end of an end-tag or self-closing tag
if (!tagName ||
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
tok.type == "tag" && state.type == "closeTag" ||
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
closingTagExists(cm, tagName, pos, state, true))
return CodeMirror.Pass;
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
replacements[i] = {indent: indent,
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
}
for (var i = ranges.length - 1; i >= 0; i--) {
var info = replacements[i];
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
var sel = cm.listSelections().slice(0);
sel[i] = {head: info.newPos, anchor: info.newPos};
cm.setSelections(sel);
if (info.indent) {
cm.indentLine(info.newPos.line, null, true);
cm.indentLine(info.newPos.line + 1, null, true);
}
}
}
function autoCloseCurrent(cm, typingSlash) {
var ranges = cm.listSelections(), replacements = [];
var head = typingSlash ? "/" : "</";
for (var i = 0; i < ranges.length; i++) {
if (!ranges[i].empty()) return CodeMirror.Pass;
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
tok.start != pos.ch - 1))
return CodeMirror.Pass;
// Kludge to get around the fact that we are not in XML mode
// when completing in JS/CSS snippet in htmlmixed mode. Does not
// work for other XML embedded languages (there is no general
// way to go from a mixed mode to its current XML state).
var replacement;
if (inner.mode.name != "xml") {
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
replacement = head + "script";
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
replacement = head + "style";
else
return CodeMirror.Pass;
} else {
if (!state.context || !state.context.tagName ||
closingTagExists(cm, state.context.tagName, pos, state))
return CodeMirror.Pass;
replacement = head + state.context.tagName;
}
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
replacements[i] = replacement;
}
cm.replaceSelections(replacements);
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++)
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
cm.indentLine(ranges[i].head.line);
}
function autoCloseSlash(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
return autoCloseCurrent(cm, true);
}
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
function indexOf(collection, elt) {
if (collection.indexOf) return collection.indexOf(elt);
for (var i = 0, e = collection.length; i < e; ++i)
if (collection[i] == elt) return i;
return -1;
}
// If xml-fold is loaded, we use its functionality to try and verify
// whether a given tag is actually unclosed.
function closingTagExists(cm, tagName, pos, state, newTag) {
if (!CodeMirror.scanForClosingTag) return false;
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
if (!nextClose || nextClose.tag != tagName) return false;
var cx = state.context;
// If the immediate wrapping context contains onCx instances of
// the same tag, a closing tag only exists if there are at least
// that many closing tags of that type following.
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
pos = nextClose.to;
for (var i = 1; i < onCx; i++) {
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
if (!next || next.tag != tagName) return false;
pos = next.to;
}
return true;
}
});

View File

@@ -1,51 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
unorderedListRE = /[*+-]\s/;
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), replacements = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head;
var eolState = cm.getStateAfter(pos.line);
var inList = eolState.list !== false;
var inQuote = eolState.quote !== 0;
var line = cm.getLine(pos.line), match = listRE.exec(line);
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
cm.execCommand("newlineAndIndent");
return;
}
if (emptyListRE.test(line)) {
cm.replaceRange("", {
line: pos.line, ch: 0
}, {
line: pos.line, ch: pos.ch + 1
});
replacements[i] = "\n";
} else {
var indent = match[1], after = match[5];
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
? match[2]
: (parseInt(match[3], 10) + 1) + match[4];
replacements[i] = "\n" + indent + bullet + after;
}
}
cm.replaceSelections(replacements);
};
});

View File

@@ -1,120 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
(document.documentMode == null || document.documentMode < 8);
var Pos = CodeMirror.Pos;
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
function findMatchingBracket(cm, where, strict, config) {
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
if (!match) return null;
var dir = match.charAt(1) == ">" ? 1 : -1;
if (strict && (dir > 0) != (pos == where.ch)) return null;
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
if (found == null) return null;
return {from: Pos(where.line, pos), to: found && found.pos,
match: found && found.ch == match.charAt(0), forward: dir > 0};
}
// bracketRegex is used to specify which type of bracket to scan
// should be a regexp, e.g. /[[\]]/
//
// Note: If "where" is on an open bracket, then this bracket is ignored.
//
// Returns false when no bracket was found, null when it reached
// maxScanLines and gave up
function scanForBracket(cm, where, dir, style, config) {
var maxScanLen = (config && config.maxScanLineLength) || 10000;
var maxScanLines = (config && config.maxScanLines) || 1000;
var stack = [];
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
var line = cm.getLine(lineNo);
if (!line) continue;
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
if (line.length > maxScanLen) continue;
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
for (; pos != end; pos += dir) {
var ch = line.charAt(pos);
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
var match = matching[ch];
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
else stack.pop();
}
}
}
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
}
function matchBrackets(cm, autoclear, config) {
// Disable brace matching in long lines, since it'll cause hugely slow updates
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
var marks = [], ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
}
}
if (marks.length) {
// Kludge to work around the IE bug from issue #1193, where text
// input stops going to the textare whever this fires.
if (ie_lt8 && cm.state.focused) cm.focus();
var clear = function() {
cm.operation(function() {
for (var i = 0; i < marks.length; i++) marks[i].clear();
});
};
if (autoclear) setTimeout(clear, 800);
else return clear;
}
}
var currentlyHighlighted = null;
function doMatchBrackets(cm) {
cm.operation(function() {
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
});
}
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init)
cm.off("cursorActivity", doMatchBrackets);
if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets);
}
});
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
return findMatchingBracket(this, pos, strict, config);
});
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
return scanForBracket(this, pos, dir, style, config);
});
});

View File

@@ -1,66 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchTags);
cm.off("viewportChange", maybeUpdateMatch);
clear(cm);
}
if (val) {
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
cm.on("cursorActivity", doMatchTags);
cm.on("viewportChange", maybeUpdateMatch);
doMatchTags(cm);
}
});
function clear(cm) {
if (cm.state.tagHit) cm.state.tagHit.clear();
if (cm.state.tagOther) cm.state.tagOther.clear();
cm.state.tagHit = cm.state.tagOther = null;
}
function doMatchTags(cm) {
cm.state.failedTagMatch = false;
cm.operation(function() {
clear(cm);
if (cm.somethingSelected()) return;
var cur = cm.getCursor(), range = cm.getViewport();
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
var match = CodeMirror.findMatchingTag(cm, cur, range);
if (!match) return;
if (cm.state.matchBothTags) {
var hit = match.at == "open" ? match.open : match.close;
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
}
var other = match.at == "close" ? match.open : match.close;
if (other)
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
else
cm.state.failedTagMatch = true;
});
}
function maybeUpdateMatch(cm) {
if (cm.state.failedTagMatch) doMatchTags(cm);
}
CodeMirror.commands.toMatchingTag = function(cm) {
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
if (found) {
var other = found.at == "close" ? found.open : found.close;
if (other) cm.extendSelection(other.to, other.from);
}
};
});

View File

@@ -1,27 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
if (prev == CodeMirror.Init) prev = false;
if (prev && !val)
cm.removeOverlay("trailingspace");
else if (!prev && val)
cm.addOverlay({
token: function(stream) {
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
if (i > stream.pos) { stream.pos = i; return null; }
stream.pos = l;
return "trailingspace";
},
name: "trailingspace"
});
});
});

View File

@@ -1,105 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
var line = start.line, lineText = cm.getLine(line);
var startCh, tokenType;
function findOpening(openCh) {
for (var at = start.ch, pass = 0;;) {
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
if (found == -1) {
if (pass == 1) break;
pass = 1;
at = lineText.length;
continue;
}
if (pass == 1 && found < start.ch) break;
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
if (!/^(comment|string)/.test(tokenType)) return found + 1;
at = found - 1;
}
}
var startToken = "{", endToken = "}", startCh = findOpening("{");
if (startCh == null) {
startToken = "[", endToken = "]";
startCh = findOpening("[");
}
if (startCh == null) return;
var count = 1, lastLine = cm.lastLine(), end, endCh;
outer: for (var i = line; i <= lastLine; ++i) {
var text = cm.getLine(i), pos = i == line ? startCh : 0;
for (;;) {
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
if (pos == text.length) break;
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
if (pos == nextOpen) ++count;
else if (!--count) { end = i; endCh = pos; break outer; }
}
++pos;
}
}
if (end == null || line == end && endCh == startCh) return;
return {from: CodeMirror.Pos(line, startCh),
to: CodeMirror.Pos(end, endCh)};
});
CodeMirror.registerHelper("fold", "import", function(cm, start) {
function hasImport(line) {
if (line < cm.firstLine() || line > cm.lastLine()) return null;
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
if (start.type != "keyword" || start.string != "import") return null;
// Now find closing semicolon, return its position
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
var text = cm.getLine(i), semi = text.indexOf(";");
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
}
}
var start = start.line, has = hasImport(start), prev;
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
return null;
for (var end = has.end;;) {
var next = hasImport(end.line + 1);
if (next == null) break;
end = next.end;
}
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
});
CodeMirror.registerHelper("fold", "include", function(cm, start) {
function hasInclude(line) {
if (line < cm.firstLine() || line > cm.lastLine()) return null;
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
}
var start = start.line, has = hasInclude(start);
if (has == null || hasInclude(start - 1) != null) return null;
for (var end = start;;) {
var next = hasInclude(end + 1);
if (next == null) break;
++end;
}
return {from: CodeMirror.Pos(start, has + 1),
to: cm.clipPos(CodeMirror.Pos(end))};
});
});

View File

@@ -1,57 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
return mode.blockCommentStart && mode.blockCommentEnd;
}, function(cm, start) {
var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
if (!startToken || !endToken) return;
var line = start.line, lineText = cm.getLine(line);
var startCh;
for (var at = start.ch, pass = 0;;) {
var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
if (found == -1) {
if (pass == 1) return;
pass = 1;
at = lineText.length;
continue;
}
if (pass == 1 && found < start.ch) return;
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
startCh = found + startToken.length;
break;
}
at = found - 1;
}
var depth = 1, lastLine = cm.lastLine(), end, endCh;
outer: for (var i = line; i <= lastLine; ++i) {
var text = cm.getLine(i), pos = i == line ? startCh : 0;
for (;;) {
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
if (pos == text.length) break;
if (pos == nextOpen) ++depth;
else if (!--depth) { end = i; endCh = pos; break outer; }
++pos;
}
}
if (end == null || line == end && endCh == startCh) return;
return {from: CodeMirror.Pos(line, startCh),
to: CodeMirror.Pos(end, endCh)};
});
});

View File

@@ -1,149 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
function doFold(cm, pos, options, force) {
if (options && options.call) {
var finder = options;
options = null;
} else {
var finder = getOption(cm, options, "rangeFinder");
}
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
var minSize = getOption(cm, options, "minFoldSize");
function getRange(allowFolded) {
var range = finder(cm, pos);
if (!range || range.to.line - range.from.line < minSize) return null;
var marks = cm.findMarksAt(range.from);
for (var i = 0; i < marks.length; ++i) {
if (marks[i].__isFold && force !== "fold") {
if (!allowFolded) return null;
range.cleared = true;
marks[i].clear();
}
}
return range;
}
var range = getRange(true);
if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
pos = CodeMirror.Pos(pos.line - 1, 0);
range = getRange(false);
}
if (!range || range.cleared || force === "unfold") return;
var myWidget = makeWidget(cm, options);
CodeMirror.on(myWidget, "mousedown", function(e) {
myRange.clear();
CodeMirror.e_preventDefault(e);
});
var myRange = cm.markText(range.from, range.to, {
replacedWith: myWidget,
clearOnEnter: true,
__isFold: true
});
myRange.on("clear", function(from, to) {
CodeMirror.signal(cm, "unfold", cm, from, to);
});
CodeMirror.signal(cm, "fold", cm, range.from, range.to);
}
function makeWidget(cm, options) {
var widget = getOption(cm, options, "widget");
if (typeof widget == "string") {
var text = document.createTextNode(widget);
widget = document.createElement("span");
widget.appendChild(text);
widget.className = "CodeMirror-foldmarker";
}
return widget;
}
// Clumsy backwards-compatible interface
CodeMirror.newFoldFunction = function(rangeFinder, widget) {
return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
};
// New-style interface
CodeMirror.defineExtension("foldCode", function(pos, options, force) {
doFold(this, pos, options, force);
});
CodeMirror.defineExtension("isFolded", function(pos) {
var marks = this.findMarksAt(pos);
for (var i = 0; i < marks.length; ++i)
if (marks[i].__isFold) return true;
});
CodeMirror.commands.toggleFold = function(cm) {
cm.foldCode(cm.getCursor());
};
CodeMirror.commands.fold = function(cm) {
cm.foldCode(cm.getCursor(), null, "fold");
};
CodeMirror.commands.unfold = function(cm) {
cm.foldCode(cm.getCursor(), null, "unfold");
};
CodeMirror.commands.foldAll = function(cm) {
cm.operation(function() {
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
});
};
CodeMirror.commands.unfoldAll = function(cm) {
cm.operation(function() {
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
});
};
CodeMirror.registerHelper("fold", "combine", function() {
var funcs = Array.prototype.slice.call(arguments, 0);
return function(cm, start) {
for (var i = 0; i < funcs.length; ++i) {
var found = funcs[i](cm, start);
if (found) return found;
}
};
});
CodeMirror.registerHelper("fold", "auto", function(cm, start) {
var helpers = cm.getHelpers(start, "fold");
for (var i = 0; i < helpers.length; i++) {
var cur = helpers[i](cm, start);
if (cur) return cur;
}
});
var defaultOptions = {
rangeFinder: CodeMirror.fold.auto,
widget: "\u2194",
minFoldSize: 0,
scanUp: false
};
CodeMirror.defineOption("foldOptions", null);
function getOption(cm, options, name) {
if (options && options[name] !== undefined)
return options[name];
var editorOptions = cm.options.foldOptions;
if (editorOptions && editorOptions[name] !== undefined)
return editorOptions[name];
return defaultOptions[name];
}
CodeMirror.defineExtension("foldOption", function(options, name) {
return getOption(this, options, name);
});
});

View File

@@ -1,20 +0,0 @@
.CodeMirror-foldmarker {
color: blue;
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
font-family: arial;
line-height: .3;
cursor: pointer;
}
.CodeMirror-foldgutter {
width: .7em;
}
.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
cursor: pointer;
}
.CodeMirror-foldgutter-open:after {
content: "\25BE";
}
.CodeMirror-foldgutter-folded:after {
content: "\25B8";
}

View File

@@ -1,146 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("./foldcode"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "./foldcode"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.clearGutter(cm.state.foldGutter.options.gutter);
cm.state.foldGutter = null;
cm.off("gutterClick", onGutterClick);
cm.off("change", onChange);
cm.off("viewportChange", onViewportChange);
cm.off("fold", onFold);
cm.off("unfold", onFold);
cm.off("swapDoc", updateInViewport);
}
if (val) {
cm.state.foldGutter = new State(parseOptions(val));
updateInViewport(cm);
cm.on("gutterClick", onGutterClick);
cm.on("change", onChange);
cm.on("viewportChange", onViewportChange);
cm.on("fold", onFold);
cm.on("unfold", onFold);
cm.on("swapDoc", updateInViewport);
}
});
var Pos = CodeMirror.Pos;
function State(options) {
this.options = options;
this.from = this.to = 0;
}
function parseOptions(opts) {
if (opts === true) opts = {};
if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
return opts;
}
function isFolded(cm, line) {
var marks = cm.findMarksAt(Pos(line));
for (var i = 0; i < marks.length; ++i)
if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
}
function marker(spec) {
if (typeof spec == "string") {
var elt = document.createElement("div");
elt.className = spec + " CodeMirror-guttermarker-subtle";
return elt;
} else {
return spec.cloneNode(true);
}
}
function updateFoldInfo(cm, from, to) {
var opts = cm.state.foldGutter.options, cur = from;
var minSize = cm.foldOption(opts, "minFoldSize");
var func = cm.foldOption(opts, "rangeFinder");
cm.eachLine(from, to, function(line) {
var mark = null;
if (isFolded(cm, cur)) {
mark = marker(opts.indicatorFolded);
} else {
var pos = Pos(cur, 0);
var range = func && func(cm, pos);
if (range && range.to.line - range.from.line >= minSize)
mark = marker(opts.indicatorOpen);
}
cm.setGutterMarker(line, opts.gutter, mark);
++cur;
});
}
function updateInViewport(cm) {
var vp = cm.getViewport(), state = cm.state.foldGutter;
if (!state) return;
cm.operation(function() {
updateFoldInfo(cm, vp.from, vp.to);
});
state.from = vp.from; state.to = vp.to;
}
function onGutterClick(cm, line, gutter) {
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
if (gutter != opts.gutter) return;
var folded = isFolded(cm, line);
if (folded) folded.clear();
else cm.foldCode(Pos(line, 0), opts.rangeFinder);
}
function onChange(cm) {
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
state.from = state.to = 0;
clearTimeout(state.changeUpdate);
state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
}
function onViewportChange(cm) {
var state = cm.state.foldGutter;
if (!state) return;
var opts = state.options;
clearTimeout(state.changeUpdate);
state.changeUpdate = setTimeout(function() {
var vp = cm.getViewport();
if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
updateInViewport(cm);
} else {
cm.operation(function() {
if (vp.from < state.from) {
updateFoldInfo(cm, vp.from, state.from);
state.from = vp.from;
}
if (vp.to > state.to) {
updateFoldInfo(cm, state.to, vp.to);
state.to = vp.to;
}
});
}
}, opts.updateViewportTimeSpan || 400);
}
function onFold(cm, from) {
var state = cm.state.foldGutter;
if (!state) return;
var line = from.line;
if (line >= state.from && line < state.to)
updateFoldInfo(cm, line, line + 1);
}
});

Some files were not shown because too many files have changed in this diff Show More