| Revision 3880:e6d1f6d9d7df,
614 bytes
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
|
Use let and const rather than var (ES2015/ES6), use template string where is more efficient
|
| Line | |
|---|
| 1 | /*global $ */ |
|---|
| 2 | 'use strict'; |
|---|
| 3 | |
|---|
| 4 | $(function() { |
|---|
| 5 | $('#link-insert-cancel').click(function() { |
|---|
| 6 | window.close(); |
|---|
| 7 | }); |
|---|
| 8 | |
|---|
| 9 | $('#link-insert-ok').click(function() { |
|---|
| 10 | sendClose(); |
|---|
| 11 | window.close(); |
|---|
| 12 | }); |
|---|
| 13 | |
|---|
| 14 | function sendClose() { |
|---|
| 15 | const insert_form = $('#link-insert-form').get(0); |
|---|
| 16 | if (insert_form == undefined) { return; } |
|---|
| 17 | |
|---|
| 18 | const tb = window.opener.the_toolbar; |
|---|
| 19 | const data = tb.elements.link.data; |
|---|
| 20 | |
|---|
| 21 | data.href = tb.stripBaseURL(insert_form.elements.href.value); |
|---|
| 22 | data.title = insert_form.elements.title.value; |
|---|
| 23 | data.hreflang = insert_form.elements.hreflang.value; |
|---|
| 24 | tb.elements.link.fncall[tb.mode].call(tb); |
|---|
| 25 | } |
|---|
| 26 | }); |
|---|
Note: See
TracBrowser
for help on using the repository browser.