/usr/share/javascript/jquery-watermark/jquery.data.js is in libjs-jquery-watermark 3.1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | // December 3, 2010
// The following code has been pulled out of the Watermark plugin because
// of conflicts with jQuery UI, which also defines a [less-sophisticated]
// :data() extension.
//
// I have inserted an exact duplicate of the jQuery UI :data() extension
// into the Watermark plugin, so there shouldn't be any conflicts.
// Extends jQuery with a custom selector - ":data(...)"
// :data(<name>) Includes elements that have a specific name defined in the jQuery data collection. (Only the existence of the name is checked; the value is ignored.)
// :data(<name>=<value>) Includes elements that have a specific jQuery data name defined, with a specific value associated with it.
// :data(<name>!=<value>) Includes elements that have a specific jQuery data name defined, with a value that is not equal to the value specified.
// :data(<name>^=<value>) Includes elements that have a specific jQuery data name defined, with a value that starts with the value specified.
// :data(<name>$=<value>) Includes elements that have a specific jQuery data name defined, with a value that ends with the value specified.
// :data(<name>*=<value>) Includes elements that have a specific jQuery data name defined, with a value that contains the value specified.
$.extend($.expr[":"], {
"search": function (elem) {
return "search" === (elem.type || "");
},
"data": function (element, index, matches, set) {
var data, parts = /^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(matches[3]);
if (parts) {
data = $.data(element, parts[1]);
if (data !== undefined) {
if (parts[2]) {
data = "" + data;
switch (parts[2]) {
case "=":
return (data == parts[3]);
case "!=":
return (data != parts[3]);
case "^=":
return (data.slice(0, parts[3].length) == parts[3]);
case "$=":
return (data.slice(-parts[3].length) == parts[3]);
case "*=":
return (data.indexOf(parts[3]) !== -1);
}
}
return true;
}
}
return false;
}
});
|