Merge branch 'prod' for fixes and link to new words.

This commit is contained in:
Robbie Antenesse 2015-11-09 18:10:26 -07:00
commit 782bbe10e5
6 changed files with 96 additions and 29 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
php/google/
ipa_character_picker/ ipa_character_picker/

View File

@ -5,6 +5,11 @@
font-family: Georgia, 'Times New Roman', Times, serif; font-family: Georgia, 'Times New Roman', Times, serif;
} }
contents {
display: block;
width: 100%;
}
footer { footer {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -21,17 +26,34 @@ footer {
display: inline !important; display: inline !important;
} }
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
footer {
position: relative;
clear: both;
max-height: 100%;
}
#dictionaryContainer {
margin-bottom: 15px !important;
}
}
#leftColumn { #leftColumn {
float: left; float: left;
} }
form { form {
margin: 15px;
padding: 15px; padding: 15px;
} }
#wordEntryForm { #wordEntryForm {
width: 30%;
max-width: 400px; max-width: 400px;
min-width: 260px;
margin: 15px 0 15px 15px;
border: outset 3px; border: outset 3px;
} }
@ -69,13 +91,18 @@ input[type=checkbox] {
} }
#longDefinition { #longDefinition {
width: 350px; width: 80%;
height: 200px; min-width: 260px;
height: 150px;
}
#updateConflict {
width: 260px;
} }
#errorMessage, #updateConflictMessage, #settingsErrorMessage { #errorMessage, #updateConflictMessage, #settingsErrorMessage {
display: block; display: block;
color: red; color: maroon;
font-weight: bold; font-weight: bold;
} }
@ -84,10 +111,20 @@ input[type=checkbox] {
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
#notificationArea {
text-align:center;
padding:10px;
border-radius:5px;
margin:0 auto;
width:50%;
min-width:200px;
}
#dictionaryContainer { #dictionaryContainer {
margin: 15px 0 36px 15px; /* bottom margin must clear footer */ margin: 15px 0 36px 15px; /* bottom margin must clear footer */
width: 50%; width: 60%;
min-width: 350px; min-width: 260px;
max-width: 600px;
float: left; float: left;
} }
@ -128,8 +165,8 @@ input[type=checkbox] {
entry { entry {
display: block; display: block;
width: 50%; width: 90%;
min-width: 300px; min-width: 200px;
padding: 10px 10px 3px; padding: 10px 10px 3px;
border: outset 3px; border: outset 3px;
margin-bottom: 5px; margin-bottom: 5px;
@ -138,6 +175,9 @@ entry {
.wordLink { .wordLink {
text-decoration: none; text-decoration: none;
float: right; float: right;
font-size: 13px;
padding: 2px;
line-height: 10px;
} }
word { word {
@ -233,7 +273,7 @@ searchTerm {
margin: 10px; margin: 10px;
} }
#settingsBackgroundFade, #aboutBackgroundFade { #settingsBackgroundFade, #infoBackgroundFade {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@ -243,14 +283,14 @@ searchTerm {
opacity: 0.75; opacity: 0.75;
} }
#settingsOptions, #aboutPage { #settingsOptions, #infoPage {
position: fixed; position: fixed;
top: 10%; top: 6%;
left: 10%; left: 6%;
right: 10%; right: 6%;
bottom: 10%; bottom: 6%;
min-width: 300px; min-width: 260px;
min-height: 300px; min-height: 260px;
padding: 5px 5% 5%; padding: 5px 5% 5%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
@ -259,8 +299,9 @@ searchTerm {
border: 1px solid black; border: 1px solid black;
} }
#notificationCloseButton,
#settingsButton, #settingsScreenCloseButton, #settingsButton, #settingsScreenCloseButton,
#settingsSaveButtons button, #aboutScreenCloseButton { #settingsSaveButtons button, #infoScreenCloseButton {
float: right; float: right;
font-size: 12px; font-size: 12px;
} }
@ -271,9 +312,14 @@ searchTerm {
margin: 0; margin: 0;
} }
#dictionaryDescriptionEdit, #dictionaryPartsOfSpeechEdit {
width: 100%;
max-width: 360px;
min-width: 200px;
}
#dictionaryDescriptionEdit { #dictionaryDescriptionEdit {
width: 280px; height: 200px;
height: 130px;
} }
#settingsErrorMessage { #settingsErrorMessage {
@ -289,6 +335,8 @@ searchTerm {
.settingsCol { .settingsCol {
display: block; display: block;
float: left; float: left;
width: 300px; width: 30%;
min-width: 260px;
max-width: 400px;
margin: 0 30px 0 0; margin: 0 30px 0 0;
} }

View File

@ -18,6 +18,11 @@
<script src="js/ui.js"></script> <script src="js/ui.js"></script>
</head> </head>
<body> <body>
<contents>
<div id="notificationArea" style="display:none;">
<span id="notificationCloseButton" class="clickable" onclick="document.getElementById('notificationArea').style.display='none';">Close</span>
<div id="notificationMessage"></div>
</div>
<div id="leftColumn"> <div id="leftColumn">
<form id="wordEntryForm"> <form id="wordEntryForm">
<label><span>Word</span> <label><span>Word</span>
@ -145,7 +150,7 @@
<div id="aboutText"></div> <div id="aboutText"></div>
</div> </div>
</div> </div>
</contents>
<footer> <footer>
<span id="aboutButton" class="clickable" onclick="ShowAbout()">About Dictionary Builder</span> <span id="aboutButton" class="clickable" onclick="ShowAbout()">About Dictionary Builder</span>
Dictionary Builder only guaranteed to work with most up-to-date HTML5 browsers. Dictionary Builder only guaranteed to work with most up-to-date HTML5 browsers.

View File

@ -89,10 +89,11 @@ function AddWord() {
} }
} else { } else {
currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: partOfSpeech, simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++}); currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: partOfSpeech, simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++});
FocusAfterAddingNewWord();
NewWordNotification(word);
SaveAndUpdateDictionary(false); SaveAndUpdateDictionary(false);
} }
errorMessageArea.innerHTML = ""; errorMessageArea.innerHTML = "";
} else { } else {
if (word == "") { if (word == "") {
@ -242,7 +243,7 @@ function DictionaryEntry(itemIndex) {
entryText += "<word>" + ((searchTerm != "" && document.getElementById("searchOptionWord").checked) ? currentDictionary.words[itemIndex].name.replace(searchRegEx, "<searchTerm>" + searchTerm + "</searchterm>") : currentDictionary.words[itemIndex].name) + "</word>"; entryText += "<word>" + ((searchTerm != "" && document.getElementById("searchOptionWord").checked) ? currentDictionary.words[itemIndex].name.replace(searchRegEx, "<searchTerm>" + searchTerm + "</searchterm>") : currentDictionary.words[itemIndex].name) + "</word>";
if (currentDictionary.words[itemIndex].pronunciation != "") { if (currentDictionary.words[itemIndex].pronunciation != "") {
entryText += "<pronunciation>" + markdown.toHTML(currentDictionary.words[itemIndex].pronunciation).replace("<p>","").replace("</p>","") + "</pronunciation>"; entryText += "<pronunciation>" + markdown.toHTML(htmlEntitiesParse(currentDictionary.words[itemIndex].pronunciation)).replace("<p>","").replace("</p>","") + "</pronunciation>";
} }
if (currentDictionary.words[itemIndex].partOfSpeech != "") { if (currentDictionary.words[itemIndex].partOfSpeech != "") {

View File

@ -92,3 +92,15 @@ function HideSettings() {
document.getElementById("settingsScreen").style.display = "none"; document.getElementById("settingsScreen").style.display = "none";
document.getElementById("wordEntryForm").style.display = (currentDictionary.settings.isComplete) ? "none" : "block"; document.getElementById("wordEntryForm").style.display = (currentDictionary.settings.isComplete) ? "none" : "block";
} }
function NewWordNotification(word) {
var notificationArea = document.getElementById("notificationArea");
var notificationMessage = document.getElementById("notificationMessage");
var wordId = currentDictionary.nextWordId - 1;
notificationArea.style.display = "block";
notificationMessage.innerHTML = "New Word Added: <a href='#" + wordId.toString() + "'>" + word + "</a>";
}
function FocusAfterAddingNewWord() {
document.getElementById("word").focus();
}

0
notification.php Normal file
View File