Wikibooks plwikibooks https://pl.wikibooks.org/wiki/Wikibooks:Strona_g%C5%82%C3%B3wna MediaWiki 1.39.0-wmf.21 first-letter Media Specjalna Dyskusja Wikipedysta Dyskusja wikipedysty Wikibooks Dyskusja Wikibooks Plik Dyskusja pliku MediaWiki Dyskusja MediaWiki Szablon Dyskusja szablonu Pomoc Dyskusja pomocy Kategoria Dyskusja kategorii Wikijunior Dyskusja Wikijuniora TimedText TimedText talk Moduł Dyskusja modułu Gadżet Dyskusja gadżetu Definicja gadżetu Dyskusja definicji gadżetu Elektrodynamika klasyczna/Elektrostatyka 0 16542 435102 327179 2022-07-19T14:18:36Z Rychozol 20187 drobne red. wikitext text/x-wiki <noinclude>{{SkomplikowanaStronaStart}}</noinclude> Tutaj będziemy się zajmować polami elektrycznymi, które nie zmieniają się w czasie. == Prawo Coulomba == Prawo Coulomba mówi, jak oddziałują dwa punktowe ładunki q i Q, jeśli ich odległość jest R. Siłę, jaką jeden ładunek oddziałuje z drugim przedstawiamy wedle wzoru: {{CentrujWzór|<MATH>\vec{F}={{1}\over{4\pi\epsilon_0}}{{qQ}\over{R^2}}\hat{\vec{R}}</MATH>|1.1}} W powyższym wektorze występuje wektor {{Formuła|<MATH>\vec{R}\;</MATH>}}, który ma kierunek przechodzący przez dwa oddziaływające ładunki, wartość tego wektora równa się odległości między tymi obiektami, a zwrot jest w stronę ładunku, dla której liczymy tę siłę, z jaką oddziałuje ładunek Q z ciałem o ładunku q. Ta siła jest wyrażona przez wzór {{LinkWzór|1.1}}. * gdzie stała występująca w powyższym wzorze jest nazywana stałą przenikalności elektrycznej, a wartość jej jest równa&nbsp;{{Formuła|<MATH>\epsilon_0=8,85\cdot 10^{-12}{{C^2}\over{Nm^2}}</MATH>}}. Przypominając jeszcze raz o wielkości {{Formuła|<MATH>\vec{R}\;</MATH>}} jest to odległość ładunku q od ładunku Q, czyli powinno zachodzić {{Formuła|<math>R=\vec{r}-\vec{r}^'</MATH>}}, gdzie {{Formuła|<MATH>\vec{r}</MATH>}} jest to wektor wodzący cząstki o wartości ładunku, nazwijmy go q, a {{Formuła|<MATH>\vec{r}^'</MATH>}} jest to wektor wodzący źródło pola elektrostatycznego o ładunku Q, i jeśli oba te ładunki są jednakowego znaku, to one się odpychają i dlatego wzór na {{Formuła|<MATH>\vec{F}</MATH>}} nie zawiera w sobie minusa. == Pole elektryczne punktowego ładunku Q == {{Rysunek|Electric Field Lines.svg|lpppldiuo|Linie pola pochodzące od ładunku dodatniego i ujemnego oraz obojętnego}} Natężeniem pola elektrycznego nazywamy wielkość zdefiniowaną wedle wzoru: {{CentrujWzór|<MATH>\vec{E}={{\vec{F}}\over{q}}\;</MaTh>|1.2}} jest on równy sile działającej na ładunek próbny ''q'' podzielonej przez wartość tego ładunku. Wykorzystując wzór {{LinkWzór|1.2}} i siłę {{Formuła|<MATH>\vec{F}\;</MATH>}} działającą na ładunek próbny q {{LinkWzór|1.1}} ze strony punktowego ładunku elektrycznego, wtedy dostajemy wzór na natężenie pola elektrostatycznego wytwarzane przez ładunek Q. {{CentrujWzór|<MATH>\vec{E}={{1}\over{4\pi\epsilon_0}}{{Q}\over{R^2}}\hat{\vec{R}}\;</MATH>|1.3}} Wzór {{LinkWzór|1.3}} przestawia natężenie pola elektrycznego wytwarzane przez ładunek Q w odległości R od tego ładunku. Kierunek tej wielkości pokrywa się z prostą przechodzącą przez ten ładunek Q i przez punkt, w którym liczymy to właśnie natężenie, a zwrot jej zależy od znaku ładunku Q i jest przeciwny do ładunku Q na tej prostej, gdy ładunek Q ma znak dodatni, gdy ma ujemny znak, to w stronę tegoż wspomnianego ładunku. == Wypadkowe pole elektryczne == Załóżmy, że pole elektryczne pochodzi od ładunków q<sub>1</sub>,q<sub>2</sub>,...,q<sub>N</sub>, to wtedy całkowita siła działająca na ładunek q jest sumą sił działających od tych ładunków i wyrażona jest: {{CentrujWzór|<MATH>\vec{F}=\sum^N_{i=1}\vec{F}_i=\sum^N_{i=1}{{qq_i}\over{4\pi\epsilon_0}}{{1}\over{R_i^2}}\hat{\vec{R}}_i={{q}\over{4\pi\epsilon_0}}\sum^N_{i=1}{{q_i}\over{R_i^2}}\hat{\vec{R_i}}</MATH>|1.4}} Oznaczmy przez {{Formuła|<Math>\vec{E}\;</maTH>}} natężenie pola elektrycznego i zapiszmy je jako stosunek siły działającej na ładunek próbny q przez ten ładunek i zapisujemy go podobnie jak w punkcie {{LinkWzór|1.2}} dla jednego ładunku elektrycznego, wtedy całkowite natężenie pola elektrycznego wytwarzane przez układ ładunków, który na ładunek próbny q działa z siłą {{LinkWzór|1.4}} i według definicji natężenie pola {{linkWzór|1.2}} pochodzącej od tych ładunków jest napisane: {{CentrujWzór|<MATH>\vec{E}={{1}\over{4\pi\epsilon_0}}\sum^N_{i=1}{{q_i}\over{R_i^2}}\hat{\vec{R}}_i=\sum_i \vec{E}_i</MATH>|1.5}} Jak widzimy całkowite pole elektryczne jest równe sumie pól wytwarzanych przez punktowe ładunki q<sub>i</sub>. == Wypadkowe pole elektryczne dla ciągłego rozkładu ładunków == Określmy, że nieskończenie mały ładunek znajdujący się w położeniu {{Formuła|<MATH>\vec{r}\;</MATH>}}, który piszemy według: {{CentrujWzór|<MATH>dq(\vec{r})=\rho(\vec{r})dV</MATH>|1.6}} Pole elektryczne w dowolnym punkcie A jest wyrażone podobnie jak według wzoru {{LinkWzór|1.5}}, ale tutaj zamiast q<sub>i</sub> są ładunki nieskończenie małe, całkowite natężenie pola elektrycznego jest sumą przyczynków natężeń pól elektrycznych pochodzących od infinitezymalnych ładunków {{LinkWzór|1.6}}, czyli {{Formuła|<MATH>dq(\vec{r})</MATH>}}, to natężenie pola elektrycznego dla rozciągłego rozkładu ładunków jest wyrażone: {{CentrujWzór|<MATH>\vec{E}(\vec{r})=\int_V d\vec{E}(\vec{r}^')=\int_V{{1}\over{4\pi\epsilon_0}}{{dq(\vec{r}^')}\over{R^2}}\hat{\vec{R}}={{1}\over{4\pi\epsilon_0}}\int_V{{\rho(\vec{r}^')}\over{R^2}} \hat{\vec{R}}dV^'</MATH>|1.7}} Tutaj przyjęliśmy taką samą definicję wektora {{Formuła|<MATH>\vec{R}</MATH>}}, co poprzednio, wyznaczając infinitezymalne natężenie pola elektrycznego pochodzące od nieskończenie małego pojedynczego przyczynku, i na tej podstawie wyznaczyliśmy całkowite pole pochodzące od ciągłego rozkładu ładunków, to natężenie {{LinkWzór|1.7}} jest to stosunek siły działający na ładunek próbny q przez ten ładunek, i jego ładunek jest na tyle mały, by jego pole nie zakłócało ciągłego rozkładu ładunków. Rozkład natężenia pola elektrycznego zależy od gęstości ładunku elektrycznego tego rozkładu i jest napisany przez &rho;(r). <noinclude>{{Kreska nawigacja|{{AktualnaKsiążka}}|{{NastępnyArtykuł}}|{{PoprzedniArtykuł}}}}</noinclude><noinclude>{{SkomplikowanaStronaKoniec}}</noinclude> rlyt5enjraramultcvrdofl7k6g6hgg Szablon:StronaStart 10 19820 435100 435088 2022-07-19T14:12:51Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak|wysokość=calc( 100vh - 260px )}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> 6hvdotfkkntd5qpgaqis8jbaxvgwwou 435224 435100 2022-07-19T20:18:27Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:none;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak|wysokość=calc( 100vh - 260px )}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> f5u2cu5nokrxx0p65icb61qr46eyt4f 435225 435224 2022-07-19T20:22:21Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:none;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> gd8arlam7gq1e3ih6swizaxb7j4s7jg 435227 435225 2022-07-19T20:33:04Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:block;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> twcmgzmyxd9ygbeuy6trhg92p88klxm 435229 435227 2022-07-19T20:51:42Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:none;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> gd8arlam7gq1e3ih6swizaxb7j4s7jg 435239 435229 2022-07-19T21:29:10Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:block;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> twcmgzmyxd9ygbeuy6trhg92p88klxm 435252 435239 2022-07-20T08:40:04Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:flex;flex-direction:column;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> rb7qvugwwm13nwplajszzbrpmsmbwfu 435254 435252 2022-07-20T08:48:17Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:block;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> twcmgzmyxd9ygbeuy6trhg92p88klxm 435257 435254 2022-07-20T09:02:30Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:block;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak|wysokość=calc( 100vh - 260px )}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;display:flex;flex-direction:column;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> a46jig4mj8ooxe3vzlt86sunvp95ajs 435262 435257 2022-07-20T09:45:05Z Persino 2851 wikitext text/x-wiki <includeonly><templatestyles src="Szablon:StronaStart/stronastart.css" /><templatestyles src="Szablon:TOC_limit/styles.css" />{{#if:{{{formatowanie|}}}|<templatestyles src="Szablon:StronaStart/styles.css" />{{#if:{{{boczne menu|}}}|{{#if:{{{spis treści|TOC}}}{{{wykaz modułów|WYKAZ}}}|<templatestyles src="Szablon:TOC/styles.css" />}}}}}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}|||{{Mniejszy}}div class="strona_start" style="min-width:822px;width:auto;max-width:100%;height:auto;box-sizing:border-box;overflow:hidden"{{Większy}}{{Mniejszy}}div style="display:flex;flex-direction:column;"{{Większy}}{{#if:{{{podręcznik|tak}}}|{{Podręcznik|styl=order:1;}}}}{{Mniejszy}}div style="order:2;"{{Większy}} {{{nagłówek|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div style="order:4;"{{Większy}} {{{stopka|}}}{{Mniejszy}}/div{{Większy}}{{Mniejszy}}div class="noprint" class="główna_strona tło" style="order:3;position:relative;top:0px;left:0px;display:flex;flex-direction:row;{{#if:{{{margines zewnętrzny|0}}}|margin:{{{margines zewnętrzny|0}}};}}"{{Większy}}{{#if:{{{boczne menu|}}}|__NOTOC__}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}{{{nagłówek prawy|}}}{{{stopka prawa|}}}| <div style="order:1;width:100%;" class="strona_lewa"><!-- --><div style="position:relative;height:100%;display:flex;flex-direction:column;box-sizing:border-box;z-index:1"><!-- -->{{#if:{{{nagłówek lewy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{nagłówek lewy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka lewa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;left:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;left:0;|{{{stopka lewa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div><!-- --><div style="width:100%;order:3;" class="strona_prawa"><div class="mw-sticky-y toclimit {{#if:{{{limit|}}}|toclimit-{{{limit}}}}} {{#if:{{{formatowanie|}}}|fonty_rodzina_sans {{#if:{{{boczne menu|}}}|fonty_poboczna_kolumna|fonty_toc}}}} spis" style="display:block;z-index:2;position:absolute;right:0;top:52px;width:{{#if:{{{boczne menu|}}}|700px|auto}};max-width:700px;box-sizing:border-box;height:auto;{{#if:{{{boczne menu|}}}|border: solid #aaa 1px;}}overflow:visible;{{#if:{{{margines zewnętrzny poboczny|0}}}|margin:{{{margines zewnętrzny poboczny|0}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-size:{{{rozmiar czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|line-height:{{{wysokość linii czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-family:{{{rodzina czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-variant:{{{wariant czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-stretch:{{{rozciągnięcie czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-weight:{{{waga czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}}{{#if:{{{czcionka {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}||{{#if:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}}|font-style:{{{styl czcionki {{#if:{{{boczne menu|}}}|bocznego menu|TOC}}|}}};}}}};{{#if:{{{boczne menu|}}}|{{#if:{{{margines wewnętrzny poboczny|10px}}}|padding:{{{margines wewnętrzny poboczny|10px}}};}}}}background-color:{{#if:{{{boczne menu|}}}|white|transparent}}"><!-- -->{{#if:{{{boczne menu|}}}<!-- -->|{{#invoke:StronicowyParser|PierwszaStrona|{{{nazwa modułu|NAZWA MODUŁU}}}|{{{licencja|LICENCJA}}}|{{{wykaz modułów|WYKAZ}}}|{{{spis treści|TOC}}}|rozciągnij=tak|wysokość=calc( 100vh - 80px )|bez marginesu dolnego=tak}}<!-- -->|{{#switch:{{#invoke:Pudełko|Typ jednostki|obsługiwane jednostki użytkownika=tak|obsługiwane jednostki brudnopisu projektu=tak|obsługiwane strony jako niebrudnopisowe jednostki programowe=tak}}<!-- -->|podręcznik|podręcznik dla dzieci|podręcznik brudnopisu projektu|podręcznik użytkownika={{Jeśli niepuste|{{#invoke:StronicowyParser|WykazModolow|spis książkowy=tak|spis rzeczy=tak|nagłówki=tak|wysokość=calc( 100vh - 260px )}}|__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}|przed lewy={{Div start|styl=width:700px;background-color:white;display:flex;flex-direction:column;overflow:auto;}}{{StronaTytułowa|rozmiar=100%}}__NOTOC__|po lewy={{Div koniec}}}}<!-- -->|strona szablonu={{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->|#default=__NOTOC__{{TOC/silnik|funkcja=PokazanaNiewikitabelowaListaMenu|spis treści=Spis treści|spis artykułu=tak|limit={{{limit|}}}|bez dodatkowych sprawdzeń=tak|bez komunikatu błędu=tak|wysokość=calc( 100vh - 85px )}}<!-- -->}}<!-- -->}}<!-- --></div> <!-- --><div style="position:relative;height:auto;display:flex;flex-direction:column;position:relative;margin-top:360px;box-sizing:border-box;z-index:1;"><!-- -->{{#if:{{{nagłówek prawy|}}}|<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{nagłówek prawy}}}}} }}<!-- -->{{DivClear}}<!-- -->}}<!-- -->{{Div|styl=height:100%;box-sizing:border-box;}}<!-- -->{{#if:{{{stopka prawa|}}}|{{DivClear}}<!-- -->{{Tabela nawigacyjna | funkcja = PokazanaNiewikitabelowaListaMenu | styl = position:absolute;right:0;display:block; | styl tytułu = background-color:white; | tytuł = | bez dodatkowych sprawdzeń = tak | spis = {{Div|styl=position:absolute;right:0;|{{{stopka prawa}}}}} }}<!-- -->}}<!-- --> </div><!-- --></div>}}<!-- -->}}{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|{{Mniejszy}}div style="order:2;display:flex;flex-direction:column;" class="strona_środkowa"{{Większy}}<!-- --><div style="order:1">{{{wstęp|}}}</div><!-- --><div style="order:3">{{{zakończenie|}}}</div><!-- -->}}{{Mniejszy}}div id="strona" {{#if:{{{formatowanie|}}}|class="strona mw-overflow-x print fonty_rodzina_sans fonty_główna_kolumna {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"|class="strona {{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}||strona_start}}"}} style="{{#if:{{{boczne menu|}}}{{{spis treści|TOC}}}|order:2;}}display:flex;flex-direction:column;position:relative;left:0px;top:0px;min-width:{{{minimalna szerokość strony|{{{szerokość strony|822px}}}}}};max-width:{{{maksymalna szerokość strony|{{{szerokość strony|822px}}}}}};width:{{{szerokość strony|822px}}};height:{{{wysokość strony|100%}}};{{#if:{{{obramowanie|tak}}}|border: solid #aaa 1px;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}|padding:{{{margines wewnętrzny|10px 10px 10px 10px}}};}}{{#if:{{{margines zewnętrzny główny|0}}}|margin:{{{margines zewnętrzny główny|0}}};}}{{#ifeq:{{{boczne menu|}}}{{{spis treści|TOC}}}||{{#if:{{{margines zewnętrzny|5px 0 0 0}}}|margin:{{{margines zewnętrzny|5px 0 0 0}}};}}}}{{#if:{{{pasek przewijania|hidden}}}|overflow-x:{{{pasek przewijania|hidden}}};overflow-y:visible;}}{{#if:{{{margines wewnętrzny|10px 10px 10px 10px}}}{{{obramowanie|tak}}}|box-sizing:border-box;}}{{#if:{{{czcionka strony|}}}|font:{{{czcionka strony|}}};}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozmiar czcionki strony|}}}|font-size:{{{rozmiar czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wysokość linii czcionki strony|}}}|line-height:{{{wysokość linii czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rodzina czcionki strony|}}}|font-family:{{{rodzina czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{wariant czcionki strony|}}}|font-variant:{{{wariant czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{rozciągnięcie czcionki strony|}}}|font-stretch:{{{rozciągnięcie czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{waga czcionki strony|}}}|font-weight:{{{waga czcionki strony|}}};}}}}{{#if:{{{czcionka strony|}}}||{{#if:{{{styl czcionki strony|}}}|font-style:{{{styl czcionki strony|}}};}}}}background-color:white;"{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_kontener" class="ciało_kontener" style="display:flex;flex-direction:column"{{Większy}}<!-- -->{{Mniejszy}}div style="order:1;flex:0 1 auto;max-width:100%;"{{Większy}}{{{nagłówek strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div style="order:3;flex:0 1 auto;max-width:100%;"{{Większy}}{{{stopka strony|}}}{{Mniejszy}}/div{{Większy}}<!-- -->{{Mniejszy}}div id="ciało_strona" class="ciało_strona" style="order:2;flex:0 1 auto;max-width:100%;"{{Większy}}<!-- --></includeonly><noinclude>{{Dokumentacja}}</noinclude> rc5a1f98b9m4198cpl02qpw0yofyq9y Moduł:StronicowyParser 828 34347 435226 434943 2022-07-19T20:28:46Z Persino 2851 Scribunto text/plain local p = {} function p.SpreparowanyWikikodStrony(nazwa_modolu,dokumentacja) local stronicowyparser_dalszefunkcje=require("Module:StronicowyParser/DalszeFunkcje") return stronicowyparser_dalszefunkcje.SpreparowanyWikikodStrony(nil,nazwa_modolu,dokumentacja); end; function p.PrzekierowanieDoStrony(frame) local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local nazwa_modulu=PobierzParametr(1); local latki_modul=require("Module:Łatki"); return latki_modul.contentMatch{args={ [1]="^%s*#REDIRECT%s+%[%[(.+)%]%]%s*", [2]="^%s*#PATRZ%s+%[%[(.+)%]%]%s*", [3]="^%s*#TAM%s+%[%[(.+)%]%]%s*", namespace="", pagename=nazwa_modulu, }, }; end; p["TekstRozdziałuStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.TekstRozdzialuStrony(frame); end; p["KtóraSekcjaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.KtoraSekcjaStrony(frame); end; p["ZwróćSekcjęNagłówkaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.ZwrocSekcjeNaglowkaStrony(frame); end; p["NastępnyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$"); local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local i=0; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie_element in ipairs(tab_lista[2])do local artykul_w_bazie;local artykul_bez_naglowka_w_bazie;local artykul_z_naglowkiem_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie_element[1]); if(czy_table)then artykul_w_bazie=artykul_w_bazie_element[1][1]; else artykul_w_bazie=artykul_w_bazie_element[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_w_bazie,"^([^#]*)#.*$"); artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end if(not naglowek)then artykul_z_naglowkiem_w_bazie=artykul_bez_naglowka_w_bazie; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie; end; local numer_artykulu_w_bazie; if(numer>0)then numer_artykulu_w_bazie=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); end; local function Nastepny() if(not nazwa)then return artykul_z_naglowkiem_w_bazie; end; if(czy_table)then return artykul_w_bazie[1][2]; else return artykul_z_naglowkiem_w_bazie; end; end; if(i==1)then if(numer>0)then local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka,numer); if((numer==numer_artykulu_w_bazie)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then return Nastepny(); end; else return Nastepny(); end; else if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match))) and (artykul_z_naglowkiem_w_bazie==nazwa_artykulu) ))then i=1; end; end; end; end; end; end; if(i==1)then return ""; end; return "(błąd)"; end; p["PoprzedniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$") local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local artykul; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_z_naglowkiem_w_bazie;local artykul_bez_naglowka_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie[1]); if(czy_table)then artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1][1]; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_z_naglowkiem_w_bazie,"^([^#]*)#.*$") artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_z_naglowkiem_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end; if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match)))and(artykul_z_naglowkiem_w_bazie==nazwa_artykulu)))then if(not artykul)then return "";end; local czy_table_artykul=parametry_modul.TypeTable(artykul); if(czy_table_artykul)then if(not nazwa)then if(naglowek)then return artykul[1]; end; artykul,_=mw.ustring.gsub(artykul[1],"^([^#]+)#(.*)$","%1"); return artykul; else return artykul[2]; end; else if(naglowek)then return artykul; end; artykul,_=mw.ustring.gsub(artykul,"^([^#]+)#(.*)$","%1"); return artykul; end; end if(numer>0)then local numer_artykulu_poprzedni=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka_w_bazie,numer); if((numer==numer_artykulu_poprzedni)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then artykul=artykul_w_bazie[1]; end; else artykul=artykul_w_bazie[1]; end; end; end; end; end; return "(błąd)"; end; p["PoziomNazwyArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.PoziomAdresu(nazwa_artykulu); end; p["PierwszyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then local artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; return (not naglowek) and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; else return parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or ((not naglowek) and mw.ustring.gsub(artykul_w_bazie[1],"^([^#]*)#(.*)$","%1") or artykul_w_bazie[1]); end; end; end; end; end; p["OstatniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; else ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or artykul_w_bazie[1]; end; end; end; end; if(ostatni_artykul)then return (not naglowek) and mw.ustring.gsub(ostatni_artykul,"^([^#]*)#(.*)$","%1") or ostatni_artykul; end; return "(błąd)"; end; p["PomiędzyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:PomiedzyArtykul(frame) or nil; if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return (not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or ((not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element); end; p["LosowyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:LosowyArtykul(frame); if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element; end; local function PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local ktory=(tonumber(args["który"]) or 1); local parametr_pierwszy_szablonu=typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or args[1]; if(not typ)then parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"^[%s_]+",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+$",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+"," "); end; local HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumer_2=nil; local tab_numer_2=nil; local tab_numer={}; local i=(not poziomowo) and 0 or nil; local i_2=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local poziom_spisu_tresci=nil; local pierwszy_dodatni_spis_tresci=nil; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local poziom_rozdzialu=tab_lista[1][2][1]; if(poziom_rozdzialu>0)then local czy_nie_ten_rozdzial=nil; local czy_jest_teraz_spis_tresci=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial];local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; if(not czy_nie_ten_rozdzial)then if(poziomowo)then local hnumer=HNumer(poziom_rozdzialu); if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; else tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; end; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); ---- if(wartosc)then return wartosc;end; ---- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then HNumer_2=HNumer; HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then HNumer=HNumer_2; HNumer_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_dodatni_spis_tresci=false; end; else i=i+1; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); --- if(wartosc)then return wartosc;end; --- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then i_2=i; i=0; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then i=i_2; i_2=nil; pierwszy_dodatni_spis_tresci=false; end; end; end; end; end; end; p["PobierzNumerNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,naglowek,rozdzial) if(naglowek==rozdzial)then if(s==ktory)then if(poziomowo)then if(#tab_numer==0)then return;end; return table.concat(tab_numer,"."); else return i; end; end; s=s+1; end; end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,false); end; p["PobierzNazwęNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,numer,rozdzial) if(poziomowo)then if(#tab_numer==0)then return;end; if(numer==table.concat(tab_numer,"."))then if(s==ktory)then return rozdzial; else s=s+1; end; end; elseif(numer==i)then if(s==ktory)then return rozdzial; else s=s+1; end; end end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,true); end; local function PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek)and {} or nil; local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local tab_poziomowo={}; local tab_poziomowo_1={}; local tab_poziomowo_2={}; local html_modul=require("Module:Html"); local pierwszy_parametr_szablonu=args[1] and (typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or ((not naglowek) and mw.ustring.gsub(html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1])),"^([^#]*)#(.*)$","%1") or html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1]))) ) or (typ and 1 or "Przykładowy artykuł"); local ktory=(tonumber(args["ktory"]) or 1); local i=(not poziomowo) and 1 or nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; --local HNumer=poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_4=nil--poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_3=nil local HNumerPoziomow_2=nil; local HNumerPoziomow_1=nil; local HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow_1=nil; local HNumerPoziomowNaglowkow_2=nil; --local HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local tab_numer=poziomowo and {} or nil; tab_numer_1=nil; tab_numer_3=nil tab_numer_4=nil;--poziomowo and {} or nil; local spis=false; local czy_poziom_spisu_tresci=nil; local pierwszy_dodatni_naglowek=nil; local pierwszy_ujemny_naglowek=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local poprzedni_poziom_znakowy_rozdzialu=nil; local poprzedni_tab_poziomowo=nil; local poziom_pierwszego_dodatniego_naglowka=0; local poziom_pierwszego_ujemnego_naglowka=0; local poziom_zerowego_naglowka=0; local poziom_spisu_tresci_naglowka=0; local numer_poziomu=nil; local ostatni_rozdzial_dodatni=nil; local pierwszy_rozdzial_dodatni=nil; local glowny_dodatni_rozdzial=nil; local glowny_ujemny_rozdzial=nil; local spis_tresci=nil; local poziom_pierwszego_ujemnego_spisu_tresci=nil; local ostatni_poczatek_artykulu=nil; local pierwszy_rowny_rozdzial=nil; local artykuly_w_rozdziale=nil; local spis_tresci_zerowy; local poziom_zerowy; local rozdzial; if(poziomowo and tab_lista_artykulow_w_ksiazce[1])then rozdzial=tab_lista_artykulow_w_ksiazce[1][1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); spis_tresci_zerowy=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]; poziom_zerowy=tab_lista_artykulow_w_ksiazce[1][1][2][1]; end; for m,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local tab_poprzedni_artykul_w_bazie=nil; local poziom_rozdzialu; local poziom_poczatku_rozdzialu=nil; local poziom_znakowy_rozdzialu=nil; local poziom_naglowka=nil; if(poziomowo)then poziom_rozdzialu=tab_lista[1][2][1]; poziom_poczatku_rozdzialu=tab_lista[1][2][2]; if(m>1)then rozdzial=tab_lista[1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); end; tab_poziomowo={}; local czy_jest_teraz_spis_tresci=((m>1)and(not spis_tresci_zerowy or not poziom_zerowy)or((m==1)and(spis_tresci_zerowy))) and ((m==1) and true or tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]) local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; --if(not czy_nie_ten_rozdzial)then poprzedni_poziom_znakowy_rozdzialu=poziom_znakowy_rozdzialu; poziom_znakowy_rozdzialu=poziom_rozdzialu; poziom_rozdzialu=math.abs(poziom_rozdzialu); artykuly_w_rozdziale=nil; if(poziom_znakowy_rozdzialu>0)then poziom_naglowka=poziom_rozdzialu; poziom_pierwszego_ujemnego_spisu_tresci=nil; poprzedni_tab_poziomowo=nil; poziom_zerowego_naglowka=0; if(glowny_ujemny_rozdzial)then HNumerPoziomow=HNumerPoziomow_4; HNumerPoziomow_4=nil; tab_numer=tab_numer_4; poziom_pierwszego_ujemnego_naglowka=nil; glowny_ujemny_rozdzial=nil; end; if(pierwszy_ujemny_spis_tresci)then HNumerPoziomow=HNumerPoziomow_2; HNumerPoziomow_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_ujemny_spis_tresci=nil; czy_poziom_ujemny_spisu_tresci=nil; end; if(not glowny_dodatni_rozdzial)then if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not czy_jest_teraz_spis_tresci)and(not spis_tresci))then numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); spis_tresci=true; else if(not pierwszy_rozdzial_dodatni)then pierwszy_rozdzial_dodatni=1; numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu); end; end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); glowny_dodatni_rozdzial=false; end; ostatni_rozdzial_dodatni=poziom_rozdzialu; elseif(poziom_znakowy_rozdzialu<0)then if(not pierwszy_rowny_rozdzial)then if((ostatni_poczatek_artykulu) and(#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu~=poziom_poczatku_rozdzialu) and(mw.ustring.match(ostatni_poczatek_artykulu,"^*")) and(mw.ustring.match(poziom_poczatku_rozdzialu,"^:")) )then poziom_rozdzialu=poziom_rozdzialu+1; poziom_znakowy_rozdzialu=-poziom_rozdzialu; pierwszy_rowny_rozdzial=1; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; else poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; else if((#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu==poziom_poczatku_rozdzialu) )then pierwszy_rowny_rozdzial=0;end; poziom_rozdzialu=poziom_rozdzialu+pierwszy_rowny_rozdzial; poziom_znakowy_rozdzialu=-poziom_rozdzialu; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; if(not glowny_ujemny_rozdzial)then --if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not spis_tresci))then -- numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); -- spis_tresci=true; --else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka); --end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka,1); glowny_ujemny_rozdzial=false; end; else if((m>1)or((m==1)and(not czy_jest_teraz_spis_tresci)))then poziom_zerowego_naglowka=1; numer_rozdzialu=HNumerPoziomow( 1 + (ostatni_rozdzial_dodatni or 0) + 0); poziom_znakowy_rozdzialu=-1; poziom_rozdzialu=1; poziom_naglowka= 1 + (ostatni_rozdzial_dodatni or 0) + 0; else poziom_zerowego_naglowka=0; numer_rozdzialu=0; poziom_naglowka=(ostatni_rozdzial_dodatni or 0) + 0; end; end; local numer; if(poziom_znakowy_rozdzialu>0)then local numer=HNumerPoziomowNaglowkow(poziom_znakowy_rozdzialu); --HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); elseif(poziom_znakowy_rozdzialu<0)then --local numer=HNumerPoziomowInnychNaglowkow(-poziom_znakowy_rozdzialu); end; if((m>1) and(tab_lista_artykulow_w_ksiazce[m-1]) and(tab_lista_artykulow_w_ksiazce[m-1][2]) and(#tab_lista_artykulow_w_ksiazce[m-1][2][1]>0) and(tab_lista_artykulow_w_ksiazce[m-1][2][#tab_lista_artykulow_w_ksiazce[m-1][2]][2][1]==0) )then local lens_tab_numer=#tab_numer; local roznica=math.min(#poprzedni_tab_poziomowo+#tab_numer,numer_rozdzialu)-#tab_numer; roznica=((roznica>0) and roznica or 0); for i=1,roznica,1 do tab_numer[i+lens_tab_numer]=poprzedni_tab_poziomowo[i]; end; end; if((czy_jest_teraz_spis_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if(poziom_znakowy_rozdzialu>0)then poziom_spisu_tresci_naglowka=poziom_rozdzialu; else poziom_pierwszego_ujemnego_spisu_tresci=poziom_rozdzialu; end; end; if(poziom_rozdzialu>0)then if((((czy_poziom_dodatni_spisu_tresci)and(poziom_znakowy_rozdzialu>0))or((czy_poziom_ujemny_spisu_tresci)and(poziom_znakowy_rozdzialu<0))) and(poziom_spisu_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu) )then if(poziom_znakowy_rozdzialu>0)then tab_numer=tab_numer_1; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_1; HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_1; czy_poziom_dodatni_spisu_tresci=false; elseif(poziom_znakowy_rozdzialu<0)then tab_numer=tab_numer_2; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_2; --HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_2; czy_poziom_ujemny_spisu_tresci=false; pierwszy_ujemny_spis_tresci=nil; end; end; local hnumer=numer_rozdzialu; if(poprzedni_tab_poziomowo)then local lens=math.min(#poprzedni_tab_poziomowo,hnumer-#tab_numer); local len_tab_numer=#tab_numer; for i=1,lens,1 do tab_numer[len_tab_numer+i]=poprzedni_tab_poziomowo[i]; end; for i=lens+1,#tab_numer do tab_numer[len_tab_numer+i]=nil; end; end; if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; else tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; end; else --[[if(poziom_rozdzialu==0)then if(tab_lista_artykulow_w_ksiazce[m+1])then if(tab_lista_artykulow_w_ksiazce[m+1][1][2]>0)then tab_numer={0,}; elseif(tab_lista_artykulow_w_ksiazce[m+1][1][2]<0)then tab_numer={}; end; else tab_numer={}; end; end;]] end; --end; if((czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_spis_tresci)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_spis_tresci)and(poziom_znakowy_rozdzialu<0))))then function Poziom_dodatni() for s,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(s>m)then if(tab_lista[1][2][1]>0)then if(math.abs(tab_lista[1][2][1])>poziom_rozdzialu)then return true; else return false; end; end; end; end; return true; end; local id=nil; if(tab_lista_artykulow_w_ksiazce[m][2])then for p,artykul_w_bazie in ipairs(tab_lista_artykulow_w_ksiazce[m][2])do id=tab_lista_artykulow_w_ksiazce[m][2][p][4]; if(id)then break; end; end; end; if((poziom_znakowy_rozdzialu>0)and((id)or(Poziom_dodatni())))then tab_poziomowo_1=tab_poziomowo; tab_poziomowo={}; czy_poziom_dodatni_spisu_tresci=true; HNumerPoziomow_1=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); HNumerPoziomowNaglowkow_1=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_1=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((poziom_znakowy_rozdzialu<0) and((id)or((tab_lista_artykulow_w_ksiazce[m+1]) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu))))then tab_poziomowo_2=tab_poziomowo; tab_poziomowo={}; czy_poziom_ujemny_spisu_tresci=true; HNumerPoziomow_2=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; --HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_ujemny_spis_tresci=true; end; end; local function OTakimSamymLubMniejszymPoziomie(m) if(poziom_rozdzialu==0)then return true;end; local lens=parametry_modul["LiczbaElementówNumerowanychTablicy"](tab_lista_artykulow_w_ksiazce); if(m==lens)then return true;end; if(poziom_znakowy_rozdzialu>0)then for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]>0)then if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])<=poziom_rozdzialu)then return true; end; end; end; end; elseif(((m==1)or((tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]>0)))and(poziom_znakowy_rozdzialu<0))then local poziom_zerowego_naglowka_innego=0; for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]<=0)then local ile=tab_lista_artykulow_w_ksiazce[k][1][2][1]; if(ile==0)then if((czy_jest_teraz_spis_tresci)and(m==1))then poziom_zerowego_naglowka_innego=poziom_zerowego_naglowka; else poziom_zerowego_naglowka_innego=1; end; end; if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])+poziom_zerowego_naglowka_innego<=poziom_rozdzialu)then return true; end; else break; end; end; end; else return true; end; end; -- if(not czy_nie_ten_rozdzial)then if((tab_lista[2]) and(tab_lista[2][1]) and(tab_lista[2][1][2][1]==0) and(not tab_lista[2][1][4]) and(tab_lista_artykulow_w_ksiazce[m+1]) and(((poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( ((poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])+poziom_zerowego_naglowka>poziom_rozdzialu) ) )or( (poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]~=0) )) )then if(m==1)then tab_numer={0,} else table.insert(tab_numer,0); end; elseif((m==1)and(not tab_lista_artykulow_w_ksiazce[m+1]))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0))then tab_numer={0,} elseif((poziomowo)and(m==2)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu<0)and(tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]==0))then if(poprzedni_tab_poziomowo)then local min=math.min(math.abs(numer_rozdzialu),#poprzedni_tab_poziomowo); for i=#poprzedni_tab_poziomowo,min+1,-1 do table.remove(poprzedni_tab_poziomowo,i) end; tab_numer=poprzedni_tab_poziomowo; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; end; elseif((not czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_naglowek)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_naglowek)and(poziom_znakowy_rozdzialu<0))))then if(poziom_rozdzialu>0)then if(not OTakimSamymLubMniejszymPoziomie(m))then if(poziom_znakowy_rozdzialu>0)then HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_3=tab_numer; tab_numer={0,}; HNumerPoziomow_3=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); pierwszy_dodatni_naglowek=true; poziom_pierwszego_dodatniego_naglowka=poziom_rozdzialu; glowny_dodatni_rozdzial=true; else tab_numer_4=tab_numer; tab_numer=parametry_modul["KopiujTabelęElementów"](tab_numer); tab_numer[#tab_numer]=nil; HNumerPoziomow_4=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); if(poziom_naglowka or 0>0)then HNumerPoziomow(poziom_naglowka,#tab_numer); end; pierwszy_ujemny_naglowek=true; poziom_pierwszego_ujemnego_naglowka=poziom_rozdzialu; glowny_ujemny_rozdzial=true; end; else if(poziom_znakowy_rozdzialu>0)then pierwszy_dodatni_naglowek=true;else pierwszy_ujemny_naglowek=true;end; end; end; elseif((czy_jest_teraz_spis_tresci)and(not czy_nie_ten_rozdzial))then if((not spis)and(poziom_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )) )then tab_numer={0,}; spis=true; end elseif((tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )--[[or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )]]) )then table.insert(tab_numer,0); end; -- end; end; if(tab_lista[2])then local HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local czy_tytul_rozdzial=nil;local poprzedni_b=nil;local ile_odjac=0; local HNumerB=nil; local poprzedni_poziom_artykulu=nil; local czy_ma_elementy=nil; local poziom_poprzedni_artykulu=nil; for p,artykul_w_bazie in ipairs(tab_lista[2])do local artykul=artykul_w_bazie[1][1] or artykul_w_bazie[1]; artykul=(not naglowek)and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; if(naglowek or not tab_artykul[artykul])then pierwszy_rowny_rozdzial=nil; czy_ma_elementy=true; if(not naglowek)then tab_artykul[artykul]=true; end; local tab_artykul_w_bazie; if(poziomowo)then local poziom_artykulu=artykul_w_bazie[2][1]; local poziom_poczatku_artykulu=artykul_w_bazie[2][2]; local w_rozdziale=artykul_w_bazie[2][4]; if(w_rozdziale)then if((w_rozdziale)and(not tab_lista[2][p+1]))then local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,{}); if(wartosc)then return wartosc;end; end; function Dalej() for s,artykul_w_bazie in ipairs(tab_lista[2])do if(s>p)then if((tab_lista[2][s])and(not tab_lista[2][s][2][4]))then return true; end; end; end; return false; end; if(Dalej())then tab_numer[#tab_numer+1]=0; artykuly_w_rozdziale=true; end; elseif(artykuly_w_rozdziale)then artykuly_w_rozdziale=nil; table.remove(tab_numer,#tab_numer); tab_poziomowo={}; end; ostatni_poczatek_artykulu=poziom_poczatku_artykulu; local function ToNumberPoziomArtykulu(poziom_artykulu) local numer=tonumber(poziom_artykulu) or 1; if(numer<1)then numer=1;end; return numer; end; poziom_artykulu=ToNumberPoziomArtykulu(poziom_artykulu); poziom_artykulu=poziom_artykulu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; local numer_poziomu=HNumerPoziomow(poziom_artykulu); if(p>1)then local numer_poprzedni=tonumber(tab_lista[2][p-1][2][1]) or 1; local id_poprzednie=tab_lista[2][p-1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_poprzedni==0)and(not id_poprzednie)and(not id)and(numer>0))then if(#tab_numer>(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka)then tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; tab_poziomowo={}; end; end; end; local prefix_poziom_artykulu=poziom_artykulu; local b=0; local tab_artykul_w_bazie=mw.text.split(artykul,"/"); if(tab_poprzedni_artykul_w_bazie)then if(poprzedni_poziom_artykulu)then if(poprzedni_poziom_artykulu==poziom_artykulu)then for c=1,#tab_artykul_w_bazie,1 do local podstrona_artykul=tab_artykul_w_bazie[c]; local podstrona_nazwy_artykulu=tab_poprzedni_artykul_w_bazie[c]; if(podstrona_artykul==podstrona_nazwy_artykulu)then b=b+1; end; end; else b=0; end; end; if(poziom_znakowy_rozdzialu<0)then if(#tab_numer~=0)then if(poziom_artykulu<=(poziom_pierwszego_ujemnego_naglowka or 0))then tab_poziomowo=tab_numer_4; tab_numer={}; HNumerArtykulu=HNumerPoziomow_4; elseif((poziom_poprzedni_artykulu)and(poziom_artykulu>(poziom_pierwszego_ujemnego_naglowka or 0))and(poziom_poprzedni_artykulu>(poziom_pierwszego_ujemnego_spisu_tresci or 0))and(poziom_artykulu<=(poziom_pierwszego_ujemnego_spisu_tresci or 0)))then HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); for i=#tab_poziomowo,numer_poziomu+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0 ) + 1; tab_poziomowo=tab_numer; tab_numer={}; elseif((poziom_naglowka>=poziom_artykulu)or((poziom_rozdzialu==poziom_artykulu) and((numer_poziomu<numer_rozdzialu) or((numer_poziomu==numer_rozdzialu) and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu) )) ))then local tab_numer2={}; for i=1,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka,1 do tab_numer2[i]=tab_numer[i]; end; local tab_poziomowo2={}; for i=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,#tab_numer,1 do tab_poziomowo2[i-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka]=tab_numer[i]; end; local indeks=(((HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1>#tab_numer) and 0 or (#tab_numer-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka)); for i=1,numer_poziomu,1 do tab_poziomowo2[i+indeks]=tab_poziomowo[i]; end; tab_numer=tab_numer2; tab_poziomowo=tab_poziomowo2; --[[tab_poziomowo=tab_numer; tab_numer={};]] HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --local numer_poziomu=HNumerPoziomow(poziom_artykulu+(ostatni_rozdzial_dodatni or 0),#tab_poziomowo+1); end; end; end; elseif(#tab_numer>numer_poziomu)then tab_poziomowo={}; tab_poziomowo[1]=tab_numer[numer_poziomu]; for i=#tab_numer,numer_poziomu,-1 do table.remove(tab_numer,i); end; elseif((#tab_numer<=numer_rozdzialu)and(numer_rozdzialu>=numer_poziomu))then local numer_rozdzialu_dodatniego=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka; if((numer_rozdzialu_dodatniego>0)or((numer_rozdzialu==numer_poziomu)and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu)))then if(#tab_numer>=numer_rozdzialu_dodatniego)then local tab_numer2={}; for i=1,numer_rozdzialu_dodatniego,1 do tab_numer2[i]=tab_numer[i]; end; tab_poziomowo={}; for i=numer_rozdzialu_dodatniego+1,#tab_numer,1 do tab_poziomowo[i-numer_rozdzialu_dodatniego]=tab_numer[i]; end; tab_numer=tab_numer2; end; end; end; poprzedni_poziom_artykulu=poziom_artykulu; local czy_z_rozdzialem=(tab_artykul_w_bazie[1]==rozdzial); if((p==1)and(czy_z_rozdzialem))then b=1;end; czy_tytul_rozdzial=((p==1)and true or czy_tytul_rozdzial) and (czy_z_rozdzialem); local dodatek=b-((czy_tytul_rozdzial)and 0 or 1); dodatek=((dodatek>0)and dodatek or 0); if((poziomowo)and(poziom_znakowy_rozdzialu<0))then if(poziom_naglowka>=poziom_artykulu)then local numer_poziomu=HNumerPoziomu(poziom_naglowka,numer_rozdzialu-(HNumerPoziomowNaglowkow(0) or 0)); end; end; local stala=poziom_artykulu; local numer_poziomu=HNumerPoziomu(stala); poziom_artykulu=stala+dodatek; local numer=HNumerArtykulu(poziom_artykulu); local roznica=numer_poziomu-numer; if(roznica>0)then numer=HNumerArtykulu(poziom_artykulu,numer_poziomu); end; if(#tab_poziomowo<numer)then for i=#tab_poziomowo+1,numer,1 do table.insert(tab_poziomowo,1); end; else if(#tab_poziomowo>numer)then for i=#tab_poziomowo,numer+1,-1 do table.remove(tab_poziomowo,i); end; end; tab_poziomowo[#tab_poziomowo]=(tab_poziomowo[#tab_poziomowo] or 0)+1; end; tab_poprzedni_artykul_w_bazie=tab_artykul_w_bazie; poziom_poprzedni_artykulu=poziom_artykulu; end; local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,tab_poziomowo); if(poziomowo)then if(tab_lista[2][p+1])then local numer_nastepny=tonumber(tab_lista[2][p+1][2][1]) or 1; local id_nastepny=tab_lista[2][p+1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_nastepny==0)and(not id_nastepny)and(not id)and(numer>0))then tab_poziomowo={tab_numer[(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1],}; for i=#tab_numer,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,-1 do table.remove(tab_numer,i); end; end; end; poprzedni_tab_poziomowo=tab_poziomowo; end; if(wartosc)then return wartosc;end; if(not poziomowo)then i=i+1; end; end; end; if(not czy_ma_elementy)then poprzedni_tab_poziomowo=nil; end; else poprzedni_tab_poziomowo=nil; end; end; return; end; p["PobierzNazwęArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,numer,artykul,tab_numer,tab_poziomowo) if((not poziomowo)and(i==numer))then if(s==ktory)then return artykul; else s=s+1; end; elseif(poziomowo)then if((table.concat(tab_numer,".") ..((#tab_numer>0) and "." or "") ..table.concat(tab_poziomowo,"."))==numer)then if(s==ktory)then return artykul; else s=s+1; end; end; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,true); end; p["PobierzNumerArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,nazwa_artykulu,artykul,tab_numer,tab_poziomowo) if(nazwa_artykulu==artykul)then if(s==ktory)then if(poziomowo)then return (table.concat(tab_numer,".")..((#tab_numer>0) and ((#tab_poziomowo>0) and "." or "") or "")..table.concat(tab_poziomowo,".")); else return i; end; end; s=s+1; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,false); end; p["SubNazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 0; local krok=tonumber(args[2])or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,numer,krok); end; p["NazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,1,numer); end; p["NazwaLinkuArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(type(artykul_w_bazie[1])~="table")then if(artykul_w_bazie[1]==nazwa_artykulu)then return artykul_w_bazie[1]; end; elseif(artykul_w_bazie[1][1]==nazwa_artykulu)then return artykul_w_bazie[1][2]; end; end; end; end; return "(błąd)"; end; p["LiczbaArtykułówKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek) and {} or nil; local i=0; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local nazwa_artykulu=artykul_w_bazie[1][1] or artykul_w_bazie[1]; local artykul=(not naglowek) and mw.ustring.gsub(nazwa_artykulu,"^([^#]*)#(.*)$","%1") or nazwa_artykulu; if(naglowek or not tab_artykul[artykul])then if(not naglowek)then tab_artykul[artykul]=true; end; i=i+1; end; end; end; end; return i; end; p["LiniaArtykułuKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local czy_analiza=parametry_modul.CzyTak(args["analiza"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_ksiazki=artykul_w_bazie[1][1] or artykul_w_bazie[1]; if(artykul_ksiazki==nazwa_artykulu)then if(not czy_analiza)then return artykul_w_bazie[3]; else local function AnalizaLiniiArtykolow() local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})"); if(czy_spis_tresci)then local techniczne_modul=require("Module:Techniczne"); local parametry_szablony=techniczne_modul["ParsujWywołanieSzablonu"](czy_spis_tresci); local nazwa_artykulu=parametry_szablony[1]; ------ local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local pelna_nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local link= "[["..pelna_nazwa_strony.."|"..nazwa_artykulu.."]]"; local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})",link); return linia2; else local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|[^{}]*}})"); if(czy_spis_tresci)then local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|)","%1astandardowo=tak|"); return linia2; else local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local function adresuj_linki(a,b) return "[["..nazwa_ksiazki.."/"..a..(b or "").."]]"; end; local artykul=mw.ustring.gsub(artykul_w_bazie[3],"%[%[%s*/([^%[%]|]-)/*%s*(|.*)%]%]",adresuj_linki); artykul=mw.ustring.gsub(artykul,"%[%[%s*/([^%[%]|]-)/*%s*%]%]",adresuj_linki); return artykul; end; end; end; return AnalizaLiniiArtykolow(); end end; end; end; end; local uzupelniaj_sekcje_artykulow=parametry_modul.CzyTak(args["uzupełniaj sekcje artykułów"]); if(uzupelniaj_sekcje_artykulow)then if(mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"))then local naglowek=mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"); if(parametry_modul["CzyTakCiąg"](naglowek))then local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) return "[["..pelna_nazwa_ksiazki..((nazwa_artykulu~="")and("/"..nazwa_artykulu) or "").."|"..naglowek.."]]"; end; end; end; end; p["AktualnaKsiążka"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["NazwaAktualnyArtykuł"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["ListaNagłówkówKsiążki"] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local czy_sa_rozdzialy=nil; local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local args=stronicowyparser_potrzebne_modul:Args(); local wikikod=""; local linki_modul=require("Module:Linki"); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local numer_rozdzialu=tab_lista[1][2][1]; if(numer_rozdzialu>0)then if(not tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial])then wikikod=((wikikod~="")and (wikikod.." &nbsp;—&nbsp; ") or "") ..linki_modul["Link wewnętrzny"]{ ["strona"]=pelna_nazwa_ksiazki, ["nagłówek"]=rozdzial, ["nazwa"]=rozdzial, ["bez znaczników"]=args["bez znaczników"], ["bez przetwarzania"]=args["bez przetwarzania"], }; end; czy_sa_rozdzialy=true; end; end; if(not czy_sa_rozdzialy)then return "(błąd: brak rozdziałów)";end; return wikikod; end; p["ArtykułSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni;local nazwa_ksiazki;local nazwa_artykulu; if(not tabela_listy_danych_analizy_ksiazki.zastepczy)then nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; else nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_artykulu; end; local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local pobierz_nazwa_artykulu=PobierzParametr("pobierz pełną nazwę artykułu"); local pobierz_adres_ksiazki=PobierzParametr("pobierz pełną nazwę książki"); local czy_pobierz_pelna_nazwa_artykulu=parametry_modul.CzyTak(pobierz_nazwa_artykulu); local czy_pobierz_pelna_nazwa_ksiazki=parametry_modul.CzyTak(pobierz_adres_ksiazki); if(czy_pobierz_pelna_nazwa_artykulu and not czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; elseif(not czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki; elseif(czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return "(błąd)"; end; local nazwa_strony=((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; local techniczne_modul=require("Module:Techniczne"); local szablon=techniczne_modul.NazwaSzablonu(nazwa_strony); return frame:expandTemplate{title=szablon,args={},}; end; p["KsiążkaSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local str=tabela_listy_danych_analizy_ksiazki["KsiążkaSubst"]; return str; end; p["StronaSubst"] = function(frame) local parametry_modul=require("Module:Parametry"); local args=frame and ((frame.getParent and ((parametry_modul.CzyTak(frame.args["wyspecjalizowana"]))and frame or frame:getParent()) or frame).args or frame) or {}; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local tab_stronasubst=tabela_listy_danych_analizy_ksiazki["StronaSubst"]; if(not tab_stronasubst)then return;end; local pierwszy,_=mw.ustring.gsub(args[1],"[%s_]+"," "); local tab_strona=tab_stronasubst[pierwszy]; if(not tab_strona)then return;end; local link=args["link"]; local czy_link=parametry_modul.CzyTak(link); local stronasubst=tab_strona[(czy_link and "tak" or "")]; return stronasubst; end; p["CzyStronęNumerować"] = function(frame) local strona=frame.args[1]; local nazwy_modul=require("Module:Nazwy"); strona=nazwy_modul["PEŁNANAZWASTRONY"](strona); local pudelko_modul=require("Module:Pudełko"); if(strona==pudelko_modul["Strona główna tego projektu"](frame))then return; end; if(strona==pudelko_modul["Strona główna dla dzieci tego projektu"](frame))then return; end; if(mw.ustring.match(strona,"^Szablon:SG/"))then return; end; local zbiory={ ["Szablon:Nowe podręczniki miesiąca/Zwycięzca"]=true, ["Wikibooks:Polecane książki"]=true, ["Szablon:Wyróżnienia książek miesiąca/Wyróżniony"]=true, } if(zbiory[strona])then return; end; if(mw.ustring.match(strona,"^Szablon:Polecane książki/") or(mw.ustring.match(strona,"^Szablon:Nowe podręczniki miesiąca/")) or(mw.ustring.match(strona,"^Szablon:Wyróżnienia książek miesiąca/")) )then return; end; return "tak"; end; function p.HNumer(frame) local p=frame.args["wyspecjalizowana"] and frame or frame:getParent(); if((not p) or (not p.args[1]))then local blad_module=require("Module:Błąd"); local frame2=p:newChild{args={[1]="Podano złe parametry w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); return; end; local stronicowyparser_rozdzialy_modul=require("Module:StronicowyParser/Rozdziały"); local naglowek,licznik=stronicowyparser_rozdzialy_modul.PodajRozdzial(p.args[1]); local id2,_=mw.ustring.gsub(naglowek,"^[%s_]",""); id2,_=mw.ustring.gsub(id2,"[%s_]$",""); id2,_=mw.ustring.gsub(id2,"[%s_]","_"); local id3,_=mw.ustring.gsub(mw.uri.encode(mw.text.encode(id2),"WIKI"),"(%%)","."); if(licznik>6)then local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h6"..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\"mw-hnumber mw-hnumber-"..licznik..((parametry_modul.CzyTak(klasa)) and (" "..klasa) or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "") ..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h6>"; elseif(licznik<1)then local blad_module=require("Module:Błąd"); local frame2=pf:newChild{args={[1]="Nie podano nagłówka w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); else local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h"..licznik..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\""..((parametry_modul.CzyTak(klasa)) and klasa or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "")..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h"..licznik..">"; end; end; function p.TOC(frame,czy_rozciagnij,gdy_pusty_spis_tresci) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_modul=require("Module:Nazwy"); local parametry_modul=require("Module:Parametry"); local ksiazkowe_modul=require("Module:Książkowe"); local args=(frame)and (parametry_modul.CzyTak(frame.args["wyspecjalizowana"])and frame.args or frame:getParent().args) or {}; local nazwa_przestrzeni=args[2] and nazwy_modul["NAZWAPRZESTRZENI"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=args[2] and ksiazkowe_modul["NazwaKsiążki"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_artykulu=args[1] and args[1] or tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; local czy_nie_aktualny=( (nazwa_przestrzeni~=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni) or(nazwa_ksiazki~=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki) or (nazwa_artykulu~=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu) ); local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); if ((tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza)or(tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC)) then mw.log(tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza); local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza or tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; elseif(not gdy_pusty_spis_tresci)then local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,nil,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; end; end; function p.WykazModolow(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local lista_ksiazek_w_przestrzeni_nazw=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni]; if(not lista_ksiazek_w_przestrzeni_nazw)then return nil;end; local tab_lista_artykulow_w_ksiazce_w_ksiazce=lista_ksiazek_w_przestrzeni_nazw[nazwa_ksiazki]; if(not tab_lista_artykulow_w_ksiazce_w_ksiazce)then return nil;end; local spis=tab_lista_artykulow_w_ksiazce_w_ksiazce.spis; if(not spis)then return nil;end; local parametry_modul=require("Module:Parametry"); local spis_ksiazkowy=parametry_modul.CzyTak(frame.args["spis książkowy"]); local spis_rzeczy=parametry_modul.CzyTak(frame.args["spis rzeczy"]); local tylko_naglowki=parametry_modul.CzyTak(frame.args["nagłówki"]); local wysokosc=frame.args["wysokość"]; local wykaz_modolow_w_liscie=""; local i=1; for _,tab_artykul in ipairs(spis)do if(tab_artykul[2])then for _,tab_pozycja in ipairs(tab_artykul[2])do if(type(tab_pozycja[1])~="table")then sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1],"_"," "); else sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1][1],"_"," "); end; local id=tab_pozycja[4] if(not tylko_naglowki or id)then if(not spis_ksiazkowy)then wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'<li>[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|<span class=\"tocnumber\">"..i.."</span><span class=\"toctext\">"..sformatowana_nazwa_artykulu..'</span>]]</li>'; else wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'{{SpisZw||[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|"..sformatowana_nazwa_artykulu.."]]|"..i.."|100%}}"; end; i=i+1; end; end; end; end; if(wykaz_modolow_w_liscie=="")then return nil;end; if(not spis_ksiazkowy)then wykaz_modolow_w_liscie="<ul>"..wykaz_modolow_w_liscie.."</ul>"; wykaz_modolow_w_liscie='<div class="toc_ogólnie_spis toc_wykaz" style="width:100%;max-height:400px;overflow:auto;">'..wykaz_modolow_w_liscie.."</div>"; wykaz_modolow_w_liscie='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Wykaz modułów w książce</div>|spis='..wykaz_modolow_w_liscie..'|funkcja=UkrytaWikitabelowaListaMenu}}'; else wykaz_modolow_w_liscie="<div class=\"toc_wykaz\" style=\""..(wysokosc and ("max-height:"..wysokosc..";overflow:auto;") or "").."border:solid #aaa 1px;padding:10px;width:auto;background-color:white;\">"..wykaz_modolow_w_liscie.."</div>"; end; local rozwiniety_wikikod=frame:preprocess(wykaz_modolow_w_liscie); return rozwiniety_wikikod; end; function p.NazwaModolu() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_np_modul=mw.loadData('Moduł:Nazwy/Np'); local nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; if(nazwa_artykulu==nil)then return "[["..nazwy_np_modul.Category..": Nie można wygenerować nazwy strony]]"; else return nazwa_artykulu; end; end; function p.Wstep_do_licencji(frame) local element_licencji_1='<strong>Autor:</strong> '..frame.args[1]..'<BR>'; local element_licencji_2; if((frame.args[2]~='')and(frame.args[2]~=nil))then element_licencji_2=frame.args[2]..'<BR>'; end; local element_licencji_3; if((frame.args[3]~='')and(frame.args[3]~=nil))then element_licencji_3='<strong>Email:</strong> '..frame.args[3]..'<BR>'; end; local element_licencji_4; if((frame.args[4]~='')and(frame.args[4]~=nil))then element_licencji_4='<strong>Dotyczy:</strong> '..frame.args[4].."<BR>"; else element_licencji_4='<strong>Dotyczy:</strong> książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami.<BR>'; end; if((frame.args[5]~='')and(frame.args[5]~=nil))then element_licencji_5=frame.args[5].."<BR>"; else element_licencji_5='Użytkownika książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami nie zwalnia z odpowiedzialności prawnoautorskiej nieprzeczytanie warunków licencjonowania.<BR>'; end; local element_licencji_6; if((frame.args[6]~='')and(frame.args[6]~=nil))then element_licencji_6='<strong>Umowa prawna:</strong> '..frame.args[6]..'<BR>'; else element_licencji_6='<strong>Umowa prawna:</strong> [http://creativecommons.org/licenses/by-sa/3.0/deed.pl Creative Commons: uznanie autorstwa oraz miejsca pochodzenia książki i jej jakikolwiek części, a także treści, teksty, tabele, wykresy, rysunki, wzory i inne elementy oraz ich części zawarte w książce, i tą książkę, nawet w postaci przerobionej nie można umieszczać w jakikolwiek formie na czasopismach naukowych, archiwach prac, itp.]<BR>'; end; if((frame.args[7]~='')and(frame.args[7]~=nil))then element_licencji_7=frame.args[7].."<BR>"; else element_licencji_7='Autor tej książki dołożył wszelką staranność, aby informacje zawarte w książce były poprawne i najwyższej jakości, jednakże nie udzielana jest żadna gwarancja, czy też rękojma. Autor nie jest odpowiedzialny za wykorzystanie informacji zawarte w książce nawet jeśli wywołaby jakąś szkodę, straty w zyskach, zastoju w prowadzeniu firmy, przedsiębiorstwa lub spółki bądź utraty informacji niezależnie, czy autor (a nawet [https://pl.wikibooks.org Wikibooks]) został powiadomiony o możliwości wystąpienie szkód. Informacje zawarte w książce mogą być wykorzystane tylko na własną odpowiedzialność.<BR>'; end; local licencja=element_licencji_1..((element_licencji_2)and element_licencji_2 or "")..((element_licencji_3)and element_licencji_3 or "") ..element_licencji_4..element_licencji_5..element_licencji_6..element_licencji_7; return licencja; end; function p.Licencja(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local menu_z_licencja; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(licencja)then if(licencja[1])then local frame={}; frame.args={licencja[1],licencja[2],licencja[3],licencja[4],licencja[5],licencja[6],licencja[7]}; local ramka_z_licencja='<div style="margin-left:0px;padding:3px;width:100%;height:auto;box-sizing:border-box;">'..p.Wstep_do_licencji(frame)..'</div>'; menu_z_licencja='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Licencja</div>|spis='..ramka_z_licencja..'|funkcja=StatycznaWikitabelowaListaMenu}}'; else return nil; end; local frame=mw.getCurrentFrame(); local rozwiniety_wikikod=frame:preprocess(menu_z_licencja); return rozwiniety_wikikod; else return nil; end; end; function p.Autor(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(tabela_listy_danych_analizy_ksiazki.licencja)then return licencja[1]; end; end; function p.PierwszaStrona(frame) local prawe_menu=""; local parametry_modul=require("Module:Parametry"); local czy_rozciagnij=parametry_modul.CzyTak(frame.args["rozciągnij"]) if(parametry_modul.CzyTak(frame.args[1]))then prawe_menu='<div style="margin-top:5px;font-size:1.9em;line-height:25px;text-align:left;">'..p.NazwaModolu()..'</div><hr style=\"margin:5px 0\"/>'; end; if(parametry_modul.CzyTak(frame.args[2]))then local licencja=p.Licencja(frame,czy_rozciagnij); if(licencja~=nil)then prawe_menu=prawe_menu..licencja; else local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local uchwyt_strony=mw.title.getCurrentTitle(); local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "na stronach głównych, książek" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "na stronach głównych, książek dla dzieci" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "na stronach głównych, książek użytkowników" or((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "na stronach głównych, książek brudnopisu projektu" or "na stronach głównych, publikacji"))); local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local kategoria_braku_licencji=(not tabela_listy_danych_analizy_ksiazki.korzystane_strona_glowna_nie_istnieje)and"[["..nazwy_np_modul.Category..": Brak licencji, "..element_zdania_kategorii.."]]" or ""; prawe_menu=prawe_menu..kategoria_braku_licencji; end; end; if(parametry_modul.CzyTak(frame.args[3]))then local wykaz_artykulow=p.WykazModolow(frame,czy_rozciagnij); if(wykaz_artykulow~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..wykaz_artykulow; end; end; if(parametry_modul.CzyTak(frame.args[4]))then local spis_tresci=p.TOC(frame,czy_rozciagnij,true); if(spis_tresci~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..spis_tresci; end; end; local wysokosc=frame.args["wysokość"]; return (wysokosc and ("<div class=\"pierwsza_strona mw-overflow-y\" style=\"max-height:"..wysokosc..";overflow:auto;\">") or "").."<div style=\"width:auto;height:auto;\">"..prawe_menu.."</div>"..(wysokosc and "</div>" or ""); end; function p.SpisTresci(frame) local parametry_modul=require("Module:Parametry"); local args=parametry_modul.PobierzArgsParametry(frame); local nazwa_artykulu=args["artykuł"] or args[1]; local nazwa_ksiazki=args["książka"] or args[2]; if(not parametry_modul.CzyTak(nazwa_ksiazki))then local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local uzyskana_nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local uzyskana_nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_ksiazki=((uzyskana_nazwa_przestrzeni~=nil) and (uzyskana_nazwa_przestrzeni..":") or "")..uzyskana_nazwa_ksiazki; end; local brak=(nazwa_artykulu and mw.ustring.match(nazwa_artykulu,"[|<>{}%[%]]") or nil) or (nazwa_ksiazki and mw.ustring.match(nazwa_ksiazki,"[|<>{}%[%]]") or nil); if(brak~=nil)then local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "artykułów," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "artykułów dla dzieci," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "stron użytkowników," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "stron brudnopisu projektu," or "stron,"))); return "[["..nazwy_np_modul.Category..":Nazwy "..element_zdania_kategorii.." w spisach treści, zawierają niedozwolone znaki]]"; end; local html_modul=require("Module:Html"); local nazwy_modul=require("Module:Nazwy"); local ksiazkowe_modul=require("Module:Książkowe"); local nazwa_przestrzeni=nazwy_modul["NAZWAPRZESTRZENI"](nazwa_ksiazki); local nazwa_ksiazki=ksiazkowe_modul["NazwaKsiążki"](nazwa_ksiazki); nazwa_ksiazki=html_modul.TransformacjaKlasyZnakowej(nazwa_ksiazki); local nazwa_artykulu=html_modul.TransformacjaKlasyZnakowej(nazwa_artykulu); local nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local pelna_nazwa_strony=(nazwa_przestrzeni=="")and nazwa_strony or nazwa_przestrzeni..":"..nazwa_strony; local tekst_artykulu=p.SpreparowanyWikikodStrony(pelna_nazwa_strony); local nazwa=args["nazwa"] or args[3]; local nazwa_strony_artykulu=parametry_modul.CzyTak(nazwa) and nazwa or mw.ustring.gsub(mw.ustring.match(nazwa_artykulu,"[^/]*$"),"_"," "); local dodatek=args["dodatek"] or args[4]; if(not tekst_artykulu)then if(nazwa_artykulu~="")then return "\n"..mw.ustring.rep("=",6).."<span style=\"color:red\">[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]</span>"..mw.ustring.rep("=",6).."\n"; else return frame:getParent():preprocess("{{Błąd|Wywołano szablon z argumentem pierwszym pustym.}}"); end; else local twor_spisu_tresci="[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]"..(((dodatek)and(dodatek~="")) and (" "..dodatek) or ""); twor_spisu_tresci=mw.ustring.rep("=",6)..twor_spisu_tresci..mw.ustring.rep("=",6).."\n"; local stronicowyparser_dalszefunkcje_modul=require("Module:StronicowyParser/DalszeFunkcje"); local ulozenia_w_menu_spisu_tresci=stronicowyparser_dalszefunkcje_modul:SpisTresciWstep(tekst_artykulu, pelna_nazwa_strony); local atrybuty="style=\"margin-left:20px\""; local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local toc=stronicowyparser_potrzebne_modul.TOCSilnik(ulozenia_w_menu_spisu_tresci, atrybuty); local limit=args["limit"]; local czy_limit=parametry_modul.CzyTak(limit); return '<div class="toc_ogólnie_spis toc_artykuł toclimit '..(czy_limit and ("toclimit-"..limit) or "")..'">\n'..twor_spisu_tresci..(toc and toc or "")..'</div>'; end; end; function IteratorFunkcja() local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local tabela_wypowiedzi=obiekty_modul.tablica_obiektow; local licznik=1; return function() local tabela_obiektu=tabela_wypowiedzi[licznik]; if(not tabela_obiektu)then return nil;end; local wartosc1=mw.ustring.gsub(tabela_obiektu[1],"%d+$",""); local wartosc2=tabela_obiektu[4]; licznik=licznik+1; return wartosc1,wartosc2; end; end; local iterator=IteratorFunkcja(); for nazwa_obiektu,czesc_nazwy_funkcji in iterator do p["Numer"..czesc_nazwy_funkcji] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); return stronicowyparser_potrzebne_modul.NumerObiektu(frame,nazwa_obiektu); end; end; p["AnalizujSzablonemStronicowymArtykuł"]=function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return ""; end; function p.formatowanie() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return tabela_listy_danych_analizy_ksiazki.formatowanie; end; function p.WstawKategorie(frame) local stronicowyparser_kategorie_modul=require("Module:StronicowyParser/Kategorie"); return stronicowyparser_kategorie_modul.WstawKategorie(frame); end; function p.CzyStronaSubst(frame,pelnanazwastrony,czy_wymusic) if(czy_wymusic)then local nazwy_modul=require("Module:Nazwy"); local pelnanazwastronyaktualnej=nazwy_modul["PEŁNANAZWASTRONY"](); if(pelnanazwastrony~=pelnanazwastronyaktualnej)then local stronicowyparser_stronasubst_modul=require("Module:StronicowyParser/StronaSubst"); local TakFun=function(frame) return "tak";end;local NieFun=function(frame) return "";end; return stronicowyparser_stronasubst_modul.AnalizaStronaSubst(nil,pelnanazwastrony,TakFun,NieFun,nil); end; end; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; if(tabela_listy_danych_analizy_ksiazki["CzyStronaSubst"])then return "tak"; end; return ""; end; return p; ap88zrefgmnnuzdvcqj4j8wlw5njqcn 435230 435226 2022-07-19T20:59:37Z Persino 2851 Scribunto text/plain local p = {} function p.SpreparowanyWikikodStrony(nazwa_modolu,dokumentacja) local stronicowyparser_dalszefunkcje=require("Module:StronicowyParser/DalszeFunkcje") return stronicowyparser_dalszefunkcje.SpreparowanyWikikodStrony(nil,nazwa_modolu,dokumentacja); end; function p.PrzekierowanieDoStrony(frame) local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local nazwa_modulu=PobierzParametr(1); local latki_modul=require("Module:Łatki"); return latki_modul.contentMatch{args={ [1]="^%s*#REDIRECT%s+%[%[(.+)%]%]%s*", [2]="^%s*#PATRZ%s+%[%[(.+)%]%]%s*", [3]="^%s*#TAM%s+%[%[(.+)%]%]%s*", namespace="", pagename=nazwa_modulu, }, }; end; p["TekstRozdziałuStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.TekstRozdzialuStrony(frame); end; p["KtóraSekcjaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.KtoraSekcjaStrony(frame); end; p["ZwróćSekcjęNagłówkaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.ZwrocSekcjeNaglowkaStrony(frame); end; p["NastępnyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$"); local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local i=0; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie_element in ipairs(tab_lista[2])do local artykul_w_bazie;local artykul_bez_naglowka_w_bazie;local artykul_z_naglowkiem_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie_element[1]); if(czy_table)then artykul_w_bazie=artykul_w_bazie_element[1][1]; else artykul_w_bazie=artykul_w_bazie_element[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_w_bazie,"^([^#]*)#.*$"); artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end if(not naglowek)then artykul_z_naglowkiem_w_bazie=artykul_bez_naglowka_w_bazie; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie; end; local numer_artykulu_w_bazie; if(numer>0)then numer_artykulu_w_bazie=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); end; local function Nastepny() if(not nazwa)then return artykul_z_naglowkiem_w_bazie; end; if(czy_table)then return artykul_w_bazie[1][2]; else return artykul_z_naglowkiem_w_bazie; end; end; if(i==1)then if(numer>0)then local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka,numer); if((numer==numer_artykulu_w_bazie)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then return Nastepny(); end; else return Nastepny(); end; else if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match))) and (artykul_z_naglowkiem_w_bazie==nazwa_artykulu) ))then i=1; end; end; end; end; end; end; if(i==1)then return ""; end; return "(błąd)"; end; p["PoprzedniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$") local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local artykul; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_z_naglowkiem_w_bazie;local artykul_bez_naglowka_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie[1]); if(czy_table)then artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1][1]; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_z_naglowkiem_w_bazie,"^([^#]*)#.*$") artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_z_naglowkiem_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end; if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match)))and(artykul_z_naglowkiem_w_bazie==nazwa_artykulu)))then if(not artykul)then return "";end; local czy_table_artykul=parametry_modul.TypeTable(artykul); if(czy_table_artykul)then if(not nazwa)then if(naglowek)then return artykul[1]; end; artykul,_=mw.ustring.gsub(artykul[1],"^([^#]+)#(.*)$","%1"); return artykul; else return artykul[2]; end; else if(naglowek)then return artykul; end; artykul,_=mw.ustring.gsub(artykul,"^([^#]+)#(.*)$","%1"); return artykul; end; end if(numer>0)then local numer_artykulu_poprzedni=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka_w_bazie,numer); if((numer==numer_artykulu_poprzedni)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then artykul=artykul_w_bazie[1]; end; else artykul=artykul_w_bazie[1]; end; end; end; end; end; return "(błąd)"; end; p["PoziomNazwyArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.PoziomAdresu(nazwa_artykulu); end; p["PierwszyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then local artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; return (not naglowek) and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; else return parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or ((not naglowek) and mw.ustring.gsub(artykul_w_bazie[1],"^([^#]*)#(.*)$","%1") or artykul_w_bazie[1]); end; end; end; end; end; p["OstatniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; else ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or artykul_w_bazie[1]; end; end; end; end; if(ostatni_artykul)then return (not naglowek) and mw.ustring.gsub(ostatni_artykul,"^([^#]*)#(.*)$","%1") or ostatni_artykul; end; return "(błąd)"; end; p["PomiędzyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:PomiedzyArtykul(frame) or nil; if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return (not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or ((not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element); end; p["LosowyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:LosowyArtykul(frame); if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element; end; local function PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local ktory=(tonumber(args["który"]) or 1); local parametr_pierwszy_szablonu=typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or args[1]; if(not typ)then parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"^[%s_]+",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+$",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+"," "); end; local HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumer_2=nil; local tab_numer_2=nil; local tab_numer={}; local i=(not poziomowo) and 0 or nil; local i_2=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local poziom_spisu_tresci=nil; local pierwszy_dodatni_spis_tresci=nil; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local poziom_rozdzialu=tab_lista[1][2][1]; if(poziom_rozdzialu>0)then local czy_nie_ten_rozdzial=nil; local czy_jest_teraz_spis_tresci=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial];local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; if(not czy_nie_ten_rozdzial)then if(poziomowo)then local hnumer=HNumer(poziom_rozdzialu); if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; else tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; end; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); ---- if(wartosc)then return wartosc;end; ---- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then HNumer_2=HNumer; HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then HNumer=HNumer_2; HNumer_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_dodatni_spis_tresci=false; end; else i=i+1; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); --- if(wartosc)then return wartosc;end; --- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then i_2=i; i=0; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then i=i_2; i_2=nil; pierwszy_dodatni_spis_tresci=false; end; end; end; end; end; end; p["PobierzNumerNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,naglowek,rozdzial) if(naglowek==rozdzial)then if(s==ktory)then if(poziomowo)then if(#tab_numer==0)then return;end; return table.concat(tab_numer,"."); else return i; end; end; s=s+1; end; end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,false); end; p["PobierzNazwęNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,numer,rozdzial) if(poziomowo)then if(#tab_numer==0)then return;end; if(numer==table.concat(tab_numer,"."))then if(s==ktory)then return rozdzial; else s=s+1; end; end; elseif(numer==i)then if(s==ktory)then return rozdzial; else s=s+1; end; end end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,true); end; local function PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek)and {} or nil; local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local tab_poziomowo={}; local tab_poziomowo_1={}; local tab_poziomowo_2={}; local html_modul=require("Module:Html"); local pierwszy_parametr_szablonu=args[1] and (typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or ((not naglowek) and mw.ustring.gsub(html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1])),"^([^#]*)#(.*)$","%1") or html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1]))) ) or (typ and 1 or "Przykładowy artykuł"); local ktory=(tonumber(args["ktory"]) or 1); local i=(not poziomowo) and 1 or nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; --local HNumer=poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_4=nil--poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_3=nil local HNumerPoziomow_2=nil; local HNumerPoziomow_1=nil; local HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow_1=nil; local HNumerPoziomowNaglowkow_2=nil; --local HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local tab_numer=poziomowo and {} or nil; tab_numer_1=nil; tab_numer_3=nil tab_numer_4=nil;--poziomowo and {} or nil; local spis=false; local czy_poziom_spisu_tresci=nil; local pierwszy_dodatni_naglowek=nil; local pierwszy_ujemny_naglowek=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local poprzedni_poziom_znakowy_rozdzialu=nil; local poprzedni_tab_poziomowo=nil; local poziom_pierwszego_dodatniego_naglowka=0; local poziom_pierwszego_ujemnego_naglowka=0; local poziom_zerowego_naglowka=0; local poziom_spisu_tresci_naglowka=0; local numer_poziomu=nil; local ostatni_rozdzial_dodatni=nil; local pierwszy_rozdzial_dodatni=nil; local glowny_dodatni_rozdzial=nil; local glowny_ujemny_rozdzial=nil; local spis_tresci=nil; local poziom_pierwszego_ujemnego_spisu_tresci=nil; local ostatni_poczatek_artykulu=nil; local pierwszy_rowny_rozdzial=nil; local artykuly_w_rozdziale=nil; local spis_tresci_zerowy; local poziom_zerowy; local rozdzial; if(poziomowo and tab_lista_artykulow_w_ksiazce[1])then rozdzial=tab_lista_artykulow_w_ksiazce[1][1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); spis_tresci_zerowy=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]; poziom_zerowy=tab_lista_artykulow_w_ksiazce[1][1][2][1]; end; for m,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local tab_poprzedni_artykul_w_bazie=nil; local poziom_rozdzialu; local poziom_poczatku_rozdzialu=nil; local poziom_znakowy_rozdzialu=nil; local poziom_naglowka=nil; if(poziomowo)then poziom_rozdzialu=tab_lista[1][2][1]; poziom_poczatku_rozdzialu=tab_lista[1][2][2]; if(m>1)then rozdzial=tab_lista[1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); end; tab_poziomowo={}; local czy_jest_teraz_spis_tresci=((m>1)and(not spis_tresci_zerowy or not poziom_zerowy)or((m==1)and(spis_tresci_zerowy))) and ((m==1) and true or tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]) local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; --if(not czy_nie_ten_rozdzial)then poprzedni_poziom_znakowy_rozdzialu=poziom_znakowy_rozdzialu; poziom_znakowy_rozdzialu=poziom_rozdzialu; poziom_rozdzialu=math.abs(poziom_rozdzialu); artykuly_w_rozdziale=nil; if(poziom_znakowy_rozdzialu>0)then poziom_naglowka=poziom_rozdzialu; poziom_pierwszego_ujemnego_spisu_tresci=nil; poprzedni_tab_poziomowo=nil; poziom_zerowego_naglowka=0; if(glowny_ujemny_rozdzial)then HNumerPoziomow=HNumerPoziomow_4; HNumerPoziomow_4=nil; tab_numer=tab_numer_4; poziom_pierwszego_ujemnego_naglowka=nil; glowny_ujemny_rozdzial=nil; end; if(pierwszy_ujemny_spis_tresci)then HNumerPoziomow=HNumerPoziomow_2; HNumerPoziomow_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_ujemny_spis_tresci=nil; czy_poziom_ujemny_spisu_tresci=nil; end; if(not glowny_dodatni_rozdzial)then if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not czy_jest_teraz_spis_tresci)and(not spis_tresci))then numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); spis_tresci=true; else if(not pierwszy_rozdzial_dodatni)then pierwszy_rozdzial_dodatni=1; numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu); end; end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); glowny_dodatni_rozdzial=false; end; ostatni_rozdzial_dodatni=poziom_rozdzialu; elseif(poziom_znakowy_rozdzialu<0)then if(not pierwszy_rowny_rozdzial)then if((ostatni_poczatek_artykulu) and(#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu~=poziom_poczatku_rozdzialu) and(mw.ustring.match(ostatni_poczatek_artykulu,"^*")) and(mw.ustring.match(poziom_poczatku_rozdzialu,"^:")) )then poziom_rozdzialu=poziom_rozdzialu+1; poziom_znakowy_rozdzialu=-poziom_rozdzialu; pierwszy_rowny_rozdzial=1; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; else poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; else if((#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu==poziom_poczatku_rozdzialu) )then pierwszy_rowny_rozdzial=0;end; poziom_rozdzialu=poziom_rozdzialu+pierwszy_rowny_rozdzial; poziom_znakowy_rozdzialu=-poziom_rozdzialu; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; if(not glowny_ujemny_rozdzial)then --if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not spis_tresci))then -- numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); -- spis_tresci=true; --else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka); --end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka,1); glowny_ujemny_rozdzial=false; end; else if((m>1)or((m==1)and(not czy_jest_teraz_spis_tresci)))then poziom_zerowego_naglowka=1; numer_rozdzialu=HNumerPoziomow( 1 + (ostatni_rozdzial_dodatni or 0) + 0); poziom_znakowy_rozdzialu=-1; poziom_rozdzialu=1; poziom_naglowka= 1 + (ostatni_rozdzial_dodatni or 0) + 0; else poziom_zerowego_naglowka=0; numer_rozdzialu=0; poziom_naglowka=(ostatni_rozdzial_dodatni or 0) + 0; end; end; local numer; if(poziom_znakowy_rozdzialu>0)then local numer=HNumerPoziomowNaglowkow(poziom_znakowy_rozdzialu); --HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); elseif(poziom_znakowy_rozdzialu<0)then --local numer=HNumerPoziomowInnychNaglowkow(-poziom_znakowy_rozdzialu); end; if((m>1) and(tab_lista_artykulow_w_ksiazce[m-1]) and(tab_lista_artykulow_w_ksiazce[m-1][2]) and(#tab_lista_artykulow_w_ksiazce[m-1][2][1]>0) and(tab_lista_artykulow_w_ksiazce[m-1][2][#tab_lista_artykulow_w_ksiazce[m-1][2]][2][1]==0) )then local lens_tab_numer=#tab_numer; local roznica=math.min(#poprzedni_tab_poziomowo+#tab_numer,numer_rozdzialu)-#tab_numer; roznica=((roznica>0) and roznica or 0); for i=1,roznica,1 do tab_numer[i+lens_tab_numer]=poprzedni_tab_poziomowo[i]; end; end; if((czy_jest_teraz_spis_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if(poziom_znakowy_rozdzialu>0)then poziom_spisu_tresci_naglowka=poziom_rozdzialu; else poziom_pierwszego_ujemnego_spisu_tresci=poziom_rozdzialu; end; end; if(poziom_rozdzialu>0)then if((((czy_poziom_dodatni_spisu_tresci)and(poziom_znakowy_rozdzialu>0))or((czy_poziom_ujemny_spisu_tresci)and(poziom_znakowy_rozdzialu<0))) and(poziom_spisu_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu) )then if(poziom_znakowy_rozdzialu>0)then tab_numer=tab_numer_1; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_1; HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_1; czy_poziom_dodatni_spisu_tresci=false; elseif(poziom_znakowy_rozdzialu<0)then tab_numer=tab_numer_2; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_2; --HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_2; czy_poziom_ujemny_spisu_tresci=false; pierwszy_ujemny_spis_tresci=nil; end; end; local hnumer=numer_rozdzialu; if(poprzedni_tab_poziomowo)then local lens=math.min(#poprzedni_tab_poziomowo,hnumer-#tab_numer); local len_tab_numer=#tab_numer; for i=1,lens,1 do tab_numer[len_tab_numer+i]=poprzedni_tab_poziomowo[i]; end; for i=lens+1,#tab_numer do tab_numer[len_tab_numer+i]=nil; end; end; if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; else tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; end; else --[[if(poziom_rozdzialu==0)then if(tab_lista_artykulow_w_ksiazce[m+1])then if(tab_lista_artykulow_w_ksiazce[m+1][1][2]>0)then tab_numer={0,}; elseif(tab_lista_artykulow_w_ksiazce[m+1][1][2]<0)then tab_numer={}; end; else tab_numer={}; end; end;]] end; --end; if((czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_spis_tresci)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_spis_tresci)and(poziom_znakowy_rozdzialu<0))))then function Poziom_dodatni() for s,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(s>m)then if(tab_lista[1][2][1]>0)then if(math.abs(tab_lista[1][2][1])>poziom_rozdzialu)then return true; else return false; end; end; end; end; return true; end; local id=nil; if(tab_lista_artykulow_w_ksiazce[m][2])then for p,artykul_w_bazie in ipairs(tab_lista_artykulow_w_ksiazce[m][2])do id=tab_lista_artykulow_w_ksiazce[m][2][p][4]; if(id)then break; end; end; end; if((poziom_znakowy_rozdzialu>0)and((id)or(Poziom_dodatni())))then tab_poziomowo_1=tab_poziomowo; tab_poziomowo={}; czy_poziom_dodatni_spisu_tresci=true; HNumerPoziomow_1=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); HNumerPoziomowNaglowkow_1=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_1=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((poziom_znakowy_rozdzialu<0) and((id)or((tab_lista_artykulow_w_ksiazce[m+1]) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu))))then tab_poziomowo_2=tab_poziomowo; tab_poziomowo={}; czy_poziom_ujemny_spisu_tresci=true; HNumerPoziomow_2=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; --HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_ujemny_spis_tresci=true; end; end; local function OTakimSamymLubMniejszymPoziomie(m) if(poziom_rozdzialu==0)then return true;end; local lens=parametry_modul["LiczbaElementówNumerowanychTablicy"](tab_lista_artykulow_w_ksiazce); if(m==lens)then return true;end; if(poziom_znakowy_rozdzialu>0)then for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]>0)then if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])<=poziom_rozdzialu)then return true; end; end; end; end; elseif(((m==1)or((tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]>0)))and(poziom_znakowy_rozdzialu<0))then local poziom_zerowego_naglowka_innego=0; for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]<=0)then local ile=tab_lista_artykulow_w_ksiazce[k][1][2][1]; if(ile==0)then if((czy_jest_teraz_spis_tresci)and(m==1))then poziom_zerowego_naglowka_innego=poziom_zerowego_naglowka; else poziom_zerowego_naglowka_innego=1; end; end; if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])+poziom_zerowego_naglowka_innego<=poziom_rozdzialu)then return true; end; else break; end; end; end; else return true; end; end; -- if(not czy_nie_ten_rozdzial)then if((tab_lista[2]) and(tab_lista[2][1]) and(tab_lista[2][1][2][1]==0) and(not tab_lista[2][1][4]) and(tab_lista_artykulow_w_ksiazce[m+1]) and(((poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( ((poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])+poziom_zerowego_naglowka>poziom_rozdzialu) ) )or( (poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]~=0) )) )then if(m==1)then tab_numer={0,} else table.insert(tab_numer,0); end; elseif((m==1)and(not tab_lista_artykulow_w_ksiazce[m+1]))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0))then tab_numer={0,} elseif((poziomowo)and(m==2)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu<0)and(tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]==0))then if(poprzedni_tab_poziomowo)then local min=math.min(math.abs(numer_rozdzialu),#poprzedni_tab_poziomowo); for i=#poprzedni_tab_poziomowo,min+1,-1 do table.remove(poprzedni_tab_poziomowo,i) end; tab_numer=poprzedni_tab_poziomowo; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; end; elseif((not czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_naglowek)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_naglowek)and(poziom_znakowy_rozdzialu<0))))then if(poziom_rozdzialu>0)then if(not OTakimSamymLubMniejszymPoziomie(m))then if(poziom_znakowy_rozdzialu>0)then HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_3=tab_numer; tab_numer={0,}; HNumerPoziomow_3=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); pierwszy_dodatni_naglowek=true; poziom_pierwszego_dodatniego_naglowka=poziom_rozdzialu; glowny_dodatni_rozdzial=true; else tab_numer_4=tab_numer; tab_numer=parametry_modul["KopiujTabelęElementów"](tab_numer); tab_numer[#tab_numer]=nil; HNumerPoziomow_4=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); if(poziom_naglowka or 0>0)then HNumerPoziomow(poziom_naglowka,#tab_numer); end; pierwszy_ujemny_naglowek=true; poziom_pierwszego_ujemnego_naglowka=poziom_rozdzialu; glowny_ujemny_rozdzial=true; end; else if(poziom_znakowy_rozdzialu>0)then pierwszy_dodatni_naglowek=true;else pierwszy_ujemny_naglowek=true;end; end; end; elseif((czy_jest_teraz_spis_tresci)and(not czy_nie_ten_rozdzial))then if((not spis)and(poziom_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )) )then tab_numer={0,}; spis=true; end elseif((tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )--[[or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )]]) )then table.insert(tab_numer,0); end; -- end; end; if(tab_lista[2])then local HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local czy_tytul_rozdzial=nil;local poprzedni_b=nil;local ile_odjac=0; local HNumerB=nil; local poprzedni_poziom_artykulu=nil; local czy_ma_elementy=nil; local poziom_poprzedni_artykulu=nil; for p,artykul_w_bazie in ipairs(tab_lista[2])do local artykul=artykul_w_bazie[1][1] or artykul_w_bazie[1]; artykul=(not naglowek)and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; if(naglowek or not tab_artykul[artykul])then pierwszy_rowny_rozdzial=nil; czy_ma_elementy=true; if(not naglowek)then tab_artykul[artykul]=true; end; local tab_artykul_w_bazie; if(poziomowo)then local poziom_artykulu=artykul_w_bazie[2][1]; local poziom_poczatku_artykulu=artykul_w_bazie[2][2]; local w_rozdziale=artykul_w_bazie[2][4]; if(w_rozdziale)then if((w_rozdziale)and(not tab_lista[2][p+1]))then local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,{}); if(wartosc)then return wartosc;end; end; function Dalej() for s,artykul_w_bazie in ipairs(tab_lista[2])do if(s>p)then if((tab_lista[2][s])and(not tab_lista[2][s][2][4]))then return true; end; end; end; return false; end; if(Dalej())then tab_numer[#tab_numer+1]=0; artykuly_w_rozdziale=true; end; elseif(artykuly_w_rozdziale)then artykuly_w_rozdziale=nil; table.remove(tab_numer,#tab_numer); tab_poziomowo={}; end; ostatni_poczatek_artykulu=poziom_poczatku_artykulu; local function ToNumberPoziomArtykulu(poziom_artykulu) local numer=tonumber(poziom_artykulu) or 1; if(numer<1)then numer=1;end; return numer; end; poziom_artykulu=ToNumberPoziomArtykulu(poziom_artykulu); poziom_artykulu=poziom_artykulu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; local numer_poziomu=HNumerPoziomow(poziom_artykulu); if(p>1)then local numer_poprzedni=tonumber(tab_lista[2][p-1][2][1]) or 1; local id_poprzednie=tab_lista[2][p-1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_poprzedni==0)and(not id_poprzednie)and(not id)and(numer>0))then if(#tab_numer>(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka)then tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; tab_poziomowo={}; end; end; end; local prefix_poziom_artykulu=poziom_artykulu; local b=0; local tab_artykul_w_bazie=mw.text.split(artykul,"/"); if(tab_poprzedni_artykul_w_bazie)then if(poprzedni_poziom_artykulu)then if(poprzedni_poziom_artykulu==poziom_artykulu)then for c=1,#tab_artykul_w_bazie,1 do local podstrona_artykul=tab_artykul_w_bazie[c]; local podstrona_nazwy_artykulu=tab_poprzedni_artykul_w_bazie[c]; if(podstrona_artykul==podstrona_nazwy_artykulu)then b=b+1; end; end; else b=0; end; end; if(poziom_znakowy_rozdzialu<0)then if(#tab_numer~=0)then if(poziom_artykulu<=(poziom_pierwszego_ujemnego_naglowka or 0))then tab_poziomowo=tab_numer_4; tab_numer={}; HNumerArtykulu=HNumerPoziomow_4; elseif((poziom_poprzedni_artykulu)and(poziom_artykulu>(poziom_pierwszego_ujemnego_naglowka or 0))and(poziom_poprzedni_artykulu>(poziom_pierwszego_ujemnego_spisu_tresci or 0))and(poziom_artykulu<=(poziom_pierwszego_ujemnego_spisu_tresci or 0)))then HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); for i=#tab_poziomowo,numer_poziomu+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0 ) + 1; tab_poziomowo=tab_numer; tab_numer={}; elseif((poziom_naglowka>=poziom_artykulu)or((poziom_rozdzialu==poziom_artykulu) and((numer_poziomu<numer_rozdzialu) or((numer_poziomu==numer_rozdzialu) and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu) )) ))then local tab_numer2={}; for i=1,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka,1 do tab_numer2[i]=tab_numer[i]; end; local tab_poziomowo2={}; for i=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,#tab_numer,1 do tab_poziomowo2[i-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka]=tab_numer[i]; end; local indeks=(((HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1>#tab_numer) and 0 or (#tab_numer-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka)); for i=1,numer_poziomu,1 do tab_poziomowo2[i+indeks]=tab_poziomowo[i]; end; tab_numer=tab_numer2; tab_poziomowo=tab_poziomowo2; --[[tab_poziomowo=tab_numer; tab_numer={};]] HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --local numer_poziomu=HNumerPoziomow(poziom_artykulu+(ostatni_rozdzial_dodatni or 0),#tab_poziomowo+1); end; end; end; elseif(#tab_numer>numer_poziomu)then tab_poziomowo={}; tab_poziomowo[1]=tab_numer[numer_poziomu]; for i=#tab_numer,numer_poziomu,-1 do table.remove(tab_numer,i); end; elseif((#tab_numer<=numer_rozdzialu)and(numer_rozdzialu>=numer_poziomu))then local numer_rozdzialu_dodatniego=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka; if((numer_rozdzialu_dodatniego>0)or((numer_rozdzialu==numer_poziomu)and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu)))then if(#tab_numer>=numer_rozdzialu_dodatniego)then local tab_numer2={}; for i=1,numer_rozdzialu_dodatniego,1 do tab_numer2[i]=tab_numer[i]; end; tab_poziomowo={}; for i=numer_rozdzialu_dodatniego+1,#tab_numer,1 do tab_poziomowo[i-numer_rozdzialu_dodatniego]=tab_numer[i]; end; tab_numer=tab_numer2; end; end; end; poprzedni_poziom_artykulu=poziom_artykulu; local czy_z_rozdzialem=(tab_artykul_w_bazie[1]==rozdzial); if((p==1)and(czy_z_rozdzialem))then b=1;end; czy_tytul_rozdzial=((p==1)and true or czy_tytul_rozdzial) and (czy_z_rozdzialem); local dodatek=b-((czy_tytul_rozdzial)and 0 or 1); dodatek=((dodatek>0)and dodatek or 0); if((poziomowo)and(poziom_znakowy_rozdzialu<0))then if(poziom_naglowka>=poziom_artykulu)then local numer_poziomu=HNumerPoziomu(poziom_naglowka,numer_rozdzialu-(HNumerPoziomowNaglowkow(0) or 0)); end; end; local stala=poziom_artykulu; local numer_poziomu=HNumerPoziomu(stala); poziom_artykulu=stala+dodatek; local numer=HNumerArtykulu(poziom_artykulu); local roznica=numer_poziomu-numer; if(roznica>0)then numer=HNumerArtykulu(poziom_artykulu,numer_poziomu); end; if(#tab_poziomowo<numer)then for i=#tab_poziomowo+1,numer,1 do table.insert(tab_poziomowo,1); end; else if(#tab_poziomowo>numer)then for i=#tab_poziomowo,numer+1,-1 do table.remove(tab_poziomowo,i); end; end; tab_poziomowo[#tab_poziomowo]=(tab_poziomowo[#tab_poziomowo] or 0)+1; end; tab_poprzedni_artykul_w_bazie=tab_artykul_w_bazie; poziom_poprzedni_artykulu=poziom_artykulu; end; local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,tab_poziomowo); if(poziomowo)then if(tab_lista[2][p+1])then local numer_nastepny=tonumber(tab_lista[2][p+1][2][1]) or 1; local id_nastepny=tab_lista[2][p+1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_nastepny==0)and(not id_nastepny)and(not id)and(numer>0))then tab_poziomowo={tab_numer[(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1],}; for i=#tab_numer,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,-1 do table.remove(tab_numer,i); end; end; end; poprzedni_tab_poziomowo=tab_poziomowo; end; if(wartosc)then return wartosc;end; if(not poziomowo)then i=i+1; end; end; end; if(not czy_ma_elementy)then poprzedni_tab_poziomowo=nil; end; else poprzedni_tab_poziomowo=nil; end; end; return; end; p["PobierzNazwęArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,numer,artykul,tab_numer,tab_poziomowo) if((not poziomowo)and(i==numer))then if(s==ktory)then return artykul; else s=s+1; end; elseif(poziomowo)then if((table.concat(tab_numer,".") ..((#tab_numer>0) and "." or "") ..table.concat(tab_poziomowo,"."))==numer)then if(s==ktory)then return artykul; else s=s+1; end; end; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,true); end; p["PobierzNumerArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,nazwa_artykulu,artykul,tab_numer,tab_poziomowo) if(nazwa_artykulu==artykul)then if(s==ktory)then if(poziomowo)then return (table.concat(tab_numer,".")..((#tab_numer>0) and ((#tab_poziomowo>0) and "." or "") or "")..table.concat(tab_poziomowo,".")); else return i; end; end; s=s+1; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,false); end; p["SubNazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 0; local krok=tonumber(args[2])or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,numer,krok); end; p["NazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,1,numer); end; p["NazwaLinkuArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(type(artykul_w_bazie[1])~="table")then if(artykul_w_bazie[1]==nazwa_artykulu)then return artykul_w_bazie[1]; end; elseif(artykul_w_bazie[1][1]==nazwa_artykulu)then return artykul_w_bazie[1][2]; end; end; end; end; return "(błąd)"; end; p["LiczbaArtykułówKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek) and {} or nil; local i=0; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local nazwa_artykulu=artykul_w_bazie[1][1] or artykul_w_bazie[1]; local artykul=(not naglowek) and mw.ustring.gsub(nazwa_artykulu,"^([^#]*)#(.*)$","%1") or nazwa_artykulu; if(naglowek or not tab_artykul[artykul])then if(not naglowek)then tab_artykul[artykul]=true; end; i=i+1; end; end; end; end; return i; end; p["LiniaArtykułuKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local czy_analiza=parametry_modul.CzyTak(args["analiza"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_ksiazki=artykul_w_bazie[1][1] or artykul_w_bazie[1]; if(artykul_ksiazki==nazwa_artykulu)then if(not czy_analiza)then return artykul_w_bazie[3]; else local function AnalizaLiniiArtykolow() local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})"); if(czy_spis_tresci)then local techniczne_modul=require("Module:Techniczne"); local parametry_szablony=techniczne_modul["ParsujWywołanieSzablonu"](czy_spis_tresci); local nazwa_artykulu=parametry_szablony[1]; ------ local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local pelna_nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local link= "[["..pelna_nazwa_strony.."|"..nazwa_artykulu.."]]"; local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})",link); return linia2; else local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|[^{}]*}})"); if(czy_spis_tresci)then local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|)","%1astandardowo=tak|"); return linia2; else local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local function adresuj_linki(a,b) return "[["..nazwa_ksiazki.."/"..a..(b or "").."]]"; end; local artykul=mw.ustring.gsub(artykul_w_bazie[3],"%[%[%s*/([^%[%]|]-)/*%s*(|.*)%]%]",adresuj_linki); artykul=mw.ustring.gsub(artykul,"%[%[%s*/([^%[%]|]-)/*%s*%]%]",adresuj_linki); return artykul; end; end; end; return AnalizaLiniiArtykolow(); end end; end; end; end; local uzupelniaj_sekcje_artykulow=parametry_modul.CzyTak(args["uzupełniaj sekcje artykułów"]); if(uzupelniaj_sekcje_artykulow)then if(mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"))then local naglowek=mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"); if(parametry_modul["CzyTakCiąg"](naglowek))then local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) return "[["..pelna_nazwa_ksiazki..((nazwa_artykulu~="")and("/"..nazwa_artykulu) or "").."|"..naglowek.."]]"; end; end; end; end; p["AktualnaKsiążka"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["NazwaAktualnyArtykuł"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["ListaNagłówkówKsiążki"] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local czy_sa_rozdzialy=nil; local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local args=stronicowyparser_potrzebne_modul:Args(); local wikikod=""; local linki_modul=require("Module:Linki"); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local numer_rozdzialu=tab_lista[1][2][1]; if(numer_rozdzialu>0)then if(not tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial])then wikikod=((wikikod~="")and (wikikod.." &nbsp;—&nbsp; ") or "") ..linki_modul["Link wewnętrzny"]{ ["strona"]=pelna_nazwa_ksiazki, ["nagłówek"]=rozdzial, ["nazwa"]=rozdzial, ["bez znaczników"]=args["bez znaczników"], ["bez przetwarzania"]=args["bez przetwarzania"], }; end; czy_sa_rozdzialy=true; end; end; if(not czy_sa_rozdzialy)then return "(błąd: brak rozdziałów)";end; return wikikod; end; p["ArtykułSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni;local nazwa_ksiazki;local nazwa_artykulu; if(not tabela_listy_danych_analizy_ksiazki.zastepczy)then nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; else nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_artykulu; end; local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local pobierz_nazwa_artykulu=PobierzParametr("pobierz pełną nazwę artykułu"); local pobierz_adres_ksiazki=PobierzParametr("pobierz pełną nazwę książki"); local czy_pobierz_pelna_nazwa_artykulu=parametry_modul.CzyTak(pobierz_nazwa_artykulu); local czy_pobierz_pelna_nazwa_ksiazki=parametry_modul.CzyTak(pobierz_adres_ksiazki); if(czy_pobierz_pelna_nazwa_artykulu and not czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; elseif(not czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki; elseif(czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return "(błąd)"; end; local nazwa_strony=((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; local techniczne_modul=require("Module:Techniczne"); local szablon=techniczne_modul.NazwaSzablonu(nazwa_strony); return frame:expandTemplate{title=szablon,args={},}; end; p["KsiążkaSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local str=tabela_listy_danych_analizy_ksiazki["KsiążkaSubst"]; return str; end; p["StronaSubst"] = function(frame) local parametry_modul=require("Module:Parametry"); local args=frame and ((frame.getParent and ((parametry_modul.CzyTak(frame.args["wyspecjalizowana"]))and frame or frame:getParent()) or frame).args or frame) or {}; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local tab_stronasubst=tabela_listy_danych_analizy_ksiazki["StronaSubst"]; if(not tab_stronasubst)then return;end; local pierwszy,_=mw.ustring.gsub(args[1],"[%s_]+"," "); local tab_strona=tab_stronasubst[pierwszy]; if(not tab_strona)then return;end; local link=args["link"]; local czy_link=parametry_modul.CzyTak(link); local stronasubst=tab_strona[(czy_link and "tak" or "")]; return stronasubst; end; p["CzyStronęNumerować"] = function(frame) local strona=frame.args[1]; local nazwy_modul=require("Module:Nazwy"); strona=nazwy_modul["PEŁNANAZWASTRONY"](strona); local pudelko_modul=require("Module:Pudełko"); if(strona==pudelko_modul["Strona główna tego projektu"](frame))then return; end; if(strona==pudelko_modul["Strona główna dla dzieci tego projektu"](frame))then return; end; if(mw.ustring.match(strona,"^Szablon:SG/"))then return; end; local zbiory={ ["Szablon:Nowe podręczniki miesiąca/Zwycięzca"]=true, ["Wikibooks:Polecane książki"]=true, ["Szablon:Wyróżnienia książek miesiąca/Wyróżniony"]=true, } if(zbiory[strona])then return; end; if(mw.ustring.match(strona,"^Szablon:Polecane książki/") or(mw.ustring.match(strona,"^Szablon:Nowe podręczniki miesiąca/")) or(mw.ustring.match(strona,"^Szablon:Wyróżnienia książek miesiąca/")) )then return; end; return "tak"; end; function p.HNumer(frame) local p=frame.args["wyspecjalizowana"] and frame or frame:getParent(); if((not p) or (not p.args[1]))then local blad_module=require("Module:Błąd"); local frame2=p:newChild{args={[1]="Podano złe parametry w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); return; end; local stronicowyparser_rozdzialy_modul=require("Module:StronicowyParser/Rozdziały"); local naglowek,licznik=stronicowyparser_rozdzialy_modul.PodajRozdzial(p.args[1]); local id2,_=mw.ustring.gsub(naglowek,"^[%s_]",""); id2,_=mw.ustring.gsub(id2,"[%s_]$",""); id2,_=mw.ustring.gsub(id2,"[%s_]","_"); local id3,_=mw.ustring.gsub(mw.uri.encode(mw.text.encode(id2),"WIKI"),"(%%)","."); if(licznik>6)then local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h6"..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\"mw-hnumber mw-hnumber-"..licznik..((parametry_modul.CzyTak(klasa)) and (" "..klasa) or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "") ..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h6>"; elseif(licznik<1)then local blad_module=require("Module:Błąd"); local frame2=pf:newChild{args={[1]="Nie podano nagłówka w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); else local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h"..licznik..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\""..((parametry_modul.CzyTak(klasa)) and klasa or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "")..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h"..licznik..">"; end; end; function p.TOC(frame,czy_rozciagnij,gdy_pusty_spis_tresci) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_modul=require("Module:Nazwy"); local parametry_modul=require("Module:Parametry"); local ksiazkowe_modul=require("Module:Książkowe"); local args=(frame)and (parametry_modul.CzyTak(frame.args["wyspecjalizowana"])and frame.args or frame:getParent().args) or {}; local nazwa_przestrzeni=args[2] and nazwy_modul["NAZWAPRZESTRZENI"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=args[2] and ksiazkowe_modul["NazwaKsiążki"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_artykulu=args[1] and args[1] or tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; local czy_nie_aktualny=( (nazwa_przestrzeni~=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni) or(nazwa_ksiazki~=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki) or (nazwa_artykulu~=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu) ); local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); if ((tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza)or(tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC)) then mw.log(tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza); local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza or tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; elseif(not gdy_pusty_spis_tresci)then local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,nil,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; end; end; function p.WykazModolow(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local lista_ksiazek_w_przestrzeni_nazw=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni]; if(not lista_ksiazek_w_przestrzeni_nazw)then return nil;end; local tab_lista_artykulow_w_ksiazce_w_ksiazce=lista_ksiazek_w_przestrzeni_nazw[nazwa_ksiazki]; if(not tab_lista_artykulow_w_ksiazce_w_ksiazce)then return nil;end; local spis=tab_lista_artykulow_w_ksiazce_w_ksiazce.spis; if(not spis)then return nil;end; local parametry_modul=require("Module:Parametry"); local spis_ksiazkowy=parametry_modul.CzyTak(frame.args["spis książkowy"]); local spis_rzeczy=parametry_modul.CzyTak(frame.args["spis rzeczy"]); local tylko_naglowki=parametry_modul.CzyTak(frame.args["nagłówki"]); local wysokosc=frame.args["wysokość"]; local wykaz_modolow_w_liscie=""; local i=1; for _,tab_artykul in ipairs(spis)do if(tab_artykul[2])then for _,tab_pozycja in ipairs(tab_artykul[2])do if(type(tab_pozycja[1])~="table")then sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1],"_"," "); else sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1][1],"_"," "); end; local id=tab_pozycja[4] if(not tylko_naglowki or id)then if(not spis_ksiazkowy)then wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'<li>[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|<span class=\"tocnumber\">"..i.."</span><span class=\"toctext\">"..sformatowana_nazwa_artykulu..'</span>]]</li>'; else wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'{{SpisZw||[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|"..sformatowana_nazwa_artykulu.."]]|"..i.."|100%}}"; end; i=i+1; end; end; end; end; if(wykaz_modolow_w_liscie=="")then return nil;end; if(not spis_ksiazkowy)then wykaz_modolow_w_liscie="<ul>"..wykaz_modolow_w_liscie.."</ul>"; wykaz_modolow_w_liscie='<div class="toc_ogólnie_spis toc_wykaz" style="width:100%;max-height:400px;overflow:auto;">'..wykaz_modolow_w_liscie.."</div>"; wykaz_modolow_w_liscie='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Wykaz modułów w książce</div>|spis='..wykaz_modolow_w_liscie..'|funkcja=UkrytaWikitabelowaListaMenu}}'; else wykaz_modolow_w_liscie="<div class=\"toc_wykaz mw-overflow-y\" style=\""..(wysokosc and ("max-height:"..wysokosc..";overflow:auto;") or "").."border:solid #aaa 1px;padding:10px;width:auto;background-color:white;\">"..wykaz_modolow_w_liscie.."</div>"; end; local rozwiniety_wikikod=frame:preprocess(wykaz_modolow_w_liscie); return rozwiniety_wikikod; end; function p.NazwaModolu() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_np_modul=mw.loadData('Moduł:Nazwy/Np'); local nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; if(nazwa_artykulu==nil)then return "[["..nazwy_np_modul.Category..": Nie można wygenerować nazwy strony]]"; else return nazwa_artykulu; end; end; function p.Wstep_do_licencji(frame) local element_licencji_1='<strong>Autor:</strong> '..frame.args[1]..'<BR>'; local element_licencji_2; if((frame.args[2]~='')and(frame.args[2]~=nil))then element_licencji_2=frame.args[2]..'<BR>'; end; local element_licencji_3; if((frame.args[3]~='')and(frame.args[3]~=nil))then element_licencji_3='<strong>Email:</strong> '..frame.args[3]..'<BR>'; end; local element_licencji_4; if((frame.args[4]~='')and(frame.args[4]~=nil))then element_licencji_4='<strong>Dotyczy:</strong> '..frame.args[4].."<BR>"; else element_licencji_4='<strong>Dotyczy:</strong> książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami.<BR>'; end; if((frame.args[5]~='')and(frame.args[5]~=nil))then element_licencji_5=frame.args[5].."<BR>"; else element_licencji_5='Użytkownika książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami nie zwalnia z odpowiedzialności prawnoautorskiej nieprzeczytanie warunków licencjonowania.<BR>'; end; local element_licencji_6; if((frame.args[6]~='')and(frame.args[6]~=nil))then element_licencji_6='<strong>Umowa prawna:</strong> '..frame.args[6]..'<BR>'; else element_licencji_6='<strong>Umowa prawna:</strong> [http://creativecommons.org/licenses/by-sa/3.0/deed.pl Creative Commons: uznanie autorstwa oraz miejsca pochodzenia książki i jej jakikolwiek części, a także treści, teksty, tabele, wykresy, rysunki, wzory i inne elementy oraz ich części zawarte w książce, i tą książkę, nawet w postaci przerobionej nie można umieszczać w jakikolwiek formie na czasopismach naukowych, archiwach prac, itp.]<BR>'; end; if((frame.args[7]~='')and(frame.args[7]~=nil))then element_licencji_7=frame.args[7].."<BR>"; else element_licencji_7='Autor tej książki dołożył wszelką staranność, aby informacje zawarte w książce były poprawne i najwyższej jakości, jednakże nie udzielana jest żadna gwarancja, czy też rękojma. Autor nie jest odpowiedzialny za wykorzystanie informacji zawarte w książce nawet jeśli wywołaby jakąś szkodę, straty w zyskach, zastoju w prowadzeniu firmy, przedsiębiorstwa lub spółki bądź utraty informacji niezależnie, czy autor (a nawet [https://pl.wikibooks.org Wikibooks]) został powiadomiony o możliwości wystąpienie szkód. Informacje zawarte w książce mogą być wykorzystane tylko na własną odpowiedzialność.<BR>'; end; local licencja=element_licencji_1..((element_licencji_2)and element_licencji_2 or "")..((element_licencji_3)and element_licencji_3 or "") ..element_licencji_4..element_licencji_5..element_licencji_6..element_licencji_7; return licencja; end; function p.Licencja(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local menu_z_licencja; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(licencja)then if(licencja[1])then local frame={}; frame.args={licencja[1],licencja[2],licencja[3],licencja[4],licencja[5],licencja[6],licencja[7]}; local ramka_z_licencja='<div style="margin-left:0px;padding:3px;width:100%;height:auto;box-sizing:border-box;">'..p.Wstep_do_licencji(frame)..'</div>'; menu_z_licencja='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Licencja</div>|spis='..ramka_z_licencja..'|funkcja=StatycznaWikitabelowaListaMenu}}'; else return nil; end; local frame=mw.getCurrentFrame(); local rozwiniety_wikikod=frame:preprocess(menu_z_licencja); return rozwiniety_wikikod; else return nil; end; end; function p.Autor(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(tabela_listy_danych_analizy_ksiazki.licencja)then return licencja[1]; end; end; function p.PierwszaStrona(frame) local prawe_menu=""; local parametry_modul=require("Module:Parametry"); local czy_rozciagnij=parametry_modul.CzyTak(frame.args["rozciągnij"]) if(parametry_modul.CzyTak(frame.args[1]))then prawe_menu='<div style="margin-top:5px;font-size:1.9em;line-height:25px;text-align:left;">'..p.NazwaModolu()..'</div><hr style=\"margin:5px 0\"/>'; end; if(parametry_modul.CzyTak(frame.args[2]))then local licencja=p.Licencja(frame,czy_rozciagnij); if(licencja~=nil)then prawe_menu=prawe_menu..licencja; else local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local uchwyt_strony=mw.title.getCurrentTitle(); local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "na stronach głównych, książek" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "na stronach głównych, książek dla dzieci" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "na stronach głównych, książek użytkowników" or((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "na stronach głównych, książek brudnopisu projektu" or "na stronach głównych, publikacji"))); local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local kategoria_braku_licencji=(not tabela_listy_danych_analizy_ksiazki.korzystane_strona_glowna_nie_istnieje)and"[["..nazwy_np_modul.Category..": Brak licencji, "..element_zdania_kategorii.."]]" or ""; prawe_menu=prawe_menu..kategoria_braku_licencji; end; end; if(parametry_modul.CzyTak(frame.args[3]))then local wykaz_artykulow=p.WykazModolow(frame,czy_rozciagnij); if(wykaz_artykulow~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..wykaz_artykulow; end; end; if(parametry_modul.CzyTak(frame.args[4]))then local spis_tresci=p.TOC(frame,czy_rozciagnij,true); if(spis_tresci~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..spis_tresci; end; end; local wysokosc=frame.args["wysokość"]; return (wysokosc and ("<div class=\"pierwsza_strona mw-overflow-y\" style=\"max-height:"..wysokosc..";overflow:auto;\">") or "").."<div style=\"width:auto;height:auto;\">"..prawe_menu.."</div>"..(wysokosc and "</div>" or ""); end; function p.SpisTresci(frame) local parametry_modul=require("Module:Parametry"); local args=parametry_modul.PobierzArgsParametry(frame); local nazwa_artykulu=args["artykuł"] or args[1]; local nazwa_ksiazki=args["książka"] or args[2]; if(not parametry_modul.CzyTak(nazwa_ksiazki))then local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local uzyskana_nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local uzyskana_nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_ksiazki=((uzyskana_nazwa_przestrzeni~=nil) and (uzyskana_nazwa_przestrzeni..":") or "")..uzyskana_nazwa_ksiazki; end; local brak=(nazwa_artykulu and mw.ustring.match(nazwa_artykulu,"[|<>{}%[%]]") or nil) or (nazwa_ksiazki and mw.ustring.match(nazwa_ksiazki,"[|<>{}%[%]]") or nil); if(brak~=nil)then local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "artykułów," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "artykułów dla dzieci," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "stron użytkowników," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "stron brudnopisu projektu," or "stron,"))); return "[["..nazwy_np_modul.Category..":Nazwy "..element_zdania_kategorii.." w spisach treści, zawierają niedozwolone znaki]]"; end; local html_modul=require("Module:Html"); local nazwy_modul=require("Module:Nazwy"); local ksiazkowe_modul=require("Module:Książkowe"); local nazwa_przestrzeni=nazwy_modul["NAZWAPRZESTRZENI"](nazwa_ksiazki); local nazwa_ksiazki=ksiazkowe_modul["NazwaKsiążki"](nazwa_ksiazki); nazwa_ksiazki=html_modul.TransformacjaKlasyZnakowej(nazwa_ksiazki); local nazwa_artykulu=html_modul.TransformacjaKlasyZnakowej(nazwa_artykulu); local nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local pelna_nazwa_strony=(nazwa_przestrzeni=="")and nazwa_strony or nazwa_przestrzeni..":"..nazwa_strony; local tekst_artykulu=p.SpreparowanyWikikodStrony(pelna_nazwa_strony); local nazwa=args["nazwa"] or args[3]; local nazwa_strony_artykulu=parametry_modul.CzyTak(nazwa) and nazwa or mw.ustring.gsub(mw.ustring.match(nazwa_artykulu,"[^/]*$"),"_"," "); local dodatek=args["dodatek"] or args[4]; if(not tekst_artykulu)then if(nazwa_artykulu~="")then return "\n"..mw.ustring.rep("=",6).."<span style=\"color:red\">[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]</span>"..mw.ustring.rep("=",6).."\n"; else return frame:getParent():preprocess("{{Błąd|Wywołano szablon z argumentem pierwszym pustym.}}"); end; else local twor_spisu_tresci="[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]"..(((dodatek)and(dodatek~="")) and (" "..dodatek) or ""); twor_spisu_tresci=mw.ustring.rep("=",6)..twor_spisu_tresci..mw.ustring.rep("=",6).."\n"; local stronicowyparser_dalszefunkcje_modul=require("Module:StronicowyParser/DalszeFunkcje"); local ulozenia_w_menu_spisu_tresci=stronicowyparser_dalszefunkcje_modul:SpisTresciWstep(tekst_artykulu, pelna_nazwa_strony); local atrybuty="style=\"margin-left:20px\""; local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local toc=stronicowyparser_potrzebne_modul.TOCSilnik(ulozenia_w_menu_spisu_tresci, atrybuty); local limit=args["limit"]; local czy_limit=parametry_modul.CzyTak(limit); return '<div class="toc_ogólnie_spis toc_artykuł toclimit '..(czy_limit and ("toclimit-"..limit) or "")..'">\n'..twor_spisu_tresci..(toc and toc or "")..'</div>'; end; end; function IteratorFunkcja() local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local tabela_wypowiedzi=obiekty_modul.tablica_obiektow; local licznik=1; return function() local tabela_obiektu=tabela_wypowiedzi[licznik]; if(not tabela_obiektu)then return nil;end; local wartosc1=mw.ustring.gsub(tabela_obiektu[1],"%d+$",""); local wartosc2=tabela_obiektu[4]; licznik=licznik+1; return wartosc1,wartosc2; end; end; local iterator=IteratorFunkcja(); for nazwa_obiektu,czesc_nazwy_funkcji in iterator do p["Numer"..czesc_nazwy_funkcji] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); return stronicowyparser_potrzebne_modul.NumerObiektu(frame,nazwa_obiektu); end; end; p["AnalizujSzablonemStronicowymArtykuł"]=function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return ""; end; function p.formatowanie() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return tabela_listy_danych_analizy_ksiazki.formatowanie; end; function p.WstawKategorie(frame) local stronicowyparser_kategorie_modul=require("Module:StronicowyParser/Kategorie"); return stronicowyparser_kategorie_modul.WstawKategorie(frame); end; function p.CzyStronaSubst(frame,pelnanazwastrony,czy_wymusic) if(czy_wymusic)then local nazwy_modul=require("Module:Nazwy"); local pelnanazwastronyaktualnej=nazwy_modul["PEŁNANAZWASTRONY"](); if(pelnanazwastrony~=pelnanazwastronyaktualnej)then local stronicowyparser_stronasubst_modul=require("Module:StronicowyParser/StronaSubst"); local TakFun=function(frame) return "tak";end;local NieFun=function(frame) return "";end; return stronicowyparser_stronasubst_modul.AnalizaStronaSubst(nil,pelnanazwastrony,TakFun,NieFun,nil); end; end; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; if(tabela_listy_danych_analizy_ksiazki["CzyStronaSubst"])then return "tak"; end; return ""; end; return p; cwqz7o35g749l7yrdeagxm7hmx6eqix 435256 435230 2022-07-20T08:54:03Z Persino 2851 Scribunto text/plain local p = {} function p.SpreparowanyWikikodStrony(nazwa_modolu,dokumentacja) local stronicowyparser_dalszefunkcje=require("Module:StronicowyParser/DalszeFunkcje") return stronicowyparser_dalszefunkcje.SpreparowanyWikikodStrony(nil,nazwa_modolu,dokumentacja); end; function p.PrzekierowanieDoStrony(frame) local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local nazwa_modulu=PobierzParametr(1); local latki_modul=require("Module:Łatki"); return latki_modul.contentMatch{args={ [1]="^%s*#REDIRECT%s+%[%[(.+)%]%]%s*", [2]="^%s*#PATRZ%s+%[%[(.+)%]%]%s*", [3]="^%s*#TAM%s+%[%[(.+)%]%]%s*", namespace="", pagename=nazwa_modulu, }, }; end; p["TekstRozdziałuStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.TekstRozdzialuStrony(frame); end; p["KtóraSekcjaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.KtoraSekcjaStrony(frame); end; p["ZwróćSekcjęNagłówkaStrony"]=function(frame) local stronicowyparser_rozdzialy=require("Module:StronicowyParser/Rozdziały"); return stronicowyparser_rozdzialy.ZwrocSekcjeNaglowkaStrony(frame); end; p["NastępnyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$"); local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local i=0; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie_element in ipairs(tab_lista[2])do local artykul_w_bazie;local artykul_bez_naglowka_w_bazie;local artykul_z_naglowkiem_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie_element[1]); if(czy_table)then artykul_w_bazie=artykul_w_bazie_element[1][1]; else artykul_w_bazie=artykul_w_bazie_element[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_w_bazie,"^([^#]*)#.*$"); artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end if(not naglowek)then artykul_z_naglowkiem_w_bazie=artykul_bez_naglowka_w_bazie; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie; end; local numer_artykulu_w_bazie; if(numer>0)then numer_artykulu_w_bazie=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); end; local function Nastepny() if(not nazwa)then return artykul_z_naglowkiem_w_bazie; end; if(czy_table)then return artykul_w_bazie[1][2]; else return artykul_z_naglowkiem_w_bazie; end; end; if(i==1)then if(numer>0)then local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka,numer); if((numer==numer_artykulu_w_bazie)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then return Nastepny(); end; else return Nastepny(); end; else if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match))) and (artykul_z_naglowkiem_w_bazie==nazwa_artykulu) ))then i=1; end; end; end; end; end; end; if(i==1)then return ""; end; return "(błąd)"; end; p["PoprzedniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local numer=tonumber(args[1]) or 0; local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local nazwa_artykulu_z_naglowkiem_match=mw.ustring.match(nazwa_artykulu,"^([^#]*)#.*$") local nazwa_artykulu_z_opcja_naglowek=(not naglowek) and nazwa_artykulu_z_naglowkiem_match or nazwa_artykulu; local nadstrona_artykulu=(numer>0) and stronicowyparser_potrzebne_modul.NazwaNadStrony(nazwa_artykulu,numer) or nil; local artykul; local tab_artykul={}; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_z_naglowkiem_w_bazie;local artykul_bez_naglowka_w_bazie; local czy_table=parametry_modul.TypeTable(artykul_w_bazie[1]); if(czy_table)then artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1][1]; else artykul_z_naglowkiem_w_bazie=artykul_w_bazie[1]; end; local artykul_z_naglowkiem_w_bazie_match=mw.ustring.match(artykul_z_naglowkiem_w_bazie,"^([^#]*)#.*$") artykul_bez_naglowka_w_bazie=artykul_z_naglowkiem_w_bazie_match or artykul_z_naglowkiem_w_bazie; if(naglowek or not tab_artykul[artykul_bez_naglowka_w_bazie])then if(not naglowek)then tab_artykul[artykul_bez_naglowka_w_bazie]=true; end; if((not naglowek)and(artykul_bez_naglowka_w_bazie==nazwa_artykulu_z_opcja_naglowek) or(((naglowek) and ((nazwa_artykulu_z_naglowkiem_match and artykul_z_naglowkiem_w_bazie_match)or(not nazwa_artykulu_z_naglowkiem_match and not artykul_z_naglowkiem_w_bazie_match)))and(artykul_z_naglowkiem_w_bazie==nazwa_artykulu)))then if(not artykul)then return "";end; local czy_table_artykul=parametry_modul.TypeTable(artykul); if(czy_table_artykul)then if(not nazwa)then if(naglowek)then return artykul[1]; end; artykul,_=mw.ustring.gsub(artykul[1],"^([^#]+)#(.*)$","%1"); return artykul; else return artykul[2]; end; else if(naglowek)then return artykul; end; artykul,_=mw.ustring.gsub(artykul,"^([^#]+)#(.*)$","%1"); return artykul; end; end if(numer>0)then local numer_artykulu_poprzedni=stronicowyparser_potrzebne_modul.PoziomAdresu(artykul_bez_naglowka_w_bazie); local nadstrona_artykulu_w_bazie=stronicowyparser_potrzebne_modul.NazwaNadStrony(artykul_bez_naglowka_w_bazie,numer); if((numer==numer_artykulu_poprzedni)and(nadstrona_artykulu==nadstrona_artykulu_w_bazie))then artykul=artykul_w_bazie[1]; end; else artykul=artykul_w_bazie[1]; end; end; end; end; end; return "(błąd)"; end; p["PoziomNazwyArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.PoziomAdresu(nazwa_artykulu); end; p["PierwszyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then local artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; return (not naglowek) and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; else return parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or ((not naglowek) and mw.ustring.gsub(artykul_w_bazie[1],"^([^#]*)#(.*)$","%1") or artykul_w_bazie[1]); end; end; end; end; end; p["OstatniArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(not nazwa)then ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][1] or artykul_w_bazie[1]; else ostatni_artykul=parametry_modul.TypeTable(artykul_w_bazie[1]) and artykul_w_bazie[1][2] or artykul_w_bazie[1]; end; end; end; end; if(ostatni_artykul)then return (not naglowek) and mw.ustring.gsub(ostatni_artykul,"^([^#]*)#(.*)$","%1") or ostatni_artykul; end; return "(błąd)"; end; p["PomiędzyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:PomiedzyArtykul(frame) or nil; if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return (not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or ((not naglowek) and mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element); end; p["LosowyArtykuł"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local val=stronicowyparser_potrzebne_modul:ObliczeniaInformacje(frame); if(not val)then return "(błąd)";end; local element=stronicowyparser_potrzebne_modul:LosowyArtykul(frame); if(not element)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local nazwa=parametry_modul.CzyTak(args["nazwa"]); local czy_table=parametry_modul.TypeTable(element); local element=czy_table and element[1] or element; if(not nazwa)then return mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element;end; return czy_table and element[2] or mw.ustring.gsub(element,"^([^#]*)#(.*)$","%1") or element; end; local function PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local ktory=(tonumber(args["który"]) or 1); local parametr_pierwszy_szablonu=typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or args[1]; if(not typ)then parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"^[%s_]+",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+$",""); parametr_pierwszy_szablonu,_=mw.ustring.gsub(parametr_pierwszy_szablonu,"[%s_]+"," "); end; local HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumer_2=nil; local tab_numer_2=nil; local tab_numer={}; local i=(not poziomowo) and 0 or nil; local i_2=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local poziom_spisu_tresci=nil; local pierwszy_dodatni_spis_tresci=nil; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local poziom_rozdzialu=tab_lista[1][2][1]; if(poziom_rozdzialu>0)then local czy_nie_ten_rozdzial=nil; local czy_jest_teraz_spis_tresci=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial];local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; if(not czy_nie_ten_rozdzial)then if(poziomowo)then local hnumer=HNumer(poziom_rozdzialu); if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; else tab_numer[#tab_numer]=tab_numer[#tab_numer]+1; end; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); ---- if(wartosc)then return wartosc;end; ---- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then HNumer_2=HNumer; HNumer=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then HNumer=HNumer_2; HNumer_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_dodatni_spis_tresci=false; end; else i=i+1; ---- local wartosc=__FUNKCJA(poziomowo,i,tab_numer,ktory,parametr_pierwszy_szablonu,rozdzial); --- if(wartosc)then return wartosc;end; --- if((czy_jest_teraz_spis_tresci)and(not pierwszy_dodatni_spis_tresci))then i_2=i; i=0; pierwszy_dodatni_spis_tresci=true; elseif((pierwszy_dodatni_spis_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu))then i=i_2; i_2=nil; pierwszy_dodatni_spis_tresci=false; end; end; end; end; end; end; p["PobierzNumerNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,naglowek,rozdzial) if(naglowek==rozdzial)then if(s==ktory)then if(poziomowo)then if(#tab_numer==0)then return;end; return table.concat(tab_numer,"."); else return i; end; end; s=s+1; end; end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,false); end; p["PobierzNazwęNagłówka"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,tab_numer,ktory,numer,rozdzial) if(poziomowo)then if(#tab_numer==0)then return;end; if(numer==table.concat(tab_numer,"."))then if(s==ktory)then return rozdzial; else s=s+1; end; end; elseif(numer==i)then if(s==ktory)then return rozdzial; else s=s+1; end; end end; return PobiezNumerLubNazweNaglowka(frame,__FUNKCJA,true); end; local function PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,typ) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local parametry_modul=require("Module:Parametry"); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek)and {} or nil; local poziomowo=parametry_modul.CzyTak(args["poziomowo"]); local tab_poziomowo={}; local tab_poziomowo_1={}; local tab_poziomowo_2={}; local html_modul=require("Module:Html"); local pierwszy_parametr_szablonu=args[1] and (typ and ((not poziomowo) and (tonumber(args[1]) or 1) or args[1]) or ((not naglowek) and mw.ustring.gsub(html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1])),"^([^#]*)#(.*)$","%1") or html_modul["PoprawAdresNagłówkaStronyAdresu"](html_modul["TransformacjaKoduZnakuDoZnakuŁancucha"](args[1]))) ) or (typ and 1 or "Przykładowy artykuł"); local ktory=(tonumber(args["ktory"]) or 1); local i=(not poziomowo) and 1 or nil; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; --local HNumer=poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_4=nil--poziomowo and stronicowyparser_potrzebne_modul.LiczonyHNumer() or nil; local HNumerPoziomow_3=nil local HNumerPoziomow_2=nil; local HNumerPoziomow_1=nil; local HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomowNaglowkow_1=nil; local HNumerPoziomowNaglowkow_2=nil; --local HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local tab_numer=poziomowo and {} or nil; tab_numer_1=nil; tab_numer_3=nil tab_numer_4=nil;--poziomowo and {} or nil; local spis=false; local czy_poziom_spisu_tresci=nil; local pierwszy_dodatni_naglowek=nil; local pierwszy_ujemny_naglowek=nil; local juz_nie_rozwazaj_spisu_tresci=nil; local juz_nie_rozwazaj_rozdzialu_spisu_tresci=nil; local poprzedni_poziom_znakowy_rozdzialu=nil; local poprzedni_tab_poziomowo=nil; local poziom_pierwszego_dodatniego_naglowka=0; local poziom_pierwszego_ujemnego_naglowka=0; local poziom_zerowego_naglowka=0; local poziom_spisu_tresci_naglowka=0; local numer_poziomu=nil; local ostatni_rozdzial_dodatni=nil; local pierwszy_rozdzial_dodatni=nil; local glowny_dodatni_rozdzial=nil; local glowny_ujemny_rozdzial=nil; local spis_tresci=nil; local poziom_pierwszego_ujemnego_spisu_tresci=nil; local ostatni_poczatek_artykulu=nil; local pierwszy_rowny_rozdzial=nil; local artykuly_w_rozdziale=nil; local spis_tresci_zerowy; local poziom_zerowy; local rozdzial; if(poziomowo and tab_lista_artykulow_w_ksiazce[1])then rozdzial=tab_lista_artykulow_w_ksiazce[1][1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); spis_tresci_zerowy=tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]; poziom_zerowy=tab_lista_artykulow_w_ksiazce[1][1][2][1]; end; for m,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local tab_poprzedni_artykul_w_bazie=nil; local poziom_rozdzialu; local poziom_poczatku_rozdzialu=nil; local poziom_znakowy_rozdzialu=nil; local poziom_naglowka=nil; if(poziomowo)then poziom_rozdzialu=tab_lista[1][2][1]; poziom_poczatku_rozdzialu=tab_lista[1][2][2]; if(m>1)then rozdzial=tab_lista[1][1]; rozdzial,_=mw.ustring.gsub(rozdzial,"'+",""); end; tab_poziomowo={}; local czy_jest_teraz_spis_tresci=((m>1)and(not spis_tresci_zerowy or not poziom_zerowy)or((m==1)and(spis_tresci_zerowy))) and ((m==1) and true or tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial]) local czy_nie_ten_rozdzial; if((not juz_nie_rozwazaj_spisu_tresci)and(not juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(czy_jest_teraz_spis_tresci))then poziom_spisu_tresci=poziom_rozdzialu; juz_nie_rozwazaj_rozdzialu_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; elseif((not juz_nie_rozwazaj_spisu_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if((poziom_spisu_tresci<poziom_rozdzialu))then czy_nie_ten_rozdzial=false; else juz_nie_rozwazaj_spisu_tresci=true; czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; else czy_nie_ten_rozdzial=tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek[rozdzial]; end; --if(not czy_nie_ten_rozdzial)then poprzedni_poziom_znakowy_rozdzialu=poziom_znakowy_rozdzialu; poziom_znakowy_rozdzialu=poziom_rozdzialu; poziom_rozdzialu=math.abs(poziom_rozdzialu); artykuly_w_rozdziale=nil; if(poziom_znakowy_rozdzialu>0)then poziom_naglowka=poziom_rozdzialu; poziom_pierwszego_ujemnego_spisu_tresci=nil; poprzedni_tab_poziomowo=nil; poziom_zerowego_naglowka=0; if(glowny_ujemny_rozdzial)then HNumerPoziomow=HNumerPoziomow_4; HNumerPoziomow_4=nil; tab_numer=tab_numer_4; poziom_pierwszego_ujemnego_naglowka=nil; glowny_ujemny_rozdzial=nil; end; if(pierwszy_ujemny_spis_tresci)then HNumerPoziomow=HNumerPoziomow_2; HNumerPoziomow_2=nil; tab_numer=tab_numer_2; tab_numer_2=nil; pierwszy_ujemny_spis_tresci=nil; czy_poziom_ujemny_spisu_tresci=nil; end; if(not glowny_dodatni_rozdzial)then if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not czy_jest_teraz_spis_tresci)and(not spis_tresci))then numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); spis_tresci=true; else if(not pierwszy_rozdzial_dodatni)then pierwszy_rozdzial_dodatni=1; numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu); end; end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); glowny_dodatni_rozdzial=false; end; ostatni_rozdzial_dodatni=poziom_rozdzialu; elseif(poziom_znakowy_rozdzialu<0)then if(not pierwszy_rowny_rozdzial)then if((ostatni_poczatek_artykulu) and(#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu~=poziom_poczatku_rozdzialu) and(mw.ustring.match(ostatni_poczatek_artykulu,"^*")) and(mw.ustring.match(poziom_poczatku_rozdzialu,"^:")) )then poziom_rozdzialu=poziom_rozdzialu+1; poziom_znakowy_rozdzialu=-poziom_rozdzialu; pierwszy_rowny_rozdzial=1; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; else poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; else if((#ostatni_poczatek_artykulu==#poziom_poczatku_rozdzialu) and(ostatni_poczatek_artykulu==poziom_poczatku_rozdzialu) )then pierwszy_rowny_rozdzial=0;end; poziom_rozdzialu=poziom_rozdzialu+pierwszy_rowny_rozdzial; poziom_znakowy_rozdzialu=-poziom_rozdzialu; poziom_naglowka=poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; end; if(not glowny_ujemny_rozdzial)then --if((juz_nie_rozwazaj_rozdzialu_spisu_tresci)and(not juz_nie_rozwazaj_spisu_tresci)and(not spis_tresci))then -- numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu,1); -- spis_tresci=true; --else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka); --end; else numer_rozdzialu=HNumerPoziomow(poziom_rozdzialu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka,1); glowny_ujemny_rozdzial=false; end; else if((m>1)or((m==1)and(not czy_jest_teraz_spis_tresci)))then poziom_zerowego_naglowka=1; numer_rozdzialu=HNumerPoziomow( 1 + (ostatni_rozdzial_dodatni or 0) + 0); poziom_znakowy_rozdzialu=-1; poziom_rozdzialu=1; poziom_naglowka= 1 + (ostatni_rozdzial_dodatni or 0) + 0; else poziom_zerowego_naglowka=0; numer_rozdzialu=0; poziom_naglowka=(ostatni_rozdzial_dodatni or 0) + 0; end; end; local numer; if(poziom_znakowy_rozdzialu>0)then local numer=HNumerPoziomowNaglowkow(poziom_znakowy_rozdzialu); --HNumerPoziomowInnychNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); elseif(poziom_znakowy_rozdzialu<0)then --local numer=HNumerPoziomowInnychNaglowkow(-poziom_znakowy_rozdzialu); end; if((m>1) and(tab_lista_artykulow_w_ksiazce[m-1]) and(tab_lista_artykulow_w_ksiazce[m-1][2]) and(#tab_lista_artykulow_w_ksiazce[m-1][2][1]>0) and(tab_lista_artykulow_w_ksiazce[m-1][2][#tab_lista_artykulow_w_ksiazce[m-1][2]][2][1]==0) )then local lens_tab_numer=#tab_numer; local roznica=math.min(#poprzedni_tab_poziomowo+#tab_numer,numer_rozdzialu)-#tab_numer; roznica=((roznica>0) and roznica or 0); for i=1,roznica,1 do tab_numer[i+lens_tab_numer]=poprzedni_tab_poziomowo[i]; end; end; if((czy_jest_teraz_spis_tresci)and(juz_nie_rozwazaj_rozdzialu_spisu_tresci))then if(poziom_znakowy_rozdzialu>0)then poziom_spisu_tresci_naglowka=poziom_rozdzialu; else poziom_pierwszego_ujemnego_spisu_tresci=poziom_rozdzialu; end; end; if(poziom_rozdzialu>0)then if((((czy_poziom_dodatni_spisu_tresci)and(poziom_znakowy_rozdzialu>0))or((czy_poziom_ujemny_spisu_tresci)and(poziom_znakowy_rozdzialu<0))) and(poziom_spisu_tresci)and(poziom_spisu_tresci>=poziom_rozdzialu) )then if(poziom_znakowy_rozdzialu>0)then tab_numer=tab_numer_1; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_1; HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_1; czy_poziom_dodatni_spisu_tresci=false; elseif(poziom_znakowy_rozdzialu<0)then tab_numer=tab_numer_2; tab_poziomowo={}; poziom_spisu_tresci=nil; HNumerPoziomow=HNumerPoziomow_2; --HNumerPoziomowNaglowkow=HNumerPoziomowNaglowkow_2; czy_poziom_ujemny_spisu_tresci=false; pierwszy_ujemny_spis_tresci=nil; end; end; local hnumer=numer_rozdzialu; if(poprzedni_tab_poziomowo)then local lens=math.min(#poprzedni_tab_poziomowo,hnumer-#tab_numer); local len_tab_numer=#tab_numer; for i=1,lens,1 do tab_numer[len_tab_numer+i]=poprzedni_tab_poziomowo[i]; end; for i=lens+1,#tab_numer do tab_numer[len_tab_numer+i]=nil; end; end; if(#tab_numer<hnumer)then for i=#tab_numer+1,hnumer,1 do table.insert(tab_numer,1); end; elseif(#tab_numer>hnumer)then for i=#tab_numer, hnumer+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; else tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0) + 1; end; else --[[if(poziom_rozdzialu==0)then if(tab_lista_artykulow_w_ksiazce[m+1])then if(tab_lista_artykulow_w_ksiazce[m+1][1][2]>0)then tab_numer={0,}; elseif(tab_lista_artykulow_w_ksiazce[m+1][1][2]<0)then tab_numer={}; end; else tab_numer={}; end; end;]] end; --end; if((czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_spis_tresci)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_spis_tresci)and(poziom_znakowy_rozdzialu<0))))then function Poziom_dodatni() for s,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(s>m)then if(tab_lista[1][2][1]>0)then if(math.abs(tab_lista[1][2][1])>poziom_rozdzialu)then return true; else return false; end; end; end; end; return true; end; local id=nil; if(tab_lista_artykulow_w_ksiazce[m][2])then for p,artykul_w_bazie in ipairs(tab_lista_artykulow_w_ksiazce[m][2])do id=tab_lista_artykulow_w_ksiazce[m][2][p][4]; if(id)then break; end; end; end; if((poziom_znakowy_rozdzialu>0)and((id)or(Poziom_dodatni())))then tab_poziomowo_1=tab_poziomowo; tab_poziomowo={}; czy_poziom_dodatni_spisu_tresci=true; HNumerPoziomow_1=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); HNumerPoziomowNaglowkow_1=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_1=tab_numer; tab_numer={}; pierwszy_dodatni_spis_tresci=true; elseif((poziom_znakowy_rozdzialu<0) and((id)or((tab_lista_artykulow_w_ksiazce[m+1]) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu))))then tab_poziomowo_2=tab_poziomowo; tab_poziomowo={}; czy_poziom_ujemny_spisu_tresci=true; HNumerPoziomow_2=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; --HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_2=tab_numer; tab_numer={}; pierwszy_ujemny_spis_tresci=true; end; end; local function OTakimSamymLubMniejszymPoziomie(m) if(poziom_rozdzialu==0)then return true;end; local lens=parametry_modul["LiczbaElementówNumerowanychTablicy"](tab_lista_artykulow_w_ksiazce); if(m==lens)then return true;end; if(poziom_znakowy_rozdzialu>0)then for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]>0)then if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])<=poziom_rozdzialu)then return true; end; end; end; end; elseif(((m==1)or((tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]>0)))and(poziom_znakowy_rozdzialu<0))then local poziom_zerowego_naglowka_innego=0; for k=m+1,lens,1 do if(tab_lista_artykulow_w_ksiazce[k])then if(tab_lista_artykulow_w_ksiazce[k][1][2][1]<=0)then local ile=tab_lista_artykulow_w_ksiazce[k][1][2][1]; if(ile==0)then if((czy_jest_teraz_spis_tresci)and(m==1))then poziom_zerowego_naglowka_innego=poziom_zerowego_naglowka; else poziom_zerowego_naglowka_innego=1; end; end; if(math.abs(tab_lista_artykulow_w_ksiazce[k][1][2][1])+poziom_zerowego_naglowka_innego<=poziom_rozdzialu)then return true; end; else break; end; end; end; else return true; end; end; -- if(not czy_nie_ten_rozdzial)then if((tab_lista[2]) and(tab_lista[2][1]) and(tab_lista[2][1][2][1]==0) and(not tab_lista[2][1][4]) and(tab_lista_artykulow_w_ksiazce[m+1]) and(((poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( ((poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])+poziom_zerowego_naglowka>poziom_rozdzialu) ) )or( (poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]~=0) )) )then if(m==1)then tab_numer={0,} else table.insert(tab_numer,0); end; elseif((m==1)and(not tab_lista_artykulow_w_ksiazce[m+1]))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0))then tab_numer={}; elseif((poziomowo)and(m==1)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu==0)and(tab_lista_artykulow_w_ksiazce[m+1])and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0))then tab_numer={0,} elseif((poziomowo)and(m==2)and(poziom_zerowego_naglowka==0)and(poziom_znakowy_rozdzialu<0)and(tab_lista_artykulow_w_ksiazce[m-1])and(tab_lista_artykulow_w_ksiazce[m-1][1][2][1]==0))then if(poprzedni_tab_poziomowo)then local min=math.min(math.abs(numer_rozdzialu),#poprzedni_tab_poziomowo); for i=#poprzedni_tab_poziomowo,min+1,-1 do table.remove(poprzedni_tab_poziomowo,i) end; tab_numer=poprzedni_tab_poziomowo; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; end; elseif((not czy_jest_teraz_spis_tresci)and(((not pierwszy_dodatni_naglowek)and(poziom_znakowy_rozdzialu>0))or((not pierwszy_ujemny_naglowek)and(poziom_znakowy_rozdzialu<0))))then if(poziom_rozdzialu>0)then if(not OTakimSamymLubMniejszymPoziomie(m))then if(poziom_znakowy_rozdzialu>0)then HNumerPoziomowNaglowkow_2=HNumerPoziomowNaglowkow; HNumerPoziomowNaglowkow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); tab_numer_3=tab_numer; tab_numer={0,}; HNumerPoziomow_3=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); pierwszy_dodatni_naglowek=true; poziom_pierwszego_dodatniego_naglowka=poziom_rozdzialu; glowny_dodatni_rozdzial=true; else tab_numer_4=tab_numer; tab_numer=parametry_modul["KopiujTabelęElementów"](tab_numer); tab_numer[#tab_numer]=nil; HNumerPoziomow_4=HNumerPoziomow; HNumerPoziomow=stronicowyparser_potrzebne_modul.LiczonyHNumer(); if(poziom_naglowka or 0>0)then HNumerPoziomow(poziom_naglowka,#tab_numer); end; pierwszy_ujemny_naglowek=true; poziom_pierwszego_ujemnego_naglowka=poziom_rozdzialu; glowny_ujemny_rozdzial=true; end; else if(poziom_znakowy_rozdzialu>0)then pierwszy_dodatni_naglowek=true;else pierwszy_ujemny_naglowek=true;end; end; end; elseif((czy_jest_teraz_spis_tresci)and(not czy_nie_ten_rozdzial))then if((not spis)and(poziom_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )) )then tab_numer={0,}; spis=true; end elseif((tab_lista_artykulow_w_ksiazce[m+1]) and(( (poziom_znakowy_rozdzialu>0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]>0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )--[[or( (poziom_znakowy_rozdzialu<0) and(tab_lista_artykulow_w_ksiazce[m+1][1][2][1]<0) and(math.abs(tab_lista_artykulow_w_ksiazce[m+1][1][2][1])>poziom_rozdzialu) )]]) )then table.insert(tab_numer,0); end; -- end; end; if(tab_lista[2])then local HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local HNumerPoziomu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); local czy_tytul_rozdzial=nil;local poprzedni_b=nil;local ile_odjac=0; local HNumerB=nil; local poprzedni_poziom_artykulu=nil; local czy_ma_elementy=nil; local poziom_poprzedni_artykulu=nil; for p,artykul_w_bazie in ipairs(tab_lista[2])do local artykul=artykul_w_bazie[1][1] or artykul_w_bazie[1]; artykul=(not naglowek)and mw.ustring.gsub(artykul,"^([^#]*)#(.*)$","%1") or artykul; if(naglowek or not tab_artykul[artykul])then pierwszy_rowny_rozdzial=nil; czy_ma_elementy=true; if(not naglowek)then tab_artykul[artykul]=true; end; local tab_artykul_w_bazie; if(poziomowo)then local poziom_artykulu=artykul_w_bazie[2][1]; local poziom_poczatku_artykulu=artykul_w_bazie[2][2]; local w_rozdziale=artykul_w_bazie[2][4]; if(w_rozdziale)then if((w_rozdziale)and(not tab_lista[2][p+1]))then local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,{}); if(wartosc)then return wartosc;end; end; function Dalej() for s,artykul_w_bazie in ipairs(tab_lista[2])do if(s>p)then if((tab_lista[2][s])and(not tab_lista[2][s][2][4]))then return true; end; end; end; return false; end; if(Dalej())then tab_numer[#tab_numer+1]=0; artykuly_w_rozdziale=true; end; elseif(artykuly_w_rozdziale)then artykuly_w_rozdziale=nil; table.remove(tab_numer,#tab_numer); tab_poziomowo={}; end; ostatni_poczatek_artykulu=poziom_poczatku_artykulu; local function ToNumberPoziomArtykulu(poziom_artykulu) local numer=tonumber(poziom_artykulu) or 1; if(numer<1)then numer=1;end; return numer; end; poziom_artykulu=ToNumberPoziomArtykulu(poziom_artykulu); poziom_artykulu=poziom_artykulu+(ostatni_rozdzial_dodatni or 0)+poziom_zerowego_naglowka; local numer_poziomu=HNumerPoziomow(poziom_artykulu); if(p>1)then local numer_poprzedni=tonumber(tab_lista[2][p-1][2][1]) or 1; local id_poprzednie=tab_lista[2][p-1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_poprzedni==0)and(not id_poprzednie)and(not id)and(numer>0))then if(#tab_numer>(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka)then tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0)+1; tab_poziomowo={}; end; end; end; local prefix_poziom_artykulu=poziom_artykulu; local b=0; local tab_artykul_w_bazie=mw.text.split(artykul,"/"); if(tab_poprzedni_artykul_w_bazie)then if(poprzedni_poziom_artykulu)then if(poprzedni_poziom_artykulu==poziom_artykulu)then for c=1,#tab_artykul_w_bazie,1 do local podstrona_artykul=tab_artykul_w_bazie[c]; local podstrona_nazwy_artykulu=tab_poprzedni_artykul_w_bazie[c]; if(podstrona_artykul==podstrona_nazwy_artykulu)then b=b+1; end; end; else b=0; end; end; if(poziom_znakowy_rozdzialu<0)then if(#tab_numer~=0)then if(poziom_artykulu<=(poziom_pierwszego_ujemnego_naglowka or 0))then tab_poziomowo=tab_numer_4; tab_numer={}; HNumerArtykulu=HNumerPoziomow_4; elseif((poziom_poprzedni_artykulu)and(poziom_artykulu>(poziom_pierwszego_ujemnego_naglowka or 0))and(poziom_poprzedni_artykulu>(poziom_pierwszego_ujemnego_spisu_tresci or 0))and(poziom_artykulu<=(poziom_pierwszego_ujemnego_spisu_tresci or 0)))then HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); for i=#tab_poziomowo,numer_poziomu+1,-1 do table.remove(tab_numer,i); end; tab_numer[#tab_numer]=(tab_numer[#tab_numer] or 0 ) + 1; tab_poziomowo=tab_numer; tab_numer={}; elseif((poziom_naglowka>=poziom_artykulu)or((poziom_rozdzialu==poziom_artykulu) and((numer_poziomu<numer_rozdzialu) or((numer_poziomu==numer_rozdzialu) and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu) )) ))then local tab_numer2={}; for i=1,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka,1 do tab_numer2[i]=tab_numer[i]; end; local tab_poziomowo2={}; for i=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,#tab_numer,1 do tab_poziomowo2[i-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka]=tab_numer[i]; end; local indeks=(((HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1>#tab_numer) and 0 or (#tab_numer-(HNumerPoziomowNaglowkow(0) or 0)-poziom_zerowego_naglowka)); for i=1,numer_poziomu,1 do tab_poziomowo2[i+indeks]=tab_poziomowo[i]; end; tab_numer=tab_numer2; tab_poziomowo=tab_poziomowo2; --[[tab_poziomowo=tab_numer; tab_numer={};]] HNumerArtykulu=stronicowyparser_potrzebne_modul.LiczonyHNumer(); --local numer_poziomu=HNumerPoziomow(poziom_artykulu+(ostatni_rozdzial_dodatni or 0),#tab_poziomowo+1); end; end; end; elseif(#tab_numer>numer_poziomu)then tab_poziomowo={}; tab_poziomowo[1]=tab_numer[numer_poziomu]; for i=#tab_numer,numer_poziomu,-1 do table.remove(tab_numer,i); end; elseif((#tab_numer<=numer_rozdzialu)and(numer_rozdzialu>=numer_poziomu))then local numer_rozdzialu_dodatniego=(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka; if((numer_rozdzialu_dodatniego>0)or((numer_rozdzialu==numer_poziomu)and(poziom_poczatku_rozdzialu==poziom_poczatku_artykulu)))then if(#tab_numer>=numer_rozdzialu_dodatniego)then local tab_numer2={}; for i=1,numer_rozdzialu_dodatniego,1 do tab_numer2[i]=tab_numer[i]; end; tab_poziomowo={}; for i=numer_rozdzialu_dodatniego+1,#tab_numer,1 do tab_poziomowo[i-numer_rozdzialu_dodatniego]=tab_numer[i]; end; tab_numer=tab_numer2; end; end; end; poprzedni_poziom_artykulu=poziom_artykulu; local czy_z_rozdzialem=(tab_artykul_w_bazie[1]==rozdzial); if((p==1)and(czy_z_rozdzialem))then b=1;end; czy_tytul_rozdzial=((p==1)and true or czy_tytul_rozdzial) and (czy_z_rozdzialem); local dodatek=b-((czy_tytul_rozdzial)and 0 or 1); dodatek=((dodatek>0)and dodatek or 0); if((poziomowo)and(poziom_znakowy_rozdzialu<0))then if(poziom_naglowka>=poziom_artykulu)then local numer_poziomu=HNumerPoziomu(poziom_naglowka,numer_rozdzialu-(HNumerPoziomowNaglowkow(0) or 0)); end; end; local stala=poziom_artykulu; local numer_poziomu=HNumerPoziomu(stala); poziom_artykulu=stala+dodatek; local numer=HNumerArtykulu(poziom_artykulu); local roznica=numer_poziomu-numer; if(roznica>0)then numer=HNumerArtykulu(poziom_artykulu,numer_poziomu); end; if(#tab_poziomowo<numer)then for i=#tab_poziomowo+1,numer,1 do table.insert(tab_poziomowo,1); end; else if(#tab_poziomowo>numer)then for i=#tab_poziomowo,numer+1,-1 do table.remove(tab_poziomowo,i); end; end; tab_poziomowo[#tab_poziomowo]=(tab_poziomowo[#tab_poziomowo] or 0)+1; end; tab_poprzedni_artykul_w_bazie=tab_artykul_w_bazie; poziom_poprzedni_artykulu=poziom_artykulu; end; local wartosc=__FUNKCJA(poziomowo,i,ktory,pierwszy_parametr_szablonu,artykul,tab_numer,tab_poziomowo); if(poziomowo)then if(tab_lista[2][p+1])then local numer_nastepny=tonumber(tab_lista[2][p+1][2][1]) or 1; local id_nastepny=tab_lista[2][p+1][4]; local numer=tonumber(tab_lista[2][p][2][1]) or 1; local id=tab_lista[2][p][4]; if((numer_nastepny==0)and(not id_nastepny)and(not id)and(numer>0))then tab_poziomowo={tab_numer[(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1],}; for i=#tab_numer,(HNumerPoziomowNaglowkow(0) or 0)+poziom_zerowego_naglowka+1,-1 do table.remove(tab_numer,i); end; end; end; poprzedni_tab_poziomowo=tab_poziomowo; end; if(wartosc)then return wartosc;end; if(not poziomowo)then i=i+1; end; end; end; if(not czy_ma_elementy)then poprzedni_tab_poziomowo=nil; end; else poprzedni_tab_poziomowo=nil; end; end; return; end; p["PobierzNazwęArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,numer,artykul,tab_numer,tab_poziomowo) if((not poziomowo)and(i==numer))then if(s==ktory)then return artykul; else s=s+1; end; elseif(poziomowo)then if((table.concat(tab_numer,".") ..((#tab_numer>0) and "." or "") ..table.concat(tab_poziomowo,"."))==numer)then if(s==ktory)then return artykul; else s=s+1; end; end; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,true); end; p["PobierzNumerArtykułu"]=function(frame) local s=1; local function __FUNKCJA(poziomowo,i,ktory,nazwa_artykulu,artykul,tab_numer,tab_poziomowo) if(nazwa_artykulu==artykul)then if(s==ktory)then if(poziomowo)then return (table.concat(tab_numer,".")..((#tab_numer>0) and ((#tab_poziomowo>0) and "." or "") or "")..table.concat(tab_poziomowo,".")); else return i; end; end; s=s+1; end; end; return PobierzNumerLubNazweArtykulu(frame,__FUNKCJA,false); end; p["SubNazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 0; local krok=tonumber(args[2])or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,numer,krok); end; p["NazwaNadArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local args=stronicowyparser_potrzebne_modul:Args(frame); local numer=tonumber(args[1]) or 1; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); return stronicowyparser_potrzebne_modul.SubNazwaNadStrony(nazwa_artykulu,1,numer); end; p["NazwaLinkuArtykułu"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local ostatni_artykul; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do if(type(artykul_w_bazie[1])~="table")then if(artykul_w_bazie[1]==nazwa_artykulu)then return artykul_w_bazie[1]; end; elseif(artykul_w_bazie[1][1]==nazwa_artykulu)then return artykul_w_bazie[1][2]; end; end; end; end; return "(błąd)"; end; p["LiczbaArtykułówKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local naglowek=parametry_modul.CzyTak(args["nagłówek"]); local tab_artykul=(not naglowek) and {} or nil; local i=0; for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local nazwa_artykulu=artykul_w_bazie[1][1] or artykul_w_bazie[1]; local artykul=(not naglowek) and mw.ustring.gsub(nazwa_artykulu,"^([^#]*)#(.*)$","%1") or nazwa_artykulu; if(naglowek or not tab_artykul[artykul])then if(not naglowek)then tab_artykul[artykul]=true; end; i=i+1; end; end; end; end; return i; end; p["LiniaArtykułuKsiążki"]=function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local nazwa_artykulu=stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame); local parametry_modul=require("Module:Parametry"); local args=stronicowyparser_potrzebne_modul:Args(); local czy_analiza=parametry_modul.CzyTak(args["analiza"]); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do if(tab_lista[2])then for _,artykul_w_bazie in ipairs(tab_lista[2])do local artykul_ksiazki=artykul_w_bazie[1][1] or artykul_w_bazie[1]; if(artykul_ksiazki==nazwa_artykulu)then if(not czy_analiza)then return artykul_w_bazie[3]; else local function AnalizaLiniiArtykolow() local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})"); if(czy_spis_tresci)then local techniczne_modul=require("Module:Techniczne"); local parametry_szablony=techniczne_modul["ParsujWywołanieSzablonu"](czy_spis_tresci); local nazwa_artykulu=parametry_szablony[1]; ------ local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local pelna_nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local link= "[["..pelna_nazwa_strony.."|"..nazwa_artykulu.."]]"; local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]pisTreści%s*|[^{}]*}})",link); return linia2; else local czy_spis_tresci=mw.ustring.match(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|[^{}]*}})"); if(czy_spis_tresci)then local linia2,_=mw.ustring.gsub(artykul_w_bazie[3],"({{%s*[Ss]ekcja[%s_]+referencyjna%s*|)","%1astandardowo=tak|"); return linia2; else local nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local function adresuj_linki(a,b) return "[["..nazwa_ksiazki.."/"..a..(b or "").."]]"; end; local artykul=mw.ustring.gsub(artykul_w_bazie[3],"%[%[%s*/([^%[%]|]-)/*%s*(|.*)%]%]",adresuj_linki); artykul=mw.ustring.gsub(artykul,"%[%[%s*/([^%[%]|]-)/*%s*%]%]",adresuj_linki); return artykul; end; end; end; return AnalizaLiniiArtykolow(); end end; end; end; end; local uzupelniaj_sekcje_artykulow=parametry_modul.CzyTak(args["uzupełniaj sekcje artykułów"]); if(uzupelniaj_sekcje_artykulow)then if(mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"))then local naglowek=mw.ustring.match(nazwa_artykulu,"^[^#]*#(.+)$"); if(parametry_modul["CzyTakCiąg"](naglowek))then local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) return "[["..pelna_nazwa_ksiazki..((nazwa_artykulu~="")and("/"..nazwa_artykulu) or "").."|"..naglowek.."]]"; end; end; end; end; p["AktualnaKsiążka"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["NazwaAktualnyArtykuł"]=function(frame,__error) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); return stronicowyparser_potrzebne_modul:NazwaArtykuluKsiazki(frame) or ((not __error)and "(błąd)" or nil); end; p["ListaNagłówkówKsiążki"] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); stronicowyparser_potrzebne_modul:AnalizujArgumentySzablonu(frame); stronicowyparser_potrzebne_modul:ParametryPudelkaKsiazki(frame); local tab_lista_artykulow_w_ksiazce=stronicowyparser_potrzebne_modul:TabelaListyArtykulowKsiazki(frame); if(not tab_lista_artykulow_w_ksiazce)then return "(błąd)";end; local stronicowyparser_obiekty=mw.loadData("Module:StronicowyParser/obiekty"); local tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_pomijanych_w_rozwazaniach_na_stronach_glownych_ksiazek; local tab_rozdzialow_glownych_spisow_tresci_ksiazek=stronicowyparser_obiekty.tab_rozdzialow_glownych_spisow_tresci_ksiazek; local czy_sa_rozdzialy=nil; local pelna_nazwa_ksiazki=stronicowyparser_potrzebne_modul:PelnaNazwaKsiazki(frame); local args=stronicowyparser_potrzebne_modul:Args(); local wikikod=""; local linki_modul=require("Module:Linki"); for _,tab_lista in ipairs(tab_lista_artykulow_w_ksiazce)do local rozdzial=tab_lista[1][1]; local numer_rozdzialu=tab_lista[1][2][1]; if(numer_rozdzialu>0)then if(not tab_rozdzialow_glownych_spisow_tresci_ksiazek[rozdzial])then wikikod=((wikikod~="")and (wikikod.." &nbsp;—&nbsp; ") or "") ..linki_modul["Link wewnętrzny"]{ ["strona"]=pelna_nazwa_ksiazki, ["nagłówek"]=rozdzial, ["nazwa"]=rozdzial, ["bez znaczników"]=args["bez znaczników"], ["bez przetwarzania"]=args["bez przetwarzania"], }; end; czy_sa_rozdzialy=true; end; end; if(not czy_sa_rozdzialy)then return "(błąd: brak rozdziałów)";end; return wikikod; end; p["ArtykułSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni;local nazwa_ksiazki;local nazwa_artykulu; if(not tabela_listy_danych_analizy_ksiazki.zastepczy)then nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; else nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_przestrzeni; nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_ksiazki; nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.normalna_nazwa_artykulu; end; local parametry_modul=require("Module:Parametry"); local PobierzParametr=parametry_modul.PobierzParametr(frame); local pobierz_nazwa_artykulu=PobierzParametr("pobierz pełną nazwę artykułu"); local pobierz_adres_ksiazki=PobierzParametr("pobierz pełną nazwę książki"); local czy_pobierz_pelna_nazwa_artykulu=parametry_modul.CzyTak(pobierz_nazwa_artykulu); local czy_pobierz_pelna_nazwa_ksiazki=parametry_modul.CzyTak(pobierz_adres_ksiazki); if(czy_pobierz_pelna_nazwa_artykulu and not czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; elseif(not czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return ((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki; elseif(czy_pobierz_pelna_nazwa_artykulu and czy_pobierz_pelna_nazwa_ksiazki)then return "(błąd)"; end; local nazwa_strony=((nazwa_przestrzeni~="")and(nazwa_przestrzeni..":") or "")..nazwa_ksiazki..((nazwa_artykulu~="") and "/" or "")..nazwa_artykulu; local techniczne_modul=require("Module:Techniczne"); local szablon=techniczne_modul.NazwaSzablonu(nazwa_strony); return frame:expandTemplate{title=szablon,args={},}; end; p["KsiążkaSubst"] = function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local str=tabela_listy_danych_analizy_ksiazki["KsiążkaSubst"]; return str; end; p["StronaSubst"] = function(frame) local parametry_modul=require("Module:Parametry"); local args=frame and ((frame.getParent and ((parametry_modul.CzyTak(frame.args["wyspecjalizowana"]))and frame or frame:getParent()) or frame).args or frame) or {}; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local tab_stronasubst=tabela_listy_danych_analizy_ksiazki["StronaSubst"]; if(not tab_stronasubst)then return;end; local pierwszy,_=mw.ustring.gsub(args[1],"[%s_]+"," "); local tab_strona=tab_stronasubst[pierwszy]; if(not tab_strona)then return;end; local link=args["link"]; local czy_link=parametry_modul.CzyTak(link); local stronasubst=tab_strona[(czy_link and "tak" or "")]; return stronasubst; end; p["CzyStronęNumerować"] = function(frame) local strona=frame.args[1]; local nazwy_modul=require("Module:Nazwy"); strona=nazwy_modul["PEŁNANAZWASTRONY"](strona); local pudelko_modul=require("Module:Pudełko"); if(strona==pudelko_modul["Strona główna tego projektu"](frame))then return; end; if(strona==pudelko_modul["Strona główna dla dzieci tego projektu"](frame))then return; end; if(mw.ustring.match(strona,"^Szablon:SG/"))then return; end; local zbiory={ ["Szablon:Nowe podręczniki miesiąca/Zwycięzca"]=true, ["Wikibooks:Polecane książki"]=true, ["Szablon:Wyróżnienia książek miesiąca/Wyróżniony"]=true, } if(zbiory[strona])then return; end; if(mw.ustring.match(strona,"^Szablon:Polecane książki/") or(mw.ustring.match(strona,"^Szablon:Nowe podręczniki miesiąca/")) or(mw.ustring.match(strona,"^Szablon:Wyróżnienia książek miesiąca/")) )then return; end; return "tak"; end; function p.HNumer(frame) local p=frame.args["wyspecjalizowana"] and frame or frame:getParent(); if((not p) or (not p.args[1]))then local blad_module=require("Module:Błąd"); local frame2=p:newChild{args={[1]="Podano złe parametry w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); return; end; local stronicowyparser_rozdzialy_modul=require("Module:StronicowyParser/Rozdziały"); local naglowek,licznik=stronicowyparser_rozdzialy_modul.PodajRozdzial(p.args[1]); local id2,_=mw.ustring.gsub(naglowek,"^[%s_]",""); id2,_=mw.ustring.gsub(id2,"[%s_]$",""); id2,_=mw.ustring.gsub(id2,"[%s_]","_"); local id3,_=mw.ustring.gsub(mw.uri.encode(mw.text.encode(id2),"WIKI"),"(%%)","."); if(licznik>6)then local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h6"..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\"mw-hnumber mw-hnumber-"..licznik..((parametry_modul.CzyTak(klasa)) and (" "..klasa) or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "") ..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h6>"; elseif(licznik<1)then local blad_module=require("Module:Błąd"); local frame2=pf:newChild{args={[1]="Nie podano nagłówka w szablonie: [[Szablon:HLiczba]].",["tag"]="span",},} blad_module.error(frame2); else local id=p.args["id"]; local styl=p.args["styl"]; local klasa=p.args["klasa"]; local atrybuty=p.args["atrybuty"]; local parametry_modul=require("Module:Parametry"); return "<h"..licznik..(parametry_modul.CzyTak(id)and " id=\""..id.."\"" or "") ..(parametry_modul.CzyTak(styl)and " style=\""..styl.."\"" or "") .." class=\""..((parametry_modul.CzyTak(klasa)) and klasa or "").."\"" ..(parametry_modul.CzyTak(atrybuty)and " "..atrybuty or "")..">"..((id2~=id3) and ("<span id=\""..id3.."\"></span>") or "").."<span id=\""..id2.."\" class=\"mw-headline\">"..naglowek.."</span></h"..licznik..">"; end; end; function p.TOC(frame,czy_rozciagnij,gdy_pusty_spis_tresci) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_modul=require("Module:Nazwy"); local parametry_modul=require("Module:Parametry"); local ksiazkowe_modul=require("Module:Książkowe"); local args=(frame)and (parametry_modul.CzyTak(frame.args["wyspecjalizowana"])and frame.args or frame:getParent().args) or {}; local nazwa_przestrzeni=args[2] and nazwy_modul["NAZWAPRZESTRZENI"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=args[2] and ksiazkowe_modul["NazwaKsiążki"](args[2]) or tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_artykulu=args[1] and args[1] or tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; local czy_nie_aktualny=( (nazwa_przestrzeni~=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni) or(nazwa_ksiazki~=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki) or (nazwa_artykulu~=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu) ); local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); if ((tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza)or(tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu] and tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC)) then mw.log(tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza); local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,tabela_listy_danych_analizy_ksiazki.TOC_StronaZbiorcza or tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].lista_artykolow[nazwa_artykulu].TOC,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; elseif(not gdy_pusty_spis_tresci)then local spis_tresci_artykulu=stronicowyparser_potrzebne_modul.TOC(frame,nil,czy_nie_aktualny,czy_rozciagnij); return spis_tresci_artykulu; end; end; function p.WykazModolow(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local lista_ksiazek_w_przestrzeni_nazw=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni]; if(not lista_ksiazek_w_przestrzeni_nazw)then return nil;end; local tab_lista_artykulow_w_ksiazce_w_ksiazce=lista_ksiazek_w_przestrzeni_nazw[nazwa_ksiazki]; if(not tab_lista_artykulow_w_ksiazce_w_ksiazce)then return nil;end; local spis=tab_lista_artykulow_w_ksiazce_w_ksiazce.spis; if(not spis)then return nil;end; local parametry_modul=require("Module:Parametry"); local spis_ksiazkowy=parametry_modul.CzyTak(frame.args["spis książkowy"]); local spis_rzeczy=parametry_modul.CzyTak(frame.args["spis rzeczy"]); local tylko_naglowki=parametry_modul.CzyTak(frame.args["nagłówki"]); local wysokosc=frame.args["wysokość"]; local wykaz_modolow_w_liscie=""; local i=1; for _,tab_artykul in ipairs(spis)do if(tab_artykul[2])then for _,tab_pozycja in ipairs(tab_artykul[2])do if(type(tab_pozycja[1])~="table")then sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1],"_"," "); else sformatowana_nazwa_artykulu,_=mw.ustring.gsub(tab_pozycja[1][1],"_"," "); end; local id=tab_pozycja[4] if(not tylko_naglowki or id)then if(not spis_ksiazkowy)then wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'<li>[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|<span class=\"tocnumber\">"..i.."</span><span class=\"toctext\">"..sformatowana_nazwa_artykulu..'</span>]]</li>'; else wykaz_modolow_w_liscie=((wykaz_modolow_w_liscie~="") and (wykaz_modolow_w_liscie.."\n") or "")..'{{SpisZw||[['..((not spis_rzeczy or not id)and (((nazwa_przestrzeni=="")and nazwa_ksiazki or nazwa_przestrzeni..":"..nazwa_ksiazki).."/") or "#")..sformatowana_nazwa_artykulu.."|"..sformatowana_nazwa_artykulu.."]]|"..i.."|100%}}"; end; i=i+1; end; end; end; end; if(wykaz_modolow_w_liscie=="")then return nil;end; if(not spis_ksiazkowy)then wykaz_modolow_w_liscie="<ul>"..wykaz_modolow_w_liscie.."</ul>"; wykaz_modolow_w_liscie='<div class="toc_ogólnie_spis toc_wykaz" style="width:100%;max-height:400px;overflow:auto;">'..wykaz_modolow_w_liscie.."</div>"; wykaz_modolow_w_liscie='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Wykaz modułów w książce</div>|spis='..wykaz_modolow_w_liscie..'|funkcja=UkrytaWikitabelowaListaMenu}}'; else wykaz_modolow_w_liscie="<div class=\"toc_wykaz mw-overflow-y\" style=\""..(wysokosc and ("max-height:"..wysokosc..";overflow:auto;") or "").."border:solid #aaa 1px;padding:10px;width:auto;background-color:white;\">"..wykaz_modolow_w_liscie.."</div>"; end; local rozwiniety_wikikod=frame:preprocess(wykaz_modolow_w_liscie); return rozwiniety_wikikod; end; function p.NazwaModolu() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwy_np_modul=mw.loadData('Moduł:Nazwy/Np'); local nazwa_artykulu=tabela_listy_danych_analizy_ksiazki.nazwa_artykulu; if(nazwa_artykulu==nil)then return "[["..nazwy_np_modul.Category..": Nie można wygenerować nazwy strony]]"; else return nazwa_artykulu; end; end; function p.Wstep_do_licencji(frame) local element_licencji_1='<strong>Autor:</strong> '..frame.args[1]..'<BR>'; local element_licencji_2; if((frame.args[2]~='')and(frame.args[2]~=nil))then element_licencji_2=frame.args[2]..'<BR>'; end; local element_licencji_3; if((frame.args[3]~='')and(frame.args[3]~=nil))then element_licencji_3='<strong>Email:</strong> '..frame.args[3]..'<BR>'; end; local element_licencji_4; if((frame.args[4]~='')and(frame.args[4]~=nil))then element_licencji_4='<strong>Dotyczy:</strong> '..frame.args[4].."<BR>"; else element_licencji_4='<strong>Dotyczy:</strong> książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami.<BR>'; end; if((frame.args[5]~='')and(frame.args[5]~=nil))then element_licencji_5=frame.args[5].."<BR>"; else element_licencji_5='Użytkownika książki, do której należy ta strona, oraz w niej zawartych stron i w nich podstron, a także w nich kolumn, wraz z zawartościami nie zwalnia z odpowiedzialności prawnoautorskiej nieprzeczytanie warunków licencjonowania.<BR>'; end; local element_licencji_6; if((frame.args[6]~='')and(frame.args[6]~=nil))then element_licencji_6='<strong>Umowa prawna:</strong> '..frame.args[6]..'<BR>'; else element_licencji_6='<strong>Umowa prawna:</strong> [http://creativecommons.org/licenses/by-sa/3.0/deed.pl Creative Commons: uznanie autorstwa oraz miejsca pochodzenia książki i jej jakikolwiek części, a także treści, teksty, tabele, wykresy, rysunki, wzory i inne elementy oraz ich części zawarte w książce, i tą książkę, nawet w postaci przerobionej nie można umieszczać w jakikolwiek formie na czasopismach naukowych, archiwach prac, itp.]<BR>'; end; if((frame.args[7]~='')and(frame.args[7]~=nil))then element_licencji_7=frame.args[7].."<BR>"; else element_licencji_7='Autor tej książki dołożył wszelką staranność, aby informacje zawarte w książce były poprawne i najwyższej jakości, jednakże nie udzielana jest żadna gwarancja, czy też rękojma. Autor nie jest odpowiedzialny za wykorzystanie informacji zawarte w książce nawet jeśli wywołaby jakąś szkodę, straty w zyskach, zastoju w prowadzeniu firmy, przedsiębiorstwa lub spółki bądź utraty informacji niezależnie, czy autor (a nawet [https://pl.wikibooks.org Wikibooks]) został powiadomiony o możliwości wystąpienie szkód. Informacje zawarte w książce mogą być wykorzystane tylko na własną odpowiedzialność.<BR>'; end; local licencja=element_licencji_1..((element_licencji_2)and element_licencji_2 or "")..((element_licencji_3)and element_licencji_3 or "") ..element_licencji_4..element_licencji_5..element_licencji_6..element_licencji_7; return licencja; end; function p.Licencja(frame,czy_rozciagnij) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local menu_z_licencja; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(licencja)then if(licencja[1])then local frame={}; frame.args={licencja[1],licencja[2],licencja[3],licencja[4],licencja[5],licencja[6],licencja[7]}; local ramka_z_licencja='<div style="margin-left:0px;padding:3px;width:100%;height:auto;box-sizing:border-box;">'..p.Wstep_do_licencji(frame)..'</div>'; menu_z_licencja='{{Tabela nawigacyjna|styl=width:'..(czy_rozciagnij and "100%" or "auto")..';font-size:14px;line-height:1.2em;background-color:white;|tytuł=<div style="font-size:14px;line-height:1.2em;background-color:white;text-align:left;white-space:nowrap;">Licencja</div>|spis='..ramka_z_licencja..'|funkcja=StatycznaWikitabelowaListaMenu}}'; else return nil; end; local frame=mw.getCurrentFrame(); local rozwiniety_wikikod=frame:preprocess(menu_z_licencja); return rozwiniety_wikikod; else return nil; end; end; function p.Autor(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; local licencja=tabela_listy_danych_analizy_ksiazki.dane_analizy_artykulu[nazwa_przestrzeni][nazwa_ksiazki].licencja; if(tabela_listy_danych_analizy_ksiazki.licencja)then return licencja[1]; end; end; function p.PierwszaStrona(frame) local prawe_menu=""; local parametry_modul=require("Module:Parametry"); local czy_rozciagnij=parametry_modul.CzyTak(frame.args["rozciągnij"]) if(parametry_modul.CzyTak(frame.args[1]))then prawe_menu='<div style="margin-top:5px;font-size:1.9em;line-height:25px;text-align:left;">'..p.NazwaModolu()..'</div><hr style=\"margin:5px 0\"/>'; end; if(parametry_modul.CzyTak(frame.args[2]))then local licencja=p.Licencja(frame,czy_rozciagnij); if(licencja~=nil)then prawe_menu=prawe_menu..licencja; else local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local uchwyt_strony=mw.title.getCurrentTitle(); local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "na stronach głównych, książek" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "na stronach głównych, książek dla dzieci" or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "na stronach głównych, książek użytkowników" or((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "na stronach głównych, książek brudnopisu projektu" or "na stronach głównych, publikacji"))); local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; local kategoria_braku_licencji=(not tabela_listy_danych_analizy_ksiazki.korzystane_strona_glowna_nie_istnieje)and"[["..nazwy_np_modul.Category..": Brak licencji, "..element_zdania_kategorii.."]]" or ""; prawe_menu=prawe_menu..kategoria_braku_licencji; end; end; if(parametry_modul.CzyTak(frame.args[3]))then local wykaz_artykulow=p.WykazModolow(frame,czy_rozciagnij); if(wykaz_artykulow~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..wykaz_artykulow; end; end; if(parametry_modul.CzyTak(frame.args[4]))then local spis_tresci=p.TOC(frame,czy_rozciagnij,true); if(spis_tresci~=nil)then prawe_menu=prawe_menu.."<hr style=\"margin:5px 0\"/>"..spis_tresci; end; end; local wysokosc=frame.args["wysokość"]; return (wysokosc and ("<div class=\"pierwsza_strona mw-overflow-y\" style=\"max-height:"..wysokosc..";overflow:auto;\">") or "").."<div style=\"display:flex;flex-direction:column;width:auto;height:auto;\">"..prawe_menu.."</div>"..(wysokosc and "</div>" or ""); end; function p.SpisTresci(frame) local parametry_modul=require("Module:Parametry"); local args=parametry_modul.PobierzArgsParametry(frame); local nazwa_artykulu=args["artykuł"] or args[1]; local nazwa_ksiazki=args["książka"] or args[2]; if(not parametry_modul.CzyTak(nazwa_ksiazki))then local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; local uzyskana_nazwa_przestrzeni=tabela_listy_danych_analizy_ksiazki.nazwa_przestrzeni; local uzyskana_nazwa_ksiazki=tabela_listy_danych_analizy_ksiazki.nazwa_ksiazki; nazwa_ksiazki=((uzyskana_nazwa_przestrzeni~=nil) and (uzyskana_nazwa_przestrzeni..":") or "")..uzyskana_nazwa_ksiazki; end; local brak=(nazwa_artykulu and mw.ustring.match(nazwa_artykulu,"[|<>{}%[%]]") or nil) or (nazwa_ksiazki and mw.ustring.match(nazwa_ksiazki,"[|<>{}%[%]]") or nil); if(brak~=nil)then local nazwy_np_modul=mw.loadData("Module:Nazwy/Np"); local nazwa_przestrzeni_nazw_strony=require("Module:Nazwy")["NAZWAPRZESTRZENI"](); local element_zdania_kategorii=(nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Main)and "artykułów," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikijunior)and "artykułów dla dzieci," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.User)and "stron użytkowników," or ((nazwa_przestrzeni_nazw_strony==nazwy_np_modul.Wikibooks)and "stron brudnopisu projektu," or "stron,"))); return "[["..nazwy_np_modul.Category..":Nazwy "..element_zdania_kategorii.." w spisach treści, zawierają niedozwolone znaki]]"; end; local html_modul=require("Module:Html"); local nazwy_modul=require("Module:Nazwy"); local ksiazkowe_modul=require("Module:Książkowe"); local nazwa_przestrzeni=nazwy_modul["NAZWAPRZESTRZENI"](nazwa_ksiazki); local nazwa_ksiazki=ksiazkowe_modul["NazwaKsiążki"](nazwa_ksiazki); nazwa_ksiazki=html_modul.TransformacjaKlasyZnakowej(nazwa_ksiazki); local nazwa_artykulu=html_modul.TransformacjaKlasyZnakowej(nazwa_artykulu); local nazwa_strony=(nazwa_artykulu=="")and nazwa_ksiazki or nazwa_ksiazki.."/"..nazwa_artykulu; local pelna_nazwa_strony=(nazwa_przestrzeni=="")and nazwa_strony or nazwa_przestrzeni..":"..nazwa_strony; local tekst_artykulu=p.SpreparowanyWikikodStrony(pelna_nazwa_strony); local nazwa=args["nazwa"] or args[3]; local nazwa_strony_artykulu=parametry_modul.CzyTak(nazwa) and nazwa or mw.ustring.gsub(mw.ustring.match(nazwa_artykulu,"[^/]*$"),"_"," "); local dodatek=args["dodatek"] or args[4]; if(not tekst_artykulu)then if(nazwa_artykulu~="")then return "\n"..mw.ustring.rep("=",6).."<span style=\"color:red\">[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]</span>"..mw.ustring.rep("=",6).."\n"; else return frame:getParent():preprocess("{{Błąd|Wywołano szablon z argumentem pierwszym pustym.}}"); end; else local twor_spisu_tresci="[["..pelna_nazwa_strony.."|"..nazwa_strony_artykulu.."]]"..(((dodatek)and(dodatek~="")) and (" "..dodatek) or ""); twor_spisu_tresci=mw.ustring.rep("=",6)..twor_spisu_tresci..mw.ustring.rep("=",6).."\n"; local stronicowyparser_dalszefunkcje_modul=require("Module:StronicowyParser/DalszeFunkcje"); local ulozenia_w_menu_spisu_tresci=stronicowyparser_dalszefunkcje_modul:SpisTresciWstep(tekst_artykulu, pelna_nazwa_strony); local atrybuty="style=\"margin-left:20px\""; local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); local toc=stronicowyparser_potrzebne_modul.TOCSilnik(ulozenia_w_menu_spisu_tresci, atrybuty); local limit=args["limit"]; local czy_limit=parametry_modul.CzyTak(limit); return '<div class="toc_ogólnie_spis toc_artykuł toclimit '..(czy_limit and ("toclimit-"..limit) or "")..'">\n'..twor_spisu_tresci..(toc and toc or "")..'</div>'; end; end; function IteratorFunkcja() local obiekty_modul=mw.loadData("Module:StronicowyParser/obiekty"); local tabela_wypowiedzi=obiekty_modul.tablica_obiektow; local licznik=1; return function() local tabela_obiektu=tabela_wypowiedzi[licznik]; if(not tabela_obiektu)then return nil;end; local wartosc1=mw.ustring.gsub(tabela_obiektu[1],"%d+$",""); local wartosc2=tabela_obiektu[4]; licznik=licznik+1; return wartosc1,wartosc2; end; end; local iterator=IteratorFunkcja(); for nazwa_obiektu,czesc_nazwy_funkcji in iterator do p["Numer"..czesc_nazwy_funkcji] = function(frame) local stronicowyparser_potrzebne_modul=require("Module:StronicowyParser/Potrzebne"); return stronicowyparser_potrzebne_modul.NumerObiektu(frame,nazwa_obiektu); end; end; p["AnalizujSzablonemStronicowymArtykuł"]=function(frame) local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return ""; end; function p.formatowanie() local tabela_listy_danych_analizy_ksiazki=mw.loadData('Module:StronicowyParser/informacje').tablica_zebranych_danych_ksiazkowych; return tabela_listy_danych_analizy_ksiazki.formatowanie; end; function p.WstawKategorie(frame) local stronicowyparser_kategorie_modul=require("Module:StronicowyParser/Kategorie"); return stronicowyparser_kategorie_modul.WstawKategorie(frame); end; function p.CzyStronaSubst(frame,pelnanazwastrony,czy_wymusic) if(czy_wymusic)then local nazwy_modul=require("Module:Nazwy"); local pelnanazwastronyaktualnej=nazwy_modul["PEŁNANAZWASTRONY"](); if(pelnanazwastrony~=pelnanazwastronyaktualnej)then local stronicowyparser_stronasubst_modul=require("Module:StronicowyParser/StronaSubst"); local TakFun=function(frame) return "tak";end;local NieFun=function(frame) return "";end; return stronicowyparser_stronasubst_modul.AnalizaStronaSubst(nil,pelnanazwastrony,TakFun,NieFun,nil); end; end; local tabela_listy_danych_analizy_ksiazki=mw.loadData("Module:StronicowyParser/informacje").tablica_zebranych_danych_ksiazkowych; if(tabela_listy_danych_analizy_ksiazki["CzyStronaSubst"])then return "tak"; end; return ""; end; return p; a2dmk6cbxv2hn3676fdayqh1fsc4ydo Szablon:Państwo dane Papua-Nowa Gwinea 10 47119 435264 330138 2022-07-20T11:04:45Z CommonsDelinker 1569 Replacing Flag_of_Papua_New_Guinea_(1965–1970).svg with [[File:Sporting_Flag_of_Papua_New_Guinea_(1965–1970).svg]] (by [[:c:User:CommonsDelinker|CommonsDelinker]] because: [[:c:COM:FR|File renamed]]: [[:c:COM:FR#FR2|Criterion 2]] (meaningless or ambiguous wikitext text/x-wiki {{ {{{1<noinclude>|państwo dane/opis</noinclude><includeonly>|#switch:{{{parametr|}}}</includeonly>}}} | link alias = Papua-Nowa Gwinea | skrót = PNG | dopełniacz = Papui-Nowej Gwinei | flaga alias = Flag of Papua New Guinea.svg | flaga alias-bandera-wojenna = Naval Ensign of Papua New Guinea.svg | flaga alias-1899 = Flag of German New Guinea.svg | link alias-1899 = Nowa Gwinea Niemiecka | flaga alias-Papua = Flag of the Territory of Papua.svg | link alias-Papua = Papua (terytorium) | nazwa alias-Papua = Papua | flaga alias-Nowa Gwinea = Flag of the Territory of New Guinea.svg | link alias-Nowa Gwinea = Nowa Gwinea Australijska | flaga alias-1945 = Flag of Australia.svg | link alias-1945 = Terytorium Papui i Nowej Gwinei | flaga alias-1965 = Sporting Flag of Papua New Guinea (1965–1970).svg | link alias-1965 = Terytorium Papui i Nowej Gwinei | flaga alias-1970 = Flag of Papua New Guinea (1970–1971).svg | link alias-1970 = Terytorium Papui i Nowej Gwinei | link alias-1971 = Terytorium Papui i Nowej Gwinei | rozmiar = {{{rozmiar|}}} | nazwa = {{{nazwa|}}} | link = {{{link|}}} | altlink = {{{altlink|}}} | wariant = {{{wariant|}}} <noinclude> | par1 = 1899 | par2 = Papua | par3 = Nowa Gwinea | par4 = 1945 | par5 = 1965 | par6 = 1970 | prz1 = 1971 </noinclude> }} s0p9rox64fctsq9oindcmn5s8gzh9qb Wikipedysta:Persino/common.js 2 58552 435091 435090 2022-07-19T12:05:10Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ /*$("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY);*/ $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ t8coh6dzknbqyyej068mod70u3063hs 435092 435091 2022-07-19T12:05:44Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2itwbijugc4anxs1ymp6rx264zjr59q 435093 435092 2022-07-19T12:27:50Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+1)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 6rwunmrfecg5cnoyegm9gzg0mbk5tfq 435094 435093 2022-07-19T12:28:55Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2itwbijugc4anxs1ymp6rx264zjr59q 435095 435094 2022-07-19T13:38:52Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ pjyz2fckej8s1kogooc1td2i619287f 435096 435095 2022-07-19T13:43:43Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-10)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 0ma9je42l1li5mw3pjpff5dyfu0j5n7 435097 435096 2022-07-19T13:44:19Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 7uz43l1f400tjelzrayrczt1rocle59 435098 435097 2022-07-19T14:01:18Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ffwrq2mh9e5nvr65bakar1z46rd55sw 435099 435098 2022-07-19T14:11:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; //element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ q184mzz04f4jmja4lzn2v9d8et39dyk 435101 435099 2022-07-19T14:17:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } //element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; //element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; $(element_g).children().each((i,element_f)=>{ element_f.style[height]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ c0vkmq2cuw0fb7zdhyd8r9qj19vxil7 435103 435101 2022-07-19T14:20:28Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; //element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ q184mzz04f4jmja4lzn2v9d8et39dyk 435104 435103 2022-07-19T14:34:48Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } //element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; element_g.firstChild.style[height]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2zk9ijlqvkg0ko8ksgxh2n317y4g3d8 435105 435104 2022-07-19T14:38:17Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-20)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 7uz43l1f400tjelzrayrczt1rocle59 435106 435105 2022-07-19T14:39:31Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-100)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 5arwdcebd0p7xesa7k6uj4lo9kjwj2c 435107 435106 2022-07-19T14:40:16Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)-200)+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bf7jw013j5bb0wf7aj50vsuck8e17py 435108 435107 2022-07-19T14:41:30Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ pjyz2fckej8s1kogooc1td2i619287f 435109 435108 2022-07-19T14:49:38Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ em9v0wyoc3q5xrpgpmun39ufco004n3 435110 435109 2022-07-19T15:08:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children().each((i,element_f)=>{ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 8qljegks7e4x3s55dbnp9alm1seznp2 435111 435110 2022-07-19T15:11:27Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children('div.mw-overflow-y').each((i,element_f)=>{ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ f6wvcp4y129wijuh2u7z3vhqupbk72r 435112 435111 2022-07-19T15:17:04Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } alert($(element_g).children());//.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ t6f85ziaei85zkzezcbin8b55uxcpy8 435113 435112 2022-07-19T15:17:28Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } alert($(element_g).children().length);//.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ paryzqto3l83tlymj7avpd0kuzpkayh 435114 435113 2022-07-19T15:18:30Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } alert($(element_g).children(":only-child").length);//.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ pezj9yfp8xrz75oxmwe78qb2ma6829i 435115 435114 2022-07-19T15:20:44Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each((i,element_f)=>{ alert("TYTAN") }) }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ f76vb460o92j9b4sy27fklbsraab76u 435116 435115 2022-07-19T15:21:40Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each((i,element_f)=>{ alert("TYTAN") }); alert("TYTAN") }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ keqs8vnn6pxoev0p74nocw6fp4820nw 435117 435116 2022-07-19T15:23:22Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; var children=$(element_g).children(":only-child"); if(children.length>0){ children[0].style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; } }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ m0soyoj5adr0byhbvldj68zzcdldmat 435118 435117 2022-07-19T15:24:24Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; var children=$(element_g).children(":only-child"); alert(children.length); if(children.length>0){ children[0].style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; } }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 6brf58enxvt0ls9r9ii5bxtdf6f52iw 435119 435118 2022-07-19T15:25:01Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; var children=$(element_g).children(":only-child"); alert(children.length); //if(children.length>0){ //children[0].style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; //} }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ hanx3ugq3om64m3tyc5jfbqzpx0mrop 435120 435119 2022-07-19T15:25:54Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; var children=$(element_g).children(":only-child"); alert(children.length); if(children.length>0){ //children[0].style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; } }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 64iu1lys1uirm2eig1f2pn6675asb3q 435121 435120 2022-07-19T15:27:33Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; var children=$(element_g).children(":only-child").each((i,element_f)=>{ alert("TYTAN") element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 6whut4tcw3imawrjmwmldxwabcoi7kd 435122 435121 2022-07-19T15:28:46Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each((i,element_f)=>{ alert("TYTAN"); //element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 6qui6vnfci062e7jp2d1fuip9dekjaz 435123 435122 2022-07-19T15:31:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ alert("TYTAN"); //element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2thl6ga21757z9lelzco6zzz8go0b31 435124 435123 2022-07-19T15:31:41Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ alert("TYTAN"); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 91xb0v8gqpspzgntdgcyuedavf3zh92 435125 435124 2022-07-19T15:32:20Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style["overflow-"+((height=="height")?"y":"x")]="auto"; element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ p95pd16l4bnmnpith8jui5ks7cdx3v8 435126 435125 2022-07-19T15:35:58Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bildtceneob6ljjfwcfis1n1uujbm33 435127 435126 2022-07-19T15:38:54Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom-100))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 4p421hcydmx213u387ak8lpmell352q 435128 435127 2022-07-19T15:40:46Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+100))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 80i0yvtv5bs3joozhejbyy70ng64wfx 435129 435128 2022-07-19T15:43:07Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ keaoepb2psv32lulpu76oao2hr5n9tx 435130 435129 2022-07-19T15:47:15Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ peeu4tzccocb797tdt2akmorrmgm09d 435131 435130 2022-07-19T15:50:25Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+20))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bxewbiobjct8ainbphw0u1968xj5crg 435132 435131 2022-07-19T15:50:57Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+50))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ qyvsmtbml89vcso68ml3q4x7iont5a2 435133 435132 2022-07-19T15:51:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+80))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2ydn30h1cltetml6n2bm9kpqfiltyij 435134 435133 2022-07-19T15:52:59Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+20))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bxewbiobjct8ainbphw0u1968xj5crg 435135 435134 2022-07-19T15:53:52Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+40))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ btm9bethiw4fhk7ywygwn6x79xj6kd4 435136 435135 2022-07-19T15:54:52Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+30))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ rj6nu9fmrud6vukrqspn4d0lv09au8y 435137 435136 2022-07-19T15:55:39Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+25))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ kji11xiazi4nl57yg98rbl58lj5tfk7 435138 435137 2022-07-19T15:56:30Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+23))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ grwot6q7y8ipqwp6krdygl7h3ge9a09 435139 435138 2022-07-19T15:57:29Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var przodek_srodek=parseFloat(window.getComputedStyle($('.strona_środkowa')[0], null).getPropertyValue(height)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_srodek-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+22))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 721zih0no5ofmu42wwwmnqj262fzjkq 435140 435139 2022-07-19T16:01:37Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+22))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ksubv4sig79jxc752avdurvtt8449pe 435141 435140 2022-07-19T16:08:04Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ //var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); //var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); //var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); //var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+20))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ aq1unl7kdkl6d7ew575alpmuopu7hyp 435142 435141 2022-07-19T16:08:50Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ //var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); //var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); //var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); //var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+22))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 6uftjk4ijdcvtzxyif56y2qhfutlu69 435143 435142 2022-07-19T16:12:51Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=(przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob))+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ p0h4ifrhjnl0blx6eflbt6138m47sm7 435144 435143 2022-07-19T16:24:57Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement.clientHeight-8-80)+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ hawa0euw8bnp6wge48889ikmno5gjq3 435145 435144 2022-07-19T16:26:23Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-80)+"px"; element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ b03brr34yxa946suwxv0jplus6m9w8v 435146 435145 2022-07-19T17:22:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-80)+"px"; //element_f.style["overflow-"+((height=="height")?"y":"x")]="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 8wjbly3orw4smlm50rsr78mucbqpysz 435147 435146 2022-07-19T17:22:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-80)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 9ssxzgsk5cm2d1yyyo19t25r9csbu7e 435148 435147 2022-07-19T17:57:57Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top))-80)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ grys3fxe2dn17y6qjmh2uxl85ynp871 435149 435148 2022-07-19T18:00:54Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_dziecko[top]-80)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 39w9gmoblaxkzi03mnj5brr4e40mzom 435150 435149 2022-07-19T18:02:17Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_dziecko[top])+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 5pyvkgu68olz1r2a7ff288eojzepijl 435151 435150 2022-07-19T18:02:51Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_dziecko[top]-10)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ onfgotysza2u1peylolk3y0d4yje81c 435152 435151 2022-07-19T18:03:14Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_dziecko[top]-20)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ pii8kki6ip9iuoyplslilf62yqvurov 435153 435152 2022-07-19T18:03:36Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_dziecko[top]-30)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ kr9z1540on924hjuci0loohvzq3qdd1 435154 435153 2022-07-19T18:05:07Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-(rect_dziecko[top]-rect_rodzic[top])-30)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1o49ptjz9osd81ff79vw3b06a1df5vi 435155 435154 2022-07-19T18:06:46Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]:0)-80)+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ axirrwrtr791qbx30y6wtmvebrx1wjf 435156 435155 2022-07-19T18:08:45Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ cxw9k6k30vvusfbibll815pf1cvzump 435157 435156 2022-07-19T18:09:46Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]-20:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ kraic61n7dmih56wbllgwj88g3skeaz 435158 435157 2022-07-19T18:10:19Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]-40:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ q3tlchrsl154nazs30i1on3pvubidby 435159 435158 2022-07-19T18:11:13Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]-80:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ svlv7boy0cgxtzin3lubg3lxf466jft 435160 435159 2022-07-19T18:12:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]+20:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bywslrh18jyi5e8tsf54gxye9l7mn6x 435161 435160 2022-07-19T18:12:43Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]+30:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ q13fcaeb3bfdmrt259rf1hqmxjpe9n7 435162 435161 2022-07-19T18:14:40Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>0)?rect_rodzic[top]:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ cxw9k6k30vvusfbibll815pf1cvzump 435163 435162 2022-07-19T18:16:03Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?rect_rodzic[top]:80))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ a1y5tbk3jczgqwzfwhed1tjzsdp2xu3 435164 435163 2022-07-19T18:24:23Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(Math.max(0,80-rect_rodzic[top])):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ tce413tbqn73x7zaknxhojn18zd5mm6 435165 435164 2022-07-19T18:26:41Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 9gw24uuknzph6ef55y3ebzn5hwpai6h 435166 435165 2022-07-19T18:27:22Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+20):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ i0szyrmdqjbbs8h0lk2eivqw3zhntcr 435167 435166 2022-07-19T18:28:01Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+30):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ tw9q7kqiunkqa86l8bmy8f2olycynjd 435168 435167 2022-07-19T18:28:54Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+25):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ h2soy2077vc0kkowsglpv33j22ux50p 435169 435168 2022-07-19T18:30:07Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+30):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ tw9q7kqiunkqa86l8bmy8f2olycynjd 435170 435169 2022-07-19T18:33:36Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+25):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ h2soy2077vc0kkowsglpv33j22ux50p 435171 435170 2022-07-19T18:34:36Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]+28):(80)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ezn57azwwexz6qim5qxbicv932q53u0 435172 435171 2022-07-19T18:38:56Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((rect_rodzic[bottom]>=0)?(rect_rodzic[botttom]):(0)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 7g4mhu8uzbsjope6akc9belbbuu89jb 435173 435172 2022-07-19T18:40:00Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((rect_rodzic[bottom]>=0)?(rect_rodzic[bottom]):(0)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ fl4tytgok0aha6vfzov92huhsvou839 435174 435173 2022-07-19T18:42:39Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ mhr76syzi39mjrp32vl99i6wemccnz4 435175 435174 2022-07-19T18:46:14Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1kpyajqxts1azjyn2hol9p7ym1uaytf 435176 435175 2022-07-19T18:48:19Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(40))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(40)))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 01lkz3t2yj67fzzo67rwngr7m1ee17x 435177 435176 2022-07-19T18:51:45Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80:0) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ okg54qmrwrdgr47ogz8xb8wc15trl51 435178 435177 2022-07-19T18:53:36Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25:0) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ owwoprsr6q8kooj2cgsgr219kdv3fnh 435179 435178 2022-07-19T18:55:39Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?25:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ orgpulqcc799e3wk75ghzm2avyg36b8 435180 435179 2022-07-19T18:56:24Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?80:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ i4iwu05y5t34e58d8j9jt0sool2qwro 435181 435180 2022-07-19T18:57:25Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?0:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 594dc028q6oau3tlrioih4bypu1j5aq 435182 435181 2022-07-19T18:58:28Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?75:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 4fd4k9jtfl274mnt4vv9fg6e437o7wk 435183 435182 2022-07-19T18:59:08Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?70:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 29py8xu9uii7soly06vwxz0dcy30a4w 435184 435183 2022-07-19T19:00:08Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?74:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ sndlm1anqwx0nwpryaspw3tegz9hue9 435185 435184 2022-07-19T19:05:42Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; alert(height_sticky); }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?80: (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?74:0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jafy8iek3liw1ppt10tmqhpfmwp1h5s 435186 435185 2022-07-19T19:10:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?33: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 5jc1oi4tj27qahcroowm4p5aiysj8go 435187 435186 2022-07-19T19:12:05Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ sg1d23onpm83njtfac91a3si8ppb7ld 435188 435187 2022-07-19T19:12:55Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ nsv1es3bqpauqu2mn0u1yweacxyyfad 435189 435188 2022-07-19T19:13:34Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?28: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jb23haoybbh1jsupj95xo16i8lb8ske 435190 435189 2022-07-19T19:14:53Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?28: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ idwss24h7eqoflxzkngep9uyatuljvk 435191 435190 2022-07-19T19:15:26Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?27: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 5j09yh33w6183oht7r7yvw316n70dpt 435192 435191 2022-07-19T19:16:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?23: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ohlyikvfxpw1w90418t87l34d04bcut 435193 435192 2022-07-19T19:17:12Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?25: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ pxum30j6ngxd50vww2xixpgdy8smvka 435194 435193 2022-07-19T19:18:01Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?33: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 4hby6ht9kprcvd1l23mwl64tfpdo6wh 435195 435194 2022-07-19T19:18:34Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+28):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ppuoycugxitskqtnspg5q1aucp3o639 435196 435195 2022-07-19T19:19:26Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+20):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ gaa5h3ga2bxdf6bazqq3oa0tys578f0 435197 435196 2022-07-19T19:20:12Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+23):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 8yvwwpndqnzfp6w67ms30k5g9kqsvzu 435198 435197 2022-07-19T19:21:01Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+25):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 9ob69tge0qmyuazev8z4fviingz13p0 435199 435198 2022-07-19T19:23:04Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?30: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+25):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jumwrfcfuwagu2lydcbryxssxacqfci 435200 435199 2022-07-19T19:30:23Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?27: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+27):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 4eyi30o80qlh3d5easownwpilx76m1n 435201 435200 2022-07-19T19:32:41Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; alert(nie_ob) var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+33): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?27: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+27):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 2g3jqoc8496z9ljyzy81u378y91hri1 435202 435201 2022-07-19T19:35:24Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+8): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?4: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+4):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1tlzdu3mcfb3qd6cgovfbrpohr48uvo 435203 435202 2022-07-19T19:36:20Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+11): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?4: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+4):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ eyme1voxmby2k40x50xsqy3s4pd1xz4 435204 435203 2022-07-19T19:37:47Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?4: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+4):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 470x8vbyzhmj4ggq6a2l391ucgfedu4 435205 435204 2022-07-19T19:38:32Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?6: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ iplv00sdhgpewog4wjuopt1sgkrqulm 435206 435205 2022-07-19T19:39:17Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?12: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ onw7u2qdtzvxnv4ws98nlwi5i63mnin 435207 435206 2022-07-19T19:40:24Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?8: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ sejp3rx6vcwmzp2usjlaamxy1r0738e 435208 435207 2022-07-19T19:40:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?10: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 8071e44am6pjb7ty1ibvhuq93x0hcsf 435209 435208 2022-07-19T19:41:48Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+12): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ prwtk4bmkx9cdafmf6fxfpqd3jro73t 435210 435209 2022-07-19T19:43:17Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+5): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1head96rkzw5w4v50k7keykhqkdlaaj 435211 435210 2022-07-19T19:44:03Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+8): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ eoyti60oa27a7qa7lxetudroz5m6nt8 435212 435211 2022-07-19T19:44:52Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+4): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ngpe95paddprzeipxtxjqdbgg6wrfzb 435213 435212 2022-07-19T19:45:21Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+6): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jxm707kiqqu2mxs9qm5ot4cbyjt8eeq 435214 435213 2022-07-19T19:45:54Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+8): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ eoyti60oa27a7qa7lxetudroz5m6nt8 435215 435214 2022-07-19T19:46:19Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?24: (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+6):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ c67trrf6603ed2uwcn9rs3p57tj4kvd 435216 435215 2022-07-19T19:47:51Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ rwq5f119cvpkga7yrdjnr7v4f9s5b5y 435217 435216 2022-07-19T19:50:13Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ i2bg5iylxgw2s4i0i3uphsrvm2ivl3k 435218 435217 2022-07-19T19:51:33Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(10): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jx5rd36x995ksuoc2brro1d4t8z76q2 435219 435218 2022-07-19T19:54:09Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ rwq5f119cvpkga7yrdjnr7v4f9s5b5y 435220 435219 2022-07-19T19:55:32Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ eh5lxawjwzqwhf7r36zj8dvtg1ai0f5 435221 435220 2022-07-19T19:55:59Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ a4a1v26rfs433aeho2lesnqvysbvpxu 435222 435221 2022-07-19T20:03:00Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; element_g.style.overflow="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ nnc26r9zimcjj7v1idn68vmyvxicydm 435223 435222 2022-07-19T20:11:32Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; element_f.style.overflow="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 0k6r0qg4lpnmt6tm4j8b2afhps4d6uq 435228 435223 2022-07-19T20:41:07Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; ScrollBarOverflow(); }); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 7louy6lr8ajih3drbl93oghry1dwd02 435231 435228 2022-07-19T21:04:11Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])-rect_dz[top]; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 4mqkxdpi40zlitniez0enwspufervca 435232 435231 2022-07-19T21:09:34Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom]); el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ esk5u1pxkyvezkrj4qvctrjcft8zy2o 435233 435232 2022-07-19T21:10:08Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom]); //el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ huemf6xfkxuzyrqh3xxeo9k9hu1om8a 435234 435233 2022-07-19T21:12:48Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])-rect_dz[top]; alert(((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])+","+rect_dz[top]) el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ taq6s05suq09lomye1p4t173ele3a0q 435235 435234 2022-07-19T21:13:41Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])-rect_dz[top]; //alert(((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])+","+rect_dz[top]) el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ p20a4dbxjtkpo957qwx0io5tdqzb5hs 435236 435235 2022-07-19T21:16:37Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var rect_ro=el.parentNode.getBoundingClientRect(); var he_ro=rect_ro[height]; var top_ro=rect_ro[top]; var bottom_ro=rect_ro[bottom]; var rect_dz=el.getBoundingClientRect(); var height_dz=((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])-rect_dz[top]; alert(height_dz) //alert(((rect_dz[bottom]>bottom_ro)?bottom_ro:rect_dz[bottom])+","+rect_dz[top]) el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jw4i8io5jg61hh7mjapzc6qu1hs7t1v 435237 435236 2022-07-19T21:26:47Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); alert(rect_ro[bottom]-rect_ro[top]); //var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1xdutaid5rwxaj1rxz4vyhgutnz7xmz 435238 435237 2022-07-19T21:28:13Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); alert(bottom_dz-rect_ro[top]); //var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ sr8zeflnbcmoi94o9wophuun5450kro 435240 435238 2022-07-19T21:30:34Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 9qjmrb2066qmg12bcem15ec6y9bdltt 435241 435240 2022-07-19T21:31:52Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); alert(bottom_dz-rect_ro[bottom],height_scroll) var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ d9nhvfcfr9rm06793jwv296hoicauyu 435242 435241 2022-07-19T21:33:04Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); alert(bottom_dz-rect_ro[bottom]+","+height_scroll) var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 12n3kxpczck37wyxorlxswz2nhkgi99 435243 435242 2022-07-19T21:34:25Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); alert(height_scroll-(bottom_dz-rect_ro[bottom])) var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 613dqgaq0ytijbutl9kn2ofkn70th5a 435244 435243 2022-07-19T21:38:08Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 9qjmrb2066qmg12bcem15ec6y9bdltt 435245 435244 2022-07-19T21:39:07Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz+"px"; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 1nv4k7x1o2z670bo8eltumr50hwi98t 435246 435245 2022-07-19T21:42:25Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ el.style.overflow="visible"; var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz+"px"; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ bp2mz9o0qikm86odxaw0oesmfve4cct 435247 435246 2022-07-19T21:44:39Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); $(element_g).find('*.mw-overflow-y').each(function(i,el){ el.style.overflow="visible"; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]="100%"; var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz+"px"; el.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ jt8zowjmcrz0pie65mbruwmvpqshwqw 435248 435247 2022-07-19T21:45:36Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); /*$(element_g).find('*.mw-overflow-y').each(function(i,el){ el.style.overflow="visible"; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]="100%"; var height_scroll=el["scroll"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; var rect_dz=el.getBoundingClientRect(); var bottom_dz=rect_dz[top]+height_scroll; var rect_ro=el.parentNode.getBoundingClientRect(); var height_dz=(bottom_dz>rect_ro[bottom])?(height_scroll-(bottom_dz-rect_ro[bottom])):height_scroll; el.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=height_dz+"px"; el.style.overflow="auto"; });*/ ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ s2le6k8byu5722bnhl2fz8so9x0qxk9 435249 435248 2022-07-20T08:23:40Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } var padding_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ lk1ky8hw68nh1840gm8cruewafmzwd5 435250 435249 2022-07-20T08:27:56Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ ithlpt1fu3qwrruhk0qmo8bmqj5tu9s 435251 435250 2022-07-20T08:31:23Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } var padding_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ hscqw3q7j0mo6r50dplaxa9ojewll0a 435253 435251 2022-07-20T08:45:16Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } var padding_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g.parentNode, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_g.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ qumtifktoo4f4uymsonthxo0yf7gown 435255 435253 2022-07-20T08:51:56Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":only-child").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 3npmgzfsaeewfto3kk2u7ambieqbddt 435258 435255 2022-07-20T09:11:25Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":not(:style):not(link)").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ tsmiax1jlybltg90akbkb25x0j3ao9i 435259 435258 2022-07-20T09:12:27Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":not(style):not(link)").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ qc3bbnpbpqec1aqlorcuom5l7x6glxy 435260 435259 2022-07-20T09:30:33Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){return;} var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]=(przodek_height-((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))-marginbottom-rect_dziecko[height]-margintop)+"px"; console.log(przodek_height,bottom_ab,rect_dziecko[height],"TYTAN",element_g.style[top],element_g.style[bottom+"Old"]); element_g.style[bottom]="auto"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ gq4znrcaiw6zyp5a5rpyfok53qf3xga 435261 435260 2022-07-20T09:32:49Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":not(style):not(link)").each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ qc3bbnpbpqec1aqlorcuom5l7x6glxy 435263 435261 2022-07-20T10:12:19Z Persino 2851 javascript text/javascript mw.loader.load( '//pl.wikibooks.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedysta:Persino/Gadget-StronicowyParser.js', 'text/javascript', true ); /**/ /*Funkcja do liczenia, czy nastąpiło przepełnienie poziome lub pionowe*/ function ScrollBarOverflow(){ $('*.mw-overflow-x, *.mw-overflow-y').each(function(i,element_g){ /*start overflow*/ var overflow=window.getComputedStyle(element_g, null).getPropertyValue("overflow"); var overflow_x=$(element_g).hasClass('mw-overflow-x'); if(overflow_x){ var overflowX=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-x")); if((overflowX)&&(overflowX=="auto")){ const hasHorizontalScrollbar = element_g.scrollWidth > element_g.clientWidth; // true lub false if(hasHorizontalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-x"); }else{ element_g.classList.remove("mw-scrollbar-overflow-x"); } } } var overflow_y=$(element_g).hasClass('mw-overflow-y'); if(overflow_y){ var overflowY=(((overflow)&&(overflow!=""))?overflow:window.getComputedStyle(element_g, null).getPropertyValue("overflow-y")); if((overflowY)&&(overflowY=="auto")){ const hasVerticalScrollbar = element_g.scrollHeight > element_g.clientHeight; // true lub false if(hasVerticalScrollbar){ element_g.classList.add("mw-scrollbar-overflow-y"); }else{ element_g.classList.remove("mw-scrollbar-overflow-y"); } } } /*koniec overflow*/ }); } $(ScrollBarOverflow); $(window).on('resize', ScrollBarOverflow); /*Funkcja symulująca właściwości position:sticky, wszędzie tam, gdzie nie można go użyć.*/ function StickyXY(){ $('*.mw-sticky-x, *.mw-sticky-y').each(function(i,element_g){ function FunStickyXY(top,bottom,height){ if(element_g.style[top+"Old"]===undefined){ element_g.style[top+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(top)); element_g.style[top+"Old"]=((!isNaN(element_g.style[top+"Old"]))?element_g.style[top+"Old"]:0); } if(element_g.style[bottom+"Old"]===undefined){ element_g.style[bottom+"Old"]=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue(bottom)); element_g.style[bottom+"Old"]=((!isNaN(element_g.style[bottom+"Old"]))?element_g.style[bottom+"Old"]:0); } var margintop=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+top)); margintop=((!isNaN(margintop))?margintop:0); var marginbottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("margin-"+bottom)); marginbottom=((!isNaN(marginbottom))?marginbottom:0); var przodek_height=undefined; var rect_dziecko=element_g.getBoundingClientRect(); var rect_rodzic=element_g.parentNode.getBoundingClientRect(); var top_ab=rect_rodzic[top]-margintop; var bottom_ab=rect_rodzic[bottom]-marginbottom; var height_obj=rect_dziecko[height]+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+margintop+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; for(var rodzic=element_g.parentNode;((rodzic!=null)&&(rodzic!=document));rodzic=rodzic.parentNode){ var height_rodzic=parseFloat(window.getComputedStyle(rodzic, null).getPropertyValue([height])); if(height_rodzic>=height_obj){ przodek_height=height_rodzic; break; } } if(!przodek_height){ element_g.style.display="none"; return; } var top_obj=(((top_ab>=0)?0:(-top_ab)))+((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab))); var wysokosc=top_obj+margintop+rect_dziecko[height]+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom; if(wysokosc>=przodek_height){ element_g.style[top]="auto"; element_g.style[bottom]=(((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom)+"px"; }else{ element_g.style[top]=top_obj+"px"; element_g.style[bottom]="auto"; } $(element_g).children(":not(style):not(link)").first().each(function(i,element_f){ var padding_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+top)); var padding_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("padding-"+bottom)); var border_top=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+top+"-width")); var border_bottom=parseFloat(window.getComputedStyle(element_g, null).getPropertyValue("border-"+bottom+"-width")); var nie_ob=padding_top+padding_bottom+border_top+border_bottom; var rect_dziecko=element_g.getBoundingClientRect(); var height_sticky=0; $('#vector-sticky-header').each(function(i,el){ var rect_sticky=el.getBoundingClientRect(); height_sticky=rect_sticky[height]+nie_ob; }); var wys=document.documentElement["client"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]; element_f.style["max"+(height.replace(/^(.)/g,function(s){return s.toUpperCase();}))]=Math.min((przodek_height-(((top_ab<=0)?(element_g.style[top+"Old"]):(Math.max(0,element_g.style[top+"Old"]-top_ab)))+((bottom_ab<=0)?(element_g.style[bottom+"Old"]):(Math.max(0,element_g.style[bottom+"Old"]-bottom_ab)))+marginbottom+nie_ob)),wys-((rect_rodzic[top]>=0)?(rect_rodzic[top]):(0))-((wys-rect_rodzic[bottom]>=0)?(wys-rect_rodzic[bottom]):(0))-( (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]<=0))?(height_sticky+10): (((rect_rodzic[top]>=0)&&(wys-rect_rodzic[bottom]<=0))?(nie_ob+5): (((rect_rodzic[top]<=0)&&(wys-rect_rodzic[bottom]>=0))?(height_sticky+5):0) ) ) ))+"px"; //element_f.style.overflow="auto"; }); ScrollBarOverflow(); element_g.style.display="block"; } var position=window.getComputedStyle(element_g, null).getPropertyValue("position"); if(position!="absolute"){return;} var sticky_x=$(element_g).hasClass('mw-sticky-x'); if(sticky_x){ FunStickyXY("left","right","width"); } var sticky_y=$(element_g).hasClass('mw-sticky-y'); if(sticky_y){ FunStickyXY("top","bottom","height"); } }); } $(StickyXY); $(window).on('scroll', StickyXY); /*Uruchamianie dodatkowych zdarzeń do StickyXY*/ function StickyXYBeginEnd(){ $("*.mw-sticky-x, *.mw-sticky-y").on('mouseover',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('mouseout',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionstart',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionrun',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitioncancel',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('transitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('webkittransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('moztransitionend',StickyXY); $("*.mw-sticky-x, *.mw-sticky-y").on('otransitionend',StickyXY); }; $(StickyXYBeginEnd); /*Koniec dodatkowych zdarzeń*/ /*Uruchamianie dodatkowych funkcji, niż standardowe, w href w linkach rozwijanej tabeli TABLE lub ramki DIV, jeśli ona generuje zwiększenie rozmiarów, aby w rodzicu pojawił się pasek przewijania, z dodatkowymi opcjami generowanej przez arkusz kalkulacyjny CSS*/ function RamkiTableIDiv(obiekt,id_tabeli_lub_ramki,id_nazwa_a,fun_obiektu){ $(obiekt).each(function(i,element_f){ return new Promise(function(resolve,reject){ var czas=0; function Czekaj(){ if(czas>30000){ reject(); } var collapsebutton=$(element_f).find('a#'+id_nazwa_a+i); if((collapsebutton!==null)&&(collapsebutton.length>0)){ var tabele_lub_ramki=collapsebutton.parents('#'+id_tabeli_lub_ramki+i); if((tabele_lub_ramki===null)||(tabele_lub_ramki.length==0)){reject();} resolve(i); }else{ czas+=100; setTimeout(Czekaj,100); } } Czekaj(); }).then(function(i){ $('*.mw-overflow-x a#'+id_nazwa_a+i+', *.mw-overflow-y a#'+id_nazwa_a+i).each(function(j,element_g){ var href=element_g.getAttribute('href'); if((href!=null)&&(href!="")){ var col="[\\s;\\(\\,]*javascript:"+fun_obiektu+"\\s*\\(\\s*"+i+"\\s*\\)[\\s;\\)\\,]*"; var re_frame = new RegExp(col,'g'); var re_javascript=new RegExp("^[\\s;]*javascript:"); if((re_javascript.test(href))&&(re_frame.test(href))){ element_g.setAttribute('href',href.replace(/[;\s]*$/g,"")+';javascript:ScrollBarOverflow();javascript:StickyXY();') } } }); }); }); }; /*Dla menu rozwijanego tabeli TABLE zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("table.collapsible",'collapsibleTable','collapseButton','collapseTable'); /*Dla menu rozwijanej ramki DIV zdefiniowanej na stronie MediaWiki:Common.js*/ RamkiTableIDiv("div.NavFrame",'NavFrame','NavToggle','toggleNavigationBar'); /*Koniec dodatkowych funkcji*/ 659mrpnkszjekef48t569ikcswmv4dv