CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/madflow/jquery-slugify/master/dist/slugify.js
accept-ranges: bytes
age: 0
date: Sun, 27 Jul 2025 19:28:44 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210055-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753644523.902547,VS0,VE1190
vary: Accept-Encoding
x-fastly-request-id: f6a339ec8e9d9b80a08c1af88f28bce01c003149
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"0291b8d68bacb3b12f8cf90e061df9160d7473c17428f088a670d7c35b3ff575"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: D948:2F63CE:26A5AE:62BDC3:68867DEA
content-encoding: gzip
accept-ranges: bytes
date: Sun, 27 Jul 2025 19:28:44 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210045-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753644524.162200,VS0,VE297
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: fa2db508aa98b9f54023652f8fcb2816ba390118
expires: Sun, 27 Jul 2025 19:33:44 GMT
source-age: 0
content-length: 692
/*! jquery-slugify - v1.2.5 - 2017-10-06
* Copyright (c) 2017 madflow; Licensed */
(function($) {
$.fn.slugify = function(source, options) {
return this.each(function() {
var $target = $(this),
$source = $(source);
$target.on('keyup change', function() {
if ($target.val() !== '' && $target.val() !== undefined) {
$target.data('locked', true);
} else {
$target.data('locked', false);
}
});
$source.on('keyup change', function() {
// If the target is empty - it cannot be locked
if ($target.val() === '' || $target.val() === undefined) {
$target.data('locked', false);
}
if (true === $target.data('locked')) {
return;
}
if ($target.is('input') || $target.is('textarea')) {
$target.val($.slugify($source.val(), options));
} else {
$target.text($.slugify($source.val(), options));
}
});
});
};
// Static method.
$.slugify = function(sourceString, options) {
// Override default options with passed-in options.
options = $.extend({}, $.slugify.options, options);
// Guess language specifics from html.lang attribute
// when options.lang is not defined
options.lang = options.lang || $('html').prop('lang');
// Apply preSlug function - if exists
if (typeof options.preSlug === 'function') {
sourceString = options.preSlug(sourceString);
}
sourceString = options.slugFunc(sourceString, options);
// Apply postSlug function - if exists
if (typeof options.postSlug === 'function') {
sourceString = options.postSlug(sourceString);
}
return sourceString;
};
// Default plugin options
$.slugify.options = {
preSlug: null,
postSlug: null,
slugFunc: function(input, opts) {
return window.getSlug(input, opts);
}
};
})(jQuery);