Package cx.fbn.nevernote.dialog

Examples of cx.fbn.nevernote.dialog.EnCryptDialog


    String text = browser.selectedText();
    if (text.trim().equalsIgnoreCase(""))
      return;
    text = new String(text.replaceAll("\n", "<br/>"));

    EnCryptDialog dialog = new EnCryptDialog();
    dialog.exec();
    if (!dialog.okPressed()) {
      return;
    }

    EnCrypt crypt = new EnCrypt();
    String encrypted = crypt.encrypt(text, dialog.getPassword().trim(), 64);
    String decrypted = crypt.decrypt(encrypted, dialog.getPassword().trim(), 64);

    if (encrypted.trim().equals("")) {
      QMessageBox.information(this, tr("Error"), tr("Error Encrypting String"));
      return;
    }
    StringBuffer buffer = new StringBuffer(encrypted.length() + 100);
    buffer.append("<img en-tag=\"en-crypt\" cipher=\"RC2\" hint=\""
        + dialog.getHint().replace("'","\\'") + "\" length=\"64\" ");
    buffer.append("contentEditable=\"false\" alt=\"");
    buffer.append(encrypted);
    buffer.append("\" src=\"").append(FileUtils.toForwardSlashedPath(Global.getFileManager().getImageDirPath("encrypt.png") +"\""));
    Global.cryptCounter++;
    buffer.append(" id=\"crypt"+Global.cryptCounter.toString() +"\"");
    buffer.append(" onMouseOver=\"style.cursor=\\'hand\\'\"");
    buffer.append(" onClick=\"window.jambi.decryptText(\\'crypt"+Global.cryptCounter.toString()
        +"\\', \\'"+encrypted+"\\', \\'"+dialog.getHint().replace("'", "\\&amp;apos;")+"\\');\"");
    buffer.append("style=\"display:block\" />");

    String script_start = new String(
        "document.execCommand('insertHtml', false, '");
    String script_end = new String("');");
View Full Code Here

TOP

Related Classes of cx.fbn.nevernote.dialog.EnCryptDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.