Devices: NodesLearnt table integration with FuelUx Datagrid.
[controller.git] / opendaylight / web / root / src / main / resources / js / fuelux / util.js
diff --git a/opendaylight/web/root/src/main/resources/js/fuelux/util.js b/opendaylight/web/root/src/main/resources/js/fuelux/util.js
new file mode 100755 (executable)
index 0000000..469e9db
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Fuel UX Utilities
+ * https://github.com/ExactTarget/fuelux
+ *
+ * Copyright (c) 2012 ExactTarget
+ * Licensed under the MIT license.
+ */
+
+define(['require','jquery'],function (require) {
+
+       var $ = require('jquery');
+
+       // custom case-insensitive match expression
+       function fuelTextExactCI(elem, text) {
+               return (elem.textContent || elem.innerText || $(elem).text() || '').toLowerCase() === (text || '').toLowerCase();
+       }
+
+       $.expr[':'].fuelTextExactCI = $.expr.createPseudo ?
+               $.expr.createPseudo(function (text) {
+                       return function (elem) {
+                               return fuelTextExactCI(elem, text);
+                       };
+               }) :
+               function (elem, i, match) {
+                       return fuelTextExactCI(elem, match[3]);
+               };
+
+});
\ No newline at end of file