Support » Plugin: Safari Push » Compress the JS file to speed up loading

  • Resolved Djib's

    (@djibs13)


    Hello,

    To speed up the display of pages, it would be nice to provide a compressed version of the javascript file.

    jQuery(document).ready(function(){var a=window.navigator.userAgent,b=a.indexOf(“Safari”),a=a.substring(0,b).substring(a.substring(0,b).lastIndexOf(“/”)+1);null===SafariPushParams.websitePushID?(console.log(“Website Push ID is missing”),SafariPushParams.status=”error”):null===SafariPushParams.webServiceURL?(console.log(“Web Service URL is missing”),SafariPushParams.status=”error”):0<b&&7<=parseInt(a,10)?surrealroad_safaripush_checkPermission():SafariPushParams.status=”unsupported”;surrealroad_safaripush_rendershortcode(SafariPushParams.status)}); function surrealroad_safaripush_checkPermission(){var a=window.safari.pushNotification.permission(SafariPushParams.websitePushID);SafariPushParams.status=a.permission;”default”===a.permission?surrealroad_safaripush_requestPermission():”granted”===a.permission&&(SafariPushParams.token=a.deviceToken)} function surrealroad_safaripush_requestPermission(){window.safari.pushNotification.requestPermission(SafariPushParams.webServiceURL,SafariPushParams.websitePushID,null,surrealroad_safaripush_requestPermissionCallback)}function surrealroad_safaripush_requestPermissionCallback(a){“granted”===a.permission&&(SafariPushParams.token=a.deviceToken);SafariPushParams.status=a.permission;surrealroad_safaripush_rendershortcode(SafariPushParams.status)} function surrealroad_safaripush_rendershortcode(a){var b=””;switch(a){case “error”:b=SafariPushParams.errorMsg;break;case “unsupported”:b=SafariPushParams.unsupportedMsg;break;case “granted”:b=SafariPushParams.grantedMsg;break;case “denied”:b=SafariPushParams.deniedMsg;break;default:b=SafariPushParams.defaultMsg}jQuery(“.safari-push-info”).html(b)};

    http://wordpress.org/plugins/safari-push/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compress the JS file to speed up loading’ is closed to new replies.