Add a dictionary share link for easier sharing of public dictionaries.

This commit is contained in:
Robbie Antenesse 2016-06-22 12:43:39 -06:00
parent f2b9d01d3b
commit 4ac000db09
4 changed files with 24 additions and 9 deletions

View File

@ -129,6 +129,10 @@ input, textarea, select, option {
text-shadow: 2px 2px 2px #915337;
}
#dictionaryShareLink {
text-shadow: none;
}
#dictionaryDescription {
width: 90%;
background: #f2d5b2;

View File

@ -159,6 +159,11 @@ input[type=checkbox] {
margin: 0 0 5px;
}
#dictionaryShareLink {
margin-left: 10px;
vertical-align: middle;
}
#dictionaryDescription {
width: 100%;
max-height: 400px;
@ -186,12 +191,11 @@ input[type=checkbox] {
padding: 2px 4px;
}
#descriptionToggle, #searchFilterToggle {
.toggleButton {
display: inline-block;
margin: 8px;
font-weight: bold;
font-size: 12px;
cursor: pointer;
}
.searchOption, .filterOption {
@ -353,7 +357,7 @@ searchTerm {
}
#announcementCloseButton, #notificationCloseButton,
#settingsButton, #settingsScreenCloseButton,
#settingsButton, #settingsScreenCloseButton, #accountSettingsScreenCloseButton,
#settingsSaveButtons button, #infoScreenCloseButton,
#fullScreenTextboxScreenCloseButton {
float: right;

View File

@ -203,13 +203,13 @@ if ($display_mode != "build") {
<?php } ?>
<?php if ($display_mode == "word") { ?>
<a class="clickable" href="/<?php echo $dictionary_to_load; ?>">View Full Dictionary</a>
<a class="clickable toggleButton" href="/<?php echo $dictionary_to_load; ?>">View Full Dictionary</a>
<?php } ?>
<span id="descriptionToggle" class="clickable" onclick="ToggleDescription();"><?php if ($display_mode == "view") { ?>Hide<?php } else { ?>Show<?php } ?> Description</span>
<span id="descriptionToggle" class="clickable toggleButton" onclick="ToggleDescription();"><?php if ($display_mode == "view") { ?>Hide<?php } else { ?>Show<?php } ?> Description</span>
<div id="dictionaryDescription" style="display:<?php if ($display_mode == "view") { ?>block<?php } else { ?>none<?php } ?>;"></div>
<?php if ($display_mode != "word") { ?>
<span id="searchFilterToggle" class="clickable" onclick="ToggleSearchFilter();"><?php if ($display_mode == "view") { ?>Hide <?php } ?>Search/Filter Options</span>
<span id="searchFilterToggle" class="clickable toggleButton" onclick="ToggleSearchFilter();"><?php if ($display_mode == "view") { ?>Hide <?php } ?>Search/Filter Options</span>
<div id="searchFilterArea" style="display:<?php if ($display_mode == "view") { ?>block<?php } else { ?>none<?php } ?>;">
<div id="searchArea" style="display:block;">
<label style="margin-top:10px;">
@ -371,11 +371,14 @@ if ($display_mode != "build") {
</label> <span class="clickable inline-button" onclick="ExplainAllowEmails()">?</span>
<div id="accountSettingsError" style="font-weight:bold;color:red;"></div>
<button type="submit" id="accountSettingsSubmitButton" onclick="ValidateAccountSettings(); return false;">Save Settings</button>
<br><br>
<br>
</form></div>
<div class="settingsCol">
<br>
<h2>Reset Your Password</h2>
<p style="font-size: 12px;">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.</p>
<span id="resetPassword" class="clickable" onclick="this.innerHTML='Loading...';LoggedInResetPassword();" style="margin-top:20px;">Reset Password</span>
</form></div>
</div>
</div>
</div>
<?php
@ -445,6 +448,7 @@ if ($display_mode != "build") {
Initialize();
});
<?php } ?>
var loggedIn = <?php echo ($current_user > 0) ? "true" : "false"; ?>;
</script>
</body>
</html>

View File

@ -229,6 +229,9 @@ function ShowDictionary() {
var dictionaryNameArea = document.getElementById("dictionaryName");
dictionaryNameArea.innerHTML = htmlEntitiesParse(currentDictionary.name) + " Dictionary";
if (loggedIn && currentDictionary.settings.isPublic) {
dictionaryNameArea.innerHTML += "<a href='/" + currentDictionary.externalID + "' target='_blank' id='dictionaryShareLink' class='clickable' title='Share Dictionary'>&#10150;</a>";
}
var dictionaryDescriptionArea = document.getElementById("dictionaryDescription");
dictionaryDescriptionArea.innerHTML = marked(htmlEntitiesParse(currentDictionary.description));
@ -339,7 +342,7 @@ function DictionaryEntryTemplate(wordObject, managementIndex) {
}
entryText += "'><a name='" + wordObject.wordId + "'></a>";
if (currentDictionary.settings.isPublic) {
if (loggedIn && currentDictionary.settings.isPublic) {
entryText += "<a href='/" + currentDictionary.externalID + "/" + wordObject.wordId + "' target='_blank' class='wordLink clickable' title='Share Word' style='margin-left:5px;'>&#10150;</a>";
}