PageSourceSearch

https://actionnetwork.org/includes/js/redactor_video.js?v=71

js actionnetwork.org collected 2026-09-24 07:04:08 UTC 2,639 bytes, 93 lines download raw bytes

1(function($)
2{
3	$.Redactor.prototype.video = function()
4	{
5		return {
6			reUrlYoutube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig,
7			reUrlVimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,
8			langs: {
9				en: {
10					"video": "Video",
11					"video-html-code": "Video Embed Code or Youtube/Vimeo Link"
12				}
13			},
14			getTemplate: function()
15			{
16				return String()
17				+ '<div class="modal-section" id="redactor-modal-video-insert">'
18					+ '<section>'
19						+ '<label>' + this.lang.get('video-html-code') + '</label>'
20						+ '<textarea id="redactor-insert-video-area" style="height: 160px;"></textarea>'
21					+ '</section>'
22					+ '<section>'
23						+ '<button id="redactor-modal-button-action">Insert</button>'
24						+ '<button id="redactor-modal-button-cancel">Cancel</button>'
25					+ '</section>'
26				+ '</div>';
27			},
28			init: function()
29			{
30				var button = this.button.addAfter('image', 'video', this.lang.get('video'));
31				this.button.addCallback(button, this.video.show);
32			},
33			show: function()
34			{
35				this.modal.addTemplate('video', this.video.getTemplate());
36
37				this.modal.load('video', this.lang.get('video'), 700);
38
39				// action button
40				this.modal.getActionButton().text(this.lang.get('insert')).on('click', this.video.insert);
41				this.modal.show();
42
43				// focus
44				if (this.detect.isDesktop())
45				{
46					setTimeout(function()
47					{
48						$('#redactor-insert-video-area').focus();
49
50					}, 1);
51				}
52
53
54			},
55			insert: function()
56			{
57				var data = $('#redactor-insert-video-area').val();
58
59				if (!data.match(/<iframe|<video/gi))
60				{
61					data = this.clean.stripTags(data);
62
63					this.opts.videoContainerClass = (typeof this.opts.videoContainerClass === 'undefined') ? 'video-container' : this.opts.videoContainerClass;
64
65					// parse if it is link on youtube & vimeo
66					var iframeStart = '<div class="' + this.opts.videoContainerClass + '"><iframe style="width: 500px; height: 281px;" src="',
67						iframeEnd = '" frameborder="0" allowfullscreen></iframe></div>';
68
69					if (data.match(this.video.reUrlYoutube))
70					{
71						data = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);
72					}
73					else if (data.match(this.video.reUrlVimeo))
74					{
75						data = data.replace(this.video.reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);
76					}
77				}
78
79				this.modal.close();
80				this.placeholder.hide();
81
82				// buffer
83				this.buffer.set();
84
85				// insert
86				this.air.collapsed();
87				this.insert.html(data);
88
89			}
90
91		};
92	};
93})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.