Announcement

Collapse
No announcement yet.

Auto Check Retrieve remote file and reference locally

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Auto Check Retrieve remote file and reference locally

    Is there a way to auto-check the "Retrieve remote file and reference locally" check box? I run a SSL site and it is really annoying when someone attaches a non SSL image and does not check the box. The SSL then breaks because of mixed content. It would be a great customization to be able to auto check this option:

    Click image for larger version

Name:	SSL Image Proxy.jpg
Views:	311
Size:	82.9 KB
ID:	1821



    William
    Last edited by William; 11-01-2016, 11:55 AM.

    #2
    Glen can probably do better at this one, but I've done a little footwork.

    The checkbox element is part of the CKE.
    Code:
    <input class="cke_dialog_ui_checkbox_input" aria-labelledby="cke_88_label" id="cke_89_uiElement" type="checkbox">
    The ID for this checkbox is "cke_89_uiElement"
    In order to change the box to checked by default, checked> has to be added to the end of the <input

    I know of 2 ways to do this.
    1. Hack the code and set it. The issue I have is that I don't have the same version of vB and can not find that new code.
    It is most likely not in the vB core folder and more likely in the root/JS/CKEditor folder.
    2. Use jquery code to toggle the box as checked.
    Code:
    $(document).ready(function() {
        $("#cke_89_uiElement").click(function() {
            var checkBoxes = $("input[name=recipients\\[\\]]");
            checkBoxes.prop("checked", !checkBoxes.prop("checked"));
        });                 
    });
    This could be added to the footer module, I think, to trigger it.

    All I have for now, but you should be able to find either the <input line or use the code to accomplish this.

    Comment


      #3
      Originally posted by Felix2 View Post
      Glen can probably do better at this one, but I've done a little footwork.

      The checkbox element is part of the CKE.
      Code:
      <input class="cke_dialog_ui_checkbox_input" aria-labelledby="cke_88_label" id="cke_89_uiElement" type="checkbox">
      The ID for this checkbox is "cke_89_uiElement"
      In order to change the box to checked by default, checked> has to be added to the end of the <input

      I know of 2 ways to do this.
      1. Hack the code and set it. The issue I have is that I don't have the same version of vB and can not find that new code.
      It is most likely not in the vB core folder and more likely in the root/JS/CKEditor folder.
      2. Use jquery code to toggle the box as checked.
      Code:
      $(document).ready(function() {
      $("#cke_89_uiElement").click(function() {
      var checkBoxes = $("input[name=recipients\\[\\]]");
      checkBoxes.prop("checked", !checkBoxes.prop("checked"));
      });
      });
      This could be added to the footer module, I think, to trigger it.

      All I have for now, but you should be able to find either the <input line or use the code to accomplish this.
      Thanks for your input and help Felix. However, way beyond my ability.

      Enjoy,
      William

      Comment


        #4
        Okay, in the ckeditor-rollup-524.js file around line 572 I found the only occurrence of cke_dialog_ui_checkbox_input

        Code:
        g={"class":[B]"cke_dialog_ui_checkbox_input",type:"checkbox"[/B],"aria-labelledby":d};t(c);a["default"]&&(g.checked="checked");"undefined"!=typeof c.inputStyle&&(c.style=c.inputStyle);
        f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,e,"input",null,g);
        Nowhere however in the code, CKE or vB, can I find cke_89_uiElement
        This leads me to believe it is theme specific.
        If I am correct, then you would have to search your own theme code for
        Code:
        <input class="cke_dialog_ui_checkbox_input" aria-labelledby="cke_88_label" id="cke_89_uiElement" type="checkbox">
        and replace it with
        Code:
        <input class="cke_dialog_ui_checkbox_input" aria-labelledby="cke_88_label" id="cke_89_uiElement" type="checkbox"[B] checked>[/B]
        Option 2,
        AdminCP, Styles, select your theme, edit templates, edit the FOOTER template.
        Scroll down to the end of the code and look for {vb:hook footer_before_body_end}
        Somewhere after that line add this code
        Code:
         
         $(document).ready(function() { $("#cke_89_uiElement").click(function() { var checkBoxes = $("input[name=recipients\\[\\]]"); checkBoxes.prop("checked", !checkBoxes.prop("checked")); }); });
        Save, load up a page, try attacking an image and see if the box is checked.
        If yes, yippie!
        If no, remove the code and let us know.

        Comment


        • William
          William commented
          Editing a comment
          The first option had no results searching the templates. So I tried option two, cleared cache and it made no difference. Unfortunately, the option was not checked.

        #5
        Option 2 should be done via template hook to avoid editing footer template.
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment

        Users Viewing This Page

        Collapse

        There is 1 user viewing this forum topic.

        • Guest Guest

        Latest Posts

        Collapse

        Working...
        X
        Searching...Please wait.
        An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

        Please push the back button and reload the previous window.'
        An unexpected error was returned: 'Your submission could not be processed because the token has expired.

        Please push the back button and reload the previous window.'
        An internal error has occurred and the module cannot be displayed.
        There are no results that meet this criteria.
        Search Result for "|||"