e82e0ac9184cfa4b97cb9b8b66813d53ef5730b6
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Resources / Public / JavaScript / UrlLinkHandler.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 /**
15 * Module: TYPO3/CMS/Recordlist/UrlLinkHandler
16 * URL link interaction
17 */
18 define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser) {
19 'use strict';
20
21 /**
22 *
23 * @type {{}}
24 * @exports TYPO3/CMS/Recordlist/UrlLinkHandler
25 */
26 var UrlLinkHandler = {};
27
28 /**
29 *
30 * @param {Event} event
31 */
32 UrlLinkHandler.link = function(event) {
33 event.preventDefault();
34
35 var value = $(this).find('[name="lurl"]').val();
36 if (value === "http://") {
37 return;
38 }
39
40 LinkBrowser.finalizeFunction(value);
41 };
42
43 $(function() {
44 $('#lurlform').on('submit', UrlLinkHandler.link);
45 });
46
47 return UrlLinkHandler;
48 });