• Resolved Senri Miura

    (@senribb)


    Currently, when you select the jQuery version as “WordPress default” in the jQuery Migrate settings, Transposh’s translation edit mode does not work.
    So, I tried to modify Transposh’s jQuery program from legacy 1.12.4 to jQuery 3.x as follows, but it doesn’t work. Maybe there’s a problem with the core of WordPress 5.6, but I’m not sure.
    I would like to receive a professor from someone who has any other hints.

    If there is no patch for Transposh as it is, “jQuery Migrate” will be abolished in the release of WordPress 5.7 (jQuery 3.5.1), and Transposh may not work completely, so I would like to ask the author for support.

    ◇ transposh.js

    c(“.”+r+”setdeflang”).click(function(){return c.ajax({url:t_jp.ajaxurl
     ↓
    c(“.”+r+”setdeflang”).on(“click”,function(){return c.ajax({url:t_jp.ajaxurl

    ◇ jquery.ui.menu.js

    .bind → .on
    .unbind → .off

    removeAttr → ???

    ◇ admin/contexthelp.js

    !function(l){l(“.tp_help”).live(“click”,function(e){e.preventDefault(),window.scrollTo(0,0),l(“#tab-link-“+jQuery(this).attr(“rel”)+” a”).trigger(“click”),l(“#contextual-help-link”).hasClass(“screen-meta-active”)||l(“#contextual-help-link”).trigger(“click”)})}(jQuery);
    //# sourceMappingURL=contexthelp.js.map
     ↓
    !function(l){l(document).on(‘click’,’.tp_help’,function(e){e.preventDefault(),window.scrollTo(0,0),l(“#tab-link-“+jQuery(this).attr(“rel”)+” a”).trigger(“click”),l(“#contextual-help-link”).hasClass(“screen-meta-active”)||l(“#contextual-help-link”).trigger(“click”)})}(jQuery);
    //# sourceMappingURL=contexthelp.js.map

    ◇ admin/languages.js

    i(this).click(clickfunction)})}}),
     ↓
    i(this).on(“click”,clickfunction)})}}),
    etc.,

    ◇ admin/contexthelp.js.map

    $(‘.tp_help’).live(‘click’, function (event) {\n
     ↓
    $(document).on(‘click’, ‘.tp_help’, function (event) {\n

    • This topic was modified 3 years, 11 months ago by Senri Miura.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 25 total)
  • ANother solution is to deregister the default jquery and load a working (old) version of jquery. Version 2.2.4 is working.
    add_action( ‘init’, ‘wpm_jquery’ );
    function wpm_jquery() {
    if ( !is_admin() ) {
    wp_deregister_script( ‘jquery’ );
    wp_register_script( ‘jquery’, ( ‘https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js’ ), false, null, true );
    wp_enqueue_script( ‘jquery’ );
    }
    }

    Do this:
    Open the file transposhedit.js and search for this:

    <textarea cols="80" row="3" name="original" id="'+u+'original" readonly="y"/><span id="'+u+'utlbar"><button id="'+u+'prev">'+v("previous translation")+'</button><button id="'+u+'zoom">'+v("find on page")+'</button><button id="'+u+'next">'+v("next translation")+'</button></span><label for="translation">'+v("Translate to")+'</label><textarea cols="80" row="3" name="translation" lang="'+t_jp.lang+'"id="'+u+'translation"/>

    And replace with this:

    <textarea cols="80" row="3" name="original" id="'+u+'original" readonly="y"/></textarea><span id="'+u+'utlbar"><button id="'+u+'prev">'+v("previous translation")+'</button><button id="'+u+'zoom">'+v("find on page")+'</button><button id="'+u+'next">'+v("next translation")+'</button></span><label for="translation">'+v("Translate to")+'</label><textarea cols="80" row="3" name="translation" lang="'+t_jp.lang+'"id="'+u+'translation"/></textarea>

    This should open the editor, but you should also change the option “Override jQueryUI version” in the Advanced settings of transposh – add 1.8.4 or something between 1.8- 1.9 should work. Seems like the text areas are closing automatically at the wrong position with the new jquery parser(?). This solution was proposed by the creator Ofer Wald at another post.

    • This reply was modified 3 years, 11 months ago by Dpsachou.
    • This reply was modified 3 years, 11 months ago by Dpsachou.
    • This reply was modified 3 years, 11 months ago by Dpsachou. Reason: Forgot to add things
    Thread Starter Senri Miura

    (@senribb)

    Hello roryrory, Dpsachou

    Thank you for suggesting another solution for WordPress 5.7. Also, thank you for the information regarding the fix for transposhedit.js.

    I think the best way is for the author to fix it to maintain compatibility for WordPress 5.7 (jQuery 3.5.1).

    I tried to fix transposhedit.js shown by Dpsachou, but it is not working properly so far.
    In Transposh’s advanced settings, I specified some versions in “Overwrite jQuery UI version”, but unfortunately, I’ve not confirmed normal operation so far.

    If you have any other information about the fix, please let us know.

    P.S.
    In the above iQuery modification example I showed, admin / contexthelp.js.map is actually modified to admin / contexthelp.js.

    Hi,

    It works for me with this edits and when entering “1.9.2” in the jquery version field. Do you get any test fields at all when trying to edit the translation?

    • This reply was modified 3 years, 11 months ago by Dpsachou.
    Thread Starter Senri Miura

    (@senribb)

    I modified transposhedit.js by the method shown. Then, I entered “1.9.2” in “Override jQuery UI version” of Transposh’s Advanced settings. However, Transposh’s translation edit dialog didn’t work.

    If I set the jQuery version of jQuery Migrate to “Legacy 1.2.4-wp”, the Transposh translation edit dialog will be displayed, but I set it to the WordPress default, the display will still be corrupted.
    It may be the effect of my modification to jQuery 3.x, but I’m not sure why.

    Thread Starter Senri Miura

    (@senribb)

    P.S.
    For more information on changes in other plugins, including Transposh, see the following articles:

    https://www.senris.com/wordpress-5_5/?lang=en

    Have you found any solution to the problem? I modified transposhedit.js and added Override jQueryUI version 1.8.0, but that doesn’t change anything.
    It is impossible to add any translations. When I click on the yellow square next to the word or phrase that I want to translate, only the text in the original language and the Close button appear. There is no usual rectangle in which to write a translation and there is no Add/OK button.
    https://ozma-yeudit.com/?lang=he

    Thread Starter Senri Miura

    (@senribb)

    Hello, mikhaelb.

    Right now, I can’t find a fundamental solution, so I’ll wait until Transposh, which supports WordPress 5.7 (jQuery 3.5.1), is upgraded.

    Hi dear @senribb, @roryrory , @dpsachou , @mikhaelb

    Today, the latest version of Transposh v1.0.7 was released a few hours ago, I have both tested and tried it and I can tell you that it works great because the developer @oferwald, a very prepared, kind and professional person, has solved many of the bugs that created problems, so I invite you to update with confidence.

    Hoping to be helpful I wish you a good day.

    Sincerely, Fabio Perri.

    Thread Starter Senri Miura

    (@senribb)

    Hello, Fabio Perri.

    Today, I have upgraded Transposh to the latest version v1.0.7.
    However, when the jQuery version setting of jQuery Migrate is set to “WordPress default”, the edit dialog does not display properly.
    If you set the jQuery version setting to “Legacy 1-12-4-wp”, the edit dialog will be displayed normally.
    There is a description that Transposh v1.0.7 is compatible with jQuery 3.x, but when I checked Transposh’s jQuery program, I confirmed that it was not compatible with jQuery 3.x.

    Plugin Author oferwald

    (@oferwald)

    Hello @senribb

    I did a simple test, installed a clean version of wordpress 5.6 (latest available for download) and then installed Transposh 1.0.7.1 on top of it.

    It worked, and the edit dialog showed.

    My guess is that there is some caching involved. Or maybe some other problem.

    I also tested with the latest nightly, and will repeat the test once 5.7 is out.

    Thanks for your inputs.

    Thread Starter Senri Miura

    (@senribb)

    Hello, Ofer Wald

    A big respect for your great plugin.
    Thank you for your prompt reply.

    For reference, on my website (htts://senris.com), the screenshot of Transposh’s translation edit mode dialog is shown at the following URL.
    Sure, it may be due to some cache (Transposh?) Or interference from other plugins, but unfortunately, for now, I’m not sure why the display is corrupted.

    https://www.senris.com/images/screenshot/Transposh-2021-02-03.jpg

    Plugin Author oferwald

    (@oferwald)

    Which browser are you using?

    The main change in the last version was to remove the deprecated jQuery.browser property from the lazy loader.

    I have test with Chrome/Firefox and things seemed to work, I no longer care about IE (which is probably the status for everyone).

    Can you check if the editing interface loads for you on transposh.org?

    Thread Starter Senri Miura

    (@senribb)

    The browser is the Chrome version of Microsoft Edge.
    If I set the jQuery version setting to “Legacy 1-12-4-wp”, the edit dialog will be displayed normally as shown in the screenshot below.

    https://www.senris.com/images/screenshot/Transposh-2021-02-03-2.jpg

    P.S.
    I just made a big discovery!
    It was displayed normally in the Chrome browser on Android.
    The display seems to be broken on Microsoft Edge (Chrome version).
    The screenshot is at the following URL.

    https://www.senris.com/images/screenshot/Transposh-2021-02-03-3.jpg

    • This reply was modified 3 years, 9 months ago by Senri Miura.
    • This reply was modified 3 years, 9 months ago by Senri Miura.
    • This reply was modified 3 years, 9 months ago by Senri Miura.
    Plugin Author oferwald

    (@oferwald)

    Thanks for reporting that, I didn’t do any tests with Edge and its quite likely that this will happen in an untested scenario. I will mark this clearly as a known caveat, will try to fix it once I have access to a setup with edge (mostly on linux here…)

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘jQuery 3.x patch’ is closed to new replies.