Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 4.11 KB | None | 0 0
  1.     var ccCore={TARGET_DESKTOP:"desktop",TARGET_OOCSS:"oocss",mAuthUser:[],USER_GROUPID_USER:0,USER_GROUPID_ADMIN:1,USER_GROUPID_MODERATOR:2,USER_GROUPID_SUPER_MODERATOR:3,USER_GROUPID_SUPPORTER:4,USER_GROUPID_ADMIN_SHOP:5,USER_GROUPID_EXPERT:6,USER_GROUPID_COMMUNITY_MANAGER:7,mTarget:this.TARGET_DESKTOP,init:function(a,b){ccCore.mAuthUser=a;ccCore.mTarget=b},log:function(a,b){var c="undefined"!==typeof console&&"undefined"!==typeof console.log;"undefined"===typeof b?c&&console.log(a):c&&console.log(a,
  2. b)},info:function(a,b){var c="undefined"!==typeof console&&"undefined"!==typeof console.info;"undefined"===typeof b?c&&console.info(a):c&&console.info(a,b)},debug:function(a,b){var c="undefined"!==typeof console&&"undefined"!==typeof console.debug;"undefined"===typeof b?c&&console.debug(a):c&&console.debug(a,b)},warn:function(a,b){var c="undefined"!==typeof console&&"undefined"!==typeof console.warn;"undefined"===typeof b?c&&console.warn(a):c&&console.warn(a,b)},error:function(a,b){var c="undefined"!==
  3. typeof console&&"undefined"!==typeof console.error;"undefined"===typeof obj?c&&console.error(a):c&&console.error(a,b)},historyPushState:function(a,b,c){"undefined"!==typeof history&&"undefined"!==typeof history.pushState&&history.pushState(a,b,c)},historyReplaceState:function(a,b,c){"undefined"!==typeof history&&"undefined"!==typeof history.replaceState&&history.replaceState(a,b,c)},historyBack:function(){"undefined"!==typeof history&&"undefined"!==typeof history.back&&history.back()},historyForward:function(){"undefined"!==
  4. typeof history&&"undefined"!==typeof history.forward&&history.forward()},clone:function(a){return jQuery.extend({},a)},cloneD:function(a){return jQuery.extend(!0,{},jQuery.extend(!0,{},a))},arrayGet:function(a,b,c){return"undefined"==typeof a||null==a||"undefined"==typeof a[b]?"undefined"==typeof c?0:c:a[b]},timeSql2Unix:function(a){a=a.replace(/-/g,"/");return Math.round((new Date(a)).getTime()/1E3)},timeSql2Human:function(a){var b;b=""+a.substring(8,10);b=b+"."+a.substring(5,7);b+=".";return b+=
  5. a.substring(0,4)},timeUnix:function(){return parseInt((new Date).getTime()/1E3)},timeUnix2HumanDate:function(a){return(new Date(1E3*a)).toLocaleDateString(navigator.userLanguage||navigator.language,{day:"numeric",month:"numeric"})},isAWE:function(){return navigator.userAgent.match(/(Awesomium)/g)?!0:!1},isIOS:function(){return navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1},isMobile:function(){return/iphone|ipod|android|iemobile|opera mini|blackberry|fennec/.test(navigator.userAgent.toLowerCase())},
  6. isAndroid:function(){return navigator.userAgent.match(/Android/g)?!0:!1},getAndroidVersion:function(){var a=navigator.userAgent;return 0<=a.indexOf("Android")?parseFloat(a.slice(a.indexOf("Android")+8)):0},modalAlert:function(a,b){"undefined"!=typeof smoke?smoke.alert(a,function(a){a&&"undefined"!=typeof b&&("function"==typeof b?b.call():window.location=b)},{ok:ccText.txt("layout_generic_ok")}):alert(a)&&"undefined"!=typeof b&&("function"==typeof b?b.call():window.location=b);return!1},modalConfirm:function(a,
  7. b){"undefined"!=typeof smoke?smoke.confirm(a,function(a){a&&"undefined"!=typeof b&&("function"==typeof b?b.call():window.location=b)},{ok:ccText.txt("layout_generic_yes"),cancel:ccText.txt("layout_generic_cancel"),reverseButtons:!0}):confirm(a)&&"undefined"!=typeof b&&("function"==typeof b?b.call():window.location=b);return!1},authSetUser:function(a){ccCore.mAuthUser=a},authGetUserId:function(){return ccCore.arrayGet(ccCore.mAuthUser,"id",0)},authGetUserName:function(){return ccCore.arrayGet(ccCore.mAuthUser,
  8. "name","")},authGetUserGroupId:function(){return ccCore.arrayGet(ccCore.mAuthUser,"group_id",0)},checkTarget:function(a){return ccCore.mTarget==a},scrollIntoView:function(a){if("undefined"!=typeof a){var b=$(window).scrollTop(),c=b+$(window).height(),d=$(a).offset().top;a=d+$(a).height();var e=-1;d<b||b+a-c>=d?e=d-16:a>c&&(e=b+a-c+16);0<e&&$(window).scrollTop(e)}},getEventHandlerTarget:function(){var a=$("#eventHandlerTarget");0==$(a).length&&(a=$(document));return $(a)},stringBeginsWith:function(a,
  9. b){return 0===a.lastIndexOf(b,0)},stringEndsWith:function(a,b){return-1!==a.indexOf(b,a.length-b.length)}};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement