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/

View File

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

View File

@ -18,6 +18,11 @@
<script src="js/ui.js"></script>
</head>
<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">
<form id="wordEntryForm">
<label><span>Word</span>
@ -139,13 +144,13 @@
</div>
<div id="aboutScreen" style="display:none;">
<div id="aboutBackgroundFade" onclick="HideAbout()"></div>
<div id="aboutPage">
<span id="aboutScreenCloseButton" class="clickable" onclick="HideAbout()">Close</span>
<div id="aboutText"></div>
</div>
</div>
<div id="aboutBackgroundFade" onclick="HideAbout()"></div>
<div id="aboutPage">
<span id="aboutScreenCloseButton" class="clickable" onclick="HideAbout()">Close</span>
<div id="aboutText"></div>
</div>
</div>
</contents>
<footer>
<span id="aboutButton" class="clickable" onclick="ShowAbout()">About Dictionary Builder</span>
Dictionary Builder only guaranteed to work with most up-to-date HTML5 browsers.

View File

@ -89,10 +89,11 @@ function AddWord() {
}
} else {
currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: partOfSpeech, simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++});
FocusAfterAddingNewWord();
NewWordNotification(word);
SaveAndUpdateDictionary(false);
}
errorMessageArea.innerHTML = "";
} else {
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>";
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 != "") {

View File

@ -91,4 +91,16 @@ function SetPartsOfSpeech () {
function HideSettings() {
document.getElementById("settingsScreen").style.display = "none";
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