How to change the editor>insert link default web address content from "http://" to "https://"

1 Answer 61 Views
Editor
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 01 Nov 2022, 05:55 AM

How to change the editor>insert link default web address content  from "http://" to "https://"

See screenshot

 

 

1 Answer, 1 is accepted

Sort by
0
Lyuboslav
Telerik team
answered on 01 Nov 2022, 10:31 AM

Hi Morten,

Thanks for the providing image.

Firstly, you can handle the "execute" event:

$("#editor").kendoEditor({
        execute:(e)=>{
....
         }

Then when in the event handler get the content of input and split it. This way we can easily add 's' and change the "HTTP" to "HTTPS". The index 4 is used as obviously "s" will be always in the same position, "5" in our way:

previousContent = document.querySelector('#k-editor-link-url').value.split('');
          if(previousContent[4] != 's'){
            previousContent.splice(4,0,'s');  
          }          
          document.querySelector('#k-editor-link-url').value = previousContent.join('');

All examples above are summarized in the sample dojo example.

I hope this will help you. 

Regards,
Lyuboslav
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Morten
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 01 Nov 2022, 01:46 PM

thanks a lot.
Tags
Editor
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Lyuboslav
Telerik team
Share this question
or