Plugin Directory

Changeset 3665758


Ignore:
Timestamp:
08/25/2026 05:27:29 PM (2 months ago)
Author:
hesapis
Message:

2.4.7: make accent_color and bg_secondary_color work; rewrite ticker scrolling; add margin option

Location:
hesapis-market-data-gold-currency-crypto-prices
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hesapis-market-data-gold-currency-crypto-prices/tags/2.4.7/hesapis-market-data.php

    r3665637 r3665758  
    44 * Plugin URI: https://www.hesapis.com/api/
    55 * Description: Real-time gold prices, currency exchange rates, and cryptocurrency data widgets. Display financial market data with beautiful, customizable widgets.
    6  * Version: 2.4.3
     6 * Version: 2.4.7
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
    … …  
    2323
    2424// Plugin sabitleri
    25 define( 'HESAPIS_VERSION', '2.4.3' );
     25define( 'HESAPIS_VERSION', '2.4.7' );
    2626define( 'HESAPIS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2727define( 'HESAPIS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • hesapis-market-data-gold-currency-crypto-prices/tags/2.4.7/includes/class-hesapis-shortcodes.php

    r3665637 r3665758  
    380380            'font_size'            => '',
    381381            'padding'              => '',
     382            // Seridin ALTINDAKI bosluk. Basligin hemen altina koyan
     383            // kullanicilarda tema widget kabi genelde 30-40px alt bosluk
     384            // ekliyor ve serit icerikten kopuk duruyor; margin="0" ile
     385            // kapatilabilsin diye acildi.
     386            'margin'               => '',
    382387            // DIKKAT: varsayilan 'normal' OLAMAZ. Oyle olursa
    383388            // get_scroll_duration() her zaman 30s kademesine duser ve
    … …  
    898903        }
    899904
     905        // Alt bosluk: "0" gecerli bir deger oldugu icin empty() ile
     906        // kontrol EDILEMEZ - empty('0') true doner ve kullanicinin
     907        // "bosluk istemiyorum" istegi sessizce yok sayilirdi.
     908        if ( isset( $atts['margin'] ) && '' !== trim( (string) $atts['margin'] ) ) {
     909            $bosluk   = trim( (string) $atts['margin'] );
     910            $bosluk   = is_numeric( $bosluk ) ? $bosluk . 'px' : $bosluk;
     911            $styles[] = '--hesapis-margin: ' . esc_attr( $bosluk );
     912        }
     913
    900914        if ( empty( $styles ) ) {
    901915            return '';
  • hesapis-market-data-gold-currency-crypto-prices/tags/2.4.7/public/css/hesapis-style.css

    r3665637 r3665758  
    6666
    6767.hesapis-card {
    68     background: var(--hesapis-bg);
     68    background: var(--hesapis-card-bg, var(--hesapis-bg));
    6969    border: 1px solid var(--hesapis-border);
    7070    border-radius: var(--hesapis-radius);
    … …  
    216216
    217217.hesapis-table th {
    218     background: var(--hesapis-divider);
     218    background: var(--hesapis-bg-secondary, var(--hesapis-divider));
    219219    color: var(--hesapis-muted);
    220220    font-weight: 600;
    … …  
    399399   ============================================ */
    400400.hesapis-ticker {
     401    /* Alt bosluk kisa koddan ayarlanabilir; varsayilan 0 cunku serit
     402       genelde baska bir kabin (widget alani) icinde duruyor ve o kap
     403       zaten kendi boslugunu veriyor. */
     404    margin-bottom: var(--hesapis-margin, 0);
    401405    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    402406    border-radius: var(--hesapis-radius);
    … …  
    436440}
    437441
    438 .hesapis-ticker-track::before,
    439 .hesapis-ticker-track::after {
     442.hesapis-ticker::before,
     443.hesapis-ticker::after {
    440444    content: '';
    441445    position: absolute;
    … …  
    447451}
    448452
    449 .hesapis-ticker-track::before {
     453.hesapis-ticker::before {
    450454    left: 0;
    451455    background: linear-gradient(90deg, var(--hesapis-bg, #0f172a), transparent);
    452456}
    453457
    454 .hesapis-ticker-track::after {
     458.hesapis-ticker::after {
    455459    right: 0;
    456460    background: linear-gradient(-90deg, var(--hesapis-bg, #1e293b), transparent);
    … …  
    459463.hesapis-ticker-content {
    460464    display: flex;
    461     animation: hesapis-scroll var(--hesapis-duration, 30s) linear infinite;
     465    /* CSS animasyonu KALDIRILDI.
     466       Animasyon transform ile, elle kaydirma scrollLeft ile calisiyordu:
     467       iki ayri koordinat sistemi ayni anda hareket edince hizalama tutmuyor
     468       ve serit bos alana kayabiliyordu. Artik ikisi de scrollLeft uzerinden
     469       yurutuluyor (hesapis-script.js), boylece cakisacak iki sistem yok.
     470       JS calismazsa serit durur ama okunabilir ve elle kaydirilabilir kalir. */
    462471    padding: var(--hesapis-padding, 12px) 0;
    463 }
    464 
    465 .hesapis-ticker:hover .hesapis-ticker-content {
    466     animation-play-state: paused;
    467 }
     472    /* transform ile yapilan hareket TASMA OLUSTURMAZ; kap
     473       overflow-x:auto olsa bile kaydirilacak alan dogmaz. Icerige
     474       gercek genislik verince serit fiilen tasiyor ve parmakla
     475       kaydirilabiliyor. */
     476    width: max-content;
     477}
     478
     479/* Duraklatma artik JS tarafinda (rAF dongusu durduruluyor). */
    468480
    469481@keyframes hesapis-scroll {
    … …  
    474486.hesapis-ticker-item {
    475487    display: inline-flex;
     488    flex-shrink: 0;
    476489    align-items: center;
    477490    gap: 8px;
    … …  
    785798    animation: hesapis-scroll var(--hesapis-duration, 25s) linear infinite;
    786799    white-space: nowrap;
     800    /* Seritte oldugu gibi: transform tasma olusturmadigi icin elle
     801       kaydirma calismaz; gercek genislik sart. */
     802    width: max-content;
     803}
     804
     805.hesapis-marquee-item {
     806    flex-shrink: 0;
    787807}
    788808
    … …  
    11021122    }
    11031123}
     1124
     1125/* ============================================
     1126   Vurgu rengi (accent_color)
     1127   ============================================
     1128   --hesapis-accent ve --hesapis-primary :root'ta TANIMLIYDI ama hicbir
     1129   kural okumuyordu; yani kisa koddaki accent_color parametresi
     1130   belgelenmis olmasina ragmen hicbir sey yapmiyordu. Vurgu artik
     1131   baslik altindaki cizgide ve secili/one cikan ogelerde kullaniliyor. */
     1132.hesapis-widget .hesapis-header{
     1133    border-bottom: 2px solid var(--hesapis-accent, var(--hesapis-border));
     1134}
     1135.hesapis-ticker-name{
     1136    color: var(--hesapis-accent, inherit);
     1137}
  • hesapis-market-data-gold-currency-crypto-prices/tags/2.4.7/public/js/hesapis-script.js

    r3665637 r3665758  
    322322                var $content = $ticker.find('.hesapis-ticker-content');
    323323
    324                 // İçeriği çoğalt (sonsuz scroll için)
    325                 if ($content.children().length > 0) {
    326                     $content.append($content.html());
    327                 }
     324                // Cogaltma YAPILMIYOR: PHP zaten iki kopya basiyor ve
     325                // kaydirma dongusu yarim genislikte basa sariyor.
     326                // Onceki surumde burada her init'te bir kopya daha
     327                // ekleniyordu; init otomatik yenilemede de calistigi
     328                // icin kopyalar katlaniyordu.
    328329            });
    329330        }
    … …  
    349350     * kaybolur ve hareket takilir.
    350351     */
    351     function kaydirmayiEtkinlestir() {
    352         var kaplar = document.querySelectorAll('.hesapis-ticker, .hesapis-marquee');
     352    /**
     353     * Seridi kaydirir ve parmakla surumeye izin verir.
     354     *
     355     * TEK MEKANIZMA: hem otomatik akis hem elle surukleme scrollLeft
     356     * uzerinden yurur. Onceki surumlerde akis CSS transform, surukleme
     357     * ise scrollLeft ile yapiliyordu; iki koordinat sistemi ayni anda
     358     * hareket edince hizalama bozuluyor ve serit bos alana kayiyordu.
     359     *
     360     * PHP icerigi IKI KEZ basiyor. Yarim genisligi gecince scrollLeft'i
     361     * yarim geriye aliyoruz: gorunum ayni oldugu icin sicrama fark
     362     * edilmiyor, sonsuz donguyu bu saglıyor.
     363     */
     364    function seritleriBaslat() {
     365        var kaplar = document.querySelectorAll('.hesapis-ticker');
     366        var azHareket = window.matchMedia
     367            && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    353368
    354369        Array.prototype.forEach.call(kaplar, function (kap) {
    355             if (kap.dataset.hesapisKaydirma === '1') { return; }
    356             kap.dataset.hesapisKaydirma = '1';
    357 
    358             var raf = kap.querySelector('.hesapis-ticker-track') || kap;
    359             var zamanlayici = null;
     370            if (kap.dataset.hesapisSerit === '1') { return; }
     371            kap.dataset.hesapisSerit = '1';
     372
     373            var raf = kap.querySelector('.hesapis-ticker-track');
     374            if (!raf) { return; }
     375
     376            // Sure kabin uzerindeki --hesapis-duration degiskeninden gelir;
     377            // ayarlar sayfasindaki kaydirac bu degeri yaziyor.
     378            var sure = parseFloat(
     379                getComputedStyle(kap).getPropertyValue('--hesapis-duration')
     380            ) || 30;
     381
     382            var duruyor = false;
     383            var bekleme = null;
     384            var oncekiAn = null;
    360385
    361386            function tut() {
    362                 if (zamanlayici) { clearTimeout(zamanlayici); zamanlayici = null; }
    363                 kap.classList.add('hesapis-elde');
     387                duruyor = true;
     388                if (bekleme) { clearTimeout(bekleme); bekleme = null; }
    364389            }
    365390
    366391            function birak() {
    367                 if (zamanlayici) { clearTimeout(zamanlayici); }
    368                 // Parmak kalkar kalkmaz devam ettirmek sarsintili duruyor;
    369                 // kisa bir bekleme kullaniciya okumak icin firsat veriyor.
    370                 zamanlayici = setTimeout(function () {
    371                     kap.classList.remove('hesapis-elde');
    372                     zamanlayici = null;
     392                if (bekleme) { clearTimeout(bekleme); }
     393                // Parmak kalkar kalkmaz devam etmek sarsintili duruyor.
     394                bekleme = setTimeout(function () {
     395                    duruyor = false;
     396                    oncekiAn = null;
     397                    bekleme = null;
    373398                }, 2500);
    374399            }
    … …  
    377402            raf.addEventListener('touchend', birak, { passive: true });
    378403            raf.addEventListener('touchcancel', birak, { passive: true });
    379 
    380             // Fare tekerlegiyle yatay kaydirma ve trackpad icin
    381             raf.addEventListener('scroll', function () {
    382                 tut();
    383                 birak();
    384             }, { passive: true });
     404            kap.addEventListener('mouseenter', tut);
     405            kap.addEventListener('mouseleave', birak);
     406
     407            // Isletim sisteminde "hareketi azalt" seciliyse akis hic
     408            // baslamaz; serit elle kaydirilabilir oldugu icin veri yine
     409            // erisilebilir kalir (WCAG 2.3.3).
     410            if (azHareket) { return; }
     411
     412            function adim(an) {
     413                var yarim = raf.scrollWidth / 2;
     414                if (yarim > 0 && !duruyor) {
     415                    if (oncekiAn !== null) {
     416                        // Bir tam tur = yarim genislik / sure saniye
     417                        var px = (yarim / sure) * ((an - oncekiAn) / 1000);
     418                        raf.scrollLeft += px;
     419                        if (raf.scrollLeft >= yarim) { raf.scrollLeft -= yarim; }
     420                    }
     421                    oncekiAn = an;
     422                } else {
     423                    oncekiAn = an;
     424                }
     425                requestAnimationFrame(adim);
     426            }
     427            requestAnimationFrame(adim);
    385428        });
    386429    }
    … …  
    388431    $(document).ready(function() {
    389432        HesapisWidget.init();
    390         kaydirmayiEtkinlestir();
     433        seritleriBaslat();
    391434    });
    392435
    393436    // Ajax ile yenilenen seritler icin tekrar bagla
    394     $(document).on('hesapis:refreshed', kaydirmayiEtkinlestir);
     437    $(document).on('hesapis:refreshed', seritleriBaslat);
    395438
    396439    // Global erişim için
  • hesapis-market-data-gold-currency-crypto-prices/tags/2.4.7/readme.txt

    r3665637 r3665758  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 2.4.3
     8Stable tag: 2.4.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    152152
    153153== Changelog ==
     154
     155= 2.4.7 =
     156**Fixed**
     157
     158* **`accent_color` and `bg_secondary_color` did nothing.** Both are
     159  documented shortcode attributes and both were accepted without
     160  complaint, but no stylesheet rule ever read the custom properties they
     161  set - `--hesapis-accent` and `--hesapis-primary` were declared in
     162  `:root` and never used, and `--hesapis-bg-secondary` / `--hesapis-card-bg`
     163  were not declared at all. The accent colour now drives the widget
     164  heading rule and the ticker labels; the secondary background drives
     165  table header rows and card surfaces.
     166* **The swipeable ticker from 2.4.3 did not work.** The strip was animated
     167  with a CSS transform, and transforms create no scrollable overflow, so a
     168  scrollable container had nothing to scroll. Auto-scroll and dragging now
     169  share one mechanism (`scrollLeft`), which also removes the class of bug
     170  where the two fought each other and pushed content out of view.
     171* **Ticker text sped up and vanished after a few minutes.** The script
     172  duplicated the strip's contents on every initialisation, and
     173  initialisation also runs on each auto-refresh, so copies doubled: 4, 8,
     174  16. With a fixed duration every doubling made the strip twice as fast.
     175  The markup already contains the two copies the loop needs, so the
     176  duplication was removed entirely. This affected 2.4.1 and 2.4.2 too.
     177
     178**Added**
     179
     180* **`margin` attribute for the ticker.** Themes often wrap widget areas in
     181  30-40px of bottom margin, which leaves the strip floating away from the
     182  content below it. `margin="0"` closes the gap; any CSS length works.
     183* Ticker edge fades stay pinned to the edges while the strip is scrolled.
     184
     185= 2.4.4 =
     186**Fixed**
     187
     188* **The swipeable ticker introduced in 2.4.3 did not actually work.** The
     189  strip is animated with a CSS transform, and transforms do not create
     190  scrollable overflow - so making the container scrollable had nothing to
     191  scroll. The content now carries its real width and dragging works as
     192  described.
     193* **Ticker text sped up and vanished after a few minutes.** The script
     194  duplicated the strip's contents on every initialisation, and
     195  initialisation also runs on each auto-refresh: 4 copies became 8, then
     196  16. With the animation duration fixed, every doubling made the strip
     197  twice as fast until the text was unreadable. The duplication now happens
     198  once per element. This affected 2.4.1 and 2.4.2 as well.
     199* Dragging and the animation no longer fight each other: the strip eases
     200  back to the start before the animation resumes, instead of drifting out
     201  of view.
     202* The ticker's edge fades stay pinned to the edges while you scroll.
    154203
    155204= 2.4.3 =
    … …  
    224273== Upgrade Notice ==
    225274
     275= 2.4.7 =
     276Makes accent_color and bg_secondary_color actually work, fixes the swipeable
     277ticker introduced in 2.4.3, and stops ticker text speeding up and disappearing.
     278
     279= 2.4.4 =
     280Fixes the swipeable ticker from 2.4.3, which did not work, and a long-standing
     281bug that made ticker text speed up and disappear after a few minutes.
     282
    226283= 2.4.3 =
    227284Important fix: the Settings link was broken, which prevented new users from
  • hesapis-market-data-gold-currency-crypto-prices/trunk/hesapis-market-data.php

    r3665637 r3665758  
    44 * Plugin URI: https://www.hesapis.com/api/
    55 * Description: Real-time gold prices, currency exchange rates, and cryptocurrency data widgets. Display financial market data with beautiful, customizable widgets.
    6  * Version: 2.4.3
     6 * Version: 2.4.7
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
    … …  
    2323
    2424// Plugin sabitleri
    25 define( 'HESAPIS_VERSION', '2.4.3' );
     25define( 'HESAPIS_VERSION', '2.4.7' );
    2626define( 'HESAPIS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2727define( 'HESAPIS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • hesapis-market-data-gold-currency-crypto-prices/trunk/includes/class-hesapis-shortcodes.php

    r3665637 r3665758  
    380380            'font_size'            => '',
    381381            'padding'              => '',
     382            // Seridin ALTINDAKI bosluk. Basligin hemen altina koyan
     383            // kullanicilarda tema widget kabi genelde 30-40px alt bosluk
     384            // ekliyor ve serit icerikten kopuk duruyor; margin="0" ile
     385            // kapatilabilsin diye acildi.
     386            'margin'               => '',
    382387            // DIKKAT: varsayilan 'normal' OLAMAZ. Oyle olursa
    383388            // get_scroll_duration() her zaman 30s kademesine duser ve
    … …  
    898903        }
    899904
     905        // Alt bosluk: "0" gecerli bir deger oldugu icin empty() ile
     906        // kontrol EDILEMEZ - empty('0') true doner ve kullanicinin
     907        // "bosluk istemiyorum" istegi sessizce yok sayilirdi.
     908        if ( isset( $atts['margin'] ) && '' !== trim( (string) $atts['margin'] ) ) {
     909            $bosluk   = trim( (string) $atts['margin'] );
     910            $bosluk   = is_numeric( $bosluk ) ? $bosluk . 'px' : $bosluk;
     911            $styles[] = '--hesapis-margin: ' . esc_attr( $bosluk );
     912        }
     913
    900914        if ( empty( $styles ) ) {
    901915            return '';
  • hesapis-market-data-gold-currency-crypto-prices/trunk/public/css/hesapis-style.css

    r3665637 r3665758  
    6666
    6767.hesapis-card {
    68     background: var(--hesapis-bg);
     68    background: var(--hesapis-card-bg, var(--hesapis-bg));
    6969    border: 1px solid var(--hesapis-border);
    7070    border-radius: var(--hesapis-radius);
    … …  
    216216
    217217.hesapis-table th {
    218     background: var(--hesapis-divider);
     218    background: var(--hesapis-bg-secondary, var(--hesapis-divider));
    219219    color: var(--hesapis-muted);
    220220    font-weight: 600;
    … …  
    399399   ============================================ */
    400400.hesapis-ticker {
     401    /* Alt bosluk kisa koddan ayarlanabilir; varsayilan 0 cunku serit
     402       genelde baska bir kabin (widget alani) icinde duruyor ve o kap
     403       zaten kendi boslugunu veriyor. */
     404    margin-bottom: var(--hesapis-margin, 0);
    401405    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    402406    border-radius: var(--hesapis-radius);
    … …  
    436440}
    437441
    438 .hesapis-ticker-track::before,
    439 .hesapis-ticker-track::after {
     442.hesapis-ticker::before,
     443.hesapis-ticker::after {
    440444    content: '';
    441445    position: absolute;
    … …  
    447451}
    448452
    449 .hesapis-ticker-track::before {
     453.hesapis-ticker::before {
    450454    left: 0;
    451455    background: linear-gradient(90deg, var(--hesapis-bg, #0f172a), transparent);
    452456}
    453457
    454 .hesapis-ticker-track::after {
     458.hesapis-ticker::after {
    455459    right: 0;
    456460    background: linear-gradient(-90deg, var(--hesapis-bg, #1e293b), transparent);
    … …  
    459463.hesapis-ticker-content {
    460464    display: flex;
    461     animation: hesapis-scroll var(--hesapis-duration, 30s) linear infinite;
     465    /* CSS animasyonu KALDIRILDI.
     466       Animasyon transform ile, elle kaydirma scrollLeft ile calisiyordu:
     467       iki ayri koordinat sistemi ayni anda hareket edince hizalama tutmuyor
     468       ve serit bos alana kayabiliyordu. Artik ikisi de scrollLeft uzerinden
     469       yurutuluyor (hesapis-script.js), boylece cakisacak iki sistem yok.
     470       JS calismazsa serit durur ama okunabilir ve elle kaydirilabilir kalir. */
    462471    padding: var(--hesapis-padding, 12px) 0;
    463 }
    464 
    465 .hesapis-ticker:hover .hesapis-ticker-content {
    466     animation-play-state: paused;
    467 }
     472    /* transform ile yapilan hareket TASMA OLUSTURMAZ; kap
     473       overflow-x:auto olsa bile kaydirilacak alan dogmaz. Icerige
     474       gercek genislik verince serit fiilen tasiyor ve parmakla
     475       kaydirilabiliyor. */
     476    width: max-content;
     477}
     478
     479/* Duraklatma artik JS tarafinda (rAF dongusu durduruluyor). */
    468480
    469481@keyframes hesapis-scroll {
    … …  
    474486.hesapis-ticker-item {
    475487    display: inline-flex;
     488    flex-shrink: 0;
    476489    align-items: center;
    477490    gap: 8px;
    … …  
    785798    animation: hesapis-scroll var(--hesapis-duration, 25s) linear infinite;
    786799    white-space: nowrap;
     800    /* Seritte oldugu gibi: transform tasma olusturmadigi icin elle
     801       kaydirma calismaz; gercek genislik sart. */
     802    width: max-content;
     803}
     804
     805.hesapis-marquee-item {
     806    flex-shrink: 0;
    787807}
    788808
    … …  
    11021122    }
    11031123}
     1124
     1125/* ============================================
     1126   Vurgu rengi (accent_color)
     1127   ============================================
     1128   --hesapis-accent ve --hesapis-primary :root'ta TANIMLIYDI ama hicbir
     1129   kural okumuyordu; yani kisa koddaki accent_color parametresi
     1130   belgelenmis olmasina ragmen hicbir sey yapmiyordu. Vurgu artik
     1131   baslik altindaki cizgide ve secili/one cikan ogelerde kullaniliyor. */
     1132.hesapis-widget .hesapis-header{
     1133    border-bottom: 2px solid var(--hesapis-accent, var(--hesapis-border));
     1134}
     1135.hesapis-ticker-name{
     1136    color: var(--hesapis-accent, inherit);
     1137}
  • hesapis-market-data-gold-currency-crypto-prices/trunk/public/js/hesapis-script.js

    r3665637 r3665758  
    322322                var $content = $ticker.find('.hesapis-ticker-content');
    323323
    324                 // İçeriği çoğalt (sonsuz scroll için)
    325                 if ($content.children().length > 0) {
    326                     $content.append($content.html());
    327                 }
     324                // Cogaltma YAPILMIYOR: PHP zaten iki kopya basiyor ve
     325                // kaydirma dongusu yarim genislikte basa sariyor.
     326                // Onceki surumde burada her init'te bir kopya daha
     327                // ekleniyordu; init otomatik yenilemede de calistigi
     328                // icin kopyalar katlaniyordu.
    328329            });
    329330        }
    … …  
    349350     * kaybolur ve hareket takilir.
    350351     */
    351     function kaydirmayiEtkinlestir() {
    352         var kaplar = document.querySelectorAll('.hesapis-ticker, .hesapis-marquee');
     352    /**
     353     * Seridi kaydirir ve parmakla surumeye izin verir.
     354     *
     355     * TEK MEKANIZMA: hem otomatik akis hem elle surukleme scrollLeft
     356     * uzerinden yurur. Onceki surumlerde akis CSS transform, surukleme
     357     * ise scrollLeft ile yapiliyordu; iki koordinat sistemi ayni anda
     358     * hareket edince hizalama bozuluyor ve serit bos alana kayiyordu.
     359     *
     360     * PHP icerigi IKI KEZ basiyor. Yarim genisligi gecince scrollLeft'i
     361     * yarim geriye aliyoruz: gorunum ayni oldugu icin sicrama fark
     362     * edilmiyor, sonsuz donguyu bu saglıyor.
     363     */
     364    function seritleriBaslat() {
     365        var kaplar = document.querySelectorAll('.hesapis-ticker');
     366        var azHareket = window.matchMedia
     367            && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    353368
    354369        Array.prototype.forEach.call(kaplar, function (kap) {
    355             if (kap.dataset.hesapisKaydirma === '1') { return; }
    356             kap.dataset.hesapisKaydirma = '1';
    357 
    358             var raf = kap.querySelector('.hesapis-ticker-track') || kap;
    359             var zamanlayici = null;
     370            if (kap.dataset.hesapisSerit === '1') { return; }
     371            kap.dataset.hesapisSerit = '1';
     372
     373            var raf = kap.querySelector('.hesapis-ticker-track');
     374            if (!raf) { return; }
     375
     376            // Sure kabin uzerindeki --hesapis-duration degiskeninden gelir;
     377            // ayarlar sayfasindaki kaydirac bu degeri yaziyor.
     378            var sure = parseFloat(
     379                getComputedStyle(kap).getPropertyValue('--hesapis-duration')
     380            ) || 30;
     381
     382            var duruyor = false;
     383            var bekleme = null;
     384            var oncekiAn = null;
    360385
    361386            function tut() {
    362                 if (zamanlayici) { clearTimeout(zamanlayici); zamanlayici = null; }
    363                 kap.classList.add('hesapis-elde');
     387                duruyor = true;
     388                if (bekleme) { clearTimeout(bekleme); bekleme = null; }
    364389            }
    365390
    366391            function birak() {
    367                 if (zamanlayici) { clearTimeout(zamanlayici); }
    368                 // Parmak kalkar kalkmaz devam ettirmek sarsintili duruyor;
    369                 // kisa bir bekleme kullaniciya okumak icin firsat veriyor.
    370                 zamanlayici = setTimeout(function () {
    371                     kap.classList.remove('hesapis-elde');
    372                     zamanlayici = null;
     392                if (bekleme) { clearTimeout(bekleme); }
     393                // Parmak kalkar kalkmaz devam etmek sarsintili duruyor.
     394                bekleme = setTimeout(function () {
     395                    duruyor = false;
     396                    oncekiAn = null;
     397                    bekleme = null;
    373398                }, 2500);
    374399            }
    … …  
    377402            raf.addEventListener('touchend', birak, { passive: true });
    378403            raf.addEventListener('touchcancel', birak, { passive: true });
    379 
    380             // Fare tekerlegiyle yatay kaydirma ve trackpad icin
    381             raf.addEventListener('scroll', function () {
    382                 tut();
    383                 birak();
    384             }, { passive: true });
     404            kap.addEventListener('mouseenter', tut);
     405            kap.addEventListener('mouseleave', birak);
     406
     407            // Isletim sisteminde "hareketi azalt" seciliyse akis hic
     408            // baslamaz; serit elle kaydirilabilir oldugu icin veri yine
     409            // erisilebilir kalir (WCAG 2.3.3).
     410            if (azHareket) { return; }
     411
     412            function adim(an) {
     413                var yarim = raf.scrollWidth / 2;
     414                if (yarim > 0 && !duruyor) {
     415                    if (oncekiAn !== null) {
     416                        // Bir tam tur = yarim genislik / sure saniye
     417                        var px = (yarim / sure) * ((an - oncekiAn) / 1000);
     418                        raf.scrollLeft += px;
     419                        if (raf.scrollLeft >= yarim) { raf.scrollLeft -= yarim; }
     420                    }
     421                    oncekiAn = an;
     422                } else {
     423                    oncekiAn = an;
     424                }
     425                requestAnimationFrame(adim);
     426            }
     427            requestAnimationFrame(adim);
    385428        });
    386429    }
    … …  
    388431    $(document).ready(function() {
    389432        HesapisWidget.init();
    390         kaydirmayiEtkinlestir();
     433        seritleriBaslat();
    391434    });
    392435
    393436    // Ajax ile yenilenen seritler icin tekrar bagla
    394     $(document).on('hesapis:refreshed', kaydirmayiEtkinlestir);
     437    $(document).on('hesapis:refreshed', seritleriBaslat);
    395438
    396439    // Global erişim için
  • hesapis-market-data-gold-currency-crypto-prices/trunk/readme.txt

    r3665637 r3665758  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 2.4.3
     8Stable tag: 2.4.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    152152
    153153== Changelog ==
     154
     155= 2.4.7 =
     156**Fixed**
     157
     158* **`accent_color` and `bg_secondary_color` did nothing.** Both are
     159  documented shortcode attributes and both were accepted without
     160  complaint, but no stylesheet rule ever read the custom properties they
     161  set - `--hesapis-accent` and `--hesapis-primary` were declared in
     162  `:root` and never used, and `--hesapis-bg-secondary` / `--hesapis-card-bg`
     163  were not declared at all. The accent colour now drives the widget
     164  heading rule and the ticker labels; the secondary background drives
     165  table header rows and card surfaces.
     166* **The swipeable ticker from 2.4.3 did not work.** The strip was animated
     167  with a CSS transform, and transforms create no scrollable overflow, so a
     168  scrollable container had nothing to scroll. Auto-scroll and dragging now
     169  share one mechanism (`scrollLeft`), which also removes the class of bug
     170  where the two fought each other and pushed content out of view.
     171* **Ticker text sped up and vanished after a few minutes.** The script
     172  duplicated the strip's contents on every initialisation, and
     173  initialisation also runs on each auto-refresh, so copies doubled: 4, 8,
     174  16. With a fixed duration every doubling made the strip twice as fast.
     175  The markup already contains the two copies the loop needs, so the
     176  duplication was removed entirely. This affected 2.4.1 and 2.4.2 too.
     177
     178**Added**
     179
     180* **`margin` attribute for the ticker.** Themes often wrap widget areas in
     181  30-40px of bottom margin, which leaves the strip floating away from the
     182  content below it. `margin="0"` closes the gap; any CSS length works.
     183* Ticker edge fades stay pinned to the edges while the strip is scrolled.
     184
     185= 2.4.4 =
     186**Fixed**
     187
     188* **The swipeable ticker introduced in 2.4.3 did not actually work.** The
     189  strip is animated with a CSS transform, and transforms do not create
     190  scrollable overflow - so making the container scrollable had nothing to
     191  scroll. The content now carries its real width and dragging works as
     192  described.
     193* **Ticker text sped up and vanished after a few minutes.** The script
     194  duplicated the strip's contents on every initialisation, and
     195  initialisation also runs on each auto-refresh: 4 copies became 8, then
     196  16. With the animation duration fixed, every doubling made the strip
     197  twice as fast until the text was unreadable. The duplication now happens
     198  once per element. This affected 2.4.1 and 2.4.2 as well.
     199* Dragging and the animation no longer fight each other: the strip eases
     200  back to the start before the animation resumes, instead of drifting out
     201  of view.
     202* The ticker's edge fades stay pinned to the edges while you scroll.
    154203
    155204= 2.4.3 =
    … …  
    224273== Upgrade Notice ==
    225274
     275= 2.4.7 =
     276Makes accent_color and bg_secondary_color actually work, fixes the swipeable
     277ticker introduced in 2.4.3, and stops ticker text speeding up and disappearing.
     278
     279= 2.4.4 =
     280Fixes the swipeable ticker from 2.4.3, which did not work, and a long-standing
     281bug that made ticker text speed up and disappear after a few minutes.
     282
    226283= 2.4.3 =
    227284Important fix: the Settings link was broken, which prevented new users from
Note: See TracChangeset for help on using the changeset viewer.