Commit new folders which were not uploaded in the previous commit
diff --git a/css/options.css b/css/options.css
new file mode 100644
index 0000000..216e656
--- /dev/null
+++ b/css/options.css
@@ -0,0 +1,103 @@
+@import url("widgets.css");
+
+body {
+ padding: 10px;
+ font-family: "Roboto", "Arial", sans-serif!important;
+ background-color: #BBDEFB;
+ background-repeat: repeat;
+ background-position: left top;
+ font-size: 100%;
+ cursor: default;
+}
+h1 {
+ text-align: center;
+ font-size: 30px;
+}
+h2 {
+ font-size: 20px;
+}
+#languages_container {
+ width: 300px;
+ height: 365px;
+ border: 1px solid #ccc;
+ background-color: #E3F2FD;
+}
+#languages {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+#languages li {
+ padding: 15px;
+ border-bottom: 1px dashed #ddd;
+ background-color: #EEF7FD;
+ cursor: move;
+ -webkit-user-select: none;
+}
+#languages li.sortable-ghost {
+ background-color: #E3F2FD;
+}
+#languages li .delete {
+ font-size: 14px;
+ float: right;
+ cursor: pointer;
+ color: red;
+}
+#languages_footer {
+ width: 300px;
+ height: 35px;
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-top: 0;
+}
+button, input, select, option {
+ font-size: 13px!important;
+}
+#languages_add {
+ margin-left: 4px;
+ margin-top: 4px;
+}
+#save {
+ display: block;
+ margin: 18px auto;
+}
+
+/* Dialog */
+dialog {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ margin-left: -216px;
+ margin-top: -91px;
+ height: 150px;
+ width: 400px;
+ border: 1px solid rgba(0, 0, 0, 0.3);
+ border-radius: 6px;
+ box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+}
+
+dialog h3 {
+ margin-bottom: 10px;
+}
+
+dialog #language_label {
+ font-size: 12px;
+}
+
+dialog select {
+ width: 100%;
+}
+
+dialog .action_buttons {
+ margin-top: 10px;
+ float: right;
+}
+
+dialog::backdrop {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+}
\ No newline at end of file
diff --git a/css/widgets.css b/css/widgets.css
new file mode 100644
index 0000000..c988a27
--- /dev/null
+++ b/css/widgets.css
@@ -0,0 +1,304 @@
+/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in https://chromium.googlesource.com/chromium/src/+/master/LICENSE */
+
+/* This file defines styles for form controls. The order of rule blocks is
+ * important as there are some rules with equal specificity that rely on order
+ * as a tiebreaker. These are marked with OVERRIDE. */
+
+/* Default state **************************************************************/
+
+:-webkit-any(button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button),
+select,
+input[type='checkbox'],
+input[type='radio'] {
+ -webkit-appearance: none;
+ -webkit-user-select: none;
+ background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
+ border: 1px solid rgba(0, 0, 0, 0.25);
+ border-radius: 2px;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
+ inset 0 1px 2px rgba(255, 255, 255, 0.75);
+ color: #444;
+ font: inherit;
+ margin: 0 1px 0 0;
+ outline: none;
+ text-shadow: 0 1px 0 rgb(240, 240, 240);
+}
+
+:-webkit-any(button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button),
+select {
+ min-height: 2em;
+ min-width: 4em;
+
+}
+
+:-webkit-any(button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button) {
+ -webkit-padding-end: 10px;
+ -webkit-padding-start: 10px;
+}
+
+select {
+ -webkit-appearance: none;
+ -webkit-padding-end: 20px;
+ -webkit-padding-start: 6px;
+ /* OVERRIDE */
+ background-image: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ngoX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJggg==') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAQCAQAAAA/1a6rAAAAQUlEQVR4Xu3MsQnAMBAEMI1+myf9gw0+3ASCenmu+mQn2yGn3S4Mp906DEW3CEPfzTD03QxD380w3OmIUHe9v+u9QwAt93yns5cAAAAASUVORK5CYII=') 2x),
+ -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
+ background-position: right center;
+ background-repeat: no-repeat;
+}
+
+html[dir='rtl'] select {
+ background-position: center left;
+}
+
+input[type='checkbox'] {
+
+bottom: 2px;
+ height: 13px;
+ position: relative;
+ vertical-align: middle;
+ width: 13px;
+}
+
+input[type='radio'] {
+ /* OVERRIDE */
+ border-radius: 100%;
+ bottom: 1px;
+ height: 15px;
+ position: relative;
+ vertical-align: middle;
+ width: 15px;
+}
+
+/* TODO(estade): add more types here? */
+input[type='number'],
+input[type='password'],
+input[type='search'],
+input[type='text'],
+input[type='url'],
+input:not([type]),
+textarea {
+ border: 1px solid #bfbfbf;
+ border-radius: 2px;
+ box-sizing: border-box;
+ color: #444;
+ font: inherit;
+ margin: 0;
+ /* Use min-height to accommodate addditional padding for touch as needed. */
+ min-height: 2em;
+ padding: 3px;
+ outline: none;
+/* For better alignment between adjacent buttons and inputs. */
+ padding-bottom: 4px;
+}
+
+input[type='search'] {
+ -webkit-appearance: textfield;
+ /* NOTE: Keep a relatively high min-width for this so we don't obscure the end
+ * of the default text in relatively spacious languages (i.e. German). */
+ min-width: 160px;
+}
+
+/* Remove when https://bugs.webkit.org/show_bug.cgi?id=51499 is fixed.
+ * TODO(dbeam): are there more types that would benefit from this? */
+input[type='search']::-webkit-textfield-decoration-container {
+ direction: inherit;
+}
+
+/* Checked ********************************************************************/
+
+input[type='checkbox']:checked::before {
+ -webkit-user-select: none;
+ background-image: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAQAAAADpb+tAAAAaElEQVR4Xl3PIQoCQQCF4Y8JW42D1bDZ4iVEjDbxFpstYhC7eIVBZHkXFGw734sv/TqDQQ8Xb1udja/I8igeIm7Aygj2IpoKTGZnVRNxAHYi4iPiDlA9xX+aNQDFySziqDN6uSp6y7ofEMwZ05uUZRkAAAAASUVORK5CYII=') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAQAAABuvaSwAAAAvElEQVR4XrXPMUrDYBzG4UeRZnAQnFxq3XT3AsVABm8QPIHQIeAJuoqb2s1BcHAIin4HVLqEvx9NQgb5rc/wvn4mNBUbqlKDcezCp6Qexxx7lbapx/CBe6mrHsYrKXQ7hKtIre1nOD/W9eiQiK80inis680JEc+1kien+TEfzom4sJG2aZXxmG9LIqaRerohx6V2J72zl2NY2OTUgxm7MEU25sURfZg4590Zw5iFZ8mXS0ZwN+eaPjyh/8O/H7bzPJ5NOo0AAAAASUVORK5CYII=') 2x);
+ background-size: 100% 100%;
+ content: '';
+ display: block;
+ height: 100%;
+ width: 100%;
+}
+
+input[type='radio']:checked::before {
+ background-color: #666;
+ border-radius: 100%;
+ bottom: 3px;
+ content: '';
+ display: block;
+ left: 3px;
+ position: absolute;
+ right: 3px;
+ top: 3px;
+}
+
+/* Hover **********************************************************************/
+
+:enabled:hover:-webkit-any(
+ select,
+ input[type='checkbox'],
+ input[type='radio'],
+ :-webkit-any(
+ button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button)) {
+ background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
+ border-color: rgba(0, 0, 0, 0.3);
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
+ inset 0 1px 2px rgba(255, 255, 255, 0.95);
+ color: black;
+}
+
+:enabled:hover:-webkit-any(select) {
+ /* OVERRIDE */
+ background-image: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ngoX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJggg==') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAQCAQAAAA/1a6rAAAAQUlEQVR4Xu3MsQnAMBAEMI1+myf9gw0+3ASCenmu+mQn2yGn3S4Mp906DEW3CEPfzTD03QxD380w3OmIUHe9v+u9QwAt93yns5cAAAAASUVORK5CYII=') 2x),
+ -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
+}
+
+/* Active *********************************************************************/
+
+:enabled:active:-webkit-any(
+ select,
+ input[type='checkbox'],
+ input[type='radio'],
+ :-webkit-any(
+ button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button)) {
+ background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
+ box-shadow: none;
+ text-shadow: none;
+}
+
+:enabled:active:-webkit-any(select) {
+ /* OVERRIDE */
+ background-image: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ngoX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJggg==') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAQCAQAAAA/1a6rAAAAQUlEQVR4Xu3MsQnAMBAEMI1+myf9gw0+3ASCenmu+mQn2yGn3S4Mp906DEW3CEPfzTD03QxD380w3OmIUHe9v+u9QwAt93yns5cAAAAASUVORK5CYII=') 2x),
+ -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
+}
+
+/* Disabled *******************************************************************/
+
+:disabled:-webkit-any(
+ button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button),
+select:disabled {
+ background-image: -webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
+ border-color: rgba(80, 80, 80, 0.2);
+ box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
+ inset 0 1px 2px rgba(255, 255, 255, 0.75);
+ color: #aaa;
+}
+
+select:disabled {
+ /* OVERRIDE */
+ background-image: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAASklEQVQY02P4z0AMRGZGMaShwCisyhITG/4jw8RErMr+KyxYiFC0YOF/BeyWIikEKWLA4Ta4QogiPMpACt82QRThVQYUYYWz4BAAGr6Ii6kEPacAAAAASUVORK5CYII=') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAQCAQAAADQF8WVAAAARElEQVR4Xu3MsQ0AIAwEsYx+m4fySsgLOuTe1Re9z4De4DzbdVDnmZ0ENcrsZJVkdoIKMzurMLOzSjNhlWfCapBlfpZbeMFeGdxKIEQAAAAASUVORK5CYII=') 2x),
+ -webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
+}
+
+input:disabled:-webkit-any([type='checkbox'],
+ [type='radio']) {
+ opacity: .75;
+}
+
+input:disabled:-webkit-any([type='password'],
+ [type='search'],
+ [type='text'],
+ [type='url'],
+ :not([type])) {
+ color: #999;
+}
+
+/* Focus **********************************************************************/
+
+:enabled:focus:-webkit-any(
+ select,
+ input[type='checkbox'],
+ input[type='number'],
+ input[type='password'],
+ input[type='radio'],
+ input[type='search'],
+ input[type='text'],
+ input[type='url'],
+ input:not([type]),
+ :-webkit-any(
+ button,
+ input[type='button'],
+ input[type='submit']):not(.custom-appearance):not(.link-button)) {
+ /* OVERRIDE */
+ -webkit-transition: border-color 200ms;
+ /* We use border color because it follows the border radius (unlike outline).
+ * This is particularly noticeable on mac. */
+ border-color: rgb(77, 144, 254);
+ outline: none;
+}
+
+/* Link buttons ***************************************************************/
+
+.link-button {
+ -webkit-box-shadow: none;
+ background: transparent none;
+ border: none;
+ color: rgb(17, 85, 204);
+ cursor: pointer;
+ /* Input elements have -webkit-small-control which can override the body font.
+ * Resolve this by using 'inherit'. */
+ font: inherit;
+ margin: 0;
+ padding: 0;
+}
+
+.link-button:hover {
+ text-decoration: underline;
+}
+
+.link-button:active {
+ color: rgb(5, 37, 119);
+ text-decoration: underline;
+}
+
+.link-button[disabled] {
+ color: #999;
+ cursor: default;
+ text-decoration: none;
+}
+
+/* Checkbox/radio helpers ******************************************************
+ *
+ * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
+ * these classes with the markup structure:
+ *
+ * <div class="checkbox">
+ * <label>
+ * <input type="checkbox"></input>
+ * <span>
+ * </label>
+ * </div>
+ */
+
+:-webkit-any(.checkbox, .radio) label {
+ /* Don't expand horizontally: <http://crbug.com/112091>. */
+ display: -webkit-inline-box;
+ padding-bottom: 7px;
+ padding-top: 7px;
+}
+
+:-webkit-any(.checkbox, .radio) label input ~ span {
+ -webkit-margin-start: 0.6em;
+ -webkit-user-select: none;
+ /* Make sure long spans wrap at the same horizontal position they start. */
+ display: block;
+}
+
+:-webkit-any(.checkbox, .radio) label:hover {
+ color: black;
+}
+
+label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span {
+ color: #999;
+}
\ No newline at end of file
diff --git a/icons/translate-128.png b/icons/translate-128.png
new file mode 100644
index 0000000..1a33921
--- /dev/null
+++ b/icons/translate-128.png
Binary files differ
diff --git a/icons/translate-16.png b/icons/translate-16.png
new file mode 100644
index 0000000..6629ac6
--- /dev/null
+++ b/icons/translate-16.png
Binary files differ
diff --git a/icons/translate-256.png b/icons/translate-256.png
new file mode 100644
index 0000000..0b2ead1
--- /dev/null
+++ b/icons/translate-256.png
Binary files differ
diff --git a/icons/translate-32.png b/icons/translate-32.png
new file mode 100644
index 0000000..ee6fcfe
--- /dev/null
+++ b/icons/translate-32.png
Binary files differ
diff --git a/icons/translate-512.png b/icons/translate-512.png
new file mode 100644
index 0000000..8fc23a3
--- /dev/null
+++ b/icons/translate-512.png
Binary files differ
diff --git a/icons/translate-64.png b/icons/translate-64.png
new file mode 100644
index 0000000..6de6bb7
--- /dev/null
+++ b/icons/translate-64.png
Binary files differ
diff --git a/js/options.js b/js/options.js
new file mode 100644
index 0000000..76f3c0e
--- /dev/null
+++ b/js/options.js
@@ -0,0 +1,161 @@
+var isoLangs = {"af":{"name":"Afrikaans","nativeName":"Afrikaans"},"sq":{"name":"Albanian","nativeName":"Shqip"},"ar":{"name":"Arabic","nativeName":"\u0639\u0631\u0628\u064a"},"hy":{"name":"Armenian","nativeName":"\u0540\u0561\u0575\u0565\u0580\u0567\u0576"},"az":{"name":"Azerbaijani","nativeName":"\u0622\u0630\u0631\u0628\u0627\u06cc\u062c\u0627\u0646 \u062f\u06cc\u0644\u06cc"},"eu":{"name":"Basque","nativeName":"Euskara"},"be":{"name":"Belarusian","nativeName":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f"},"bg":{"name":"Bulgarian","nativeName":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"},"ca":{"name":"Catalan","nativeName":"Catal\u00e0"},"zh-CN":{"name":"Chinese (Simplified)","nativeName":"\u4e2d\u6587\u7b80\u4f53"},"zh-TW":{"name":"Chinese (Traditional)","nativeName":"\u4e2d\u6587\u7e41\u9ad4"},"hr":{"name":"Croatian","nativeName":"Hrvatski"},"cs":{"name":"Czech","nativeName":"\u010ce\u0161tina"},"da":{"name":"Danish","nativeName":"Dansk"},"nl":{"name":"Dutch","nativeName":"Nederlands"},"en":{"name":"English","nativeName":"English"},"et":{"name":"Estonian","nativeName":"Eesti keel"},"tl":{"name":"Filipino","nativeName":"Filipino"},"fi":{"name":"Finnish","nativeName":"Suomi"},"fr":{"name":"French","nativeName":"Fran\u00e7ais"},"gl":{"name":"Galician","nativeName":"Galego"},"ka":{"name":"Georgian","nativeName":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8"},"de":{"name":"German","nativeName":"Deutsch"},"el":{"name":"Greek","nativeName":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},"ht":{"name":"Haitian Creole","nativeName":"Krey\u00f2l ayisyen"},"iw":{"name":"Hebrew","nativeName":"\u05e2\u05d1\u05e8\u05d9\u05ea"},"hi":{"name":"Hindi","nativeName":"\u0939\u093f\u0928\u094d\u0926\u0940"},"hu":{"name":"Hungarian","nativeName":"Magyar"},"is":{"name":"Icelandic","nativeName":"\u00cdslenska"},"id":{"name":"Indonesian","nativeName":"Bahasa Indonesia"},"ga":{"name":"Irish","nativeName":"Gaeilge"},"it":{"name":"Italian","nativeName":"Italiano"},"ja":{"name":"Japanese","nativeName":"\u65e5\u672c\u8a9e"},"ko":{"name":"Korean","nativeName":"\ud55c\uad6d\uc5b4"},"lv":{"name":"Latvian","nativeName":"Latvie\u0161u"},"lt":{"name":"Lithuanian","nativeName":"Lietuvi\u0173 kalba"},"mk":{"name":"Macedonian","nativeName":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438"},"ms":{"name":"Malay","nativeName":"Malay"},"mt":{"name":"Maltese","nativeName":"Malti"},"no":{"name":"Norwegian","nativeName":"Norsk"},"fa":{"name":"Persian","nativeName":"\u0641\u0627\u0631\u0633\u06cc"},"pl":{"name":"Polish","nativeName":"Polski"},"pt":{"name":"Portuguese","nativeName":"Portugu\u00eas"},"ro":{"name":"Romanian","nativeName":"Rom\u00e2n\u0103"},"ru":{"name":"Russian","nativeName":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},"sr":{"name":"Serbian","nativeName":"\u0421\u0440\u043f\u0441\u043a\u0438"},"sk":{"name":"Slovak","nativeName":"Sloven\u010dina"},"sl":{"name":"Slovenian","nativeName":"Slovensko"},"es":{"name":"Spanish","nativeName":"Espa\u00f1ol"},"sw":{"name":"Swahili","nativeName":"Kiswahili"},"sv":{"name":"Swedish","nativeName":"Svenska"},"th":{"name":"Thai","nativeName":"\u0e44\u0e17\u0e22"},"tr":{"name":"Turkish","nativeName":"T\u00fcrk\u00e7e"},"uk":{"name":"Ukrainian","nativeName":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},"ur":{"name":"Urdu","nativeName":"\u0627\u0631\u062f\u0648"},"vi":{"name":"Vietnamese","nativeName":"Ti\u1ebfng Vi\u1ec7t"},"cy":{"name":"Welsh","nativeName":"Cymraeg"},"yi":{"name":"Yiddish","nativeName":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9"}}, sortable;
+
+function $(selector) {
+ return document.querySelector(selector);
+}
+
+function $all(selector) {
+ return document.querySelectorAll(selector);
+}
+
+function isEmpty(obj) {
+ return Object.keys(obj).length === 0;
+}
+
+function i18n() {
+ $("#welcome").innerHTML = chrome.i18n.getMessage("options_welcome");
+ $("#introduction").innerHTML = chrome.i18n.getMessage("options_introduction");
+ //$("#languageselectheader").innerHTML = chrome.i18n.getMessage("options_languageselectheader");
+ $("#otheroptionsheader").innerHTML = chrome.i18n.getMessage("options_otheroptionsheader");
+ $("#varioustabs_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_1");
+ $("#uniquetab_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_2");
+ $("#panel_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_3");
+ $("#save").innerHTML = chrome.i18n.getMessage("options_savebutton");
+}
+
+function print_list_modal() {
+ $("#select_language").innerHTML = "";
+ var heysortable = sortable.toArray();
+ for (var language in isoLangs) {
+ if (!inArray(language, heysortable)) {
+ var el = document.createElement('option');
+ el.setAttribute('value', language);
+ el.innerText = isoLangs[language]["name"]+" ("+isoLangs[language]["nativeName"]+")";
+ $("#select_language").appendChild(el);
+ }
+ }
+}
+
+function init() {
+ i18n();
+ chrome.storage.sync.get(null, function(items) {
+ // If no settings are set
+ if (isEmpty(items)) {
+ items = {'translateinto': {}, 'uniquetab': ''};
+ chrome.storage.sync.set({'translateinto': {}, 'uniquetab': ''});
+ }
+
+ // Check the checkbox of the window opening
+ if (items.uniquetab === "yep")
+ $("#uniquetab").checked = true;
+ if (items.uniquetab === "")
+ $("#varioustabs").checked = true;
+ if (items.uniquetab === "panel")
+ $("#panel").checked = true;
+
+ // Add event listeners for certain buttons and links
+ $("#panelsflag").addEventListener('click', function() { event.preventDefault(); chrome.tabs.create({url: 'chrome://flags/#enable-panels'}); });
+ $("#save").addEventListener('click', function() {
+ save_options();
+ });
+
+ // Print selected language list
+ var languages = items.translateinto;
+
+ if (languages) {
+ for (var language_id in languages) {
+ var language = languages[language_id];
+ var el = document.createElement('li');
+ el.setAttribute('data-language', language);
+ el.setAttribute('data-id', language);
+ el.innerHTML = isoLangs[language]["name"]+" ("+isoLangs[language]["nativeName"]+")"+"<span data-language='"+language+"' class='delete'>x</span>";
+ $("#languages").appendChild(el);
+ $("#languages li[data-language="+language+"] .delete").addEventListener('click', function() {
+ $("#languages").removeChild($("li[data-language="+this.getAttribute("data-language")+"]"));
+ print_list_modal();
+ });
+ }
+ }
+
+ // Initiate Sortable
+ sortable = new Sortable($("#languages"), {
+ animation: 150
+ });
+
+ // Handling The Dialog
+ $("#languages_add").addEventListener('click', function() { $("dialog").showModal(); });
+ $("#languages_add_cancel").addEventListener('click', function() { $("dialog").close(); });
+ $("#languages_add_ok").addEventListener('click', function() {
+ var el = document.createElement('li');
+ var language = $("#select_language").value;
+ if (inArray(language, sortable.toArray())) {
+ return;
+ }
+ el.setAttribute('data-language', language);
+ el.setAttribute('data-id', language);
+ el.innerHTML = isoLangs[language]["name"]+" ("+isoLangs[language]["nativeName"]+")"+"<span data-language='"+language+"' class='delete'>x</span>";
+ $("#languages").appendChild(el);
+ var selection = $("#select_language option[value="+language+"]");
+ selection.parentNode.removeChild(selection);
+ $("#languages li[data-id="+language+"] .delete").addEventListener('click', function() {
+ $("#languages").removeChild($("li[data-language="+this.getAttribute("data-language")+"]"));
+ print_list_modal();
+ });
+ $("dialog").close();
+ });
+
+ // Print language list in the modal dialog
+ print_list_modal();
+ });
+}
+
+function save_options() {
+ var languages = document.getElementById("languages");
+ var options = {"uniquetab": "", "translateinto": {}};
+
+ options.uniquetab = radio_selected("uniquetab");
+
+ var selected_languages = sortable.toArray();
+
+ var i = 0;
+ for (var language_id in selected_languages) {
+ var language = selected_languages[language_id];
+ options.translateinto[i] = language;
+ i++;
+ }
+
+ chrome.storage.sync.set(options, function() {
+ var background = chrome.extension.getBackgroundPage();
+
+ background.translator_tab = false;
+ background.translator_window = false;
+ window.close();
+ });
+
+ // We don't need the following code because the background.js is already listening to changes in chrome.sync ;-) Yeeey!
+ //chrome.extension.getBackgroundPage().createmenus(JSON.stringify(options));
+}
+
+function toObject(arr) {
+ var rv = {};
+ for (var i = 0; i < arr.length; ++i)
+ if (arr[i] !== undefined) rv[i] = arr[i];
+ return rv;
+}
+
+function radio_selected(a) {
+ var elements = document.getElementsByName(a);
+
+ for (var i=0; i<elements.length; i++)
+ if (elements[i].checked) return elements[i].value;
+}
+
+function inArray(needle, haystack) {
+ var length = haystack.length;
+ for(var i = 0; i < length; i++) {
+ if(haystack[i] == needle) return true;
+ }
+ return false;
+}
+
+window.addEventListener('load', init);
diff --git a/js/sortable.js b/js/sortable.js
new file mode 100644
index 0000000..524e118
--- /dev/null
+++ b/js/sortable.js
@@ -0,0 +1,783 @@
+/**!
+ * Sortable
+ * @author RubaXa <trash@rubaxa.org>
+ * @license MIT
+ */
+
+
+(function (factory){
+ "use strict";
+
+ if( typeof define === "function" && define.amd ){
+ define(factory);
+ }
+ else if( typeof module != "undefined" && typeof module.exports != "undefined" ){
+ module.exports = factory();
+ }
+ else {
+ window["Sortable"] = factory();
+ }
+})(function (){
+ "use strict";
+
+ var
+ dragEl
+ , ghostEl
+ , cloneEl
+ , rootEl
+ , nextEl
+
+ , lastEl
+ , lastCSS
+
+ , activeGroup
+
+ , tapEvt
+ , touchEvt
+
+ , expando = 'Sortable' + (new Date).getTime()
+
+ , win = window
+ , document = win.document
+ , parseInt = win.parseInt
+ , supportIEdnd = !!document.createElement('div').dragDrop
+
+ , _silent = false
+
+ , _dispatchEvent = function (rootEl, name, targetEl, fromEl) {
+ var evt = document.createEvent('Event');
+
+ evt.initEvent(name, true, true);
+ evt.item = targetEl || rootEl;
+ evt.from = fromEl || rootEl;
+
+ rootEl.dispatchEvent(evt);
+ }
+
+ , _customEvents = 'onAdd onUpdate onRemove onStart onEnd onFilter onSort'.split(' ')
+
+ , noop = function (){}
+ , slice = [].slice
+
+ , touchDragOverListeners = []
+ ;
+
+
+
+ /**
+ * @class Sortable
+ * @param {HTMLElement} el
+ * @param {Object} [options]
+ */
+ function Sortable(el, options){
+ this.el = el; // root element
+ this.options = options = (options || {});
+
+
+ // Default options
+ var defaults = {
+ group: Math.random(),
+ sort: true,
+ store: null,
+ handle: null,
+ draggable: el.children[0] && el.children[0].nodeName || (/[uo]l/i.test(el.nodeName) ? 'li' : '*'),
+ ghostClass: 'sortable-ghost',
+ ignore: 'a, img',
+ filter: null,
+ animation: 0
+ };
+
+
+ // Set default options
+ for (var name in defaults) {
+ !(name in options) && (options[name] = defaults[name]);
+ }
+
+
+ if (!options.group.name) {
+ options.group = { name: options.group };
+ }
+
+
+ ['pull', 'put'].forEach(function (key) {
+ if (!(key in options.group)) {
+ options.group[key] = true;
+ }
+ });
+
+
+ // Define events
+ _customEvents.forEach(function (name) {
+ options[name] = _bind(this, options[name] || noop);
+ _on(el, name.substr(2).toLowerCase(), options[name]);
+ }, this);
+
+
+ // Export group name
+ el[expando] = options.group.name;
+
+
+ // Bind all private methods
+ for( var fn in this ){
+ if( fn.charAt(0) === '_' ){
+ this[fn] = _bind(this, this[fn]);
+ }
+ }
+
+
+ // Bind events
+ _on(el, 'mousedown', this._onTapStart);
+ _on(el, 'touchstart', this._onTapStart);
+ supportIEdnd && _on(el, 'selectstart', this._onTapStart);
+
+ _on(el, 'dragover', this._onDragOver);
+ _on(el, 'dragenter', this._onDragOver);
+
+ touchDragOverListeners.push(this._onDragOver);
+
+ // Restore sorting
+ options.store && this.sort(options.store.get(this));
+ }
+
+
+ Sortable.prototype = /** @lends Sortable.prototype */ {
+ constructor: Sortable,
+
+
+ _applyEffects: function (){
+ _toggleClass(dragEl, this.options.ghostClass, true);
+ },
+
+
+ _onTapStart: function (evt/**Event|TouchEvent*/){
+ var
+ touch = evt.touches && evt.touches[0]
+ , target = (touch || evt).target
+ , options = this.options
+ , el = this.el
+ , filter = options.filter
+ ;
+
+ if( evt.type === 'mousedown' && evt.button !== 0 ) {
+ return; // only left button
+ }
+
+ // Check filter
+ if( typeof filter === 'function' ){
+ if( filter.call(this, target, this) ){
+ _dispatchEvent(el, 'filter', target);
+ return; // cancel dnd
+ }
+ }
+ else if( filter ){
+ filter = filter.split(',').filter(function (criteria) {
+ return _closest(target, criteria.trim(), el);
+ });
+
+ if (filter.length) {
+ _dispatchEvent(el, 'filter', target);
+ return; // cancel dnd
+ }
+ }
+
+ if( options.handle ){
+ target = _closest(target, options.handle, el);
+ }
+
+ target = _closest(target, options.draggable, el);
+
+ // IE 9 Support
+ if( target && evt.type == 'selectstart' ){
+ if( target.tagName != 'A' && target.tagName != 'IMG'){
+ target.dragDrop();
+ }
+ }
+
+ if( target && !dragEl && (target.parentNode === el) ){
+ tapEvt = evt;
+
+ rootEl = this.el;
+ dragEl = target;
+ nextEl = dragEl.nextSibling;
+ activeGroup = this.options.group;
+
+ dragEl.draggable = true;
+
+ // Disable "draggable"
+ options.ignore.split(',').forEach(function (criteria) {
+ _find(target, criteria.trim(), _disableDraggable);
+ });
+
+ if( touch ){
+ // Touch device support
+ tapEvt = {
+ target: target
+ , clientX: touch.clientX
+ , clientY: touch.clientY
+ };
+
+ this._onDragStart(tapEvt, true);
+ evt.preventDefault();
+ }
+
+ _on(document, 'mouseup', this._onDrop);
+ _on(document, 'touchend', this._onDrop);
+ _on(document, 'touchcancel', this._onDrop);
+
+ _on(this.el, 'dragstart', this._onDragStart);
+ _on(this.el, 'dragend', this._onDrop);
+ _on(document, 'dragover', _globalDragOver);
+
+
+ try {
+ if( document.selection ){
+ document.selection.empty();
+ } else {
+ window.getSelection().removeAllRanges()
+ }
+ } catch (err){ }
+
+
+ _dispatchEvent(dragEl, 'start');
+
+
+ cloneEl = dragEl.cloneNode(true);
+ _css(cloneEl, 'display', 'none');
+ rootEl.insertBefore(cloneEl, dragEl);
+ }
+ },
+
+ _emulateDragOver: function (){
+ if( touchEvt ){
+ _css(ghostEl, 'display', 'none');
+
+ var
+ target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY)
+ , parent = target
+ , groupName = this.options.group.name
+ , i = touchDragOverListeners.length
+ ;
+
+ if( parent ){
+ do {
+ if( parent[expando] === groupName ){
+ while( i-- ){
+ touchDragOverListeners[i]({
+ clientX: touchEvt.clientX,
+ clientY: touchEvt.clientY,
+ target: target,
+ rootEl: parent
+ });
+ }
+ break;
+ }
+
+ target = parent; // store last element
+ }
+ while( parent = parent.parentNode );
+ }
+
+ _css(ghostEl, 'display', '');
+ }
+ },
+
+
+ _onTouchMove: function (evt/**TouchEvent*/){
+ if( tapEvt ){
+ var
+ touch = evt.touches[0]
+ , dx = touch.clientX - tapEvt.clientX
+ , dy = touch.clientY - tapEvt.clientY
+ , translate3d = 'translate3d(' + dx + 'px,' + dy + 'px,0)'
+ ;
+
+ touchEvt = touch;
+
+ _css(ghostEl, 'webkitTransform', translate3d);
+ _css(ghostEl, 'mozTransform', translate3d);
+ _css(ghostEl, 'msTransform', translate3d);
+ _css(ghostEl, 'transform', translate3d);
+
+ evt.preventDefault();
+ }
+ },
+
+
+ _onDragStart: function (evt/**Event*/, isTouch/**Boolean*/){
+ var dataTransfer = evt.dataTransfer;
+
+ this._offUpEvents();
+
+ if( isTouch ){
+ var
+ rect = dragEl.getBoundingClientRect()
+ , css = _css(dragEl)
+ , ghostRect
+ ;
+
+ ghostEl = dragEl.cloneNode(true);
+
+ _css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10));
+ _css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10));
+ _css(ghostEl, 'width', rect.width);
+ _css(ghostEl, 'height', rect.height);
+ _css(ghostEl, 'opacity', '0.8');
+ _css(ghostEl, 'position', 'fixed');
+ _css(ghostEl, 'zIndex', '100000');
+
+ rootEl.appendChild(ghostEl);
+
+ // Fixing dimensions.
+ ghostRect = ghostEl.getBoundingClientRect();
+ _css(ghostEl, 'width', rect.width*2 - ghostRect.width);
+ _css(ghostEl, 'height', rect.height*2 - ghostRect.height);
+
+ // Bind touch events
+ _on(document, 'touchmove', this._onTouchMove);
+ _on(document, 'touchend', this._onDrop);
+ _on(document, 'touchcancel', this._onDrop);
+
+ this._loopId = setInterval(this._emulateDragOver, 150);
+ }
+ else {
+ dataTransfer.effectAllowed = 'move';
+ dataTransfer.setData('Text', dragEl.textContent);
+
+ _on(document, 'drop', this._onDrop);
+ }
+
+ setTimeout(this._applyEffects);
+ },
+
+
+ _onDragOver: function (evt/**Event*/){
+ var el = this.el,
+ target,
+ dragRect,
+ revert,
+ options = this.options,
+ group = options.group,
+ groupPut = group.put,
+ isOwner = (activeGroup === group);
+
+ if( !_silent &&
+ (activeGroup.name === group.name || groupPut && groupPut.indexOf && groupPut.indexOf(activeGroup.name) > -1) &&
+ (isOwner && (options.sort || (revert = !rootEl.contains(dragEl))) || groupPut && activeGroup.pull) &&
+ (evt.rootEl === void 0 || evt.rootEl === this.el)
+ ){
+ target = _closest(evt.target, this.options.draggable, el);
+ dragRect = dragEl.getBoundingClientRect();
+
+ if ((activeGroup.pull == 'clone') && (cloneEl.state !== isOwner)) {
+ _css(cloneEl, 'display', isOwner ? 'none' : '');
+ !isOwner && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl);
+ cloneEl.state = isOwner;
+ }
+
+ if (revert) {
+ rootEl.insertBefore(dragEl, cloneEl);
+ return;
+ }
+
+ if( (el.children.length === 0) || (el.children[0] === ghostEl) ||
+ (el === evt.target) && _ghostInBottom(el, evt)
+ ){
+ target && (targetRect = target.getBoundingClientRect());
+
+ el.appendChild(dragEl);
+ this._animate(dragRect, dragEl);
+ target && this._animate(targetRect, target);
+ }
+ else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){
+ if( lastEl !== target ){
+ lastEl = target;
+ lastCSS = _css(target);
+ }
+
+
+ var targetRect = target.getBoundingClientRect()
+ , width = targetRect.right - targetRect.left
+ , height = targetRect.bottom - targetRect.top
+ , floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display)
+ , isWide = (target.offsetWidth > dragEl.offsetWidth)
+ , isLong = (target.offsetHeight > dragEl.offsetHeight)
+ , halfway = (floating ? (evt.clientX - targetRect.left)/width : (evt.clientY - targetRect.top)/height) > .5
+ , nextSibling = target.nextElementSibling
+ , after
+ ;
+
+ _silent = true;
+ setTimeout(_unsilent, 30);
+
+ if( floating ){
+ after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide
+ } else {
+ after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
+ }
+
+ if( after && !nextSibling ){
+ el.appendChild(dragEl);
+ } else {
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
+ }
+
+ this._animate(dragRect, dragEl);
+ this._animate(targetRect, target);
+ }
+ }
+ },
+
+ _animate: function (prevRect, target) {
+ var ms = this.options.animation;
+
+ if (ms) {
+ var currentRect = target.getBoundingClientRect();
+
+ _css(target, 'transition', 'none');
+ _css(target, 'transform', 'translate3d('
+ + (prevRect.left - currentRect.left) + 'px,'
+ + (prevRect.top - currentRect.top) + 'px,0)'
+ );
+
+ target.offsetWidth; // repaint
+
+ _css(target, 'transition', 'all ' + ms + 'ms');
+ _css(target, 'transform', 'translate3d(0,0,0)');
+
+ clearTimeout(target.animated);
+ target.animated = setTimeout(function () {
+ _css(target, 'transition', '');
+ target.animated = false;
+ }, ms);
+ }
+ },
+
+ _offUpEvents: function () {
+ _off(document, 'mouseup', this._onDrop);
+ _off(document, 'touchmove', this._onTouchMove);
+ _off(document, 'touchend', this._onDrop);
+ _off(document, 'touchcancel', this._onDrop);
+ },
+
+ _onDrop: function (evt/**Event*/){
+ clearInterval(this._loopId);
+
+ // Unbind events
+ _off(document, 'drop', this._onDrop);
+ _off(document, 'dragover', _globalDragOver);
+
+ _off(this.el, 'dragend', this._onDrop);
+ _off(this.el, 'dragstart', this._onDragStart);
+ _off(this.el, 'selectstart', this._onTapStart);
+
+ this._offUpEvents();
+
+ if( evt ){
+ evt.preventDefault();
+ evt.stopPropagation();
+
+ cloneEl.parentNode.removeChild(cloneEl);
+ ghostEl && ghostEl.parentNode.removeChild(ghostEl);
+
+ if( dragEl ){
+ _disableDraggable(dragEl);
+ _toggleClass(dragEl, this.options.ghostClass, false);
+
+ if( !rootEl.contains(dragEl) ){
+ _dispatchEvent(dragEl, 'sort');
+ _dispatchEvent(rootEl, 'sort');
+
+ // Add event
+ _dispatchEvent(dragEl, 'add', dragEl, rootEl);
+
+ // Remove event
+ _dispatchEvent(rootEl, 'remove', dragEl);
+ }
+ else if( dragEl.nextSibling !== nextEl ){
+ // Update event
+ _dispatchEvent(dragEl, 'update');
+ _dispatchEvent(dragEl, 'sort');
+ }
+
+ _dispatchEvent(rootEl, 'end');
+ }
+
+ // Set NULL
+ rootEl =
+ dragEl =
+ ghostEl =
+ nextEl =
+ cloneEl =
+
+ tapEvt =
+ touchEvt =
+
+ lastEl =
+ lastCSS =
+
+ activeGroup = null;
+
+ // Save sorting
+ this.options.store && this.options.store.set(this);
+ }
+ },
+
+
+ /**
+ * Serializes the item into an array of string.
+ * @returns {String[]}
+ */
+ toArray: function () {
+ var order = [],
+ el,
+ children = this.el.children,
+ i = 0,
+ n = children.length
+ ;
+
+ for (; i < n; i++) {
+ el = children[i];
+ if (_closest(el, this.options.draggable, this.el)) {
+ order.push(el.getAttribute('data-id') || _generateId(el));
+ }
+ }
+
+ return order;
+ },
+
+
+ /**
+ * Sorts the elements according to the array.
+ * @param {String[]} order order of the items
+ */
+ sort: function (order) {
+ var items = {}, rootEl = this.el;
+
+ this.toArray().forEach(function (id, i) {
+ var el = rootEl.children[i];
+
+ if (_closest(el, this.options.draggable, rootEl)) {
+ items[id] = el;
+ }
+ }, this);
+
+
+ order.forEach(function (id) {
+ if (items[id]) {
+ rootEl.removeChild(items[id]);
+ rootEl.appendChild(items[id]);
+ }
+ });
+ },
+
+
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ * @param {HTMLElement} el
+ * @param {String} [selector] default: `options.draggable`
+ * @returns {HTMLElement|null}
+ */
+ closest: function (el, selector) {
+ return _closest(el, selector || this.options.draggable, this.el);
+ },
+
+
+ /**
+ * Destroy
+ */
+ destroy: function () {
+ var el = this.el, options = this.options;
+
+ _customEvents.forEach(function (name) {
+ _off(el, name.substr(2).toLowerCase(), options[name]);
+ });
+
+ _off(el, 'mousedown', this._onTapStart);
+ _off(el, 'touchstart', this._onTapStart);
+ _off(el, 'selectstart', this._onTapStart);
+
+ _off(el, 'dragover', this._onDragOver);
+ _off(el, 'dragenter', this._onDragOver);
+
+ //remove draggable attributes
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function(el) {
+ el.removeAttribute('draggable');
+ });
+
+ touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1);
+
+ this._onDrop();
+
+ this.el = null;
+ }
+ };
+
+
+ function _bind(ctx, fn){
+ var args = slice.call(arguments, 2);
+ return fn.bind ? fn.bind.apply(fn, [ctx].concat(args)) : function (){
+ return fn.apply(ctx, args.concat(slice.call(arguments)));
+ };
+ }
+
+
+ function _closest(el, selector, ctx){
+ if( selector === '*' ){
+ return el;
+ }
+ else if( el ){
+ ctx = ctx || document;
+ selector = selector.split('.');
+
+ var
+ tag = selector.shift().toUpperCase()
+ , re = new RegExp('\\s('+selector.join('|')+')\\s', 'g')
+ ;
+
+ do {
+ if(
+ (tag === '' || el.nodeName == tag)
+ && (!selector.length || ((' '+el.className+' ').match(re) || []).length == selector.length)
+ ){
+ return el;
+ }
+ }
+ while( el !== ctx && (el = el.parentNode) );
+ }
+
+ return null;
+ }
+
+
+ function _globalDragOver(evt){
+ evt.dataTransfer.dropEffect = 'move';
+ evt.preventDefault();
+ }
+
+
+ function _on(el, event, fn){
+ el.addEventListener(event, fn, false);
+ }
+
+
+ function _off(el, event, fn){
+ el.removeEventListener(event, fn, false);
+ }
+
+
+ function _toggleClass(el, name, state){
+ if( el ){
+ if( el.classList ){
+ el.classList[state ? 'add' : 'remove'](name);
+ }
+ else {
+ var className = (' '+el.className+' ').replace(/\s+/g, ' ').replace(' '+name+' ', '');
+ el.className = className + (state ? ' '+name : '')
+ }
+ }
+ }
+
+
+ function _css(el, prop, val){
+ var style = el && el.style;
+
+ if( style ){
+ if( val === void 0 ){
+ if( document.defaultView && document.defaultView.getComputedStyle ){
+ val = document.defaultView.getComputedStyle(el, '');
+ }
+ else if( el.currentStyle ){
+ val = el.currentStyle;
+ }
+
+ return prop === void 0 ? val : val[prop];
+ }
+ else {
+ if (!(prop in style)) {
+ prop = '-webkit-' + prop;
+ }
+
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
+ }
+ }
+ }
+
+
+ function _find(ctx, tagName, iterator){
+ if( ctx ){
+ var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
+ if( iterator ){
+ for( ; i < n; i++ ){
+ iterator(list[i], i);
+ }
+ }
+ return list;
+ }
+ return [];
+ }
+
+
+ function _disableDraggable(el){
+ return el.draggable = false;
+ }
+
+
+ function _unsilent(){
+ _silent = false;
+ }
+
+
+ function _ghostInBottom(el, evt){
+ var last = el.lastElementChild.getBoundingClientRect();
+ return evt.clientY - (last.top + last.height) > 5; // min delta
+ }
+
+
+ /**
+ * Generate id
+ * @param {HTMLElement} el
+ * @returns {String}
+ * @private
+ */
+ function _generateId(el) {
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
+ i = str.length,
+ sum = 0
+ ;
+
+ while (i--) {
+ sum += str.charCodeAt(i);
+ }
+
+ return sum.toString(36);
+ }
+
+
+ // Export utils
+ Sortable.utils = {
+ on: _on,
+ off: _off,
+ css: _css,
+ find: _find,
+ bind: _bind,
+ closest: _closest,
+ toggleClass: _toggleClass,
+ dispatchEvent: _dispatchEvent
+ };
+
+
+ Sortable.version = '0.6.0';
+
+
+ /**
+ * Create sortable instance
+ * @param {HTMLElement} el
+ * @param {Object} [options]
+ */
+ Sortable.create = function (el, options) {
+ return new Sortable(el, options)
+ };
+
+ // Export
+ return Sortable;
+});
diff --git a/json/credits.json b/json/credits.json
new file mode 100644
index 0000000..c3fde48
--- /dev/null
+++ b/json/credits.json
@@ -0,0 +1,27 @@
+/*
+ * JSON credits. This file includes credits to the Open Source projects which made this extension exist
+ */
+{
+ "icon": {
+ "name": "Metro Uinvert Dock Icon Set",
+ "url": "http://dakirby309.deviantart.com/art/Metro-Uinvert-Dock-Icon-Set-725-Icons-294529071",
+ "author": "dAKirby309"
+ },
+ "translation": {
+ "name": "Russian Translation",
+ "url": "https://code.google.com/r/sashasimkin-translateselectedtext/source/detail?r=fc4e58ee0d69929d610a84a7600338e99b9d3d83",
+ "author": "Alexander Simkin"
+ }
+ "sortable": {
+ "name": "Sortable",
+ "url": "https://github.com/RubaXa/Sortable",
+ "author": "Lebedev Konstantin",
+ "license": "MIT License"
+ },
+ "widgets": {
+ "name": "Chromium",
+ "url": "https://code.google.com/p/chromium/",
+ "author": "The Chromum Authors",
+ "license": "BSD-like License"
+ }
+}
\ No newline at end of file