X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7ba0bf0e4c5325d2f78ae640568e6de9ea3e9440..687fac27f7a6aacbc140300cd5f40ffe3cc20e89:/fixtures/przyciski.xml?ds=sidebyside diff --git a/fixtures/przyciski.xml b/fixtures/przyciski.xml old mode 100644 new mode 100755 index ea1d7246..2065b151 --- a/fixtures/przyciski.xml +++ b/fixtures/przyciski.xml @@ -1,5 +1,15 @@ + + Dodatkowe przyciski w XMLEditor + xmleditor-extra-buttons + -1 + + + HTMLEditor Extra + htmleditor-extra + -1 + Akapity i długie cytaty akapity-i-dlugie-cytaty @@ -15,16 +25,6 @@ bloki 0 - - Bloki początkowe - bloki-poczatkowe - 0 - - - Deklaracje - deklaracje - 0 - Dramat wierszowany dramat-wierszowany @@ -40,11 +40,6 @@ elementy-poczatkowe 0 - - Mastery - mastery - 0 - Nagłówki naglowki @@ -75,20 +70,17 @@ wersy 0 - - Widok - display_options - 2 - A<sup>+</sup> increase_font_size {"change": 2} codemirror_fontsize - + + + + 0 Zwiększ rozmiar czcionki. - + @@ -96,10 +88,12 @@ descrease_font_size {"change": -2} codemirror_fontsize - - + + + 0 Zmniejsz rozmiar czcionki. - + @@ -107,10 +101,12 @@ reset_font_size {"fontSize": 13} codemirror_fontsize - = + + + 0 Przywróć orginalny rozmiar czcionki. - + @@ -118,7 +114,9 @@ tolowercase [] lowercase + u + 6 Zamień wielkie litery na małe. @@ -129,7 +127,9 @@ basic_correction {"exprs": [["\n\\d+\n", "\n"], ["-\\s*\n+", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]} fulltextregexp + + 0 Wykonuję operację z novel-pages i poem-pages. @@ -140,18 +140,66 @@ strip_whitespace {"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "]]} lineregexp + + 0 Usuwa zbędne spację z dokumentu. + + Wers wcięty + wers-wciety + {"tag": "wers_wciety", "attrs": {"typ": ""}} + insert_tag + + + 0 + + + + + + + + Wydrukuj + print-xml + [] + + + + print/xml + + 0 + + + + + + + Wydrukuj + htmleditor-print + [] + + + + print/html + + 0 + + + + + - Zamień Cudzysłowy + Zamień cudzysłowy zamien-cudzyslowy {"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"]]} lineregexp + + 0 @@ -162,7 +210,9 @@ zamien_dywiz {"exprs": [["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]} lineregexp + + 0 Zamienia '—' na '---', oraz '1—2' na '1--2'. @@ -173,7 +223,9 @@ akapit {"tag": "akap"} insert_tag + + 0 @@ -184,7 +236,9 @@ akapit-cd {"tag": "akap_cd"} insert_tag + + 0 @@ -195,7 +249,9 @@ akapit-dialogowy {"tag": "akap_dialog"} insert_tag + + 0 @@ -206,7 +262,9 @@ akt {"tag": "akt"} insert_tag + + 0 @@ -217,7 +275,9 @@ autor {"tag": "autor"} insert_tag + + 0 @@ -228,65 +288,53 @@ czesc {"tag": "naglowek_czesc"} insert_tag + + 0 - - dedykacja - dedykacja - {"tag": "dedykacja"} - insert_tag - - - - - - dedykacja dedykacja {"tag": "dedykacja"} insert_tag + + 0 + - - didaskalia - didaskalia - {"tag": "didaskalia"} - insert_tag - - - - - - didaskalia didaskalia {"tag": "didaskalia"} insert_tag + + 0 + - - didaskalia wewn. - didaskalia-wewn - {"tag": "didask_tekst"} + + didaskalia początkowe + didaskalia-poczatkowe + {"tag": "miejsce_czas"} insert_tag + + 0 - + @@ -294,10 +342,13 @@ didaskalia-wewn {"tag": "didask_tekst"} insert_tag + + 0 + @@ -305,7 +356,9 @@ dramat-wiersz {"tag": "dramat_wierszowany_l"} insert_tag + + 0 @@ -316,7 +369,9 @@ dramat-wiersz-w-lam {"tag": "dramat_wierszowany_lp"} insert_tag + + 0 @@ -327,7 +382,9 @@ dramat-wspolczesny {"tag": "dramat_wspolczesny"} insert_tag + + 0 @@ -338,7 +395,9 @@ dzielo-nadrzedne {"tag": "dzielo_nadrzedne"} insert_tag + + 0 @@ -349,21 +408,13 @@ dlugi-cyt-poet {"tag": "poezja_cyt"} insert_tag + - - - - - - - długi cyta. poet. - dlugi-cyt-poet - {"tag": "poezja_cyt"} - insert_tag - + 0 + @@ -371,7 +422,9 @@ dlugi-cytat {"tag": "dlugi_cyt"} insert_tag + + 0 @@ -383,31 +436,25 @@ ekstra {"tag": "ekstra"} insert_tag + + 0 - + kwestia kwestia {"tag": "kwestia"} insert_tag + + 0 - - - - kwestia - kwestia - {"tag": "kwestia"} - insert_tag - - - @@ -416,7 +463,9 @@ liryka {"tag": "liryka_l"} insert_tag + + 0 @@ -427,32 +476,38 @@ liryka-w-lam {"tag": "liryka_lp"} insert_tag + + 0 - - mamtemat. - matemat - {"tag": "mat"} + + lista osób: pole + lista-osob-pole + {"tag": "lista_osoba", "attrs": {"typ": ""}} insert_tag + + 0 - + - - motto - motto - {"tag": "motto"} + + mamtemat. + matemat + {"tag": "mat"} insert_tag + + 0 - + @@ -460,9 +515,12 @@ motto {"tag": "motto"} insert_tag + + 0 + @@ -471,7 +529,9 @@ motto-podpis {"tag": "motto_podpis"} insert_tag + + 0 @@ -482,7 +542,9 @@ naglowek-kwestii {"tag": "naglowek_osoba"} insert_tag + + 0 @@ -493,7 +555,9 @@ nota {"tag": "nota"} insert_tag + + 0 @@ -504,32 +568,26 @@ opowiadanie {"tag": "opowiadanie"} insert_tag + + 0 - - osoba - osoba - {"tag": "osoba"} - insert_tag - - - - - - osoba osoba {"tag": "osoba"} insert_tag + + 0 + @@ -537,7 +595,9 @@ podrozdzial {"tag": "naglowek_podrozdzial"} insert_tag + + 0 @@ -548,7 +608,9 @@ podtytul {"tag": "podtytul"} insert_tag + + 0 @@ -559,7 +621,9 @@ powiesc {"tag": "powiesc"} insert_tag + + 0 @@ -570,7 +634,9 @@ przypis-autorski {"tag": "pa"} insert_tag + + 0 @@ -581,7 +647,9 @@ przypis-edytorski {"tag": "pe"} insert_tag + + 0 @@ -592,7 +660,9 @@ przypis-redaktorski {"tag": "pr"} insert_tag + + 0 @@ -603,7 +673,9 @@ przypis-tlumacza {"tag": "pt"} insert_tag + + 0 @@ -614,7 +686,9 @@ rozdzial {"tag": "naglowek_rozdzial"} insert_tag + + 0 @@ -625,7 +699,9 @@ scena {"tag": "naglowek_scena"} insert_tag + + 0 @@ -636,7 +712,9 @@ sep-asteryks {"tag": "sekcja_asteryks"} insert_tag + + 0 @@ -647,7 +725,9 @@ sep-linia {"tag": "separator_linia"} insert_tag + + 0 @@ -658,20 +738,25 @@ sep-swiatlo {"tag": "sekcja_swiatlo"} insert_tag + + 0 - + strofa strofa {"tag": "strofa"} - insert_tag - + insert_stanza + + s + 1 + @@ -680,7 +765,9 @@ slowo-obce {"tag": "slowo_obce"} insert_tag + + 0 @@ -691,7 +778,9 @@ tagi-glowne {"tag": "utwor"} insert_tag + + 0 @@ -702,7 +791,9 @@ tytul {"tag": "nazwa_utworu"} insert_tag + + 0 @@ -711,9 +802,11 @@ tytuł dzieła tytul-dziela - {"tag": "tytul_dziela", "attrs": {"typ": " "}} + {"tag": "tytul_dziela", "attrs": {"typ": "1"}} insert_tag + + 0 @@ -724,75 +817,39 @@ uwaga {"tag": "uwaga"} insert_tag + + 0 - + wers akap. wers-akap {"tag": "wers_akap"} insert_tag + + 0 - - - - wers akap. - wers-akap - {"tag": "wers_akap"} - insert_tag - - - - + wers cd. wers-cd {"tag": "wers_cd"} insert_tag + + 0 - - - - wers cd. - wers-cd - {"tag": "wers_cd"} - insert_tag - - - - - - - - wers wcięty - wers-wciety - {"tag": "wers_wciety"} - insert_tag - - - - - - - - wers wcięty - wers-wciety - {"tag": "wers_wciety"} - insert_tag - - - @@ -801,7 +858,9 @@ www {"tag": "www"} insert_tag + + 0 @@ -812,7 +871,9 @@ wyroznienie {"tag": "wyroznienie"} insert_tag + + 0 @@ -823,7 +884,9 @@ wywiad {"tag": "wywiad"} insert_tag + + 0 @@ -834,7 +897,9 @@ wywiad-odpowiedz {"tag": "wywiad_odp"} insert_tag + + 0 @@ -845,7 +910,9 @@ wywiad-pytanie {"tag": "wywiad_pyt"} insert_tag + + 0 @@ -856,7 +923,9 @@ zastepnik-wersu {"tag": "zastepnik_wersu"} insert_tag + + 0 @@ -867,7 +936,9 @@ srodtytul {"tag": "srodtytul"} insert_tag + + 0 @@ -911,12 +982,9 @@ if (text.length == 0) { panel.fireEvent('contentChanged'); - // params: {exprs: list of {expr: "", repl: "" [, opts: "g"]}} + editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1); var cm = panel.texteditor; - - - var exprs = $.map(params.exprs, function(expr) { var opts = "g"; @@ -953,44 +1021,32 @@ if(!text) { -var changed = false; - +var changed = 0; var lines = text.split('\n'); - var lines = $.map(lines, function(line) { - var old_line = line; - $(exprs).each(function() { - var expr = this; - line = line.replace(expr.rx, expr.repl); - }); - if(old_line != line) changed = true; - + if(old_line != line) changed += 1; return line; - }); - - -if(changed) - +if(changed > 0) { - cm.replaceSelection( lines.join('\n') ); - panel.fireEvent('contentChanged'); - + editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500); + editor.advancePopupQueue(); +} +else { + editor.showPopup('generic-info', 'Brak zmian w tekście', 1500); + editor.advancePopupQueue(); } - - if(!partial) - cm.selectLines( cm.nthLine(cpos.line), cpos.character ) @@ -1015,70 +1071,51 @@ else { } - var cm = panel.texteditor; + editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1); -var exprs = $.map(params.exprs, function(expr) { +var cm = panel.texteditor; +var exprs = $.map(params.exprs, function(expr) { var opts = "mg"; - if(expr.length > 2) - opts = expr[2]; return {rx: new RegExp(expr[0], opts), repl: expr[1]}; - }); - - var partial = true; - var text = cm.selection(); - - if(!text) { - var cpos = cm.cursorPosition(); - cpos.line = cm.lineNumber(cpos.line) - cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0); text = cm.selection(); - partial = false; - } var original = text; - - - $(exprs).each(function() { - text = text.replace(this.rx, this.repl); - }); - - -if( original != text) { - +if( original != text) +{ cm.replaceSelection(text); - panel.fireEvent('contentChanged'); - + editor.showPopup('generic-yes', 'Zmieniono tekst' ); + editor.advancePopupQueue(); +} +else { + editor.showPopup('generic-info', 'Brak zmian w tekście.'); + editor.advancePopupQueue(); } - - if(!partial) { - cm.selectLines( cm.nthLine(cpos.line), cpos.character ); - } @@ -1105,4 +1142,39 @@ if(repl != text) { }; + + var texteditor = panel.texteditor; + +var text = texteditor.selection(); + + + +if(text) { + + text = '\n' + text.split('\n').join('\\\n') + '\n'; + +} + + + +texteditor.replaceSelection('<strofa>'+text+'</strofa>'); + + + +if (!text) { + + var pos = texteditor.cursorPosition(); + + texteditor.selectLines(pos.line, pos.character + 6 + 2); + +} + + + + + + + +panel.fireEvent('contentChanged'); +