{"version":3,"file":"sm.portal.plugin.public.min.js","names":["jQuery","undefined","sm","window","extend","each","proxy","noop","isFunction","globalize","Globalize","toggleSMHeaderLogin","that","myMenu","first","title","attr","not","on","portal","ui","lightBox","errorLightbox","errMsg","content","html","length","remove","show_lightbox_error","displayclass","callback","php_ajax","theAction","theObj","theSuccessFunc","theFailFunc","post","ajax_object","ajax_url","action","result","res","code","xhr","eval","fail","status","error","plugin","public","document","ready"],"sources":["public/js/sm.portal.plugin.public.js"],"mappings":"CAQA,SAAWA,OAAQC,WAEf,IAAIC,GAAKC,OAAOD,GAAKC,OAAOD,IAAM,CAAC,EAC/BE,OAASJ,OAAOI,OAChBC,KAAOL,OAAOK,KACdC,MAAQN,OAAOM,MACfC,KAAOP,OAAOO,KACdC,WAAaR,OAAOQ,WACpBC,UAAYN,OAAOO,UAiBvB,SAASC,sBACL,IAAIC,EAAOZ,OAAO,yBACda,EAASb,OAAO,mBAAmBc,QACnCC,EAAQH,EAAKI,KAAK,uBAEtBJ,EAAKK,IAAI,2BAA2BC,GAAG,SAAS,WAC5ChB,GAAGiB,OAAOC,GAAGC,SAASN,EAAOF,EAAQ,iBAKzC,IACAD,EAAKI,KAAK,kBAAkB,EAChC,CAEA,SAASM,gBACL,IAAIC,EAASvB,OAAO,yBAChBe,EAAQQ,EAAOP,KAAK,uBACpBQ,EAAUD,EAAOE,OAEjBF,EAAOG,OAAS,IAChBxB,GAAGiB,OAAOC,GAAGC,SAASN,EAAOS,EAAS,wBACtCD,EAAOI,SAEf,CAEA,SAASC,oBAAoBb,EAAOS,EAASK,EAAcC,GAEnC,MAAhBD,GAAwC,IAAhBA,IACxBA,EAAe,wBAEnB3B,GAAGiB,OAAOC,GAAGC,SAASN,EAAOS,EAASK,EAAcC,EACxD,CAMA,SAASC,SAASC,UAAWC,OAAQC,eAAgBC,aAEjDnC,OAAOoC,KACHC,YAAYC,SACR,CAKIC,OAAQP,UAGRQ,OAAQP,SAEZ,SAAUQ,IAAKC,KAAMC,KACL,WAARD,MACAE,KAAKV,eAAeO,KAE5B,IACFI,MAAK,SAAUF,IAAKG,OAAQC,OAC1BH,KAAKT,YAAYY,OACrB,GACR,MA3EyB,IAAd7C,GAAGiB,QACVf,OAAOF,GAAI,CAAEiB,OAAQ,CAAC,SAEM,IAArBjB,GAAGiB,OAAO6B,QACjB5C,OAAOF,GAAGiB,OAAQ,CAAE6B,OAAQ,CAAC,SAEM,IAA5B9C,GAAGiB,OAAO6B,OAAOC,QACxB7C,OAAOF,GAAGiB,OAAO6B,OAAQ,CAAEC,OAAQ,CAAC,IAGxCjD,OAAOkD,UAAUC,OAAM,WACnBjD,GAAGiB,OAAO6B,OAAOC,OAAOtC,sBACxBT,GAAGiB,OAAO6B,OAAOC,OAAO3B,eAC5B,IAgEAtB,OAAOI,QAAO,EAAMF,GAAGiB,OAAO6B,OAAOC,OAAQ,CACzCtC,oBAAqBA,oBACrBW,cAAeA,cACfM,oBAAqBA,oBACrBG,SAAUA,UAEjB,EA7FD,CA6FG/B","ignoreList":[],"sourcesContent":["/**\r\n* The public-facing redirect functionality of the login.\r\n*\r\n* @since 1.0.0\r\n*\r\n* @package U4SM-adaptor\r\n* @subpackage U4SM-adaptor/public/js\r\n*/\r\n(function (jQuery, undefined) {\r\n\r\n var sm = window.sm = window.sm || {},\r\n extend = jQuery.extend,\r\n each = jQuery.each,\r\n proxy = jQuery.proxy,\r\n noop = jQuery.noop,\r\n isFunction = jQuery.isFunction,\r\n globalize = window.Globalize;\r\n\r\n if (typeof sm.portal === \"undefined\") {\r\n extend(sm, { portal: {} });\r\n }\r\n if (typeof sm.portal.plugin === \"undefined\") {\r\n extend(sm.portal, { plugin: {} });\r\n }\r\n if (typeof sm.portal.plugin.public === \"undefined\") {\r\n extend(sm.portal.plugin, { public: {} });\r\n }\r\n\r\n jQuery(document).ready(function () {\r\n sm.portal.plugin.public.toggleSMHeaderLogin();\r\n sm.portal.plugin.public.errorLightbox();\r\n });\r\n\r\n function toggleSMHeaderLogin() {\r\n var that = jQuery('.smHeaderLogin button');\r\n var myMenu = jQuery('.sm_loginWidget').first();\r\n var title = that.attr('data-lightbox-title');\r\n\r\n that.not('[data-processed=\"true\"]').on('click', function () {\r\n sm.portal.ui.lightBox(title, myMenu, 'sm_loginDialog');\r\n // focus username field - sucks on ipad - disabling till i get better mobile detection in place\r\n //if (!jQuery('body').hasClass('ipad') || !jQuery('body').hasClass('iphone')) {\r\n // jQuery('.smModal .sm_loginFields input[type=\"text\"]').focus();\r\n //}\r\n });\r\n that.attr('data-processed', true);\r\n }\r\n\r\n function errorLightbox() {\r\n var errMsg = jQuery('.sm_loginErrorMessage');\r\n var title = errMsg.attr('data-lightbox-title');\r\n var content = errMsg.html();\r\n\r\n if (errMsg.length > 0) {\r\n sm.portal.ui.lightBox(title, content, 'sm_loginDialog error');\r\n errMsg.remove();\r\n }\r\n }\r\n\r\n function show_lightbox_error(title, content, displayclass, callback) {\r\n\r\n if (displayclass == null || displayclass == '') {\r\n displayclass = 'sm_loginDialog error';\r\n }\r\n sm.portal.ui.lightBox(title, content, displayclass, callback);\r\n }\r\n\r\n // theAction = string\r\n // theObj = any object\r\n // theSuccessFunc = function\r\n // theFailFunc = function \r\n function php_ajax(theAction, theObj, theSuccessFunc, theFailFunc) {\r\n\r\n jQuery.post(\r\n ajax_object.ajax_url, // object was declared in the \"redirect_scripts\" in the php file\r\n {\r\n // here we declare the parameters to send along with the request\r\n // this means the following action hooks will be fired\r\n // (assuming the action was \"save_options\"):\r\n // wp_ajax_nopriv_save_options and wp_ajax_save_options\r\n action: theAction,\r\n\r\n // other parameters can be added along with \"action\"\r\n result: theObj\r\n },\r\n function (res, code, xhr) {\r\n if (code == 'success') {\r\n eval(theSuccessFunc(res));\r\n }\r\n }\r\n ).fail(function (xhr, status, error) {\r\n eval(theFailFunc(error));\r\n });\r\n }\r\n\r\n jQuery.extend(true, sm.portal.plugin.public, {\r\n toggleSMHeaderLogin: toggleSMHeaderLogin,\r\n errorLightbox: errorLightbox, \r\n show_lightbox_error: show_lightbox_error, \r\n php_ajax: php_ajax,\r\n });\r\n})(jQuery);"]}