diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df81d2f..eb1298a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,24 @@ +2.1.0 / 2016-06-22 +================== + +New functionality and features +------------------------------ + + * New configuration parameter `:client_hints` + * Enhanced auto `width` values + * Enhanced `quality` values + +Other Changes +------------- + + * Use duck-typing to set/get attributes. + * Updated dependencies + * Add `client_hints`, `width`, `quality` tests + * Create spec-helper.coffee. Add `sharedExamples`. + * Fix assets compilation issue with Cloudinary GEM cloudinary/cloudinary_gem#203 + * Remove map reference in `js` folder. Fixes cloudinary/cloudinary_gem#199 + 2.0.9 / 2016-06-05 ================== diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 199e0ad6..5c4deb60 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -61,12 +61,22 @@ module.exports = (grunt)-> reporters: ['dots'] configFile: 'karma.coffee' browserDisconnectTolerance: 3 + files: [ + { pattern: 'test/docRoot/*', watched: false, included: false, served: true, nocache: false} + { pattern: 'test/docRoot/css/*', watched: false, included: false, served: true, nocache: false} + { pattern: 'bower_components/bootstrap/dist/css/*', watched: false, included: false, served: true, nocache: false} + { pattern: 'bower_components/bootstrap/dist/js/*', watched: false, included: false, served: true, nocache: false} + { pattern: 'bower_components/blueimp-file-upload/js/*', watched: false, included: false, served: true, nocache: false} + { pattern: 'bower_components/jquery.ui/ui/*', watched: false, included: false, served: true, nocache: false} + ] + 'cloudinary-core': files: src: [ "bower_components/lodash/lodash.js" "<%= karmaCommon %>" + "test/spec/responsive-core-spec.js" ] @@ -74,6 +84,7 @@ module.exports = (grunt)-> files: src: [ "<%= karmaCommon %>" + "test/spec/responsive-shrinkwrap-spec.js" ] 'cloudinary-jquery': @@ -81,6 +92,7 @@ module.exports = (grunt)-> src: [ "bower_components/jquery/dist/jquery.js" "<%= karmaCommon %>" + "test/spec/responsive-jquery-spec.js" ] 'cloudinary-jquery-file-upload': @@ -152,12 +164,12 @@ module.exports = (grunt)-> files: for repo in repos dest = if /shrinkwrap/.test(repo) then "cloudinary-core" else repo {'cwd': 'build','src': ["#{repo}.js", "#{repo}.min.js", "#{repo}.min.js.map"], 'dest': "../pkg/pkg-#{dest}/", 'expand': true} - doc: - files: for repo in repos when !/shrinkwrap/.test(repo) - expand: true - cwd: "doc/pkg-#{repo}/" - src: ["**"] - dest: "../pkg/pkg-#{repo}/" +# doc: +# files: for repo in repos when !/shrinkwrap/.test(repo) +# expand: true +# cwd: "doc/pkg-#{repo}/" +# src: ["**"] +# dest: "../pkg/pkg-#{repo}/" version: options: @@ -282,7 +294,7 @@ module.exports = (grunt)-> grunt.loadNpmTasks('grunt-version') grunt.registerTask('default', ['concat', 'coffee']) - grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'coffee', 'copy:backward-compatible', 'copy:dist']) + grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'coffee', 'copy:backward-compatible']) grunt.registerTask('build', ['clean', 'concat', 'coffee', 'copy:backward-compatible', 'jsdoc']) grunt.registerTask('lodash', (name, target)-> lodashCalls = grunt.file.read('src/util/lodash.coffee').match(/_\.\w+/g) diff --git a/Gruntfile.js b/Gruntfile.js index 141dd641..91c25c7c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -60,21 +60,60 @@ options: { reporters: ['dots'], configFile: 'karma.coffee', - browserDisconnectTolerance: 3 + browserDisconnectTolerance: 3, + files: [ + { + pattern: 'test/docRoot/*', + watched: false, + included: false, + served: true, + nocache: false + }, { + pattern: 'test/docRoot/css/*', + watched: false, + included: false, + served: true, + nocache: false + }, { + pattern: 'bower_components/bootstrap/dist/css/*', + watched: false, + included: false, + served: true, + nocache: false + }, { + pattern: 'bower_components/bootstrap/dist/js/*', + watched: false, + included: false, + served: true, + nocache: false + }, { + pattern: 'bower_components/blueimp-file-upload/js/*', + watched: false, + included: false, + served: true, + nocache: false + }, { + pattern: 'bower_components/jquery.ui/ui/*', + watched: false, + included: false, + served: true, + nocache: false + } + ] }, 'cloudinary-core': { files: { - src: ["bower_components/lodash/lodash.js", "<%= karmaCommon %>"] + src: ["bower_components/lodash/lodash.js", "<%= karmaCommon %>", "test/spec/responsive-core-spec.js"] } }, 'cloudinary-core-shrinkwrap': { files: { - src: ["<%= karmaCommon %>"] + src: ["<%= karmaCommon %>", "test/spec/responsive-shrinkwrap-spec.js"] } }, 'cloudinary-jquery': { files: { - src: ["bower_components/jquery/dist/jquery.js", "<%= karmaCommon %>"] + src: ["bower_components/jquery/dist/jquery.js", "<%= karmaCommon %>", "test/spec/responsive-jquery-spec.js"] } }, 'cloudinary-jquery-file-upload': { @@ -151,24 +190,6 @@ } return results; })() - }, - doc: { - files: (function() { - var i, len, results; - results = []; - for (i = 0, len = repos.length; i < len; i++) { - repo = repos[i]; - if (!/shrinkwrap/.test(repo)) { - results.push({ - expand: true, - cwd: "doc/pkg-" + repo + "/", - src: ["**"], - dest: "../pkg/pkg-" + repo + "/" - }); - } - } - return results; - })() } }, version: { @@ -240,7 +261,7 @@ grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-version'); grunt.registerTask('default', ['concat', 'coffee']); - grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'coffee', 'copy:backward-compatible', 'copy:dist']); + grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'coffee', 'copy:backward-compatible']); grunt.registerTask('build', ['clean', 'concat', 'coffee', 'copy:backward-compatible', 'jsdoc']); return grunt.registerTask('lodash', function(name, target) { var func, i, include, len, lodashCalls; diff --git a/bower.json b/bower.json index 826542be..fcb298e4 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "cloudinary", - "version": "2.0.9", + "version": "2.1.0", "title": "Cloudinary jQuery Plugin", "authors": [ { diff --git a/js/jquery.cloudinary.js b/js/jquery.cloudinary.js index 4c1fec41..bab6f030 100644 --- a/js/jquery.cloudinary.js +++ b/js/jquery.cloudinary.js @@ -1,6 +1,6 @@ /** - * Cloudinary's JavaScript library - Version 2.0.9 + * Cloudinary's JavaScript library - Version 2.1.0 * Copyright Cloudinary * see https://github.com/cloudinary/cloudinary_js * @@ -2391,6 +2391,12 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal return element; }; + HtmlTag.isResponsive = function(tag, responsiveClass) { + var dataSrc; + dataSrc = Util.getData(tag, 'src-cache') || Util.getData(tag, 'src'); + return Util.hasClass(tag, responsiveClass) && /\bw_auto\b/.exec(dataSrc); + }; + return HtmlTag; })(); @@ -2839,9 +2845,9 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal })(TextLayer); Cloudinary = (function() { - var AKAMAI_SHARED_CDN, CF_SHARED_CDN, DEFAULT_POSTER_OPTIONS, DEFAULT_VIDEO_SOURCE_TYPES, OLD_AKAMAI_SHARED_CDN, SHARED_CDN, VERSION, absolutize, applyBreakpoints, cdnSubdomainNumber, closestAbove, cloudinaryUrlPrefix, defaultBreakpoints, finalizeResourceType, parentWidth; + var AKAMAI_SHARED_CDN, CF_SHARED_CDN, DEFAULT_POSTER_OPTIONS, DEFAULT_VIDEO_SOURCE_TYPES, OLD_AKAMAI_SHARED_CDN, SHARED_CDN, VERSION, absolutize, applyBreakpoints, cdnSubdomainNumber, closestAbove, cloudinaryUrlPrefix, defaultBreakpoints, finalizeResourceType, findContainerWidth, maxWidth, updateDpr; - VERSION = "2.0.9"; + VERSION = "2.1.0"; CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net"; @@ -3360,11 +3366,11 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal * @ignore */ - Cloudinary.prototype.calc_breakpoint = function(element, width) { + Cloudinary.prototype.calc_breakpoint = function(element, width, steps) { var breakpoints, point; breakpoints = Util.getData(element, 'breakpoints') || Util.getData(element, 'stoppoints') || this.config('breakpoints') || this.config('stoppoints') || defaultBreakpoints; if (Util.isFunction(breakpoints)) { - return breakpoints(width); + return breakpoints(width, steps); } else { if (Util.isString(breakpoints)) { breakpoints = ((function() { @@ -3419,8 +3425,11 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal return dprString; }; - defaultBreakpoints = function(width) { - return 100 * Math.ceil(width / 100); + defaultBreakpoints = function(width, steps) { + if (steps == null) { + steps = 100; + } + return steps * Math.ceil(width / steps); }; closestAbove = function(list, value) { @@ -3515,17 +3524,17 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal return this; }; - applyBreakpoints = function(tag, width, options) { + applyBreakpoints = function(tag, width, steps, options) { var ref, ref1, ref2, responsive_use_breakpoints; responsive_use_breakpoints = (ref = (ref1 = (ref2 = options['responsive_use_breakpoints']) != null ? ref2 : options['responsive_use_stoppoints']) != null ? ref1 : this.config('responsive_use_breakpoints')) != null ? ref : this.config('responsive_use_stoppoints'); if ((!responsive_use_breakpoints) || (responsive_use_breakpoints === 'resize' && !options.resizing)) { return width; } else { - return this.calc_breakpoint(tag, width); + return this.calc_breakpoint(tag, width, steps); } }; - parentWidth = function(element) { + findContainerWidth = function(element) { var containerWidth, style; containerWidth = 0; while (((element = element != null ? element.parentNode : void 0) instanceof Element) && !containerWidth) { @@ -3537,6 +3546,20 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal return containerWidth; }; + updateDpr = function(dataSrc, roundDpr) { + return dataSrc.replace(/\bdpr_(1\.0|auto)\b/g, 'dpr_' + this.device_pixel_ratio(roundDpr)); + }; + + maxWidth = function(requiredWidth, tag) { + var imageWidth; + imageWidth = Util.getData(tag, 'width') || 0; + if (requiredWidth > imageWidth) { + imageWidth = requiredWidth; + Util.setData(tag, 'width', requiredWidth); + } + return requiredWidth; + }; + /** * Update hidpi (dpr_auto) and responsive (w_auto) fields according to the current container size and the device pixel ratio. @@ -3554,10 +3577,16 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal */ Cloudinary.prototype.cloudinary_update = function(elements, options) { - var client_hints, containerWidth, dataSrc, imageWidth, j, len, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, requestedWidth, responsive, responsiveClass, roundDpr, setUrl, tag; + var client_hints, containerWidth, dataSrc, j, len, match, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, requiredWidth, responsive, responsiveClass, roundDpr, setUrl, tag; if (options == null) { options = {}; } + client_hints = (ref = (ref1 = options.client_hints) != null ? ref1 : this.config('client_hints')) != null ? ref : false; + client_hints = client_hints || (typeof document !== "undefined" && document !== null ? document.querySelector('meta[http-equiv="Accept-CH"]') : void 0); + if (client_hints) { + return; + } + responsive = (ref2 = (ref3 = options.responsive) != null ? ref3 : this.config('responsive')) != null ? ref2 : false; elements = (function() { switch (false) { case !Util.isArray(elements): @@ -3570,32 +3599,33 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal return [elements]; } })(); - responsiveClass = (ref = (ref1 = this.responsiveConfig['responsive_class']) != null ? ref1 : options['responsive_class']) != null ? ref : this.config('responsive_class'); - roundDpr = (ref2 = options['round_dpr']) != null ? ref2 : this.config('round_dpr'); + responsiveClass = (ref4 = (ref5 = this.responsiveConfig['responsive_class']) != null ? ref5 : options['responsive_class']) != null ? ref4 : this.config('responsive_class'); + roundDpr = (ref6 = options['round_dpr']) != null ? ref6 : this.config('round_dpr'); for (j = 0, len = elements.length; j < len; j++) { tag = elements[j]; - if (!((ref3 = tag.tagName) != null ? ref3.match(/img/i) : void 0)) { + if (!((ref7 = tag.tagName) != null ? ref7.match(/img/i) : void 0)) { continue; } setUrl = true; - client_hints = (ref4 = (ref5 = options.client_hints) != null ? ref5 : this.config('client_hints')) != null ? ref4 : false; - responsive = (ref6 = (ref7 = options.responsive) != null ? ref7 : this.config('responsive')) != null ? ref6 : false; if (responsive && !client_hints) { Util.addClass(tag, responsiveClass); } dataSrc = Util.getData(tag, 'src-cache') || Util.getData(tag, 'src'); if (!Util.isEmpty(dataSrc)) { - dataSrc = dataSrc.replace(/\bdpr_(1\.0|auto)\b/g, 'dpr_' + this.device_pixel_ratio(roundDpr)); - if (Util.hasClass(tag, responsiveClass) && /\bw_auto\b/.exec(dataSrc)) { - containerWidth = parentWidth(tag); + dataSrc = updateDpr.call(this, dataSrc, roundDpr); + if (HtmlTag.isResponsive(tag, responsiveClass)) { + containerWidth = findContainerWidth(tag); if (containerWidth !== 0) { - requestedWidth = applyBreakpoints.call(this, tag, containerWidth, options); - imageWidth = Util.getData(tag, 'width') || 0; - if (requestedWidth > imageWidth) { - imageWidth = requestedWidth; - Util.setData(tag, 'width', requestedWidth); + switch (false) { + case !/w_auto:breakpoints/.test(dataSrc): + requiredWidth = maxWidth(containerWidth, tag); + dataSrc = dataSrc.replace(/w_auto:breakpoints([_0-9]*)(:[0-9]+)?/, "w_auto:breakpoints$1:" + requiredWidth); + break; + case !(match = /w_auto(:(\d+))?/.exec(dataSrc)): + requiredWidth = applyBreakpoints.call(this, tag, containerWidth, match[2], options); + requiredWidth = maxWidth(requiredWidth, tag); + dataSrc = dataSrc.replace(/w_auto[^,\/]*/g, "w_" + requiredWidth); } - dataSrc = dataSrc.replace(/\bw_auto\b/g, 'w_' + imageWidth); Util.removeAttribute(tag, 'width'); if (!options.responsive_preserve_height) { Util.removeAttribute(tag, 'height'); @@ -4033,7 +4063,7 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal TextLayer: TextLayer, SubtitlesLayer: SubtitlesLayer, Cloudinary: Cloudinary, - VERSION: "2.0.9", + VERSION: "2.1.0", CloudinaryJQuery: CloudinaryJQuery }; return cloudinary; diff --git a/karma.cloudinary-core.coffee b/karma.cloudinary-core.coffee index f0e2a173..05ddbebd 100644 --- a/karma.cloudinary-core.coffee +++ b/karma.cloudinary-core.coffee @@ -5,7 +5,7 @@ module.exports = (config) -> config.set # base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '' +# basePath: '.' # frameworks to use @@ -23,6 +23,9 @@ module.exports = (config) -> 'test/spec/tagspec.js' 'test/spec/videourlspec.js' 'test/spec/chaining-spec.js' + 'test/spec/responsive-core-spec.js' + { pattern: 'test/docRoot/responsive-core-test.html', watched: false, included: false, served: true, nocache: false} + { pattern: 'bower_components/bootstrap/dist/css/*', watched: false, included: false, served: true, nocache: false} ] # preprocess matching files before serving them to the browser diff --git a/karma.cloudinary-jquery-file-upload.coffee b/karma.cloudinary-jquery-file-upload.coffee index aa90e3cc..1a4a7211 100644 --- a/karma.cloudinary-jquery-file-upload.coffee +++ b/karma.cloudinary-jquery-file-upload.coffee @@ -22,6 +22,7 @@ module.exports = (config) -> 'bower_components/blueimp-file-upload/js/jquery.iframe-transport.js' 'bower_components/blueimp-file-upload/js/jquery.fileupload-image.js' 'build/cloudinary-jquery-file-upload.js' + 'test/spec/spec-helper.js' 'test/spec/cloudinary-spec.js' 'test/spec/cloudinary-jquery-spec.js' 'test/spec/cloudinary-jquery-upload-spec.js' @@ -29,6 +30,8 @@ module.exports = (config) -> 'test/spec/tagspec.js' 'test/spec/videourlspec.js' 'test/spec/chaining-spec.js' + 'test/spec/responsive-jquery-spec.js' + {pattern: 'test/docRoot/responsive-jquery-test.html', watched: false, included: false, served: true, nocache: false} ] diff --git a/karma.cloudinary-jquery.coffee b/karma.cloudinary-jquery.coffee index dad161f5..763e935e 100644 --- a/karma.cloudinary-jquery.coffee +++ b/karma.cloudinary-jquery.coffee @@ -17,12 +17,15 @@ module.exports = (config) -> files: [ 'bower_components/jquery/dist/jquery.js' 'build/cloudinary-jquery.js' + 'test/spec/spec-helper.js' 'test/spec/cloudinary-spec.js' 'test/spec/cloudinary-jquery-spec.js' 'test/spec/transformation-spec.js' 'test/spec/tagspec.js' 'test/spec/videourlspec.js' 'test/spec/chaining-spec.js' + 'test/spec/responsive-jquery-spec.js' + {pattern: 'test/docRoot/responsive-jquery-test.html', watched: false, included: false, served: true, nocache: false} ] diff --git a/karma.coffee b/karma.coffee index 894dec12..24d11248 100644 --- a/karma.coffee +++ b/karma.coffee @@ -51,7 +51,7 @@ module.exports = (config) -> # start these browsers # available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome' , 'Firefox', 'Safari'] + browsers: ['Chrome' , 'Firefox', 'Safari', 'PhantomJS'] # Continuous Integration mode diff --git a/package.json b/package.json index 97d1f7a1..8df58a19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudinary_js", - "version": "2.0.9", + "version": "2.1.0", "description": "Cloudinary streamlines your web application’s image manipulation needs. Cloudinary's cloud-based servers automate image uploading, resizing, cropping, optimizing, sprite generation and more. Cloudinary's jQuery plugin allows direct uploading from the browser to the cloud and dynamic cloud-based image transformations and effects.", "main": "js/jquery.cloudinary.js", "directories": { diff --git a/src/cloudinary.coffee b/src/cloudinary.coffee index b5036421..76418b9f 100644 --- a/src/cloudinary.coffee +++ b/src/cloudinary.coffee @@ -1,5 +1,5 @@ class Cloudinary - VERSION = "2.0.9" + VERSION = "2.1.0" CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net" OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net" AKAMAI_SHARED_CDN = "res.cloudinary.com" @@ -392,10 +392,10 @@ class Cloudinary * @private * @ignore ### - calc_breakpoint: (element, width) -> + calc_breakpoint: (element, width, steps) -> breakpoints = Util.getData(element, 'breakpoints') or Util.getData(element, 'stoppoints') or @config('breakpoints') or @config('stoppoints') or defaultBreakpoints if Util.isFunction breakpoints - breakpoints(width) + breakpoints(width, steps) else if Util.isString breakpoints breakpoints = (parseInt(point) for point in breakpoints.split(',')).sort((a, b) -> a - b) @@ -423,8 +423,8 @@ class Cloudinary dprString += '.0' dprString - defaultBreakpoints = (width) -> - 100 * Math.ceil(width / 100) + defaultBreakpoints = (width, steps = 100) -> + steps * Math.ceil(width / steps) closestAbove = (list, value) -> i = list.length - 2 @@ -505,20 +505,30 @@ class Cloudinary @cloudinary_update( images, options) this - applyBreakpoints = (tag, width, options)-> + applyBreakpoints = (tag, width, steps, options)-> responsive_use_breakpoints = options['responsive_use_breakpoints'] ? options['responsive_use_stoppoints'] ? @config('responsive_use_breakpoints') ? @config('responsive_use_stoppoints') if (!responsive_use_breakpoints) || (responsive_use_breakpoints == 'resize' and !options.resizing) width else - @calc_breakpoint(tag, width) + @calc_breakpoint(tag, width, steps) - parentWidth = (element) -> + findContainerWidth = (element) -> containerWidth = 0 while ((element = element?.parentNode) instanceof Element) and !containerWidth style = window.getComputedStyle(element); containerWidth = Util.width(element) unless /^inline/.test(style.display) containerWidth + updateDpr = (dataSrc, roundDpr) -> + dataSrc.replace(/\bdpr_(1\.0|auto)\b/g, 'dpr_' + @device_pixel_ratio(roundDpr)) + + maxWidth = (requiredWidth, tag) -> + imageWidth = Util.getData(tag, 'width') or 0 + if requiredWidth > imageWidth + imageWidth = requiredWidth + Util.setData(tag, 'width', requiredWidth) + requiredWidth + ###* * Update hidpi (dpr_auto) and responsive (w_auto) fields according to the current container size and the device pixel ratio. * Only images marked with the cld-responsive class have w_auto updated. @@ -534,6 +544,12 @@ class Cloudinary * Should only be used if the transformation supports different aspect ratios. ### cloudinary_update: (elements, options = {}) -> + client_hints = options.client_hints ? @config('client_hints') ? false + client_hints = client_hints || document?.querySelector('meta[http-equiv="Accept-CH"]') + return if client_hints + + responsive = options.responsive ? @config('responsive') ? false + elements = switch when Util.isArray(elements) elements @@ -549,26 +565,24 @@ class Cloudinary for tag in elements when tag.tagName?.match(/img/i) setUrl = true - client_hints = options.client_hints ? @config('client_hints') ? false - responsive = options.responsive ? @config('responsive') ? false + if responsive && !client_hints Util.addClass(tag, responsiveClass) dataSrc = Util.getData(tag, 'src-cache') or Util.getData(tag, 'src') unless Util.isEmpty(dataSrc) # Update dpr according to the device's devicePixelRatio - dataSrc = dataSrc.replace(/\bdpr_(1\.0|auto)\b/g, 'dpr_' + @device_pixel_ratio(roundDpr)) - if Util.hasClass(tag, responsiveClass) and /\bw_auto\b/.exec(dataSrc) - containerWidth = parentWidth(tag) + dataSrc = updateDpr.call(this, dataSrc, roundDpr) + if HtmlTag.isResponsive(tag, responsiveClass) + containerWidth = findContainerWidth(tag) if containerWidth != 0 - requestedWidth = applyBreakpoints.call(this, tag, containerWidth, options) - - imageWidth = Util.getData(tag, 'width') or 0 - if requestedWidth > imageWidth - imageWidth = requestedWidth - Util.setData(tag, 'width', requestedWidth) - -# tag.style.setProperty("max-width", requestedWidth) - dataSrc = dataSrc.replace(/\bw_auto\b/g, 'w_' + imageWidth) + switch + when /w_auto:breakpoints/.test(dataSrc) + requiredWidth = maxWidth(containerWidth, tag) + dataSrc = dataSrc.replace( /w_auto:breakpoints([_0-9]*)(:[0-9]+)?/, "w_auto:breakpoints$1:#{requiredWidth}") + when match = /w_auto(:(\d+))?/.exec(dataSrc) + requiredWidth = applyBreakpoints.call(this, tag, containerWidth, match[2] , options) + requiredWidth = maxWidth(requiredWidth, tag) + dataSrc = dataSrc.replace( /w_auto[^,\/]*/g, "w_#{requiredWidth}") Util.removeAttribute(tag, 'width') Util.removeAttribute(tag, 'height') unless options.responsive_preserve_height diff --git a/src/tags/htmltag.coffee b/src/tags/htmltag.coffee index 9b48154d..e1543823 100644 --- a/src/tags/htmltag.coffee +++ b/src/tags/htmltag.coffee @@ -162,3 +162,7 @@ class HtmlTag element = document.createElement(@name) element[name] = value for name, value of @attributes() element + + @isResponsive: (tag, responsiveClass)-> + dataSrc = Util.getData(tag, 'src-cache') or Util.getData(tag, 'src') + Util.hasClass(tag, responsiveClass) and /\bw_auto\b/.exec(dataSrc) \ No newline at end of file diff --git a/test/docRoot/responsive-core-test.html b/test/docRoot/responsive-core-test.html index 97fba3bf..aa44c357 100644 --- a/test/docRoot/responsive-core-test.html +++ b/test/docRoot/responsive-core-test.html @@ -7,6 +7,7 @@ + Responsive Test @@ -22,7 +23,7 @@

