{"version":3,"sources":["counter.js","definedlinks.js","fontcolor.js","fontfamily.js","fontsize.js","fullscreen.js","properties.js","scriptbuttons.js","uploadcare.js","video.js","custom.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrEA","file":"scripts.js","sourcesContent":["// Word counter\n// Adapted from offical Redactor site\n// https://imperavi.com/redactor/plugins/counter/\n\nif (!RedactorPlugins) var RedactorPlugins = {};\n \nRedactorPlugins.counter = function()\n{\n return {\n init: function()\n { \n // As have no access to init of Redactor in Craft add callback from plugin \n if (typeof this.opts.callbacks.counter === 'undefined')\n {\n this.opts.callbacks.counter = function(data)\n {\n console.log(data);\n }\n }\n\n var button = this.button.add('counter-button', 'Word count');\n this.button.addCallback(button, this.counter.showCount)\n\n this.core.editor().on('keyup.redactor-plugin-counter', $.proxy(this.counter.count, this));\n },\n count: function()\n {\n var words = 0, characters = 0, spaces = 0;\n var html = this.code.get();\n\n var text = html.replace(/<\\/(.*?)>/gi, ' ');\n text = text.replace(/<(.*?)>/gi, '');\n text = text.replace(/\\t/gi, '');\n text = text.replace(/\\n/gi, ' ');\n text = text.replace(/\\r/gi, ' ');\n text = text.replace(/\\u200B/g, '');\n text = $.trim(text);\n\n if (text !== '')\n {\n var arrWords = text.split(/\\s+/);\n var arrSpaces = text.match(/\\s/g);\n\n words = (arrWords) ? arrWords.length : 0;\n spaces = (arrSpaces) ? arrSpaces.length : 0;\n\n characters = text.length;\n\n }\n\n this.core.callback('counter', { words: words, characters: characters, spaces: spaces });\n\n return { words: words, characters: characters, spaces: spaces };\n },\n showCount: function()\n {\n var data = this.counter.count();\n console.log('Words: ' + data.words);\n console.log('Characters: ' + data.characters);\n console.log('Characters w/o spaces: ' + (data.characters - data.spaces));\n \n // open modal\n this.modal.addTemplate('counterTemplate', this.counter.getTemplate());\n this.modal.load('counterTemplate', 'Word counter', 500);\n \n var button = this.modal.getActionButton();\n button.on('click', this.counter.insert);\n \n this.modal.show();\n },\n getTemplate: function()\n {\n var data = this.counter.count();\n \n return String()\n + '
'\n + '
'\n + ''\n + ''\n + ''\n + ''\n + ''\n + ''\n + ''\n + '
Words' + data.words + '
Characters' + data.characters + '
Characters without spaces' + (data.characters - data.spaces) + '
'\n + '
'\n + ''\n + '
'\n + '
';\n }\n };\n};","if (!RedactorPlugins) var RedactorPlugins = {};\n\nRedactorPlugins.definedlinks = function()\n{\n\treturn {\n\t\tinit: function()\n\t\t{\n\t\t\tif (!this.opts.definedLinks)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.modal.addCallback('link', $.proxy(this.definedlinks.load, this));\n\n\t\t},\n\t\tload: function()\n\t\t{\n\t\t\tvar $section = $('
');\n\t\t\tvar $select = $(''\n\t\t\t \t+ '
'\n\t\t\t \t+ '
'\n\t\t\t\t \t+ ''\n\t\t\t\t \t+ ''\n\t\t\t\t + '
'\n\t\t\t\t+ '
'\n\t\t\t\t\t+ ''\n\t\t\t\t\t+ ''\n\t\t\t\t+ '
'\n\t\t\t + '';\n\t\t},\n\t\tsetup: function()\n\t\t{\n\t\t\tthis.opts.properties = (typeof this.opts.properties === 'undefined') ? {} : this.opts.properties;\n\t\t\tthis.opts.properties.id = (typeof this.opts.properties.id === 'undefined') ? true : this.opts.properties.id;\n\t\t\tthis.opts.properties.classname = (typeof this.opts.properties.classname === 'undefined') ? true : this.opts.properties.classname;\n\t\t\tthis.opts.properties.show = (typeof this.opts.properties.show === 'undefined') ? false : this.opts.properties.show;\n\n\t\t},\n\t\tinit: function()\n\t\t{\n\t\t\tif (this.opts.type === 'pre' || this.opts.type === 'inline')\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.properties.setup();\n\n\t\t\tthis.properties.createLabelId(this.properties.labelStyle);\n\t\t\tthis.properties.createLabelClass(this.properties.labelStyle);\n\n\t\t\tthis.properties.setEvents();\n\n\t\t\tvar button = this.button.add('properties', this.lang.get('properties'));\n\t\t\tthis.button.addCallback(button, this.properties.show);\n\n\t\t},\n\t\tshow: function()\n\t\t{\n\t\t\tthis.modal.addTemplate('properties', this.properties.getTemplate());\n\t\t\tthis.modal.load('properties', 'Properties', 600);\n\n\t\t\tvar button = this.modal.getActionButton().text('Save');\n\t\t\tbutton.on('click', this.properties.save);\n\n\t\t\tthis.properties.showId();\n\t\t\tthis.properties.showClass();\n\n\t\t\tthis.modal.show();\n\n\t\t},\n\t\tcreateLabelId: function(css)\n\t\t{\n\t\t\tif (!this.opts.properties.show && !this.opts.properties.id)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.properties.labelId = $('').attr('id', 'redactor-properties-label-id-' + this.uuid).attr('title', 'ID').hide();\n\t\t\tthis.properties.labelId.css(css).css('background', 'rgba(229, 57, 143, .7)');\n\t\t\t$('body').append(this.properties.labelId);\n\n\t\t},\n\t\tcreateLabelClass: function(css)\n\t\t{\n\t\t\tif (!this.opts.properties.show && !this.opts.properties.classname)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.properties.labelClass = $('').attr('id', 'redactor-properties-label-class-' + this.uuid).attr('title', 'class').hide();\n\t\t\tthis.properties.labelClass.css(css).css('background', 'rgba(61, 121, 242, .7)');\n\t\t\t$('body').append(this.properties.labelClass);\n\n\t\t},\n\t\tsetEvents: function()\n\t\t{\n\t\t\tthis.core.element().on('click.callback.redactor', this.properties.showOnClick);\n\t\t\t$(document).on('mousedown.redactor-properties', $.proxy(this.properties.hideOnBlur, this));\n\n\t\t\tthis.core.element().on('destroy.callback.redactor', $.proxy(function()\n\t\t\t{\n\t\t\t\t$(document).off('.redactor-properties');\n\n\t\t\t}, this));\n\t\t},\n\t\tshowId: function()\n\t\t{\n\t\t\tif (this.opts.properties.id)\n\t\t\t{\n\t\t\t\t$('#modal-properties-id-label').show();\n\t\t\t\t$('#modal-properties-id').show().val($(this.properties.block).attr('id'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#modal-properties-id, #modal-properties-id-label').hide();\n\t\t\t}\n\t\t},\n\t\tshowClass: function()\n\t\t{\n\t\t\tif (this.opts.properties.classname)\n\t\t\t{\n\t\t\t\t$('#modal-properties-class-label').show();\n\t\t\t\t$('#modal-properties-class').show().val($(this.properties.block).attr('class'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#modal-properties-class, #modal-properties-class-label').hide();\n\t\t\t}\n\t\t},\n\t\tsave: function()\n\t\t{\n\t\t\t// id\n\t\t\tif (this.opts.properties.id)\n\t\t\t{\n\t\t\t\tvar id = $('#modal-properties-id').val();\n\t\t\t\tif (typeof id === 'undefined' || id === '')\n\t\t\t\t{\n\t\t\t\t\tthis.block.removeAttr('id', this.properties.block);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.block.replaceAttr('id', id, this.properties.block);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// class\n\t\t\tif (this.opts.properties.classname)\n\t\t\t{\n\t\t\t\tvar classname = $('#modal-properties-class').val();\n\t\t\t\tif (typeof classname === 'undefined' || classname === '')\n\t\t\t\t{\n\t\t\t\t\tthis.block.removeAttr('class', this.properties.block);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.block.replaceClass(classname, this.properties.block);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.modal.close();\n\t\t\tthis.properties.showOnClick(false);\n\n\t\t},\n\t\tshowOnClick: function(e)\n\t\t{\n\t\t\tif (e !== false)\n\t\t\t{\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\tvar zindex = (typeof this.fullscreen !== 'undefined' && this.fullscreen.isOpen) ? 1052 : 99;\n\n\t\t\tthis.properties.block = this.selection.block();\n\t\t\tif (!this.properties.block || !this.utils.isRedactorParent(this.properties.block) || this.utils.isCurrentOrParent(['figure', 'li']))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar pos = $(this.properties.block).offset();\n\n\t\t\tvar classname = this.properties.showOnClickClass(pos, zindex);\n\t\t\tthis.properties.showOnClickId(pos, zindex, classname);\n\n\t\t},\n\t\tshowOnClickId: function(pos, zindex, classname)\n\t\t{\n\t\t\tvar id = $(this.properties.block).attr('id');\n\t\t\tif (this.opts.properties.show && this.opts.properties.id && typeof id !== 'undefined' && id !== '')\n\t\t\t{\n\t\t\t\tsetTimeout($.proxy(function()\n\t\t\t\t{\n\t\t\t\t\tvar width = (this.opts.properties.classname && typeof classname !== 'undefined' && classname !== '') ? this.properties.labelClass.innerWidth() : -3;\n\t\t\t\t\tthis.properties.labelId.css({\n\n\t\t\t\t\t\tzIndex: zindex,\n\t\t\t\t\t\ttop: pos.top - 13,\n\t\t\t\t\t\tleft: pos.left + width\n\n\t\t\t\t\t}).show().text('#' + id);\n\n\t\t\t\t}, this), 10);\n\t\t\t}\n\t\t},\n\t\tshowOnClickClass: function(pos, zindex)\n\t\t{\n\t\t\tvar classname = $(this.properties.block).attr('class');\n\t\t\tif (this.opts.properties.show && this.opts.properties.classname && typeof classname !== 'undefined' && classname !== '')\n\t\t\t{\n\t\t\t\tthis.properties.labelClass.css({\n\n\t\t\t\t\tzIndex: zindex,\n\t\t\t\t\ttop: pos.top - 13,\n\t\t\t\t\tleft: pos.left - 3\n\n\t\t\t\t}).show().text(classname);\n\t\t\t}\n\n\t\t\treturn classname;\n\t\t},\n\t\thideOnBlur: function(e)\n\t\t{\n\t\t\tif (e.target === this.properties.block)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.properties.hideOnBlurId();\n\t\t\tthis.properties.hideOnBlurClass();\n\n\t\t},\n\t\thideOnBlurId: function()\n\t\t{\n\t\t\tif (this.opts.properties.show && this.opts.properties.id)\n\t\t\t{\n\t\t\t\tthis.properties.labelId.css('z-index', 99).hide();\n\t\t\t}\n\t\t},\n\t\thideOnBlurClass: function()\n\t\t{\n\t\t\tif (this.opts.properties.show && this.opts.properties.classname)\n\t\t\t{\n\t\t\t\tthis.properties.labelClass.css('z-index', 99).hide();\n\t\t\t}\n\t\t}\n\t}\n};\n","if (!RedactorPlugins) var RedactorPlugins = {};\n\nRedactorPlugins.scriptbuttons = function()\n{\n return {\n init: function()\n {\n var sup = this.button.add('superscript', 'superscript');\n var sub = this.button.add('subscript', 'subscript');\n //this.button.setIcon('superscript', '');\n //this.button.setIcon('subscript', '');\n this.button.setAwesome('superscript', 'fa-superscript');\n this.button.setAwesome('subscript', 'fa-subscript');\n\n this.button.addCallback(sup, this.scriptbuttons.formatSup);\n this.button.addCallback(sub, this.scriptbuttons.formatSub);\n },\n formatSup: function()\n {\n this.inline.format('sup');\n },\n formatSub: function()\n {\n this.inline.format('sub');\n }\n }\n};\n","/*\n * Uploadcare Redactor plugin (1.1.3)\n */\n\nif (!RedactorPlugins) var RedactorPlugins = {};\n\n(function($) {\n RedactorPlugins.uploadcare = function() {\n var $opts;\n return {\n init: function() {\n $opts = this.opts.uploadcare;\n // defaults\n if (! $opts.crop) {\n $opts.crop = '';\n }\n if (! $opts.version) {\n $opts.version = '2.5.0';\n }\n\n if (typeof uploadcare === 'undefined') {\n var widget_url = 'https://ucarecdn.com/widget/' + $opts.version + '/uploadcare/uploadcare.min.js';\n $.getScript(widget_url);\n }\n var button = this.button.add('image', $opts.buttonLabel || 'Uploadcare');\n this.button.addCallback(button, this.uploadcare.show);\n\n // using Font Awesome, sets the default icon\n // for usage with Semantic UI, change second argument to desired icon class (e.g. 'attach icon')\n this.button.setAwesome('uploadcare', 'fa-picture-o');\n },\n\n show: function() {\n var dialog = uploadcare.openDialog({}, $opts);\n this.selection.save();\n dialog.done(this.uploadcare.done)\n },\n\n done: function(data) {\n var $this = this;\n var files = $opts.multiple ? data.files() : [data];\n this.selection.restore();\n $.when.apply(null, files).done(function() {\n $.each(arguments, function() {\n if ($.isFunction($opts.uploadCompleteCallback)) {\n $opts.uploadCompleteCallback.call($this, this);\n } else {\n var imageUrl = this.cdnUrl;\n if (this.isImage && ! this.cdnUrlModifiers) {\n imageUrl += '-/preview/';\n }\n if (this.isImage) {\n $this.insert.html('\"'', false);\n } else {\n $this.insert.html('' + this.name + '', false);\n }\n }\n });\n });\n },\n };\n };\n})(jQuery);\n","if (!RedactorPlugins) var RedactorPlugins = {};\n\nRedactorPlugins.video = function()\n{\n\treturn {\n\t\treUrlYoutube: /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com\\S*[^\\w\\-\\s])([\\w\\-]{11})(?=[^\\w\\-]|$)(?![?=&+%\\w.-]*(?:['\"][^<>]*>|<\\/a>))[?=&+%\\w.-]*/ig,\n\t\treUrlVimeo: /https?:\\/\\/(www\\.)?vimeo.com\\/(\\d+)($|\\/)/,\n\t\tgetTemplate: function()\n\t\t{\n\t\t\treturn String()\n\t\t\t+ '
'\n\t\t\t\t+ ''\n\t\t\t\t+ ''\n\t\t\t+ '
';\n\t\t},\n\t\tinit: function()\n\t\t{\n\t\t\tvar button = this.button.addAfter('image', 'video', this.lang.get('video'));\n\t\t\tthis.button.addCallback(button, this.video.show);\n\t\t},\n\t\tshow: function()\n\t\t{\n\t\t\tthis.modal.addTemplate('video', this.video.getTemplate());\n\n\t\t\tthis.modal.load('video', this.lang.get('video'), 700);\n\t\t\tthis.modal.createCancelButton();\n\n\t\t\tvar button = this.modal.createActionButton(this.lang.get('insert'));\n\t\t\tbutton.on('click', this.video.insert);\n\n\t\t\tthis.selection.save();\n\t\t\tthis.modal.show();\n\n\t\t\t$('#redactor-insert-video-area').focus();\n\n\t\t},\n\t\tinsert: function()\n\t\t{\n\t\t\tvar data = $('#redactor-insert-video-area').val();\n\t\t\tdata = this.clean.stripTags(data);\n\n\t\t\t// parse if it is link on youtube & vimeo\n\t\t\tvar iframeStart = '';\n\n\t\t\tif (data.match(this.video.reUrlYoutube))\n\t\t\t{\n\t\t\t\tdata = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);\n\t\t\t}\n\t\t\telse if (data.match(this.video.reUrlVimeo))\n\t\t\t{\n\t\t\t\tdata = data.replace(this.video.reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);\n\t\t\t}\n\n\t\t\tthis.selection.restore();\n\t\t\tthis.modal.close();\n\n\t\t\tvar current = this.selection.getBlock() || this.selection.getCurrent();\n\n\t\t\tif (current) $(current).after(data);\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.insert.html(data);\n\t\t\t}\n\n\t\t\tthis.code.sync();\n\t\t}\n\n\t};\n};",""],"sourceRoot":"/source/"}