From 853c41ba448a68c77dc88e9124e59fa0edfe154b Mon Sep 17 00:00:00 2001 From: Alexander Menshchikov Date: Wed, 4 Oct 2023 03:09:57 +0300 Subject: [PATCH] Many many fixes + bump deps (php, js) --- shared/homeless/.php-cs-fixer.php | 2 +- shared/homeless/assets/js/app.js | 189 ++++--- .../assets/js/lib/canvas-to-blob.min.js | 1 - .../homeless/assets/js/lib/jpeg_camera.min.js | 330 ----------- .../assets/js/lib/jquery.slimscroll.js | 468 ---------------- shared/homeless/assets/js/lib/lightbox.js | 511 ------------------ .../homeless/assets/js/lib/swfobject.min.js | 4 - shared/homeless/composer.json | 1 + shared/homeless/composer.lock | 436 +++++++-------- shared/homeless/config/packages/twig.php | 5 +- shared/homeless/package.json | 3 + .../homeless/src/Admin/CertificateAdmin.php | 3 +- .../homeless/src/Admin/UserOwnableTrait.php | 3 +- .../homeless/src/Controller/App/Version.php | 6 +- shared/homeless/src/Entity/Contract.php | 4 +- .../homeless/src/Form/Type/AppPhotoType.php | 4 +- shared/homeless/src/Service/ReportService.php | 4 +- .../fields/service_type_select.html.twig | 9 - .../homeless/templates/admin/report.html.twig | 326 ++++------- .../admin/service/base_edit_form.html.twig | 10 - .../homeless/templates/form/fields.html.twig | 1 - shared/homeless/webpack.config.js | 2 +- shared/homeless/yarn.lock | 398 +++++++------- 23 files changed, 653 insertions(+), 2067 deletions(-) delete mode 100644 shared/homeless/assets/js/lib/canvas-to-blob.min.js delete mode 100644 shared/homeless/assets/js/lib/jpeg_camera.min.js delete mode 100644 shared/homeless/assets/js/lib/jquery.slimscroll.js delete mode 100644 shared/homeless/assets/js/lib/lightbox.js delete mode 100644 shared/homeless/assets/js/lib/swfobject.min.js delete mode 100644 shared/homeless/templates/admin/fields/service_type_select.html.twig diff --git a/shared/homeless/.php-cs-fixer.php b/shared/homeless/.php-cs-fixer.php index 7d1f5c21..7729909e 100644 --- a/shared/homeless/.php-cs-fixer.php +++ b/shared/homeless/.php-cs-fixer.php @@ -28,7 +28,6 @@ 'blank_line_before_statement' => [ 'statements' => ['case', 'default', 'return', 'throw', 'try'], ], - 'curly_braces_position' => false, 'comment_to_phpdoc' => [ 'ignored_tags' => [ 'see', @@ -37,6 +36,7 @@ ], 'linebreak_after_opening_tag' => false, 'method_argument_space' => [ + 'attribute_placement' => 'standalone', 'on_multiline' => 'ignore', ], 'multiline_whitespace_before_semicolons' => [ diff --git a/shared/homeless/assets/js/app.js b/shared/homeless/assets/js/app.js index 61fb2f1e..15e9d64f 100644 --- a/shared/homeless/assets/js/app.js +++ b/shared/homeless/assets/js/app.js @@ -1,34 +1,37 @@ import '../css/lightbox.css' import '../css/style.css' -import 'script-loader!./lib/jquery.slimscroll' -import 'script-loader!./lib/swfobject.min' -import 'script-loader!./lib/canvas-to-blob.min' -import 'script-loader!./lib/jpeg_camera.min' -import 'script-loader!./lib/lightbox' + +import 'script-loader!lightbox2/dist/js/lightbox.min' +import 'script-loader!jquery-slimscroll/jquery.slimscroll.min' + +import '@yoobic/jpeg-camera-es6/lib/swfobject.min' +import 'script-loader!@yoobic/jpeg-camera-es6/lib/canvas-to-blob.min' + +import JpegCamera from '@yoobic/jpeg-camera-es6' // Initialized at the end -var camera; +let camera; +const photoInput = $('.client_photo_file')[0]; -var update_stream_stats = function (stats) { +const update_stream_stats = function (stats) { $("#stream_stats").html( "Mean luminance = " + stats.mean + "; Standard Deviation = " + stats.std); setTimeout(function () { - camera.get_stats(update_stream_stats); + camera.getStats(update_stream_stats); }, 1000); }; -var take_snapshots = function (count) { - var snapshot = camera.capture(); +const take_snapshots = function (count) { + const snapshot = camera.capture(); - if (JpegCamera.canvas_supported()) { - snapshot.get_canvas(add_snapshot); - } - else { + if (camera.canvasSupported()) { + snapshot.getCanvas(add_snapshot); + } else { // is not supported in this browser. // We'll use anonymous graphic instead. - var image = document.createElement("img"); + let image = document.createElement("img"); image.src = "no_canvas_photo.jpg"; setTimeout(function () { add_snapshot.call(snapshot, image) @@ -42,53 +45,62 @@ var take_snapshots = function (count) { } }; -var add_snapshot = function (element) { +const add_snapshot = function (element) { $(element).data("snapshot", this).addClass("item"); - var $container = $("#snapshots").append(element); - var $camera = $("#camera"); - var camera_ratio = $camera.innerWidth() / $camera.innerHeight(); + const $camera = $("#camera"); + const $container = $("#snapshots").append(element); + const camera_ratio = $camera.innerWidth() / $camera.innerHeight(); - var height = $container.height() + const height = $container.height() element.style.height = "" + height + "px"; element.style.width = "" + Math.round(camera_ratio * height) + "px"; - var scroll = $container[0].scrollWidth - $container.innerWidth(); + const scroll = $container[0].scrollWidth - $container.innerWidth(); $container.animate({ scrollLeft: scroll }, 200); $(".item").removeClass("selected"); - $('.client_photo_input').val(''); - var snapshot = $(element).addClass("selected").data("snapshot"); + photoInput.files = (new DataTransfer()).files; + + const snapshot = $(element).addClass("selected").data("snapshot"); $("#discard_snapshot, #upload_snapshot, #api_url").show(); snapshot.show(); $("#show_stream").show(); - snapshot.get_canvas(function (a) { - $('.client_photo_input').val(a.toDataURL()); + snapshot.getCanvas(canvas => { + canvas.toBlob(blob => { + const dt = new DataTransfer() + dt.items.add(new File([blob], "photo.png", {type: "image/png"})) + photoInput.files = dt.files + }) }); }; -var select_snapshot = function () { +const select_snapshot = function () { $(".item").removeClass("selected"); - $('.client_photo_input').val(''); - var snapshot = $(this).addClass("selected").data("snapshot"); + photoInput.files = (new DataTransfer()).files; + + const snapshot = $(this).addClass("selected").data("snapshot"); $("#discard_snapshot, #upload_snapshot, #api_url").show(); snapshot.show(); $("#show_stream").show(); - snapshot.get_canvas(function (a) { - $('.client_photo_input').val(a.toDataURL()); + snapshot.getCanvas(canvas => { + canvas.toBlob(blob => { + const dt = new DataTransfer() + dt.items.add(new File([blob], "photo.png", {type: "image/png"})) + photoInput.files = dt.files + }) }); }; -var clear_upload_data = function () { +const clear_upload_data = function () { $("#upload_status, #upload_result").html(""); }; -var upload_snapshot = function () { - var api_url = $("#api_url").val(); - +const upload_snapshot = function () { + const api_url = $("#api_url").val(); if (!api_url.length) { $("#upload_status").html("Please provide URL for the upload"); return; @@ -98,18 +110,18 @@ var upload_snapshot = function () { $("#loader").show(); $("#upload_snapshot").prop("disabled", true); - var snapshot = $(".item.selected").data("snapshot"); + const snapshot = $(".item.selected").data("snapshot"); snapshot.upload({api_url: api_url}).done(upload_done).fail(upload_fail); }; -var upload_done = function (response) { +const upload_done = function (response) { $("#upload_snapshot").prop("disabled", false); $("#loader").hide(); $("#upload_status").html("Upload successful"); $("#upload_result").html(response); }; -var upload_fail = function (code, error, response) { +const upload_fail = function (code, error, response) { $("#upload_snapshot").prop("disabled", false); $("#loader").hide(); $("#upload_status").html( @@ -117,10 +129,10 @@ var upload_fail = function (code, error, response) { $("#upload_result").html(response); }; -var discard_snapshot = function () { - var element = $(".item.selected").removeClass("item selected"); +const discard_snapshot = function () { + const element = $(".item.selected").removeClass("item selected"); - var next = element.nextAll(".item").first(); + let next = element.nextAll(".item").first(); if (!next.size()) { next = element.prevAll(".item").first(); @@ -141,63 +153,68 @@ var discard_snapshot = function () { }); }; -var show_stream = function () { +const show_stream = function () { $(this).hide(); $(".item").removeClass("selected"); - $('.client_photo_input').val(''); + photoInput.files = (new DataTransfer()).files; hide_snapshot_controls(); clear_upload_data(); - camera.show_stream(); + camera.showStream(); }; -var hide_snapshot_controls = function () { +const hide_snapshot_controls = function () { $("#discard_snapshot, #upload_snapshot, #api_url").hide(); $("#upload_result, #upload_status").html(""); $("#show_stream").hide(); }; -var jpegCameraInit = function () { - $("#take_snapshots").off(); - $("#snapshots").off(); - $("#upload_snapshot").off(); - $("#discard_snapshot").off(); - $("#show_stream").off(); +const jpegCameraInit = function () { + const $takeSnapshots = $("#take_snapshots"); + const $snapshots = $("#snapshots"); + const $uploadSnapshot = $("#upload_snapshot"); + const $discardSnapshot = $("#discard_snapshot"); + const $showStream = $("#show_stream"); + + $takeSnapshots.off(); + $snapshots.off(); + $uploadSnapshot.off(); + $discardSnapshot.off(); + $showStream.off(); $('#snapshots .item').remove(); $('#snapshots_container').hide(); - $("#show_stream").hide(); + $showStream.hide(); - if (window.JpegCamera) { - $("#take_snapshots").click(function (e) { - e.stopPropagation(); - e.preventDefault(); - $('#snapshots_container').show(); - take_snapshots(1); - return false; - }); - - $("#snapshots").on("click", ".item", select_snapshot); - - $("#upload_snapshot").click(upload_snapshot); - $("#discard_snapshot").click(discard_snapshot); - - $("#show_stream").click(function (e) { - e.stopPropagation(); - e.preventDefault(); - show_stream(); - return false; - }); - - camera = new JpegCamera("#camera", { - mirror: true - }).ready(function (info) { - $("#take_snapshots").show(); - - $("#camera_info").html( - "Camera resolution: " + info.video_width + "x" + info.video_height); - - this.get_stats(update_stream_stats); - }); - } + $takeSnapshots.click(function (e) { + e.stopPropagation(); + e.preventDefault(); + $('#snapshots_container').show(); + take_snapshots(1); + return false; + }); + + $snapshots.on("click", ".item", select_snapshot); + + $uploadSnapshot.click(upload_snapshot); + $discardSnapshot.click(discard_snapshot); + + $showStream.click(function (e) { + e.stopPropagation(); + e.preventDefault(); + show_stream(); + return false; + }); + + JpegCamera(document.getElementById('camera'), { + mirror: true, + onInit: (webcam) => { + camera = webcam; + }, + onReady: (info) => { + $takeSnapshots.show(); + $("#camera_info").html(`Camera resolution: ${info.videoWidth}x${info.videoHeight}`); + camera.getStats(update_stream_stats); + }, + }); }; $(function () { @@ -211,13 +228,11 @@ $(function () { $("#do-webcam-photo").click(function (e) { $('.client_photo_file').val('').css('visibility', 'hidden'); $('#user-file-photo').hide(); - $('#user-webcam-photo').show(function () { - jpegCameraInit(); - }); + $('#user-webcam-photo').show(jpegCameraInit); return false; }); - var btnAddDropDown = $('.fa-plus-circle').parent('.sonata-action-element'); + const btnAddDropDown = $('.fa-plus-circle').parent('.sonata-action-element'); $(btnAddDropDown).css('font-weight', '600'); $(btnAddDropDown).css('color', '#00a65a'); }); diff --git a/shared/homeless/assets/js/lib/canvas-to-blob.min.js b/shared/homeless/assets/js/lib/canvas-to-blob.min.js deleted file mode 100644 index ece99f38..00000000 --- a/shared/homeless/assets/js/lib/canvas-to-blob.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B f; f++) if (c = d[f]) for (b in c) e = c[b], a[b] = e; - return a - }, a.prototype._debug = function (a) { - return this.options.on_debug ? this.options.on_debug.call(this, a) : void 0 - }, a.prototype._display = function (a) { - return this._engine_display(a), this._displayed_snapshot = a - }, a.prototype._displayed_snapshot = null, a.prototype._discard = function (a) { - return this._displayed_snapshot === a && this.show_stream(), this._engine_discard(a), a._discarded = !0, delete this._snapshots[a.id] - }, a.prototype._prepared = function (a, b) { - var c; - return this.video_width = a, this.video_height = b, this._debug("Camera resolution " + this.video_width + "x" + this.video_height + "px"), c = this, setTimeout(function () { - return c._wait_until_stream_looks_ok(!0) - }, 1) - }, a.prototype._wait_until_stream_looks_ok = function (a) { - return this.get_stats(function (b) { - var c; - return b.std > 2 ? (this._debug("Stream mean gray value = " + b.mean + " standard deviation = " + b.std), this._debug("Camera is ready"), this._is_ready = !0, this.options.on_ready ? this.options.on_ready.call(this, { - video_width: this.video_width, - video_height: this.video_height - }) : void 0) : (a && this._debug("Stream mean gray value = " + b.mean + " standard deviation = " + b.std), c = this, setTimeout(function () { - return c._wait_until_stream_looks_ok(!1) - }, 100)) - }) - }, a.prototype._got_error = function (a) { - return this._debug("Error - " + a), this._error_occured = a, this.options.on_error ? this.options.on_error.call(this, this._error_occured) : void 0 - }, a.prototype._block_element_access = function () { - return this._overlay = document.createElement("div"), this._overlay.style.width = "100%", this._overlay.style.height = "100%", this._overlay.style.position = "absolute", this._overlay.style.top = 0, this._overlay.style.left = 0, this._overlay.style.zIndex = 2, this.container.appendChild(this._overlay) - }, a.prototype._overlay = null, a.prototype.view_width = null, a.prototype.view_height = null, a._add_prefixed_style = function (a, b, c) { - var d; - return d = b.charAt(0).toUpperCase() + b.slice(1), a.style[b] = c, a.style["Webkit" + d] = c, a.style["Moz" + d] = c, a.style["ms" + d] = c, a.style["O" + d] = c - }, a - }(), navigator.getUserMedia || (navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia), window.AudioContext || (window.AudioContext = window.webkitAudioContext), h = function () { - var a; - if (a = document.createElement("canvas"), a.getContext && !a.toBlob) throw"JpegCamera: Canvas-to-Blob is not loaded" - }, navigator.getUserMedia && (h(), l = "audio/ogg; codecs=vorbis", i = "audio/mpeg; ", f = function (a) { - var b; - return b = document.createElement("video"), !(!b.canPlayType || !b.canPlayType(a).replace(/no/, "")) - }, c = function (b) { - function c() { - return m = c.__super__.constructor.apply(this, arguments) - } - - return p(c, b), c.prototype._engine_init = function () { - var b, c, d, e, g, h, j; - this._debug("Using HTML5 engine"), j = Math.floor(.2 * this.view_height), e = Math.floor(.2 * this.view_width), this.message = document.createElement("div"), this.message["class"] = "message", this.message.style.width = "100%", this.message.style.height = "100%", a._add_prefixed_style(this.message, "boxSizing", "border-box"), this.message.style.overflow = "hidden", this.message.style.textAlign = "center", this.message.style.paddingTop = "" + j + "px", this.message.style.paddingBottom = "" + j + "px", this.message.style.paddingLeft = "" + e + "px", this.message.style.paddingRight = "" + e + "px", this.message.style.position = "absolute", this.message.style.zIndex = 3, this.message.innerHTML = "Please allow camera access when prompted by the browser.

Look for camera icon around your address bar.", this.container.appendChild(this.message), this.video_container = document.createElement("div"), this.video_container.style.width = "" + this.view_width + "px", this.video_container.style.height = "" + this.view_height + "px", this.video_container.style.overflow = "hidden", this.video_container.style.position = "absolute", this.video_container.style.zIndex = 1, this.container.appendChild(this.video_container), this.video = document.createElement("video"), this.video.autoplay = !0, window.AudioContext && (f(l) ? this._load_shutter_sound(this.options.shutter_ogg_url) : f(i) && this._load_shutter_sound(this.options.shutter_mp3_url)), d = {video: {optional: [{minWidth: 1280}, {minWidth: 640}, {minWidth: 480}, {minWidth: 360}]}}, h = this - , - g = function (a) { - return h._remove_message(), - window.URL ? - h.video.srcObject = a : - h.video.src = a, - h._block_element_access(), - h._wait_for_video_ready() - }, - c = function (a) { - var b, c, d; - h.message.innerHTML = 'You have denied camera access.

Look for camera icon around your address bar to change your decision.', b = a.code; - for (c in a) if (d = a[c], "code" !== c) return void h._got_error(c); - return h._got_error("UNKNOWN ERROR") - }; - try { - return navigator.getUserMedia(d, g, c) - } catch (k) { - return b = k, navigator.getUserMedia("video", g, c) - } - }, c.prototype._engine_play_shutter_sound = function () { - var a; - if (this.shutter_buffer) return a = this.audio_context.createBufferSource(), a.buffer = this.shutter_buffer, a.connect(this.audio_context.destination), a.start(0) - }, c.prototype._engine_capture = function (a, b, c, d) { - var e, f, g; - return g = this._get_capture_crop(), e = document.createElement("canvas"), e.width = Math.round(g.width * d), e.height = Math.round(g.height * d), f = e.getContext("2d"), f.drawImage(this.video, g.x_offset, g.y_offset, g.width, g.height, 0, 0, Math.round(g.width * d), Math.round(g.height * d)), a._canvas = e, a._mirror = b, a._quality = c - }, c.prototype._engine_display = function (b) { - return this.displayed_canvas && this.container.removeChild(this.displayed_canvas), this.displayed_canvas = b._canvas, this.displayed_canvas.style.width = "" + this.view_width + "px", this.displayed_canvas.style.height = "" + this.view_height + "px", this.displayed_canvas.style.top = 0, this.displayed_canvas.style.left = 0, this.displayed_canvas.style.position = "absolute", this.displayed_canvas.style.zIndex = 2, this.container.appendChild(this.displayed_canvas) - }, c.prototype._engine_get_canvas = function (a) { - var b, c; - return b = document.createElement("canvas"), b.width = a._canvas.width, b.height = a._canvas.height, c = b.getContext("2d"), c.drawImage(a._canvas, 0, 0), b - }, c.prototype._engine_get_image_data = function (a) { - var b, c; - return b = a._canvas, c = b.getContext("2d"), c.getImageData(0, 0, b.width, b.height) - }, c.prototype._engine_get_blob = function (a, b, c, d, e) { - var f, g; - return c ? (f = document.createElement("canvas"), f.width = a._canvas.width, f.height = a._canvas.height, g = f.getContext("2d"), g.setTransform(1, 0, 0, 1, 0, 0), g.translate(f.width, 0), g.scale(-1, 1), g.drawImage(a._canvas, 0, 0)) : f = a._canvas, f.toBlob(function (a) { - return e(a) - }, b, d) - }, c.prototype._engine_discard = function (a) { - return a._xhr && a._xhr.abort(), delete a._xhr, delete a._canvas - }, c.prototype._engine_show_stream = function () { - return this.displayed_canvas && (this.container.removeChild(this.displayed_canvas), this.displayed_canvas = null), this.video_container.style.display = "block" - }, c.prototype._engine_upload = function (a, b, c, d) { - return this._debug("Uploading the file"), a.get_blob(function (e) { - var f, g; - return f = function (b) { - return delete a._xhr, a._status = b.target.status, a._response = b.target.responseText, a._status >= 200 && a._status < 300 ? a._upload_done() : (a._error_message = b.target.statusText || "Unknown error", a._upload_fail()) - }, g = new XMLHttpRequest, g.open("POST", b), g.timeout = d, c && g.setRequestHeader("X-CSRF-Token", c), g.onload = f, g.onerror = f, g.onabort = f, g.send(e), a._xhr = g - }, "image/jpeg") - }, c.prototype._remove_message = function () { - return this.message.style.display = "none" - }, c.prototype._load_shutter_sound = function (a) { - var b, c; - if (!this.audio_context) return this.audio_context = new AudioContext, b = new XMLHttpRequest, b.open("GET", a, !0), b.responseType = "arraybuffer", c = this, b.onload = function () { - return c.audio_context.decodeAudioData(b.response, function (a) { - return c.shutter_buffer = a - }) - }, b.send() - }, c.prototype._wait_for_video_ready = function () { - var a, b, c, d; - return d = parseInt(this.video.videoWidth), c = parseInt(this.video.videoHeight), d > 0 && c > 0 ? (this.video_container.appendChild(this.video), this.video_width = d, this.video_height = c, a = this._get_video_crop(), this.video.style.position = "relative", this.video.style.width = "" + a.width + "px", this.video.style.height = "" + a.height + "px", this.video.style.left = "" + a.x_offset + "px", this.video.style.top = "" + a.y_offset + "px", this._prepared(this.video_width, this.video_height)) : this._status_checks_count > 100 ? this._got_error("Camera failed to initialize in 10 seconds") : (this._status_checks_count++, b = this, setTimeout(function () { - return b._wait_for_video_ready() - }, 100)) - }, c.prototype._status_checks_count = 0, c.prototype._get_video_crop = function () { - var a, b, c, d, e; - return c = this.video_width / this.video_height, e = this.view_width / this.view_height, c >= e ? (this._debug("Filling height"), d = this.view_height / this.video_height, b = Math.round(this.video_width * d), { - width: b, - height: this.view_height, - x_offset: -Math.floor((b - this.view_width) / 2), - y_offset: 0 - }) : (this._debug("Filling width"), d = this.view_width / this.video_width, a = Math.round(this.video_height * d), { - width: this.view_width, - height: a, - x_offset: 0, - y_offset: -Math.floor((a - this.view_height) / 2) - }) - }, c.prototype._get_capture_crop = function () { - var a, b, c, d; - return c = this.video_width / this.video_height, d = this.view_width / this.view_height, c >= d ? (b = Math.round(this.video_height * d), { - width: b, - height: this.video_height, - x_offset: Math.floor((this.video_width - b) / 2), - y_offset: 0 - }) : (a = Math.round(this.video_width / d), { - width: this.video_width, - height: a, - x_offset: 0, - y_offset: Math.floor((this.video_height - a) / 2) - }) - }, c - }(a), window.JpegCamera = c), !window.swfobject) throw"JpegCamera: SWFObject is not loaded"; - k = "9", j = !window.JpegCamera || !window.AudioContext || window.jpeg_camera_force_flash, g = function () { - return window.swfobject && swfobject.hasFlashPlayerVersion(k) - }, j && g() && (b = function (b) { - function c() { - return n = c.__super__.constructor.apply(this, arguments) - } - - return p(c, b), c._send_message = function (a, b) { - var c, d; - return (d = this._instances[parseInt(a)]) ? (c = Array.prototype.slice.call(arguments, 2), this.prototype[b].apply(d, c)) : void 0 - }, c._instances = {}, c._next_id = 1, c.prototype._engine_init = function () { - var a, b, c, d, e, f, g; - return this._debug("Using Flash engine"), this._id = this.constructor._next_id++, this.constructor._instances[this._id] = this, this.view_width < 215 || this.view_height < 138 ? void this._got_error("camera is too small to display privacy dialog") : (d = "flash_object_" + this._id, f = { - loop: "false", - allowScriptAccess: "always", - allowFullScreen: "false", - quality: "best", - wmode: "opaque", - menu: "false" - }, a = {id: d, align: "middle"}, e = { - id: this._id, - width: this.view_width, - height: this.view_height, - shutter_url: this.options.shutter_mp3_url - }, g = this, b = function (a) { - return a.success ? (g._debug("Flash loaded"), g._flash = document.getElementById(d)) : g._got_error("Flash loading failed.") - }, c = document.createElement("div"), c.id = "jpeg_camera_flash_" + this._id, c.style.width = "100%", c.style.height = "100%", this.container.appendChild(c), swfobject.embedSWF(this.options.swf_url, c.id, this.view_width, this.view_height, "9", null, e, f, a, b)) - }, c.prototype._engine_play_shutter_sound = function () { - return this._flash._play_shutter() - }, c.prototype._engine_capture = function (a, b, c, d) { - return this._flash._capture(a.id, b, c, d) - }, c.prototype._engine_display = function (a) { - return this._flash._display(a.id) - }, c.prototype._engine_get_canvas = function (a) { - var b, c; - return a._image_data || (a._image_data = this._engine_get_image_data(a)), b = document.createElement("canvas"), b.width = a._image_data.width, b.height = a._image_data.height, c = b.getContext("2d"), c.putImageData(a._image_data, 0, 0), b - }, c.prototype._engine_get_image_data = function (b) { - var c, d, e, f, g, h, i, j, k, l, m, n, o; - for (f = this._flash._get_image_data(b.id), a.canvas_supported() ? (d = document.createElement("canvas"), d.width = f.width, d.height = f.height, e = d.getContext("2d"), l = e.createImageData(f.width, f.height)) : l = { - data: [], - width: f.width, - height: f.height - }, o = f.data, h = m = 0, n = o.length; n > m; h = ++m) j = o[h], i = 4 * h, k = j >> 16 & 255, g = j >> 8 & 255, c = 255 & j, l.data[i + 0] = k, l.data[i + 1] = g, l.data[i + 2] = c, l.data[i + 3] = 255; - return l - }, c.prototype._engine_get_blob = function (a, b, c, d, e) { - var f, g; - return a._extra_canvas || (a._extra_canvas = this._engine_get_canvas(a)), c ? (f = document.createElement("canvas"), f.width = a._canvas.width, f.height = a._canvas.height, g = f.getContext("2d"), g.setTransform(1, 0, 0, 1, 0, 0), g.translate(f.width, 0), g.scale(-1, 1), g.drawImage(a._extra_canvas, 0, 0)) : f = a._extra_canvas, f.toBlob(function (a) { - return e(a) - }, b, d) - }, c.prototype._engine_discard = function (a) { - return this._flash._discard(a.id) - }, c.prototype._engine_show_stream = function () { - return this._flash._show_stream() - }, c.prototype._engine_upload = function (a, b, c, d) { - return this._flash._upload(a.id, b, c, d) - }, c.prototype._flash_prepared = function (a, b) { - return this._block_element_access(), document.body.tabIndex = 0, document.body.focus(), this._prepared(a, b) - }, c.prototype._flash_upload_complete = function (a, b, c, d) { - var e; - return a = parseInt(a), e = this._snapshots[a], e._status = parseInt(b), e._response = d, e._status >= 200 && e._status < 300 ? e._upload_done() : (e._error_message = c, e._upload_fail()) - }, c - }(a), window.JpegCamera = b), d = function () { - function b(a, b) { - this.camera = a, this.options = b, this.id = this.constructor._next_snapshot_id++ - } - - return b._next_snapshot_id = 1, b.prototype._discarded = !1, b.prototype.show = function () { - return this._discarded && raise("discarded snapshot cannot be used"), this.camera._display(this), this - }, b.prototype.hide = function () { - return this.camera.displayed_snapshot() === this && this.camera.show_stream(), this - }, b.prototype.get_stats = function (a) { - return this._discarded && raise("discarded snapshot cannot be used"), this.get_image_data(function (b) { - return this._get_stats(b, a) - }) - }, b.prototype.get_canvas = function (b) { - var c; - return this._discarded && raise("discarded snapshot cannot be used"), !a._canvas_supported, c = this, setTimeout(function () { - return c._extra_canvas || (c._extra_canvas = c.camera._engine_get_canvas(c)), b.call(c, c._extra_canvas) - }, 1), !0 - }, b.prototype._extra_canvas = null, b.prototype.get_blob = function (b, c) { - var d; - return null == c && (c = "image/jpeg"), this._discarded && raise("discarded snapshot cannot be used"), !a._canvas_supported, d = this, setTimeout(function () { - var a, e; - return d._blob_mime !== c && (d._blob = null), d._blob_mime = c, d._blob ? b.call(d, d._blob) : (a = d.options.mirror, e = d.options.quality, d.camera._engine_get_blob(d, c, a, e, function (a) { - return d._blob = a, b.call(d, d._blob) - })) - }, 1), !0 - }, b.prototype._blob = null, b.prototype._blob_mime = null, b.prototype.get_image_data = function (a) { - var b; - return this._discarded && raise("discarded snapshot cannot be used"), b = this, setTimeout(function () { - return b._image_data || (b._image_data = b.camera._engine_get_image_data(b)), a.call(b, b._image_data) - }, 1), null - }, b.prototype._image_data = null, b.prototype.upload = function (a) { - var b; - if (null == a && (a = {}), this._discarded && raise("discarded snapshot cannot be used"), this._uploading) return void this.camera._debug("Upload already in progress"); - if (this._uploading = !0, this._retry = 1, this._upload_options = a, b = this._options(), !b.api_url) throw this.camera._debug("Snapshot#upload called without valid api_url"), "Snapshot#upload called without valid api_url"; - return this._start_upload(b), this - }, b.prototype._upload_options = {}, b.prototype._uploading = !1, b.prototype._retry = 1, b.prototype.done = function (a) { - var b; - return this._discarded && raise("discarded snapshot cannot be used"), this._upload_options.on_upload_done = a, b = this._options(), b.on_upload_done && this._done && b.on_upload_done.call(this, this._response), this - }, b.prototype._done = !1, b.prototype._response = null, b.prototype.fail = function (a) { - var b; - return this._discarded && raise("discarded snapshot cannot be used"), this._upload_options.on_upload_fail = a, b = this._options(), b.on_upload_fail && this._fail && b.on_upload_fail.call(this, this._status, this._error_message, this._response), this - }, b.prototype._fail = !1, b.prototype._status = null, b.prototype._error_message = null, b.prototype.discard = function () { - return this.camera._discard(this), delete this._extra_canvas, delete this._image_data, void delete this._blob - }, b.prototype._options = function () { - return this.camera._extend({}, this.camera.options, this.options, this._upload_options) - }, b.prototype._start_upload = function (a) { - var b; - return b = "string" == typeof a.csrf_token && a.csrf_token.length > 0 ? a.csrf_token : null, this._done = !1, this._response = null, this._fail = !1, this._status = null, this._error_message = null, this.camera._engine_upload(this, a.api_url, b, a.timeout) - }, b.prototype._get_stats = function (a, b) { - var c, d, f, g, h, i, j, k, l, m, n; - if (!this._stats) { - for (i = a.width * a.height, j = 0, d = new Array(i), f = l = 0; i > l; f = l += 1) g = 4 * f, c = .2126 * a.data[g + 0] + .7152 * a.data[g + 1] + .0722 * a.data[g + 2], c = Math.round(c), j += c, d[f] = c; - for (h = Math.round(j / i), k = 0, m = 0, n = d.length; n > m; m++) c = d[m], k += Math.pow(c - h, 2); - this._stats = new e, this._stats.mean = h, this._stats.std = Math.round(Math.sqrt(k / i)) - } - return b.call(this, this._stats) - }, b.prototype._stats = null, b.prototype._upload_done = function () { - var a, b, c, d; - return this.camera._debug("Upload completed with status " + this._status), this._done = !0, a = this._options(), c = a.retry_success && a.retry_if && a.retry_if.call(this, this._status, this._error_message, this._response, this._retry), !0 === c && (c = 0), "number" == typeof c ? (this._retry++, c > 0 ? (b = parseInt(c), this.camera._debug("Will retry the upload in " + b + "ms (attempt #" + this._retry + ")"), d = this, setTimeout(function () { - return d._start_upload(a) - }, b)) : (this.camera._debug("Will retry the upload immediately (attempt #" + this._retry + ")"), this._start_upload(a))) : (this._uploading = !1, a.on_upload_done ? a.on_upload_done.call(this, this._response) : void 0) - }, b.prototype._upload_fail = function () { - var a, b, c, d; - return this.camera._debug("Upload failed with status " + this._status), this._fail = !0, a = this._options(), c = a.retry_if && a.retry_if.call(this, this._status, this._error_message, this._response, this._retry), !0 === c && (c = 0), "number" == typeof c ? (this._retry++, c > 0 ? (b = parseInt(c), this.camera._debug("Will retry the upload in " + b + "ms (attempt #" + this._retry + ")"), d = this, setTimeout(function () { - return d._start_upload(a) - }, b)) : (this.camera._debug("Will retry the upload immediately (attempt #" + this._retry + ")"), this._start_upload(a))) : (this._uploading = !1, a.on_upload_fail ? a.on_upload_fail.call(this, this._status, this._error_message, this._response) : void 0) - }, b - }(), e = function () { - function a() { - } - - return a.prototype.mean = null, a.prototype.std = null, a - }() -}).call(this); \ No newline at end of file diff --git a/shared/homeless/assets/js/lib/jquery.slimscroll.js b/shared/homeless/assets/js/lib/jquery.slimscroll.js deleted file mode 100644 index a4b25804..00000000 --- a/shared/homeless/assets/js/lib/jquery.slimscroll.js +++ /dev/null @@ -1,468 +0,0 @@ -/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Version: 1.3.8 - * - */ -(function ($) { - - $.fn.extend({ - slimScroll: function (options) { - - var defaults = { - - // width in pixels of the visible scroll area - width: 'auto', - - // height in pixels of the visible scroll area - height: '250px', - - // width in pixels of the scrollbar and rail - size: '7px', - - // scrollbar color, accepts any hex/color value - color: '#000', - - // scrollbar position - left/right - position: 'right', - - // distance in pixels between the side edge and the scrollbar - distance: '1px', - - // default scroll position on load - top / bottom / $('selector') - start: 'top', - - // sets scrollbar opacity - opacity: .4, - - // enables always-on mode for the scrollbar - alwaysVisible: false, - - // check if we should hide the scrollbar when user is hovering over - disableFadeOut: false, - - // sets visibility of the rail - railVisible: false, - - // sets rail color - railColor: '#333', - - // sets rail opacity - railOpacity: .2, - - // whether we should use jQuery UI Draggable to enable bar dragging - railDraggable: true, - - // defautlt CSS class of the slimscroll rail - railClass: 'slimScrollRail', - - // defautlt CSS class of the slimscroll bar - barClass: 'slimScrollBar', - - // defautlt CSS class of the slimscroll wrapper - wrapperClass: 'slimScrollDiv', - - // check if mousewheel should scroll the window if we reach top/bottom - allowPageScroll: false, - - // scroll amount applied to each mouse wheel step - wheelStep: 20, - - // scroll amount applied when user is using gestures - touchScrollStep: 200, - - // sets border radius - borderRadius: '7px', - - // sets border radius of the rail - railBorderRadius: '7px' - }; - - var o = $.extend(defaults, options); - - // device detection - if (!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) - || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4)))) { - return this; - } - - // do it for every element that matches selector - this.each(function () { - - var isOverPanel, isOverBar, isDragg, queueHide, touchDif, - barHeight, percentScroll, lastScroll, - divS = '
', - minBarHeight = 30, - releaseScroll = false; - - // used in event handlers and for better minification - var me = $(this); - - // ensure we are not binding it again - if (me.parent().hasClass(o.wrapperClass)) { - // start from last bar position - var offset = me.scrollTop(); - - // find bar and rail - bar = me.siblings('.' + o.barClass); - rail = me.siblings('.' + o.railClass); - - getBarHeight(); - - // check if we should scroll existing instance - if ($.isPlainObject(options)) { - // Pass height: auto to an existing slimscroll object to force a resize after contents have changed - if ('height' in options && options.height == 'auto') { - me.parent().css('height', 'auto'); - me.css('height', 'auto'); - var height = me.parent().parent().height(); - me.parent().css('height', height); - me.css('height', height); - } else if ('height' in options) { - var h = options.height; - me.parent().css('height', h); - me.css('height', h); - } - - if ('scrollTo' in options) { - // jump to a static point - offset = parseInt(o.scrollTo); - } - else if ('scrollBy' in options) { - // jump by value pixels - offset += parseInt(o.scrollBy); - } - else if ('destroy' in options) { - // remove slimscroll elements - bar.remove(); - rail.remove(); - me.unwrap(); - return; - } - - // scroll content by the given offset - scrollContent(offset, false, true); - } - - return; - } - else if ($.isPlainObject(options)) { - if ('destroy' in options) { - return; - } - } - - // optionally set height to the parent's height - o.height = (o.height == 'auto') ? me.parent().height() : o.height; - - // wrap content - var wrapper = $(divS) - .addClass(o.wrapperClass) - .css({ - position: 'relative', - overflow: 'hidden', - width: o.width, - height: o.height - }); - - // update style for the div - me.css({ - overflow: 'hidden', - width: o.width, - height: o.height - }); - - // create scrollbar rail - var rail = $(divS) - .addClass(o.railClass) - .css({ - width: o.size, - height: '100%', - position: 'absolute', - top: 0, - display: (o.alwaysVisible && o.railVisible) ? 'block' : 'none', - 'border-radius': o.railBorderRadius, - background: o.railColor, - opacity: o.railOpacity, - zIndex: 90 - }); - - // create scrollbar - var bar = $(divS) - .addClass(o.barClass) - .css({ - background: o.color, - width: o.size, - position: 'absolute', - top: 0, - opacity: o.opacity, - display: o.alwaysVisible ? 'block' : 'none', - 'border-radius': o.borderRadius, - BorderRadius: o.borderRadius, - MozBorderRadius: o.borderRadius, - WebkitBorderRadius: o.borderRadius, - zIndex: 99 - }); - - // set position - var posCss = (o.position == 'right') ? {right: o.distance} : {left: o.distance}; - rail.css(posCss); - bar.css(posCss); - - // wrap it - me.wrap(wrapper); - - // append to parent div - me.parent().append(bar); - me.parent().append(rail); - - // make it draggable and no longer dependent on the jqueryUI - if (o.railDraggable) { - bar.bind("mousedown", function (e) { - var $doc = $(document); - isDragg = true; - t = parseFloat(bar.css('top')); - pageY = e.pageY; - - $doc.bind("mousemove.slimscroll", function (e) { - currTop = t + e.pageY - pageY; - bar.css('top', currTop); - scrollContent(0, bar.position().top, false);// scroll content - }); - - $doc.bind("mouseup.slimscroll", function (e) { - isDragg = false; - hideBar(); - $doc.unbind('.slimscroll'); - }); - return false; - }).bind("selectstart.slimscroll", function (e) { - e.stopPropagation(); - e.preventDefault(); - return false; - }); - } - - // on rail over - rail.hover(function () { - showBar(); - }, function () { - hideBar(); - }); - - // on bar over - bar.hover(function () { - isOverBar = true; - }, function () { - isOverBar = false; - }); - - // show on parent mouseover - me.hover(function () { - isOverPanel = true; - showBar(); - hideBar(); - }, function () { - isOverPanel = false; - hideBar(); - }); - - // support for mobile - me.bind('touchstart', function (e, b) { - if (e.originalEvent.touches.length) { - // record where touch started - touchDif = e.originalEvent.touches[0].pageY; - } - }); - - me.bind('touchmove', function (e) { - // prevent scrolling the page if necessary - if (!releaseScroll) { - e.originalEvent.preventDefault(); - } - if (e.originalEvent.touches.length) { - // see how far user swiped - var diff = (touchDif - e.originalEvent.touches[0].pageY) / o.touchScrollStep; - // scroll content - scrollContent(diff, true); - touchDif = e.originalEvent.touches[0].pageY; - } - }); - - // set up initial height - getBarHeight(); - - // check start position - if (o.start === 'bottom') { - // scroll content to bottom - bar.css({top: me.outerHeight() - bar.outerHeight()}); - scrollContent(0, true); - } - else if (o.start !== 'top') { - // assume jQuery selector - scrollContent($(o.start).position().top, null, true); - - // make sure bar stays hidden - if (!o.alwaysVisible) { - bar.hide(); - } - } - - // attach scroll events - attachWheel(this); - - function _onWheel(e) { - // use mouse wheel only when mouse is over - if (!isOverPanel) { - return; - } - - var e = e || window.event; - - var delta = 0; - if (e.wheelDelta) { - delta = -e.wheelDelta / 120; - } - if (e.detail) { - delta = e.detail / 3; - } - - var target = e.target || e.srcTarget || e.srcElement; - if ($(target).closest('.' + o.wrapperClass).is(me.parent())) { - // scroll content - scrollContent(delta, true); - } - - // stop window scroll - if (e.preventDefault && !releaseScroll) { - e.preventDefault(); - } - if (!releaseScroll) { - e.returnValue = false; - } - } - - function scrollContent(y, isWheel, isJump) { - releaseScroll = false; - var delta = y; - var maxTop = me.outerHeight() - bar.outerHeight(); - - if (isWheel) { - // move bar with mouse wheel - delta = parseInt(bar.css('top')) + y * parseInt(o.wheelStep) / 100 * bar.outerHeight(); - - // move bar, make sure it doesn't go out - delta = Math.min(Math.max(delta, 0), maxTop); - - // if scrolling down, make sure a fractional change to the - // scroll position isn't rounded away when the scrollbar's CSS is set - // this flooring of delta would happened automatically when - // bar.css is set below, but we floor here for clarity - delta = (y > 0) ? Math.ceil(delta) : Math.floor(delta); - - // scroll the scrollbar - bar.css({top: delta + 'px'}); - } - - // calculate actual scroll amount - percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight()); - delta = percentScroll * (me[0].scrollHeight - me.outerHeight()); - - if (isJump) { - delta = y; - var offsetTop = delta / me[0].scrollHeight * me.outerHeight(); - offsetTop = Math.min(Math.max(offsetTop, 0), maxTop); - bar.css({top: offsetTop + 'px'}); - } - - // scroll content - me.scrollTop(delta); - - // fire scrolling event - me.trigger('slimscrolling', ~~delta); - - // ensure bar is visible - showBar(); - - // trigger hide when scroll is stopped - hideBar(); - } - - function attachWheel(target) { - if (window.addEventListener) { - target.addEventListener('DOMMouseScroll', _onWheel, false); - target.addEventListener('mousewheel', _onWheel, false); - } - else { - document.attachEvent("onmousewheel", _onWheel) - } - } - - function getBarHeight() { - // calculate scrollbar height and make sure it is not too small - barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight); - bar.css({height: barHeight + 'px'}); - - // hide scrollbar if content is not long enough - var display = barHeight == me.outerHeight() ? 'none' : 'block'; - bar.css({display: display}); - } - - function showBar() { - // recalculate bar height - getBarHeight(); - clearTimeout(queueHide); - - // when bar reached top or bottom - if (percentScroll == ~~percentScroll) { - //release wheel - releaseScroll = o.allowPageScroll; - - // publish approporiate event - if (lastScroll != percentScroll) { - var msg = (~~percentScroll == 0) ? 'top' : 'bottom'; - me.trigger('slimscroll', msg); - } - } - else { - releaseScroll = false; - } - lastScroll = percentScroll; - - // show only when required - if (barHeight >= me.outerHeight()) { - //allow window scroll - releaseScroll = true; - return; - } - bar.stop(true, true).fadeIn('fast'); - if (o.railVisible) { - rail.stop(true, true).fadeIn('fast'); - } - } - - function hideBar() { - // only hide when options allow it - if (!o.alwaysVisible) { - queueHide = setTimeout(function () { - if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg) { - bar.fadeOut('slow'); - rail.fadeOut('slow'); - } - }, 1000); - } - } - - }); - - // maintain chainability - return this; - } - }); - - $.fn.extend({ - slimscroll: $.fn.slimScroll - }); - -})(jQuery); diff --git a/shared/homeless/assets/js/lib/lightbox.js b/shared/homeless/assets/js/lib/lightbox.js deleted file mode 100644 index 89aff092..00000000 --- a/shared/homeless/assets/js/lib/lightbox.js +++ /dev/null @@ -1,511 +0,0 @@ -/*! - * Lightbox v2.9.0 - * by Lokesh Dhakar - * - * More info: - * http://lokeshdhakar.com/projects/lightbox2/ - * - * Copyright 2007, 2015 Lokesh Dhakar - * Released under the MIT license - * https://github.com/lokesh/lightbox2/blob/master/LICENSE - * - * @preserve - */ - -// Uses Node, AMD or browser globals to create a module. -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require('jquery')); - } else { - // Browser globals (root is window) - root.lightbox = factory(root.jQuery); - } -}(this, function ($) { - - function Lightbox(options) { - this.album = []; - this.currentImageIndex = void 0; - this.init(); - - // options - this.options = $.extend({}, this.constructor.defaults); - this.option(options); - } - - // Descriptions of all options available on the demo site: - // http://lokeshdhakar.com/projects/lightbox2/index.html#options - Lightbox.defaults = { - albumLabel: 'Image %1 of %2', - alwaysShowNavOnTouchDevices: false, - fadeDuration: 600, - fitImagesInViewport: true, - imageFadeDuration: 600, - // maxWidth: 800, - // maxHeight: 600, - positionFromTop: 50, - resizeDuration: 700, - showImageNumberLabel: true, - wrapAround: false, - disableScrolling: false, - /* - Sanitize Title - If the caption data is trusted, for example you are hardcoding it in, then leave this to false. - This will free you to add html tags, such as links, in the caption. - - If the caption data is user submitted or from some other untrusted source, then set this to true - to prevent xss and other injection attacks. - */ - sanitizeTitle: false - }; - - Lightbox.prototype.option = function(options) { - $.extend(this.options, options); - }; - - Lightbox.prototype.imageCountLabel = function(currentImageNum, totalImages) { - return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages); - }; - - Lightbox.prototype.init = function() { - var self = this; - // Both enable and build methods require the body tag to be in the DOM. - $(document).ready(function() { - self.enable(); - self.build(); - }); - }; - - // Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes - // that contain 'lightbox'. When these are clicked, start lightbox. - Lightbox.prototype.enable = function() { - var self = this; - $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) { - self.start($(event.currentTarget)); - return false; - }); - }; - - // Build html for the lightbox and the overlay. - // Attach event handlers to the new DOM elements. click click click - Lightbox.prototype.build = function() { - var self = this; - $('
').appendTo($('body')); - - // Cache jQuery objects - this.$lightbox = $('#lightbox'); - this.$overlay = $('#lightboxOverlay'); - this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); - this.$container = this.$lightbox.find('.lb-container'); - this.$image = this.$lightbox.find('.lb-image'); - this.$nav = this.$lightbox.find('.lb-nav'); - - // Store css values for future lookup - this.containerPadding = { - top: parseInt(this.$container.css('padding-top'), 10), - right: parseInt(this.$container.css('padding-right'), 10), - bottom: parseInt(this.$container.css('padding-bottom'), 10), - left: parseInt(this.$container.css('padding-left'), 10) - }; - - this.imageBorderWidth = { - top: parseInt(this.$image.css('border-top-width'), 10), - right: parseInt(this.$image.css('border-right-width'), 10), - bottom: parseInt(this.$image.css('border-bottom-width'), 10), - left: parseInt(this.$image.css('border-left-width'), 10) - }; - - // Attach event handlers to the newly minted DOM elements - this.$overlay.hide().on('click', function() { - self.end(); - return false; - }); - - this.$lightbox.hide().on('click', function(event) { - if ($(event.target).attr('id') === 'lightbox') { - self.end(); - } - return false; - }); - - this.$outerContainer.on('click', function(event) { - if ($(event.target).attr('id') === 'lightbox') { - self.end(); - } - return false; - }); - - this.$lightbox.find('.lb-prev').on('click', function() { - if (self.currentImageIndex === 0) { - self.changeImage(self.album.length - 1); - } else { - self.changeImage(self.currentImageIndex - 1); - } - return false; - }); - - this.$lightbox.find('.lb-next').on('click', function() { - if (self.currentImageIndex === self.album.length - 1) { - self.changeImage(0); - } else { - self.changeImage(self.currentImageIndex + 1); - } - return false; - }); - - /* - Show context menu for image on right-click - - There is a div containing the navigation that spans the entire image and lives above of it. If - you right-click, you are right clicking this div and not the image. This prevents users from - saving the image or using other context menu actions with the image. - - To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we - set pointer-events to none on the nav div. This is so that the upcoming right-click event on - the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs - we set the pointer events back to auto for the nav div so it can capture hover and left-click - events as usual. - */ - this.$nav.on('mousedown', function(event) { - if (event.which === 3) { - self.$nav.css('pointer-events', 'none'); - - self.$lightbox.one('contextmenu', function() { - setTimeout(function() { - this.$nav.css('pointer-events', 'auto'); - }.bind(self), 0); - }); - } - }); - - - this.$lightbox.find('.lb-loader, .lb-close').on('click', function() { - self.end(); - return false; - }); - }; - - // Show overlay and lightbox. If the image is part of a set, add siblings to album array. - Lightbox.prototype.start = function($link) { - var self = this; - var $window = $(window); - - $window.on('resize', $.proxy(this.sizeOverlay, this)); - - $('select, object, embed').css({ - visibility: 'hidden' - }); - - this.sizeOverlay(); - - this.album = []; - var imageNumber = 0; - - function addToAlbum($link) { - self.album.push({ - link: $link.attr('href'), - title: $link.attr('data-title') || $link.attr('title') - }); - } - - // Support both data-lightbox attribute and rel attribute implementations - var dataLightboxValue = $link.attr('data-lightbox'); - var $links; - - if (dataLightboxValue) { - $links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]'); - for (var i = 0; i < $links.length; i = ++i) { - addToAlbum($($links[i])); - if ($links[i] === $link[0]) { - imageNumber = i; - } - } - } else { - if ($link.attr('rel') === 'lightbox') { - // If image is not part of a set - addToAlbum($link); - } else { - // If image is part of a set - $links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]'); - for (var j = 0; j < $links.length; j = ++j) { - addToAlbum($($links[j])); - if ($links[j] === $link[0]) { - imageNumber = j; - } - } - } - } - - // Position Lightbox - var top = $window.scrollTop() + this.options.positionFromTop; - var left = $window.scrollLeft(); - this.$lightbox.css({ - top: top + 'px', - left: left + 'px' - }).fadeIn(this.options.fadeDuration); - - // Disable scrolling of the page while open - if (this.options.disableScrolling) { - $('body').addClass('lb-disable-scrolling'); - } - - this.changeImage(imageNumber); - }; - - // Hide most UI elements in preparation for the animated resizing of the lightbox. - Lightbox.prototype.changeImage = function(imageNumber) { - var self = this; - - this.disableKeyboardNav(); - var $image = this.$lightbox.find('.lb-image'); - - this.$overlay.fadeIn(this.options.fadeDuration); - - $('.lb-loader').fadeIn('slow'); - this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); - - this.$outerContainer.addClass('animating'); - - // When image to show is preloaded, we send the width and height to sizeContainer() - var preloader = new Image(); - preloader.onload = function() { - var $preloader; - var imageHeight; - var imageWidth; - var maxImageHeight; - var maxImageWidth; - var windowHeight; - var windowWidth; - - $image.attr('src', self.album[imageNumber].link); - - $preloader = $(preloader); - - $image.width(preloader.width); - $image.height(preloader.height); - - if (self.options.fitImagesInViewport) { - // Fit image inside the viewport. - // Take into account the border around the image and an additional 10px gutter on each side. - - windowWidth = $(window).width(); - windowHeight = $(window).height(); - maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20; - maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - 120; - - // Check if image size is larger then maxWidth|maxHeight in settings - if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) { - maxImageWidth = self.options.maxWidth; - } - if (self.options.maxHeight && self.options.maxHeight < maxImageWidth) { - maxImageHeight = self.options.maxHeight; - } - - // Is the current image's width or height is greater than the maxImageWidth or maxImageHeight - // option than we need to size down while maintaining the aspect ratio. - if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) { - if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) { - imageWidth = maxImageWidth; - imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10); - $image.width(imageWidth); - $image.height(imageHeight); - } else { - imageHeight = maxImageHeight; - imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10); - $image.width(imageWidth); - $image.height(imageHeight); - } - } - } - self.sizeContainer($image.width(), $image.height()); - }; - - preloader.src = this.album[imageNumber].link; - this.currentImageIndex = imageNumber; - }; - - // Stretch overlay to fit the viewport - Lightbox.prototype.sizeOverlay = function() { - this.$overlay - .width($(document).width()) - .height($(document).height()); - }; - - // Animate the size of the lightbox to fit the image we are showing - Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) { - var self = this; - - var oldWidth = this.$outerContainer.outerWidth(); - var oldHeight = this.$outerContainer.outerHeight(); - var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right; - var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom; - - function postResize() { - self.$lightbox.find('.lb-dataContainer').width(newWidth); - self.$lightbox.find('.lb-prevLink').height(newHeight); - self.$lightbox.find('.lb-nextLink').height(newHeight); - self.showImage(); - } - - if (oldWidth !== newWidth || oldHeight !== newHeight) { - this.$outerContainer.animate({ - width: newWidth, - height: newHeight - }, this.options.resizeDuration, 'swing', function() { - postResize(); - }); - } else { - postResize(); - } - }; - - // Display the image and its details and begin preload neighboring images. - Lightbox.prototype.showImage = function() { - this.$lightbox.find('.lb-loader').stop(true).hide(); - this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration); - - this.updateNav(); - this.updateDetails(); - this.preloadNeighboringImages(); - this.enableKeyboardNav(); - }; - - // Display previous and next navigation if appropriate. - Lightbox.prototype.updateNav = function() { - // Check to see if the browser supports touch events. If so, we take the conservative approach - // and assume that mouse hover events are not supported and always show prev/next navigation - // arrows in image sets. - var alwaysShowNav = false; - try { - document.createEvent('TouchEvent'); - alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false; - } catch (e) {} - - this.$lightbox.find('.lb-nav').show(); - - if (this.album.length > 1) { - if (this.options.wrapAround) { - if (alwaysShowNav) { - this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1'); - } - this.$lightbox.find('.lb-prev, .lb-next').show(); - } else { - if (this.currentImageIndex > 0) { - this.$lightbox.find('.lb-prev').show(); - if (alwaysShowNav) { - this.$lightbox.find('.lb-prev').css('opacity', '1'); - } - } - if (this.currentImageIndex < this.album.length - 1) { - this.$lightbox.find('.lb-next').show(); - if (alwaysShowNav) { - this.$lightbox.find('.lb-next').css('opacity', '1'); - } - } - } - } - }; - - // Display caption, image number, and closing button. - Lightbox.prototype.updateDetails = function() { - var self = this; - - // Enable anchor clicks in the injected caption html. - // Thanks Nate Wright for the fix. @https://github.com/NateWr - if (typeof this.album[this.currentImageIndex].title !== 'undefined' && - this.album[this.currentImageIndex].title !== '') { - var $caption = this.$lightbox.find('.lb-caption'); - if (this.options.sanitizeTitle) { - $caption.text(this.album[this.currentImageIndex].title); - } else { - $caption.html(this.album[this.currentImageIndex].title); - } - $caption.fadeIn('fast') - .find('a').on('click', function(event) { - if ($(this).attr('target') !== undefined) { - window.open($(this).attr('href'), $(this).attr('target')); - } else { - location.href = $(this).attr('href'); - } - }); - } - - if (this.album.length > 1 && this.options.showImageNumberLabel) { - var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length); - this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast'); - } else { - this.$lightbox.find('.lb-number').hide(); - } - - this.$outerContainer.removeClass('animating'); - - this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() { - return self.sizeOverlay(); - }); - }; - - // Preload previous and next images in set. - Lightbox.prototype.preloadNeighboringImages = function() { - if (this.album.length > this.currentImageIndex + 1) { - var preloadNext = new Image(); - preloadNext.src = this.album[this.currentImageIndex + 1].link; - } - if (this.currentImageIndex > 0) { - var preloadPrev = new Image(); - preloadPrev.src = this.album[this.currentImageIndex - 1].link; - } - }; - - Lightbox.prototype.enableKeyboardNav = function() { - $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this)); - }; - - Lightbox.prototype.disableKeyboardNav = function() { - $(document).off('.keyboard'); - }; - - Lightbox.prototype.keyboardAction = function(event) { - var KEYCODE_ESC = 27; - var KEYCODE_LEFTARROW = 37; - var KEYCODE_RIGHTARROW = 39; - - var keycode = event.keyCode; - var key = String.fromCharCode(keycode).toLowerCase(); - if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) { - this.end(); - } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) { - if (this.currentImageIndex !== 0) { - this.changeImage(this.currentImageIndex - 1); - } else if (this.options.wrapAround && this.album.length > 1) { - this.changeImage(this.album.length - 1); - } - } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) { - if (this.currentImageIndex !== this.album.length - 1) { - this.changeImage(this.currentImageIndex + 1); - } else if (this.options.wrapAround && this.album.length > 1) { - this.changeImage(0); - } - } - }; - - // Closing time. :-( - Lightbox.prototype.end = function() { - this.disableKeyboardNav(); - $(window).off('resize', this.sizeOverlay); - this.$lightbox.fadeOut(this.options.fadeDuration); - this.$overlay.fadeOut(this.options.fadeDuration); - $('select, object, embed').css({ - visibility: 'visible' - }); - if (this.options.disableScrolling) { - $('body').removeClass('lb-disable-scrolling'); - } - }; - - return new Lightbox(); -})); diff --git a/shared/homeless/assets/js/lib/swfobject.min.js b/shared/homeless/assets/js/lib/swfobject.min.js deleted file mode 100644 index 8eafe9dd..00000000 --- a/shared/homeless/assets/js/lib/swfobject.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* SWFObject v2.2 - is released under the MIT License -*/ -var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab=8.1.0", - "symfony/asset": "^5.4 || ^6.2", - "symfony/config": "^5.4 || ^6.2", - "symfony/dependency-injection": "^5.4 || ^6.2", - "symfony/http-kernel": "^5.4 || ^6.2", + "symfony/asset": "^5.4 || ^6.2 || ^7.0", + "symfony/config": "^5.4 || ^6.2 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", "symfony/service-contracts": "^1.1.9 || ^2.1.3 || ^3.0" }, "require-dev": { - "symfony/framework-bundle": "^5.4 || ^6.2", - "symfony/phpunit-bridge": "^5.4 || ^6.2", - "symfony/twig-bundle": "^5.4 || ^6.2", - "symfony/web-link": "^5.4 || ^6.2" + "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/phpunit-bridge": "^5.4 || ^6.2 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/web-link": "^5.4 || ^6.2 || ^7.0" }, "type": "symfony-bundle", "extra": { @@ -9467,7 +9467,7 @@ "description": "Integration with your Symfony app & Webpack Encore!", "support": { "issues": "https://github.com/symfony/webpack-encore-bundle/issues", - "source": "https://github.com/symfony/webpack-encore-bundle/tree/v2.0.1" + "source": "https://github.com/symfony/webpack-encore-bundle/tree/v2.1.0" }, "funding": [ { @@ -9483,7 +9483,7 @@ "type": "tidelift" } ], - "time": "2023-05-31T14:28:33+00:00" + "time": "2023-09-26T14:41:29+00:00" }, { "name": "symfony/yaml", @@ -10232,16 +10232,16 @@ }, { "name": "symfony/maker-bundle", - "version": "v1.51.0", + "version": "v1.51.1", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "d5684e5628d545a67ba833adcd216e7029f3e506" + "reference": "0890fd3cf1e2a5221f9b3c6ee1769c537aef683d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/d5684e5628d545a67ba833adcd216e7029f3e506", - "reference": "d5684e5628d545a67ba833adcd216e7029f3e506", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/0890fd3cf1e2a5221f9b3c6ee1769c537aef683d", + "reference": "0890fd3cf1e2a5221f9b3c6ee1769c537aef683d", "shasum": "" }, "require": { @@ -10304,7 +10304,7 @@ ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.51.0" + "source": "https://github.com/symfony/maker-bundle/tree/v1.51.1" }, "funding": [ { @@ -10320,7 +10320,7 @@ "type": "tidelift" } ], - "time": "2023-09-12T18:09:19+00:00" + "time": "2023-09-18T18:17:31+00:00" }, { "name": "symfony/web-profiler-bundle", diff --git a/shared/homeless/config/packages/twig.php b/shared/homeless/config/packages/twig.php index 16d2064d..09a0d652 100644 --- a/shared/homeless/config/packages/twig.php +++ b/shared/homeless/config/packages/twig.php @@ -13,10 +13,11 @@ ->strictVariables(param('kernel.debug')) ->formThemes([ 'form/fields.html.twig', - '@VichUploader/Form/fields.html.twig', + '@FOSCKEditor/Form/ckeditor_widget.html.twig', + '@SonataForm/Form/datepicker.html.twig', '@SonataFormatter/Form/formatter.html.twig', '@VichUploader/Form/fields.html.twig', - '@SonataForm/Form/datepicker.html.twig', + '@VichUploader/Form/fields.html.twig', ]) ->global('org_name_short', env('ORG_NAME_SHORT')) ->global('org_name', env('ORG_NAME')) diff --git a/shared/homeless/package.json b/shared/homeless/package.json index 76bde083..28bacd01 100644 --- a/shared/homeless/package.json +++ b/shared/homeless/package.json @@ -3,7 +3,10 @@ "@babel/core": "^7.22.11", "@babel/preset-env": "^7.22.10", "@symfony/webpack-encore": "^4.4.0", + "@yoobic/jpeg-camera-es6": "^1.0.12", "core-js": "^3.32.1", + "jquery-slimscroll": "^1.3.8", + "lightbox2": "^2.11.4", "regenerator-runtime": "^0.14.0", "script-loader": "^0.7.2", "webpack": "^5.88.2", diff --git a/shared/homeless/src/Admin/CertificateAdmin.php b/shared/homeless/src/Admin/CertificateAdmin.php index 9e99afb8..01eae4dd 100644 --- a/shared/homeless/src/Admin/CertificateAdmin.php +++ b/shared/homeless/src/Admin/CertificateAdmin.php @@ -114,7 +114,8 @@ protected function configureFormFields(FormMapper $form): void /** * Обработка типов справок, требующих указаний значений дополнительных полей при создании */ - protected function formSubmit(FormEvent $event): void { + protected function formSubmit(FormEvent $event): void + { /** @var Certificate $certificate */ $certificate = $event->getForm()->getViewData(); switch ($certificate->getType()->getSyncId()) { diff --git a/shared/homeless/src/Admin/UserOwnableTrait.php b/shared/homeless/src/Admin/UserOwnableTrait.php index b1f76b5f..e5fcc505 100644 --- a/shared/homeless/src/Admin/UserOwnableTrait.php +++ b/shared/homeless/src/Admin/UserOwnableTrait.php @@ -9,7 +9,8 @@ trait UserOwnableTrait { - public function getClient(): ?Client { + public function getClient(): ?Client + { $result = null; try { diff --git a/shared/homeless/src/Controller/App/Version.php b/shared/homeless/src/Controller/App/Version.php index 96ae88a5..4328db2b 100644 --- a/shared/homeless/src/Controller/App/Version.php +++ b/shared/homeless/src/Controller/App/Version.php @@ -13,8 +13,10 @@ #[Route('/version', name: 'version')] class Version extends AbstractController { - public function __invoke(#[Autowire(env: 'APP_VER')] string $version): Response - { + public function __invoke( + #[Autowire(env: 'APP_VER')] + string $version, + ): Response { return new Response($version); } } diff --git a/shared/homeless/src/Entity/Contract.php b/shared/homeless/src/Entity/Contract.php index 138d5b03..ad33d985 100644 --- a/shared/homeless/src/Entity/Contract.php +++ b/shared/homeless/src/Entity/Contract.php @@ -53,9 +53,7 @@ public function __toString(): string return $this->getLabel(); } - public function __set($name, $value): void - { - } + public function __set($name, $value): void {} public function getNamePrefix(): string { diff --git a/shared/homeless/src/Form/Type/AppPhotoType.php b/shared/homeless/src/Form/Type/AppPhotoType.php index 29ef2fa3..c7afff4c 100644 --- a/shared/homeless/src/Form/Type/AppPhotoType.php +++ b/shared/homeless/src/Form/Type/AppPhotoType.php @@ -14,9 +14,7 @@ #[AutoconfigureTag(name: 'form.type', attributes: ['alias' => 'app_photo'])] class AppPhotoType extends AbstractType { - public function buildView(FormView $view, FormInterface $form, array $options): void - { - } + public function buildView(FormView $view, FormInterface $form, array $options): void {} public function getBlockPrefix(): string { diff --git a/shared/homeless/src/Service/ReportService.php b/shared/homeless/src/Service/ReportService.php index 11d2ad01..dacedc74 100644 --- a/shared/homeless/src/Service/ReportService.php +++ b/shared/homeless/src/Service/ReportService.php @@ -65,13 +65,13 @@ public function generate( ): void { if ($dateFrom) { $date = new \DateTimeImmutable(); - $date->setTimestamp(strtotime($dateFrom)); + $date = $date->setTimestamp(strtotime($dateFrom)); $dateFrom = $date->format('Y-m-d'); } if ($dateTo) { $date = new \DateTimeImmutable(); - $date->setTimestamp(strtotime($dateTo)); + $date = $date->setTimestamp(strtotime($dateTo)); $dateTo = $date->format('Y-m-d'); } diff --git a/shared/homeless/templates/admin/fields/service_type_select.html.twig b/shared/homeless/templates/admin/fields/service_type_select.html.twig deleted file mode 100644 index 37c936e5..00000000 --- a/shared/homeless/templates/admin/fields/service_type_select.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{#{% extends '@SonataAdmin/CRUD/base_show_field.html.twig' %}#} - -{% block field %} - {{ value|join(', ') }} - -{% endblock %} diff --git a/shared/homeless/templates/admin/report.html.twig b/shared/homeless/templates/admin/report.html.twig index b2805b60..57058580 100644 --- a/shared/homeless/templates/admin/report.html.twig +++ b/shared/homeless/templates/admin/report.html.twig @@ -5,18 +5,26 @@
@@ -153,45 +138,21 @@
-
+
+ type="text" + id="s5a37d10f9fe56_dateTo" + name="dateTo" + class="sonata-medium-date form-control" + data-td-target="#dp_s5a37d10f9fe56_dateTo" + />
-
@@ -203,44 +164,21 @@
-
-
+
+
-
@@ -249,45 +187,21 @@
-
+
+ type="text" + id="s5a37d10f9fe56_createClientFromTo" + name="createClientFromTo" + class="sonata-medium-date form-control" + data-td-target="#dp_s5a37d10f9fe56_createClientFromTo" + />
-
@@ -296,44 +210,21 @@
-
-
+
+
-
@@ -342,45 +233,22 @@
-
+
+ data-td-target="#dp_s5a37d10f9fe56_createServiceFromTo" + />
-
diff --git a/shared/homeless/templates/admin/service/base_edit_form.html.twig b/shared/homeless/templates/admin/service/base_edit_form.html.twig index bef48b87..cecb2f1e 100644 --- a/shared/homeless/templates/admin/service/base_edit_form.html.twig +++ b/shared/homeless/templates/admin/service/base_edit_form.html.twig @@ -158,16 +158,6 @@ {{ sonata_block_render_event('sonata.admin.edit.form.bottom', { 'admin': admin, 'object': object }) }} -