Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidying up the create list box, added reset #125

Merged
merged 1 commit into from Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 4 additions & 10 deletions assets/css/admin/admin_styles.css
Expand Up @@ -708,18 +708,12 @@ li.fav-box-item:hover::before {color: #C03957;}

.db-list-item-draggable {width: 255px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }

.db-list-buttons { font-size: 0.8em; display:none;}

.active .fa-check { color: #90C695; font-size:16px; padding: 0 2px 0 0; }
.add-to-list-button { font-size: 0.8em; }
.databases-searchresults { padding: 0; }

/*
.db-list-item:before {
font-family: FontAwesome;
content:"\f00c";
color: #90C695; font-size:16px;
padding: 0 8px 0 0;
}
*/

.dblist-button {margin-top:20px; font-size: 0.8em; display:none;}


/* Catalog Pluslet Display Admin */
Expand Down
29 changes: 20 additions & 9 deletions assets/js/guides/create_resource_list.js
Expand Up @@ -41,7 +41,7 @@ $(document).ready(function () {

var token_string = "<ul class='token-list'>";
$('.db-list-item-draggable').each(function(data){
var title = $(this).text()
var title = $(this).find('.db-list-label').text()
var record_id = $(this).val();

console.log($(this).data());
Expand All @@ -51,9 +51,8 @@ $(document).ready(function () {


// If these are undefined, make them 0
include_description = (typeof include_description === 'undefined') ? 0 : include_description;
include_icons = (typeof include_icons === 'undefined') ? 0 : include_icons;
display_note = (typeof display_note === 'undefined') ? 0 : display_note;
display_options = (typeof display_options === 'undefined') ? "000" : display_options;


if ($(this).text()) {
token_string += "<li class='token-list-item'>{{dab},{" + record_id + "},{" + title + "}" + ",{" + display_options + "}}<li>";
Expand All @@ -62,18 +61,28 @@ $(document).ready(function () {


token_string += "</ul>";
CKEDITOR.instances[Object.keys(CKEDITOR.instances)[click_count]].setData(token_string);
console.log(token_string);




CKEDITOR.instances[Object.keys(CKEDITOR.instances)[click_count]].setData(token_string.trim());

click_count++;

$('.db-list-content').empty();
$('.db-list-results').empty();
}
}, 100);

});



$('.dblist-reset-button').on("click", function() {
$('.db-list-results').empty();

});

$('.databases-search').keypress(function(data) {

$('.databases-searchresults').empty();
Expand Down Expand Up @@ -101,14 +110,16 @@ $(document).ready(function () {

$('body').on("click", '.add-to-list-button', function() {

$('.dblist-button').show();
$('.db-list-buttons').show();
$('.db-list-content').show();

var databaseToken = Object.create(DatabaseToken);
databaseToken.label = $(this).attr('data-label');
databaseToken.label = $(this).attr('data-label').trim();
databaseToken.record_id = $(this).val();

$('.db-list-results').append("<li class='db-list-item-draggable' value='" + databaseToken.record_id +"'>"+ databaseToken.label +"<div><span class='show-description-toggle'><i class='fa fa-check'></i> Show Description </span><span class='show-icons-toggle'> <i class='fa fa-check'></i>Show Icons </span><span class='include-note-toggle'><i class='fa fa-check'></i> Include Note </span></div></li>");


$('.db-list-results').append("<li class='db-list-item-draggable' value='" + databaseToken.record_id +"'><span class='db-list-label'>"+ databaseToken.label +"</span><div><span class='show-description-toggle db-list-toggle'><i class='fa fa-check'></i> Show Description </span><span class='show-icons-toggle db-list-toggle'> <i class='fa fa-check'></i>Show Icons </span><span class='include-note-toggle db-list-toggle'><i class='fa fa-check'></i> Include Note </span></div></li>");
$('.db-list-results').sortable();
$('.db-list-results').disableSelection();
$('.fa-check').hide();
Expand Down
8 changes: 5 additions & 3 deletions control/guides/guide.php
Expand Up @@ -902,7 +902,7 @@ function addTab() {
<option>Please select a database</option>
</select>

<div class="databases-results-display">
<div class="databases-results-display pure-form">
<input class="databases-search" type="text" placeholder="<?php print _("Enter database title..."); ?>"></input>
<ul class="databases-searchresults"></ul>
</div>
Expand All @@ -915,8 +915,10 @@ function addTab() {

</ul>
</div>
<button class="pure-button pure-button-primary dblist-button">Create List Box</button>

<div class="db-list-buttons">
<button class="pure-button pure-button-primary dblist-button"><?php print _("Create List Box"); ?></button>
<button class="pure-button pure-button-primary dblist-reset-button"><?php print _("Reset List Box"); ?></button>
</div>
</div>
</div>

Expand Down