nl_tokens: Reads registered data attributes of a given element from the DOM and updates an existing jQuery data cache with these values .
pl_tokens: function _updateJQueryDataCache ( $elem ) { var add = { } , remove = [ ] ; if ( $ . hasData ( $elem [ 0 ] ) ) { // A jQuery data cache exists. Update it for the el properties (and attribute names registered by a plugin). // Primitive data types. Normally, this will read the "data-tag-name", "data-class-name" and "data-id" // attributes. _ . each ( registeredDataAttributes . primitives , function ( attributeName ) { var attributeValue = $elem . attr ( "data-" + attributeName ) ; if ( attributeValue === undefined ) { remove . push ( attributeName ) ; } else { add [ toCamelCase ( attributeName ) ] = attributeValue ; } } ) ; // Stringified JSON data. Normally, this just deals with "data-attributes". _ . each ( registeredDataAttributes . json , function ( attributeName ) { var attributeValue = $elem . attr ( "data-" + attributeName ) ; if ( attributeValue === undefined ) { remove . <mask> ( attributeName ) ; } else { try { add [ toCamelCase ( attributeName ) ] = $ . parseJSON ( attributeValue ) ; } catch ( err ) { remove . push ( attributeName ) ; } } } ) ; if ( remove . length ) $elem . removeData ( remove ) ; if ( _ . size ( add ) ) $elem . data ( add ) ; } }