summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Bookmarklet.js
Side-by-side diff
Diffstat (limited to 'frontend/beta/js/Bookmarklet.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Bookmarklet.js400
1 files changed, 400 insertions, 0 deletions
diff --git a/frontend/beta/js/Bookmarklet.js b/frontend/beta/js/Bookmarklet.js
new file mode 100644
index 0000000..b8a0c0e
--- a/dev/null
+++ b/frontend/beta/js/Bookmarklet.js
@@ -0,0 +1,400 @@
+/*
+
+Copyright 2008-2011 Clipperz Srl
+
+This file is part of Clipperz's Javascript Crypto Library.
+Javascript Crypto Library provides web developers with an extensive
+and efficient set of cryptographic functions. The library aims to
+obtain maximum execution speed while preserving modularity and
+reusability.
+For further information about its features and functionalities please
+refer to http://www.clipperz.com
+
+* Javascript Crypto Library is free software: you can redistribute
+ it and/or modify it under the terms of the GNU Affero General Public
+ License as published by the Free Software Foundation, either version
+ 3 of the License, or (at your option) any later version.
+
+* Javascript Crypto Library is distributed in the hope that it will
+ be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU Affero General Public License for more details.
+
+* You should have received a copy of the GNU Affero General Public
+ License along with Javascript Crypto Library. If not, see
+ <http://www.gnu.org/licenses/>.
+
+*/
+
+_cble = null;
+
+//-----------------------------------------------------------------------------
+
+isLoginForm = function(aForm) {
+ var inputFields;
+ var passwordFieldsFound;
+ var i,c;
+
+//console.log('is login form: ' + aForm.name + ' (' + aForm.id + ')');
+ passwordFieldsFound = 0;
+ inputFields = aForm.elements;
+ c = inputFields.length;
+ for (i=0; i<c; i++) {
+ if (inputFields[i].type == 'password') {
+ passwordFieldsFound ++;
+ }
+ }
+//console.log('number of password fields found: ' + passwordFieldsFound);
+ return (passwordFieldsFound == 1);
+};
+
+//-----------------------------------------------------------------------------
+
+findLoginForm = function(aDocument, aLevel) {
+ var result;
+ var documentForms;
+ var i,c;
+
+ result = null;
+
+ try {
+ documentForms = aDocument.getElementsByTagName('form');
+
+ c = documentForms.length;
+ for (i=0; (i<c) && (result == null); i++) {
+ if (isLoginForm(documentForms[i])) {
+ result = documentForms[i];
+ }
+ }
+
+ if ((result == null) && (aLevel == 0)) {
+ var iFrames;
+
+ iFrames = aDocument.getElementsByTagName('iframe');
+ c = iFrames.length;
+ for (i=0; (i<c) && (result == null); i++) {
+ result = findLoginForm(iFrames[i].contentDocument, (aLevel + 1));
+ }
+ }
+ } catch (e) {
+ _cble = e;
+ }
+
+ return result;
+};
+
+//-----------------------------------------------------------------------------
+
+inputElementValues = function(anInputElement) {
+ var result;
+
+// if ((anInputElement instanceof HTMLInputElement) && (anInputElement.getAttribute('name') != null)) {
+ if ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('name') != null)) {
+ result = {};
+ result.type = anInputElement.getAttribute('type') || 'text';
+ result.name = anInputElement.getAttribute('name');
+// result.value = anInputElement.getAttribute('value');
+ result.value = anInputElement.value;
+ if (anInputElement.type.toLowerCase() == 'radio') {
+ result.checked = anInputElement.checked;
+ }
+// } else if ((anInputElement instanceof HTMLSelectElement) && (anInputElement.getAttribute('name') != null)) {
+ } else if ((anInputElement.tagName.toLowerCase() == 'select') && (anInputElement.getAttribute('name') != null)) {
+ var options;
+ var c,i;
+
+//console.log('input element values: %o', anInputElement);
+ result = {};
+ result.type = 'select';
+ result.name = anInputElement.getAttribute('name');
+
+ result.options = [];
+ options = anInputElement.options;
+ c = options.length;
+ for (i=0; i<c; i++) {
+ var option;
+
+ option = {};
+ option.selected = options[i].selected;
+ option.label = options[i].label || options[i].innerHTML;
+ option.value = options[i].value;
+ result.options.push(option);
+ }
+ } else {
+ result = null;
+ }
+
+ return result;
+};
+
+//-----------------------------------------------------------------------------
+
+formParameters = function(aLoginForm) {
+ var result;
+ var i, c;
+ var action;
+
+ if (aLoginForm == null) {
+ result = null;
+ } else {
+ var radioValues;
+ var radioValueName;
+
+ result = {};
+ radioValues = {};
+
+ action = aLoginForm.action;
+ if (action.constructor != String) {
+ action = aLoginForm.getAttribute('action');
+ }
+
+ if (/^https?\:\/\/.*/.test(action)) {
+ action = action;
+ } else if (/^\/.*/.test(action)) {
+ action = window.location.protocol + '/' + '/' + window.location.hostname + action;
+ } else {
+ action = window.location.href.replace(/\/[^\/]*$/, '/' + action);
+ }
+
+ result.attributes = {};
+ result.attributes.action = action;
+ result.attributes.method = aLoginForm.getAttribute('method');
+
+ result.inputs = [];
+ c = aLoginForm.elements.length;
+ for (i=0; i<c; i++) {
+ var inputElement;
+ var elementValues;
+
+ inputElement = aLoginForm.elements[i];
+ elementValues = inputElementValues(inputElement);
+ if (elementValues != null) {
+ if (elementValues.type != 'radio') {
+ result.inputs.push(elementValues);
+ } else {
+ var radioValue;
+ var values;
+
+ radioValue = radioValues[elementValues.name];
+ if (radioValue == null) {
+ radioValue = {};
+ radioValue.name = elementValues.name;
+ radioValue.type = 'radio';
+ radioValue.options = [];
+
+ radioValues[elementValues.name] = radioValue;
+ }
+
+ values = {};
+ values.value = elementValues.value;
+ values.checked = elementValues.checked;
+
+ radioValue.options.push(values);
+ }
+ }
+ }
+
+ for (radioValueName in radioValues) {
+ if (typeof(radioValues[radioValueName]) != 'function') {
+ result.inputs.push(radioValues[radioValueName]);
+ }
+ }
+ }
+
+ return result;
+};
+
+//-----------------------------------------------------------------------------
+
+pageParameters = function() {
+ var result;
+
+ result = {};
+ result['title'] = document.title;
+//<link rel='icon' href='http://example.com/favicon.ico' type='image/x-icon'>
+
+ return result;
+};
+
+//-----------------------------------------------------------------------------
+
+reprString = function (o) {
+ return ('\'' + o.replace(/(["\\])/g, '\\$1') + '\''
+ ).replace(/[\f]/g, '\\f'
+ ).replace(/[\b]/g, '\\b'
+ ).replace(/[\n]/g, '\\n'
+ ).replace(/[\t]/g, '\\t'
+ ).replace(/[\r]/g, '\\r');
+};
+
+//-----------------------------------------------------------------------------
+
+serializeJSON = function (o) {
+ var objtype = typeof(o);
+ if (objtype == 'number' || objtype == 'boolean') {
+ return o + '';
+ } else if (o === null) {
+ return 'null';
+ }
+
+// var m = MochiKit.Base;
+// var reprString = m.reprString;
+ if (objtype == 'string') {
+ return reprString(o);
+ }
+
+ // recurse
+ var me = arguments.callee;
+ // array
+ if (objtype != 'function' && typeof(o.length) == 'number') {
+ var res = [];
+ for (var i = 0; i < o.length; i++) {
+ var val = me(o[i]);
+ if (typeof(val) != 'string') {
+ val = 'undefined';
+ }
+ res.push(val);
+ }
+ return '[' + res.join(',\n') + ']';
+ }
+
+ // undefined is outside of the spec
+ if (objtype == 'undefined') {
+// throw new TypeError('undefined can not be serialized as JSON');
+ throw new TypeError('error');
+ }
+
+ // generic object code path
+ res = [];
+ for (var k in o) {
+ if (typeof(o[k]) != 'function') {
+ var useKey;
+ if (typeof(k) == 'number') {
+ useKey = '\'' + k + '\'';
+ } else if (typeof(k) == 'string') {
+ useKey = reprString(k);
+ } else {
+ // skip non-string or number keys
+ continue;
+ }
+
+ val = me(o[k]);
+ if (typeof(val) != 'string') {
+ // skip non-serializable values
+ continue;
+ }
+ res.push(useKey + ':' + ' ' + val);
+ }
+ }
+
+ return '{' + res.join(',\n') + '}';
+};
+
+//-----------------------------------------------------------------------------
+
+closeBookmarklet = function() {
+ var bookmarkletDiv;
+
+ bookmarkletDiv = document.getElementById('clipperz_bookmarklet');
+ bookmarkletDiv.parentNode.removeChild(bookmarkletDiv);
+};
+
+//-----------------------------------------------------------------------------
+
+logFormParameters = function(someParameters, anException) {
+ var newDiv;
+ var base_url;
+ var help_url;
+// var base_image_url;
+ var logo_image_url;
+ var background_image_url;
+ var close_image_url;
+ var bookmarklet_textarea;
+ var innerHTML;
+
+//
+// Obsolete: image -> base64 encoding done here: http://www.motobit.com/util/base64-decoder-encoder.asp
+// conversion done using the Filemark Maker application: http://www.insanelygreattees.com/news/?p=51
+//
+
+ base_url = 'http://www.clipperz.com/';
+ help_url = base_url + 'help/bookmarklet';
+// base_image_url = base_url + 'files/clipperz.com/bookmarklet/';
+// logo_image_url = base_image_url + 'logo.png';
+ logo_image_url = 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAXCAYAAABOMABkAAAACXBIWXMAAAsTAAALEwEAmpwYAAANJ2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjardd5NJRv2AfwaxbGMmbGGHsY2Xcle/YtkWzZUpKdYSYmScqSlDVLKNoo2oQWEonqR5YkyZKtyJKlFLJkmfcPqd7feZfznvNefzzneu7nj/t+7nM+3/vcAHgNdxqNggSAwCB6sK2ZIdnJ2YWM6QQM4IAXsCDi7hFCM7C2toT/uhAA852AAABoV3Cn0SjwfytcsJOzCwBCHgBIPuu9PgCQDq739gBAOkKn0QEQvgBA8vB19wRARACAfLC9rREA4iYA4HzW+woAwB1c7xsAABfq4UMHQHQDMBODPP2CADBTAMy6nl4hHgA4eQDw9AzxCATApQKAVWAg1RMA9xEApD1owXQAPAsAKDg5u5DXl7w3AWAbPwCLxZ+xI5kAZXkA0rv+jIk9AuBxB8hP/jM2awsIAEDwtIZ4q2xd30GsIQDTAIMxKwmASQdYTWMwlvMZjNVrAKg+gFqKx+Hg0I39RrQA/G/v6//8q1AIACQAQhxRiAxHRaAjmE4wR2FiWE6yGrPWsZ1mP4ON50jClRN8OdOIaVzppHPcmTyZvNl8dQJUwdxNuUKXhBvIh0XzN18Ta5U4Jlko1SZzQvaOXKdCjOJdpZ4tp7feV/mgmqRWrj6omaJVqT2qk6H7VG/CIMvwudFXkxzTerMZ8ys7myzmd+Vbvd79xvqNTZvtiv3tPR0OnY5dTt0u6L33XPv29e8fcPtw4ONBrMdjz2GvEe9RnzHfz37jAdyUZ4Ffgr5Sp2nfDn0PngmZo88d/hE6f2QhbPHoUvjPYysRK8dXI2WiOmIQJ5GxqFPoOKbTzGcw8SwJrIlsSezJ2BSOs7hUfBohnTODeI4rk5TFnc1znvcCXw5/rsBFwUubLgtdEb4qkkfOF722+bpYgXihxA2pm1K3pG/L3JG9M1lEu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L0Pg+cpXtYTCAKwfHk2JpOBzz47iMXSysmT/+JmjmI06snOzmDFiudvS2RlX8fdZgvyJcFOp4vWVhuSJGG3OwIWdTicTJ06DoNByyefHKC0tMbXEe/VK5jXX8/uloQOh5Pnn3+clhYbO3cW4PHI6PUaAMzmXqxcOcfXJASIigrjvfeWsmbNJ5w+fY6amltXYDQaFVFRYSxZ8ixTpoy+5ddOF21tdkRR9OVD/umTt7NT7nTd3AXoaAiUcwIuJYL0KIKIosCiRdPIzBzHsWOlXLzYCECfPuGkpj7AkCFxfsqJidFs3ry0qyKk8VV8MjPHkZwciyAImM2B96Pcbhm9Xs2qVXPIyBhBYeE57HYnMTGRpKen3PFOldvtISQkiJycF3jyyVTOnKnE6XQzcGBfHntsBJGRoQE6cXFRbNnyOkVFFZSWVtPU1IJGoyIxMZqxY4fSu3eIn/z06Y8ydOgABEEgMjIs0AjzeJi24873sHy/Hk7oM1rxsJ5EkJuIjo4gO/uxX1QOCzMG3H0CiI83+/UvuvUfT2e0GTt2CGPHDrlrg29WodLTU0hPT7krHUkSGTMmmTFjkn9RNiGhn18/JPBsGAMJMYrn3G9JugIFCu4ygvxWcDrdWK0O3+v/Tq/jv9ZToOB3RZAnnhhFTEwkoigwYMDdN9SysiYwcmQisuwlOTlW+dYU/N8gKP9qokDBnfGfAQA9nOAwz2UemwAAAABJRU5ErkJgggo=';
+// background_image_url = base_image_url + 'background.png';
+ background_image_url = 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAGlCAYAAABAwstlAAANMWlDQ1BJQ0MgUHJvZmlsZQAAeJyV13k0lG0fB/DfLIxlzDDGHkb2XWQPWSJL9mwpMXbDTAyplCUpRJZQtKBoU5RIJKqHLAnJklBUZCmFSJZ5/5Dqfc553ue81x/3+d2/+9znuu77nM/3OhcAXsuTRqMgASA4hB5qb2ZEcnF1I2F6AAM44AMsiHqSw2iGtrZW8I9jvgcQAABdip40GiUc3ZFJftCtapBvLz7n36D0z+8BAAA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uJhbMnvnHmzPH3au27hGOf4jDO+qx7GkOz2T67b89tv9U+deHmW/bXffffNc7rAsLcd/9ddfMt+1u39Kb2XX/w7qraXqvbRu1zNC95yTXJhlL77PWZqpqdm939G+073HPvnfas4EOi3+/XPffeuea27XPX/XqNVmCztTrcTNWFf5J3cc8x5mtb7x3CuX5/+hfad/rMHbeN+fBAou7vfH9q5kBVbatRsGZr7YR1ycYNVvtPcM4vCfv9qb3tO+3fv2fMhwcSdX/np3pT19dowmpOe2omrO4nuFyUcfewmssmXNNVNdPr9be37+g8K/hw6f7O9/pTzXTV7F+NHauqyZaE7T2sZsoC6Gomq+a4Ypvu3Y+D6XcOgK7uR0t1+3HRJt10735CA0BX+93Bsaerqsmmom4lncYOrGe9yeqKB6vqwkkLoGviUDUmnbAAfpaN3hG8ome6t1+ICQvYyHr/W9ZVWRIC/CybthoTLCDGJKc1AIzrii4Ju2tRAQPez0a9uGJ/Swhwsd6vGxfdFHtYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEmCRYw84BsJFN6cU4wRIo4FJ1mzF8n+9taNwJS7CAzXBJLbGHBcTYzGCZuoD1bFobNnXCGg6Wz7SvLyyc3cyHB7a47u/8YLB8trZQsAY1ejGDqhouD5beaX/z6NG3J3x4IEn3d355sHhi5cvmzbpBTfDG3STBGrReSFXVcHn53BvtOzz37AsTPDyQpvs7v7R05q26MFLdy4u2GU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83V7qmqfyjDWeViTboZ3a9trHe1gnavRP+p0rR+s9pQlWLD1dKerQY1+55upqZmymv2qM63Lc7X6juBYoWpMEqzmxW/0vabCzT/qdI2WjLM1OiWiWU62gyVWsDW1/ySv2TBvJqxmgmomrTO19iTRJljt0xjGitZmTVhVo9gsdm5vV3i2RtGaqbXTVfPuYjtW9rLg6lvv0xWaCamJTxOi9v5Uc9nEqrnfRB8tUzV5sKounLQWa+3oOFOre1hNrJrztjaarkxacPWtF5b23xA3IWoum32q9qkL7VhNtBys2pxgNdqbcu1gNWNjO1TN0d5sb09VggVbR3sqan7P25vn3T9ubp9n1XSgasJYVW1+GLonk645kbTWn6zaobIUhK2ne1pD1doYtb9u9qgm+hiZjVyOSaZ7TlW/Llz6rffOoKkKtrbup4a2V1ODdW6rWrtdNLHLGYn1YtTdrxIqyNKelNofk77esemuVCy6z7NRqMQLtq71/vfmsf4H53FttUBstdcD+D9HAQAAAAAAAAAAAAAAIN3/A/PNWgCA/F3MAAAAAElFTkSuQmCCCg==';
+// close_image_url = base_image_url + 'close.png';
+ close_image_url = 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAIAAAC0D9CtAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGiSURBVHjaYvz//z8DiYAFU+jhg5cXLtx9/+4LLy+nlpa8hpYsIyMjTj03rj/u71l74fxdZEEFRfG8wkBrG224CCPcbfv2XKivWfjr1x+s7snM8U1IcoOwmeA24NEABNOnbN698yyKHqCTIBrcPU2WrKiIjHYEsh2c9BctK0tMcYeomdC37sePXyAW0G0P7r8wM8yBoFs3n/wHgwP7L/79+xfI+Pnzl6VpHkR27+7zQBGQPcie3rr5JIRh76DHxASS3bHtzN8//yCCF87fgbrt/fsvcD3Ll+4/eOASnPvg/suO1hVwLjACoHqA8QAXBfrB1k4HOaDjEl3hXF4+LqgeYMTBRZNS3CFOAtoAEUlIdGNmgQaVlrYcVA8wpoHmQUT377v469fvTRuOR4W1zZi25cf3X6DAAPuHi4vd1l4XEadHj1wtypsB0QY0Fe5pZHZOvn9svAsifoBJAxjTEDZcETLbw8s0Js4ZPe0AATCmgRH35vUn5BQAdFJSqgdQAzylMqLlBWBMHztyDRgPoHTNxwX0NNAP/PzcyGoYycg/AAEGABYVzxqE3YcJAAAAAElFTkSuQmCCCg==';
+
+// newDiv.parentNode.removeChild(newDiv);
+ newDiv = document.createElement('div');
+ newDiv.setAttribute('id', 'clipperz_bookmarklet');
+// newDiv.setAttribute('style', 'width:270px; height:400px; padding:20px 0px 0px 20px; margin:0px; border:0px; background-color:transparent; background-repeat:no-repeat; position:absolute; z-index:20000; top:40px; left:40px; background-image:url(' + background_image_url + ');');
+
+ innerHTML = '';
+ innerHTML += '<style>div#ClipperzBackgroundDIV { width:290px; height:420px; padding:20px 0px 0px 20px; margin:0px; border:0px; background-color:transparent; background-repeat:no-repeat; position:absolute; z-index:20000; top:40px; left:40px; background-image:url(' + background_image_url + ') }</style>';
+ innerHTML += '<div style="border:0px; margin:0px; padding:0px; padding-left:10px;">' +
+ '<img style="padding-top:5px;" src="' + logo_image_url + '">' +
+ '<a href="javascript:closeBookmarklet();">' +
+ '<img style="padding-left:28px; padding-bottom:10px;" border=0 src="' + close_image_url + '">' +
+ '</a>' +
+ '</div>';
+
+ if ((someParameters != null) && (anException == null)) {
+ innerHTML += '<div style="width:255px; border-top:1px dotted #336;">' +
+ '<div style="line-height:10pt; margin-right:10px; margin-top:5px; padding:5px 10px; color:#666; text-align:left; font-family:sans-serif;">' +
+ '<p style="margin:0px; font-weight:bold; font-size:10pt; font-family:sans-serif;">How to add a new card or a direct login to an existing card for this website:</p>' +
+ '<ol style="padding:0px 0px 0px 20px; font-size:9pt; font-family:sans-serif;">' +
+ '<li>Copy the content of the text area below (Ctrl-C)</li>' +
+ '<li>Go to your Clipperz account</li>' +
+ '<li>Click "Add new card" or select the related card</li>' +
+ '<li>Paste the direct login configuration (Ctrl-V)</li>' +
+ '<li>Complete and review the details, then click "Save"</li>' +
+ '</ol>' +
+ '</div>' +
+ '</div>';
+ innerHTML += '<textarea id="bookmarklet_textarea" style="border:2px solid #333366; font-family:sans-serif; font-size:8pt; color:#336; width:240px; height:135px; padding:4px; background-color:white; margin:0px 10px;">' +
+ serializeJSON(someParameters) +
+ '</textarea>';
+ } else if ((someParameters == null) && (anException == null)) {
+ innerHTML += '<div>No login form has been found on the page</div><div>Get some help <a href="#">here</a></div>';
+ } else {
+ innerHTML += '<div>An error happened while processing the page</div><div>Get some help <a href="#">here</a></div><div>' + anException.name + ' - ' + anException.message + '</div>';
+ }
+
+// newDiv.innerHTML = '<div style="width:290px; height:420px; padding:20px 0px 0px 20px; margin:0px; border:0px; background-color:transparent; background-repeat:no-repeat; position:absolute; z-index:20000; top:40px; left:40px; background-image:url(' + background_image_url + ')">' + innerHTML + '</div>';
+ newDiv.innerHTML = '<div id="ClipperzBackgroundDIV">' + innerHTML + '</div>';
+
+ document.body.appendChild(newDiv);
+
+ if ((someParameters != null) && (anException == null)) {
+ bookmarklet_textarea = document.getElementById('bookmarklet_textarea');
+ bookmarklet_textarea.focus();
+ bookmarklet_textarea.select();
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+getLoginFormConfiguration = function() {
+ var parameters;
+
+ try {
+ parameters = {};
+ parameters.page = pageParameters();
+ parameters.form = formParameters(findLoginForm(document, 0));
+ parameters.version = '0.2.3';
+ logFormParameters(parameters, _cble);
+ } catch (e) {
+ // parameters = 'No login form has been found'
+ logFormParameters(parameters, e);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+getLoginFormConfiguration();
+
+
+