jquery-viewer
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Changelog | ||
## 1.0.1 (Dec 14, 2019) | ||
- Register as a plugin only when both the jQuery and Cropper.js are existing. | ||
## 1.0.0 (Apr 1, 2018) | ||
@@ -4,0 +8,0 @@ |
/*! | ||
* jQuery Viewer v1.0.0 | ||
* https://github.com/fengyuanchen/jquery-viewer | ||
* jQuery Viewer v1.0.1 | ||
* https://fengyuanchen.github.io/jquery-viewer | ||
* | ||
* Copyright (c) 2018 Chen Fengyuan | ||
* Copyright 2018-present Chen Fengyuan | ||
* Released under the MIT license | ||
* | ||
* Date: 2018-04-01T05:58:29.617Z | ||
* Date: 2019-12-14T09:00:02.315Z | ||
*/ | ||
@@ -18,3 +18,3 @@ | ||
if ($.fn) { | ||
if ($ && $.fn && Viewer) { | ||
var AnotherViewer = $.fn.viewer; | ||
@@ -24,8 +24,7 @@ var NAMESPACE = 'viewer'; | ||
$.fn.viewer = function jQueryViewer(option) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var result = void 0; | ||
var result; | ||
this.each(function (i, element) { | ||
@@ -42,3 +41,2 @@ var $element = $(element); | ||
var options = $.extend({}, $element.data(), $.isPlainObject(option) && option); | ||
viewer = new Viewer(element, options); | ||
@@ -64,3 +62,2 @@ $element.data(NAMESPACE, viewer); | ||
}); | ||
return result !== undefined ? result : this; | ||
@@ -71,2 +68,3 @@ }; | ||
$.fn.viewer.setDefaults = Viewer.setDefaults; | ||
$.fn.viewer.noConflict = function noConflict() { | ||
@@ -73,0 +71,0 @@ $.fn.viewer = AnotherViewer; |
/*! | ||
* jQuery Viewer v1.0.0 | ||
* https://github.com/fengyuanchen/jquery-viewer | ||
* jQuery Viewer v1.0.1 | ||
* https://fengyuanchen.github.io/jquery-viewer | ||
* | ||
* Copyright (c) 2018 Chen Fengyuan | ||
* Copyright 2018-present Chen Fengyuan | ||
* Released under the MIT license | ||
* | ||
* Date: 2018-04-01T05:58:29.617Z | ||
* Date: 2019-12-14T09:00:02.315Z | ||
*/ | ||
@@ -14,3 +14,3 @@ | ||
if ($.fn) { | ||
if ($ && $.fn && Viewer) { | ||
var AnotherViewer = $.fn.viewer; | ||
@@ -20,8 +20,7 @@ var NAMESPACE = 'viewer'; | ||
$.fn.viewer = function jQueryViewer(option) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var result = void 0; | ||
var result; | ||
this.each(function (i, element) { | ||
@@ -38,3 +37,2 @@ var $element = $(element); | ||
var options = $.extend({}, $element.data(), $.isPlainObject(option) && option); | ||
viewer = new Viewer(element, options); | ||
@@ -60,3 +58,2 @@ $element.data(NAMESPACE, viewer); | ||
}); | ||
return result !== undefined ? result : this; | ||
@@ -67,2 +64,3 @@ }; | ||
$.fn.viewer.setDefaults = Viewer.setDefaults; | ||
$.fn.viewer.noConflict = function noConflict() { | ||
@@ -69,0 +67,0 @@ $.fn.viewer = AnotherViewer; |
/*! | ||
* jQuery Viewer v1.0.0 | ||
* https://github.com/fengyuanchen/jquery-viewer | ||
* jQuery Viewer v1.0.1 | ||
* https://fengyuanchen.github.io/jquery-viewer | ||
* | ||
* Copyright (c) 2018 Chen Fengyuan | ||
* Copyright 2018-present Chen Fengyuan | ||
* Released under the MIT license | ||
* | ||
* Date: 2018-04-01T05:58:29.617Z | ||
* Date: 2019-12-14T09:00:02.315Z | ||
*/ | ||
@@ -14,4 +14,4 @@ | ||
typeof define === 'function' && define.amd ? define(['jquery', 'viewerjs'], factory) : | ||
(factory(global.jQuery,global.Viewer)); | ||
}(this, (function ($,Viewer) { 'use strict'; | ||
(global = global || self, factory(global.jQuery, global.Viewer)); | ||
}(this, (function ($, Viewer) { 'use strict'; | ||
@@ -21,3 +21,3 @@ $ = $ && $.hasOwnProperty('default') ? $['default'] : $; | ||
if ($.fn) { | ||
if ($ && $.fn && Viewer) { | ||
var AnotherViewer = $.fn.viewer; | ||
@@ -27,8 +27,7 @@ var NAMESPACE = 'viewer'; | ||
$.fn.viewer = function jQueryViewer(option) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var result = void 0; | ||
var result; | ||
this.each(function (i, element) { | ||
@@ -45,3 +44,2 @@ var $element = $(element); | ||
var options = $.extend({}, $element.data(), $.isPlainObject(option) && option); | ||
viewer = new Viewer(element, options); | ||
@@ -67,3 +65,2 @@ $element.data(NAMESPACE, viewer); | ||
}); | ||
return result !== undefined ? result : this; | ||
@@ -74,2 +71,3 @@ }; | ||
$.fn.viewer.setDefaults = Viewer.setDefaults; | ||
$.fn.viewer.noConflict = function noConflict() { | ||
@@ -76,0 +74,0 @@ $.fn.viewer = AnotherViewer; |
/*! | ||
* jQuery Viewer v1.0.0 | ||
* https://github.com/fengyuanchen/jquery-viewer | ||
* jQuery Viewer v1.0.1 | ||
* https://fengyuanchen.github.io/jquery-viewer | ||
* | ||
* Copyright (c) 2018 Chen Fengyuan | ||
* Copyright 2018-present Chen Fengyuan | ||
* Released under the MIT license | ||
* | ||
* Date: 2018-04-01T05:58:29.617Z | ||
* Date: 2019-12-14T09:00:02.315Z | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery"),require("viewerjs")):"function"==typeof define&&define.amd?define(["jquery","viewerjs"],t):t(e.jQuery,e.Viewer)}(this,function(d,v){"use strict";if(d=d&&d.hasOwnProperty("default")?d.default:d,v=v&&v.hasOwnProperty("default")?v.default:v,d.fn){var e=d.fn.viewer,c="viewer";d.fn.viewer=function(o){for(var e=arguments.length,u=Array(1<e?e-1:0),t=1;t<e;t++)u[t-1]=arguments[t];var s=void 0;return this.each(function(e,t){var r=d(t),i="destroy"===o,n=r.data(c);if(!n){if(i)return;var f=d.extend({},r.data(),d.isPlainObject(o)&&o);n=new v(t,f),r.data(c,n)}if("string"==typeof o){var a=n[o];d.isFunction(a)&&((s=a.apply(n,u))===n&&(s=void 0),i&&r.removeData(c))}}),void 0!==s?s:this},d.fn.viewer.Constructor=v,d.fn.viewer.setDefaults=v.setDefaults,d.fn.viewer.noConflict=function(){return d.fn.viewer=e,this}}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery"),require("viewerjs")):"function"==typeof define&&define.amd?define(["jquery","viewerjs"],t):t((e=e||self).jQuery,e.Viewer)}(this,function(d,v){"use strict";if(d=d&&d.hasOwnProperty("default")?d.default:d,v=v&&v.hasOwnProperty("default")?v.default:v,d&&d.fn&&v){var e=d.fn.viewer,w="viewer";d.fn.viewer=function(o){for(var e=arguments.length,u=new Array(1<e?e-1:0),t=1;t<e;t++)u[t-1]=arguments[t];var s;return this.each(function(e,t){var r=d(t),n="destroy"===o,i=r.data(w);if(!i){if(n)return;var f=d.extend({},r.data(),d.isPlainObject(o)&&o);i=new v(t,f),r.data(w,i)}if("string"==typeof o){var a=i[o];d.isFunction(a)&&((s=a.apply(i,u))===i&&(s=void 0),n&&r.removeData(w))}}),void 0!==s?s:this},d.fn.viewer.Constructor=v,d.fn.viewer.setDefaults=v.setDefaults,d.fn.viewer.noConflict=function(){return d.fn.viewer=e,this}}}); |
127
package.json
{ | ||
"name": "jquery-viewer", | ||
"description": "A jQuery plugin wrapper for Viewer.js.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "dist/jquery-viewer.common.js", | ||
"module": "dist/jquery-viewer.esm.js", | ||
"unpkg": "dist/jquery-viewer.js", | ||
"repository": "fengyuanchen/jquery-viewer", | ||
"homepage": "https://fengyuanchen.github.io/jquery-viewer", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Chen Fengyuan", | ||
"url": "http://chenfengyuan.com" | ||
}, | ||
"browser": "dist/jquery-viewer.js", | ||
"files": [ | ||
@@ -19,19 +12,6 @@ "src", | ||
], | ||
"keywords": [ | ||
"image", | ||
"viewer", | ||
"viewer.js", | ||
"viewing", | ||
"jquery", | ||
"jquery-plugin", | ||
"html", | ||
"css", | ||
"javascript", | ||
"front-end", | ||
"web" | ||
], | ||
"scripts": { | ||
"build": "rollup -c", | ||
"clear": "del-cli dist", | ||
"commitmsg": "npm run lint && commitlint -e", | ||
"codecov": "cat coverage/lcov.info | codecov", | ||
"compress": "uglifyjs dist/jquery-viewer.js -o dist/jquery-viewer.min.js -c -m --comments /^!/", | ||
@@ -41,39 +21,82 @@ "lint": "eslint src test *.js --fix", | ||
"start": "rollup -c -m -w", | ||
"test": "karma start test/karma.conf.js" | ||
"test": "karma start" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/fengyuanchen/jquery-viewer.git" | ||
}, | ||
"keywords": [ | ||
"image", | ||
"viewer", | ||
"jquery", | ||
"jquery-plugin" | ||
], | ||
"author": { | ||
"name": "Chen Fengyuan", | ||
"url": "https://chenfengyuan.com/" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/fengyuanchen/jquery-viewer/issues" | ||
}, | ||
"homepage": "https://fengyuanchen.github.io/jquery-viewer", | ||
"devDependencies": { | ||
"@commitlint/cli": "^6.1.3", | ||
"@commitlint/config-angular": "^6.1.3", | ||
"babel-core": "^6.26.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-env": "^1.6.1", | ||
"chai": "^4.1.2", | ||
"del-cli": "^1.1.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.10.0", | ||
"husky": "^0.14.3", | ||
"jquery": "^3.3.1", | ||
"karma": "^2.0.0", | ||
"@babel/core": "^7.7.5", | ||
"@babel/preset-env": "^7.7.6", | ||
"@commitlint/cli": "^8.2.0", | ||
"@commitlint/config-conventional": "^8.2.0", | ||
"babel-plugin-istanbul": "^5.2.0", | ||
"chai": "^4.2.0", | ||
"codecov": "^3.6.1", | ||
"create-banner": "^1.0.0", | ||
"viewerjs": "^1.4.0", | ||
"del-cli": "^3.0.0", | ||
"eslint": "^6.7.2", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"husky": "^3.1.0", | ||
"jquery": "^3.4.1", | ||
"lint-staged": "^9.5.0", | ||
"karma": "^4.4.1", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-coverage": "^1.1.1", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-coverage-istanbul-reporter": "^2.1.1", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-rollup-preprocessor": "^5.1.1", | ||
"mocha": "^5.0.5", | ||
"puppeteer": "^1.2.0", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-alias": "^1.4.0", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "^9.1.0", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-watch": "^4.3.1", | ||
"uglify-js": "^3.3.17", | ||
"viewerjs": "^1.0.0" | ||
"karma-rollup-preprocessor": "^7.0.2", | ||
"mocha": "^6.2.2", | ||
"puppeteer": "^2.0.0", | ||
"rollup": "^1.27.12", | ||
"rollup-plugin-alias": "^2.2.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"uglify-js": "^3.7.2" | ||
}, | ||
"peerDependencies": { | ||
"viewerjs": ">= 1.0.0", | ||
"jquery": ">= 1.9.1" | ||
"viewerjs": ">=1.5.0", | ||
"jquery": ">=1.9.1" | ||
}, | ||
"browserslist": [ | ||
"last 2 versions", | ||
"> 1%", | ||
"not ie <= 8" | ||
], | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"lint-staged": { | ||
"{src,test}/**/*.js|*.conf*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
] | ||
} | ||
} |
# jquery-viewer | ||
[![Build Status](https://travis-ci.org/fengyuanchen/jquery-viewer.svg)](https://travis-ci.org/fengyuanchen/jquery-viewer) [![Downloads](https://img.shields.io/npm/dm/jquery-viewer.svg)](https://www.npmjs.com/package/jquery-viewer) [![Version](https://img.shields.io/npm/v/jquery-viewer.svg)](https://www.npmjs.com/package/jquery-viewer) | ||
[![Build Status](https://img.shields.io/travis/fengyuanchen/jquery-viewer.svg)](https://travis-ci.org/fengyuanchen/jquery-viewer) [![Coverage Status](https://img.shields.io/codecov/c/github/fengyuanchen/jquery-viewer.svg)](https://codecov.io/gh/fengyuanchen/jquery-viewer) [![Downloads](https://img.shields.io/npm/dm/jquery-viewer.svg)](https://www.npmjs.com/package/jquery-viewer) [![Version](https://img.shields.io/npm/v/jquery-viewer.svg)](https://www.npmjs.com/package/jquery-viewer) | ||
@@ -111,14 +111,10 @@ > A jQuery plugin wrapper for [Viewer.js](https://github.com/fengyuanchen/viewerjs). | ||
It is the same as the [browser support of Viewer.js](https://github.com/fengyuanchen/viewerjs#browser-support). As a jQuery plugin, you also need to see the [jQuery Browser Support](http://jquery.com/browser-support/). | ||
It is the same as the [browser support of Viewer.js](https://github.com/fengyuanchen/viewerjs#browser-support). As a jQuery plugin, you also need to see the [jQuery Browser Support](https://jquery.com/browser-support/). | ||
## Contributing | ||
Please read through our [contributing guidelines](.github/CONTRIBUTING.md). | ||
## Versioning | ||
Maintained under the [Semantic Versioning guidelines](http://semver.org/). | ||
Maintained under the [Semantic Versioning guidelines](https://semver.org/). | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) © [Chen Fengyuan](http://chenfengyuan.com) | ||
[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com/) |
import $ from 'jquery'; | ||
import Viewer from 'viewerjs'; | ||
if ($.fn) { | ||
if ($ && $.fn && Viewer) { | ||
const AnotherViewer = $.fn.viewer; | ||
@@ -6,0 +6,0 @@ const NAMESPACE = 'viewer'; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
14891
0
0
31
120