function decrypt_search(password_input, path_location) {
    sessionIndex = sessionStorage.getItem('encryptcontent-index');
    if (sessionIndex) {
        sessionIndex = JSON.parse(sessionIndex);
        for (var i=0; i < sessionIndex.docs.length; i++) {
            var doc = sessionIndex.docs[i];
            if (doc.location.indexOf(path_location) !== -1) {
                // grab the ciphertext bundle and try to decrypt it
                var parts = doc.text.split(';');
                if (parts[0], parts[1], parts[2]) {
                    var content = decrypt_content(password_input.value, parts[0], parts[1], parts[2]);
                };
                if (content) {
                    doc.text = content;
                    // any post processing on the decrypted search index should be done here
                };
            }
        };
        // force search index reloading on Worker
        if (!window.Worker) {
            console.log('Web Worker API not supported');
        } else {
            sessionIndex = JSON.stringify(sessionIndex);
            sessionStorage.setItem('encryptcontent-index', sessionIndex);
            searchWorker.postMessage({init: true, sessionIndex: sessionIndex});
        };
    }
}
/* Decrypt part of the search index and refresh it for search engine */
Decrypt part of the search index and refresh it for search engine
Decrypt part of the search index and refresh it for search engine
function decrypt_search(password_input, path_location) {
    sessionIndex = sessionStorage.getItem('encryptcontent-index');
    if (sessionIndex) {
        sessionIndex = JSON.parse(sessionIndex);
        for (var i=0; i < sessionIndex.docs.length; i++) {
            var doc = sessionIndex.docs[i];
            if (doc.location.indexOf(path_location) !== -1) {
                var parts = doc.text.split(';');
                if (parts[0], parts[1], parts[2]) {
                    var content = decrypt_content(password_input.value, parts[0], parts[1], parts[2]);
                };
                if (content) {
                    doc.text = content;
                };
            }
        };
        if (!window.Worker) {
            console.log('Web Worker API not supported');
        } else {
            sessionIndex = JSON.stringify(sessionIndex);
            sessionStorage.setItem('encryptcontent-index', sessionIndex);
            searchWorker.postMessage({init: true, sessionIndex: sessionIndex});
        };
    }
}
function decrypt_search ( password_input , path_location ) { sessionIndex = sessionStorage . getItem ( 'encryptcontent-index' ) ; if ( sessionIndex ) { sessionIndex = JSON . parse ( sessionIndex ) ; for ( var i = 0 ; i < sessionIndex . docs . length ; i ++ ) { var doc = sessionIndex . docs [ i ] ; if ( doc . location . indexOf ( path_location ) !== - 1 ) { var parts = doc . text . split ( ';' ) ; if ( parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) { var content = decrypt_content ( password_input . value , parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) ; } ; if ( content ) { doc . text = content ; } ; } } ; if ( ! window . Worker ) { console . log ( 'Web Worker API not supported' ) ; } else { sessionIndex = JSON . stringify ( sessionIndex ) ; sessionStorage . setItem ( 'encryptcontent-index' , sessionIndex ) ; searchWorker . postMessage ( { init : true , sessionIndex : sessionIndex } ) ; } ; } }
Decrypt part of the search index and refresh it for search engine
Decrypt part of the search index and refresh it for search engine
// grab the ciphertext bundle and try to decrypt it // any post processing on the decrypted search index should be done here // force search index reloading on Worker