mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Interactive input forms
This commit is contained in:
19
src/interface/static/js/pyshelf_ux.js
vendored
19
src/interface/static/js/pyshelf_ux.js
vendored
@@ -16,6 +16,9 @@ $(document).ready(function(){
|
||||
var nav_width = $('.nav_l').width(); // Get the width of our nav items
|
||||
var cmp_height = window.screen.availHeight;
|
||||
var max_height = win_height - (hdr_height + ftr_height) - (scr_height - win_height); // Set our available height
|
||||
var u_string = "Username";
|
||||
var p_string = "Password";
|
||||
var s_string = "search by Title, Author, Tags, or Collections"
|
||||
customlog([cmp_height]);
|
||||
$(".search_submit").click(function(){
|
||||
var query = $('.nav_search').val();
|
||||
@@ -54,4 +57,18 @@ $(document).ready(function(){
|
||||
$('#btn_collections').on('click', function (e){
|
||||
$('.hidden.vert-nav.collections').toggle()
|
||||
});
|
||||
})
|
||||
$('.input_box').on('click', function(){
|
||||
$(this).attr("value","");
|
||||
});
|
||||
$('.input_box').focusout(function(){
|
||||
if ($(this).hasClass('nav_search') && $(this).val() == "") {
|
||||
$(this).attr("value", s_string);
|
||||
}
|
||||
if ($(this).attr("id") == "username" && $(this).val() == "") {
|
||||
$(this).attr("value", u_string);
|
||||
}
|
||||
if ($(this).attr("id") == "password" && $(this).val() == "") {
|
||||
$(this).attr("value", p_string);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,7 +9,6 @@ from django.http import JsonResponse
|
||||
from django.shortcuts import HttpResponse, render # render_to_response
|
||||
from django.utils.text import slugify
|
||||
import json
|
||||
import jsonpickle
|
||||
|
||||
from .models import Books, Collections, Navigation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user