commit 3affd48293b1152b070b5e03321dd007235b3e86 Author: gine Date: Sun Sep 11 17:48:55 2016 +0200 Init commit diff --git a/ftp.php b/ftp.php new file mode 100644 index 0000000..07f1ab9 --- /dev/null +++ b/ftp.php @@ -0,0 +1,118 @@ + diff --git a/include/localization.php b/include/localization.php new file mode 100755 index 0000000..d9d6e9c --- /dev/null +++ b/include/localization.php @@ -0,0 +1,115 @@ +"; + foreach ($langarray as $l) { + $label=split("_",$l); + $class=""; + if ($l == $lang) + $class="class='it'"; + + echo "
  • ".$label[0]."
  • "; + } + $foo = getenv("HTTP_ACCEPT_LANGUAGE"); + echo "\n"; +} + +/** + * Sets a new text domain after recording the current one + * so it can be restored later with restore_textdomain(). + * + * It's possible to nest calls to these two functions. + * @param string the new text domain to set + */ +function set_textdomain($td) +{ + global $_td_stack; + + $old_td = textdomain(NULL); + + if ($old_td) { + if (!strcmp($old_td, $td)) + array_push($_td_stack, false); + else + array_push($_td_stack, $old_td); + } + + textdomain($td); +} + +/** + * Restore the text domain active before the last call to + * set_textdomain(). + */ +function restore_textdomain() +{ + global $_td_stack; + + $old_td = array_pop($_td_stack); + + if ($old_td) + textdomain($old_td); +} +?> diff --git a/include/log.php b/include/log.php new file mode 100644 index 0000000..d8d1379 --- /dev/null +++ b/include/log.php @@ -0,0 +1,19 @@ + diff --git a/include/strenght_box.php b/include/strenght_box.php new file mode 100644 index 0000000..14f3d20 --- /dev/null +++ b/include/strenght_box.php @@ -0,0 +1,12 @@ + +
    + <?php _(" title=""> + <?php _(" title=""> + <?php _(" title=""> +
    + diff --git a/include/template.php b/include/template.php new file mode 100644 index 0000000..1a414e9 --- /dev/null +++ b/include/template.php @@ -0,0 +1,132 @@ + + + + + + <?php echo sprintf(_("Tool to change %s password"), $title_page); ?> + + + + + + + + + + + +
    +

    + +

    +
    + +
    + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    + + + + +
    +
    +
    +
    +
    + + Help + +
    +
    + +

    + +

    + +
    + + + + + diff --git a/include/var.php b/include/var.php new file mode 100644 index 0000000..e92a2e6 --- /dev/null +++ b/include/var.php @@ -0,0 +1,16 @@ +bad!'); + $msgServiceOffline = _('Service offline for maintenance. We will come back soon, in case of problem write to gestione@posta.indivia.net or visit ortiches blog.'); + $helppwd = _('How to chose my password'); +?> diff --git a/lang/de_DE/change_pw.php b/lang/de_DE/change_pw.php new file mode 100644 index 0000000..03cd801 --- /dev/null +++ b/lang/de_DE/change_pw.php @@ -0,0 +1,25 @@ +benutzen!"; + $msgServiceOffline = 'Service offline for maintenance. We will come back soon, in case of problem write to gestione@posta.indivia.net' ; + $helppwd = "Wie wähle ich mein Passwort"; +?> diff --git a/lang/en_US/change_pw.php b/lang/en_US/change_pw.php new file mode 100644 index 0000000..a3fc776 --- /dev/null +++ b/lang/en_US/change_pw.php @@ -0,0 +1,25 @@ +bad!'; + $msgServiceOffline = 'Service offline for maintenance. We will come back soon, in case of problem write to gestione@posta.indivia.net'; + $helppwd = 'How to chose my password'; +?> diff --git a/lang/es_ES/change_pw.php b/lang/es_ES/change_pw.php new file mode 100644 index 0000000..88cc7c7 --- /dev/null +++ b/lang/es_ES/change_pw.php @@ -0,0 +1,26 @@ +mala!'; + $msgServiceOffline = 'Service offline for maintenance. We will come back soon, in case of problem write to gestione@posta.indivia.net'; + $helppwd = '¿Cómo elegir mi contraseña' ; +?> diff --git a/lang/it_IT/change_pw.php b/lang/it_IT/change_pw.php new file mode 100644 index 0000000..e830f1e --- /dev/null +++ b/lang/it_IT/change_pw.php @@ -0,0 +1,16 @@ +male!'; + $msgServiceOffline = 'Servizio offline per manutenzione. Torneremo presto, in caso di bisogno scrivete a gestione@posta.indivia.net'; + $helppwd = 'Come scegliere la password?' ; +?> diff --git a/mail.php b/mail.php new file mode 100644 index 0000000..570f230 --- /dev/null +++ b/mail.php @@ -0,0 +1,61 @@ + diff --git a/res/css/default.css b/res/css/default.css new file mode 100644 index 0000000..39343ae --- /dev/null +++ b/res/css/default.css @@ -0,0 +1,126 @@ +body { + margin: 0px auto; + width:41.5em; +} + +ul.langsel { + float: left; + font-family: Verdana,sans-serif; + font-size: 8pt; + font-variant: small-caps; + font-weight: bold; + left: 0; + list-style-type: none; + margin-left: -1.5em; + margin-top: 1.6em; + padding: 0; + top: 2em; + position: inherit; + width: 1.5em; +} + +div.homebox { + background-color: #ddd; + border-radius:15px; + moz-border-radius:15px; + background-repeat: no-repeat; + background-position: top left; + left: 26em; + font-family: Verdana, sans-serif; + font-size: 10pt; +} + +div#chpw-hb { + width: 36em; +} + +input{ + size: 28; + border-color: grey; + border-radius: 7px; + moz-border-radius: 7px; + border-style: solid; +} + +div.homebox h1 { + font-size: 14pt; + font-family: Verdana, Helvetica, sans-serif; + font-weight: bold; + margin-top: 12px; + padding-top: 12px; + text-align: center; +} +div.homebox table.formtable { + margin-left: auto; + margin-right: auto; +} +div.homebox table.formtable tr td:first-child { + text-align: right; + white-space: nowrap; +} +div.homebox select { + background-color: white; + border: 1px inset #ddd; + font-size: 10pt; + padding: 0.1em; +} +div.homebox p { + margin: 0; + text-align: justify; +} +div.homebox a:link, div.homebox a:visited { + color: black; +} +div.homebox a:hover, div.homebox a:active { + color: #555; +} + +div#help-box{ + width: 29.2em; +} + +div#help-box a{ + text-decoration:none; +} + +div#help-box img{ + float:right; + margin-top:-30px; + width:30px; + height:30px; + clear:both; +} + +div#helper { + clear:both; + background-color: #ddd; + background-repeat: no-repeat; + background-position: top left; + border-style:dashed; + border-width:1px; + width: 30em; + top:-1em; + margin-left:38em; + font-family: Verdana, sans-serif; + font-size: 9pt; + border-radius: 15px 15px 15px 15px; + -moz-border-radius:15px 15px 15px 15px; +} + +div#sentenza{ + margin-top:-30px; +} + +div#Words-box{ + text-align:center; + font-size: 12pt; + border-radius:15px; + moz-border-radius:15px 15px 15px 15px; + background-color: #ddd; +} + +div.homebox p.msg{ + text-align: center; + padding-bottom: 30px; +} + diff --git a/res/css/keyboard.css b/res/css/keyboard.css new file mode 100644 index 0000000..0cbe549 --- /dev/null +++ b/res/css/keyboard.css @@ -0,0 +1,112 @@ +#keyboardInputMaster { + position:absolute; + border:2px groove #dddddd; + color:#000000; + background-color:#dddddd; + text-align:left; + z-index:1000000; + width:auto; +} + +#keyboardInputMaster thead tr th { + text-align:left; + padding:2px 5px 2px 4px; + background-color:inherit; + border:0px none; +} +#keyboardInputMaster thead tr th select, +#keyboardInputMaster thead tr th label { + color:#000000; + font:normal 11px Arial,sans-serif; +} +#keyboardInputMaster thead tr td { + text-align:right; + padding:2px 4px 2px 5px; + background-color:inherit; + border:0px none; +} +#keyboardInputMaster thead tr td span { + padding:1px 4px; + font:bold 11px Arial,sans-serif; + border:1px outset #aaaaaa; + background-color:#cccccc; + cursor:pointer; +} +#keyboardInputMaster thead tr td span.pressed { + border:1px inset #999999; + background-color:#bbbbbb; +} + +#keyboardInputMaster tbody tr td { + text-align:left; + margin:0px; + padding:0px 4px 3px 4px; +} +#keyboardInputMaster tbody tr td div { + text-align:center; + position:relative; + height:0px; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout { + height:auto; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table { + height:20px; + white-space:nowrap; + width:100%; + border-collapse:separate; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table.keyboardInputCenter { + width:auto; + margin:0px auto; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td { + vertical-align:middle; + padding:0px 5px 0px 5px; + white-space:pre; + font:normal 11px 'Lucida Console',monospace; + border-top:1px solid #e5e5e5; + border-right:1px solid #5d5d5d; + border-bottom:1px solid #5d5d5d; + border-left:1px solid #e5e5e5; + background-color:#eeeeee; + cursor:default; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.last { + width:99%; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.alive { + background-color:#ccccdd; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.target { + background-color:#ddddcc; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.hover { + border-top:1px solid #d5d5d5; + border-right:1px solid #555555; + border-bottom:1px solid #555555; + border-left:1px solid #d5d5d5; + background-color:#cccccc; +} +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.pressed, +#keyboardInputMaster tbody tr td div#keyboardInputLayout table tbody tr td.dead { + border-top:1px solid #555555; + border-right:1px solid #d5d5d5; + border-bottom:1px solid #d5d5d5; + border-left:1px solid #555555; + background-color:#cccccc; +} + +#keyboardInputMaster tbody tr td div var { + position:absolute; + bottom:0px; + right:0px; + font:bold italic 11px Arial,sans-serif; + color:#444444; +} + +.keyboardInputInitiator { + margin-left:3px; + vertical-align:middle; + cursor:pointer; +} \ No newline at end of file diff --git a/res/css/little_form.css b/res/css/little_form.css new file mode 100644 index 0000000..9206c8c --- /dev/null +++ b/res/css/little_form.css @@ -0,0 +1,10 @@ +#form { + background-color: #ddd; + border-radius: 15px 15px 15px 15px; + background-repeat: no-repeat; + width: 40em; + left: 26em; + font-family: Verdana, sans-serif; + font-size: 10pt; + position: relative; +}] \ No newline at end of file diff --git a/res/css/strenght_box.css b/res/css/strenght_box.css new file mode 100644 index 0000000..7a30e00 --- /dev/null +++ b/res/css/strenght_box.css @@ -0,0 +1,9 @@ +div#misuratore_password{ + float:right; + width:12.5em; + height:auto; + border-style:dashed; + border-width:1px; + top:14.7em; + margin-top: 9.7em; +} diff --git a/res/images/keyboard.png b/res/images/keyboard.png new file mode 100644 index 0000000..37f7c7c Binary files /dev/null and b/res/images/keyboard.png differ diff --git a/res/images/pi-3d.png b/res/images/pi-3d.png new file mode 100644 index 0000000..c859992 Binary files /dev/null and b/res/images/pi-3d.png differ diff --git a/res/images/pi-posate.jpg b/res/images/pi-posate.jpg new file mode 100644 index 0000000..c49dd89 Binary files /dev/null and b/res/images/pi-posate.jpg differ diff --git a/res/images/traffic_lights_green.png b/res/images/traffic_lights_green.png new file mode 100644 index 0000000..a2cd282 Binary files /dev/null and b/res/images/traffic_lights_green.png differ diff --git a/res/images/traffic_lights_grey.png b/res/images/traffic_lights_grey.png new file mode 100644 index 0000000..0122089 Binary files /dev/null and b/res/images/traffic_lights_grey.png differ diff --git a/res/images/traffic_lights_red.png b/res/images/traffic_lights_red.png new file mode 100644 index 0000000..3bcd7b6 Binary files /dev/null and b/res/images/traffic_lights_red.png differ diff --git a/res/images/traffic_lights_yellow.png b/res/images/traffic_lights_yellow.png new file mode 100644 index 0000000..d86d390 Binary files /dev/null and b/res/images/traffic_lights_yellow.png differ diff --git a/res/js/keyboard.js b/res/js/keyboard.js new file mode 100644 index 0000000..65259ed --- /dev/null +++ b/res/js/keyboard.js @@ -0,0 +1,827 @@ +/* ******************************************************************** + ********************************************************************** + * HTML Virtual Keyboard Interface Script - v1.10 + * Copyright (c) 2008 - GreyWyvern + * + * - Licenced for free distribution under the BSDL + * http://www.opensource.org/licenses/bsd-license.php + * + * Add a script-driven keyboard interface to text fields, password + * fields and textareas. + * + * See http://www.greywyvern.com/code/js/keyboard.html for examples and + * usage instructions. + * + * Version 1.10 - April 14, 2008 + * - Slovenian keyboard layout added by Miran Zeljko + * + * Version 1.9 - April 3, 2008 + * - Hungarian keyboard layout added by Antal Sall 'Hiromacu' + * + * Version 1.8 - March 31, 2008 + * - Performance tweaks + * + * Version 1.7 - March 27, 2008 + * - Arabic keyboard layout added by Srinivas Reddy + * + * Version 1.6 - January 16, 2008 + * - Hebrew keyboard layout added by Enon Avital + * + * Version 1.5 - January 7, 2008 + * - Italian and Spanish (Spain) keyboard layouts added by dictionarist.com + * + * Version 1.4a - October 15, 2007 + * - Keyboard is fully removed from document when hidden + * + * Version 1.4 - August 1, 2007 + * - Simplified layout syntax a bit + * - Added version number to lower right of interface + * - Various other small bug fixes + * + * Version 1.3 - July 30, 2007 + * - Interaction styling changes (Alt, AltGr, Shift) + * - Justified keys - last key expands to fit width + * - If no dead keys in layout, dead key checkbox is hidden + * - Option to disable dead keys per keyboard + * - Added the Number Pad layout + * - Pulled all variations of script up to same version number + * + * Keyboard Credits + * - Slovenian keyboard layout added by Miran Zeljko + * - Hungarian keyboard layout added by Antal Sall 'Hiromacu' + * - Arabic keyboard layout added by Srinivas Reddy + * - Italian and Spanish (Spain) keyboard layouts added by dictionarist.com + * - Lithuanian and Russian keyboard layouts added by Ramunas + * - German keyboard layout added by QuHno + * - French keyboard layout added by Hidden Evil + * - Polish Programmers layout assisted by moose + * - Turkish keyboard layouts added by offcu + * - Dutch and US Int'l keyboard layouts assisted by jerone + * - Portuguese keyboard layout added by clisboa + * + */ + +function VKI_buildKeyboardInputs() { + var self = this; + + this.VKI_version = "1.10"; + this.VKI_target = this.VKI_visible = ""; + this.VKI_shift = this.VKI_capslock = this.VKI_alternate = this.VKI_dead = false; + this.VKI_deadkeysOn = false; + this.VKI_kt = "US"; // Default keyboard layout + this.VKI_range = false; + this.VKI_keyCenter = 3; + + + /* ***** Create keyboards **************************************** */ + this.VKI_layout = new Object(); + this.VKI_layoutDDK = new Object(); + + // - Lay out each keyboard in rows of sub-arrays. Each sub-array + // represents one key. + // + // - Each sub-array consists of four slots described as follows: + // example: ["a", "A", "\u00e1", "\u00c1"] + // + // a) Normal character + // A) Character + Shift or Caps + // \u00e1) Character + Alt or AltGr + // \u00c1) Character + Shift or Caps + Alt or AltGr + // + // You may include sub-arrays which are fewer than four slots. In + // these cases, the missing slots will be blanked when the + // corresponding modifier key (Shift or AltGr) is pressed. + // + // - If the second slot of a sub-array matches one of the following + // strings: + // "Tab", "Caps", "Shift", "Enter", "Bksp", "Alt" OR "AltGr" + // then the function of the key will be the following, + // respectively: + // - Insert a tab + // - Toggle Caps Lock (technically a Shift Lock) + // - Next entered character will be the shifted character + // - Insert a newline (textarea), or close the keyboard + // - Delete the previous character + // - Next entered character will be the alternate character + // + // The first slot of this sub-array will be the text to display on + // the corresponding key. This allows for easy localisation of key + // names. + // + // - Layout dead keys (diacritic + letter) should be added as arrays + // of two item arrays with hash keys equal to the diacritic. See + // the "this.VKI_deadkey" object below the layout definitions. In + // each two item child array, the second item is what the diacritic + // would change the first item to. + // + // - To disable dead keys for a layout, simply assign true to the + // this.VKI_layoutDDK (DDK = disable dead keys) object of the same + // name as the layout. See the Numpad layout below for an example. + // + // - Note that any characters beyond the normal ASCII set should be + // entered in escaped Unicode format. (eg \u00a3 = Pound symbol) + // You can find Unicode values for characters here: + // http://unicode.org/charts/ + // + // - To remove a keyboard, just delete it, or comment it out of the + // source code + + this.VKI_layout.Arabic = [ // Arabic Keyboard + [["\u0630", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "\u003c"], ["\u062f", "\u003e"], ["\u005c", "\u007c"]], + [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "\u005d"], ["\u0628", "\u005b"], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\u002f"], ["\u0643", "\u003a"], ["\u0637", "\u0022"], ["Enter", "Enter"]], + [["Shift", "Shift"], ["\u0626", "\u007e"], ["\u0621", "\u0652"], ["\u0624", "\u007d"], ["\u0631", "\u007b"], ["\u0644", "\u0644"], ["\u0649", "\u0622"], ["\u0629", "\u2019"], ["\u0648", "\u002c"], ["\u0632", "\u002e"], ["\u0638", "\u061f"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["Alt", "Alt"]] + ]; + + this.VKI_layout.Belgian = [ // Belgian Standard Keyboard + [["\u00b2", "\u00b3"], ["&", "1", "|"], ["\u00e9", "2", "@"], ['"', "3", "#"], ["'", "4"], ["(", "5"], ["\u00a7", "6", "^"], ["\u00e8", "7"], ["!", "8"], ["\u00e7", "9", "{"], ["\u00e0", "0", "}"], [")", "\u00b0"], ["-", "_"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u005e", "\u00a8", "["], ["$", "*", "]"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%", "\u00b4"], ["\u03bc", "\u00a3", "`"]], + [["Shift", "Shift"], ["<", ">", "\\"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["=", "+", "~"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Dutch = [ // Dutch Standard Keyboard + [["@", "\u00a7", "\u00ac"], ["1", "!", "\u00b9"], ["2", '"', "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00bc"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "_", "\u00a3"], ["8", "(", "{"], ["9", ")", "}"], ["0", "'"], ["/", "?", "\\"], ["\u00b0", "~", "\u00b8"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R", "\u00b6"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00a8", "^"], ["*", "|"], ["<", ">"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["+", "\u00b1"], ["\u00b4", "\u0060"], ["Enter", "Enter"]], + [["Shift", "Shift"], ["]", "[", "\u00a6"], ["z", "Z", "\u00ab"], ["x", "X", "\u00bb"], ["c", "C", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":", "\u00b7"], ["-", "="], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Dvorak = [ // Dvorak Keyboard + [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["[", "{"], ["]", "}"], ["Bksp", "Bksp"]], + [["Tab", "Tab"],["'", '"'], [",", "<"], [".", ">"], ["p", "P"], ["y", "Y"], ["f", "F"], ["g", "G"], ["c", "C"], ["r", "R"], ["l", "L"], ["/", "?"], ["=", "+"], ["\\", "|"]], + [["Caps", "Caps"], ["a", "A"], ["o", "O"], ["e", "E"], ["u", "U"], ["i", "I"], ["d", "D"], ["h", "H"], ["t", "T"], ["n", "N"], ["s", "S"], ["-", "_"], ["Enter", "Enter"]], + [["Shift", "Shift"], [";", ":"], ["q", "Q"], ["j", "J"], ["k", "K"], ["x", "X"], ["b", "B"], ["m", "M"], ["w", "W"], ["v", "V"], ["z", "Z"], ["Shift", "Shift"]], + [[" ", " "]] + ]; + + this.VKI_layout.French = [ // French Standard Keyboard + [["\u00b2", "\u00b3"], ["&", "1"], ["\u00e9", "2", "~"], ['"', "3", "#"], ["'", "4", "{"], ["(", "5", "["], ["-", "6", "|"], ["\u00e8", "7", "\u0060"], ["_", "8", "\\"], ["\u00e7", "9", "\u005e"], ["\u00e0", "0", "\u0040"], [")", "\u00b0", "]"], ["=", "+", "}"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["^", "\u00a8"], ["$", "\u00a3", "\u00a4"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%"], ["*", "\u03bc"]], + [["Shift", "Shift"], ["<", ">"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["!", "\u00a7"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.German = [ // German Standard Keyboard + [["\u005e", "\u00b0"], ["1", "!"], ["2", '"', "\u00b2"], ["3", "\u00a7", "\u00b3"], ["4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["\u00df", "?", "\\"], ["\u00b4", "\u0060"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q", "\u0040"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00fc", "\u00dc"], ["+", "*", "~"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f6", "\u00d6"], ["\u00e4", "\u00c4"], ["#", "'"]], + [["Shift", "Shift"], ["<", ">", "\u00a6"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Greek = [ // Greek Standard Keyboard + [["`", "~"], ["1", "!"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a3"], ["5", "%", "\u00a7"], ["6", "^", "\u00b6"], ["7", "&"], ["8", "*", "\u00a4"], ["9", "(", "\u00a6"], ["0", ")", "\u00ba"], ["-", "_", "\u00b1"], ["=", "+", "\u00bd"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], [";", ":"], ["\u03c2", "^"], ["\u03b5", "\u0395"], ["\u03c1", "\u03a1"], ["\u03c4", "\u03a4"], ["\u03c5", "\u03a5"], ["\u03b8", "\u0398"], ["\u03b9", "\u0399"], ["\u03bf", "\u039f"], ["\u03c0", "\u03a0"], ["[", "{", "\u201c"], ["]", "}", "\u201d"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["\u03b1", "\u0391"], ["\u03c3", "\u03a3"], ["\u03b4", "\u0394"], ["\u03c6", "\u03a6"], ["\u03b3", "\u0393"], ["\u03b7", "\u0397"], ["\u03be", "\u039e"], ["\u03ba", "\u039a"], ["\u03bb", "\u039b"], ["\u0384", "\u00a8", "\u0385"], ["'", '"'], ["\\", "|", "\u00ac"]], + [["Shift", "Shift"], ["<", ">"], ["\u03b6", "\u0396"], ["\u03c7", "\u03a7"], ["\u03c8", "\u03a8"], ["\u03c9", "\u03a9"], ["\u03b2", "\u0392"], ["\u03bd", "\u039d"], ["\u03bc", "\u039c"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Hebrew = [ // Hebrew Standard Keyboard + [["~", "`"], ["1", "!"], ["2", "@"], ["3", "#"], ["4" , "$", "\u20aa"], ["5" , "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", ")"], ["0", "("], ["-", "_"], ["=", "+"], ["\\", "|"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["/", "Q"], ["'", "W"], ["\u05e7", "E", "\u20ac"], ["\u05e8", "R"], ["\u05d0", "T"], ["\u05d8", "Y"], ["\u05d5", "U", "\u05f0"], ["\u05df", "I"], ["\u05dd", "O"], ["\u05e4", "P"], ["]", "}"], ["[", "{"]], + [["Caps", "Caps"], ["\u05e9", "A"], ["\u05d3", "S"], ["\u05d2", "D"], ["\u05db", "F"], ["\u05e2", "G"], ["\u05d9", "H", "\u05f2"], ["\u05d7", "J", "\u05f1"], ["\u05dc", "K"], ["\u05da", "L"], ["\u05e3", ":"], ["," , '"'], ["Enter", "Enter"]], + [["Shift", "Shift"], ["\u05d6", "Z"], ["\u05e1", "X"], ["\u05d1", "C"], ["\u05d4", "V"], ["\u05e0", "B"], ["\u05de", "N"], ["\u05e6", "M"], ["\u05ea", ">"], ["\u05e5", "<"], [".", "?"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Hungarian = [ // Hungarian Standard Keyboard + [["0", "\u00a7"], ["1", "'", "\u007e"], ["2", '"', "\u02c7"], ["3", "+", "\u02c6"], ["4", "!", "\u02d8"], ["5", "%", "\u00b0"], ["6", "/", "\u02db"], ["7", "=", "\u0060"], ["8", "(", "\u02d9"], ["9", ")", "\u00b4"], ["\u00f6", "\u00d6", "\u02dd"], ["\u00fc", "\u00dc", "\u00a8"], ["\u00f3", "\u00d3", "\u00b8"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q", "\u005c"], ["w", "W", "\u007c"], ["e", "E", "\u00c4"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U", "\u20ac"], ["i", "I", "\u00cd"], ["o", "O"], ["p", "P"], ["\u0151", "\u0150", "\u00f7"], ["\u00fa", "\u00da", "\u00d7"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A", "\u00e4"], ["s", "S","\u0111"], ["d", "D","\u0110"], ["f", "F","\u005b"], ["g", "G","\u005d"], ["h", "H"], ["j", "J","\u00ed"], ["k", "K","\u0141"], ["l", "L","\u0142"], ["\u00e9", "\u00c9","\u0024"], ["\u00e1", "\u00c1","\u00df"], ["\u0171", "\u0170","\u00a4"]], + [["Shift", "Shift"], ["\u00ed", "\u00cd","\u003c"], ["y", "Y","\u003e"], ["x", "X","\u0023"], ["c", "C","\u0026"], ["v", "V","\u0040"], ["b", "B","\u007b"], ["n", "N","\u007d"], ["m", "M","\u003c"], [",", "?","\u003b"], [".", ":","\u003e"], ["-", "_","\u002a"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Italian = [ // Italian Standard Keyboard + [["\u005c", "\u007c"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "&"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00ec", "\u005e"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e8", "\u00e9", "[", "{"], ["+", "*", "]", "}"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f2", "\u00e7", "@"], ["\u00e0", "\u00b0", "#"], ["\u00f9", "\u00a7"]], + [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Lithuanian = [ // Lithuanian Standard Keyboard + [["`", "~"], ["\u0105", "\u0104"], ["\u010D", "\u010C"], ["\u0119", "\u0118"], ["\u0117", "\u0116"], ["\u012F", "\u012E"], ["\u0161", "\u0160"], ["\u0173", "\u0172"], ["\u016B", "\u016A"], ["\u201E", "("], ["\u201C", ")"], ["-", "_"], ["\u017E", "\u017D"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["\\", "|"]], + [["Shift", "Shift"], ["\u2013", "\u20AC"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " "]] + ]; + + this.VKI_layout.Norwegian = [ // Norwegian Standard Keyboard + [["|", "\u00a7"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?"], ["\\", "`", "\u00b4"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f8", "\u00d8"], ["\u00e6", "\u00c6"], ["'", "*"]], + [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Numpad = [ // Number pad + [["$"], ["\u00a3"], ["\u20ac"], ["\u00a5"], ["/"], ["^"], ["Bksp", "Bksp"]], + [["."], ["7"], ["8"], ["9"], ["*"], ["<"], ["("], ["["]], + [["="], ["4"], ["5"], ["6"], ["-"], [">"], [")"], ["]"]], + [["0"], ["1"], ["2"], ["3"], ["+"], ["Enter", "Enter"]], + [[" "]] + ]; + this.VKI_layoutDDK.Numpad = true; + + this.VKI_layout["Polish Prog"] = [ // Polish Programmers Keyboard + [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u0119", "\u0118"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], + [["Caps", "Caps"], ["a", "A", "\u0105", "\u0104"], ["s", "S", "\u015b", "\u015a"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u0142", "\u0141"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], + [["Shift", "Shift"], ["z", "Z", "\u017c", "\u017b"], ["x", "X", "\u017a", "\u0179"], ["c", "C", "\u0107", "\u0106"], ["v", "V"], ["b", "B"], ["n", "N", "\u0144", "\u0143"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["Alt", "Alt"]] + ]; + + this.VKI_layout.Portuguese = [ // Portuguese Standard Keyboard + [["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00e7", "\u00c7"], [";", ":"], ["'", "@"], ["#", "~"]], + [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.Russian = [ // Russian Standard Keyboard + [["\u0451", "\u0401"], ["1", "!"], ["2", '"'], ["3", "\u2116"], ["4", ";"], ["5", "%"], ["6", ":"], ["7", "?"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044B", "\u042B"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["\\", "/"]], + [["Shift", "Shift"], ["/", "|"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], [".", ","], ["Shift", "Shift"]], + [[" ", " "]] + ]; + + this.VKI_layout.Slovenian = [ // Slovenian Standard Keyboard + [["\u00a8", "\u00a8", "\u00b8"], ["1", "!", "~"], ["2", '"', "\u02c7"], ["3", "#", "^"], ["4", "$", "\u02d8"], ["5", "%", "\u00b0"], ["6", "&", "\u02db"], ["7", "/", "\u0060"], ["8", "(", "\u00B7"], ["9", ")", "\u00b4"], ["0", "=", "\u2033"], ["'", "?", "\u00a8"], ["+", "*", "\u00b8"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W","|"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0161", "\u0160", "\u00f7"], ["\u0111", "\u0110", "\u00d7"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u010D", "\u010C"], ["\u0107", "\u0106", "\u00df"], ["\u017E", "\u017D", "\u00a4"]], + [["Shift", "Shift"], ["<", ">"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V", "@"], ["b", "B", "{",], ["n", "N", "}"], ["m", "M", "\u00a7"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout["Spanish-SP"] = [ // Spanish (Spain) Standard Keyboard + [["\u00ba", "\u00aa", "\\"], ["1", "!", "|"], ["2", '"', "@"], ["3", "'", "#"], ["4", "$", "~"], ["5", "%", "\u20ac"], ["6", "&","\u00ac"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00a1", "\u00bf"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0060", "^", "["], ["\u002b", "\u002a", "]"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f1", "\u00d1"], ["\u00b4", "\u00a8", "{"], ["\u00e7", "\u00c7", "}"]], + [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout["Turkish-F"] = [ // Turkish F Keyboard Layout + [['+', "*", "\u00ac"], ["1", "!", "\u00b9", "\u00a1"], ["2", '"', "\u00b2"], ["3", "^", "#", "\u00b3"], ["4", "$", "\u00bc", "\u00a4"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "'", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["/", "?", "\\", "\u00bf"], ["-", "_", "|"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["f", "F", "@"], ["g", "G"], ["\u011f", "\u011e"], ["\u0131", "\u0049", "\u00b6", "\u00ae"], ["o", "O"], ["d", "D", "\u00a5"], ["r", "R"], ["n", "N"], ["h", "H", "\u00f8", "\u00d8"], ["p", "P", "\u00a3"], ["q", "Q", "\u00a8"], ["w", "W", "~"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["u", "U", "\u00e6", "\u00c6"], ["i", "\u0130", "\u00df", "\u00a7"], ["e", "E", "\u20ac"], ["a", "A", " ", "\u00aa"], ["\u00fc", "\u00dc"], ["t", "T"], ["k", "K"], ["m", "M"], ["l", "L"], ["y", "Y", "\u00b4"], ["\u015f", "\u015e"], ["x", "X", "`"]], + [["Shift", "Shift"], ["<", ">", "|", "\u00a6"], ["j", "J", "\u00ab", "<"], ["\u00f6", "\u00d6", "\u00bb", ">"], ["v", "V", "\u00a2", "\u00a9"], ["c", "C"], ["\u00e7", "\u00c7"], ["z", "Z"], ["s", "S", "\u00b5", "\u00ba"], ["b", "B", "\u00d7"], [".", ":", "\u00f7"], [",", ";", "-"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout["Turkish-Q"] = [ // Turkish Q Keyboard Layout + [['"', "\u00e9", "<"], ["1", "!", ">"], ["2", "'", "\u00a3"], ["3", "^", "#"], ["4", "+", "$"], ["5", "%", "\u00bd"], ["6", "&"], ["7", "/", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["*", "?", "\\"], ["-", "_", "|"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q", "@"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["\u0131", "\u0049", "\u0069", "\u0130"], ["o", "O"], ["p", "P"], ["\u011f", "\u011e", "\u00a8"], ["\u00fc", "\u00dc", "~"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A", "\u00e6", "\u00c6"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u015f", "\u015e", "\u00b4"], ["\u0069", "\u0130"], [",", ";", "`"]], + [["Shift", "Shift"], ["<", ">", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], ["\u00f6", "\u00d6"], ["\u00e7", "\u00c7"], [".", ":"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.UK = [ // UK Standard Keyboard + [["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], + [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", "@"], ["#", "~"]], + [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["AltGr", "AltGr"]] + ]; + + this.VKI_layout.US = [ // US Standard Keyboard + [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], + [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], + [["Shift", "Shift"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], + [[" ", " "]] + ]; + + this.VKI_layout["US Int'l"] = [ // US International Keyboard + [["`", "~"], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], + [["Tab", "Tab"], ["q", "Q", "\u00e4", "\u00c4"], ["w", "W", "\u00e5", "\u00c5"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R", "\u00ae"], ["t", "T", "\u00fe", "\u00de"], ["y", "Y", "\u00fc", "\u00dc"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P", "\u00f6", "\u00d6"], ["[", "{", "\u00ab"], ["]", "}", "\u00bb"], ["\\", "|", "\u00ac", "\u00a6"]], + [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S", "\u00df", "\u00a7"], ["d", "D", "\u00f0", "\u00d0"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u00f8", "\u00d8"], [";", ":", "\u00b6", "\u00b0"], ["'", '"', "\u00b4", "\u00a8"], ["Enter", "Enter"]], + [["Shift", "Shift"], ["z", "Z", "\u00e6", "\u00c6"], ["x", "X"], ["c", "C", "\u00a9", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N", "\u00f1", "\u00d1"], ["m", "M", "\u00b5"], [",", "<", "\u00e7", "\u00c7"], [".", ">"], ["/", "?", "\u00bf"], ["Shift", "Shift"]], + [[" ", " ", " ", " "], ["Alt", "Alt"]] + ]; + + + /* ***** Define Dead Keys **************************************** */ + this.VKI_deadkey = new Object(); + + // - Lay out each dead key set in one row of sub-arrays. The rows + // below are wrapped so uppercase letters are below their lowercase + // equivalents. + // + // - The first letter in each sub-array is the letter pressed after + // the diacritic. The second letter is the letter this key-combo + // will generate. + // + // - Note that if you have created a new keyboard layout and want it + // included in the distributed script, PLEASE TELL ME if you have + // added additional dead keys to the ones below. + + this.VKI_deadkey['"'] = this.VKI_deadkey['\u00a8'] = [ // Umlaut / Diaeresis / Greek Dialytika + ["a", "\u00e4"], ["e", "\u00eb"], ["i", "\u00ef"], ["o", "\u00f6"], ["u", "\u00fc"], ["y", "\u00ff"], ["\u03b9", "\u03ca"], ["\u03c5", "\u03cb"], + ["A", "\u00c4"], ["E", "\u00cb"], ["I", "\u00cf"], ["O", "\u00d6"], ["U", "\u00dc"], ["Y", "\u0178"], ["\u0399", "\u03aa"], ["\u03a5", "\u03ab"] + ]; + this.VKI_deadkey['~'] = [ // Tilde + ["a", "\u00e3"], ["o", "\u00f5"], ["n", "\u00f1"], + ["A", "\u00c3"], ["O", "\u00d5"], ["N", "\u00d1"] + ]; + this.VKI_deadkey['^'] = [ // Circumflex + ["a", "\u00e2"], ["e", "\u00ea"], ["i", "\u00ee"], ["o", "\u00f4"], ["u", "\u00fb"], ["w", "\u0175"], ["y", "\u0177"], + ["A", "\u00c2"], ["E", "\u00ca"], ["I", "\u00ce"], ["O", "\u00d4"], ["U", "\u00db"], ["W", "\u0174"], ["Y", "\u0176"] + ]; + this.VKI_deadkey['\u02c7'] = [ // Baltic caron + ["c", "\u010D"], ["s", "\u0161"], ["z", "\u017E"], ["r", "\u0159"], ["d", "\u010f"], ["t", "\u0165"], ["n", "\u0148"], ["l", "\u013e"], ["e", "\u011b"], + ["C", "\u010C"], ["S", "\u0160"], ["Z", "\u017D"], ["R", "\u0158"], ["D", "\u010e"], ["T", "\u0164"], ["N", "\u0147"], ["L", "\u013d"], ["E", "\u011a"] + ]; + this.VKI_deadkey['\u02d8'] = [ // Romanian and Turkish breve + ["a", "\u0103"], ["g", "\u011f"], + ["A", "\u0102"], ["G", "\u011e"] + ]; + this.VKI_deadkey['`'] = [ // Grave + ["a", "\u00e0"], ["e", "\u00e8"], ["i", "\u00ec"], ["o", "\u00f2"], ["u", "\u00f9"], + ["A", "\u00c0"], ["E", "\u00c8"], ["I", "\u00cc"], ["O", "\u00d2"], ["U", "\u00d9"] + ]; + this.VKI_deadkey["'"] = this.VKI_deadkey['\u00b4'] = this.VKI_deadkey['\u0384'] = [ // Acute / Greek Tonos + ["a", "\u00e1"], ["e", "\u00e9"], ["i", "\u00ed"], ["o", "\u00f3"], ["u", "\u00fa"], ["\u03b1", "\u03ac"], ["\u03b5", "\u03ad"], ["\u03b7", "\u03ae"], ["\u03b9", "\u03af"], ["\u03bf", "\u03cc"], ["\u03c5", "\u03cd"], ["\u03c9", "\u03ce"], + ["A", "\u00c1"], ["E", "\u00c9"], ["I", "\u00cd"], ["O", "\u00d3"], ["U", "\u00da"], ["\u0391", "\u0386"], ["\u0395", "\u0388"], ["\u0397", "\u0389"], ["\u0399", "\u038a"], ["\u039f", "\u038c"], ["\u03a5", "\u038e"], ["\u03a9", "\u038f"] + ]; + this.VKI_deadkey['\u02dd'] = [ // Hungarian Double Acute Accent + ["o", "\u0151"], ["u", "\u0171"], + ["O", "\u0150"], ["U", "\u0170"] + ]; + this.VKI_deadkey["\u0385"] = [ // Greek Dialytika + Tonos + ["\u03b9", "\u0390"], ["\u03c5", "\u03b0"] + ]; + this.VKI_deadkey['\u00b0'] = this.VKI_deadkey['\u00ba'] = [ // Ring + ["a", "\u00e5"], + ["A", "\u00c5"] + ]; + + + + /* ***** Find tagged input & textarea elements ******************* */ + var inputElems = [ + document.getElementsByTagName('input'), + document.getElementsByTagName('textarea'), + ] + for (var x = 0, inputCount = 0, elem; elem = inputElems[x++];) { + if (elem) { + for (var y = 0, keyid = "", ex; ex = elem[y++];) { + if ((ex.nodeName == "TEXTAREA" || ex.type == "text" || ex.type == "password") && ex.className.indexOf("keyboardInput") > -1) { + if (!ex.id) { + do { keyid = 'keyboardInputInitiator' + inputCount++; } while (document.getElementById(keyid)); + ex.id = keyid; + } else keyid = ex.id; + var keybut = document.createElement('img'); + keybut.src = "res/images/keyboard.png"; + keybut.alt = "Keyboard interface"; + keybut.className = "keyboardInputInitiator"; + keybut.title = "Display graphical keyboard interface"; + //RANDOM: aggiunto self.VKI_buildKeys() per rigenerare 1 keyboard diversa ogni volta che si preme sulla png. + keybut.onclick = (function(a) { return function() { self.VKI_buildKeys(); self.VKI_show(a); }; })(keyid); + ex.parentNode.insertBefore(keybut, ex.nextSibling); + if (!window.sidebar && !window.opera) { + ex.onclick = ex.onkeyup = ex.onselect = function() { + if (self.VKI_target.createTextRange) self.VKI_range = document.selection.createRange(); + }; + } + } + } + } + } + + + /* ***** Build the keyboard interface **************************** */ + this.VKI_keyboard = document.createElement('table'); + this.VKI_keyboard.id = "keyboardInputMaster"; + this.VKI_keyboard.cellSpacing = this.VKI_keyboard.cellPadding = this.VKI_keyboard.border = "0"; + + var layouts = 0; + for (ktype in this.VKI_layout) if (typeof this.VKI_layout[ktype] == "object") layouts++; + + var thead = document.createElement('thead'); + var tr = document.createElement('tr'); + var th = document.createElement('th'); + if (layouts > 1) { + var kblist = document.createElement('select'); + for (ktype in this.VKI_layout) { + if (typeof this.VKI_layout[ktype] == "object") { + var opt = document.createElement('option'); + opt.value = ktype; + opt.appendChild(document.createTextNode(ktype)); + kblist.appendChild(opt); + } + } + kblist.value = this.VKI_kt; + kblist.onchange = function() { + self.VKI_kt = this.value; + self.VKI_buildKeys(); + self.VKI_position(); + }; + th.appendChild(kblist); + } + + var label = document.createElement('label'); + var checkbox = document.createElement('input'); + checkbox.type = "checkbox"; + checkbox.checked = this.VKI_deadkeysOn; + checkbox.title = "Toggle dead key input"; + checkbox.onclick = function() { + self.VKI_deadkeysOn = this.checked; + this.nextSibling.nodeValue = " Dead keys: " + ((this.checked) ? "On" : "Off"); + self.VKI_modify(""); + return true; + }; + label.appendChild(checkbox); + label.appendChild(document.createTextNode(" Dead keys: " + ((checkbox.checked) ? "On" : "Off"))) + th.appendChild(label); + tr.appendChild(th); + + var td = document.createElement('td'); + var clearer = document.createElement('span'); + clearer.id = "keyboardInputClear"; + clearer.appendChild(document.createTextNode("Clear")); + clearer.title = "Clear this input"; + clearer.onmousedown = function() { this.className = "pressed"; }; + clearer.onmouseup = function() { this.className = ""; }; + clearer.onclick = function() { + self.VKI_target.value = ""; + self.VKI_target.focus(); + return false; + }; + td.appendChild(clearer); + + var closer = document.createElement('span'); + closer.id = "keyboardInputClose"; + closer.appendChild(document.createTextNode('X')); + closer.title = "Close this window"; + closer.onmousedown = function() { this.className = "pressed"; }; + closer.onmouseup = function() { this.className = ""; }; + closer.onclick = function() { self.VKI_close(); }; + td.appendChild(closer); + + tr.appendChild(td); + thead.appendChild(tr); + this.VKI_keyboard.appendChild(thead); + + var tbody = document.createElement('tbody'); + var tr = document.createElement('tr'); + var td = document.createElement('td'); + td.colSpan = "2"; + var div = document.createElement('div'); + div.id = "keyboardInputLayout"; + td.appendChild(div); + var div = document.createElement('div'); + var ver = document.createElement('var'); + ver.appendChild(document.createTextNode("v" + this.VKI_version)); + div.appendChild(ver); + td.appendChild(div); + tr.appendChild(td); + tbody.appendChild(tr); + this.VKI_keyboard.appendChild(tbody); + + + + /* ***** Functions ************************************************ */ + /* ****************************************************************** + * Build or rebuild the keyboard keys + * + */ + this.VKI_buildKeys = function() { + this.VKI_shift = this.VKI_capslock = this.VKI_alternate = this.VKI_dead = false; + this.VKI_deadkeysOn = (this.VKI_layoutDDK[this.VKI_kt]) ? false : this.VKI_keyboard.getElementsByTagName('label')[0].getElementsByTagName('input')[0].checked; + + var container = this.VKI_keyboard.tBodies[0].getElementsByTagName('div')[0]; + while (container.firstChild) container.removeChild(container.firstChild); + + //RANDOM: + //l'array con le lettere e' un array di array. definisce 4 posizioni: alta bassa media e un altra, per ogni posizione c'e' un array di lettere. + //riordino l'array e pesco incrementalmente l'array con il nuovo ordine modificato. totale 4 righe. + + //funzione per riordinare un array + function randOrd(){ + return (Math.round(Math.random())-0.5); + } + + //misto l'array di posizioni + this.VKI_layout[this.VKI_kt].sort( randOrd ); + + for (var x = 0, hasDeadKey = false, lyt; lyt = this.VKI_layout[this.VKI_kt][x++];) { + //misto l'array di lettere + lyt.sort( randOrd ); + var table = document.createElement('table'); + table.cellSpacing = table.cellPadding = table.border = "0"; + if (lyt.length <= this.VKI_keyCenter) table.className = "keyboardInputCenter"; + var tbody = document.createElement('tbody'); + var tr = document.createElement('tr'); + for (var y = 0, lkey; lkey = lyt[y++];) { + if (!this.VKI_layoutDDK[this.VKI_kt] && !hasDeadKey) + for (var z = 0; z < lkey.length; z++) + if (this.VKI_deadkey[lkey[z]]) hasDeadKey = true; + + var td = document.createElement('td'); + td.appendChild(document.createTextNode(lkey[0])); + + var alive = false; + if (this.VKI_deadkeysOn) for (key in this.VKI_deadkey) if (key === lkey[0]) alive = true; + td.className = (alive) ? "alive" : ""; + if (lyt.length > this.VKI_keyCenter && y == lyt.length) + td.className += " last"; + + if (lkey[0] == " ") + td.style.paddingLeft = td.style.paddingRight = "50px"; + td.onmouseover = function() { if (this.className != "dead" && this.firstChild.nodeValue != "\xa0") this.className += " hover"; }; + td.onmouseout = function() { if (this.className != "dead") this.className = this.className.replace(/ ?(hover|pressed)/g, ""); }; + td.onmousedown = function() { if (this.className != "dead" && this.firstChild.nodeValue != "\xa0") this.className += " pressed"; }; + td.onmouseup = function() { if (this.className != "dead") this.className = this.className.replace(/ ?pressed/g, ""); }; + td.ondblclick = function() { return false; }; + + switch (lkey[1]) { + case "Caps": + case "Shift": + case "Alt": + case "AltGr": + td.onclick = (function(type) { return function() { self.VKI_modify(type); return false; }})(lkey[1]); + break; + case "Tab": + td.onclick = function() { self.VKI_insert("\t"); return false; }; + break; + case "Bksp": + td.onclick = function() { + self.VKI_target.focus(); + if (self.VKI_target.setSelectionRange) { + var srt = self.VKI_target.selectionStart; + var len = self.VKI_target.selectionEnd; + if (srt < len) srt++; + self.VKI_target.value = self.VKI_target.value.substr(0, srt - 1) + self.VKI_target.value.substr(len); + self.VKI_target.setSelectionRange(srt - 1, srt - 1); + } else if (self.VKI_target.createTextRange) { + try { self.VKI_range.select(); } catch(e) {} + self.VKI_range = document.selection.createRange(); + if (!self.VKI_range.text.length) self.VKI_range.moveStart('character', -1); + self.VKI_range.text = ""; + } else self.VKI_target.value = self.VKI_target.value.substr(0, self.VKI_target.value.length - 1); + if (self.VKI_shift) self.VKI_modify("Shift"); + if (self.VKI_alternate) self.VKI_modify("AltGr"); + return true; + }; + break; + case "Enter": + td.onclick = function() { + if (self.VKI_target.nodeName == "TEXTAREA") { self.VKI_insert("\n"); } else self.VKI_close(); + return true; + }; + break; + default: + td.onclick = function() { + if (self.VKI_deadkeysOn && self.VKI_dead) { + if (self.VKI_dead != this.firstChild.nodeValue) { + for (key in self.VKI_deadkey) { + if (key == self.VKI_dead) { + if (this.firstChild.nodeValue != " ") { + for (var z = 0, rezzed = false, dk; dk = self.VKI_deadkey[key][z++];) { + if (dk[0] == this.firstChild.nodeValue) { + self.VKI_insert(dk[1]); + rezzed = true; + break; + } + } + } else { + self.VKI_insert(self.VKI_dead); + rezzed = true; + } + break; + } + } + } else rezzed = true; + } + self.VKI_dead = false; + + if (!rezzed && this.firstChild.nodeValue != "\xa0") { + if (self.VKI_deadkeysOn) { + for (key in self.VKI_deadkey) { + if (key == this.firstChild.nodeValue) { + self.VKI_dead = key; + this.className = "dead"; + if (self.VKI_shift) self.VKI_modify("Shift"); + if (self.VKI_alternate) self.VKI_modify("AltGr"); + break; + } + } + if (!self.VKI_dead) self.VKI_insert(this.firstChild.nodeValue); + } else self.VKI_insert(this.firstChild.nodeValue); + } + + self.VKI_modify(""); + return false; + }; + + } + tr.appendChild(td); + tbody.appendChild(tr); + table.appendChild(tbody); + + for (var z = lkey.length; z < 4; z++) lkey[z] = "\xa0"; + } + container.appendChild(table); + } + this.VKI_keyboard.getElementsByTagName('label')[0].style.display = (hasDeadKey) ? "inline" : "none"; + }; + + this.VKI_buildKeys(); + VKI_disableSelection(this.VKI_keyboard); + + + /* ****************************************************************** + * Controls modifier keys + * + */ + this.VKI_modify = function(type) { + switch (type) { + case "Alt": + case "AltGr": this.VKI_alternate = !this.VKI_alternate; break; + case "Caps": this.VKI_capslock = !this.VKI_capslock; break; + case "Shift": this.VKI_shift = !this.VKI_shift; break; + } + var vchar = 0; + if (!this.VKI_shift != !this.VKI_capslock) vchar += 1; + + var tables = this.VKI_keyboard.getElementsByTagName('table'); + for (var x = 0; x < tables.length; x++) { + var tds = tables[x].getElementsByTagName('td'); + for (var y = 0; y < tds.length; y++) { + var dead = alive = target = false; + var lkey = this.VKI_layout[this.VKI_kt][x][y]; + + switch (lkey[1]) { + case "Alt": + case "AltGr": + if (this.VKI_alternate) dead = true; + break; + case "Shift": + if (this.VKI_shift) dead = true; + break; + case "Caps": + if (this.VKI_capslock) dead = true; + break; + case "Tab": case "Enter": case "Bksp": break; + default: + if (type) tds[y].firstChild.nodeValue = lkey[vchar + ((this.VKI_alternate && lkey.length == 4) ? 2 : 0)]; + if (this.VKI_deadkeysOn) { + var char = tds[y].firstChild.nodeValue; + if (this.VKI_dead) { + if (char == this.VKI_dead) dead = true; + for (var z = 0; z < this.VKI_deadkey[this.VKI_dead].length; z++) + if (char == this.VKI_deadkey[this.VKI_dead][z][0]) { target = true; break; } + } + for (key in this.VKI_deadkey) if (key === char) { alive = true; break; } + } + } + + tds[y].className = (dead) ? "dead" : ((target) ? "target" : ((alive) ? "alive" : "")); + if (y == tds.length - 1 && tds.length > this.VKI_keyCenter) tds[y].className += " last"; + } + } + this.VKI_target.focus(); + }; + + + /* ****************************************************************** + * Insert text at the cursor + * + */ + this.VKI_insert = function(text) { + this.VKI_target.focus(); + if (this.VKI_target.setSelectionRange) { + var srt = this.VKI_target.selectionStart; + var len = this.VKI_target.selectionEnd; + this.VKI_target.value = this.VKI_target.value.substr(0, srt) + text + this.VKI_target.value.substr(len); + if (text == "\n" && window.opera) srt++; + this.VKI_target.setSelectionRange(srt + text.length, srt + text.length); + } else if (this.VKI_target.createTextRange) { + try { this.VKI_range.select(); } catch(e) {} + this.VKI_range = document.selection.createRange(); + this.VKI_range.text = text; + this.VKI_range.collapse(true); + this.VKI_range.select(); + } else this.VKI_target.value += text; + if (this.VKI_shift) this.VKI_modify("Shift"); + if (this.VKI_alternate) this.VKI_modify("AltGr"); + this.VKI_target.focus(); + }; + + + /* ****************************************************************** + * Show the keyboard interface + * + */ + this.VKI_show = function(id) { + if (this.VKI_target = document.getElementById(id)) { + if (this.VKI_visible != id) { + this.VKI_range = ""; + try { this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard); } catch (e) {} + + var elem = this.VKI_target; + this.VKI_target.keyboardPosition = "absolute"; + do { + if (VKI_getStyle(elem, "position") == "fixed") { + this.VKI_target.keyboardPosition = "fixed"; + break; + } + } while (elem = elem.offsetParent); + + this.VKI_keyboard.style.top = this.VKI_keyboard.style.right = this.VKI_keyboard.style.bottom = this.VKI_keyboard.style.left = "auto"; + this.VKI_keyboard.style.position = this.VKI_target.keyboardPosition; + document.body.appendChild(this.VKI_keyboard); + + this.VKI_visible = this.VKI_target.id; + this.VKI_position(); + this.VKI_target.focus(); + } else this.VKI_close(); + } + }; + + + /* ****************************************************************** + * Position the keyboard + * + */ + this.VKI_position = function() { + if (self.VKI_visible != "") { + var inputElemPos = VKI_findPos(self.VKI_target); + self.VKI_keyboard.style.top = inputElemPos[1] - ((self.VKI_target.keyboardPosition == "fixed") ? document.body.scrollTop : 0) + self.VKI_target.offsetHeight + 3 + "px"; + self.VKI_keyboard.style.left = Math.min(VKI_innerDimensions()[0] - self.VKI_keyboard.offsetWidth - 15, inputElemPos[0]) + "px"; + } + }; + + + if (window.addEventListener) { + window.addEventListener('resize', this.VKI_position, false); + } else if (window.attachEvent) + window.attachEvent('onresize', this.VKI_position); + + + /* ****************************************************************** + * Close the keyboard interface + * + */ + this.VKI_close = function() { + try { this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard); } catch (e) {} + this.VKI_visible = ""; + this.VKI_target.focus(); + this.VKI_target = ""; + }; +} + + +/* ***** Attach this script to the onload event ******************** */ +if (window.addEventListener) { + window.addEventListener('load', VKI_buildKeyboardInputs, false); +} else if (window.attachEvent) + window.attachEvent('onload', VKI_buildKeyboardInputs); + + +function VKI_findPos(obj) { + var curleft = curtop = 0; + do { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + } while (obj = obj.offsetParent); + return [curleft, curtop]; +} + +function VKI_innerDimensions() { + if (self.innerHeight) { + return [self.innerWidth, self.innerHeight]; + } else if (document.documentElement && document.documentElement.clientHeight) { + return [document.documentElement.clientWidth, document.documentElement.clientHeight]; + } else if (document.body) + return [document.body.clientWidth, document.body.clientHeight]; + return [0, 0]; +} + +function VKI_getStyle(obj, styleProp) { + if (obj.currentStyle) { + var y = obj.currentStyle[styleProp]; + } else if (window.getComputedStyle) + var y = window.getComputedStyle(obj, null)[styleProp]; + return y; +} + +function VKI_disableSelection(elem) { + elem.onselectstart = function() { return false; }; + elem.unselectable = "on"; + elem.style.MozUserSelect = "none"; + elem.style.cursor = "default"; + if (window.opera) elem.onmousedown = function() { return false; }; +} diff --git a/res/js/pwdStrength.js b/res/js/pwdStrength.js new file mode 100644 index 0000000..e803f68 --- /dev/null +++ b/res/js/pwdStrength.js @@ -0,0 +1,215 @@ + +/* ************************************************************ +Created: 20060120 +Author: Steve Moitozo +Description: This is a quick and dirty password quality meter + written in JavaScript +License: MIT License (see below) +================================= +Revision Author: Dick Ervasti (dick dot ervasti at quty dot com) +Revision Description: Exchanged text based prompts for a graphic thermometer +================================= +Revision Author: Jay Bigam jayb tearupyourlawn com +Revision Date: Feb. 26, 2007 +Revision Description: Changed D. Ervasti's table based "thermometer" to CSS. +Revision Notes: - Verified to work in FF2, IE7 and Safari2 + - Modified messages to reflect Minimum strength requirement + - Added formSubmit button disabled until minimum requirement met +================================= +Modified: 20061111 - Steve Moitozo corrected regex for letters and numbers + Thanks to Zack Smith -- zacksmithdesign.com + and put MIT License back in + +--------------------------------------------------------------- +Copyright (c) 2006 Steve Moitozo + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + + The above copyright notice and this permission notice shall +be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE +AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------------- + + + + + + +
    + Password Strength:
    + + + Minimum Strength Not Met +
    + + + + +=================================== +Password Strength Factors and Weightings + +password length: +level 0 (3 point): less than 4 characters +level 1 (6 points): between 5 and 7 characters +level 2 (12 points): between 8 and 15 characters +level 3 (18 points): 16 or more characters + +letters: +level 0 (0 points): no letters +level 1 (5 points): all letters are lower case +level 2 (7 points): letters are mixed case + +numbers: +level 0 (0 points): no numbers exist +level 1 (5 points): one number exists +level 1 (7 points): 3 or more numbers exists + +special characters: +level 0 (0 points): no special characters +level 1 (5 points): one special character exists +level 2 (10 points): more than one special character exists + +combinatons: +level 0 (1 points): letters and numbers exist +level 1 (1 points): mixed case letters +level 1 (2 points): letters, numbers and special characters + exist +level 1 (2 points): mixed case letters, numbers and special + characters exist + + +************************************************************ */ +function testPassword(passwd) +{ + var intScore = 0 + var strVerdict = 0 + + // PASSWORD LENGTH + if (passwd.length==0 || !passwd.length) // length 0 + { + intScore = -1 + } + else if (passwd.length>0 && passwd.length<7) // LENGTH BETWEEN 1 AND 6 + { + intScore = (intScore+4) + } + else if (passwd.length>6 && passwd.length<12) // length between 7 and 11 + { + intScore = (intScore+10) + } + else if (passwd.length>11) // length 16 or more + { + intScore = (intScore+18) + } + + + // LETTERS (Not exactly implemented as dictacted above because of my limited understanding of Regex) + if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter + { + intScore = (intScore+1) + } + + if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter + { + intScore = (intScore+3) + } + + // NUMBERS + if (passwd.match(/\d+/)) // [verified] at least one number + { + intScore = (intScore+3) + } + + if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/)) // [verified] at least three numbers + { + intScore = (intScore+5) + } + + + // SPECIAL CHAR + if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)) // [verified] at least one special character + { + intScore = (intScore+5) + } + + // [verified] at least two special characters + if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) + { + intScore = (intScore+5) + } + + + // COMBOS + if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) // [verified] both upper and lower case + { + intScore = (intScore+2) + } + + if (passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/)) // [verified] both letters and numbers + { + intScore = (intScore+2) + } + + // [verified] letters, numbers, and special characters + if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)) + { + intScore = (intScore+2) + } + + //css settings per score + if(intScore < 16) { + textColor = 'red'; + formDisable = false; + } else if(intScore < 23) { + textColor = 'yellow'; + formDisable = false; + } else if (intScore < 35) { + strVerdict = "Mediocre"; + textColor = 'yellow'; + formDisable = false; + } else if (intScore < 45) { + textColor = 'green'; + formDisable = false; + } else { + textColor = 'green'; + formDisable = false; + } + + var img_pos='res/images/'; + var tl='traffic_lights_'; + var def_tlc=tl+'grey'; + if(textColor == 'green'){ + c1='red'; + c2='yellow'; + } else if(textColor =='yellow') { + c1='red'; + c2='green'; + } else { + c1='yellow'; + c2='green'; + } + + var tlc=tl + textColor; + //applying css settings + document.getElementById(tl+c1).setAttribute('src',img_pos + def_tlc +'.png'); + document.getElementById(tl+c2).setAttribute('src',img_pos + def_tlc +'.png'); + document.getElementById(tlc).setAttribute('src',img_pos + tlc + '.png'); + document.getElementById("nuovapassword").style.borderColor = textColor; + document.getElementById("formSubmit").disabled = formDisable; +} diff --git a/res/js/visibility.js b/res/js/visibility.js new file mode 100644 index 0000000..7b05bcb --- /dev/null +++ b/res/js/visibility.js @@ -0,0 +1,55 @@ +function changeDisplay(id) +{ + var visibility = document.getElementById(id).style.display; + if (visibility == 'none') + document.getElementById(id).style.display = 'block'; + else + document.getElementById(id).style.display = 'none'; + +} + +function setDisplay(id,value) +{ + document.getElementById(id).style.display = value; +} + +/*function getElementsByClassName(cl) { + var retnode = []; + var myclass = new RegExp('\\b'+cl+'\\b'); + var elem = document.getElementsByTagName('*'); + for (var i = 0; i < elem.length; i++) { + var classes = elem[i].className; + if (myclass.test(classes)) + retnode.push(elem[i]); + } + return retnode; +}*/ + +function imgExpandOrCollapse(id) { + var word = "collapse"; + var from="expand"; + var to=word; + + var imgDest = document.getElementById(id); + var path = imgDest.getAttribute("src"); + if (path.indexOf(word) != -1) { + to=from; + from=word; + } + + imgDest.setAttribute("src", path.replace(from,to)); +} + +function changeTableVisibility(id) +{ + var tbody = document.getElementById(id); + var elem = tbody.getElementsByTagName('tr'); + var visibility = elem[0].style.visibility; + var value = 'collapse'; + + if (visibility == 'collapse') + value = 'visible'; + + for (var i = 0; i < elem.length; i++) + elem[i].style.visibility = value; +} diff --git a/res/locale/en_US/LC_MESSAGES/messages.mo b/res/locale/en_US/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..37c6914 Binary files /dev/null and b/res/locale/en_US/LC_MESSAGES/messages.mo differ diff --git a/res/locale/eo_EO/LC_MESSAGES/messages.mo b/res/locale/eo_EO/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..a062372 Binary files /dev/null and b/res/locale/eo_EO/LC_MESSAGES/messages.mo differ diff --git a/res/locale/it_IT/LC_MESSAGES/messages.mo b/res/locale/it_IT/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..0c02f7d Binary files /dev/null and b/res/locale/it_IT/LC_MESSAGES/messages.mo differ diff --git a/res/locale/it_IT/LC_MESSAGES/messages.po b/res/locale/it_IT/LC_MESSAGES/messages.po new file mode 100644 index 0000000..1898458 --- /dev/null +++ b/res/locale/it_IT/LC_MESSAGES/messages.po @@ -0,0 +1,94 @@ +# BSD LICENCE +# This file is distributed under the same license as the iNDivia-chpw-0.1 package. +# gin(e) , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: iNDivia-chpw-0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-02-22 17:10+0100\n" +"PO-Revision-Date: 2012-02-22 15:56+0100\n" +"Last-Translator: \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: template.php:13 +#, php-format +msgid "Tool to change %s password" +msgstr "Accrocchio per cambiare le password degli %s" + +#: template.php:30 +#, php-format +msgid "Change your %s account password" +msgstr "Cambia la password del tuo account %s" + +#: template.php:58 +#, php-format +msgid "%s:" +msgstr "" + +#: template.php:64 +msgid "Old password:" +msgstr "Vecchia password:" + +#: template.php:67 +msgid "New password:" +msgstr "Nuova password:" + +#: template.php:73 +msgid "Retype:" +msgstr "Conferma:" + +#: template.php:92 +msgid "How to chose a password" +msgstr "Come scegliere una buona password" + +#: template.php:104 +#, php-format +msgid "%s" +msgstr "" + +#: var.php:3 +msgid "Mount" +msgstr "" + +#: var.php:5 +msgid "User" +msgstr "Utente" + +#: var.php:7 +msgid "E-mail" +msgstr "" + +#: var.php:9 +msgid "Admin password:" +msgstr "Vecchia password:" + +#: var.php:10 +msgid "Password modified correctly." +msgstr "Password modificata correttamente." + +#: var.php:11 +msgid "Password modification failed. Make sure you are typing your data correctly and retry." +msgstr "Modifica fallita. Forse hai scritto male i dati, riprova." + +#: var.php:12 +msgid "Password mismatch, please try again." +msgstr "Le password non corrispondono" + +#: var.php:13 +msgid "Note: a password shorter than 8 chars is bad!" +msgstr "Note: una password più corta di 8 caratteri e' bad!" + +#: var.php:14 +msgid "" +"Service offline for maintenance. We will come back soon, in case of problem " +"write to gestione@posta.indivia.net or visit ortiches blog." +msgstr "Servizio offline per manutenzione. Per necessita' scrivete a gestione@posta.indivia.net o visitate il blog." + +#: var.php:15 +msgid "How to chose my password" +msgstr "Come scegliere una buona password" diff --git a/res/locale/messages.pot b/res/locale/messages.pot new file mode 100644 index 0000000..3430e7a --- /dev/null +++ b/res/locale/messages.pot @@ -0,0 +1,94 @@ +# BSD LICENCE +# This file is distributed under the same license as the iNDivia-chpw-0.1 package. +# gin(e) , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: iNDivia-chpw-0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-02-22 17:10+0100\n" +"PO-Revision-Date: 2012-02-22 15:56+0100\n" +"Last-Translator: \n" +"Language-Team: iNDivia \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: template.php:13 +#, php-format +msgid "Tool to change %s password" +msgstr "" + +#: template.php:30 +#, php-format +msgid "Change your %s account password" +msgstr "" + +#: template.php:58 +#, php-format +msgid "%s:" +msgstr "" + +#: template.php:64 +msgid "Old password:" +msgstr "" + +#: template.php:67 +msgid "New password:" +msgstr "" + +#: template.php:73 +msgid "Retype:" +msgstr "" + +#: template.php:92 +msgid "How to chose a password" +msgstr "" + +#: template.php:104 +#, php-format +msgid "%s" +msgstr "" + +#: var.php:3 +msgid "Mount" +msgstr "" + +#: var.php:5 +msgid "User" +msgstr "" + +#: var.php:7 +msgid "E-mail" +msgstr "" + +#: var.php:9 +msgid "Admin password:" +msgstr "" + +#: var.php:10 +msgid "Password modified correctly." +msgstr "" + +#: var.php:11 +msgid "Password modification failed. Make sure you are typing your data correctly and retry." +msgstr "" + +#: var.php:12 +msgid "Password mismatch, please try again." +msgstr "" + +#: var.php:13 +msgid "Note: a password shorter than 8 chars is bad!" +msgstr "" + +#: var.php:14 +msgid "" +"Service offline for maintenance. We will come back soon, in case of problem " +"write to gestione@posta.indivia.net or visit ortiches blog." +msgstr "" + +#: var.php:15 +msgid "How to chose my password" +msgstr ""