Plugin Directory

Changeset 3333304


Ignore:
Timestamp:
07/24/2025 06:26:52 AM (8 months ago)
Author:
creativform
Message:

2.3.6

  • Bugfix on _load_textdomain_just_in_time
  • Improved Script Selector in the Blocks
  • BUgfix on the UTF-8 encoding
Location:
serbian-transliteration
Files:
146 added
10 edited

Legend:

Unmodified
Added
Removed
  • serbian-transliteration/trunk/CHANGELOG.txt

    r3332175 r3333304  
     1= 2.3.6 =
     2* Bugfix on _load_textdomain_just_in_time
     3* Improved Script Selector in the Blocks
     4* BUgfix on the UTF-8 encoding
     5
    16= 2.3.5 =
    27* Fixed bugs on requests
  • serbian-transliteration/trunk/assets/css/script-selector-block-editor.css

    r3332175 r3333304  
     1.rstr-block-editor-container {
     2    padding: 15px;
     3}
    14.rstr-block-editor-container,
    25.rstr-block-editor-container > .rstr-block-editor-fieldgroup,
    36.rstr-block-editor-container > .rstr-block-editor-fieldgroup input,
    4 .rstr-block-editor-container > .rstr-block-editor-fieldgroup select{
     7.rstr-block-editor-container > .rstr-block-editor-fieldgroup select {
    58    display: block;
    69}
    710
    8 .rstr-block-editor-container > .rstr-block-editor-fieldgroup{
    9    
     11.rstr-block-editor-container > .rstr-block-editor-fieldgroup + .rstr-block-editor-fieldgroup {
     12    margin-top:15px;
    1013}
    1114
    1215.rstr-block-editor-container > .rstr-block-editor-fieldgroup input,
    13 .rstr-block-editor-container > .rstr-block-editor-fieldgroup select{
     16.rstr-block-editor-container > .rstr-block-editor-fieldgroup select {
    1417    width: 100%;
    1518    max-width: 100%;
  • serbian-transliteration/trunk/assets/css/script-selector-block-editor.min.css

    r3332175 r3333304  
     1.rstr-block-editor-container{padding:15px}.rstr-block-editor-container,.rstr-block-editor-container>.rstr-block-editor-fieldgroup,.rstr-block-editor-container>.rstr-block-editor-fieldgroup input,.rstr-block-editor-container>.rstr-block-editor-fieldgroup select{display:block}.rstr-block-editor-container>.rstr-block-editor-fieldgroup+.rstr-block-editor-fieldgroup{margin-top:15px}.rstr-block-editor-container>.rstr-block-editor-fieldgroup input,.rstr-block-editor-container>.rstr-block-editor-fieldgroup select{width:100%;max-width:100%;padding:5px 10px}
  • serbian-transliteration/trunk/assets/js/script-selector-block.js

    r3332175 r3333304  
    11( function( blocks, element ) {
    22    const el = element.createElement;
     3    const c = {
     4        label: 'rstr-block-editor-label',
     5        fieldgroup: 'rstr-block-editor-fieldgroup'
     6    };
    37
    48    blocks.registerBlockType( 'serbian-transliteration/script-selector', {
     
    2024                [
    2125                    // Script selector
    22                     el( 'div', {className: 'rstr-block-editor-fieldgroup'},
     26                    el( 'div', {className: c.fieldgroup},
    2327                        el(
    2428                            'label',
    2529                            {
    26                                 className: 'rstr-block-editor-label select',
     30                                className: c.label + ' select',
    2731                                for: 'rstr-block-editor-select-script'
    2832                            },
     
    4549                    ),
    4650                    // Conditional separator field (for 'inline')
    47                     props.attributes.displayType === 'inline' && el( 'div', {className: 'rstr-block-editor-fieldgroup'},
    48                         el( 'label', {}, rstr_block_settings.labels.separator ),
     51                    props.attributes.displayType === 'inline' && el( 'div', {className: c.fieldgroup},
     52                        el( 'label', {
     53                                className: c.label + ' input',
     54                                for: 'rstr-block-editor-input-separator'
     55                            }, rstr_block_settings.labels.separator ),
    4956                        el( 'input', {
    5057                            type: 'text',
     
    5360                                props.setAttributes( { separator: e.target.value } );
    5461                            },
     62                            id: 'rstr-block-editor-input-separator'
    5563                        } )
    5664                    ),
    5765
    5866                    // Cyrillic caption input
    59                     el( 'div', {className: 'rstr-block-editor-fieldgroup'},
    60                         el( 'label', {}, rstr_block_settings.labels.cyrillic_caption ),
     67                    el( 'div', {className: c.fieldgroup},
     68                        el( 'label', {
     69                                className: c.label + ' input',
     70                                for: 'rstr-block-editor-input-cyr-caption'
     71                            }, rstr_block_settings.labels.cyrillic_caption ),
    6172                        el( 'input', {
    6273                            type: 'text',
     
    6576                                props.setAttributes( { cyr_caption: e.target.value } );
    6677                            },
     78                            id: 'rstr-block-editor-input-cyr-caption'
    6779                        } )
    6880                    ),
    6981
    7082                    // Latin caption input
    71                     el( 'div', {className: 'rstr-block-editor-fieldgroup'},
    72                         el( 'label', {}, rstr_block_settings.labels.latin_caption ),
     83                    el( 'div', {className: c.fieldgroup},
     84                        el( 'label', {
     85                                className: c.label + ' input',
     86                                for: 'rstr-block-editor-input-lat-caption'
     87                            }, rstr_block_settings.labels.latin_caption ),
    7388                        el( 'input', {
    7489                            type: 'text',
     
    7792                                props.setAttributes( { lat_caption: e.target.value } );
    7893                            },
     94                            id: 'rstr-block-editor-input-lat-caption'
    7995                        } )
    8096                    )
  • serbian-transliteration/trunk/assets/js/script-selector-block.min.js

    r3332175 r3333304  
    1 !function(t,e){const s=window.wp.element.createElement;t.registerBlockType("serbian-transliteration/script-selector",{title:rstr_block_settings.labels.script_selector.title,icon:"translation",category:"widgets",attributes:{displayType:{type:"string",default:"inline"},separator:{type:"string",default:"|"},cyr_caption:{type:"string",default:rstr_block_settings.labels.cyrillic},lat_caption:{type:"string",default:rstr_block_settings.labels.latin}},edit:function(t){return s("div",{className:"rstr-block-editor-container"},[s("label",{className:"rstr-block-editor-label select",for:"rstr-block-editor-select-script"},rstr_block_settings.labels.display_type),s("select",{id:"rstr-block-editor-select-script",value:t.attributes.displayType,onChange:function(e){t.setAttributes({displayType:e.target.value})}},s("option",{value:"inline"},rstr_block_settings.labels.script_selector.option[0]),s("option",{value:"select"},rstr_block_settings.labels.script_selector.option[1]),s("option",{value:"list"},rstr_block_settings.labels.script_selector.option[2]),s("option",{value:"list_items"},rstr_block_settings.labels.script_selector.option[3])),"inline"===t.attributes.displayType&&s("div",{},s("label",{},rstr_block_settings.labels.separator),s("input",{type:"text",value:t.attributes.separator,onChange:function(e){t.setAttributes({separator:e.target.value})}})),s("div",{},s("label",{},rstr_block_settings.labels.cyrillic_caption),s("input",{type:"text",value:t.attributes.cyr_caption,onChange:function(e){t.setAttributes({cyr_caption:e.target.value})}})),s("div",{},s("label",{},rstr_block_settings.labels.latin_caption),s("input",{type:"text",value:t.attributes.lat_caption,onChange:function(e){t.setAttributes({lat_caption:e.target.value})}}))])},save:function(){return null}})}(window.wp.blocks);
     1!function(t,e){const s=window.wp.element.createElement,i="rstr-block-editor-label",r="rstr-block-editor-fieldgroup";t.registerBlockType("serbian-transliteration/script-selector",{title:rstr_block_settings.labels.script_selector.title,icon:"translation",category:"widgets",attributes:{displayType:{type:"string",default:"inline"},separator:{type:"string",default:"|"},cyr_caption:{type:"string",default:rstr_block_settings.labels.cyrillic},lat_caption:{type:"string",default:rstr_block_settings.labels.latin}},edit:function(t){return s("div",{className:"rstr-block-editor-container"},[s("div",{className:r},s("label",{className:i+" select",for:"rstr-block-editor-select-script"},rstr_block_settings.labels.display_type),s("select",{id:"rstr-block-editor-select-script",value:t.attributes.displayType,onChange:function(e){t.setAttributes({displayType:e.target.value})}},s("option",{value:"inline"},rstr_block_settings.labels.script_selector.option[0]),s("option",{value:"select"},rstr_block_settings.labels.script_selector.option[1]),s("option",{value:"list"},rstr_block_settings.labels.script_selector.option[2]),s("option",{value:"list_items"},rstr_block_settings.labels.script_selector.option[3]))),"inline"===t.attributes.displayType&&s("div",{className:r},s("label",{className:i+" input",for:"rstr-block-editor-input-separator"},rstr_block_settings.labels.separator),s("input",{type:"text",value:t.attributes.separator,onChange:function(e){t.setAttributes({separator:e.target.value})},id:"rstr-block-editor-input-separator"})),s("div",{className:r},s("label",{className:i+" input",for:"rstr-block-editor-input-cyr-caption"},rstr_block_settings.labels.cyrillic_caption),s("input",{type:"text",value:t.attributes.cyr_caption,onChange:function(e){t.setAttributes({cyr_caption:e.target.value})},id:"rstr-block-editor-input-cyr-caption"})),s("div",{className:r},s("label",{className:i+" input",for:"rstr-block-editor-input-lat-caption"},rstr_block_settings.labels.latin_caption),s("input",{type:"text",value:t.attributes.lat_caption,onChange:function(e){t.setAttributes({lat_caption:e.target.value})},id:"rstr-block-editor-input-lat-caption"}))])},save:function(){return null}})}(window.wp.blocks);
  • serbian-transliteration/trunk/classes/blocks.php

    r3332175 r3333304  
    77class Transliteration_Blocks extends Transliteration
    88{
     9    private $lat;
     10    private $cyr;
     11   
    912    public function __construct()
    1013    {
    1114        $this->add_action('init', 'register_script_selector_block');
    12         $this->lat = '{cyr_to_lat}' . _x('Latin', 'Block Editor: Script selector', 'serbian-transliteration') . '{/cyr_to_lat}';
    13         $this->cyr = '{lat_to_cyr}' . _x('Cyrillic', 'Block Editor: Script selector', 'serbian-transliteration') . '{/lat_to_cyr}';
    1415    }
     16   
     17    private function load_titles() {
     18        if(!$this->lat) {
     19            $this->lat = '{cyr_to_lat}' . _x('Latin', 'Block Editor: Script selector', 'serbian-transliteration') . '{/cyr_to_lat}';
     20        }
     21        if(!$this->cyr) {
     22            $this->cyr = '{lat_to_cyr}' . _x('Cyrillic', 'Block Editor: Script selector', 'serbian-transliteration') . '{/lat_to_cyr}';
     23        }
     24    }
    1525
    1626    public function register_script_selector_block(): void
    1727    {
     28        $this->load_titles();
     29       
    1830        $min = defined('RSTR_DEV_MODE') && RSTR_DEV_MODE ? '' : '.min';
    1931
     
    8294    public function render_script_selector_block($attributes): string
    8395    {
     96        $this->load_titles();
     97   
    8498        $display_type = isset($attributes['displayType']) ? $attributes['displayType'] : 'inline';
    8599
  • serbian-transliteration/trunk/classes/controller.php

    r3332175 r3333304  
    722722        libxml_use_internal_errors(true);
    723723        $html = '<?xml encoding="UTF-8">' . $html; // UTF-8 deklaracija OBAVEZNA!
    724         $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
     724       
     725        // $html = htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
     726       
    725727        $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
     728        $dom->encoding = 'UTF-8';
    726729        libxml_clear_errors();
    727730
  • serbian-transliteration/trunk/classes/maps/sr_RS.php

    r3328833 r3333304  
    7676        'Ч' => 'Č', 'ч' => 'č',
    7777        'Ш' => 'Š', 'ш' => 'š',
     78        'Ѕ' => 'Dz', 'ѕ' => 'dz',
    7879    ];
    7980
     
    106107                // Add digraph priority
    107108                $custom = [
     109                    'DZ' => 'Ѕ',
    108110                    'DŽ' => 'Џ', 'Dž' => 'Џ', 'dž' => 'џ',
    109111                    'LJ' => 'Љ', 'Lj' => 'Љ', 'lj' => 'љ',
  • serbian-transliteration/trunk/readme.txt

    r3332175 r3333304  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 2.3.5
     7Stable tag: 2.3.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    8989
    9090== Changelog ==
     91
     92= 2.3.6 =
     93* Bugfix on _load_textdomain_just_in_time
     94* Improved Script Selector in the Blocks
     95* BUgfix on the UTF-8 encoding
    9196
    9297= 2.3.5 =
     
    248253
    249254== Upgrade Notice ==
     255
     256= 2.3.6 =
     257* Bugfix on _load_textdomain_just_in_time
     258* Improved Script Selector in the Blocks
     259* BUgfix on the UTF-8 encoding
    250260
    251261= 2.3.5 =
  • serbian-transliteration/trunk/serbian-transliteration.php

    r3332175 r3333304  
    55 * Plugin URI:        https://wordpress.org/plugins/serbian-transliteration/
    66 * Description:       All-in-one Cyrillic to Latin transliteration plugin for WordPress. Supports Slavic, Arabic, Greek, and Central Asian scripts.
    7  * Version:           2.3.5
     7 * Version:           2.3.6
    88 * Requires at least: 5.4
    99 * Tested up to:      6.8
Note: See TracChangeset for help on using the changeset viewer.