Merge remote-tracking branch 'dario/master'
This commit is contained in:
		@@ -116,29 +116,54 @@ Clipperz.PM.UI.Components.ExtraFeatures.OTPClass = React.createClass({
 | 
			
		||||
					'<meta charset="utf-8">' +
 | 
			
		||||
					'<title>Active One Time Passwords - Clipperz</title>' +
 | 
			
		||||
					'<style>' +
 | 
			
		||||
						'li { padding-bottom: 10px; }' +
 | 
			
		||||
						'body { margin: 0; padding: 0.5cm; }' +
 | 
			
		||||
						'ul { font-size: 0.24cm;    font-family: monospace;    list-style-type: none;    padding: 1em;    border: 1px solid;    display: inline-block;    background: lightblue;    border-radius: 10px;    margin: 0.2cm;   width: 7cm;     height: 3.6cm; vertical-align: bottom;}' +
 | 
			
		||||
						'h2 { font-size: 0.24cm;    margin: 0;    padding-right: 0.15cm;}' +
 | 
			
		||||
						'h2 span { display: inline-block;   width: 50%;}' +
 | 
			
		||||
						'h2 span.right { text-align: right; }' +
 | 
			
		||||
						'li { line-height: 0.34cm; }' +
 | 
			
		||||
						'li span { display: block; }' +
 | 
			
		||||
						'span.password { font-family: monospace; font-size: 16pt; padding-bottom: 5px; }' +
 | 
			
		||||
						'span.label { font-family: sans-serif; font-size: 12pt; }' +
 | 
			
		||||
					'</style>' +
 | 
			
		||||
				'</head>' +
 | 
			
		||||
				'<body>' +
 | 
			
		||||
					'<ul>' +
 | 
			
		||||
						MochiKit.Base.map(function (anOTP) {
 | 
			
		||||
							return	'<li>' +
 | 
			
		||||
										'<span class="password">' + anOTP.password() + '</span>' +
 | 
			
		||||
										'<span class="label">' + anOTP.label() + '</span>' +
 | 
			
		||||
									'</li>';
 | 
			
		||||
						}, filteredOtpList).join('') +
 | 
			
		||||
					'</ul>' +
 | 
			
		||||
					// '<ul>' +
 | 
			
		||||
					// 	MochiKit.Base.map(function (anOTP) {
 | 
			
		||||
					// 		return	'<li>' +
 | 
			
		||||
					// 					'<span class="password">' + anOTP.password() + '</span>' +
 | 
			
		||||
					// 					'<span class="label">' + anOTP.label() + '</span>' +
 | 
			
		||||
					// 				'</li>';
 | 
			
		||||
					// 	}, filteredOtpList).join('') +
 | 
			
		||||
					// '</ul>' +
 | 
			
		||||
					this.renderPrintedOtpList(filteredOtpList) +
 | 
			
		||||
				'</body>' +
 | 
			
		||||
			'</html>'
 | 
			
		||||
		);
 | 
			
		||||
 | 
			
		||||
		// newWindow.document.close();
 | 
			
		||||
		// newWindow.focus();
 | 
			
		||||
		// newWindow.print();
 | 
			
		||||
		// newWindow.close();
 | 
			
		||||
		newWindow.document.close();
 | 
			
		||||
		newWindow.focus();
 | 
			
		||||
		newWindow.print();
 | 
			
		||||
		newWindow.close();
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	renderPrintedOtpList: function(aList) {
 | 
			
		||||
		var result;
 | 
			
		||||
		var i;
 | 
			
		||||
 | 
			
		||||
		var date = new Date();
 | 
			
		||||
		var header = '<h2><span class="left">Clipperz OTPs</span><span class="right">'+date.getDate()+'/'+date.getMonth()+'/'+date.getFullYear()+'</span></h2>'
 | 
			
		||||
 | 
			
		||||
		result = '<ul>'+header;
 | 
			
		||||
		for (i in aList) {
 | 
			
		||||
			if (i%10 == 0 && i != 0) {
 | 
			
		||||
				result += '</ul><ul>'+header;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			result += '<li>\u2610 '+aList[i].password()+'</li>';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return result;
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	//=========================================================================
 | 
			
		||||
 
 | 
			
		||||
@@ -77,6 +77,16 @@ Clipperz.PM.UI.Components.HelpClass = React.createClass({
 | 
			
		||||
							]), React.DOM.dd({}, "previous/next card"),
 | 
			
		||||
						])
 | 
			
		||||
					]),
 | 
			
		||||
 | 
			
		||||
					React.DOM.div({'className':'helpBlock'}, [
 | 
			
		||||
						React.DOM.h4({}, "Misc"),
 | 
			
		||||
						React.DOM.dl({}, [
 | 
			
		||||
							React.DOM.dt({}, [
 | 
			
		||||
								React.DOM.span({'className':'key'}, 'l o c k'),
 | 
			
		||||
							]), React.DOM.dd({}, "lock application"),
 | 
			
		||||
						])
 | 
			
		||||
					]),
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
	Mousetrap.bind(['left',  'h', 'esc'],	MochiKit.Base.method(this, 'exitCurrentSelection'));
 | 
			
		||||
 
 | 
			
		||||
@@ -112,6 +112,8 @@ Clipperz.PM.UI.MainController = function() {
 | 
			
		||||
	Mousetrap.bind(['*'],					MochiKit.Base.method(this, 'selectAllCards_handler'));
 | 
			
		||||
 | 
			
		||||
	Mousetrap.bind(['?'],					MochiKit.Base.method(this, 'showHelp_handler'));
 | 
			
		||||
	
 | 
			
		||||
	Mousetrap.bind(['l o c k'],				MochiKit.Base.method(this, 'lockShortcut'));
 | 
			
		||||
 | 
			
		||||
//	Mousetrap.bind(['t e s t'],				MochiKit.Base.method(this, 'downloadExport_handler'));
 | 
			
		||||
 | 
			
		||||
@@ -408,6 +410,12 @@ Clipperz.log("THE BROWSER IS OFFLINE");
 | 
			
		||||
		return deferredResult;
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	lockShortcut: function(anEvent) {
 | 
			
		||||
		anEvent.preventDefault();
 | 
			
		||||
 | 
			
		||||
		return this.lock();
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	lock: function () {
 | 
			
		||||
		var deferredResult;
 | 
			
		||||
 | 
			
		||||
@@ -1853,6 +1861,8 @@ Clipperz.log("THE BROWSER IS OFFLINE");
 | 
			
		||||
	addCardClick_handler: function () {
 | 
			
		||||
		var newRecord;
 | 
			
		||||
 | 
			
		||||
		this.selectAllCards();
 | 
			
		||||
 | 
			
		||||
		return Clipperz.Async.callbacks("MainController.addCardClick_handler", [
 | 
			
		||||
			MochiKit.Base.method(this.user(), 'createNewRecord'),
 | 
			
		||||
			function (aValue) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user