build/mobify.js
/**
 * Helper method for looping through and grabbing strings of elements
 * in the captured DOM after plaintext insertion
 */
Helper method for looping through and grabbing strings of elements
in the captured DOM after plaintext insertion
Helper method for looping through and grabbing strings of elements in the captured DOM after plaintext insertion
function extractHTMLStringFromElement(container) {
    if (!container) return '';
    return [].map.call(container.childNodes, function(el) {
        var tagName = nodeName(el);
        if (tagName == '#comment') return '<!--' + el.textContent + '-->';
        if (tagName == 'plaintext') return el.textContent;
        if (tagName == 'script' && ((/mobify|adaptive|loader/.test(el.src) || /mobify|adaptive|loader/i.test(el.textContent)))) {
            return '';
        }
        if (el.getAttribute && /capture-remove/.test(el.getAttribute('class'))) {
            return '';
        }
        return el.outerHTML || el.nodeValue || Utils.outerHTML(el);
    }).join('');
}
function extractHTMLStringFromElement ( container ) { if ( ! container ) return '' ; return [ ] . map . call ( container . childNodes , function ( el ) { var tagName = nodeName ( el ) ; if ( tagName == '#comment' ) return '<!--' + el . textContent + '-->' ; if ( tagName == 'plaintext' ) return el . textContent ; if ( tagName == 'script' && ( ( / mobify|adaptive|loader / . test ( el . src ) || / mobify|adaptive|loader / i . test ( el . textContent ) ) ) ) { return '' ; } if ( el . getAttribute && / capture-remove / . test ( el . getAttribute ( 'class' ) ) ) { return '' ; } return el . outerHTML || el . nodeValue || Utils . outerHTML ( el ) ; } ) . join ( '' ) ; }
Helper method for looping through and grabbing strings of elements
 in the captured DOM after plaintext insertion
Helper method for looping through and grabbing strings of elements in the captured DOM after plaintext insertion
// Don't allow mobify related scripts to be added to the new document // If the script has the class "capture-remove", don't let it // get added to the captured document