{"version":3,"sources":["keditor-component-googlemap.js"],"names":["$","KEditor","keditor","flog","log","components","init","contentArea","container","component","iframe","find","wrapper","parent","initIframeCover","settingEnabled","settingTitle","initSettingForm","form","append","btnEdit","on","e","preventDefault","inputData","prompt","src","attr","length","getSettingComponent","alert","btn169","removeClass","addClass","btn43","jQuery"],"mappings":"CAAA,SAAWA,GACP,GAAIC,GAAUD,EAAEE,QACZC,EAAOF,EAAQG,GAEnBH,GAAQI,WAAsB,WAC1BC,KAAM,SAAUC,EAAaC,EAAWC,EAAWP,GAC/CC,EAAK,6BAA8BM,EAEnC,IAAIC,GAASD,EAAUE,KAAK,UACxBC,EAAUF,EAAOG,QACrBX,GAAQY,gBAAgBJ,EAAQE,IAGpCG,gBAAgB,EAEhBC,aAAc,sBAEdC,gBAAiB,SAAUC,EAAMhB,GAC7BC,EAAK,yCAELe,EAAKC,OACD,+hBAgBJ,IAAIC,GAAUF,EAAKP,KAAK,sBACxBS,GAAQC,GAAG,QAAS,SAAUC,GAC1BA,EAAEC,gBAEF,IAAIC,GAAYC,OAAO,+CACnBf,EAASV,EAAEwB,GACXE,EAAMhB,EAAOiB,KAAK,MAClBjB,GAAOkB,OAAS,GAAKF,GAAOA,EAAIE,OAAS,EACzC1B,EAAQ2B,sBAAsBlB,KAAK,0BAA0BgB,KAAK,MAAOD,GAEzEI,MAAM,2CAId,IAAIC,GAASb,EAAKP,KAAK,qBACvBoB,GAAOV,GAAG,QAAS,SAAUC,GACzBA,EAAEC,iBAEFrB,EAAQ2B,sBAAsBlB,KAAK,qBAAqBqB,YAAY,yBAAyBC,SAAS,2BAG1G,IAAIC,GAAQhB,EAAKP,KAAK,oBACtBuB,GAAMb,GAAG,QAAS,SAAUC,GACxBA,EAAEC,iBAEFrB,EAAQ2B,sBAAsBlB,KAAK,qBAAqBqB,YAAY,0BAA0BC,SAAS,8BAKpHE","file":"keditor-component-googlemap.min.js","sourcesContent":["(function ($) {\r\n var KEditor = $.keditor;\r\n var flog = KEditor.log;\r\n\r\n KEditor.components['googlemap'] = {\r\n init: function (contentArea, container, component, keditor) {\r\n flog('init \"googlemap\" component', component);\r\n\r\n var iframe = component.find('iframe');\r\n var wrapper = iframe.parent();\r\n keditor.initIframeCover(iframe, wrapper);\r\n },\r\n\r\n settingEnabled: true,\r\n\r\n settingTitle: 'Google Map Settings',\r\n\r\n initSettingForm: function (form, keditor) {\r\n flog('initSettingForm \"googlemap\" component');\r\n\r\n form.append(\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n '
' +\r\n ' ' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
'\r\n );\r\n\r\n var btnEdit = form.find('.btn-googlemap-edit');\r\n btnEdit.on('click', function (e) {\r\n e.preventDefault();\r\n\r\n var inputData = prompt('Please enter Google Map embed code in here:');\r\n var iframe = $(inputData);\r\n var src = iframe.attr('src');\r\n if (iframe.length > 0 && src && src.length > 0) {\r\n keditor.getSettingComponent().find('.embed-responsive-item').attr('src', src);\r\n } else {\r\n alert('Your Google Map embed code is invalid!');\r\n }\r\n });\r\n\r\n var btn169 = form.find('.btn-googlemap-169');\r\n btn169.on('click', function (e) {\r\n e.preventDefault();\r\n\r\n keditor.getSettingComponent().find('.embed-responsive').removeClass('embed-responsive-4by3').addClass('embed-responsive-16by9');\r\n });\r\n\r\n var btn43 = form.find('.btn-googlemap-43');\r\n btn43.on('click', function (e) {\r\n e.preventDefault();\r\n\r\n keditor.getSettingComponent().find('.embed-responsive').removeClass('embed-responsive-16by9').addClass('embed-responsive-4by3');\r\n });\r\n }\r\n };\r\n\r\n})(jQuery);\r\n"]}