XMLUtils.js 688 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Cognos Analytics
  5. * Copyright IBM Corp. 2015, 2017
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['jquery'], function (jquery) {
  9. 'use strict'; //NOSONAR
  10. $ = $ || jquery;
  11. $.fn.selectNode = function (name) {
  12. var result = this.children().filter(function () {
  13. return this.localName === name;
  14. });
  15. return result;
  16. };
  17. $.fn.byAttributeValue = function (name, value) {
  18. var result = this.filter(function () {
  19. return $(this).attr(name) === value;
  20. });
  21. return result;
  22. };
  23. });