Commit 0eba0b1f authored by Craig Watson's avatar Craig Watson

First pass at Pixabay image search

Search basically works; but just one page of elements are retrieved.
Metadata is assigned ok.
To do: paginate search results; correct display; and later, add filters
parent a32c1e4c
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/webbrowser"
version="1.1"
width="900"
height="500"
ub:resizable="true">
<name>Choisir</name>
<author>Craig Watson</author>
<description>Pixabay image search</description>
<content src="index.html"/>
</widget>
html, body{
width: 100%;
padding: 0;
height: auto;
background-color: white;
margin: 0;
}
::-webkit-scrollbar {
width: 14px;
background-color:white;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color:lightgray;
border: 2px solid gray;
}
::-webkit-scrollbar-button:vertical:start{
border-radius: 10px;
background-color:lightgray;
background-image: url(../images/trgUp.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
::-webkit-scrollbar-button:vertical:end{
border-radius: 10px;
background-color:lightgray;
background-image: url(../images/trgDown.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
a {
text-decoration: underline;
}
#disc_nav_cont{
height: auto;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
}
.disclaimer{
padding: 5px;
text-align: center;
background-color: #BBBBBB;
border-top: solid 4px #EEEEEE;
border-bottom: none;
font-size: 12px;
}
.resultFooter{
width: 100%;
padding: 3px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: bold;
font-size: x-large;
text-align: center;
background-color: white;
}
#searchResult {
overflow: hidden;
text-align: center;
/* margin-top: 50px;*/
margin-bottom: 85px;
}
.search{
/*position: fixed;
top: 0;
left: 0;*/
padding: 5px;
background-color: #BBBBBB;
border-bottom: solid 4px #EEEEEE;
}
.search,
.disclaimer {
width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.toggleIcon{
display: inline-block;
width: 14px;
height: 14px;
background: url(../images/trgUp.png) 50% no-repeat;
}
.searchInput{
padding: 3px;
float: left;
width: 100%;
border-radius: 3px;
border-style: none;
height: 22px;
line-height: 18px;
vertical-align: middle;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.searchButton{
background: url("../images/search_app.png") -38px -38px no-repeat;
width: 24px;
height: 24px;
overflow: hidden;
position: absolute;
right: 30px;
top: 9px;
margin-left: -2px;
cursor: pointer;
}
.subSearch{
margin: 0;
/*float: left; */
}
#subSearchInput{
width: 100%;
/*height: 46px;*/
display: inline-table;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding: 5px;
padding-right: 26px;
}
#subSearchFilter{
width: 100%;
display: none;
}
.searchResult{
width: 98%;
padding: 3px;
background-color:#123456;
}
.imgContainer{
display: inline-block;
padding: 3px;
margin: 3px;
text-align: center;
overflow: hidden;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
vertical-align: top;
}
.filterContainer{
float: left;
margin: 2px;
padding: 2px;
font-size: 14px;
}
.filterSelect{
border-style:none;
-webkit-border-top-right-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
-moz-border-radius-topright: 15px;
-moz-border-radius-bottomright: 15px;
border-top-right-radius: 15px;
margin-top: 2px;
width: 100%;
}
span{
font-family: Verdana,Arial,Helvetica,sans-serif;
color: #666;
}
[draggable] {
-webkit-user-select: none;
user-select: none;
}
.toggleFilters{
margin: 0;
padding: 0;
background-position: center;
background-image: url(../images/down.png);
position: absolute;
top: 11px;
right: 6px;
width: 20px;
height: 20px;
cursor: pointer;
}
.colors_line {
float: left;
margin: 4px;
margin-right: 0;
clear: left;
}
.custom {
opacity: 0;
position: absolute;
left: -10000px;
}
.filter_button.button.color {
display: inline-block;
width: 15px;
height: 15px;
border: 1px solid #EBEBEB;
padding: 0;
margin: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.filter_button.button.color:hover {
border: 1px solid rgb(128,128,128);
cursor: pointer;
}
input[type="radio"]:checked + .filter_button.button.color {
border: 1px solid rgb(255,255,255);
box-shadow: 0 0 0px 1px #000;
-webkit-box-shadow: 0 0 0px 1px #000;
}
#allcolor {
background: white url('../images/search_app.png') -43px -144px no-repeat;
}
#colored {
background: white url('../images/search_app.png') -43px -244px no-repeat;
}
#grayed {
background: white url('../images/search_app.png') -45px -343px no-repeat;
}
#black{
background-color:#ffffff;
}
#blue{
background-color:#0000FF;
}
#brown{
background-color:rgba(139, 82, 16, 1);
}
#gray{
background-color:#999999;
}
#green{
background-color:#00CC00;
}
#orange{
background-color:#FB940B;
}
#pink{
background-color:#FF98BF;
}
#purple{
background-color:#762CA7;
}
#red{
background-color:#CC0000;
}
#teal{
background-color:#03C0C6;
}
#white{
background-color:#000000;
}
#yellow{
background-color:#FFFF00;
}
.selectBox-dropdown, .selectBox-options li a {
line-height: 1.3 !important;
font-size: 13px;
}
.pager_button {
padding: 3px 5px;
font-size: 16px;
color: black;
display: inline-block;
}
.pager_button.active {
border-radius: 3px;
-webkit-border-radius: 3px;
background-color: gray;
color: white;
}
This diff is collapsed.
var locales = {
'en': {
'def_opts_val_size': 'Any',
'def_opts_val_type': 'Any',
'def_opts_val_image': 'Any',
'def_opts_val_copyright': 'Any',
'size_title': 'Size',
'size_small': 'Small',
'size_medium': 'Medium',
'size_large': 'Large',
'size_extra_large': 'Extra large',
'colorization_title': 'Colorization',
'coloriz_grayscale': 'Grayscale',
'coloriz_color': 'Color',
'main_color_title': 'Main color',
'm_color_black': 'Black',
'm_color_blue': 'Blue',
'm_color_brown': 'Brown',
'm_color_gray': 'Gray',
'm_color_green': 'Green',
'm_color_orange': 'Orange',
'm_color_pink': 'Pink',
'm_color_purple': 'Purple',
'm_color_red': 'Red',
'm_color_teal': 'Teal',
'm_color_white': 'White',
'm_color_yellow': 'Yellow',
'file_type_title': 'File type',
'image_type_title': 'Image type',
'image_type_faces': 'Faces',
'image_type_photo': 'Photo',
'image_type_clipart': 'Clipart',
'image_type_lineart': 'Lineart',
'image_license_title': 'Licence',
'image_license_reuse': 'Reuse',
'image_license_comm_reuse': 'Commercial reuse',
'image_license_modif': 'Modification',
'image_license_comm_modif': 'Commercial modification',
'disclaimer_title': 'This API is based on Google Image. Please refer to terms of use of this service.'
},
'fr': {
'def_opts_val_size': 'Toutes',
'def_opts_val_type': 'Tous',
'def_opts_val_image': 'Toutes',
'def_opts_val_copyright': 'Tous',
'size_title': 'Tailles',
'size_small': 'Petite',
'size_medium': 'Moyenne',
'size_large': 'Grande',
'size_extra_large': 'Extra large',
'colorization_title': 'Couleurs de l\'image',
'coloriz_grayscale': 'Noir et blanc',
'coloriz_color': 'En couleur',
'main_color_title': 'Couleur électronique',
'm_color_black': 'Noir',
'm_color_blue': 'Bleu',
'm_color_brown': 'Brun',
'm_color_gray': 'Gris',
'm_color_green': 'Vert',
'm_color_orange': 'Orange',
'm_color_pink': 'Rose',
'm_color_purple': 'Pourpre',
'm_color_red': 'Rouge',
'm_color_teal': 'Sarcelle',
'm_color_white': 'Blanc',
'm_color_yellow': 'Jaune',
'file_type_title': 'Types de fichier',
'image_type_title': 'Types d\'image',
'image_type_faces': 'Visages',
'image_type_photo': 'Photo',
'image_type_clipart': 'Images clipart',
'image_type_lineart': 'Dessins au trait',
'image_license_title': 'Droits d\'usage',
'image_license_reuse': 'Usage, distribution',
'image_license_comm_reuse': 'Usage, distribution, commercial',
'image_license_modif': 'Usage, distribution, modification',
'image_license_comm_modif': 'Usage, distribution, modification, commercial',
'disclaimer_title': 'Cette recherche utilise les services de Google Images. Veuillez vous référer aux conditions d\'utilisation de ce service.'
}
};
/* Dropdown control */
.selectBox-dropdown {
min-width: 60px;
position: relative;
/*border: solid 1px #BBB;*/
line-height: 1.5;
text-decoration: none;
text-align: left;
color: #000;
outline: none;
vertical-align: middle;
background: #F2F2F2;
background: -moz-linear-gradient(top, #F8F8F8 1%, #E1E1E1 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #F8F8F8), color-stop(100%, #E1E1E1));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F8F8F8', endColorstr='#E1E1E1', GradientType=0);
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, .75);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, .75);
box-shadow: 0 1px 0 rgba(255, 255, 255, .75);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
display: inline-block;
cursor: default;
}
.selectBox-dropdown:focus,
.selectBox-dropdown:focus .selectBox-arrow {
border-color: #666;
}
.selectBox-dropdown.selectBox-menuShowing {
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.selectBox-dropdown .selectBox-label {
padding: 2px 8px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
}
.selectBox-dropdown .selectBox-arrow {
position: absolute;
top: 0;
right: 0;
width: 23px;
height: 100%;
background: url(jquery.selectBox-arrow.gif) 50% center no-repeat;
border-left: solid 1px #BBB;
}
/* Dropdown menu */
.selectBox-dropdown-menu {
position: absolute;
z-index: 99999;
max-height: 200px;
min-height: 1em;
border: solid 1px #BBB; /* should be the same border width as .selectBox-dropdown */
background: #FFF;
-moz-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
overflow: auto;
}
/* Inline control */
.selectBox-inline {
min-width: 150px;
outline: none;
border: solid 1px #BBB;
background: #FFF;
display: inline-block;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
overflow: auto;
}
.selectBox-inline:focus {
border-color: #666;
}
/* Options */
.selectBox-options,
.selectBox-options LI,
.selectBox-options LI A {
list-style: none;
display: block;
cursor: default;
padding: 0;
margin: 0;
}
.selectBox-options LI A {
line-height: 1.5;
padding: 0 .5em;
white-space: nowrap;
overflow: hidden;
background: 6px center no-repeat;
}
.selectBox-options LI.selectBox-hover A {
background-color: #EEE;
}
.selectBox-options LI.selectBox-disabled A {
color: #888;
background-color: transparent;
}
.selectBox-options LI.selectBox-selected A {
background-color: #C8DEF4;
}
.selectBox-options .selectBox-optgroup {
color: #666;
background: #EEE;
font-weight: bold;
line-height: 1.5;
padding: 0 .3em;
white-space: nowrap;
}
/* Disabled state */
.selectBox.selectBox-disabled {
color: #888 !important;
}
.selectBox-dropdown.selectBox-disabled .selectBox-arrow {
opacity: .5;
filter: alpha(opacity=50);
border-color: #666;
}
.selectBox-inline.selectBox-disabled {
color: #888 !important;
}
.selectBox-inline.selectBox-disabled .selectBox-options A {
background-color: transparent !important;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment