From b0f778f33d6984f93f170d66bd6fab5071c76b95 Mon Sep 17 00:00:00 2001 From: fkei Date: Tue, 5 Jun 2018 17:26:04 +0900 Subject: [PATCH] Bufix license comment. --- build.sh | 10 +--------- package.json | 2 +- sua.js | 5 ++--- sua.min.js | 14 +++++++++++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/build.sh b/build.sh index e7fb1cf..b50bc9a 100755 --- a/build.sh +++ b/build.sh @@ -35,16 +35,8 @@ VERSION=`node -e 'console.log(require("./sua").VERSION)'` echo echo "info: uglify start." -echo "/**" > ${__min} -echo " * @name sua.min.js" >> ${__min} -echo " * @version ${VERSION}" >> ${__min} -echo " * @overview Simple user agent detection library." >> ${__min} -echo " */" >> ${__min} - - -${__uglify} ${__src} -m -c unused=false >> ${__min} +${__uglify} ${__src} --comments -m -c unused=false >> ${__min} [ $? -ne 0 ] && echo "error: uglify running error." && exit 1 - echo "info: output -> ${__min}" exit 0 diff --git a/package.json b/package.json index 3d823d7..5903c02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sua.js", - "version": "2.3.0", + "version": "2.4.0", "description": "Simple user agent detection library.", "license": "MIT", "keywords": [ diff --git a/sua.js b/sua.js index 5a8ab86..be06fa1 100644 --- a/sua.js +++ b/sua.js @@ -1,8 +1,7 @@ -/* Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license */ /** * @name sua.js * @author Kei Funagayama - * @overview UserAgent decision for browser. fork zepto.js(http://zeptojs.com/) + * @overview UserAgent decision for browser. fork Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license * @license MIT */ @@ -580,7 +579,7 @@ } } - SUA.VERSION = '2.3.0'; + SUA.VERSION = '2.4.0'; if (typeof module !== 'undefined' && module.exports) { // node diff --git a/sua.min.js b/sua.min.js index 3eb22eb..0ad2dd2 100644 --- a/sua.min.js +++ b/sua.min.js @@ -1,6 +1,14 @@ /** - * @name sua.min.js - * @version 2.3.0 - * @overview Simple user agent detection library. + * @name sua.js + * @author Kei Funagayama + * @overview UserAgent decision for browser. fork Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license + * @license MIT */ !function(h){"use strict";function i(i){if(!i&&h&&h.navigator&&h.navigator.userAgent&&(i=h.navigator.userAgent),!i)throw new Error("useragent setup error. useragent not found.");if(this.ie=!!(0<=i.indexOf("MSIE")||0<=i.indexOf("Trident")||0<=i.indexOf("Edge")),this.webkit=i.match(/(WebKit|Webkit)\/([\d.]+)/),this.android=i.match(/(Android)\s+([\d.]+)/),this.android23=i.match(/(Android)\s+(2\.3)([\d.]+)/),this.android4=i.match(/(Android)\s+(4)([\d.]+)/),this.android5=i.match(/(Android)\s+(5)([\d.]+)/),this.android6=i.match(/(Android)\s+(6)([\d.]+)/),this.android7=i.match(/(Android)\s+(7)([\d.]+)/),this.android8=i.match(/(Android)\s+(8)([\d.]+)/),this.ipad=i.match(/(iPad).*OS\s([\d_]+)/),this.iphone=!this.ipad&&i.match(/(iPhone\sOS)\s([\d_]+)/),this.webos=i.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),this.touchpad=this.webos&&i.match(/TouchPad/),this.kindle=i.match(/(Kindle)/),this.silk=i.match(/(Silk)/),this.blackberry=i.match(/(BlackBerry).*/),this.bb10=i.match(/(BB10).*Version\/([\d.]+)/),this.rimtabletos=i.match(/(RIM\sTablet\sOS)\s([\d.]+)/),this.playbook=i.match(/PlayBook/),this.chrome=i.match(/Chrome\/([\d.]+)/)||i.match(/CriOS\/([\d.]+)/),this.firefox=i.match(/Firefox\/([\d.]+)/),this.wii=i.match(/Nintendo (Wii);/),this.wiiu=i.match(/Nintendo (WiiU)/),this.ds=i.match(/Nintendo (DS|3DS|DSi);/),this.nintendo_switch=i.match(/Nintendo (Switch);/),this.ps3=i.match(/PLAYSTATION 3/i),this.ps4=i.match(/PLAYSTATION 4/i),this.psp=i.match(/(PlayStation Portable)/),this.psvita=i.match(/(PlayStation Vita)/),this.windowsphone=i.match(/(Windows Phone |Windows Phone OS )([\d.]+)/),this.safari=i.match(/(Version)\/([0-9\.]+).*Safari\/([0-9\.]+)/),this.trident=i.match(/Trident\/([\d\.]+)/),this.xbox=i.match(/Xbox/i),this.iphone5=!("undefined"!=typeof module&&module.exports)&&this.iphone&&screen&&320===screen.width&&568===screen.height,this.vivaldi=i.match(/Vivaldi\/([\d.]+)/),this.iphone3=!(!this.iphone||1!==h.devicePixelRatio),this.chromecast=i.match(/CrKey/),this.roku=i.match(/Roku([\w.]+)/),this.firetv1=i.match(/AFTB/),this.firetv2=i.match(/AFTS/),this.firetvstick1=i.match(/AFTM/),this.firetvstick2=i.match(/AFTT/),this.firetv=!!(this.firetv1||this.firetv2||this.firetvstick1||this.firetvstick2),this.nexusplayer=i.match(/Nexus Player/),this.appletv=i.match(/AppleTV/),this.browser={locale:void 0,lang:void 0,country:void 0},this.os={},this.webkit&&!this.ie&&(this.browser.webkit=!0,this.browser.version=this.webkit[1]),this.trident&&(this.browser.trident=!0,this.browser.version=this.trident[1]),this.android){this.os.android=!0,this.os.version=this.android[2];try{this.browser.locale=i.match(/(Android)\s(.+);\s([^;]+);/)[3],this.browser.lang=this.browser.locale.substring(0,2),this.browser.country=this.browser.locale.substring(3)}catch(i){}}if(this.iphone&&(this.os.ios=this.os.iphone=!0,this.os.version=this.iphone[2].replace(/_/g,".")),this.ipad&&(this.os.ios=this.os.ipad=!0,this.os.version=this.ipad[2].replace(/_/g,".")),this.os.ios){var s=null;this.os.version&&(s=this.os.version.split(".")[0]);for(var t=3;t<12;t++)this["ios"+t]=s===""+t}this.webos&&(this.os.webos=!0,this.os.version=this.webos[2]),this.touchpad&&(this.os.touchpad=!0),this.blackberry&&(this.os.blackberry=!0),this.bb10&&(this.os.bb10=!0,this.os.version=this.bb10[2]),this.rimtabletos&&(this.os.rimtabletos=!0,this.os.version=this.rimtabletos[2]),this.playbook&&(this.browser.playbook=!0),this.kindle&&(this.os.kindle=!0),this.silk&&(this.browser.silk=!0),!this.silk&&this.os.android&&i.match(/Kindle Fire/)&&(this.browser.silk=!0),this.chrome&&!this.ie&&(this.browser.chrome=!0,this.browser.version=this.chrome[1]),this.firefox&&(this.browser.firefox=!0,this.browser.version=this.firefox[1],i.match(/Android/)&&(this.android=["Android","Android",""])),(this.wii||this.ds||this.wiiu||this.nintendo_switch)&&(this.os.nintendo=!0,(this.wiiu||this.nintendo_switch)&&(this.browser.nintendo=i.match(/NintendoBrowser\/([\d.]+)/),this.browser.version=this.browser.nintendo[1])),this.windowsphone&&(this.browser.windowsphone=!0,this.browser.version=this.windowsphone[2]),this.safari&&(this.browser.safari=!0,this.browser.version=this.safari[2]),this.ie&&(this.browser.ie=/(MSIE|rv:?)\s?([\d\.]+)/.exec(i),this.edge=!1,this.browser.ie?this.windowsphone||(this.browser.version=this.browser.ie?this.browser.ie[2]:""):(this.browser.ie=/(Edge\/)(\d.+)/.exec(i),this.browser.version=this.browser.ie[2],this.edge=!0,this.chrome=!1,this.webkit=!1),0 + * @overview UserAgent decision for browser. fork Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license + * @license MIT + */ +!function(h){"use strict";function i(i){if(!i&&h&&h.navigator&&h.navigator.userAgent&&(i=h.navigator.userAgent),!i)throw new Error("useragent setup error. useragent not found.");if(this.ie=!!(0<=i.indexOf("MSIE")||0<=i.indexOf("Trident")||0<=i.indexOf("Edge")),this.webkit=i.match(/(WebKit|Webkit)\/([\d.]+)/),this.android=i.match(/(Android)\s+([\d.]+)/),this.android23=i.match(/(Android)\s+(2\.3)([\d.]+)/),this.android4=i.match(/(Android)\s+(4)([\d.]+)/),this.android5=i.match(/(Android)\s+(5)([\d.]+)/),this.android6=i.match(/(Android)\s+(6)([\d.]+)/),this.android7=i.match(/(Android)\s+(7)([\d.]+)/),this.android8=i.match(/(Android)\s+(8)([\d.]+)/),this.ipad=i.match(/(iPad).*OS\s([\d_]+)/),this.iphone=!this.ipad&&i.match(/(iPhone\sOS)\s([\d_]+)/),this.webos=i.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),this.touchpad=this.webos&&i.match(/TouchPad/),this.kindle=i.match(/(Kindle)/),this.silk=i.match(/(Silk)/),this.blackberry=i.match(/(BlackBerry).*/),this.bb10=i.match(/(BB10).*Version\/([\d.]+)/),this.rimtabletos=i.match(/(RIM\sTablet\sOS)\s([\d.]+)/),this.playbook=i.match(/PlayBook/),this.chrome=i.match(/Chrome\/([\d.]+)/)||i.match(/CriOS\/([\d.]+)/),this.firefox=i.match(/Firefox\/([\d.]+)/),this.wii=i.match(/Nintendo (Wii);/),this.wiiu=i.match(/Nintendo (WiiU)/),this.ds=i.match(/Nintendo (DS|3DS|DSi);/),this.nintendo_switch=i.match(/Nintendo (Switch);/),this.ps3=i.match(/PLAYSTATION 3/i),this.ps4=i.match(/PLAYSTATION 4/i),this.psp=i.match(/(PlayStation Portable)/),this.psvita=i.match(/(PlayStation Vita)/),this.windowsphone=i.match(/(Windows Phone |Windows Phone OS )([\d.]+)/),this.safari=i.match(/(Version)\/([0-9\.]+).*Safari\/([0-9\.]+)/),this.trident=i.match(/Trident\/([\d\.]+)/),this.xbox=i.match(/Xbox/i),this.iphone5=!("undefined"!=typeof module&&module.exports)&&this.iphone&&screen&&320===screen.width&&568===screen.height,this.vivaldi=i.match(/Vivaldi\/([\d.]+)/),this.iphone3=!(!this.iphone||1!==h.devicePixelRatio),this.chromecast=i.match(/CrKey/),this.roku=i.match(/Roku([\w.]+)/),this.firetv1=i.match(/AFTB/),this.firetv2=i.match(/AFTS/),this.firetvstick1=i.match(/AFTM/),this.firetvstick2=i.match(/AFTT/),this.firetv=!!(this.firetv1||this.firetv2||this.firetvstick1||this.firetvstick2),this.nexusplayer=i.match(/Nexus Player/),this.appletv=i.match(/AppleTV/),this.browser={locale:void 0,lang:void 0,country:void 0},this.os={},this.webkit&&!this.ie&&(this.browser.webkit=!0,this.browser.version=this.webkit[1]),this.trident&&(this.browser.trident=!0,this.browser.version=this.trident[1]),this.android){this.os.android=!0,this.os.version=this.android[2];try{this.browser.locale=i.match(/(Android)\s(.+);\s([^;]+);/)[3],this.browser.lang=this.browser.locale.substring(0,2),this.browser.country=this.browser.locale.substring(3)}catch(i){}}if(this.iphone&&(this.os.ios=this.os.iphone=!0,this.os.version=this.iphone[2].replace(/_/g,".")),this.ipad&&(this.os.ios=this.os.ipad=!0,this.os.version=this.ipad[2].replace(/_/g,".")),this.os.ios){var s=null;this.os.version&&(s=this.os.version.split(".")[0]);for(var t=3;t<12;t++)this["ios"+t]=s===""+t}this.webos&&(this.os.webos=!0,this.os.version=this.webos[2]),this.touchpad&&(this.os.touchpad=!0),this.blackberry&&(this.os.blackberry=!0),this.bb10&&(this.os.bb10=!0,this.os.version=this.bb10[2]),this.rimtabletos&&(this.os.rimtabletos=!0,this.os.version=this.rimtabletos[2]),this.playbook&&(this.browser.playbook=!0),this.kindle&&(this.os.kindle=!0),this.silk&&(this.browser.silk=!0),!this.silk&&this.os.android&&i.match(/Kindle Fire/)&&(this.browser.silk=!0),this.chrome&&!this.ie&&(this.browser.chrome=!0,this.browser.version=this.chrome[1]),this.firefox&&(this.browser.firefox=!0,this.browser.version=this.firefox[1],i.match(/Android/)&&(this.android=["Android","Android",""])),(this.wii||this.ds||this.wiiu||this.nintendo_switch)&&(this.os.nintendo=!0,(this.wiiu||this.nintendo_switch)&&(this.browser.nintendo=i.match(/NintendoBrowser\/([\d.]+)/),this.browser.version=this.browser.nintendo[1])),this.windowsphone&&(this.browser.windowsphone=!0,this.browser.version=this.windowsphone[2]),this.safari&&(this.browser.safari=!0,this.browser.version=this.safari[2]),this.ie&&(this.browser.ie=/(MSIE|rv:?)\s?([\d\.]+)/.exec(i),this.edge=!1,this.browser.ie?this.windowsphone||(this.browser.version=this.browser.ie?this.browser.ie[2]:""):(this.browser.ie=/(Edge\/)(\d.+)/.exec(i),this.browser.version=this.browser.ie[2],this.edge=!0,this.chrome=!1,this.webkit=!1),0