WordPress.org

Ready to get started?Download WordPress

Forums

Safari Push
[resolved] Compress the JS file to speed up loading (3 posts)

  1. Djib's
    Member
    Posted 7 months ago #

    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/

  2. macgamer
    Member
    Plugin Author

    Posted 7 months ago #

    I've added this as an issue if you want to track or add any other comments

    https://github.com/surrealroad/wp-safari-push/issues/8

  3. Djib's
    Member
    Posted 7 months ago #

    thank you

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.