This process imports words in a CSV format to the currently loaded dictionary. (Note: You can save an Excel file as a CSV)
-
The CSV file must have a header line in this order: word,pronunciation,part of speech,definition,explanation. Your word data must be in the appropriate order according to the headers. You can use this CSV file as a template if you need help.
-
Make sure the parts of speech for each word correspond to your dictionary's parts of speech or else you won't be able to find it using a filter. If a part of speech is left blank, you can find the blanks using the "Blank" option in the Filter so you can clean up.
-
At a minimum, all of your words must have the "word" field and either the "definition" or "explanation" field filled out in the CSV file.
-
-
-
-
-
-
-
diff --git a/LOGIN.form b/LOGIN.form
deleted file mode 100644
index 3990acc..0000000
--- a/LOGIN.form
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
diff --git a/PRIVACY.md b/PRIVACY.md
deleted file mode 100644
index 4781b29..0000000
--- a/PRIVACY.md
+++ /dev/null
@@ -1,49 +0,0 @@
-## Privacy Policy
-
-This document was last updated on November 02, 2015.
-
-This Privacy Policy governs the manner in which Lexiconga Dictionary Builder collects, uses, maintains and discloses information collected from users (each, a "User") of the http://lexicon.ga website ("Site") and its accounts ("Account").
-
-### Personal identification information
-We may collect personal identification information from Users in a variety of ways, including, but not limited to, when Users visit our site, register on the site, and in connection with other activities, services, features or resources we make available on our Site. Users may be asked for, as appropriate, their name and email address. Users may, however, use our Site anonymously. We will collect personal identification information from Users only if they voluntarily submit such information to us. Users can always refuse to supply personal identification information, except that it may prevent them from engaging in certain Site-related activities.
-
-### Non-personal identification information
-We may collect non-personal identification information about Users whenever they interact with our Site through website analytics tools. Non-personal identification information may include the browser name, the type of computer and technical information about Users means of connection to our Site, such as the operating system and the Internet service providers utilized and other similar information.
-
-### Web browser cookies
-Our Site does not use "cookies" to enhance User experience, but it does use "local storage". User's web browser places local storage on their hard drive for record-keeping purposes and sometimes to track information about them, but we only use this to store your current dictionary. User may choose to set their web browser to refuse local storage usage, but if they do so, the Site will not function properly.
-
-### How we use collected information
-Lexiconga Dictionary Builder may collect and use Users personal information for the following purposes:
-- **To run and operate our Site and personalize user experience:** We need your input to display content on the Site correctly, because it is a tool built entirely to display the content that you enter.
-
-### How we protect your information
-If you are utilizing an Account, we protect your information by keeping your information on a trusted database server provided by the Site's web host. All data you save from an Account is uploaded to this database server from your browser.
-
-If you utilize the ability to make dictionaries associated with an Account visible to the public, you accept all responsibility for its content being visible to anyone who might find it. We cannot protect what you willingly put in public, and we do not accept liability if information you place online is used against you somehow. Never put personal information online!
-
-If you are not using an Account, then all of your information remains right on your own computer where it belongs. As mentioned previously, all data is stored in your browser's "local storage".
-
-### Sharing your personal information
-We do not sell, trade, or rent Users personal identification information to others. We may share generic aggregated demographic information not linked to any personal identification information regarding visitors and users with our business partners, trusted affiliates and advertisers for the purposes outlined above.
-
-### Electronic newsletters
-If User decides to opt-in to our mailing list, they will receive emails that may include company news, updates, related product or service information, etc. We may use third party service providers like MailChimp to help us operate our business and the Site or administer activities on our behalf, such as sending out newsletters or surveys. We may share your information with these third parties for those limited purposes provided that you have given us your permission.
-
-### Third party websites
-Users may find advertising or other content on our Site that link to the sites and services of our partners, suppliers, advertisers, sponsors, licencors and other third parties. We do not control the content or links that appear on these sites and are not responsible for the practices employed by websites linked to or from our Site. In addition, these sites or services, including their content and links, may be constantly changing. These sites and services may have their own privacy policies and customer service policies. Browsing and interaction on any other website, including websites which have a link to our Site, is subject to that website's own terms and policies.
-
-### Advertising
-Ads appearing on our site may be delivered to Users by advertising partners, who may set cookies. These cookies allow the ad server to recognize your computer each time they send you an online advertisement to compile non personal identification information about you or others who use your computer. This information allows ad networks to, among other things, deliver targeted advertisements that they believe will be of most interest to you. This privacy policy does not cover the use of cookies by any advertisers.
-
-### Google Adsense
-Some of the ads may be served by Google. Google's use of the DART cookie enables it to serve ads to Users based on their visit to our Site and other sites on the Internet. DART uses "non personally identifiable information" and does NOT track personal information about you, such as your name, email address, physical address, etc. You may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at [http://www.google.com/policies/technologies/ads/](http://www.google.com/policies/technologies/ads/)
-
-### Changes to this privacy policy
-Lexiconga Dictionary Builder has the discretion to update this privacy policy at any time. When we do, we will post a notification on the main page of our Site. We encourage Users to frequently check this page for any changes to stay informed about how we are helping to protect the personal information we collect. You acknowledge and agree that it is your responsibility to review this privacy policy periodically and become aware of modifications.
-
-### Your acceptance of these terms
-By using this Site, you signify your acceptance of this policy. If you do not agree to this policy, please do not use our Site. Your continued use of the Site following the posting of changes to this policy will be deemed your acceptance of those changes. This policy was originally generated using PrivacyPolicies.com and modified for our use.
-
-### Contacting us
-If you have any questions about this Privacy Policy, the practices of this site, or your dealings with this site, please contact us by email at help (at) lexicon (dot) ga or follow us Twitter @alamantus.
diff --git a/TERMS.md b/TERMS.md
deleted file mode 100644
index ecf4c5b..0000000
--- a/TERMS.md
+++ /dev/null
@@ -1,40 +0,0 @@
-## Terms of Service ("Terms")
-
-Last updated: November 1, 2015.
-
-Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the http://lexicon.ga website (the "Service") or the cloud account service (an "Account") operated by Robbie Antenesse and Alamantus GameDev ("us", "we", or "our").
-
-Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms. These Terms apply to all visitors, users and others who access or use the Service. By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the terms then you may not access the Service.
-
-### Usage
-You may use our Service free of charge, and you are free to stop using our Service at any time. If you are utilizing an Account with our Service, you agree to never attempt maliciously dismantling the Service in any way or to use the Service in a way that is unlawful. If you are found in violation of this, your Account and access to the Service may be terminated without warning.
-
-If you stop using our Service, your data will remain unless you request its removal. When data is removed from an Account in our Service, it becomes permanently irretrievable. You agree that you understand the implications of deleting or requesting the deletion of your data and that we are not liable for its loss.
-
-Instructions for use are visible through the "About Lexiconga" button on the site.
-
-### Public Dictionaries
-Any dictionaries created and associated with an Account are private by default and only visible to the owner of the Account. You may make your dictionaries visible to the public at any time by utilizing the appropriate dictionarys setting.
-
-If you utilize the ability to make dictionaries associated with an Account visible to the public, you accept all responsibility for any and all damages that may come as a result of the information you place online and acknowledge that we are not liable in any way. Do not put any personal information online. We cannot protect what you deliberately make publicly visible.
-
-### Termination
-We may terminate or suspend access to our Service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms. All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.
-
-### Links To Other Web Sites
-Our Service may contain links to third-party web sites or services that are not owned or controlled by Robbie Antenesse and Alamantus GameDev.
-
-Robbie Antenesse and Alamantus GameDev has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party web sites or services. You further acknowledge and agree that Robbie Antenesse and Alamantus GameDev shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such web sites or services.
-
-We strongly advise you to read the terms and conditions and privacy policies of any third-party web sites or services that you visit.
-
-### Governing Law
-These Terms shall be governed and construed in accordance with the laws of the United States of America, without regard to its conflict of law provisions. Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our Service, and supersede and replace any prior agreements we might have between us regarding the Service.
-
-### Changes
-We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will try to provide at least 5 days notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.
-
-By continuing to access or use our Service after those revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, please stop using the Service.
-
-### Contact Us
-If you have any questions about these Terms, please contact us by email at help (at) lexicon (dot) ga or follow us on Twitter @alamantus.
diff --git a/announcement.php b/announcement.php
deleted file mode 100644
index 84c462c..0000000
--- a/announcement.php
+++ /dev/null
@@ -1 +0,0 @@
-[Release Date] | So much has been updated! Check the Updates page to see all the changes!
diff --git a/css/lexiconga.css b/css/lexiconga.css
deleted file mode 100644
index 679d8f4..0000000
--- a/css/lexiconga.css
+++ /dev/null
@@ -1,149 +0,0 @@
-body {
- background: #e6cfaa;
-}
-
-header {
- background: #eacc9d;
-}
-
-tr, thead {
- border-bottom: 1px solid #af8050;
-}
-td, th {
- border-right: 1px solid #af8050;
-}
-
-a {
- text-decoration: underline;
- color: #a01000;
-}
-
-#siteLogo {
- display: block;
- text-indent: -9999px;
- width: 242px;
- height: 48px;
- background: url(../images/logo.svg);
- background-size: 242px 48px;
- float: left;
-}
-
-#aboutButton {
-}
-
-#loginoutArea {
- float: right;
-}
-
-#loginoutArea a {
- color: #000000;
- text-decoration: none;
- font-size: 13px;
-}
-
-@media screen
-and (min-device-width : 481px) {
- #headerPadder {
- padding: 1px;
- }
-
- #loginoutArea {
- margin: 16px;
- }
-}
-
-/* Smartphones (portrait and landscape) ----------- */
-@media only screen
-and (max-device-width : 480px) {
- #siteLogo {
- display: block;
- text-indent: -9999px;
- width: 150px;
- height: 30px;
- background: url(../images/logo.svg);
- background-size: 150px 30px;
- float: left;
- }
-
- #loginoutArea {
- margin: 16px 8px;
- }
-}
-
-#wordEntryForm {
- background: #ba5536;
- -webkit-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- -moz-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- border: none;
-}
-
-input, textarea, select, option {
- background: #efdfc0;
-}
-
-#announcementArea {
- background: #a0c066;
-}
-
-#notificationArea {
- background: #c0c088;
-}
-
-#dictionaryColumn {
- background: #bd7251;
- border: none;
- -webkit-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- -moz-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
-}
-
-#settingsOptions, #infoPage, #loadAfterDeletePage, #accountSettingsPage, #fullScreenTextboxPage {
- background: #f2d5b2;
-}
-
-.management {
- border-width: 2px;
- border: none;
-}
-
-#dictionaryName {
- text-shadow: 2px 2px 2px #915337;
-}
-
-#dictionaryShareLink {
- text-shadow: none;
-}
-
-#dictionaryDescription {
- width: 90%;
- background: #f2d5b2;
-}
-
-#loginLink, #logoutLink, #descriptionToggle, #searchFilterToggle, #settingsButton, .deleteCancelButton, .deleteConfirmButton, #settingsScreenCloseButton, #infoScreenCloseButton, .clickable, button {
- background: #dcb078;
-}
-
-entry {
- background: #d7ad7d;
- border: none;
- -webkit-box-shadow: 3px 3px 10px -1px rgba(0,0,0,0.75);
- -moz-box-shadow: 3px 3px 10px -1px rgba(0,0,0,0.75);
- box-shadow: 3px 3px 10px -1px rgba(0,0,0,0.75);
-}
-
-.editButton {
- background: #86ac41;
-}
-
-.deleteButton {
- background: #ba5536;
-}
-
-footer {
- background: #cb6318;
- border: none;
- -webkit-box-shadow: 0px -3px 7px -1px rgba(0,0,0,0.75);
- -moz-box-shadow: 0px -3px 7px -1px rgba(0,0,0,0.75);
- box-shadow: 0px -3px 7px -1px rgba(0,0,0,0.75);
-}
\ No newline at end of file
diff --git a/css/mobile.css b/css/mobile.css
deleted file mode 100644
index 1aea062..0000000
--- a/css/mobile.css
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Smartphones (portrait and landscape) ----------- */
-@media screen
-and (max-width : 910px) {
- body {
- font-size: 11pt;
- }
-
- header {
- height: 70px;
- }
-
- footer {
- position: relative;
- clear: both;
- max-height: 100%;
- }
-
- #announcementArea, #notificationArea {
- width: 80%;
- }
-
- #leftColumn {
- width: 100%;
- margin: 0;
- }
-
- #wordEntryForm {
- padding: 8px 0;
- width: 100%;
- max-width: 450px;
- margin: 10px auto;
- }
-
- #wordEntryForm label {
- overflow: hidden;
- display: flex;
- justify-content: center;
- font-size: 10pt;
- }
-
- #wordEntryForm label span {
- float: left;
- width: 30%;
- text-align: right;
- margin-right: 8px;
- }
-
- #wordEntryForm input, #wordEntryForm select, #wordEntryForm textarea {
- float: right;
- width: 60%;
- margin-right: 8px;
- align-self: center;
- }
-
- .longDefinition {
- min-width: 200px;
- height: 80px;
- }
-
- #wordEntryForm button {
- display: block;
- width: 50%;
- height: 30px;
- margin: 0px auto;
- }
-
- #mobileWordFormPullout {
- position: fixed;
- top: 7%;
- left: 0;
- width: 32px;
- height: 32px;
- font-size: 20px;
- font-weight: bold;
- text-align: center;
- padding: 6px;
- background: #86ac41;
- -webkit-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- -moz-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- border: none;
- cursor: pointer;
- }
-
- #dictionaryColumn {
- width: 100%;
- margin: 0;
- padding: 0;
- }
-
- #dictionaryContent {
- margin: 0 auto;
- padding: 15px;
- }
-
- #dictionaryDescription {
- margin: 0 auto;
- }
-
- #searchFilterArea {
- width: 90%;
- min-width: 200px;
- padding: 10px 10px 3px;
- margin: 0 auto;
- }
-
- .fixedFade {
- z-index: 5;
- }
-
- .fixedPage {
- z-index: 10;
- }
-
- entry {
- margin: 0 auto 5px;
- }
-
- #formLockButton {
- display: none;
- }
-
- #showFullScreenTextbox {
- display: none;
- }
-
- #settingsSaveButtons {
- position: relative;
- right: 0;
- bottom: 0;
- clear: both;
- width: 100%;
- }
-}
diff --git a/css/styles.css b/css/styles.css
deleted file mode 100644
index 7cc1bcc..0000000
--- a/css/styles.css
+++ /dev/null
@@ -1,453 +0,0 @@
-* {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-html {
- width: 100%;
-}
-
-body {
- width: 100%;
- padding: 0;
- margin: 0;
- border: none;
- font-family: "Helvetica", Arial, sans-serif;
-}
-
-contents {
- display: block;
- width: 100%;
-}
-
-header {
- height: 50px;
- width: 100%;
- margin: 0 0 10px;
- position: relative;
- top: 0px;
- left: 0px;
- right: 0px;
- border: none;
- padding: 0;
- -webkit-box-shadow: 0px 3px 10px -1px rgba(0,0,0,0.75);
- -moz-box-shadow: 0px 3px 10px -1px rgba(0,0,0,0.75);
- box-shadow: 0px 3px 10px -1px rgba(0,0,0,0.75);
-}
-
-footer {
- width: 100%;
- text-align: center;
- vertical-align: middle;
- position:fixed;
- bottom: 0px;
- left: 0px;
- background: #aaaaaa;
- padding: 0;
- max-height: 32px; /* Update Dictionary Container's bottom margin to account for footer */
-}
-
-#footer-content {
- padding: 8px;
-}
-
-table {
- border-collapse: collapse;
- width: 100%;
-}
-
-tr, thead {
- border-bottom: 1px solid #afafaf;
-}
-tr:last-child {
- border-bottom: none;
-}
-
-td, th {
- border-right: 1px solid #afafaf;
- padding: 3px 10px;
-}
-td:last-child, th:last-child {
- border-right: none;
-}
-
-.inline {
- display: inline !important;
-}
-
-#leftColumn {
- float: left;
- width: 25%;
- margin: 15px 0 15px 15px;
-}
-
-form {
- padding: 15px;
-}
-
-#wordEntryForm {
- max-width: 400px;
- min-width: 260px;
-}
-
-.wbr:after {
- content: "\00200B";
-}
-
-label {
- display: block;
- margin-bottom: 10px;
-}
-
-label span {
- display: block;
- font-weight: bold;
-}
-
-label label {
- margin-left: 20px;
-}
-
-label span.checkboxlabel {
- display: inline;
- margin-left: 10px;
-}
-
-input, textarea {
- display: block;
- padding: 2px 0 2px 5px;
- border: none;
- margin: 2px 0;
-}
-
-input[type=checkbox] {
- display: inline;
- margin: 5px;
-}
-
-.longDefinition {
- width: 100%;
- min-width: 230px;
- height: 150px;
-}
-
-#updateConflict {
- width: 260px;
-}
-
-#errorMessage, #updateConflictMessage, #settingsErrorMessage {
- display: block;
- color: maroon;
- font-weight: bold;
-}
-
-#dictionaryWarn {
- margin-top: 10px;
- font-size: 12px;
- font-weight: bold;
- font-style: italic;
-}
-
-.exportWarnText {
- display: inline;
- color: red;
- cursor: pointer;
- text-decoration: underline;
-}
-
-#formLockButton {
- float: right;
-}
-
-#createAccountSubmitButton, #accountSettingsSubmitButton {
- margin-top: 10px;
-}
-
-#aboutButton {
- display: inline;
- margin: 0 10px 0 0;
-}
-
-#announcementArea, #notificationArea {
- text-align:center;
- padding:10px;
- margin: 0 auto 5px;
- width:50%;
- min-width:200px;
- -webkit-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- -moz-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
-}
-
-#dictionaryColumn {
- width: 50%;
- margin: 15px 0 36px 15px; /* bottom margin must clear footer */
- padding: 0;
- float: left;
-}
-
-#dictionaryContent {
- width: 100%;
- min-width: 260px;
- max-width: 800px;
- padding: 15px;
-}
-
-#dictionaryName {
- margin: 0 0 5px;
-}
-
-#dictionaryShareLink {
- margin-left: 10px;
- vertical-align: middle;
- text-decoration: none;
-}
-
-#dictionaryDescription {
- width: 100%;
- max-height: 400px;
- overflow-y: auto;
- padding: 15px;
- border: none;
- margin: 10px;
-}
-
-.clickable, button {
- display: inline;
- font-weight: bold;
- font-size: 13px;
- padding: 5px;
- border: none;
- background: #dddddd;
-}
-
-.clickable, button {
- cursor: pointer;
-}
-
-.inline-button {
- font-size: 11px;
- padding: 2px 4px;
-}
-
-.toggleButton {
- display: inline-block;
- margin: 8px;
- font-weight: bold;
- font-size: 12px;
-}
-
-.searchOption, .filterOption {
- font-size:12px;
- display: inline-block;
- margin: 0 8px 0 0;
-}
-
-#wordFilter {
- margin: 10px 0;
-}
-
-#filterWordCount {
- margin: 10px 10px;
- display: block;
- font-weight: bold;
- font-style: italic;
-}
-
-entry {
- display: block;
- width: 90%;
- min-width: 200px;
- padding: 10px 10px 3px;
- margin-bottom: 5px;
-}
-
-.wordLink {
- text-decoration: none;
- float: right;
- font-size: 13px;
- padding: 2px;
- line-height: 10px;
-}
-
-word {
- font-weight: bold;
- font-size: 20px;
-}
-
-pronunciation {
- font-size: 12px;
- margin-left:10px;
-}
-
-partofspeech {
- font-style: italic;
- font-weight: bold;
- font-size: 10px;
- margin-left:10px;
-}
-
-simpledefinition {
- display: block;
- font-style: italic;
-}
-
-longdefinition {
- display: block;
- margin-left: 20px;
-}
-
-longDefinition h1, longDefinition h2, longDefinition h3, longDefinition h4, longDefinition h5, longDefinition h6 {
- margin: 5px 0 8px;
- font-weight: bold;
-}
-
-longDefinition h1 {
- font-size: 22px;
-}
-
-longDefinition h2 {
- font-size: 20px;
-}
-
-longDefinition h3 {
- font-size: 20px;
- font-weight: normal;
-}
-
-longDefinition h4 {
- font-size: 18px;
-}
-
-longDefinition h5 {
- font-size: 18px;
- font-weight: normal;
-}
-
-longDefinition h6 {
- font-size: 17px;
-}
-
-longDefinition p {
- margin: 3px 0 8px;
-}
-
-searchTerm {
- display: inline;
- color: #ff0000;
- background: #ffff00;
- padding: 1px;
- text-decoration: underline;
- font-style: italic;
- font-weight: bold;
-}
-
-.management {
- display: block;
- right: 5px;
- width: 100px;
- padding: 3px;
- border: inset 3px;
- margin: 10px;
-}
-
-.editButton, .deleteButton, .deleteConfirmButton, .deleteCancelButton {
- display: inline;
- font-size: 10px;
- margin: 5px;
-}
-
-.deleteConfirm {
- display: block;
- font-size: 10px;
- margin: 10px;
-}
-
-.fixedFade {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: #000000;
- opacity: 0.6;
-}
-
-.fixedPage {
- position: fixed;
- top: 5%;
- left: 6%;
- right: 6%;
- bottom: 10%;
- min-width: 260px;
- min-height: 260px;
- padding: 5px 5% 5%;
- overflow-y: auto;
- overflow-x: hidden;
- background: #ffffff;
- opacity: 1;
- border: none;
- -webkit-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- -moz-box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
- box-shadow: 5px 5px 7px 0px rgba(0,0,0,0.75);
-}
-
-.rightButton {
- float: right;
- font-size: 12px;
-}
-
-#fullScreenTextboxPage {
- padding: 5px 3% 4%;
- overflow-y: hidden;
-}
-
-#fullScreenTextbox {
- position: relative;
- width: 100%;
- height: 100%;
-}
-
-#settingsForm {
- width: 100%;
- padding: 0;
- margin: 0;
-}
-
-#publicLink {
- font-size:12px;
- font-style: italic;
-}
-
-#dictionaryDescriptionEdit, #dictionaryPartsOfSpeechEdit {
- width: 100%;
- max-width: 360px;
- min-width: 200px;
-}
-
-#dictionaryDescriptionEdit {
- height: 200px;
-}
-
-#settingsErrorMessage {
- float: right;
- clear: both;
-}
-#settingsSaveButtons {
- position: absolute;
- right: 10%;
- bottom: 8%;
- font-size: 14px;
- display: block;
- width: 50%;
-}
-
-.settingsCol {
- display: block;
- float: left;
- width: 30%;
- min-width: 260px;
- max-width: 400px;
- margin: 0 30px 0 0;
-}
diff --git a/import_test.csv b/import_test.csv
deleted file mode 100644
index 397041d..0000000
--- a/import_test.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-word,pronunciation,part of speech,equivalent,explanation
-test0, [tehst], ,dah,
-test1, [tehst], a ,dah,
-test2, [tehst], a ,dah,
\ No newline at end of file
diff --git a/index.php b/index.php
deleted file mode 100644
index 019c411..0000000
--- a/index.php
+++ /dev/null
@@ -1,459 +0,0 @@
- 0) ? (($word_to_load > 0) ? "word" : "view") : "build";
-
-$announcement = get_include_contents(SITE_LOCATION . '/announcement.php');
-$notificationMessage = "";
-
-if ($current_user > 0 || !isset($_SESSION['loginfailures']) || (isset($_SESSION['loginlockouttime']) && time() - $_SESSION['loginlockouttime'] >= 3600)) {
- // If logged in, never failed, or more than 1 hour has passed, reset login failures.
- $_SESSION['loginfailures'] = 0;
-} else {
- $alertlockoutmessage = "You failed logging in 10 times. To prevent request flooding and hacking attempts, you may not log in or create an account for 1 hour.\\n\\nThe last time this page was loaded, you had been locked out for " . time_elapsed(time() - $_SESSION['loginlockouttime']) . "\\n\\nRefresh the page once the hour has passed.";
- $hoverlockoutmessage = str_replace("\\n", "\n", $alertlockoutmessage);
-}
-
-require_once(SITE_LOCATION . '/php/notificationconditiontree.php');
-
-if ($display_mode != "build") {
- $dbconnection = new PDO('mysql:host=' . DATABASE_SERVERNAME . ';dbname=' . DATABASE_NAME . ';charset=utf8', DATABASE_USERNAME, DATABASE_PASSWORD);
- $dbconnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $dbconnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
- $dbconnection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
-
- $dictionary_query = "SELECT `d`.`id`, `d`.`user`, `d`.`name`, `d`.`description`, `u`.`public_name`, `d`.`parts_of_speech`, `d`.`is_complete` ";
- $dictionary_query .= "FROM `dictionaries` AS `d` LEFT JOIN `users` AS `u` ON `d`.`user`=`u`.`id`";
- $dictionary_query .= "WHERE `d`.`is_public`=1 AND `d`.`id`=" . $dictionary_to_load . ";";
-
- $word_query = "SELECT `w`.`word_id`, `w`.`name`, `w`.`pronunciation`, `w`.`part_of_speech`, `w`.`simple_definition`, `w`.`long_definition` ";
- $word_query .= "FROM `words` AS `w` LEFT JOIN `dictionaries` AS `d` ON `w`.`dictionary`=`d`.`id` ";
- $word_query .= "WHERE `d`.`is_public`=1 AND `w`.`dictionary`=" . $dictionary_to_load . (($display_mode == "word") ? " AND `w`.`word_id`=" . $word_to_load : "") . " ";
- $word_query .= "ORDER BY IF(`d`.`sort_by_equivalent`, `w`.`simple_definition`, `w`.`name`) COLLATE utf8_unicode_ci;";
-
- try {
- $dictionary_results = $dbconnection->prepare($dictionary_query);
- $dictionary_results->execute();
- if ($dictionary_results) {
- $word_results = $dbconnection->prepare($word_query);
- $word_results->execute();
- $dictionary_words = "[";
- if ($word_results) {
- $words_counted = 0;
- $words_total = num_rows($word_results);
- while ($word = fetch($word_results)) {
- $words_counted++;
- $word_name = $word['name'];
- $dictionary_words .= '{"name":"' . $word['name'] . '",';
- $dictionary_words .= '"pronunciation":"' . $word['pronunciation'] . '",';
- $dictionary_words .= '"partOfSpeech":"' . $word['part_of_speech'] . '",';
- $dictionary_words .= '"simpleDefinition":"' . $word['simple_definition'] . '",';
- $dictionary_words .= '"longDefinition":"' . $word['long_definition'] . '",';
- $dictionary_words .= '"wordId":"' . $word['word_id'] . '"';
- $dictionary_words .= '}';
-
- if ($words_counted < $words_total) {
- $dictionary_words .= ',';
- }
- }
- }
- $dictionary_words .= "]";
-
- if (num_rows($dictionary_results) === 1) {
- while ($dict = fetch($dictionary_results)) {
- $dictionary_name = $dict['name'];
- $dictionary_creator = $dict['public_name'];
- $is_owner = $current_user == $dict['user'];
- $the_public_dictionary = '{"name":"' . $dict['name'] . '",';
- $the_public_dictionary .= '"description":"' . $dict['description'] . '",';
- $the_public_dictionary .= '"createdBy":"' . $dict['public_name'] . '",';
- $the_public_dictionary .= '"words":' . $dictionary_words . ',';
- $the_public_dictionary .= '"settings":{';
- $the_public_dictionary .= '"partsOfSpeech":"' . $dict['parts_of_speech'] . '",';
- $the_public_dictionary .= '"isComplete":' . (($dict['is_complete'] == 1) ? 'true' : 'false') . '},';
- $the_public_dictionary .= '"id":"' . $dictionary_to_load . '"';
- $the_public_dictionary .= '}';
- }
- }
- }
- }
- catch (PDOException $ex) {}
-}
-
-?>
-
-
-
-
-
-
-
- Dictionary on Lexiconga
- " />
-
- Dictionary" />
-
-
-
-
- Lexiconga Dictionary Builder
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Click the button below to reload the page and show the Reset Password form. Filling out this form will instantly change your password, and you will need to log in using the new password from that point forward.
- Reset Password
-
-
-
-
-
-
-
-
-
-
-
Dictionary Deleted
- Select dictionary to load:
-
-
-
Or
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/defiant.js b/js/defiant.js
deleted file mode 100644
index c739d6e..0000000
--- a/js/defiant.js
+++ /dev/null
@@ -1,687 +0,0 @@
-/*
- * Defiant.js v1.2.5
- * Serch JSON structures plus smart templating with XSLT and XPath.
- * http://defiantjs.com
- *
- * Copyright (c) 2013-2015, Hakan Bilgin
- * Licensed under the MIT License
- *
- * NOTE:
- * Robbie Antenesse edited line 165's RegExp to search global and case-insensitive in case of multiple contains() groups.
- */
-
-if (typeof module === "undefined") {
- var module = { exports: undefined };
-} else {
- // Node env adaptation goes here...
-}
-
-module.exports = Defiant = (function(window, undefined) {
- 'use strict';
-
- var Defiant = {
- is_ie : /msie/i.test(navigator.userAgent),
- is_safari : /safari/i.test(navigator.userAgent),
- env : 'production',
- xml_decl : '',
- namespace : 'xmlns:d="defiant-namespace"',
- tabsize : 4,
- render: function(template, data) {
- var processor = new XSLTProcessor(),
- span = document.createElement('span'),
- opt = {match: '/'},
- tmpltXpath,
- scripts,
- temp,
- sorter;
- // handle arguments
- switch (typeof(template)) {
- case 'object':
- this.extend(opt, template);
- if (!opt.data) opt.data = data;
- break;
- case 'string':
- opt.template = template;
- opt.data = data;
- break;
- default:
- throw 'error';
- }
- opt.data = JSON.toXML(opt.data);
- tmpltXpath = '//xsl:template[@name="'+ opt.template +'"]';
-
- if (!this.xsl_template) this.gatherTemplates();
-
- if (opt.sorter) {
- sorter = this.node.selectSingleNode(this.xsl_template, tmpltXpath +'//xsl:for-each//xsl:sort');
- if (sorter) {
- if (opt.sorter.order) sorter.setAttribute('order', opt.sorter.order);
- if (opt.sorter.select) sorter.setAttribute('select', opt.sorter.select);
- sorter.setAttribute('data-type', opt.sorter.type || 'text');
- }
- }
-
- temp = this.node.selectSingleNode(this.xsl_template, tmpltXpath);
- temp.setAttribute('match', opt.match);
- processor.importStylesheet(this.xsl_template);
- span.appendChild(processor.transformToFragment(opt.data, document));
- temp.removeAttribute('match');
-
- if (this.is_safari) {
- scripts = span.getElementsByTagName('script');
- for (var i=0, il=scripts.length; i'+ str.replace(/defiant:(\w+)/g, '$1') +'');
- },
- getSnapshot: function(data) {
- return JSON.toXML(data, true);
- },
- xmlFromString: function(str) {
- var parser,
- doc;
- str = str.replace(/>\s{1,}<');
- if (str.trim().match(/<\?xml/) === null) {
- str = this.xml_decl + str;
- }
- if (this.is_ie) {
- doc = new ActiveXObject('Msxml2.DOMDocument');
- doc.loadXML(str);
- if (str.indexOf('xsl:stylesheet') === -1) {
- doc.setProperty('SelectionLanguage', 'XPath');
- }
- } else {
- parser = new DOMParser();
- doc = parser.parseFromString(str, 'text/xml');
- }
- return doc;
- },
- extend: function(src, dest) {
- for (var content in dest) {
- if (!src[content] || typeof(dest[content]) !== 'object') {
- src[content] = dest[content];
- } else {
- this.extend(src[content], dest[content]);
- }
- }
- return src;
- },
- node: {}
- };
-
- return Defiant;
-
-})(this);
-
-
-if (typeof(XSLTProcessor) === 'undefined') {
-
- // emulating XSLT Processor (enough to be used in defiant)
- var XSLTProcessor = function() {};
- XSLTProcessor.prototype = {
- importStylesheet: function(xsldoc) {
- this.xsldoc = xsldoc;
- },
- transformToFragment: function(data, doc) {
- var str = data.transformNode(this.xsldoc),
- span = document.createElement('span');
- span.innerHTML = str;
- return span;
- }
- };
-
-}
-
-
-// extending STRING
-if (!String.prototype.fill) {
- String.prototype.fill = function(i,c) {
- var str = this;
- c = c || ' ';
- for (; str.length/,
- rx_constructor : /<(.+?)( d:contr=".*?")>/,
- rx_namespace : / xmlns\:d="defiant\-namespace"/,
- rx_data : /(<.+?>)(.*?)(<\/d:data>)/i,
- rx_function : /function (\w+)/i,
- to_xml: function(tree) {
- var str = this.hash_to_xml(null, tree);
- return Defiant.xmlFromString(str);
- },
- hash_to_xml: function(name, tree, array_child) {
- var is_array = tree.constructor === Array,
- elem = [],
- attr = [],
- key,
- val,
- val_is_array,
- type,
- is_attr,
- cname,
- constr,
- cnName,
- i;
-
- for (key in tree) {
- val = tree[key];
- if (val === null || val === undefined || val.toString() === 'NaN') val = null;
-
- is_attr = key.slice(0,1) === '@';
- cname = array_child ? name : key;
- if (cname == +cname && tree.constructor !== Object) cname = 'd:item';
- if (val === null) {
- constr = null;
- cnName = false;
- } else {
- constr = val.constructor;
- cnName = constr.toString().match(this.rx_function)[1];
- }
-
- if (is_attr) {
- attr.push( cname.slice(1) +'="'+ this.escape_xml(val) +'"' );
- if (cnName !== 'String') attr.push( 'd:'+ cname.slice(1) +'="'+ cnName +'"' );
- } else if (val === null) {
- elem.push( this.scalar_to_xml( cname, val ) );
- } else {
- switch (constr) {
- case Function:
- // if constructor is function, then it's not a JSON structure
- // throw ERROR ?
- break;
- case Object:
- elem.push( this.hash_to_xml( cname, val ) );
- break;
- case Array:
- if (key === cname) {
- val_is_array = val.constructor === Array;
- if (val_is_array) {
- i = val.length;
- while (i--) {
- if (val[i].constructor === Array) val_is_array = true;
- if (!val_is_array && val[i].constructor === Object) val_is_array = true;
- }
- }
- elem.push( this.scalar_to_xml( cname, val, val_is_array ) );
- break;
- }
- /* falls through */
- case String:
- if (typeof(val) === 'string') {
- val = val.toString().replace(/\&/g, '&')
- .replace(/\r|\n/g, '
');
- }
- if (cname === '#text') {
- // prepare map
- this.map.push(tree);
- attr.push('d:mi="'+ this.map.length +'"');
- attr.push('d:constr="'+ cnName +'"');
- elem.push( this.escape_xml(val) );
- break;
- }
- /* falls through */
- case Number:
- case Boolean:
- if (cname === '#text' && cnName !== 'String') {
- // prepare map
- this.map.push(tree);
- attr.push('d:mi="'+ this.map.length +'"');
- attr.push('d:constr="'+ cnName +'"');
- elem.push( this.escape_xml(val) );
- break;
- }
- elem.push( this.scalar_to_xml( cname, val ) );
- break;
- }
- }
- }
- if (!name) {
- name = 'd:data';
- attr.push(Defiant.namespace);
- if (is_array) attr.push('d:constr="Array"');
- }
- if (name.match(this.rx_validate_name) === null) {
- attr.push( 'd:name="'+ name +'"' );
- name = 'd:name';
- }
- if (array_child) return elem.join('');
- // prepare map
- this.map.push(tree);
- attr.push('d:mi="'+ this.map.length +'"');
-
- return '<'+ name + (attr.length ? ' '+ attr.join(' ') : '') + (elem.length ? '>'+ elem.join('') +''+ name +'>' : '/>' );
- },
- scalar_to_xml: function(name, val, override) {
- var attr = '',
- text,
- constr,
- cnName;
-
- // check whether the nodename is valid
- if (name.match(this.rx_validate_name) === null) {
- attr += ' d:name="'+ name +'"';
- name = 'd:name';
- override = false;
- }
- if (val === null || val.toString() === 'NaN') val = null;
- if (val === null) return '<'+ name +' d:constr="null"/>';
- if (val.length === 1 && val[0].constructor === Object) {
-
- text = this.hash_to_xml(false, val[0]);
-
- var a1 = text.match(this.rx_node),
- a2 = text.match(this.rx_constructor);
- a1 = (a1 !== null)? a1[2]
- .replace(this.rx_namespace, '')
- .replace(/>/, '')
- .replace(/"\/$/, '"') : '';
- a2 = (a2 !== null)? a2[2] : '';
-
- text = text.match(this.rx_data);
- text = (text !== null)? text[2] : '';
-
- return '<'+ name + a1 +' '+ a2 +' d:type="ArrayItem">'+ text +''+ name +'>';
- } else if (val.length === 0 && val.constructor === Array) {
- return '<'+ name +' d:constr="Array"/>';
- }
- // else
- if (override) {
- return this.hash_to_xml( name, val, true );
- }
-
- constr = val.constructor;
- cnName = constr.toString().match(this.rx_function)[1];
- text = (constr === Array) ? this.hash_to_xml( 'd:item', val, true )
- : this.escape_xml(val);
-
- attr += ' d:constr="'+ cnName +'"';
- // prepare map
- this.map.push(val);
- attr += ' d:mi="'+ this.map.length +'"';
-
- return (name === '#text') ? this.escape_xml(val) : '<'+ name + attr +'>'+ text +''+ name +'>';
- },
- escape_xml: function(text) {
- return String(text) .replace(//g, '>')
- .replace(/"/g, '"')
- .replace(/ /g, ' ');
- }
- },
- doc = interpreter.to_xml.call(interpreter, tree);
-
- // snapshot distinctly improves performance
- if (snapshot) {
- return {
- doc: doc,
- src: tree,
- map: interpreter.map
- };
- }
-
- this.search.map = interpreter.map;
- return doc;
- };
-}
-
-if (!JSON.search) {
- JSON.search = function(tree, xpath, single) {
- 'use strict';
-
- var isSnapshot = tree.doc && tree.doc.nodeType,
- doc = isSnapshot ? tree.doc : JSON.toXML(tree),
- map = isSnapshot ? tree.map : this.search.map,
- src = isSnapshot ? tree.src : tree,
- xres = Defiant.node[ single ? 'selectSingleNode' : 'selectNodes' ](doc, xpath.xTransform()),
- ret = [],
- mapIndex,
- i;
-
- if (single) xres = [xres];
- i = xres.length;
-
- while (i--) {
- switch(xres[i].nodeType) {
- case 2:
- case 3:
- ret.unshift( xres[i].nodeValue );
- break;
- default:
- mapIndex = +xres[i].getAttribute('d:mi');
- if (map[mapIndex-1]) ret.unshift( map[mapIndex-1] );
- }
- }
-
- // if environment = development, add search tracing
- if (Defiant.env === 'development') {
- this.trace = JSON.mtrace(src, ret, xres);
- }
-
- return ret;
- };
-}
-
-if (!JSON.mtrace) {
- JSON.mtrace = function(root, hits, xres) {
- 'use strict';
-
- var win = window,
- stringify = JSON.stringify,
- sroot = stringify( root, null, '\t' ).replace(/\t/g, ''),
- trace = [],
- i = 0,
- il = xres.length,
- od = il ? xres[i].ownerDocument.documentElement : false,
- map = this.search.map,
- hstr,
- cConstr,
- fIndex = 0,
- mIndex,
- lStart,
- lEnd;
-
- for (; i 0)? xI[0] : null;
- } else {
- return XNode.selectSingleNode(XPath);
- }
-};
-
-
-Defiant.node.prettyPrint = function(node) {
- var root = Defiant,
- tabs = root.tabsize,
- decl = root.xml_decl.toLowerCase(),
- ser,
- xstr;
- if (root.is_ie) {
- xstr = node.xml;
- } else {
- ser = new XMLSerializer();
- xstr = ser.serializeToString(node);
- }
- if (root.env !== 'development') {
- // if environment is not development, remove defiant related info
- xstr = xstr.replace(/ \w+\:d=".*?"| d\:\w+=".*?"/g, '');
- }
- var str = xstr.trim().replace(/(>)\s*(<)(\/*)/g, '$1\n$2$3'),
- lines = str.split('\n'),
- indent = -1,
- i = 0,
- il = lines.length,
- start,
- end;
- for (; i/g) !== null;
- //start = lines[i].match(/<[^\/]+>/g) !== null;
- end = lines[i].match(/<\/[\w\:]+>/g) !== null;
- if (lines[i].match(/<.*?\/>/g) !== null) start = end = true;
- if (start) indent++;
- lines[i] = String().fill(indent, '\t') + lines[i];
- if (start && end) indent--;
- if (!start && end) indent--;
- }
- return lines.join('\n').replace(/\t/g, String().fill(tabs, ' '));
-};
-
-
-Defiant.node.toJSON = function(xnode, stringify) {
- 'use strict';
-
- var interpret = function(leaf) {
- var obj = {},
- win = window,
- attr,
- type,
- item,
- cname,
- cConstr,
- cval,
- text,
- i, il, a;
-
- switch (leaf.nodeType) {
- case 1:
- cConstr = leaf.getAttribute('d:constr');
- if (cConstr === 'Array') obj = [];
- else if (cConstr === 'String' && leaf.textContent === '') obj = '';
-
- attr = leaf.attributes;
- i = 0;
- il = attr.length;
- for (; i= 0) {
- if (WordAtIndexWasChanged(wordIndex, word, pronunciation, partOfSpeech, simpleDefinition, longDefinition)) {
- document.getElementById("newWordButtonArea").style.display = "none";
- DisableForm('');
- updateConflictArea.style.display = "block";
-
- var updateConflictText = "\"" + word + "\" is already in the dictionary";
- if (currentDictionary.words[wordIndex].name != word) {
- updateConflictText += " as \"" + currentDictionary.words[wordIndex].name + "\", and your dictionary is set to ignore case.";
- } else {
- updateConflictText += "."
- }
- updateConflictText += " Do you want to update it to what you have set above?";
- updateConflictText += '';
- updateConflictText += ' ';
-
- updateConflictArea.innerHTML = updateConflictText;
- } else {
- errorMessage = "\"" + word + "\" is already in the dictionary exactly as it is written above";
- if (currentDictionary.words[wordIndex].name != word) {
- errorMessage += ". (Your dictionary is currently set to ignore case.)"
- }
- }
- } else {
- currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: ((partOfSpeech.length > 0) ? partOfSpeech : " "), simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++});
- SaveAndUpdateWords("new");
- FocusAfterAddingNewWord();
- NewWordNotification(word);
- }
-
- errorMessageArea.innerHTML = "";
- } else {
- if (word == "") {
- errorMessage += "Word cannot be blank";
- if (simpleDefinition == "" && longDefinition == "") {
- errorMessage += " and you need at least one definition.";
- } else {
- errorMessage += ".";
- }
- } else if (simpleDefinition == "" && longDefinition == "") {
- errorMessage += "You need at least one definition."
- }
- }
-
- errorMessageArea.innerHTML = errorMessage;
-}
-
-function ShowWordEditForm(index) {
- var indexString = index.toString(); // Variable for reduced processing
- var word = currentDictionary.words[index]; // Reference for easier reading
- var editForm = '';
-
- document.getElementById("entry" + indexString).innerHTML = editForm;
-
- SetPartsOfSpeech("partOfSpeech" + indexString);
- document.getElementById("partOfSpeech" + indexString).value = htmlEntitiesParse(word.partOfSpeech);
-
- document.getElementById("word" + indexString).focus();
-}
-
-function CancelEditForm(index) {
- document.getElementById("entry" + index.toString()).innerHTML = DictionaryEntry(index).replace("", "").replace("", "");
-}
-
-function EditWord(indexString) {
- var word = htmlEntities(document.getElementById("word" + indexString).value).trim();
- var pronunciation = htmlEntities(document.getElementById("pronunciation" + indexString).value).trim();
- var partOfSpeech = htmlEntities(document.getElementById("partOfSpeech" + indexString).value).trim();
- var simpleDefinition = htmlEntities(document.getElementById("simpleDefinition" + indexString).value).trim();
- var longDefinition = htmlEntities(document.getElementById("longDefinition" + indexString).value);
-
- var errorMessageArea = document.getElementById("errorMessage" + indexString);
- var errorMessage = "";
- var updateConflictArea = document.getElementById("updateConflict" + indexString);
-
- if (WordAtIndexWasChanged(indexString, word, pronunciation, partOfSpeech, simpleDefinition, longDefinition)) {
- document.getElementById("editWordButtonArea" + indexString).style.display = "none";
- DisableForm(indexString);
- updateConflictArea.style.display = "block";
- updateConflictArea.innerHTML = "Do you really want to change the word \"" + currentDictionary.words[parseInt(indexString)].name + "\" to what you have set above? ";
- updateConflictArea.innerHTML += '';
- updateConflictArea.innerHTML += '';
- } else {
- errorMessage = "No change has been made to \"" + word + "\"";
- if (currentDictionary.words[parseInt(indexString)].name != word) {
- errorMessage += ". (Your dictionary is currently set to ignore case.)";
- }
- }
-
- errorMessageArea.innerHTML = errorMessage;
-
- if (document.getElementById("updateConfirmButton" + indexString)) {
- document.getElementById("updateConfirmButton" + indexString).focus();
- }
-}
-
-function UpdateWord(wordIndex, word, pronunciation, partOfSpeech, simpleDefinition, longDefinition) {
- SaveScroll();
-
- currentDictionary.words[wordIndex].name = word;
- currentDictionary.words[wordIndex].pronunciation = pronunciation;
- currentDictionary.words[wordIndex].partOfSpeech = ((partOfSpeech.length > 0) ? partOfSpeech : " ");
- currentDictionary.words[wordIndex].simpleDefinition = simpleDefinition;
- currentDictionary.words[wordIndex].longDefinition = longDefinition;
-
- SaveAndUpdateWords("update", wordIndex);
-
- window.scroll(savedScroll.x, savedScroll.y);
-
- if (!wordFormIsLocked()) {
- FocusAfterAddingNewWord();
- }
-}
-
-function DeleteWord(index) {
- var deleteWord = new XMLHttpRequest();
- deleteWord.open('POST', "/php/ajax_dictionarymanagement.php?action=worddelete");
- deleteWord.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- deleteWord.onreadystatechange = function() {
- if (deleteWord.readyState == 4 && deleteWord.status == 200) {
- if (deleteWord.responseText == "deleted successfully" || deleteWord.responseText == "not signed in") {
- currentDictionary.words.splice(index, 1);
-
- SaveWords(false);
- }
- console.log(deleteWord.responseText);
- return true;
- } else {
- return false;
- }
- }
- deleteWord.send("dict=" + currentDictionary.externalID.toString() + "&word=" + currentDictionary.words[index].wordId.toString());
-}
-
-function ShowDictionary() {
- var filters = GetSelectedFilters();
-
- var searchResults = [];
- var search = htmlEntitiesParseForSearchEntry(document.getElementById("searchBox").value);
- var searchByWord = document.getElementById("searchOptionWord").checked;
- var searchBySimple = document.getElementById("searchOptionSimple").checked;
- var searchByLong = document.getElementById("searchOptionLong").checked;
- var searchIgnoreCase = !document.getElementById("searchCaseSensitive").checked; //It's easier to negate case here instead of negating it every use since ignore case is default.
- var searchIgnoreDiacritics = document.getElementById("searchIgnoreDiacritics").checked;
- if (search != "" && (searchByWord || searchBySimple || searchByLong)) {
- var xpath = [];
- var searchDictionaryJSON = htmlEntitiesParseForSearch(JSON.stringify(currentDictionary));
- if (searchIgnoreCase) {
- search = search.toLowerCase();
- }
- if (searchIgnoreDiacritics) {
- search = removeDiacritics(search);
- searchDictionaryJSON = removeDiacritics(searchDictionaryJSON);
- }
- if (searchByWord) {
- xpath.push('contains('+ ((searchIgnoreCase) ? 'name' : 'translate(name, "", "")') +', "'+ search +'")');
- }
- if (searchBySimple) {
- xpath.push('contains('+ ((searchIgnoreCase) ? 'simpleDefinition' : 'translate(simpleDefinition, "", "")') +', "'+ search +'")');
- }
- if (searchByLong) {
- xpath.push('contains('+ ((searchIgnoreCase) ? 'longDefinition' : 'translate(longDefinition, "", "")') +', "'+ search +'")');
- }
- var searchDictionary = JSON.parse(searchDictionaryJSON);
- searchResults = JSON.search(searchDictionary, '//words['+ xpath.join(' or ') +']/wordId');
- }
-
- var dictionaryNameArea = document.getElementById("dictionaryName");
- dictionaryNameArea.innerHTML = currentDictionary.name + " Dictionary";
- if (loggedIn && currentDictionary.settings.isPublic) {
- dictionaryNameArea.innerHTML += "➦";
- }
-
- var dictionaryDescriptionArea = document.getElementById("dictionaryDescription");
- dictionaryDescriptionArea.innerHTML = marked(htmlEntitiesParseForMarkdown(currentDictionary.description));
-
- var dictionaryArea = document.getElementById("theDictionary");
- var dictionaryText = "";
- var numberOfWordsDisplayed = 0;
-
- if (currentDictionary.words.length > 0) {
- for (var i = 0; i < currentDictionary.words.length; i++) {
- if (filters.length == 0 || (filters.length > 0 && filters.indexOf(currentDictionary.words[i].partOfSpeech) > -1)) {
- if (search == "" || (search != "" && (searchByWord || searchBySimple || searchByLong) && searchResults.indexOf(currentDictionary.words[i].wordId) >= 0)) {
- if (!currentDictionary.words[i].hasOwnProperty("pronunciation")) {
- currentDictionary.words[i].pronunciation = ""; //Account for new property
- }
- if (!currentDictionary.words[i].hasOwnProperty("wordId")) {
- currentDictionary.words[i].wordId = i + 1; //Account for new property
- }
- dictionaryText += DictionaryEntry(i);
- numberOfWordsDisplayed++;
- }
- }
- }
- } else {
- dictionaryText = "There are no entries in the dictionary.";
- }
-
- dictionaryArea.innerHTML = dictionaryText;
- ShowFilterWordCount(numberOfWordsDisplayed);
-}
-
-function DictionaryEntry(itemIndex) {
- var searchTerm = regexParseForSearch(document.getElementById("searchBox").value);
- var searchByWord = document.getElementById("searchOptionWord").checked;
- var searchBySimple = document.getElementById("searchOptionSimple").checked;
- var searchByLong = document.getElementById("searchOptionLong").checked;
- var searchIgnoreCase = !document.getElementById("searchCaseSensitive").checked; //It's easier to negate case here instead of negating it every use since ignore case is default.
- var searchIgnoreDiacritics = document.getElementById("searchIgnoreDiacritics").checked;
-
- var searchRegEx = new RegExp("(" + ((searchIgnoreDiacritics) ? removeDiacritics(searchTerm) + "|" + searchTerm : searchTerm) + ")", "g" + ((searchIgnoreCase) ? "i" : ""));
-
- var wordName = wordPronunciation = wordPartOfSpeech = wordSimpleDefinition = wordLongDefinition = "";
-
- if (searchTerm != "" && searchByWord) {
- // Parse HTML Entities while searching so the regex can search actual characters instead of HTML.
- wordName += htmlEntities(htmlEntitiesParse(currentDictionary.words[itemIndex].name).replace(searchRegEx, "$1")).replace(/<(\/?)searchterm>/g, '<$1searchterm>');
- } else {
- // Don't need to parse if not searching because HTML displays correctly anyway!
- wordName += currentDictionary.words[itemIndex].name.toString(); // Use toString() to prevent using a reference instead of the value.
- }
-
- if (currentDictionary.words[itemIndex].pronunciation != "") {
- wordPronunciation += marked(htmlEntitiesParseForMarkdown(currentDictionary.words[itemIndex].pronunciation)).replace(/<\/?p>/g,"");
- }
-
- if (currentDictionary.words[itemIndex].partOfSpeech != " " && currentDictionary.words[itemIndex].partOfSpeech != "") {
- wordPartOfSpeech += currentDictionary.words[itemIndex].partOfSpeech.toString();
- }
-
- if (currentDictionary.words[itemIndex].simpleDefinition != "") {
- if (searchTerm != "" && searchBySimple) {
- wordSimpleDefinition += htmlEntities(htmlEntitiesParse(currentDictionary.words[itemIndex].simpleDefinition).replace(searchRegEx, "$1")).replace(/<(\/?)searchterm>/g, '<$1searchterm>');
- } else {
- wordSimpleDefinition += currentDictionary.words[itemIndex].simpleDefinition.toString();
- }
- }
-
- if (currentDictionary.words[itemIndex].longDefinition != "") {
- if (searchTerm != "" && searchByLong) {
- wordLongDefinition += marked(htmlEntitiesParseForMarkdown(htmlEntities(htmlEntitiesParse(currentDictionary.words[itemIndex].longDefinition).replace(searchRegEx, "$1")))).replace(/<(\/?)searchterm>\;/g, '<$1searchterm>');
- } else {
- wordLongDefinition += marked(htmlEntitiesParseForMarkdown(currentDictionary.words[itemIndex].longDefinition));
- }
- }
-
- return DictionaryEntryTemplate({
- name : wordName,
- pronunciation : wordPronunciation,
- partOfSpeech : wordPartOfSpeech,
- simpleDefinition : wordSimpleDefinition,
- longDefinition : wordLongDefinition,
- wordId : currentDictionary.words[itemIndex].wordId.toString()
- }, (!currentDictionary.settings.isComplete) ? itemIndex : false);
-}
-
-function ManagementArea(itemIndex) {
- var managementHTML = "
");
- HideSettings();
-
- ChangeDictionaryToId(userDictionariesSelect.value, function(response) {
- if (response == "no dictionaries") {
- console.log(response);
- SendDictionary(false);
- } else if (response.length < 60) {
- console.log(response);
- } else {
- currentDictionary = JSON.parse(response);
- SaveDictionary(false);
- ProcessLoad();
- LoadUserDictionaries();
- HideInfo(); // Hide the loading screen.
- }
- });
- }
-}
-
-function ChangeDictionaryToId(dictionaryId, callbackFunction) {
- var changeDictionaryRequest = new XMLHttpRequest();
- changeDictionaryRequest.open('POST', "/php/ajax_dictionarymanagement.php?action=switch");
- changeDictionaryRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- var postString = "newdictionaryid=" + dictionaryId.toString();
- changeDictionaryRequest.onreadystatechange = function() {
- if (changeDictionaryRequest.readyState == 4 && changeDictionaryRequest.status == 200) {
- callbackFunction(changeDictionaryRequest.responseText);
- }
- }
- changeDictionaryRequest.send(postString);
-}
-
-function LoadLocalDictionary() {
- if (localStorage.getItem('dictionary')) {
- var tmpDictionary = JSON.parse(localStorage.getItem('dictionary'));
- if (tmpDictionary.words.length > 0 || tmpDictionary.description != "A new dictionary." || tmpDictionary.name != "New") {
- currentDictionary = JSON.parse(localStorage.getItem('dictionary'));
- }
- tmpDictionary = null;
- }
-}
-
-function ProcessLoad() {
- if (!currentDictionary.hasOwnProperty("nextWordId")) {
- currentDictionary.nextWordId = currentDictionary.words.length + 1;
- }
-
- HideSettingsWhenComplete();
-
- ShowDictionary();
-
- SetPartsOfSpeech();
-
- if (currentDictionary.settings.isComplete) {
- document.getElementById("wordEntryForm").style.display = "none";
- }
-
- SavePreviousDictionary();
-}
-
-function SavePreviousDictionary () {
- // Save non-word data to check if anything has changed (words can identify themselves if changed).
- // Used to minimize data pushed to database.
- previousDictionary = {
- name: currentDictionary.name,
- description: currentDictionary.description,
- nextWordId: currentDictionary.nextWordId,
- allowDuplicates: currentDictionary.settings.allowDuplicates,
- caseSensitive: currentDictionary.settings.caseSensitive,
- partsOfSpeech: currentDictionary.settings.partsOfSpeech,
- sortByEquivalent: currentDictionary.settings.sortByEquivalent,
- isComplete: currentDictionary.settings.isComplete,
- isPublic: currentDictionary.settings.isPublic
- };
-}
-
-function ExportDictionary() {
- var downloadName = removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g, '');
- if (downloadName == "") {
- downloadName = "export";
- }
- download(downloadName + ".dict", localStorage.getItem('dictionary'));
-}
-
-function ExportWords() {
- if (currentDictionary.words.length > 0) {
- var downloadName = removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g, '');
- if (downloadName == "") {
- downloadName = "export";
- }
- downloadName += "_words";
-
- var wordsCSV = "word,pronunciation,part of speech,definition,explanation\n";
- for (var i = 0; i < currentDictionary.words.length; i++) {
- var word = "\"" + htmlEntitiesParse(currentDictionary.words[i].name).trim().replace(/\"/g, "\"\"") + "\"";
- var pronunciation = "\"" + htmlEntitiesParse(currentDictionary.words[i].pronunciation).trim().replace(/\"/g, "\"\"") + "\"";
- var partOfSpeech = "\"" + htmlEntitiesParse(currentDictionary.words[i].partOfSpeech).trim().replace(/\"/g, "\"\"") + "\"";
- var simpleDefinition = "\"" + htmlEntitiesParse(currentDictionary.words[i].simpleDefinition).trim().replace(/\"/g, "\"\"") + "\"";
- var longDefinition = "\"" + htmlEntitiesParse(currentDictionary.words[i].longDefinition).replace(/\"/g, "\"\"") + "\"";
- wordsCSV += word + "," + pronunciation + "," + partOfSpeech + "," + simpleDefinition + "," + longDefinition + "\n";
- }
-
- download(downloadName + ".csv", wordsCSV);
- } else {
- alert("Dictionary must have at least 1 word to export.");
- }
-}
-
-function ImportDictionary() {
- if (currentDictionary.externalID > 0 || confirm("Importing this dictionary will overwrite your current one, making it impossible to retrieve if you have not already exported it! Do you still want to import?")) {
- if (!window.FileReader) {
- alert('Your browser is not supported');
- return false;
- }
-
- var reader = new FileReader();
- if (document.getElementById("importFile").files.length > 0) {
- var file = document.getElementById("importFile").files[0];
- // Read the file
- reader.readAsText(file);
- // When it's loaded, process it
- reader.onloadend = function () {
- if (reader.result && reader.result.length) {
- var tmpDicitonary = JSON.parse(reader.result);
-
- if (tmpDicitonary.hasOwnProperty("name") && tmpDicitonary.hasOwnProperty("description") &&
- tmpDicitonary.hasOwnProperty("words") && tmpDicitonary.hasOwnProperty("settings"))
- {
- currentDictionary = JSON.parse(reader.result);
- currentDictionary.externalID = 0; // Reset external id for imported dictionary.
- currentDictionary.settings.isPublic = false; // Reset public setting for imported dictionary.
- SaveDictionary(true);
- ProcessLoad();
- HideInfo();
- HideSettings();
- document.getElementById("importFile").value = "";
- NewNotification("Successfully Imported the \"" + currentDictionary.name + "\" Dictionary.");
- } else {
- var errorString = "File is missing:";
- if (!tmpDicitonary.hasOwnProperty("name"))
- errorString += " name";
- if (!tmpDicitonary.hasOwnProperty("description"))
- errorString += " description";
- if (!tmpDicitonary.hasOwnProperty("words"))
- errorString += " words";
- if (!tmpDicitonary.hasOwnProperty("settings"))
- errorString += " settings";
- alert("Uploaded file is not compatible.\n\n" + errorString);
- }
-
- tmpDicitonary = null;
- } else {
- alert("Upload Failed");
- }
- reader = null;
- }
- } else {
- alert("You must add a file to import.");
- }
- }
-}
-
-function ImportWords() {
- if (currentDictionary.externalID > 0 || confirm("This will add words in a correctly formatted CSV file to your currently loaded dictionary. Do you still want to import?")) {
- if (!window.FileReader) {
- alert('Your browser is not supported');
- return false;
- }
-
- if (document.getElementById("importWordsCSV").files.length > 0) {
- var file = document.getElementById("importWordsCSV").files[0];
-
- var resultsArea = document.getElementById("importOptions");
- resultsArea.innerHTML = "
Importing Words...
";
-
- var currentRow = 0; // Because of the header, the first row of data is always on line 2.
- var rowsImported = 0;
-
- Papa.parse(file, {
- header: true,
- step: function(row, parser) {
- currentRow++;
- // If there are no errors OR the word and either definition or explanation contain data, then import it.
- if ((row.data[0].word.trim().length > 0 && (row.data[0].definition.trim().length > 0 || row.data[0].explanation.trim().length > 0)) || row.errors.length == 0) {
- var wordName = htmlEntities(row.data[0]["word"]).trim(),
- wordPronunciation = htmlEntities(row.data[0]["pronunciation"]).trim(),
- wordPartOfSpeech = ((htmlEntities(row.data[0]["part of speech"]).trim().length > 0) ? htmlEntities(row.data[0]["part of speech"]).trim() : " "),
- wordSimpleDefinition = htmlEntities(row.data[0]["definition"]).trim(),
- wordLongDefinition = htmlEntities(row.data[0]["explanation"]).trim(),
- wordId = currentDictionary.nextWordId++;
-
- currentDictionary.words.push({name: wordName, pronunciation: wordPronunciation, partOfSpeech: wordPartOfSpeech, simpleDefinition: wordSimpleDefinition, longDefinition: wordLongDefinition, wordId: wordId});
-
- var wordEntry = DictionaryEntryTemplate(currentDictionary.words[currentDictionary.words.length - 1]);
- resultsArea.innerHTML += wordEntry;
-
- rowsImported++;
- } else {
- // If it's not just an empty line, give an error.
- if (row.data[0].word.trim().length > 0) {
- for (var i = 0; i < row.errors.length; i++) {
- resultsArea.innerHTML += "
Error on record #" + currentRow.toString() + ": " + row.errors[i].message + "
';
- }
- throw e;
- }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
- merge(marked.defaults, opt);
- return marked;
-};
-
-marked.defaults = {
- gfm: true,
- tables: true,
- breaks: false,
- pedantic: false,
- sanitize: false,
- sanitizer: null,
- mangle: true,
- smartLists: false,
- silent: false,
- highlight: null,
- langPrefix: 'lang-',
- smartypants: false,
- headerPrefix: '',
- renderer: new Renderer,
- xhtml: false
-};
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
- module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
- define(function() { return marked; });
-} else {
- this.marked = marked;
-}
-
-}).call(function() {
- return this || (typeof window !== 'undefined' ? window : global);
-}());
\ No newline at end of file
diff --git a/js/min/defiant.js b/js/min/defiant.js
deleted file mode 100644
index dbaa77e..0000000
--- a/js/min/defiant.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Defiant.js v1.2.5
- * Serch JSON structures plus smart templating with XSLT and XPath.
- * http://defiantjs.com
- *
- * Copyright (c) 2013-2015, Hakan Bilgin
- * Licensed under the MIT License
- *
- * NOTE:
- * Robbie Antenesse edited line 165's RegExp to search global and case-insensitive in case of multiple contains() groups.
- */
-if("undefined"==typeof module)var module={exports:void 0};if(module.exports=Defiant=function(t,e){"use strict";var r={is_ie:/msie/i.test(navigator.userAgent),is_safari:/safari/i.test(navigator.userAgent),env:"production",xml_decl:'',namespace:'xmlns:d="defiant-namespace"',tabsize:4,render:function(t,e){var r,n,a,s,i=new XSLTProcessor,o=document.createElement("span"),l={match:"/"};switch(typeof t){case"object":this.extend(l,t),l.data||(l.data=e);break;case"string":l.template=t,l.data=e;break;default:throw"error"}if(l.data=JSON.toXML(l.data),r='//xsl:template[@name="'+l.template+'"]',this.xsl_template||this.gatherTemplates(),l.sorter&&(s=this.node.selectSingleNode(this.xsl_template,r+"//xsl:for-each//xsl:sort"),s&&(l.sorter.order&&s.setAttribute("order",l.sorter.order),l.sorter.select&&s.setAttribute("select",l.sorter.select),s.setAttribute("data-type",l.sorter.type||"text"))),a=this.node.selectSingleNode(this.xsl_template,r),a.setAttribute("match",l.match),i.importStylesheet(this.xsl_template),o.appendChild(i.transformToFragment(l.data,document)),a.removeAttribute("match"),this.is_safari){n=o.getElementsByTagName("script");for(var c=0,u=n.length;u>c;c++)n[c].defer=!0}return o.innerHTML},gatherTemplates:function(){for(var t=document.getElementsByTagName("script"),e="",r=0,n=t.length;n>r;r++)"defiant/xsl-template"===t[r].type&&(e+=t[r].innerHTML);this.xsl_template=this.xmlFromString('"+e.replace(/defiant:(\w+)/g,"$1")+"")},getSnapshot:function(t){return JSON.toXML(t,!0)},xmlFromString:function(t){var e,r;return t=t.replace(/>\s{1,}<"),null===t.trim().match(/<\?xml/)&&(t=this.xml_decl+t),this.is_ie?(r=new ActiveXObject("Msxml2.DOMDocument"),r.loadXML(t),-1===t.indexOf("xsl:stylesheet")&&r.setProperty("SelectionLanguage","XPath")):(e=new DOMParser,r=e.parseFromString(t,"text/xml")),r},extend:function(t,e){for(var r in e)t[r]&&"object"==typeof e[r]?this.extend(t[r],e[r]):t[r]=e[r];return t},node:{}};return r}(this),"undefined"==typeof XSLTProcessor){var XSLTProcessor=function(){};XSLTProcessor.prototype={importStylesheet:function(t){this.xsldoc=t},transformToFragment:function(t,e){var r=t.transformNode(this.xsldoc),n=document.createElement("span");return n.innerHTML=r,n}}}String.prototype.fill||(String.prototype.fill=function(t,e){var r=this;for(e=e||" ";r.length/,rx_constructor:/<(.+?)( d:contr=".*?")>/,rx_namespace:/ xmlns\:d="defiant\-namespace"/,rx_data:/(<.+?>)(.*?)(<\/d:data>)/i,rx_function:/function (\w+)/i,to_xml:function(t){var e=this.hash_to_xml(null,t);return Defiant.xmlFromString(e)},hash_to_xml:function(t,e,r){var n,a,s,i,o,l,c,u,h=e.constructor===Array,d=[],m=[];for(n in e)if(a=e[n],null!==a&&void 0!==a&&"NaN"!==a.toString()||(a=null),i="@"===n.slice(0,1),o=r?t:n,o==+o&&e.constructor!==Object&&(o="d:item"),null===a?(l=null,c=!1):(l=a.constructor,c=l.toString().match(this.rx_function)[1]),i)m.push(o.slice(1)+'="'+this.escape_xml(a)+'"'),"String"!==c&&m.push("d:"+o.slice(1)+'="'+c+'"');else if(null===a)d.push(this.scalar_to_xml(o,a));else switch(l){case Function:break;case Object:d.push(this.hash_to_xml(o,a));break;case Array:if(n===o){if(s=a.constructor===Array)for(u=a.length;u--;)a[u].constructor===Array&&(s=!0),s||a[u].constructor!==Object||(s=!0);d.push(this.scalar_to_xml(o,a,s));break}case String:if("string"==typeof a&&(a=a.toString().replace(/\&/g,"&").replace(/\r|\n/g,"
")),"#text"===o){this.map.push(e),m.push('d:mi="'+this.map.length+'"'),m.push('d:constr="'+c+'"'),d.push(this.escape_xml(a));break}case Number:case Boolean:if("#text"===o&&"String"!==c){this.map.push(e),m.push('d:mi="'+this.map.length+'"'),m.push('d:constr="'+c+'"'),d.push(this.escape_xml(a));break}d.push(this.scalar_to_xml(o,a))}return t||(t="d:data",m.push(Defiant.namespace),h&&m.push('d:constr="Array"')),null===t.match(this.rx_validate_name)&&(m.push('d:name="'+t+'"'),t="d:name"),r?d.join(""):(this.map.push(e),m.push('d:mi="'+this.map.length+'"'),"<"+t+(m.length?" "+m.join(" "):"")+(d.length?">"+d.join("")+""+t+">":"/>"))},scalar_to_xml:function(t,e,r){var n,a,s,i="";if(null===t.match(this.rx_validate_name)&&(i+=' d:name="'+t+'"',t="d:name",r=!1),null!==e&&"NaN"!==e.toString()||(e=null),null===e)return"<"+t+' d:constr="null"/>';if(1===e.length&&e[0].constructor===Object){n=this.hash_to_xml(!1,e[0]);var o=n.match(this.rx_node),l=n.match(this.rx_constructor);return o=null!==o?o[2].replace(this.rx_namespace,"").replace(/>/,"").replace(/"\/$/,'"'):"",l=null!==l?l[2]:"",n=n.match(this.rx_data),n=null!==n?n[2]:"","<"+t+o+" "+l+' d:type="ArrayItem">'+n+""+t+">"}return 0===e.length&&e.constructor===Array?"<"+t+' d:constr="Array"/>':r?this.hash_to_xml(t,e,!0):(a=e.constructor,s=a.toString().match(this.rx_function)[1],n=a===Array?this.hash_to_xml("d:item",e,!0):this.escape_xml(e),i+=' d:constr="'+s+'"',this.map.push(e),i+=' d:mi="'+this.map.length+'"',"#text"===t?this.escape_xml(e):"<"+t+i+">"+n+""+t+">")},escape_xml:function(t){return String(t).replace(//g,">").replace(/"/g,""").replace(/ /g," ")}},n=r.to_xml.call(r,t);return e?{doc:n,src:t,map:r.map}:(this.search.map=r.map,n)}),JSON.search||(JSON.search=function(t,e,r){"use strict";var n,a,s=t.doc&&t.doc.nodeType,i=s?t.doc:JSON.toXML(t),o=s?t.map:this.search.map,l=s?t.src:t,c=Defiant.node[r?"selectSingleNode":"selectNodes"](i,e.xTransform()),u=[];for(r&&(c=[c]),a=c.length;a--;)switch(c[a].nodeType){case 2:case 3:u.unshift(c[a].nodeValue);break;default:n=+c[a].getAttribute("d:mi"),o[n-1]&&u.unshift(o[n-1])}return"development"===Defiant.env&&(this.trace=JSON.mtrace(l,u,c)),u}),JSON.mtrace||(JSON.mtrace=function(t,e,r){"use strict";for(var n,a,s,i,o,l=window,c=JSON.stringify,u=c(t,null," ").replace(/\t/g,""),h=[],d=0,m=r.length,p=m?r[d].ownerDocument.documentElement:!1,f=(this.search.map,0);m>d;d++){switch(r[d].nodeType){case 2:a=r[d].ownerElement?r[d].ownerElement.getAttribute("d:"+r[d].nodeName):"String",n='"@'+r[d].nodeName+'": '+l[a](e[d]),s=u.indexOf(n),o=0;break;case 3:a=r[d].parentNode.getAttribute("d:constr"),n=l[a](e[d]),n='"'+r[d].parentNode.nodeName+'": '+("Number"===n?n:'"'+n+'"'),s=u.indexOf(n),o=0;break;default:if(r[d]===p)continue;"String"===r[d].getAttribute("d:constr")?(a=r[d].getAttribute("d:constr"),n=l[a](e[d]),n='"'+r[d].nodeName+'": '+("Number"===n?n:'"'+n+'"'),s=u.indexOf(n,f),o=0,f=s+1):(n=c(e[d],null," ").replace(/\t/g,""),s=u.indexOf(n),o=n.match(/\n/g).length)}i=u.substring(0,s).match(/\n/g).length+1,h.push([i,o])}return h}),Defiant.node.selectNodes=function(t,e){if(t.evaluate){for(var r=t.createNSResolver(t.documentElement),n=t.evaluate(e,t,r,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),a=[],s=0,i=n.snapshotLength;i>s;s++)a.push(n.snapshotItem(s));return a}return t.selectNodes(e)},Defiant.node.selectSingleNode=function(t,e){if(t.evaluate){var r=this.selectNodes(t,e);return r.length>0?r[0]:null}return t.selectSingleNode(e)},Defiant.node.prettyPrint=function(t){var e,r,n=Defiant,a=n.tabsize,s=n.xml_decl.toLowerCase();n.is_ie?r=t.xml:(e=new XMLSerializer,r=e.serializeToString(t)),"development"!==n.env&&(r=r.replace(/ \w+\:d=".*?"| d\:\w+=".*?"/g,""));for(var i,o,l=r.trim().replace(/(>)\s*(<)(\/*)/g,"$1\n$2$3"),c=l.split("\n"),u=-1,h=0,d=c.length;d>h;h++)0===h&&c[h].toLowerCase()===s||(i=null!==c[h].match(/<[A-Za-z_\:]+.*?>/g),o=null!==c[h].match(/<\/[\w\:]+>/g),null!==c[h].match(/<.*?\/>/g)&&(i=o=!0),i&&u++,c[h]=String().fill(u," ")+c[h],i&&o&&u--,!i&&o&&u--);return c.join("\n").replace(/\t/g,String().fill(a," "))},Defiant.node.toJSON=function(t,e){"use strict";var r=function(t){var e,n,a,s,i,o,l,c,u,h,d={},m=window;switch(t.nodeType){case 1:for(i=t.getAttribute("d:constr"),"Array"===i?d=[]:"String"===i&&""===t.textContent&&(d=""),e=t.attributes,c=0,u=e.length;u>c;c++)h=e.item(c),null===h.nodeName.match(/\:d|d\:/g)&&(i=t.getAttribute("d:"+h.nodeName),o=i&&"undefined"!==i?"null"===h.nodeValue?null:m[i]("false"===h.nodeValue?"":h.nodeValue):h.nodeValue,d["@"+h.nodeName]=o);break;case 3:n=t.parentNode.getAttribute("d:type"),o=n?m[n]("false"===t.nodeValue?"":t.nodeValue):t.nodeValue,d=o}if(t.hasChildNodes())for(c=0,u=t.childNodes.length;u>c;c++)if(a=t.childNodes.item(c),s=a.nodeName,e=t.attributes,"d:name"===s&&(s=a.getAttribute("d:name")),"#text"===s)i=t.getAttribute("d:constr"),"undefined"===i&&(i=void 0),l=a.textContent||a.text,o="Boolean"===i&&"false"===l?"":l,i||e.length?i&&1===u?d=m[i](o):t.hasChildNodes()&&e.length<3?d=i?m[i](o):o:d[s]=i?m[i](o):o:d=o;else{if(d[s]){d[s].push?d[s].push(r(a)):d[s]=[d[s],r(a)];continue}switch(i=a.getAttribute("d:constr")){case"null":d.push?d.push(null):d[s]=null;break;case"Array":a.parentNode.firstChild===a&&"Array"===i&&"d:item"!==s?"d:item"===s||"Array"===i?(o=r(a),d[s]=o.length?[o]:o):d[s]=r(a):d.push?d.push(r(a)):d[s]=r(a);break;case"String":case"Number":case"Boolean":l=a.textContent||a.text,o="Boolean"===i&&"false"===l?"":l,d.push?d.push(m[i](o)):d[s]=r(a);break;default:d.push?d.push(r(a)):d[s]=r(a)}}return 1===t.nodeType&&"ArrayItem"===t.getAttribute("d:type")&&(d=[d]),d},n=9===t.nodeType?t.documentElement:t,a=r(n),s=a[n.nodeName];return n===n.ownerDocument.documentElement&&s&&s.constructor===Array&&(a=s),e&&"true"===e.toString()&&(e=" "),e?JSON.stringify(a,null,e):a},"undefined"!=typeof jQuery&&!function(t){"use strict";t.fn.defiant=function(t,e){return this.html(Defiant.render(t,e)),this}}(jQuery);
diff --git a/js/min/dictionaryBuilder.js b/js/min/dictionaryBuilder.js
deleted file mode 100644
index f645d60..0000000
--- a/js/min/dictionaryBuilder.js
+++ /dev/null
@@ -1 +0,0 @@
-function AddWord(){var e=htmlEntities(document.getElementById("word").value).trim(),t=htmlEntities(document.getElementById("pronunciation").value).trim(),n=htmlEntities(document.getElementById("partOfSpeech").value).trim(),i=htmlEntities(document.getElementById("simpleDefinition").value).trim(),r=htmlEntities(document.getElementById("longDefinition").value),o=document.getElementById("errorMessage"),a="",c=document.getElementById("updateConflict");if(""==e||""==i&&""==r)""==e?(a+="Word cannot be blank",a+=""==i&&""==r?" and you need at least one definition.":"."):""==i&&""==r&&(a+="You need at least one definition.");else{var s=currentDictionary.settings.allowDuplicates?-1:WordIndex(e);if(s>=0)if(WordAtIndexWasChanged(s,e,t,n,i,r)){document.getElementById("newWordButtonArea").style.display="none",DisableForm(""),c.style.display="block";var d="\""+e+'" is already in the dictionary';d+=currentDictionary.words[s].name!=e?' as "'+currentDictionary.words[s].name+'", and your dictionary is set to ignore case.':".",d+=" Do you want to update it to what you have set above?",d+='",d+=' ',c.innerHTML=d}else a='"'+e+'" is already in the dictionary exactly as it is written above',currentDictionary.words[s].name!=e&&(a+=". (Your dictionary is currently set to ignore case.)");else currentDictionary.words.push({name:e,pronunciation:t,partOfSpeech:n.length>0?n:" ",simpleDefinition:i,longDefinition:r,wordId:currentDictionary.nextWordId++}),SaveAndUpdateWords("new"),FocusAfterAddingNewWord(),NewWordNotification(e);o.innerHTML=""}o.innerHTML=a}function ShowWordEditForm(e){var t=e.toString(),n=currentDictionary.words[e],i='';document.getElementById("entry"+t).innerHTML=i,SetPartsOfSpeech("partOfSpeech"+t),document.getElementById("partOfSpeech"+t).value=htmlEntitiesParse(n.partOfSpeech)}function CancelEditForm(e){document.getElementById("entry"+e.toString()).innerHTML=DictionaryEntry(e).replace("","").replace("","")}function EditWord(e){var t=htmlEntities(document.getElementById("word"+e).value).trim(),n=htmlEntities(document.getElementById("pronunciation"+e).value).trim(),i=htmlEntities(document.getElementById("partOfSpeech"+e).value).trim(),r=htmlEntities(document.getElementById("simpleDefinition"+e).value).trim(),o=htmlEntities(document.getElementById("longDefinition"+e).value),a=document.getElementById("errorMessage"+e),c="",s=document.getElementById("updateConflict"+e);WordAtIndexWasChanged(e,t,n,i,r,o)?(document.getElementById("editWordButtonArea"+e).style.display="none",DisableForm(e),s.style.display="block",s.innerHTML="Do you really want to change the word \""+currentDictionary.words[parseInt(e)].name+'" to what you have set above? ',s.innerHTML+='",s.innerHTML+='"):(c='No change has been made to "'+t+'"',currentDictionary.words[parseInt(e)].name!=t&&(c+=". (Your dictionary is currently set to ignore case.)")),a.innerHTML=c}function UpdateWord(e,t,n,i,r,o){currentDictionary.words[e].name=t,currentDictionary.words[e].pronunciation=n,currentDictionary.words[e].partOfSpeech=i.length>0?i:" ",currentDictionary.words[e].simpleDefinition=r,currentDictionary.words[e].longDefinition=o,SaveAndUpdateWords("update",e),window.scroll(savedScroll.x,savedScroll.y),wordFormIsLocked()||FocusAfterAddingNewWord()}function DeleteWord(e){var t=new XMLHttpRequest;t.open("POST","/php/ajax_dictionarymanagement.php?action=worddelete"),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.onreadystatechange=function(){return 4==t.readyState&&200==t.status?("deleted successfully"!=t.responseText&&"not signed in"!=t.responseText||(currentDictionary.words.splice(e,1),SaveWords(!1)),console.log(t.responseText),!0):!1},t.send("dict="+currentDictionary.externalID.toString()+"&word="+currentDictionary.words[e].wordId.toString())}function ShowDictionary(){var e=GetSelectedFilters(),t=[],n=htmlEntitiesParseForSearchEntry(document.getElementById("searchBox").value),i=document.getElementById("searchOptionWord").checked,r=document.getElementById("searchOptionSimple").checked,o=document.getElementById("searchOptionLong").checked,a=!document.getElementById("searchCaseSensitive").checked,c=document.getElementById("searchIgnoreDiacritics").checked;if(""!=n&&(i||r||o)){var s=[],d=htmlEntitiesParseForSearch(JSON.stringify(currentDictionary));a&&(n=n.toLowerCase()),c&&(n=removeDiacritics(n),d=removeDiacritics(d)),i&&s.push("contains("+(a?"name":'translate(name, "", "")')+', "'+n+'")'),r&&s.push("contains("+(a?"simpleDefinition":'translate(simpleDefinition, "", "")')+', "'+n+'")'),o&&s.push("contains("+(a?"longDefinition":'translate(longDefinition, "", "")')+', "'+n+'")');var l=JSON.parse(d);t=JSON.search(l,"//words["+s.join(" or ")+"]/wordId")}var u=document.getElementById("dictionaryName");u.innerHTML=currentDictionary.name+" Dictionary",loggedIn&¤tDictionary.settings.isPublic&&(u.innerHTML+="➦");var p=document.getElementById("dictionaryDescription");p.innerHTML=marked(htmlEntitiesParseForMarkdown(currentDictionary.description));var y=document.getElementById("theDictionary"),m="",D=0;if(currentDictionary.words.length>0)for(var g=0;g0&&e.indexOf(currentDictionary.words[g].partOfSpeech)>-1)&&(""==n||""!=n&&(i||r||o)&&t.indexOf(currentDictionary.words[g].wordId)>=0)&&(currentDictionary.words[g].hasOwnProperty("pronunciation")||(currentDictionary.words[g].pronunciation=""),currentDictionary.words[g].hasOwnProperty("wordId")||(currentDictionary.words[g].wordId=g+1),m+=DictionaryEntry(g),D++);else m="There are no entries in the dictionary.";y.innerHTML=m,ShowFilterWordCount(D)}function DictionaryEntry(e){var t=regexParseForSearch(document.getElementById("searchBox").value),n=document.getElementById("searchOptionWord").checked,i=document.getElementById("searchOptionSimple").checked,r=document.getElementById("searchOptionLong").checked,o=!document.getElementById("searchCaseSensitive").checked,a=document.getElementById("searchIgnoreDiacritics").checked,c=new RegExp("("+(a?removeDiacritics(t)+"|"+t:t)+")","g"+(o?"i":"")),s=wordPronunciation=wordPartOfSpeech=wordSimpleDefinition=wordLongDefinition="";return s+=""!=t&&n?htmlEntities(htmlEntitiesParse(currentDictionary.words[e].name).replace(c,"$1")).replace(/<(\/?)searchterm>/g,"<$1searchterm>"):currentDictionary.words[e].name.toString(),""!=currentDictionary.words[e].pronunciation&&(wordPronunciation+=marked(htmlEntitiesParseForMarkdown(currentDictionary.words[e].pronunciation)).replace(/<\/?p>/g,""))," "!=currentDictionary.words[e].partOfSpeech&&""!=currentDictionary.words[e].partOfSpeech&&(wordPartOfSpeech+=currentDictionary.words[e].partOfSpeech.toString()),""!=currentDictionary.words[e].simpleDefinition&&(""!=t&&i?wordSimpleDefinition+=htmlEntities(htmlEntitiesParse(currentDictionary.words[e].simpleDefinition).replace(c,"$1")).replace(/<(\/?)searchterm>/g,"<$1searchterm>"):wordSimpleDefinition+=currentDictionary.words[e].simpleDefinition.toString()),""!=currentDictionary.words[e].longDefinition&&(""!=t&&r?wordLongDefinition+=marked(htmlEntitiesParseForMarkdown(htmlEntities(htmlEntitiesParse(currentDictionary.words[e].longDefinition).replace(c,"$1")))).replace(/<(\/?)searchterm>\;/g,"<$1searchterm>"):wordLongDefinition+=marked(htmlEntitiesParseForMarkdown(currentDictionary.words[e].longDefinition))),DictionaryEntryTemplate({name:s,pronunciation:wordPronunciation,partOfSpeech:wordPartOfSpeech,simpleDefinition:wordSimpleDefinition,longDefinition:wordLongDefinition,wordId:currentDictionary.words[e].wordId.toString()},currentDictionary.settings.isComplete?!1:e)}function ManagementArea(e){var t="
";return t+="Edit",t+="Delete',t+="
Are you sure you want to delete this entry?
",t+="No',t+="Yes",t+="
",t+="
"}function DictionaryEntryTemplate(e,t){t="undefined"!=typeof t?t:!1;var n="",loggedIn&¤tDictionary.settings.isPublic&&(n+="➦"),n+="🔗",n+=""+e.name+"",""!=e.pronunciation&&(n+=""+e.pronunciation+""),""!=e.partOfSpeech&&(n+=""+e.partOfSpeech+""),n+=" ",""!=e.simpleDefinition&&(n+=""+e.simpleDefinition+""),""!=e.longDefinition&&(n+=""+e.longDefinition+""),t!==!1&&(n+=ManagementArea(t)),n+=""}function SaveSettings(){""!=htmlEntities(document.getElementById("dictionaryNameEdit").value)&&(currentDictionary.name=htmlEntities(document.getElementById("dictionaryNameEdit").value)),currentDictionary.description=htmlEntities(document.getElementById("dictionaryDescriptionEdit").value),CheckForPartsOfSpeechChange(),currentDictionary.settings.allowDuplicates=document.getElementById("dictionaryAllowDuplicates").checked,currentDictionary.settings.caseSensitive=document.getElementById("dictionaryCaseSensitive").checked,currentDictionary.settings.sortByEquivalent=document.getElementById("dictionarySortByEquivalent").checked,currentDictionary.settings.isComplete=document.getElementById("dictionaryIsComplete").checked,document.getElementById("dictionaryIsPublic")&&(currentDictionary.settings.isPublic=document.getElementById("dictionaryIsPublic").checked),HideSettingsWhenComplete(),SaveAndUpdateDictionary(!0),LoadUserDictionaries()}function EmptyWholeDictionary(){confirm("This will delete the entire current dictionary. If you do not have a backed up export, you will lose it forever!\n\nDo you still want to delete?")&&CreateNewDictionary()}function CreateNewDictionary(){ResetDictionaryToDefault(),SaveAndUpdateDictionary(!1),SetPartsOfSpeech(),HideSettings(),ShowSettings(),document.getElementById("dictionaryNameEdit").focus()}function DeleteCurrentDictionary(){if(confirm("This will delete the current dictionary from the database. If you do not have a backed up export, you will lose it forever!\n\nDo you still want to delete?")){ResetDictionaryToDefault();var e=new XMLHttpRequest;e.open("POST","/php/ajax_dictionarymanagement.php?action=delete"),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){return 4==e.readyState&&200==e.status?(e.responseText.length<31?(console.log(e.responseText),CreateNewDictionary()):(HideSettings(),ShowDictionaryDeleteMenu(e.responseText),0==document.getElementById("loadAfterDelete").options.length&&(document.getElementById("loadAfterDeleteScreen").style.display="none",CreateNewDictionary())),!0):!1},e.send()}}function ResetDictionaryToDefault(){currentDictionary=JSON.parse(defaultDictionaryJSON)}function SaveAndUpdateWords(e,t){var n="";"all"==e?n=JSON.stringify(currentDictionary.words):"update"==e?n=JSON.stringify(currentDictionary.words[t]):"new"==e&&(n=JSON.stringify(currentDictionary.words[currentDictionary.words.length-1]));var i=new XMLHttpRequest;i.open("POST","/php/ajax_dictionarymanagement.php?action=word"+e+"&dict="+currentDictionary.externalID.toString()+"&nextwordid="+currentDictionary.nextWordId.toString()),i.setRequestHeader("Content-Type","application/json; charset=UTF-8"),i.onreadystatechange=function(){return 4==i.readyState&&200==i.status?(SaveWords(),ClearForm(),console.log(i.responseText),!0):!1},i.send(n)}function SaveWords(){currentDictionary.settings.sortByEquivalent?currentDictionary.words.sort(dynamicSort(["simpleDefinition","partOfSpeech"])):currentDictionary.words.sort(dynamicSort(["name","partOfSpeech"])),SaveDictionary(!1),ProcessLoad()}function SaveAndUpdateDictionary(e){SaveDictionary(!0),ShowDictionary(),e||ClearForm(),CloseUpdateConflictArea("")}function SaveDictionary(e){e&&SendDictionary(),localStorage.setItem("dictionary",JSON.stringify(currentDictionary)),SavePreviousDictionary()}function SendDictionary(){var e="",t="";currentDictionary.externalID>0?(e="update",t=DataToSend(!1)):(e="new",t=DataToSend(!0));var n=new XMLHttpRequest;n.open("POST","/php/ajax_dictionarymanagement.php?action="+e),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){return 4==n.readyState&&200==n.status?("updated successfully"==n.responseText?(console.log(n.responseText),LoadUserDictionaries(),ProcessLoad()):isNaN(parseInt(n.responseText))?console.log(n.responseText):(currentDictionary.externalID=parseInt(n.responseText),currentDictionary.words.length>0&&SaveAndUpdateWords("all"),LoadUserDictionaries(),ProcessLoad(),console.log("saved "+parseInt(n.responseText).toString()+" successfully")),!0):!1},n.send(t)}function DataToSend(e){e="undefined"!=typeof e&&null!=e?e:!1;var t="";return 0==currentDictionary.externalID?(t="name="+encodeURIComponent(currentDictionary.name)+"&description="+encodeURIComponent(currentDictionary.description)+"&words="+encodeURIComponent(JSON.stringify(currentDictionary.words)),t+="&nextwordid="+currentDictionary.nextWordId+"&allowduplicates="+(currentDictionary.settings.allowDuplicates?"1":"0")+"&casesensitive="+(currentDictionary.settings.caseSensitive?"1":"0"),t+="&partsofspeech="+encodeURIComponent(currentDictionary.settings.partsOfSpeech)+"&sortbyequivalent="+(currentDictionary.settings.sortByEquivalent?"1":"0")+"&iscomplete="+(currentDictionary.settings.isComplete?"1":"0")+"&ispublic="+(currentDictionary.settings.isPublic?"1":"0")):((e||currentDictionary.name!=previousDictionary.name)&&(t+="name="+encodeURIComponent(currentDictionary.name)),(e||currentDictionary.description!=previousDictionary.description)&&(t+=(""==t?"":"&")+"description="+encodeURIComponent(currentDictionary.description)),(e||currentDictionary.nextWordId!=previousDictionary.nextWordId)&&(t+=(""==t?"":"&")+"nextwordid="+currentDictionary.nextWordId),(e||currentDictionary.settings.allowDuplicates!=previousDictionary.allowDuplicates)&&(t+=(""==t?"":"&")+"allowduplicates="+(currentDictionary.settings.allowDuplicates?"1":"0")),(e||currentDictionary.settings.caseSensitive!=previousDictionary.caseSensitive)&&(t+=(""==t?"":"&")+"casesensitive="+(currentDictionary.settings.caseSensitive?"1":"0")),(e||currentDictionary.settings.partsOfSpeech!=previousDictionary.partsOfSpeech)&&(t+=(""==t?"":"&")+"partsofspeech="+encodeURIComponent(currentDictionary.settings.partsOfSpeech)),(e||currentDictionary.settings.sortByEquivalent!=previousDictionary.sortByEquivalent)&&(t+=(""==t?"":"&")+"sortbyequivalent="+(currentDictionary.settings.sortByEquivalent?"1":"0")),(e||currentDictionary.settings.isComplete!=previousDictionary.isComplete)&&(t+=(""==t?"":"&")+"iscomplete="+(currentDictionary.settings.isComplete?"1":"0")),(e||currentDictionary.settings.isPublic!=previousDictionary.isPublic)&&(t+=(""==t?"":"&")+"ispublic="+(currentDictionary.settings.isPublic?"1":"0"))),t}function LoadDictionary(){LoadLocalDictionary();var e=new XMLHttpRequest;e.open("GET","/php/ajax_dictionarymanagement.php?action=load"),e.onreadystatechange=function(){4==e.readyState&&200==e.status&&("no dictionaries"==e.responseText?(currentDictionary.externalID=0,currentDictionary.settings.isPublic=!1,SendDictionary(!0)):e.responseText.length<60?console.log(e.responseText):(currentDictionary=JSON.parse(e.responseText),SaveDictionary(!1))),ProcessLoad()},e.send()}function ChangeDictionary(e){e="undefined"!=typeof e&&null!=e?e:document.getElementById("userDictionaries"),currentDictionary.externalID!=e.value&&e.options.length>0&&(ShowInfoWithText("
Loading "+e.options[e.selectedIndex].text+"...
"),HideSettings(),ChangeDictionaryToId(e.value,function(e){"no dictionaries"==e?(console.log(e),SendDictionary(!1)):e.length<60?console.log(e):(currentDictionary=JSON.parse(e),SaveDictionary(!1),ProcessLoad(),LoadUserDictionaries(),HideInfo())}))}function ChangeDictionaryToId(e,t){var n=new XMLHttpRequest;n.open("POST","/php/ajax_dictionarymanagement.php?action=switch"),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i="newdictionaryid="+e.toString();n.onreadystatechange=function(){4==n.readyState&&200==n.status&&t(n.responseText)},n.send(i)}function LoadLocalDictionary(){if(localStorage.getItem("dictionary")){var e=JSON.parse(localStorage.getItem("dictionary"));(e.words.length>0||"A new dictionary."!=e.description||"New"!=e.name)&&(currentDictionary=JSON.parse(localStorage.getItem("dictionary"))),e=null}}function ProcessLoad(){currentDictionary.hasOwnProperty("nextWordId")||(currentDictionary.nextWordId=currentDictionary.words.length+1),HideSettingsWhenComplete(),ShowDictionary(),SetPartsOfSpeech(),currentDictionary.settings.isComplete&&(document.getElementById("wordEntryForm").style.display="none"),SavePreviousDictionary()}function SavePreviousDictionary(){previousDictionary={name:currentDictionary.name,description:currentDictionary.description,nextWordId:currentDictionary.nextWordId,allowDuplicates:currentDictionary.settings.allowDuplicates,caseSensitive:currentDictionary.settings.caseSensitive,partsOfSpeech:currentDictionary.settings.partsOfSpeech,sortByEquivalent:currentDictionary.settings.sortByEquivalent,isComplete:currentDictionary.settings.isComplete,isPublic:currentDictionary.settings.isPublic}}function ExportDictionary(){var e=removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g,"");""==e&&(e="export"),download(e+".dict",localStorage.getItem("dictionary"))}function ExportWords(){if(currentDictionary.words.length>0){var e=removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g,"");""==e&&(e="export"),e+="_words";for(var t="word,pronunciation,part of speech,definition,explanation\n",n=0;n0||confirm("Importing this dictionary will overwrite your current one, making it impossible to retrieve if you have not already exported it! Do you still want to import?")){if(!window.FileReader)return alert("Your browser is not supported"),!1;var e=new FileReader;if(document.getElementById("importFile").files.length>0){var t=document.getElementById("importFile").files[0];e.readAsText(t),e.onloadend=function(){if(e.result&&e.result.length){var t=JSON.parse(e.result);if(t.hasOwnProperty("name")&&t.hasOwnProperty("description")&&t.hasOwnProperty("words")&&t.hasOwnProperty("settings"))currentDictionary=JSON.parse(e.result),currentDictionary.externalID=0,currentDictionary.settings.isPublic=!1,SaveDictionary(!0),ProcessLoad(),HideInfo(),HideSettings(),document.getElementById("importFile").value="",NewNotification('Successfully Imported the "'+currentDictionary.name+'" Dictionary.');else{var n="File is missing:";t.hasOwnProperty("name")||(n+=" name"),t.hasOwnProperty("description")||(n+=" description"),t.hasOwnProperty("words")||(n+=" words"),t.hasOwnProperty("settings")||(n+=" settings"),alert("Uploaded file is not compatible.\n\n"+n)}t=null}else alert("Upload Failed");e=null}}else alert("You must add a file to import.")}}function ImportWords(){if(currentDictionary.externalID>0||confirm("This will add words in a correctly formatted CSV file to your currently loaded dictionary. Do you still want to import?")){if(!window.FileReader)return alert("Your browser is not supported"),!1;if(document.getElementById("importWordsCSV").files.length>0){var e=document.getElementById("importWordsCSV").files[0],t=document.getElementById("importOptions");t.innerHTML="
Importing Words...
";var n=0,i=0;Papa.parse(e,{header:!0,step:function(e,r){if(n++,e.data[0].word.trim().length>0&&(e.data[0].definition.trim().length>0||e.data[0].explanation.trim().length>0)||0==e.errors.length){var o=htmlEntities(e.data[0].word).trim(),a=htmlEntities(e.data[0].pronunciation).trim(),c=htmlEntities(e.data[0]["part of speech"]).trim().length>0?htmlEntities(e.data[0]["part of speech"]).trim():" ",s=htmlEntities(e.data[0].definition).trim(),d=htmlEntities(e.data[0].explanation).trim(),l=currentDictionary.nextWordId++;currentDictionary.words.push({name:o,pronunciation:a,partOfSpeech:c,simpleDefinition:s,longDefinition:d,wordId:l});var u=DictionaryEntryTemplate(currentDictionary.words[currentDictionary.words.length-1]);t.innerHTML+=u,i++}else if(e.data[0].word.trim().length>0)for(var p=0;pError on record #"+n.toString()+": "+e.errors[p].message+"";document.getElementById("infoPage").scrollTop=document.getElementById("infoPage").scrollHeight},complete:function(e){SaveAndUpdateWords("all"),t.innerHTML+="
The file has finished importing "+i.toString()+" words.