Bootstrap & Cloudinary Responsive Images

  • -
  • Bootstrap & Cloudinary Responsive Images
    ...
    @@ -54,6 +55,8 @@

    Bootstrap & Cloudinary Responsive Images

    window.onload = function(){ var cl = cloudinary.Cloudinary.new( {cloud_name: "demo"}); cl.responsive(); + var event = new Event('karma-ready'); + window.dispatchEvent(event); };
    diff --git a/test/docRoot/responsive-jquery-test.html b/test/docRoot/responsive-jquery-test.html index 544f0928..4e7d5bbc 100644 --- a/test/docRoot/responsive-jquery-test.html +++ b/test/docRoot/responsive-jquery-test.html @@ -30,7 +30,7 @@

    Bootstrap & Cloudinary Responsive Images

  • -
  • Bootstrap & Cloudinary Responsive Images
    - + +
    ...
    ...
    ...
    @@ -59,8 +60,11 @@

    Bootstrap & Cloudinary Responsive Images

    diff --git a/test/docRoot/responsive-jquery-upload-test.html b/test/docRoot/responsive-jquery-upload-test.html index aaee29ee..541ec984 100644 --- a/test/docRoot/responsive-jquery-upload-test.html +++ b/test/docRoot/responsive-jquery-upload-test.html @@ -1,18 +1,18 @@ - - + + - + - + @@ -30,7 +30,7 @@

    Bootstrap & Cloudinary Responsive Images

  • -
  • Bootstrap & Cloudinary Responsive Images
    -
    ...
    +
    ...
    ...
    ...
    @@ -54,8 +60,11 @@

    Bootstrap & Cloudinary Responsive Images

    diff --git a/test/docRoot/responsive-shrinkwrap-test.html b/test/docRoot/responsive-shrinkwrap-test.html new file mode 100644 index 00000000..35d898be --- /dev/null +++ b/test/docRoot/responsive-shrinkwrap-test.html @@ -0,0 +1,62 @@ + + + + + + + + + Responsive Test + + + + +
    +

    Bootstrap & Cloudinary Responsive Images

    +
    +
    +
    + + + + + +
    +
    + + + +
    +
    ...
    +
    ...
    +
    ...
    +
    + +
    +
    + + + +
    + diff --git a/test/docRoot/spec-runner-with-jquery.html b/test/docRoot/spec-runner-with-jquery.html index 0cf28c93..8623b421 100644 --- a/test/docRoot/spec-runner-with-jquery.html +++ b/test/docRoot/spec-runner-with-jquery.html @@ -21,7 +21,7 @@ - + diff --git a/test/spec/responsive-core-spec.coffee b/test/spec/responsive-core-spec.coffee index 1f303134..b7ce270c 100644 --- a/test/spec/responsive-core-spec.coffee +++ b/test/spec/responsive-core-spec.coffee @@ -1,5 +1,8 @@ -describe 'cloudinary', ()-> - defaultConfig = cloud_name: 'demo' +sharedExamples 'client side responsive', -> + if navigator.userAgent.toLowerCase().indexOf('phantom') > -1 + console.warn("Skipping responsive tests in PhantomJS") + return + defaultConfig = cloud_name: 'sdk-test' cl = null describe "responsive", ()-> fixtureContainer = undefined @@ -10,12 +13,13 @@ describe 'cloudinary', ()-> beforeAll (done)-> # Open a new window with test HTML. A dynamic title is required in order to open a *new* window each time even if # previous window was not closed. - testWindow = window.open( "responsive-core-test.html","Cloudinary test #{(new Date()).toLocaleString()}", "width=500, height=500") - - testWindow.addEventListener 'load', ()=> + testURL = "responsive-core-test.html" + testURL = "/base/test/docRoot/#{testURL}" if typeof __karma__ != "undefined" + testWindow = window.open(testURL, "Cloudinary test #{(new Date()).toLocaleString()}", "width=500, height=500") + testWindow.addEventListener 'karma-ready', ()=> testDocument = testWindow.document image1 = testDocument.getElementById('image1') - expect(image1.getAttribute('src')).toBeDefined() + expect(image1).toBeDefined() done() , false @@ -23,7 +27,7 @@ describe 'cloudinary', ()-> testWindow.close() beforeEach ()-> - cl = new cloudinary.Cloudinary(cloud_name: 'demo') + cl = new cloudinary.Cloudinary(defaultConfig) fixtureContainer = document.createElement('div') fixtureContainer.id="fixture"; document.body.appendChild(fixtureContainer) @@ -46,7 +50,7 @@ describe 'cloudinary', ()-> aContainer = document.createElement('a') divContainer.appendChild( aContainer) img = cl.image('sample.jpg', - width: 'auto:breakpoints' + width: 'auto' dpr: 'auto' crop: 'scale' responsive: true @@ -94,17 +98,17 @@ describe 'cloudinary', ()-> expect(img.getAttribute('src')).toBeFalsy() expect(cloudinary.Util.hasClass(img, 'cld-responsive')).toBeTruthy() cl.responsive() - expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' container.style.width = "211px" - expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' triggerResize window window.setTimeout ()-> # wait(200) - expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' container.style.width = "101px" window.setTimeout ()-> # wait(200) - expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' done() , 200 , 200 @@ -113,7 +117,8 @@ describe 'cloudinary', ()-> image1 = testDocument.getElementById('image1') src = image1.getAttribute('src') expect(src).toBeDefined() - currentWidth = src.match(/w_(\d+)/)[1] + expect(src).not.toBe('') + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3] handler = ()-> src = image1.getAttribute('src') expect(src).toBeDefined() @@ -127,4 +132,13 @@ describe 'cloudinary', ()-> it "should set the class used for responsive functionality", -> img = cl.image( "sample", responsive: true, responsive_class: "cl-foobar") expect(cloudinary.Util.hasClass(img, "cl-foobar")).toBeTruthy() - \ No newline at end of file + +describe 'Client side responsive', -> + describe 'client_hints', -> + describe 'false', -> + itBehavesLike 'client side responsive' + describe 'true', -> + beforeEach -> + cl.config().client_hints = true + itBehavesLike 'client side responsive' + diff --git a/test/spec/responsive-core-spec.js b/test/spec/responsive-core-spec.js index 6ab97a92..ccb9700e 100644 --- a/test/spec/responsive-core-spec.js +++ b/test/spec/responsive-core-spec.js @@ -1,7 +1,11 @@ -describe('cloudinary', function() { +sharedExamples('client side responsive', function() { var cl, defaultConfig; + if (navigator.userAgent.toLowerCase().indexOf('phantom') > -1) { + console.warn("Skipping responsive tests in PhantomJS"); + return; + } defaultConfig = { - cloud_name: 'demo' + cloud_name: 'sdk-test' }; cl = null; return describe("responsive", function() { @@ -11,13 +15,18 @@ describe('cloudinary', function() { container = void 0; testWindow = null; beforeAll(function(done) { - testWindow = window.open("responsive-core-test.html", "Cloudinary test " + ((new Date()).toLocaleString()), "width=500, height=500"); - return testWindow.addEventListener('load', (function(_this) { + var testURL; + testURL = "responsive-core-test.html"; + if (typeof __karma__ !== "undefined") { + testURL = "/base/test/docRoot/" + testURL; + } + testWindow = window.open(testURL, "Cloudinary test " + ((new Date()).toLocaleString()), "width=500, height=500"); + return testWindow.addEventListener('karma-ready', (function(_this) { return function() { var image1; testDocument = testWindow.document; image1 = testDocument.getElementById('image1'); - expect(image1.getAttribute('src')).toBeDefined(); + expect(image1).toBeDefined(); return done(); }; })(this), false); @@ -26,9 +35,7 @@ describe('cloudinary', function() { return testWindow.close(); }); beforeEach(function() { - cl = new cloudinary.Cloudinary({ - cloud_name: 'demo' - }); + cl = new cloudinary.Cloudinary(defaultConfig); fixtureContainer = document.createElement('div'); fixtureContainer.id = "fixture"; return document.body.appendChild(fixtureContainer); @@ -53,7 +60,7 @@ describe('cloudinary', function() { aContainer = document.createElement('a'); divContainer.appendChild(aContainer); img = cl.image('sample.jpg', { - width: 'auto:breakpoints', + width: 'auto', dpr: 'auto', crop: 'scale', responsive: true @@ -99,15 +106,15 @@ describe('cloudinary', function() { expect(img.getAttribute('src')).toBeFalsy(); expect(cloudinary.Util.hasClass(img, 'cld-responsive')).toBeTruthy(); cl.responsive(); - expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); container.style.width = "211px"; - expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); triggerResize(window); return window.setTimeout(function() { - expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); container.style.width = "101px"; return window.setTimeout(function() { - expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); return done(); }, 200); }, 200); @@ -117,7 +124,8 @@ describe('cloudinary', function() { image1 = testDocument.getElementById('image1'); src = image1.getAttribute('src'); expect(src).toBeDefined(); - currentWidth = src.match(/w_(\d+)/)[1]; + expect(src).not.toBe(''); + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3]; handler = function() { var newWidth; src = image1.getAttribute('src'); @@ -142,4 +150,18 @@ describe('cloudinary', function() { }); }); +describe('Client side responsive', function() { + return describe('client_hints', function() { + describe('false', function() { + return itBehavesLike('client side responsive'); + }); + return describe('true', function() { + beforeEach(function() { + return cl.config().client_hints = true; + }); + return itBehavesLike('client side responsive'); + }); + }); +}); + //# sourceMappingURL=responsive-core-spec.js.map diff --git a/test/spec/responsive-core-spec.js.map b/test/spec/responsive-core-spec.js.map index e76ad0cb..eff9ae70 100644 --- a/test/spec/responsive-core-spec.js.map +++ b/test/spec/responsive-core-spec.js.map @@ -6,5 +6,5 @@ "responsive-core-spec.coffee" ], "names": [], - "mappings": "AAAA,QAAA,CAAS,YAAT,EAAuB,SAAA;A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T,EAAmC,SAAA;SACjC,QAAA,CAAS,cAAT,EAAyB,SAAA;IACvB,QAAA,CAAS,OAAT,EAAkB,SAAA;aAChB,aAAA,CAAc,wBAAd;IADgB,CAAlB;WAEA,QAAA,CAAS,MAAT,EAAiB,SAAA;MACf,UAAA,CAAW,SAAA;eACT,EAAE,CAAC,MAAH,CAAA,CAAW,CAAC,YAAZ,GAA2B;MADlB,CAAX;aAEA,aAAA,CAAc,wBAAd;IAHe,CAAjB;EAHuB,CAAzB;AADiC,CAAnC" } \ No newline at end of file diff --git a/test/spec/responsive-jquery-spec.coffee b/test/spec/responsive-jquery-spec.coffee index a04c3b1a..c318c99b 100644 --- a/test/spec/responsive-jquery-spec.coffee +++ b/test/spec/responsive-jquery-spec.coffee @@ -1,5 +1,8 @@ -describe 'Cloudinary', ()-> - defaultConfig = cloud_name: 'demo' +sharedExamples 'client side responsive', -> + if navigator.userAgent.toLowerCase().indexOf('phantom') > -1 + console.warn("Skipping responsive tests in PhantomJS") + return + defaultConfig = cloud_name: 'sdk-test' cl =null describe "responsive", ()-> fixtureContainer = undefined @@ -9,12 +12,14 @@ describe 'Cloudinary', ()-> beforeAll (done)-> # Open a new window with test HTML. A dynamic title is required in order to open a *new* window each time even if # previous window was not closed. - testWindow = window.open( "responsive-jquery-test.html","Cloudinary test #{(new Date()).toLocaleString()}", "width=500, height=500") + testURL = "responsive-jquery-test.html" + testURL = "/base/test/docRoot/#{testURL}" if typeof __karma__ != "undefined" + testWindow = window.open( testURL,"Cloudinary test #{(new Date()).toLocaleString()}", "width=500, height=500") - testWindow.addEventListener 'load', ()=> + testWindow.addEventListener 'karma-ready', ()=> testDocument = testWindow.document image1 = testDocument.getElementById('image1') - expect(image1.getAttribute('src')).toBeDefined() + expect(image1).toBeDefined() done() , false @@ -90,17 +95,17 @@ describe 'Cloudinary', ()-> img.appendTo(container) expect(img.attr('src')).toBeFalsy() cl.responsive() - expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' container.css 'width', 211 - expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' $(window).resize() window.setTimeout (-> # wait(200) - expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' container.css 'width', 101 window.setTimeout (-> # wait(200) - expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + expect(img.attr('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' done() ), 200 ), 200 @@ -109,12 +114,27 @@ describe 'Cloudinary', ()-> image1 = testDocument.getElementById('image1') src = image1.getAttribute('src') expect(src).toBeDefined() - currentWidth = src.match(/w_(\d+)/)[1] + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3] handler = ()-> src = image1.getAttribute('src') + expect(src).toBeDefined() newWidth = src.match(/w_(\d+)/)[1] expect(newWidth).toEqual currentWidth done() testWindow.addEventListener 'resize', handler testWindow.resizeBy(200,0) + describe "responsive_class", -> + it "should set the class used for responsive functionality", -> + img = cl.image( "sample", responsive: true, responsive_class: "cl-foobar") + expect(cloudinary.Util.hasClass(img, "cl-foobar")).toBeTruthy() + +describe 'Client side responsive', -> + describe 'client_hints', -> + describe 'false', -> + itBehavesLike 'client side responsive' + describe 'true', -> + beforeEach -> + cl.config().client_hints = true + itBehavesLike 'client side responsive' + diff --git a/test/spec/responsive-jquery-spec.js b/test/spec/responsive-jquery-spec.js index dc4b2a4e..21b16824 100644 --- a/test/spec/responsive-jquery-spec.js +++ b/test/spec/responsive-jquery-spec.js @@ -1,7 +1,11 @@ -describe('Cloudinary', function() { +sharedExamples('client side responsive', function() { var cl, defaultConfig; + if (navigator.userAgent.toLowerCase().indexOf('phantom') > -1) { + console.warn("Skipping responsive tests in PhantomJS"); + return; + } defaultConfig = { - cloud_name: 'demo' + cloud_name: 'sdk-test' }; cl = null; return describe("responsive", function() { @@ -11,13 +15,18 @@ describe('Cloudinary', function() { container = void 0; testWindow = null; beforeAll(function(done) { - testWindow = window.open("responsive-jquery-test.html", "Cloudinary test " + ((new Date()).toLocaleString()), "width=500, height=500"); - return testWindow.addEventListener('load', (function(_this) { + var testURL; + testURL = "responsive-jquery-test.html"; + if (typeof __karma__ !== "undefined") { + testURL = "/base/test/docRoot/" + testURL; + } + testWindow = window.open(testURL, "Cloudinary test " + ((new Date()).toLocaleString()), "width=500, height=500"); + return testWindow.addEventListener('karma-ready', (function(_this) { return function() { var image1; testDocument = testWindow.document; image1 = testDocument.getElementById('image1'); - expect(image1.getAttribute('src')).toBeDefined(); + expect(image1).toBeDefined(); return done(); }; })(this), false); @@ -94,28 +103,29 @@ describe('Cloudinary', function() { img.appendTo(container); expect(img.attr('src')).toBeFalsy(); cl.responsive(); - expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); container.css('width', 211); - expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); $(window).resize(); return window.setTimeout((function() { - expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); container.css('width', 101); return window.setTimeout((function() { - expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/demo/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + expect(img.attr('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); return done(); }), 200); }), 200); }); - return it("should not resize images with fixed width containers", function(done) { + it("should not resize images with fixed width containers", function(done) { var currentWidth, handler, image1, src; image1 = testDocument.getElementById('image1'); src = image1.getAttribute('src'); expect(src).toBeDefined(); - currentWidth = src.match(/w_(\d+)/)[1]; + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3]; handler = function() { var newWidth; src = image1.getAttribute('src'); + expect(src).toBeDefined(); newWidth = src.match(/w_(\d+)/)[1]; expect(newWidth).toEqual(currentWidth); return done(); @@ -123,6 +133,30 @@ describe('Cloudinary', function() { testWindow.addEventListener('resize', handler); return testWindow.resizeBy(200, 0); }); + return describe("responsive_class", function() { + return it("should set the class used for responsive functionality", function() { + var img; + img = cl.image("sample", { + responsive: true, + responsive_class: "cl-foobar" + }); + return expect(cloudinary.Util.hasClass(img, "cl-foobar")).toBeTruthy(); + }); + }); + }); +}); + +describe('Client side responsive', function() { + return describe('client_hints', function() { + describe('false', function() { + return itBehavesLike('client side responsive'); + }); + return describe('true', function() { + beforeEach(function() { + return cl.config().client_hints = true; + }); + return itBehavesLike('client side responsive'); + }); }); }); diff --git a/test/spec/responsive-jquery-spec.js.map b/test/spec/responsive-jquery-spec.js.map index 0919eac4..f8c3369d 100644 ---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CAAA;QACA,QAAA,GAAW,GAAG,CAAC,KAAJ,CAAU,SAAV,CAAqB,CAAA,CAAA;QAChC,MAAA,CAAO,QAAP,CAAgB,CAAC,OAAjB,CAAyB,YAAzB;eACA,IAAA,CAAA;MALQ;MAMV,UAAU,CAAC,gBAAX,CAA4B,QAA5B,EAAsC,OAAtC;aACA,UAAU,CAAC,QAAX,CAAoB,GAApB,EAAwB,CAAxB;IAZyD,CAA3D;WAcA,QAAA,CAAS,kBAAT,EAA6B,SAAA;aAC3B,EAAA,CAAG,wDAAH,EAA6D,SAAA;AAC3D,YAAA;QAAA,GAAA,GAAM,EAAE,CAAC,KAAH,CAAU,QAAV,EAAoB;UAAA,UAAA,EAAY,IAAZ;UAAkB,gBAAA,EAAkB,WAApC;SAApB;eACN,MAAA,CAAO,UAAU,CAAC,IAAI,CAAC,QAAhB,CAAyB,GAAzB,EAA8B,WAA9B,CAAP,CAAkD,CAAC,UAAnD,CAAA;MAF2D,CAA7D;IAD2B,CAA7B;EAxHqB,CAAvB;AANuC,CAAzC;;AAmIA,QAAA,CAAS,wBAAT,EAAmC,SAAA;SACjC,QAAA,CAAS,cAAT,EAAyB,SAAA;IACvB,QAAA,CAAS,OAAT,EAAkB,SAAA;aAChB,aAAA,CAAc,wBAAd;IADgB,CAAlB;WAEA,QAAA,CAAS,MAAT,EAAiB,SAAA;MACf,UAAA,CAAW,SAAA;eACT,EAAE,CAAC,MAAH,CAAA,CAAW,CAAC,YAAZ,GAA2B;MADlB,CAAX;aAEA,aAAA,CAAc,wBAAd;IAHe,CAAjB;EAHuB,CAAzB;AADiC,CAAnC" } \ No newline at end of file diff --git a/test/spec/responsive-shrinkwrap-spec.coffee b/test/spec/responsive-shrinkwrap-spec.coffee new file mode 100644 index 00000000..904b48f1 --- /dev/null +++ b/test/spec/responsive-shrinkwrap-spec.coffee @@ -0,0 +1,144 @@ +sharedExamples 'client side responsive', -> + if navigator.userAgent.toLowerCase().indexOf('phantom') > -1 + console.warn("Skipping responsive tests in PhantomJS") + return + defaultConfig = cloud_name: 'sdk-test' + cl = null + describe "responsive", ()-> + fixtureContainer = undefined + testDocument = null + container = undefined + testWindow = null + + beforeAll (done)-> + # Open a new window with test HTML. A dynamic title is required in order to open a *new* window each time even if + # previous window was not closed. + testURL = "responsive-shrinkwrap-test.html" + testURL = "/base/test/docRoot/#{testURL}" if typeof __karma__ != "undefined" + testWindow = window.open(testURL, "Cloudinary test #{(new Date()).toLocaleString()}", "width=500, height=500") + testWindow.addEventListener 'karma-ready', ()=> + testDocument = testWindow.document + image1 = testDocument.getElementById('image1') + expect(image1).toBeDefined() + done() + , false + + afterAll ()-> + testWindow.close() + + beforeEach ()-> + cl = new cloudinary.Cloudinary(defaultConfig) + fixtureContainer = document.createElement('div') + fixtureContainer.id="fixture"; + document.body.appendChild(fixtureContainer) + + afterEach ()-> + fixtureContainer.remove() + + triggerResize = (window)-> + evt = window.document.createEvent('UIEvents') + evt.initUIEvent 'resize', true, false, window, 0 + window.dispatchEvent evt + + it 'should traverse up the DOM to find a parent that has clientWidth', -> + aContainer = undefined + divContainer = undefined + img = undefined + divContainer = document.createElement('div') + divContainer.style.width = 101 + fixtureContainer.appendChild(divContainer) + aContainer = document.createElement('a') + divContainer.appendChild( aContainer) + img = cl.image('sample.jpg', + width: 'auto' + dpr: 'auto' + crop: 'scale' + responsive: true + ) + aContainer.appendChild(img) + cl.responsive() + expect(img.getAttribute('src')).not.toEqual undefined + + it 'should compute breakpoints correctly', ()-> + el = document.createElement('img') + fixtureContainer.appendChild(el) + expect(cl.calc_breakpoint(el, 1)).toEqual 100 + expect(cl.calc_breakpoint(el, 10)).toEqual 100 + expect(cl.calc_breakpoint(el, 110)).toEqual 200 + cl.config('breakpoints', [ + 50 + 150 + ]) + expect(cl.calc_breakpoint(el, 1)).toEqual 50 + expect(cl.calc_breakpoint(el, 100)).toEqual 150 + expect(cl.calc_breakpoint(el, 180)).toEqual 150 + + cl.config 'breakpoints', (width) -> + width / 2 + + expect(cl.calc_breakpoint(el, 100)).toEqual 50 + + el.setAttribute( 'data-breakpoints', '70,140') + expect(cl.calc_breakpoint(el, 1)).toEqual 70 + expect(cl.calc_breakpoint(el, 100)).toEqual 140 + + it 'should correctly resize responsive images', (done) -> + container = undefined + img = undefined + dpr = cl.device_pixel_ratio() + container = document.createElement('div') + container.style.width = "101px" + fixtureContainer.appendChild(container) + img = cl.image('sample.jpg', + width: 'auto' + dpr: 'auto' + crop: 'scale' + responsive: true) + container.appendChild(img) + expect(img.getAttribute('src')).toBeFalsy() + expect(cloudinary.Util.hasClass(img, 'cld-responsive')).toBeTruthy() + cl.responsive() + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + container.style.width = "211px" + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg' + triggerResize window + window.setTimeout ()-> + # wait(200) + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + container.style.width = "101px" + window.setTimeout ()-> + # wait(200) + expect(img.getAttribute('src')).toEqual window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg' + done() + , 200 + , 200 + + it "should not resize images with fixed width containers", (done)-> + image1 = testDocument.getElementById('image1') + src = image1.getAttribute('src') + expect(src).toBeDefined() + expect(src).not.toBe('') + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3] + handler = ()-> + src = image1.getAttribute('src') + expect(src).toBeDefined() + newWidth = src.match(/w_(\d+)/)[1] + expect(newWidth).toEqual currentWidth + done() + testWindow.addEventListener 'resize', handler + testWindow.resizeBy(200,0) + + describe "responsive_class", -> + it "should set the class used for responsive functionality", -> + img = cl.image( "sample", responsive: true, responsive_class: "cl-foobar") + expect(cloudinary.Util.hasClass(img, "cl-foobar")).toBeTruthy() + +describe 'Client side responsive', -> + describe 'client_hints', -> + describe 'false', -> + itBehavesLike 'client side responsive' + describe 'true', -> + beforeEach -> + cl.config().client_hints = true + itBehavesLike 'client side responsive' + diff --git a/test/spec/responsive-shrinkwrap-spec.js b/test/spec/responsive-shrinkwrap-spec.js new file mode 100644 index 00000000..46457378 --- /dev/null +++ b/test/spec/responsive-shrinkwrap-spec.js @@ -0,0 +1,167 @@ +sharedExamples('client side responsive', function() { + var cl, defaultConfig; + if (navigator.userAgent.toLowerCase().indexOf('phantom') > -1) { + console.warn("Skipping responsive tests in PhantomJS"); + return; + } + defaultConfig = { + cloud_name: 'sdk-test' + }; + cl = null; + return describe("responsive", function() { + var container, fixtureContainer, testDocument, testWindow, triggerResize; + fixtureContainer = void 0; + testDocument = null; + container = void 0; + testWindow = null; + beforeAll(function(done) { + var testURL; + testURL = "responsive-shrinkwrap-test.html"; + if (typeof __karma__ !== "undefined") { + testURL = "/base/test/docRoot/" + testURL; + } + testWindow = window.open(testURL, "Cloudinary test " + ((new Date()).toLocaleString()), "width=500, height=500"); + return testWindow.addEventListener('karma-ready', (function(_this) { + return function() { + var image1; + testDocument = testWindow.document; + image1 = testDocument.getElementById('image1'); + expect(image1).toBeDefined(); + return done(); + }; + })(this), false); + }); + afterAll(function() { + return testWindow.close(); + }); + beforeEach(function() { + cl = new cloudinary.Cloudinary(defaultConfig); + fixtureContainer = document.createElement('div'); + fixtureContainer.id = "fixture"; + return document.body.appendChild(fixtureContainer); + }); + afterEach(function() { + return fixtureContainer.remove(); + }); + triggerResize = function(window) { + var evt; + evt = window.document.createEvent('UIEvents'); + evt.initUIEvent('resize', true, false, window, 0); + return window.dispatchEvent(evt); + }; + it('should traverse up the DOM to find a parent that has clientWidth', function() { + var aContainer, divContainer, img; + aContainer = void 0; + divContainer = void 0; + img = void 0; + divContainer = document.createElement('div'); + divContainer.style.width = 101; + fixtureContainer.appendChild(divContainer); + aContainer = document.createElement('a'); + divContainer.appendChild(aContainer); + img = cl.image('sample.jpg', { + width: 'auto', + dpr: 'auto', + crop: 'scale', + responsive: true + }); + aContainer.appendChild(img); + cl.responsive(); + return expect(img.getAttribute('src')).not.toEqual(void 0); + }); + it('should compute breakpoints correctly', function() { + var el; + el = document.createElement('img'); + fixtureContainer.appendChild(el); + expect(cl.calc_breakpoint(el, 1)).toEqual(100); + expect(cl.calc_breakpoint(el, 10)).toEqual(100); + expect(cl.calc_breakpoint(el, 110)).toEqual(200); + cl.config('breakpoints', [50, 150]); + expect(cl.calc_breakpoint(el, 1)).toEqual(50); + expect(cl.calc_breakpoint(el, 100)).toEqual(150); + expect(cl.calc_breakpoint(el, 180)).toEqual(150); + cl.config('breakpoints', function(width) { + return width / 2; + }); + expect(cl.calc_breakpoint(el, 100)).toEqual(50); + el.setAttribute('data-breakpoints', '70,140'); + expect(cl.calc_breakpoint(el, 1)).toEqual(70); + return expect(cl.calc_breakpoint(el, 100)).toEqual(140); + }); + it('should correctly resize responsive images', function(done) { + var dpr, img; + container = void 0; + img = void 0; + dpr = cl.device_pixel_ratio(); + container = document.createElement('div'); + container.style.width = "101px"; + fixtureContainer.appendChild(container); + img = cl.image('sample.jpg', { + width: 'auto', + dpr: 'auto', + crop: 'scale', + responsive: true + }); + container.appendChild(img); + expect(img.getAttribute('src')).toBeFalsy(); + expect(cloudinary.Util.hasClass(img, 'cld-responsive')).toBeTruthy(); + cl.responsive(); + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + container.style.width = "211px"; + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_200/sample.jpg'); + triggerResize(window); + return window.setTimeout(function() { + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + container.style.width = "101px"; + return window.setTimeout(function() { + expect(img.getAttribute('src')).toEqual(window.location.protocol + '//res.cloudinary.com/sdk-test/image/upload/c_scale,dpr_' + dpr + ',w_300/sample.jpg'); + return done(); + }, 200); + }, 200); + }); + it("should not resize images with fixed width containers", function(done) { + var currentWidth, handler, image1, src; + image1 = testDocument.getElementById('image1'); + src = image1.getAttribute('src'); + expect(src).toBeDefined(); + expect(src).not.toBe(''); + currentWidth = src.match(/w_(auto:)?(breakpoints[_\d]*:)?(\d+)/)[3]; + handler = function() { + var newWidth; + src = image1.getAttribute('src'); + expect(src).toBeDefined(); + newWidth = src.match(/w_(\d+)/)[1]; + expect(newWidth).toEqual(currentWidth); + return done(); + }; + testWindow.addEventListener('resize', handler); + return testWindow.resizeBy(200, 0); + }); + return describe("responsive_class", function() { + return it("should set the class used for responsive functionality", function() { + var img; + img = cl.image("sample", { + responsive: true, + responsive_class: "cl-foobar" + }); + return expect(cloudinary.Util.hasClass(img, "cl-foobar")).toBeTruthy(); + }); + }); + }); +}); + +describe('Client side responsive', function() { + return describe('client_hints', function() { + describe('false', function() { + return itBehavesLike('client side responsive'); + }); + return describe('true', function() { + beforeEach(function() { + return cl.config().client_hints = true; + }); + return itBehavesLike('client side responsive'); + }); + }); +}); + +//# sourceMappingURL=responsive-shrinkwrap-spec.js.map diff --git a/test/spec/responsive-shrinkwrap-spec.js.map b/test/spec/responsive-shrinkwrap-spec.js.map new file mode 100644 index 00000000..b7eca6ac --- /dev/null +++ b/test/spec/responsive-shrinkwrap-spec.js.map @@ -0,0 +1,10 @@ +{ + "version": 3, + "file": "responsive-shrinkwrap-spec.js", + "sourceRoot": "", + "sources": [ + "responsive-shrinkwrap-spec.coffee" + ], + "names": [], + "mappings": "AAAA,cAAA,CAAe,wBAAf,EAAyC,SAAA;AACvC,MAAA;EAAA,IAAG,SAAS,CAAC,SAAS,CAAC,WAApB,CAAA,CAAiC,CAAC,OAAlC,CAA0C,SAA1C,CAAA,GAAuD,CAAC,CAA3D;IACE,OAAO,CA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AAA;SACjC,QAAA,CAAS,cAAT,EAAyB,SAAA;IACvB,QAAA,CAAS,OAAT,EAAkB,SAAA;aAChB,aAAA,CAAc,wBAAd;IADgB,CAAlB;WAEA,QAAA,CAAS,MAAT,EAAiB,SAAA;MACf,UAAA,CAAW,SAAA;eACT,EAAE,CAAC,MAAH,CAAA,CAAW,CAAC,YAAZ,GAA2B;MADlB,CAAX;aAEA,aAAA,CAAc,wBAAd;IAHe,CAAjB;EAHuB,CAAzB;AADiC,CAAnC" +} \ No newline at end of file diff --git a/test/spec/tagspec.coffee b/test/spec/tagspec.coffee index 39e6626c..f8e1ed31 100644 --- a/test/spec/tagspec.coffee +++ b/test/spec/tagspec.coffee @@ -33,7 +33,7 @@ sharedExamples "client_hints", (options)-> expect(tag).toMatch( //) expect(tag).not.toMatch(/<.*class.*>/) expect(cloudinary.Util.getData(image, "src")).toBeFalsy() - expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/) + expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/) it "should override responsive", -> cl.config().responsive = true image = cl.image('sample.jpg', options) @@ -41,7 +41,7 @@ sharedExamples "client_hints", (options)-> expect(tag).toMatch( //) expect(tag).not.toMatch(/<.*class.*>/) expect(cloudinary.Util.getData(image, "src")).toBeFalsy() - expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/) + expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/) describe "Cloudinary.ImageTag", -> config = @@ -55,24 +55,24 @@ describe "Cloudinary.ImageTag", -> expect(tag).toBe("") describe ":client_hints", -> describe "as option", -> - includeContext "client_hints", {dpr: "auto", cloud_name: "test", width: "auto", crop: "scale", client_hints: true} + includeContext "client_hints", {dpr: "auto", cloud_name: "sdk-test", width: "auto", crop: "scale", client_hints: true} describe "as global configuration", -> beforeEach -> cl.config().client_hints = true - includeContext "client_hints", {dpr: "auto", cloud_name: "test", width: "auto", crop: "scale"} + includeContext "client_hints", {dpr: "auto", cloud_name: "sdk-test", width: "auto", crop: "scale"} describe "false", -> it "should use normal responsive behaviour", -> cl.config().responsive = true - image = cl.image('sample.jpg', {width: "auto", crop: "scale", cloud_name: "test", client_hints: false}) + image = cl.image('sample.jpg', {width: "auto", crop: "scale", cloud_name: "sdk-test", client_hints: false}) tag = image.outerHTML expect(tag).toMatch( //) expect(tag).toMatch( /class=["']cld-responsive["']/) - expect(cloudinary.Util.getData(image, "src-cache")).toMatch( /http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,w_auto\/sample.jpg/) + expect(cloudinary.Util.getData(image, "src-cache")).toMatch( /http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,w_auto\/sample.jpg/) describe "width", -> it "supports auto width", -> - tag = cl.image( 'sample.jpg', {crop: "scale", dpr: "auto", cloud_name: "test", width: "auto:breakpoints", client_hints: true}).outerHTML - expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto:breakpoints\/sample.jpg["']/) + tag = cl.image( 'sample.jpg', {crop: "scale", dpr: "auto", cloud_name: "sdk-test", width: "auto:breakpoints", client_hints: true}).outerHTML + expect(tag).toMatch( /src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto:breakpoints\/sample.jpg["']/) describe "Cloudinary.VideoTag", -> diff --git a/test/spec/tagspec.js b/test/spec/tagspec.js index b4f474d2..40f1ecde 100644 --- a/test/spec/tagspec.js +++ b/test/spec/tagspec.js @@ -57,7 +57,7 @@ sharedExamples("client_hints", function(options) { expect(tag).toMatch(//); expect(tag).not.toMatch(/<.*class.*>/); expect(cloudinary.Util.getData(image, "src")).toBeFalsy(); - return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/); + return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/); }); return it("should override responsive", function() { var image, tag; @@ -67,7 +67,7 @@ sharedExamples("client_hints", function(options) { expect(tag).toMatch(//); expect(tag).not.toMatch(/<.*class.*>/); expect(cloudinary.Util.getData(image, "src")).toBeFalsy(); - return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/); + return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto\/sample.jpg["']/); }); }); @@ -89,7 +89,7 @@ describe("Cloudinary.ImageTag", function() { describe("as option", function() { return includeContext("client_hints", { dpr: "auto", - cloud_name: "test", + cloud_name: "sdk-test", width: "auto", crop: "scale", client_hints: true @@ -101,7 +101,7 @@ describe("Cloudinary.ImageTag", function() { }); return includeContext("client_hints", { dpr: "auto", - cloud_name: "test", + cloud_name: "sdk-test", width: "auto", crop: "scale" }); @@ -113,13 +113,13 @@ describe("Cloudinary.ImageTag", function() { image = cl.image('sample.jpg', { width: "auto", crop: "scale", - cloud_name: "test", + cloud_name: "sdk-test", client_hints: false }); tag = image.outerHTML; expect(tag).toMatch(//); expect(tag).toMatch(/class=["']cld-responsive["']/); - return expect(cloudinary.Util.getData(image, "src-cache")).toMatch(/http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,w_auto\/sample.jpg/); + return expect(cloudinary.Util.getData(image, "src-cache")).toMatch(/http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,w_auto\/sample.jpg/); }); }); return describe("width", function() { @@ -128,11 +128,11 @@ describe("Cloudinary.ImageTag", function() { tag = cl.image('sample.jpg', { crop: "scale", dpr: "auto", - cloud_name: "test", + cloud_name: "sdk-test", width: "auto:breakpoints", client_hints: true }).outerHTML; - return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/test\/image\/upload\/c_scale,dpr_auto,w_auto:breakpoints\/sample.jpg["']/); + return expect(tag).toMatch(/src=["']http:\/\/res.cloudinary.com\/sdk-test\/image\/upload\/c_scale,dpr_auto,w_auto:breakpoints\/sample.jpg["']/); }); }); }); diff --git a/test/spec/tagspec.js.map b/test/spec/tagspec.js.map index 2793a3c0..688ef135 100644 --- a/test/spec/tagspec.js.map +++ b/test/spec/tagspec.js.map @@ -6,5 +6,5 @@ "tagspec.coffee" ], "names": [], - "mappings": "AAAA,IAAA;;AAAA,EAAA,GAAK;;AAEL,MAAA,GAAS,SAAC,GAAD;AACP,MAAA;EAAA,IAAA,GAAO,OAAO,CAAC,IAAR,CAAa,GAAb;EACP,IAAG,IAAH;WACE,CAAC,GAAG,CAAC,MAAJ,CAAW,IAAK,CAAA,CAAA,CAAE,CAAC,MAAnB,CAAD,EAA6B,IAAK,CAAA,CAAA,CAAlC,EADF;GAAA,MAAA;WAGE,CAAC,GAAD,EAAM,IAAN,EAHF;;AAFO;;AAMT,QAAA,GAAc,MAAM,CAAC,QAAQ,CAAC,QAAhB,KAA4B,OAA/B,GAA4C,OAA5C,GAAyD,MAAM,CAAC,QAAQ,CAAC;;AACpF,YAAA,GAAe,SAAC,IAAD,EAAO,MAAP;AACb,MAAA;AAAA,OAAA,aAAA;;IAAA,IAAK,CAAA,GAAA,CAAL,GAAW;AAAX;SACA;AAFa;;AAIf,WAAA,GAAc,SAAC,MAAD;SACZ,YAAA,CAAa,EAAb,EAAiB,MAAjB;AADY;;AAGd,mBAAA,GAAsB,SAAC,SAAD,EAAY,OAAZ,EAAqB,YAArB,EAAmC,gBAAnC;AACpB,MAAA;EAAA,MAAA,GAAS,EAAE,CAAC,GAAH,CAAO,SAAP,EAAkB,OAAlB;EACT,MAAA,CAAW,IAAA,UAAU,CAAC,cAAX,CAA0B,OAA1B,CAAkC,CAAC,g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