|
Before Width: | Height: | Size: 564 KiB |
|
Before Width: | Height: | Size: 418 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 156 KiB |
@ -1,12 +0,0 @@ |
||||
(function($) { |
||||
$(document).on('ready', function() { |
||||
$('select[name="action"]', '#changelist-form').on('change', function() { |
||||
if ($(this).val() == 'export_admin_action') { |
||||
$('select[name="file_format"]', '#changelist-form').parent().show(); |
||||
} else { |
||||
$('select[name="file_format"]', '#changelist-form').parent().hide(); |
||||
} |
||||
}); |
||||
$('select[name="action"]', '#changelist-form').change(); |
||||
}); |
||||
})(django.jQuery); |
||||
|
Before Width: | Height: | Size: 457 B |
|
Before Width: | Height: | Size: 496 B |
|
Before Width: | Height: | Size: 464 B |
@ -1,52 +0,0 @@ |
||||
.field-tree_actions { |
||||
width: 50px; |
||||
padding: 2px; |
||||
} |
||||
|
||||
.field-tree_actions > div { |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
background-repeat: no-repeat; |
||||
width: 18px; |
||||
height: 18px; |
||||
margin: 7px 2px 0 0; |
||||
} |
||||
|
||||
.tree-node { cursor: pointer; } |
||||
.tree-node.children { background-image: url(disclosure-down.png); } |
||||
.tree-node.closed { background-image: url(disclosure-right.png); } |
||||
|
||||
.drag-handle { background-image: url(arrow-move.png); cursor: move; } |
||||
|
||||
/* focus */ |
||||
#result_list tbody tr:focus { |
||||
background-color: #ffffcc !important; outline: 0px; } |
||||
|
||||
#drag-line { |
||||
position: absolute; |
||||
height: 3px; |
||||
font-size: 0px; |
||||
background-color: #417690; |
||||
} |
||||
|
||||
#drag-line:before { |
||||
content: ' '; |
||||
display: block; |
||||
position: absolute; |
||||
height: 10px; |
||||
width: 10px; |
||||
background: #417690; |
||||
margin: -3px 0 0 0; |
||||
border-radius: 9px; |
||||
} |
||||
|
||||
#drag-line span { |
||||
display: block; |
||||
position: absolute; |
||||
left: 15px; |
||||
bottom: 0; |
||||
width: 300px; |
||||
height: 18px; |
||||
color: #417690; |
||||
font-size: 12px; |
||||
} |
||||
@ -1,426 +0,0 @@ |
||||
/* global django */ |
||||
|
||||
// IE<9 lacks Array.prototype.indexOf
|
||||
if (!Array.prototype.indexOf) { |
||||
Array.prototype.indexOf = function(needle) { |
||||
for (var i=0, l=this.length; i<l; ++i) { |
||||
if (this[i] === needle) return i; |
||||
} |
||||
return -1; |
||||
}; |
||||
} |
||||
|
||||
// https://github.com/jquery/jquery-ui/blob/master/ui/disable-selection.js
|
||||
django.jQuery.fn.extend({ |
||||
disableSelection: (function() { |
||||
var eventType = 'onselectstart' in document.createElement('div') ? 'selectstart' : 'mousedown'; |
||||
|
||||
return function() { |
||||
return this.on(eventType + '.ui-disableSelection', function(event) { |
||||
event.preventDefault(); |
||||
}); |
||||
}; |
||||
})(), |
||||
|
||||
enableSelection: function() { |
||||
return this.off('.ui-disableSelection'); |
||||
} |
||||
}); |
||||
|
||||
|
||||
django.jQuery(function($){ |
||||
// We are not on a changelist it seems.
|
||||
if (!document.getElementById('result_list')) return; |
||||
|
||||
var DraggableMPTTAdmin = null; |
||||
|
||||
function isExpandedNode(id) { |
||||
return DraggableMPTTAdmin.collapsedNodes.indexOf(id) == -1; |
||||
} |
||||
|
||||
function markNodeAsExpanded(id) { |
||||
// remove itemId from array of collapsed nodes
|
||||
var idx = DraggableMPTTAdmin.collapsedNodes.indexOf(id); |
||||
if(idx >= 0) |
||||
DraggableMPTTAdmin.collapsedNodes.splice(idx, 1); |
||||
} |
||||
|
||||
function markNodeAsCollapsed(id) { |
||||
if(isExpandedNode(id)) |
||||
DraggableMPTTAdmin.collapsedNodes.push(id); |
||||
} |
||||
|
||||
function treeNode(pk) { |
||||
return $('.tree-node[data-pk="' + pk + '"]'); |
||||
} |
||||
|
||||
// toggle children
|
||||
function doToggle(id, show) { |
||||
var children = DraggableMPTTAdmin.treeStructure[id] || []; |
||||
for (var i=0; i<children.length; ++i) { |
||||
var childId = children[i]; |
||||
if(show) { |
||||
treeNode(childId).closest('tr').show(); |
||||
// only reveal children if current node is not collapsed
|
||||
if(isExpandedNode(childId)) { |
||||
doToggle(childId, show); |
||||
} |
||||
} else { |
||||
treeNode(childId).closest('tr').hide(); |
||||
// always recursively hide children
|
||||
doToggle(childId, show); |
||||
} |
||||
} |
||||
} |
||||
|
||||
function rowLevel($row) { |
||||
try { |
||||
return $row.find('.tree-node').data('level') || 0; |
||||
} catch (e) { |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
/* Thanks, Django */ |
||||
function getCookie(name) { |
||||
var cookieValue = null; |
||||
if (document.cookie && document.cookie != '') { |
||||
var cookies = document.cookie.split(';'); |
||||
for (var i = 0; i < cookies.length; i++) { |
||||
var cookie = $.trim(cookies[i]); |
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) { |
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
return cookieValue; |
||||
} |
||||
|
||||
/* |
||||
* FeinCMS Drag-n-drop tree reordering. |
||||
* Based upon code by bright4 for Radiant CMS, rewritten for |
||||
* FeinCMS by Bjorn Post. |
||||
* |
||||
* September 2010 |
||||
*/ |
||||
$.extend($.fn.feinTree = function() { |
||||
$.each(DraggableMPTTAdmin.treeStructure, function(key, value) { |
||||
treeNode(key).addClass('children'); |
||||
}); |
||||
|
||||
$('div.drag-handle').bind('mousedown', function(event) { |
||||
var BEFORE = 'before'; |
||||
var AFTER = 'after'; |
||||
var CHILD = 'child'; |
||||
var CHILD_PAD = DraggableMPTTAdmin.levelIndent; |
||||
var originalRow = $(event.target).closest('tr'); |
||||
var rowHeight = originalRow.height(); |
||||
var moveTo = new Object(); |
||||
var resultListWidth = $('#result_list').width(); |
||||
|
||||
$('body').addClass('dragging').disableSelection().bind('mousemove', function(event) { |
||||
// Remove focus
|
||||
originalRow.blur(); |
||||
|
||||
// attach dragged item to mouse
|
||||
var cloned = originalRow.html(); |
||||
if($('#ghost').length == 0) { |
||||
$('<div id="ghost"></div>').appendTo('body'); |
||||
} |
||||
$('#ghost').html(cloned).css({ |
||||
'opacity': .8, |
||||
'position': 'absolute', |
||||
'top': event.pageY, |
||||
'left': event.pageX - 30, |
||||
'width': 600 |
||||
}); |
||||
|
||||
// check on edge of screen
|
||||
if(event.pageY+100 > $(window).height()+$(window).scrollTop()) { |
||||
$('html,body').stop().animate({scrollTop: $(window).scrollTop()+250 }, 500); |
||||
} else if(event.pageY-50 < $(window).scrollTop()) { |
||||
$('html,body').stop().animate({scrollTop: $(window).scrollTop()-250 }, 500); |
||||
} |
||||
|
||||
// check if drag-line element already exists, else append
|
||||
if($('#drag-line').length < 1) { |
||||
$('body').append('<div id="drag-line"><span></span></div>'); |
||||
} |
||||
|
||||
// loop trough all rows
|
||||
$('tr', originalRow.parent()).each(function(index, el) { |
||||
var element = $(el), |
||||
top = element.offset().top, |
||||
next; |
||||
|
||||
// check if mouse is over a row
|
||||
if (event.pageY >= top && event.pageY < top + rowHeight) { |
||||
var targetRow = null, |
||||
targetLoc = null, |
||||
elementLevel = rowLevel(element); |
||||
|
||||
if (event.pageY >= top && event.pageY < top + rowHeight / 3) { |
||||
targetRow = element; |
||||
targetLoc = BEFORE; |
||||
} else if (event.pageY >= top + rowHeight / 3 && event.pageY < top + rowHeight * 2 / 3) { |
||||
next = element.next(); |
||||
// there's no point in allowing adding children when there are some already
|
||||
// better move the items to the correct place right away
|
||||
if (!next.length || rowLevel(next) <= elementLevel) { |
||||
targetRow = element; |
||||
targetLoc = CHILD; |
||||
} |
||||
} else if (event.pageY >= top + rowHeight * 2 / 3 && event.pageY < top + rowHeight) { |
||||
next = element.next(); |
||||
if (!next.length || rowLevel(next) <= elementLevel) { |
||||
targetRow = element; |
||||
targetLoc = AFTER; |
||||
} |
||||
} |
||||
|
||||
if(targetRow) { |
||||
|
||||
// Positioning relative to cell containing the link
|
||||
var offset = targetRow.find('th').offset(); |
||||
var left = offset.left |
||||
+ rowLevel(targetRow) * CHILD_PAD |
||||
+ (targetLoc == CHILD ? CHILD_PAD : 0) |
||||
+ 5; // Center of the circle aligns with start of link text (cell padding!)
|
||||
|
||||
$('#drag-line').css({ |
||||
'width': resultListWidth - left, |
||||
'left': left, |
||||
'top': offset.top + (targetLoc == BEFORE ? 0 : rowHeight) |
||||
}).find('span').text(DraggableMPTTAdmin.messages[targetLoc] || ''); |
||||
|
||||
// Store the found row and options
|
||||
moveTo.hovering = element; |
||||
moveTo.relativeTo = targetRow; |
||||
moveTo.side = targetLoc; |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
$('body').keydown(function(event) { |
||||
if (event.which == '27') { |
||||
$('#drag-line').remove(); |
||||
$('#ghost').remove(); |
||||
$('body').removeClass('dragging').enableSelection().unbind('mousemove').unbind('mouseup'); |
||||
event.preventDefault(); |
||||
} |
||||
}); |
||||
|
||||
$('body').bind('mouseup', function() { |
||||
if(moveTo.relativeTo) { |
||||
var cutItem = originalRow.find('.tree-node').data('pk'); |
||||
var pastedOn = moveTo.relativeTo.find('.tree-node').data('pk'); |
||||
|
||||
// get out early if items are the same
|
||||
if(cutItem != pastedOn) { |
||||
var isParent = ( |
||||
rowLevel(moveTo.relativeTo.next()) > |
||||
rowLevel(moveTo.relativeTo)); |
||||
|
||||
var position = ''; |
||||
|
||||
// determine position
|
||||
if(moveTo.side == CHILD && !isParent) { |
||||
position = 'last-child'; |
||||
} else if (moveTo.side == BEFORE) { |
||||
position = 'left'; |
||||
} else { |
||||
position = 'right'; |
||||
} |
||||
|
||||
$.ajax({ |
||||
complete: function() { |
||||
window.location.reload(); |
||||
}, |
||||
data: { |
||||
cmd: 'move_node', |
||||
position: position, |
||||
cut_item: cutItem, |
||||
pasted_on: pastedOn |
||||
}, |
||||
headers: { |
||||
'X-CSRFToken': getCookie('csrftoken') |
||||
}, |
||||
method: 'POST' |
||||
}); |
||||
} else { |
||||
$('#drag-line').remove(); |
||||
$('#ghost').remove(); |
||||
} |
||||
$('body').removeClass('dragging').enableSelection().unbind('mousemove').unbind('mouseup'); |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
|
||||
return this; |
||||
}); |
||||
|
||||
/* Every time the user expands or collapses a part of the tree, we remember |
||||
the current state of the tree so we can restore it on a reload. */ |
||||
function storeCollapsedNodes(nodes) { |
||||
window.localStorage && window.localStorage.setItem( |
||||
DraggableMPTTAdmin.storageName, |
||||
JSON.stringify(nodes) |
||||
); |
||||
} |
||||
|
||||
function retrieveCollapsedNodes() { |
||||
try { |
||||
return JSON.parse(window.localStorage.getItem( |
||||
DraggableMPTTAdmin.storageName |
||||
)); |
||||
} catch(e) { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
function expandOrCollapseNode(item) { |
||||
var show = true; |
||||
|
||||
if (!item.hasClass('children')) |
||||
return; |
||||
|
||||
var itemId = item.data('pk'); |
||||
|
||||
if (!isExpandedNode(itemId)) { |
||||
item.removeClass('closed'); |
||||
markNodeAsExpanded(itemId); |
||||
} else { |
||||
item.addClass('closed'); |
||||
show = false; |
||||
markNodeAsCollapsed(itemId); |
||||
} |
||||
|
||||
storeCollapsedNodes(DraggableMPTTAdmin.collapsedNodes); |
||||
|
||||
doToggle(itemId, show); |
||||
} |
||||
|
||||
function collapseTree() { |
||||
var rlist = $("#result_list"); |
||||
rlist.hide(); |
||||
$('tbody tr', rlist).each(function(i, el) { |
||||
var marker = $('.tree-node', el); |
||||
if (marker.hasClass('children')) { |
||||
var itemId = marker.data('pk'); |
||||
doToggle(itemId, false); |
||||
marker.addClass('closed'); |
||||
markNodeAsCollapsed(itemId); |
||||
} |
||||
}); |
||||
storeCollapsedNodes(DraggableMPTTAdmin.collapsedNodes); |
||||
rlist.show(); |
||||
return false; |
||||
} |
||||
|
||||
function expandTree() { |
||||
var rlist = $("#result_list"); |
||||
rlist.hide(); |
||||
$('tbody tr', rlist).each(function(i, el) { |
||||
var marker = $('.tree-node', el); |
||||
if (marker.hasClass('children')) { |
||||
var itemId = $('.tree-node', el).data('pk'); |
||||
doToggle(itemId, true); |
||||
marker.removeClass('closed'); |
||||
markNodeAsExpanded(itemId); |
||||
} |
||||
}); |
||||
storeCollapsedNodes([]); |
||||
rlist.show(); |
||||
return false; |
||||
} |
||||
|
||||
var changelistTab = function(elem, event, direction) { |
||||
event.preventDefault(); |
||||
elem = $(elem); |
||||
var ne = (direction > 0) ? elem.nextAll(':visible:first') : elem.prevAll(':visible:first'); |
||||
if(ne) { |
||||
elem.attr('tabindex', -1); |
||||
ne.attr('tabindex', '0'); |
||||
ne.focus(); |
||||
} |
||||
}; |
||||
|
||||
function keyboardNavigationHandler(event) { |
||||
// On form element? Ignore.
|
||||
if (/textarea|select|input/i.test(event.target.nodeName)) |
||||
return; |
||||
|
||||
// console.log('keydown', this, event.keyCode);
|
||||
switch (event.keyCode) { |
||||
case 40: // down
|
||||
changelistTab(this, event, 1); |
||||
break; |
||||
case 38: // up
|
||||
changelistTab(this, event, -1); |
||||
break; |
||||
case 37: // left
|
||||
case 39: // right
|
||||
expandOrCollapseNode($(this).find('.tree-node')); |
||||
break; |
||||
case 13: // return
|
||||
document.location = $('a', this).attr('href'); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
|
||||
function addObjectTool(title, handler) { |
||||
var $a = $('<a href/>'); |
||||
$a.click(handler); |
||||
$a.text(title); |
||||
$a.prependTo('.object-tools').wrap('<li>'); |
||||
} |
||||
|
||||
// Some old browsers do not support JSON.parse (the only thing we require)
|
||||
var jsonParse = JSON.parse || function jsonParse(sJSON) { return eval('(' + sJSON + ')'); }; |
||||
|
||||
DraggableMPTTAdmin = jsonParse( |
||||
document.getElementById('draggable-admin-context').getAttribute('data-context')); |
||||
|
||||
addObjectTool(DraggableMPTTAdmin.messages.collapseTree, collapseTree); |
||||
addObjectTool(DraggableMPTTAdmin.messages.expandTree, expandTree); |
||||
|
||||
// fire!
|
||||
var rlist = $("#result_list"), |
||||
rlist_tbody = rlist.find('tbody'); |
||||
|
||||
if ($('tbody tr', rlist).length > 1) { |
||||
rlist_tbody.feinTree(); |
||||
|
||||
rlist.find('.tree-node').on('click', function(event) { |
||||
event.preventDefault(); |
||||
event.stopPropagation(); |
||||
|
||||
expandOrCollapseNode($(this)); |
||||
}); |
||||
|
||||
/* Enable focussing, put focus on first result, add handler for keyboard navigation */ |
||||
$('tr', rlist).attr('tabindex', -1); |
||||
$('tbody tr:first', rlist).attr('tabindex', 0).focus(); |
||||
$('tr', rlist).keydown(keyboardNavigationHandler); |
||||
|
||||
DraggableMPTTAdmin.collapsedNodes = []; |
||||
var storedNodes = retrieveCollapsedNodes(); |
||||
|
||||
if (storedNodes) { |
||||
for(var i=0; i<storedNodes.length; i++) { |
||||
expandOrCollapseNode(treeNode(storedNodes[i])); |
||||
} |
||||
} else { |
||||
collapseTree(); |
||||
} |
||||
} |
||||
|
||||
}); |
||||
@ -1,40 +0,0 @@ |
||||
html, body{ |
||||
height: 100%; |
||||
max-height: 100%; |
||||
font-family: 'Roboto', sans-serif; |
||||
} |
||||
|
||||
.top-container{ |
||||
padding-top: 10%; |
||||
} |
||||
|
||||
.general-container{ |
||||
background: url('../img/bg_image.jpg'); |
||||
height: 100%; |
||||
} |
||||
|
||||
.general-container form{ |
||||
margin-top: 30px; |
||||
} |
||||
|
||||
.general-container form label{ |
||||
color: white; |
||||
font-weight: 100; |
||||
} |
||||
|
||||
.btn-orange{ |
||||
background-color: #e8643e; |
||||
border: none; |
||||
} |
||||
|
||||
.btn-orange:hover{ |
||||
background-color: #dc5129; |
||||
border: none; |
||||
} |
||||
|
||||
.title{ |
||||
text-align: center; |
||||
color: white; |
||||
font-weight: 100; |
||||
line-height: 50px; |
||||
} |
||||
@ -1,43 +0,0 @@ |
||||
html, body, div, span, applet, object, iframe, |
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
||||
a, abbr, acronym, address, big, cite, code, |
||||
del, dfn, em, img, ins, kbd, q, s, samp, |
||||
small, strike, strong, sub, sup, tt, var, |
||||
b, u, i, center, |
||||
dl, dt, dd, ol, ul, li, |
||||
fieldset, form, label, legend, |
||||
table, caption, tbody, tfoot, thead, tr, th, td, |
||||
article, aside, canvas, details, embed, |
||||
figure, figcaption, footer, header, hgroup, |
||||
menu, nav, output, ruby, section, summary, |
||||
time, mark, audio, video { |
||||
margin: 0; |
||||
padding: 0; |
||||
border: 0; |
||||
font-size: 100%; |
||||
font: inherit; |
||||
vertical-align: baseline; |
||||
} |
||||
/* HTML5 display-role reset for older browsers */ |
||||
article, aside, details, figcaption, figure, |
||||
footer, header, hgroup, menu, nav, section { |
||||
display: block; |
||||
} |
||||
body { |
||||
line-height: 1; |
||||
} |
||||
ol, ul { |
||||
list-style: none; |
||||
} |
||||
blockquote, q { |
||||
quotes: none; |
||||
} |
||||
blockquote:before, blockquote:after, |
||||
q:before, q:after { |
||||
content: ''; |
||||
content: none; |
||||
} |
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
} |
||||
@ -1,964 +0,0 @@ |
||||
html, body{ |
||||
height: 100%; |
||||
max-height: 100%; |
||||
font-family: 'Roboto', sans-serif; |
||||
background-color: #edeef0; |
||||
} |
||||
|
||||
.navbar{ |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.wrapper{ |
||||
min-height: 100%; |
||||
} |
||||
|
||||
.wrapper-content{ |
||||
overflow: auto; |
||||
padding-bottom: 180px; /* must be same height as the footer */ |
||||
} |
||||
|
||||
.section-top{ |
||||
margin-bottom: 20px |
||||
} |
||||
|
||||
.footer{ |
||||
position: relative; |
||||
margin-top: -180px; /* negative value of footer height */ |
||||
height: 180px; |
||||
clear: both; |
||||
background-color: white; |
||||
} |
||||
|
||||
.product-item{ |
||||
height: 360px; |
||||
background-color: white; |
||||
border: 1px solid lightgrey; |
||||
position: relative; |
||||
padding: 10px 0 10px 0; |
||||
text-align: center; |
||||
margin-bottom: 10px; |
||||
} |
||||
|
||||
.discount-container{ |
||||
position: absolute; |
||||
top: 30%; |
||||
background: #fb4545; |
||||
width: 30%; |
||||
color: white; |
||||
font-weight: 700; |
||||
padding: 3px; |
||||
} |
||||
|
||||
.add-to-card-btn{ |
||||
position: absolute; |
||||
bottom: 15px; |
||||
left: 50%; |
||||
} |
||||
|
||||
.section-delivery{ |
||||
height: 300px; |
||||
background-color: #2A3342; |
||||
text-align: center; |
||||
color: white; |
||||
} |
||||
|
||||
.product-description-tabs{ |
||||
padding: 10px; |
||||
} |
||||
|
||||
.product-image-item{ |
||||
padding: 5px; |
||||
margin-bottom: 5px; |
||||
} |
||||
|
||||
.navbar-top{ |
||||
min-height: 10px; |
||||
height: 20px; |
||||
background-color: green; |
||||
border: none; |
||||
border-radius: 0; |
||||
} |
||||
.navbar-main{ |
||||
background-color: #c7db03; |
||||
border: none; |
||||
border-radius: 0; |
||||
} |
||||
|
||||
.basket-container{ |
||||
position: relative; |
||||
width: 400px; |
||||
padding: 15px 10px; |
||||
} |
||||
|
||||
.basket-items{ |
||||
position: absolute; |
||||
top: 50px; |
||||
width: 100%; |
||||
background-color: #edfc05; |
||||
z-index: 10; |
||||
padding: 10px; |
||||
} |
||||
|
||||
.product-price{ |
||||
text-align: right; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.main { |
||||
|
||||
width: 1000px; |
||||
height: 150px; |
||||
margin: 0 auto; |
||||
|
||||
} |
||||
|
||||
.top-header { |
||||
max-width: 100%; |
||||
min-width: 1000px; |
||||
height: 50px; |
||||
background-color: #f1f1f1; |
||||
margin-bottom: 15px; |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
.russia-icon { |
||||
width: 95px; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
margin-left: 59px; |
||||
float: left; |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
.russia-icon p { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
margin-left: 11px; |
||||
margin-top: 5px; |
||||
cursor: pointer; |
||||
float: left; |
||||
} |
||||
|
||||
.rusio { |
||||
width: 32px; |
||||
height: 25px; |
||||
float: left; |
||||
background: url(../img/russia.jpg) no-repeat; |
||||
float: left; |
||||
} |
||||
|
||||
.contact-header { |
||||
width: auto; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
float: left; |
||||
} |
||||
|
||||
.contact-header a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
margin-top: 5px; |
||||
|
||||
} |
||||
|
||||
.menu-sp { |
||||
width: 578px; |
||||
height: 28px; |
||||
float: right; |
||||
margin-top: 5px; |
||||
margin-right: 56px; |
||||
|
||||
} |
||||
|
||||
.shop-header { |
||||
width: auto; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
|
||||
float: left; |
||||
} |
||||
|
||||
.shop-header a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
margin-left: 38px; |
||||
} |
||||
|
||||
.auth-header a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
} |
||||
|
||||
.reg-header a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
margin-right: 53px; |
||||
} |
||||
|
||||
.bonus-text p { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
|
||||
} |
||||
|
||||
.about-header { |
||||
width: auto; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
|
||||
float: left; |
||||
} |
||||
|
||||
.about-header a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
text-decoration: underline; |
||||
margin-left: 38px; |
||||
} |
||||
|
||||
.menu-in ul li a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 17px; |
||||
color: #ffffff; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
.tel p { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 16px; |
||||
color: #000; |
||||
float: right; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
.telico { |
||||
width: 20px; |
||||
height: 32px; |
||||
background: url(../img/phone.jpg) no-repeat; |
||||
float: left; |
||||
} |
||||
|
||||
.reg-header{ |
||||
width: auto; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
|
||||
float: right; |
||||
} |
||||
|
||||
.auth-header { |
||||
width: auto; |
||||
height: 25px; |
||||
margin-top: 11px; |
||||
|
||||
float: right; |
||||
} |
||||
|
||||
|
||||
.main-header { |
||||
width: 1000px; |
||||
height: 123px; |
||||
margin: 0 auto; |
||||
|
||||
} |
||||
|
||||
.logo { |
||||
width: 163px; |
||||
height: 123px; |
||||
background: url(../img/logo.jpg) no-repeat; |
||||
float: left; |
||||
} |
||||
|
||||
|
||||
.bonus { |
||||
width: 205px; |
||||
height: 60px; |
||||
|
||||
|
||||
float: left; |
||||
margin-left: 100px; |
||||
margin-top: 40px; |
||||
|
||||
} |
||||
|
||||
.pod { |
||||
width: 67px; |
||||
height: 47px; |
||||
background: url(../img/pod.jpg) no-repeat; |
||||
float: right; |
||||
} |
||||
|
||||
.bonus-text { |
||||
width: auto; |
||||
height: 40px; |
||||
float: left; |
||||
margin-top: 12px; |
||||
|
||||
} |
||||
|
||||
.elem { |
||||
width: 447px; |
||||
height: 123px; |
||||
|
||||
float: right; |
||||
|
||||
} |
||||
|
||||
.elem2 { |
||||
width: 447px; |
||||
height: 87px; |
||||
|
||||
float: right; |
||||
} |
||||
|
||||
.search { |
||||
width: 446px; |
||||
height: 44px; |
||||
float: right; |
||||
|
||||
} |
||||
|
||||
.searchloop { |
||||
width: 23px; |
||||
height: 23px; |
||||
background: url(../img/searchloop.jpg) no-repeat; |
||||
cursor: pointer; |
||||
position: absolute; |
||||
|
||||
} |
||||
|
||||
.ssslll { |
||||
width: 23px; |
||||
height: 23px; |
||||
float: right; |
||||
margin-top: -32px; |
||||
margin-right: 15px; |
||||
} |
||||
|
||||
.search input { |
||||
width: 446px; |
||||
height: 35px; |
||||
float: right; |
||||
border: 2px solid #00695a; |
||||
outline: none; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
.search input[type="text"] { |
||||
padding-left: 15px; |
||||
padding-right: 41px; |
||||
color: #000; |
||||
} |
||||
|
||||
.tel { |
||||
width: 151px; |
||||
height: 33px; |
||||
|
||||
float: right; |
||||
margin-top: 42px; |
||||
margin-right: 22px; |
||||
} |
||||
|
||||
.basket { |
||||
width: 117px; |
||||
height: 63px; |
||||
|
||||
float: right; |
||||
margin-top: 24px; |
||||
} |
||||
|
||||
.marr { |
||||
width: 58px; |
||||
height: 20px; |
||||
float: right; |
||||
} |
||||
|
||||
|
||||
.menu { |
||||
width: 100%; |
||||
height: 43px; |
||||
background-color: #cc0000; |
||||
} |
||||
|
||||
.menu-in { |
||||
width: 1000px; |
||||
height: 63px; |
||||
|
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.menu ul li { |
||||
margin-left: 66px; |
||||
margin-top: 12px; |
||||
padding-left: 15px; |
||||
float: left; |
||||
} |
||||
|
||||
.main-down { |
||||
width: 1000px; |
||||
height: 790px; |
||||
margin: 0 auto; |
||||
|
||||
} |
||||
|
||||
.gallery { |
||||
width: 1000px; |
||||
height: 410px; |
||||
|
||||
|
||||
margin-top: 50px; |
||||
|
||||
} |
||||
|
||||
.programms { |
||||
width: 1000px; |
||||
height: 380px; |
||||
|
||||
position: relative; |
||||
} |
||||
|
||||
.iconss { |
||||
width: 1000px; |
||||
height: 149px; |
||||
|
||||
|
||||
} |
||||
|
||||
.iconss2 { |
||||
width: 1000px; |
||||
height: 100px; |
||||
|
||||
|
||||
} |
||||
|
||||
.matr { |
||||
width: 34px; |
||||
height: 59px; |
||||
background: url(../img/matr.jpg) no-repeat; |
||||
float: left; |
||||
} |
||||
|
||||
.basket p { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 18px; |
||||
color: #000000; |
||||
margin-top: 25px; |
||||
float: right; |
||||
|
||||
} |
||||
|
||||
.programms h1 { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 48px; |
||||
color: #006d55; |
||||
text-align: center; |
||||
margin-bottom: 41px; |
||||
} |
||||
|
||||
.ico1 { |
||||
width: 198px; |
||||
height: 42px; |
||||
background: url(../img/ico1.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico2 { |
||||
width: 185px; |
||||
height: 73px; |
||||
background: url(../img/ico2.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico3 { |
||||
width: 149px; |
||||
height: 126px; |
||||
background: url(../img/ico3.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico4 { |
||||
width: 185px; |
||||
height: 49px; |
||||
background: url(../img/ico4.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico5 { |
||||
width: 189px; |
||||
height: 66px; |
||||
background: url(../img/ico5.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
|
||||
|
||||
.ico6 { |
||||
width: 187px; |
||||
height: 68px; |
||||
background: url(../img/ico6.jpg) no-repeat; |
||||
margin-left: 15px; |
||||
float: left; |
||||
} |
||||
|
||||
.ico7 { |
||||
width: 175px; |
||||
height: 73px; |
||||
background: url(../img/ico7.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico8 { |
||||
width: 194px; |
||||
height: 67px; |
||||
background: url(../img/ico8.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico9 { |
||||
width: 175px; |
||||
height: 49px; |
||||
background: url(../img/ico9.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
.ico10 { |
||||
width: 189px; |
||||
height: 52px; |
||||
background: url(../img/ico10.jpg) no-repeat; |
||||
float: left; |
||||
margin-left: 15px; |
||||
} |
||||
|
||||
|
||||
.boxlink { |
||||
width: 1000px; |
||||
height: 555px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.link150 { |
||||
width: 700px; |
||||
height: 26px; |
||||
|
||||
float: left; |
||||
margin-top: 25px; |
||||
} |
||||
|
||||
.link150 p a { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 14px; |
||||
color: #9e9e9e; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
.kasico { |
||||
width: 328px; |
||||
height: 76px; |
||||
background: url(../img/kasp.jpg) no-repeat; |
||||
margin-top: 53px; |
||||
float: left; |
||||
position: relative; |
||||
} |
||||
|
||||
.link150 h1 { |
||||
width: 369px; |
||||
height: 30px; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
float: right; |
||||
position: relative; |
||||
} |
||||
|
||||
.uuu { |
||||
width: 1000px; |
||||
height: 185px; |
||||
|
||||
} |
||||
|
||||
.khome { |
||||
width: 1000px; |
||||
height: 59px; |
||||
background-color: #f1f1f1; |
||||
} |
||||
|
||||
.khome p { |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 18px; |
||||
color: #006e53; |
||||
text-align: center; |
||||
padding-top: 24px; |
||||
} |
||||
|
||||
.linest { |
||||
width: 1000px; |
||||
height: 316px; |
||||
|
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.product1 { |
||||
width: 223px; |
||||
height: 307px; |
||||
margin-left: 17px; |
||||
float: left; |
||||
border: 3px solid #006e53; |
||||
} |
||||
|
||||
.product1 p { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 20px; |
||||
position: relative; |
||||
margin-top: 19px; |
||||
} |
||||
|
||||
.khome a { |
||||
color: #006e53; |
||||
} |
||||
|
||||
.pr1kas { |
||||
width: 122px; |
||||
height: 166px; |
||||
background: url(../img/pr1.jpg) no-repeat; |
||||
margin: 0 auto; |
||||
margin-top: 27px; |
||||
} |
||||
|
||||
.zks p { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 20px; |
||||
margin-top: 30px; |
||||
color: red; |
||||
} |
||||
|
||||
.blocktov { |
||||
width: 1000px; |
||||
height: 510px; |
||||
|
||||
margin-top: 20px; |
||||
} |
||||
|
||||
.blocktovleft img { |
||||
padding: 20px 40px; |
||||
float: left; |
||||
border: 3px solid #006e53; |
||||
} |
||||
|
||||
.greenline { |
||||
width: 555px; |
||||
height: 114px; |
||||
background-color: #00695a; |
||||
float: right; |
||||
} |
||||
|
||||
.greenline p { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 36px; |
||||
color: #fff; |
||||
margin-top: 20px; |
||||
margin-left: -5px; |
||||
} |
||||
|
||||
.textproduct { |
||||
width: 555px; |
||||
height: 195px; |
||||
|
||||
float: right; |
||||
margin-top: 25px; |
||||
} |
||||
|
||||
.textproduct p { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 18px; |
||||
color: #000; |
||||
} |
||||
|
||||
.bonusblock { |
||||
width: 332px; |
||||
height: 100px; |
||||
|
||||
position: absolute; |
||||
border: 3px solid #00695a; |
||||
margin-top: 400px; |
||||
} |
||||
|
||||
|
||||
.bonusblock p { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 48px; |
||||
color: #298a12; |
||||
margin-top: 12px; |
||||
} |
||||
|
||||
.bonusblock h3 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normaL; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
|
||||
|
||||
|
||||
.bonusblock h3 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normaL; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.buy { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
|
||||
|
||||
width: 185px; |
||||
height: 200px; |
||||
|
||||
float: left; |
||||
margin-top: -20px; |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
#cat1 input{ |
||||
|
||||
width: 65px; |
||||
height: 30px; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#cat2 input{ |
||||
|
||||
width: 65px; |
||||
height: 30px; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#cat3 input{ |
||||
|
||||
width: 65px; |
||||
height: 30px; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#sdgsdgsdweg { |
||||
color: red; |
||||
} |
||||
|
||||
input[type="checkbox"] { |
||||
display:inline-block; |
||||
width:40px; |
||||
|
||||
height:40px; |
||||
vertical-align:middle; |
||||
|
||||
cursor:pointer; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
|
||||
#cat1 input[type="text"] { |
||||
|
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
|
||||
#cat1 button { |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#cat2 input[type="text"] { |
||||
|
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
|
||||
#cat2 button { |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#cat3 input[type="text"] { |
||||
|
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
|
||||
#cat3 button { |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
|
||||
|
||||
.buy #cat1 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
.buy #cat2 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
margin-top: 8px; |
||||
} |
||||
.buy #cat3 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
.buy .onever { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
#erw { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
|
||||
#erw2 { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
} |
||||
.buy .itog { |
||||
text-align: center; |
||||
font-family: 'Myriad Pro'; |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
font-size: 24px; |
||||
color: #000; |
||||
margin-top: 8px; |
||||
} |
||||
|
||||
.calcblock { |
||||
width: 555px; |
||||
height: 200px; |
||||
|
||||
position: relative; |
||||
margin-top: 200px; |
||||
} |
||||
@ -1,439 +0,0 @@ |
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldCondIt.eot'); |
||||
src: local('Myriad Pro Bold Condensed Italic'), local('MyriadPro-BoldCondIt'), |
||||
url('MyriadPro-BoldCondIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldCondIt.woff') format('woff'), |
||||
url('MyriadPro-BoldCondIt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackIt.eot'); |
||||
src: local('Myriad Pro Black Italic'), local('MyriadPro-BlackIt'), |
||||
url('MyriadPro-BlackIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackIt.woff') format('woff'), |
||||
url('MyriadPro-BlackIt.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightIt.eot'); |
||||
src: local('Myriad Pro Light Italic'), local('MyriadPro-LightIt'), |
||||
url('MyriadPro-LightIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightIt.woff') format('woff'), |
||||
url('MyriadPro-LightIt.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackCond.eot'); |
||||
src: local('Myriad Pro Black Condensed'), local('MyriadPro-BlackCond'), |
||||
url('MyriadPro-BlackCond.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackCond.woff') format('woff'), |
||||
url('MyriadPro-BlackCond.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Cond.eot'); |
||||
src: local('Myriad Pro Condensed'), local('MyriadPro-Cond'), |
||||
url('MyriadPro-Cond.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Cond.woff') format('woff'), |
||||
url('MyriadPro-Cond.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Bold.eot'); |
||||
src: local('Myriad Pro Bold'), local('MyriadPro-Bold'), |
||||
url('MyriadPro-Bold.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Bold.woff') format('woff'), |
||||
url('MyriadPro-Bold.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldIt.eot'); |
||||
src: local('Myriad Pro Bold Italic'), local('MyriadPro-BoldIt'), |
||||
url('MyriadPro-BoldIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldIt.woff') format('woff'), |
||||
url('MyriadPro-BoldIt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldSemiCnIt.eot'); |
||||
src: local('Myriad Pro Bold SemiCondensed Italic'), local('MyriadPro-BoldSemiCnIt'), |
||||
url('MyriadPro-BoldSemiCnIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldSemiCnIt.woff') format('woff'), |
||||
url('MyriadPro-BoldSemiCnIt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-CondIt.eot'); |
||||
src: local('Myriad Pro Condensed Italic'), local('MyriadPro-CondIt'), |
||||
url('MyriadPro-CondIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-CondIt.woff') format('woff'), |
||||
url('MyriadPro-CondIt.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightCond.eot'); |
||||
src: local('Myriad Pro Light Condensed'), local('MyriadPro-LightCond'), |
||||
url('MyriadPro-LightCond.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightCond.woff') format('woff'), |
||||
url('MyriadPro-LightCond.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiCn.eot'); |
||||
src: local('Myriad Pro SemiCondensed'), local('MyriadPro-SemiCn'), |
||||
url('MyriadPro-SemiCn.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiCn.woff') format('woff'), |
||||
url('MyriadPro-SemiCn.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiCnIt.eot'); |
||||
src: local('Myriad Pro SemiCondensed Italic'), local('MyriadPro-SemiCnIt'), |
||||
url('MyriadPro-SemiCnIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiCnIt.woff') format('woff'), |
||||
url('MyriadPro-SemiCnIt.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldCond.eot'); |
||||
src: local('Myriad Pro Bold Condensed'), local('MyriadPro-BoldCond'), |
||||
url('MyriadPro-BoldCond.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldCond.woff') format('woff'), |
||||
url('MyriadPro-BoldCond.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightSemiExtIt.eot'); |
||||
src: local('Myriad Pro Light SemiExtended Italic'), local('MyriadPro-LightSemiExtIt'), |
||||
url('MyriadPro-LightSemiExtIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightSemiExtIt.woff') format('woff'), |
||||
url('MyriadPro-LightSemiExtIt.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Semibold.eot'); |
||||
src: local('Myriad Pro Semibold'), local('MyriadPro-Semibold'), |
||||
url('MyriadPro-Semibold.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Semibold.woff') format('woff'), |
||||
url('MyriadPro-Semibold.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Black.eot'); |
||||
src: local('Myriad Pro Black'), local('MyriadPro-Black'), |
||||
url('MyriadPro-Black.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Black.woff') format('woff'), |
||||
url('MyriadPro-Black.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Regular.eot'); |
||||
src: local('Myriad Pro Regular'), local('MyriadPro-Regular'), |
||||
url('MyriadPro-Regular.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Regular.woff') format('woff'), |
||||
url('MyriadPro-Regular.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightSemiCn.eot'); |
||||
src: local('Myriad Pro Light SemiCondensed'), local('MyriadPro-LightSemiCn'), |
||||
url('MyriadPro-LightSemiCn.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightSemiCn.woff') format('woff'), |
||||
url('MyriadPro-LightSemiCn.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackCondIt.eot'); |
||||
src: local('Myriad Pro Black Condensed Italic'), local('MyriadPro-BlackCondIt'), |
||||
url('MyriadPro-BlackCondIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackCondIt.woff') format('woff'), |
||||
url('MyriadPro-BlackCondIt.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightCondIt.eot'); |
||||
src: local('Myriad Pro Light Condensed Italic'), local('MyriadPro-LightCondIt'), |
||||
url('MyriadPro-LightCondIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightCondIt.woff') format('woff'), |
||||
url('MyriadPro-LightCondIt.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightSemiExt.eot'); |
||||
src: local('Myriad Pro Light SemiExtended'), local('MyriadPro-LightSemiExt'), |
||||
url('MyriadPro-LightSemiExt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightSemiExt.woff') format('woff'), |
||||
url('MyriadPro-LightSemiExt.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackSemiCnIt.eot'); |
||||
src: local('Myriad Pro Black SemiCondensed Italic'), local('MyriadPro-BlackSemiCnIt'), |
||||
url('MyriadPro-BlackSemiCnIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackSemiCnIt.woff') format('woff'), |
||||
url('MyriadPro-BlackSemiCnIt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldCondIt.eot'); |
||||
src: local('Myriad Pro Semibold Condensed Italic'), local('MyriadPro-SemiboldCondIt'), |
||||
url('MyriadPro-SemiboldCondIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldCondIt.woff') format('woff'), |
||||
url('MyriadPro-SemiboldCondIt.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldCond.eot'); |
||||
src: local('Myriad Pro Semibold Condensed'), local('MyriadPro-SemiboldCond'), |
||||
url('MyriadPro-SemiboldCond.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldCond.woff') format('woff'), |
||||
url('MyriadPro-SemiboldCond.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldSemiExtIt.eot'); |
||||
src: local('Myriad Pro Bold SemiExtended Italic'), local('MyriadPro-BoldSemiExtIt'), |
||||
url('MyriadPro-BoldSemiExtIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldSemiExtIt.woff') format('woff'), |
||||
url('MyriadPro-BoldSemiExtIt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldSemiCn.eot'); |
||||
src: local('Myriad Pro Semibold SemiCondensed'), local('MyriadPro-SemiboldSemiCn'), |
||||
url('MyriadPro-SemiboldSemiCn.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldSemiCn.woff') format('woff'), |
||||
url('MyriadPro-SemiboldSemiCn.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackSemiExtIt.eot'); |
||||
src: local('Myriad Pro Black SemiExtended Italic'), local('MyriadPro-BlackSemiExtIt'), |
||||
url('MyriadPro-BlackSemiExtIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackSemiExtIt.woff') format('woff'), |
||||
url('MyriadPro-BlackSemiExtIt.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldSemiExtIt.eot'); |
||||
src: local('Myriad Pro Semibold SemiExtended Italic'), local('MyriadPro-SemiboldSemiExtIt'), |
||||
url('MyriadPro-SemiboldSemiExtIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldSemiExtIt.woff') format('woff'), |
||||
url('MyriadPro-SemiboldSemiExtIt.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-LightSemiCnIt.eot'); |
||||
src: local('Myriad Pro Light SemiCondensed Italic'), local('MyriadPro-LightSemiCnIt'), |
||||
url('MyriadPro-LightSemiCnIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-LightSemiCnIt.woff') format('woff'), |
||||
url('MyriadPro-LightSemiCnIt.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldSemiCn.eot'); |
||||
src: local('Myriad Pro Bold SemiCondensed'), local('MyriadPro-BoldSemiCn'), |
||||
url('MyriadPro-BoldSemiCn.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldSemiCn.woff') format('woff'), |
||||
url('MyriadPro-BoldSemiCn.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldSemiCnIt.eot'); |
||||
src: local('Myriad Pro Semibold SemiCondensed Italic'), local('MyriadPro-SemiboldSemiCnIt'), |
||||
url('MyriadPro-SemiboldSemiCnIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldSemiCnIt.woff') format('woff'), |
||||
url('MyriadPro-SemiboldSemiCnIt.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldIt.eot'); |
||||
src: local('Myriad Pro Semibold Italic'), local('MyriadPro-SemiboldIt'), |
||||
url('MyriadPro-SemiboldIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldIt.woff') format('woff'), |
||||
url('MyriadPro-SemiboldIt.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-It.eot'); |
||||
src: local('Myriad Pro Italic'), local('MyriadPro-It'), |
||||
url('MyriadPro-It.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-It.woff') format('woff'), |
||||
url('MyriadPro-It.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BoldSemiExt.eot'); |
||||
src: local('Myriad Pro Bold SemiExtended'), local('MyriadPro-BoldSemiExt'), |
||||
url('MyriadPro-BoldSemiExt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BoldSemiExt.woff') format('woff'), |
||||
url('MyriadPro-BoldSemiExt.ttf') format('truetype'); |
||||
font-weight: bold; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-Light.eot'); |
||||
src: local('Myriad Pro Light'), local('MyriadPro-Light'), |
||||
url('MyriadPro-Light.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-Light.woff') format('woff'), |
||||
url('MyriadPro-Light.ttf') format('truetype'); |
||||
font-weight: 300; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiboldSemiExt.eot'); |
||||
src: local('Myriad Pro Semibold SemiExtended'), local('MyriadPro-SemiboldSemiExt'), |
||||
url('MyriadPro-SemiboldSemiExt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiboldSemiExt.woff') format('woff'), |
||||
url('MyriadPro-SemiboldSemiExt.ttf') format('truetype'); |
||||
font-weight: 600; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiExtIt.eot'); |
||||
src: local('Myriad Pro SemiExtended Italic'), local('MyriadPro-SemiExtIt'), |
||||
url('MyriadPro-SemiExtIt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiExtIt.woff') format('woff'), |
||||
url('MyriadPro-SemiExtIt.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: italic; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackSemiCn.eot'); |
||||
src: local('Myriad Pro Black SemiCondensed'), local('MyriadPro-BlackSemiCn'), |
||||
url('MyriadPro-BlackSemiCn.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackSemiCn.woff') format('woff'), |
||||
url('MyriadPro-BlackSemiCn.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-BlackSemiExt.eot'); |
||||
src: local('Myriad Pro Black SemiExtended'), local('MyriadPro-BlackSemiExt'), |
||||
url('MyriadPro-BlackSemiExt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-BlackSemiExt.woff') format('woff'), |
||||
url('MyriadPro-BlackSemiExt.ttf') format('truetype'); |
||||
font-weight: 900; |
||||
font-style: normal; |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: 'Myriad Pro'; |
||||
src: url('MyriadPro-SemiExt.eot'); |
||||
src: local('Myriad Pro SemiExtended'), local('MyriadPro-SemiExt'), |
||||
url('MyriadPro-SemiExt.eot?#iefix') format('embedded-opentype'), |
||||
url('MyriadPro-SemiExt.woff') format('woff'), |
||||
url('MyriadPro-SemiExt.ttf') format('truetype'); |
||||
font-weight: normal; |
||||
font-style: normal; |
||||
} |
||||
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 418 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 156 KiB |
@ -1,18 +0,0 @@ |
||||
$(function(){ |
||||
$('#search').keyup(function(){ |
||||
$.ajax({ |
||||
type: "POST", |
||||
url: "/search/", |
||||
data: { |
||||
'search_text': $('#search').val(), |
||||
'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() |
||||
}, |
||||
success: searchSuccess, |
||||
dataType: 'html' |
||||
}); |
||||
}); |
||||
}); |
||||
|
||||
function searchSuccess(data, textStatus, jqXHR){ |
||||
$('#search-results').html(data); |
||||
} |
||||
@ -1,992 +0,0 @@ |
||||
/** |
||||
* Ajax Autocomplete for jQuery, version %version% |
||||
* (c) 2015 Tomas Kirda |
||||
* |
||||
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license. |
||||
* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
|
||||
*/ |
||||
|
||||
/*jslint browser: true, white: true, single: true, this: true, multivar: true */ |
||||
/*global define, window, document, jQuery, exports, require */ |
||||
|
||||
// Expose plugin as an AMD module if AMD loader is present:
|
||||
(function (factory) { |
||||
"use strict"; |
||||
if (typeof define === 'function' && define.amd) { |
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory); |
||||
} else if (typeof exports === 'object' && typeof require === 'function') { |
||||
// Browserify
|
||||
factory(require('jquery')); |
||||
} else { |
||||
// Browser globals
|
||||
factory(jQuery); |
||||
} |
||||
}(function ($) { |
||||
'use strict'; |
||||
|
||||
var |
||||
utils = (function () { |
||||
return { |
||||
escapeRegExChars: function (value) { |
||||
return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); |
||||
}, |
||||
createNode: function (containerClass) { |
||||
var div = document.createElement('div'); |
||||
div.className = containerClass; |
||||
div.style.position = 'absolute'; |
||||
div.style.display = 'none'; |
||||
return div; |
||||
} |
||||
}; |
||||
}()), |
||||
|
||||
keys = { |
||||
ESC: 27, |
||||
TAB: 9, |
||||
RETURN: 13, |
||||
LEFT: 37, |
||||
UP: 38, |
||||
RIGHT: 39, |
||||
DOWN: 40 |
||||
}; |
||||
|
||||
function Autocomplete(el, options) { |
||||
var noop = $.noop, |
||||
that = this, |
||||
defaults = { |
||||
ajaxSettings: {}, |
||||
autoSelectFirst: false, |
||||
appendTo: document.body, |
||||
serviceUrl: null, |
||||
lookup: null, |
||||
onSelect: null, |
||||
width: 'auto', |
||||
minChars: 1, |
||||
maxHeight: 300, |
||||
deferRequestBy: 0, |
||||
params: {}, |
||||
formatResult: Autocomplete.formatResult, |
||||
delimiter: null, |
||||
zIndex: 9999, |
||||
type: 'GET', |
||||
noCache: false, |
||||
onSearchStart: noop, |
||||
onSearchComplete: noop, |
||||
onSearchError: noop, |
||||
preserveInput: false, |
||||
containerClass: 'autocomplete-suggestions', |
||||
tabDisabled: false, |
||||
dataType: 'text', |
||||
currentRequest: null, |
||||
triggerSelectOnValidInput: true, |
||||
preventBadQueries: true, |
||||
lookupFilter: function (suggestion, originalQuery, queryLowerCase) { |
||||
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1; |
||||
}, |
||||
paramName: 'query', |
||||
transformResult: function (response) { |
||||
return typeof response === 'string' ? $.parseJSON(response) : response; |
||||
}, |
||||
showNoSuggestionNotice: false, |
||||
noSuggestionNotice: 'No results', |
||||
orientation: 'bottom', |
||||
forceFixPosition: false |
||||
}; |
||||
|
||||
// Shared variables:
|
||||
that.element = el; |
||||
that.el = $(el); |
||||
that.suggestions = []; |
||||
that.badQueries = []; |
||||
that.selectedIndex = -1; |
||||
that.currentValue = that.element.value; |
||||
that.intervalId = 0; |
||||
that.cachedResponse = {}; |
||||
that.onChangeInterval = null; |
||||
that.onChange = null; |
||||
that.isLocal = false; |
||||
that.suggestionsContainer = null; |
||||
that.noSuggestionsContainer = null; |
||||
that.options = $.extend({}, defaults, options); |
||||
that.classes = { |
||||
selected: 'autocomplete-selected', |
||||
suggestion: 'autocomplete-suggestion' |
||||
}; |
||||
that.hint = null; |
||||
that.hintValue = ''; |
||||
that.selection = null; |
||||
|
||||
// Initialize and set options:
|
||||
that.initialize(); |
||||
that.setOptions(options); |
||||
} |
||||
|
||||
Autocomplete.utils = utils; |
||||
|
||||
$.Autocomplete = Autocomplete; |
||||
|
||||
Autocomplete.formatResult = function (suggestion, currentValue) { |
||||
// Do not replace anything if there current value is empty
|
||||
if (!currentValue) { |
||||
return suggestion.value; |
||||
} |
||||
|
||||
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')'; |
||||
|
||||
return suggestion.value |
||||
.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>') |
||||
.replace(/&/g, '&') |
||||
.replace(/</g, '<') |
||||
.replace(/>/g, '>') |
||||
.replace(/"/g, '"') |
||||
.replace(/<(\/?strong)>/g, '<$1>'); |
||||
}; |
||||
|
||||
Autocomplete.prototype = { |
||||
|
||||
killerFn: null, |
||||
|
||||
initialize: function () { |
||||
var that = this, |
||||
suggestionSelector = '.' + that.classes.suggestion, |
||||
selected = that.classes.selected, |
||||
options = that.options, |
||||
container; |
||||
|
||||
// Remove autocomplete attribute to prevent native suggestions:
|
||||
that.element.setAttribute('autocomplete', 'off'); |
||||
|
||||
that.killerFn = function (e) { |
||||
if (!$(e.target).closest('.' + that.options.containerClass).length) { |
||||
that.killSuggestions(); |
||||
that.disableKillerFn(); |
||||
} |
||||
}; |
||||
|
||||
// html() deals with many types: htmlString or Element or Array or jQuery
|
||||
that.noSuggestionsContainer = $('<div class="autocomplete-no-suggestion"></div>') |
||||
.html(this.options.noSuggestionNotice).get(0); |
||||
|
||||
that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass); |
||||
|
||||
container = $(that.suggestionsContainer); |
||||
|
||||
container.appendTo(options.appendTo); |
||||
|
||||
// Only set width if it was provided:
|
||||
if (options.width !== 'auto') { |
||||
container.css('width', options.width); |
||||
} |
||||
|
||||
// Listen for mouse over event on suggestions list:
|
||||
container.on('mouseover.autocomplete', suggestionSelector, function () { |
||||
that.activate($(this).data('index')); |
||||
}); |
||||
|
||||
// Deselect active element when mouse leaves suggestions container:
|
||||
container.on('mouseout.autocomplete', function () { |
||||
that.selectedIndex = -1; |
||||
container.children('.' + selected).removeClass(selected); |
||||
}); |
||||
|
||||
// Listen for click event on suggestions list:
|
||||
container.on('click.autocomplete', suggestionSelector, function () { |
||||
that.select($(this).data('index')); |
||||
return false; |
||||
}); |
||||
|
||||
that.fixPositionCapture = function () { |
||||
if (that.visible) { |
||||
that.fixPosition(); |
||||
} |
||||
}; |
||||
|
||||
$(window).on('resize.autocomplete', that.fixPositionCapture); |
||||
|
||||
that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); }); |
||||
that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); }); |
||||
that.el.on('blur.autocomplete', function () { that.onBlur(); }); |
||||
that.el.on('focus.autocomplete', function () { that.onFocus(); }); |
||||
that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); }); |
||||
that.el.on('input.autocomplete', function (e) { that.onKeyUp(e); }); |
||||
}, |
||||
|
||||
onFocus: function () { |
||||
var that = this; |
||||
|
||||
that.fixPosition(); |
||||
|
||||
if (that.el.val().length >= that.options.minChars) { |
||||
that.onValueChange(); |
||||
} |
||||
}, |
||||
|
||||
onBlur: function () { |
||||
this.enableKillerFn(); |
||||
}, |
||||
|
||||
abortAjax: function () { |
||||
var that = this; |
||||
if (that.currentRequest) { |
||||
that.currentRequest.abort(); |
||||
that.currentRequest = null; |
||||
} |
||||
}, |
||||
|
||||
setOptions: function (suppliedOptions) { |
||||
var that = this, |
||||
options = that.options; |
||||
|
||||
$.extend(options, suppliedOptions); |
||||
|
||||
that.isLocal = $.isArray(options.lookup); |
||||
|
||||
if (that.isLocal) { |
||||
options.lookup = that.verifySuggestionsFormat(options.lookup); |
||||
} |
||||
|
||||
options.orientation = that.validateOrientation(options.orientation, 'bottom'); |
||||
|
||||
// Adjust height, width and z-index:
|
||||
$(that.suggestionsContainer).css({ |
||||
'max-height': options.maxHeight + 'px', |
||||
'width': options.width + 'px', |
||||
'z-index': options.zIndex |
||||
}); |
||||
}, |
||||
|
||||
|
||||
clearCache: function () { |
||||
this.cachedResponse = {}; |
||||
this.badQueries = []; |
||||
}, |
||||
|
||||
clear: function () { |
||||
this.clearCache(); |
||||
this.currentValue = ''; |
||||
this.suggestions = []; |
||||
}, |
||||
|
||||
disable: function () { |
||||
var that = this; |
||||
that.disabled = true; |
||||
clearInterval(that.onChangeInterval); |
||||
that.abortAjax(); |
||||
}, |
||||
|
||||
enable: function () { |
||||
this.disabled = false; |
||||
}, |
||||
|
||||
fixPosition: function () { |
||||
// Use only when container has already its content
|
||||
|
||||
var that = this, |
||||
$container = $(that.suggestionsContainer), |
||||
containerParent = $container.parent().get(0); |
||||
// Fix position automatically when appended to body.
|
||||
// In other cases force parameter must be given.
|
||||
if (containerParent !== document.body && !that.options.forceFixPosition) { |
||||
return; |
||||
} |
||||
|
||||
// Choose orientation
|
||||
var orientation = that.options.orientation, |
||||
containerHeight = $container.outerHeight(), |
||||
height = that.el.outerHeight(), |
||||
offset = that.el.offset(), |
||||
styles = { 'top': offset.top, 'left': offset.left }; |
||||
|
||||
if (orientation === 'auto') { |
||||
var viewPortHeight = $(window).height(), |
||||
scrollTop = $(window).scrollTop(), |
||||
topOverflow = -scrollTop + offset.top - containerHeight, |
||||
bottomOverflow = scrollTop + viewPortHeight - (offset.top + height + containerHeight); |
||||
|
||||
orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow) ? 'top' : 'bottom'; |
||||
} |
||||
|
||||
if (orientation === 'top') { |
||||
styles.top += -containerHeight; |
||||
} else { |
||||
styles.top += height; |
||||
} |
||||
|
||||
// If container is not positioned to body,
|
||||
// correct its position using offset parent offset
|
||||
if(containerParent !== document.body) { |
||||
var opacity = $container.css('opacity'), |
||||
parentOffsetDiff; |
||||
|
||||
if (!that.visible){ |
||||
$container.css('opacity', 0).show(); |
||||
} |
||||
|
||||
parentOffsetDiff = $container.offsetParent().offset(); |
||||
styles.top -= parentOffsetDiff.top; |
||||
styles.left -= parentOffsetDiff.left; |
||||
|
||||
if (!that.visible){ |
||||
$container.css('opacity', opacity).hide(); |
||||
} |
||||
} |
||||
|
||||
if (that.options.width === 'auto') { |
||||
styles.width = that.el.outerWidth() + 'px'; |
||||
} |
||||
|
||||
$container.css(styles); |
||||
}, |
||||
|
||||
enableKillerFn: function () { |
||||
var that = this; |
||||
$(document).on('click.autocomplete', that.killerFn); |
||||
}, |
||||
|
||||
disableKillerFn: function () { |
||||
var that = this; |
||||
$(document).off('click.autocomplete', that.killerFn); |
||||
}, |
||||
|
||||
killSuggestions: function () { |
||||
var that = this; |
||||
that.stopKillSuggestions(); |
||||
that.intervalId = window.setInterval(function () { |
||||
if (that.visible) { |
||||
// No need to restore value when
|
||||
// preserveInput === true,
|
||||
// because we did not change it
|
||||
if (!that.options.preserveInput) { |
||||
that.el.val(that.currentValue); |
||||
} |
||||
|
||||
that.hide(); |
||||
} |
||||
|
||||
that.stopKillSuggestions(); |
||||
}, 50); |
||||
}, |
||||
|
||||
stopKillSuggestions: function () { |
||||
window.clearInterval(this.intervalId); |
||||
}, |
||||
|
||||
isCursorAtEnd: function () { |
||||
var that = this, |
||||
valLength = that.el.val().length, |
||||
selectionStart = that.element.selectionStart, |
||||
range; |
||||
|
||||
if (typeof selectionStart === 'number') { |
||||
return selectionStart === valLength; |
||||
} |
||||
if (document.selection) { |
||||
range = document.selection.createRange(); |
||||
range.moveStart('character', -valLength); |
||||
return valLength === range.text.length; |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
onKeyPress: function (e) { |
||||
var that = this; |
||||
|
||||
// If suggestions are hidden and user presses arrow down, display suggestions:
|
||||
if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) { |
||||
that.suggest(); |
||||
return; |
||||
} |
||||
|
||||
if (that.disabled || !that.visible) { |
||||
return; |
||||
} |
||||
|
||||
switch (e.which) { |
||||
case keys.ESC: |
||||
that.el.val(that.currentValue); |
||||
that.hide(); |
||||
break; |
||||
case keys.RIGHT: |
||||
if (that.hint && that.options.onHint && that.isCursorAtEnd()) { |
||||
that.selectHint(); |
||||
break; |
||||
} |
||||
return; |
||||
case keys.TAB: |
||||
if (that.hint && that.options.onHint) { |
||||
that.selectHint(); |
||||
return; |
||||
} |
||||
if (that.selectedIndex === -1) { |
||||
that.hide(); |
||||
return; |
||||
} |
||||
that.select(that.selectedIndex); |
||||
if (that.options.tabDisabled === false) { |
||||
return; |
||||
} |
||||
break; |
||||
case keys.RETURN: |
||||
if (that.selectedIndex === -1) { |
||||
that.hide(); |
||||
return; |
||||
} |
||||
that.select(that.selectedIndex); |
||||
break; |
||||
case keys.UP: |
||||
that.moveUp(); |
||||
break; |
||||
case keys.DOWN: |
||||
that.moveDown(); |
||||
break; |
||||
default: |
||||
return; |
||||
} |
||||
|
||||
// Cancel event if function did not return:
|
||||
e.stopImmediatePropagation(); |
||||
e.preventDefault(); |
||||
}, |
||||
|
||||
onKeyUp: function (e) { |
||||
var that = this; |
||||
|
||||
if (that.disabled) { |
||||
return; |
||||
} |
||||
|
||||
switch (e.which) { |
||||
case keys.UP: |
||||
case keys.DOWN: |
||||
return; |
||||
} |
||||
|
||||
clearInterval(that.onChangeInterval); |
||||
|
||||
if (that.currentValue !== that.el.val()) { |
||||
that.findBestHint(); |
||||
if (that.options.deferRequestBy > 0) { |
||||
// Defer lookup in case when value changes very quickly:
|
||||
that.onChangeInterval = setInterval(function () { |
||||
that.onValueChange(); |
||||
}, that.options.deferRequestBy); |
||||
} else { |
||||
that.onValueChange(); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
onValueChange: function () { |
||||
var that = this, |
||||
options = that.options, |
||||
value = that.el.val(), |
||||
query = that.getQuery(value); |
||||
|
||||
if (that.selection && that.currentValue !== query) { |
||||
that.selection = null; |
||||
(options.onInvalidateSelection || $.noop).call(that.element); |
||||
} |
||||
|
||||
clearInterval(that.onChangeInterval); |
||||
that.currentValue = value; |
||||
that.selectedIndex = -1; |
||||
|
||||
// Check existing suggestion for the match before proceeding:
|
||||
if (options.triggerSelectOnValidInput && that.isExactMatch(query)) { |
||||
that.select(0); |
||||
return; |
||||
} |
||||
|
||||
if (query.length < options.minChars) { |
||||
that.hide(); |
||||
} else { |
||||
that.getSuggestions(query); |
||||
} |
||||
}, |
||||
|
||||
isExactMatch: function (query) { |
||||
var suggestions = this.suggestions; |
||||
|
||||
return (suggestions.length === 1 && suggestions[0].value.toLowerCase() === query.toLowerCase()); |
||||
}, |
||||
|
||||
getQuery: function (value) { |
||||
var delimiter = this.options.delimiter, |
||||
parts; |
||||
|
||||
if (!delimiter) { |
||||
return value; |
||||
} |
||||
parts = value.split(delimiter); |
||||
return $.trim(parts[parts.length - 1]); |
||||
}, |
||||
|
||||
getSuggestionsLocal: function (query) { |
||||
var that = this, |
||||
options = that.options, |
||||
queryLowerCase = query.toLowerCase(), |
||||
filter = options.lookupFilter, |
||||
limit = parseInt(options.lookupLimit, 10), |
||||
data; |
||||
|
||||
data = { |
||||
suggestions: $.grep(options.lookup, function (suggestion) { |
||||
return filter(suggestion, query, queryLowerCase); |
||||
}) |
||||
}; |
||||
|
||||
if (limit && data.suggestions.length > limit) { |
||||
data.suggestions = data.suggestions.slice(0, limit); |
||||
} |
||||
|
||||
return data; |
||||
}, |
||||
|
||||
getSuggestions: function (q) { |
||||
var response, |
||||
that = this, |
||||
options = that.options, |
||||
serviceUrl = options.serviceUrl, |
||||
params, |
||||
cacheKey, |
||||
ajaxSettings; |
||||
|
||||
options.params[options.paramName] = q; |
||||
params = options.ignoreParams ? null : options.params; |
||||
|
||||
if (options.onSearchStart.call(that.element, options.params) === false) { |
||||
return; |
||||
} |
||||
|
||||
if ($.isFunction(options.lookup)){ |
||||
options.lookup(q, function (data) { |
||||
that.suggestions = data.suggestions; |
||||
that.suggest(); |
||||
options.onSearchComplete.call(that.element, q, data.suggestions); |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
if (that.isLocal) { |
||||
response = that.getSuggestionsLocal(q); |
||||
} else { |
||||
if ($.isFunction(serviceUrl)) { |
||||
serviceUrl = serviceUrl.call(that.element, q); |
||||
} |
||||
cacheKey = serviceUrl + '?' + $.param(params || {}); |
||||
response = that.cachedResponse[cacheKey]; |
||||
} |
||||
|
||||
if (response && $.isArray(response.suggestions)) { |
||||
that.suggestions = response.suggestions; |
||||
that.suggest(); |
||||
options.onSearchComplete.call(that.element, q, response.suggestions); |
||||
} else if (!that.isBadQuery(q)) { |
||||
that.abortAjax(); |
||||
|
||||
ajaxSettings = { |
||||
url: serviceUrl, |
||||
data: params, |
||||
type: options.type, |
||||
dataType: options.dataType |
||||
}; |
||||
|
||||
$.extend(ajaxSettings, options.ajaxSettings); |
||||
|
||||
that.currentRequest = $.ajax(ajaxSettings).done(function (data) { |
||||
var result; |
||||
that.currentRequest = null; |
||||
result = options.transformResult(data, q); |
||||
that.processResponse(result, q, cacheKey); |
||||
options.onSearchComplete.call(that.element, q, result.suggestions); |
||||
}).fail(function (jqXHR, textStatus, errorThrown) { |
||||
options.onSearchError.call(that.element, q, jqXHR, textStatus, errorThrown); |
||||
}); |
||||
} else { |
||||
options.onSearchComplete.call(that.element, q, []); |
||||
} |
||||
}, |
||||
|
||||
isBadQuery: function (q) { |
||||
if (!this.options.preventBadQueries){ |
||||
return false; |
||||
} |
||||
|
||||
var badQueries = this.badQueries, |
||||
i = badQueries.length; |
||||
|
||||
while (i--) { |
||||
if (q.indexOf(badQueries[i]) === 0) { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
return false; |
||||
}, |
||||
|
||||
hide: function () { |
||||
var that = this, |
||||
container = $(that.suggestionsContainer); |
||||
|
||||
if ($.isFunction(that.options.onHide) && that.visible) { |
||||
that.options.onHide.call(that.element, container); |
||||
} |
||||
|
||||
that.visible = false; |
||||
that.selectedIndex = -1; |
||||
clearInterval(that.onChangeInterval); |
||||
$(that.suggestionsContainer).hide(); |
||||
that.signalHint(null); |
||||
}, |
||||
|
||||
suggest: function () { |
||||
if (!this.suggestions.length) { |
||||
if (this.options.showNoSuggestionNotice) { |
||||
this.noSuggestions(); |
||||
} else { |
||||
this.hide(); |
||||
} |
||||
return; |
||||
} |
||||
|
||||
var that = this, |
||||
options = that.options, |
||||
groupBy = options.groupBy, |
||||
formatResult = options.formatResult, |
||||
value = that.getQuery(that.currentValue), |
||||
className = that.classes.suggestion, |
||||
classSelected = that.classes.selected, |
||||
container = $(that.suggestionsContainer), |
||||
noSuggestionsContainer = $(that.noSuggestionsContainer), |
||||
beforeRender = options.beforeRender, |
||||
html = '', |
||||
category, |
||||
formatGroup = function (suggestion, index) { |
||||
var currentCategory = suggestion.data[groupBy]; |
||||
|
||||
if (category === currentCategory){ |
||||
return ''; |
||||
} |
||||
|
||||
category = currentCategory; |
||||
|
||||
return '<div class="autocomplete-group"><strong>' + category + '</strong></div>'; |
||||
}; |
||||
|
||||
if (options.triggerSelectOnValidInput && that.isExactMatch(value)) { |
||||
that.select(0); |
||||
return; |
||||
} |
||||
|
||||
// Build suggestions inner HTML:
|
||||
$.each(that.suggestions, function (i, suggestion) { |
||||
if (groupBy){ |
||||
html += formatGroup(suggestion, value, i); |
||||
} |
||||
|
||||
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value, i) + '</div>'; |
||||
}); |
||||
|
||||
this.adjustContainerWidth(); |
||||
|
||||
noSuggestionsContainer.detach(); |
||||
container.html(html); |
||||
|
||||
if ($.isFunction(beforeRender)) { |
||||
beforeRender.call(that.element, container, that.suggestions); |
||||
} |
||||
|
||||
that.fixPosition(); |
||||
container.show(); |
||||
|
||||
// Select first value by default:
|
||||
if (options.autoSelectFirst) { |
||||
that.selectedIndex = 0; |
||||
container.scrollTop(0); |
||||
container.children('.' + className).first().addClass(classSelected); |
||||
} |
||||
|
||||
that.visible = true; |
||||
that.findBestHint(); |
||||
}, |
||||
|
||||
noSuggestions: function() { |
||||
var that = this, |
||||
container = $(that.suggestionsContainer), |
||||
noSuggestionsContainer = $(that.noSuggestionsContainer); |
||||
|
||||
this.adjustContainerWidth(); |
||||
|
||||
// Some explicit steps. Be careful here as it easy to get
|
||||
// noSuggestionsContainer removed from DOM if not detached properly.
|
||||
noSuggestionsContainer.detach(); |
||||
container.empty(); // clean suggestions if any
|
||||
container.append(noSuggestionsContainer); |
||||
|
||||
that.fixPosition(); |
||||
|
||||
container.show(); |
||||
that.visible = true; |
||||
}, |
||||
|
||||
adjustContainerWidth: function() { |
||||
var that = this, |
||||
options = that.options, |
||||
width, |
||||
container = $(that.suggestionsContainer); |
||||
|
||||
// If width is auto, adjust width before displaying suggestions,
|
||||
// because if instance was created before input had width, it will be zero.
|
||||
// Also it adjusts if input width has changed.
|
||||
if (options.width === 'auto') { |
||||
width = that.el.outerWidth(); |
||||
container.css('width', width > 0 ? width : 300); |
||||
} |
||||
}, |
||||
|
||||
findBestHint: function () { |
||||
var that = this, |
||||
value = that.el.val().toLowerCase(), |
||||
bestMatch = null; |
||||
|
||||
if (!value) { |
||||
return; |
||||
} |
||||
|
||||
$.each(that.suggestions, function (i, suggestion) { |
||||
var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0; |
||||
if (foundMatch) { |
||||
bestMatch = suggestion; |
||||
} |
||||
return !foundMatch; |
||||
}); |
||||
|
||||
that.signalHint(bestMatch); |
||||
}, |
||||
|
||||
signalHint: function (suggestion) { |
||||
var hintValue = '', |
||||
that = this; |
||||
if (suggestion) { |
||||
hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length); |
||||
} |
||||
if (that.hintValue !== hintValue) { |
||||
that.hintValue = hintValue; |
||||
that.hint = suggestion; |
||||
(this.options.onHint || $.noop)(hintValue); |
||||
} |
||||
}, |
||||
|
||||
verifySuggestionsFormat: function (suggestions) { |
||||
// If suggestions is string array, convert them to supported format:
|
||||
if (suggestions.length && typeof suggestions[0] === 'string') { |
||||
return $.map(suggestions, function (value) { |
||||
return { value: value, data: null }; |
||||
}); |
||||
} |
||||
|
||||
return suggestions; |
||||
}, |
||||
|
||||
validateOrientation: function(orientation, fallback) { |
||||
orientation = $.trim(orientation || '').toLowerCase(); |
||||
|
||||
if($.inArray(orientation, ['auto', 'bottom', 'top']) === -1){ |
||||
orientation = fallback; |
||||
} |
||||
|
||||
return orientation; |
||||
}, |
||||
|
||||
processResponse: function (result, originalQuery, cacheKey) { |
||||
var that = this, |
||||
options = that.options; |
||||
|
||||
result.suggestions = that.verifySuggestionsFormat(result.suggestions); |
||||
|
||||
// Cache results if cache is not disabled:
|
||||
if (!options.noCache) { |
||||
that.cachedResponse[cacheKey] = result; |
||||
if (options.preventBadQueries && !result.suggestions.length) { |
||||
that.badQueries.push(originalQuery); |
||||
} |
||||
} |
||||
|
||||
// Return if originalQuery is not matching current query:
|
||||
if (originalQuery !== that.getQuery(that.currentValue)) { |
||||
return; |
||||
} |
||||
|
||||
that.suggestions = result.suggestions; |
||||
that.suggest(); |
||||
}, |
||||
|
||||
activate: function (index) { |
||||
var that = this, |
||||
activeItem, |
||||
selected = that.classes.selected, |
||||
container = $(that.suggestionsContainer), |
||||
children = container.find('.' + that.classes.suggestion); |
||||
|
||||
container.find('.' + selected).removeClass(selected); |
||||
|
||||
that.selectedIndex = index; |
||||
|
||||
if (that.selectedIndex !== -1 && children.length > that.selectedIndex) { |
||||
activeItem = children.get(that.selectedIndex); |
||||
$(activeItem).addClass(selected); |
||||
return activeItem; |
||||
} |
||||
|
||||
return null; |
||||
}, |
||||
|
||||
selectHint: function () { |
||||
var that = this, |
||||
i = $.inArray(that.hint, that.suggestions); |
||||
|
||||
that.select(i); |
||||
}, |
||||
|
||||
select: function (i) { |
||||
var that = this; |
||||
that.hide(); |
||||
that.onSelect(i); |
||||
that.disableKillerFn(); |
||||
}, |
||||
|
||||
moveUp: function () { |
||||
var that = this; |
||||
|
||||
if (that.selectedIndex === -1) { |
||||
return; |
||||
} |
||||
|
||||
if (that.selectedIndex === 0) { |
||||
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected); |
||||
that.selectedIndex = -1; |
||||
that.el.val(that.currentValue); |
||||
that.findBestHint(); |
||||
return; |
||||
} |
||||
|
||||
that.adjustScroll(that.selectedIndex - 1); |
||||
}, |
||||
|
||||
moveDown: function () { |
||||
var that = this; |
||||
|
||||
if (that.selectedIndex === (that.suggestions.length - 1)) { |
||||
return; |
||||
} |
||||
|
||||
that.adjustScroll(that.selectedIndex + 1); |
||||
}, |
||||
|
||||
adjustScroll: function (index) { |
||||
var that = this, |
||||
activeItem = that.activate(index); |
||||
|
||||
if (!activeItem) { |
||||
return; |
||||
} |
||||
|
||||
var offsetTop, |
||||
upperBound, |
||||
lowerBound, |
||||
heightDelta = $(activeItem).outerHeight(); |
||||
|
||||
offsetTop = activeItem.offsetTop; |
||||
upperBound = $(that.suggestionsContainer).scrollTop(); |
||||
lowerBound = upperBound + that.options.maxHeight - heightDelta; |
||||
|
||||
if (offsetTop < upperBound) { |
||||
$(that.suggestionsContainer).scrollTop(offsetTop); |
||||
} else if (offsetTop > lowerBound) { |
||||
$(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta); |
||||
} |
||||
|
||||
if (!that.options.preserveInput) { |
||||
that.el.val(that.getValue(that.suggestions[index].value)); |
||||
} |
||||
that.signalHint(null); |
||||
}, |
||||
|
||||
onSelect: function (index) { |
||||
var that = this, |
||||
onSelectCallback = that.options.onSelect, |
||||
suggestion = that.suggestions[index]; |
||||
|
||||
that.currentValue = that.getValue(suggestion.value); |
||||
|
||||
if (that.currentValue !== that.el.val() && !that.options.preserveInput) { |
||||
that.el.val(that.currentValue); |
||||
} |
||||
|
||||
that.signalHint(null); |
||||
that.suggestions = []; |
||||
that.selection = suggestion; |
||||
|
||||
if ($.isFunction(onSelectCallback)) { |
||||
onSelectCallback.call(that.element, suggestion); |
||||
} |
||||
}, |
||||
|
||||
getValue: function (value) { |
||||
var that = this, |
||||
delimiter = that.options.delimiter, |
||||
currentValue, |
||||
parts; |
||||
|
||||
if (!delimiter) { |
||||
return value; |
||||
} |
||||
|
||||
currentValue = that.currentValue; |
||||
parts = currentValue.split(delimiter); |
||||
|
||||
if (parts.length === 1) { |
||||
return value; |
||||
} |
||||
|
||||
return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value; |
||||
}, |
||||
|
||||
dispose: function () { |
||||
var that = this; |
||||
that.el.off('.autocomplete').removeData('autocomplete'); |
||||
that.disableKillerFn(); |
||||
$(window).off('resize.autocomplete', that.fixPositionCapture); |
||||
$(that.suggestionsContainer).remove(); |
||||
} |
||||
}; |
||||
|
||||
// Create chainable jQuery plugin:
|
||||
$.fn.autocomplete = $.fn.devbridgeAutocomplete = function (options, args) { |
||||
var dataKey = 'autocomplete'; |
||||
// If function invoked without argument return
|
||||
// instance of the first matched element:
|
||||
if (!arguments.length) { |
||||
return this.first().data(dataKey); |
||||
} |
||||
|
||||
return this.each(function () { |
||||
var inputElement = $(this), |
||||
instance = inputElement.data(dataKey); |
||||
|
||||
if (typeof options === 'string') { |
||||
if (instance && typeof instance[options] === 'function') { |
||||
instance[options](args); |
||||
} |
||||
} else { |
||||
// If instance already exists, destroy it:
|
||||
if (instance && instance.dispose) { |
||||
instance.dispose(); |
||||
} |
||||
instance = new Autocomplete(this, options); |
||||
inputElement.data(dataKey, instance); |
||||
} |
||||
}); |
||||
}; |
||||
})); |
||||
@ -1,68 +0,0 @@ |
||||
$(function () { |
||||
'use strict'; |
||||
|
||||
$('#q').autocomplete({ |
||||
serviceUrl: "http://127.0.0.1:8000/search/autocomplete/", |
||||
minChars: 2, |
||||
dataType: 'json', |
||||
type: 'GET', |
||||
onSelect: function (suggestion) { |
||||
console.log( suggestion.value + ', data :' + suggestion.data); |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
|
||||
|
||||
function getParameterByName(name, url) { |
||||
if (!url) { |
||||
url = window.location.href; |
||||
} |
||||
name = name.replace(/[\[\]]/g, "\\$&"); |
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), |
||||
results = regex.exec(url); |
||||
if (!results) return null; |
||||
if (!results[2]) return ''; |
||||
return decodeURIComponent(results[2].replace(/\+/g, " ")); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
function onFacetChangeApplied(){ |
||||
var url = window.location.href.split("?")[0]; |
||||
var search_query = getParameterByName('q'); |
||||
var url_with_search_query = url + '?q=' + search_query |
||||
$('input:checkbox.facet').each(function () { |
||||
var sThisVal = (this.checked ? $(this).val() : null); |
||||
var sThisName = (this.checked ? $(this).attr('name') : null); |
||||
if(sThisVal !== null){ |
||||
url_with_search_query += '&'+encodeURIComponent(sThisName)+'='+encodeURIComponent(sThisVal); |
||||
} |
||||
}); |
||||
location.href = url_with_search_query; |
||||
return true; |
||||
} |
||||
|
||||
|
||||
function getQueryParams(){ |
||||
var vars = {}, hash; |
||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
||||
for(var i = 0; i < hashes.length; i++) |
||||
{ |
||||
hash = hashes[i].split('='); |
||||
vars[hash[1]] = hash[0] ; |
||||
} |
||||
return vars; |
||||
} |
||||
|
||||
|
||||
$( document ).ready(function() { |
||||
var all_params = getQueryParams(); |
||||
console.log(); |
||||
$.each( all_params, function( key, value ) { |
||||
id = decodeURIComponent(key).replace(/\s/g,''); |
||||
$('#'+id).attr('checked', 'checked'); |
||||
}); |
||||
|
||||
}); |
||||
@ -1,145 +0,0 @@ |
||||
$(document).ready(function () { |
||||
var form = $('#form-buying-products'); |
||||
form.on('submit', function (e) { |
||||
e.preventDefault(); |
||||
$('#number').val(); |
||||
var nmb = $('#number').val(); |
||||
var submit_btn = $('#submit-btn'); |
||||
var product_id = submit_btn.data('products-id'); |
||||
var product_name = submit_btn.data('products-name'); |
||||
var product_price = submit_btn.data('products-price'); |
||||
|
||||
var data = {}; |
||||
data.product_id = product_id; |
||||
data.nmb = nmb; |
||||
var csrf_token = $('#form-buying-products [name="csrfmiddlewaretoken"]').val(); |
||||
data["csrfmiddlewaretoken"] = csrf_token; |
||||
var url = form.attr('action'); |
||||
|
||||
$.ajax({ |
||||
url: url, |
||||
type: 'POST', |
||||
data: data, |
||||
cache: true, |
||||
success: function (data) { |
||||
if (data.products_total_nmb) { |
||||
$('#basket_total_nmb').text('(' + data.products_total_nmb + ')'); |
||||
$('.basket-items ul').html(""); |
||||
$.each(data.products, function (k, v) { |
||||
$('.basket-items ul').append('<li>' + v.name + ', ' + v.nmb + 'pc. ' + 'for ' + v.price_per_item + 'rub. ' + |
||||
//'<a class="delete-item" href="">x</a>'+
|
||||
'</li>'); |
||||
}); |
||||
} |
||||
}, |
||||
error: function () { |
||||
console.log("error") |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
calculate(); |
||||
|
||||
function showingBasket() { |
||||
$('.basket-items').removeClass('hidden'); |
||||
}; |
||||
|
||||
//$('.basket-container').on('click', function(e){
|
||||
// e.preventDefault();
|
||||
// showingBasket();
|
||||
//});
|
||||
|
||||
$('.basket-container').mouseover(function () { |
||||
showingBasket(); |
||||
}); |
||||
|
||||
$('.basket-container').mouseout(function () { |
||||
showingBasket(); |
||||
}); |
||||
|
||||
$(document).on('click', '.delete-item', function (e) { |
||||
e.preventDefault(); |
||||
$(this).closest('li').remove(); |
||||
}) |
||||
}); |
||||
|
||||
function showOrHide(cb, cat) { |
||||
cb = document.getElementById(cb); |
||||
cat = document.getElementById(cat); |
||||
if (cb.checked) cat.style.display = "block"; |
||||
else cat.style.display = "none"; |
||||
} |
||||
|
||||
function _discount(quantity, discount_policy) { |
||||
if (isNaN(discount_policy)) { |
||||
return 1 |
||||
} |
||||
else { |
||||
var keys = Object.keys(discount_policy); |
||||
for (var i = 0, len = keys.length; i < len; i++) { |
||||
var split_entry = keys[i].split('-'); |
||||
if (parseInt(split_entry[0]) <= quantity && quantity < parseFloat(split_entry[1])) { |
||||
return parseFloat(discount_policy[keys[i]]); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
function calculate() { |
||||
var count = document.getElementById("variant_length").value; |
||||
var quantity = document.getElementById("quantity").value; |
||||
var result = document.getElementById("result"); |
||||
var price_per_itom = document.getElementById("price_per_itom"); |
||||
var erw = document.getElementById("erw"); |
||||
var variants = JSON.parse(document.getElementById("variants").value.replace(/'/g, '"')); |
||||
var discount_policy = JSON.parse(document.getElementById("discount_policy").value.replace(/'/g, '"')); |
||||
var product_slug = document.getElementById("product_slug"); |
||||
var result_itog = document.getElementById("result_itog"); |
||||
var tmp_price = 0; |
||||
|
||||
|
||||
if (count == 0) { |
||||
tmp_price = Math.round(variants[0]['price'] * _discount(quantity, discount_policy)); |
||||
result.innerHTML = tmp_price; |
||||
price_per_itom.value = tmp_price; |
||||
tmp_price = tmp_price * quantity; |
||||
result_itog.innerHTML = tmp_price; |
||||
erw.innerHTML = Math.round(tmp_price * 0.05); |
||||
product_slug.value = variants[0].slug; |
||||
} |
||||
|
||||
if (count > 1) { |
||||
var quant0 = document.getElementById("id_0"); |
||||
var quant1 = document.getElementById("id_1"); |
||||
var quant0_val = JSON.parse(quant0.value.replace(/'/g, '"')); |
||||
var quant1_val = JSON.parse(quant1.value.replace(/'/g, '"')); |
||||
for (var i = 0, len = variants.length; i < len; i++) { |
||||
if (variants[i]['attributes'][quant0.name] == quant0_val['name'] && |
||||
variants[i]['attributes'][quant1.name] == quant1_val['name']) { |
||||
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy)); |
||||
result.innerHTML = tmp_price; |
||||
price_per_itom.value = tmp_price; |
||||
tmp_price = tmp_price * quantity; |
||||
result_itog.innerHTML = tmp_price; |
||||
erw.innerHTML = Math.round(tmp_price * 0.05); |
||||
product_slug.value = variants[i].slug; |
||||
} |
||||
} |
||||
} |
||||
else { |
||||
var quant0 = document.getElementById("id_0"); |
||||
var quant0_val = JSON.parse(quant0.value.replace(/'/g, '"')); |
||||
for (var i = 0, len = variants.length; i < len; i++) { |
||||
if (variants[i]['attributes'][quant0.name] == quant0_val['name']) { |
||||
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy)); |
||||
result.innerHTML = tmp_price; |
||||
price_per_itom.value = tmp_price; |
||||
tmp_price = tmp_price * quantity; |
||||
result_itog.innerHTML = tmp_price; |
||||
erw.innerHTML = Math.round(tmp_price * 0.05); |
||||
product_slug.value = variants[i].slug; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,93 @@ |
||||
|
||||
.br-theme-css-stars .br-widget { |
||||
height: 28px; |
||||
white-space: nowrap |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget a { |
||||
text-decoration: none; |
||||
height: 18px; |
||||
width: 18px; |
||||
float: left; |
||||
font-size: 23px; |
||||
margin-right: 5px |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget a:after { |
||||
content: "\2605"; |
||||
color: #d2d2d2 |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget a.br-active:after { |
||||
color: #edb867 |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget a.br-selected:after { |
||||
color: #edb867 |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget .br-current-rating { |
||||
display: none |
||||
} |
||||
|
||||
.br-theme-css-stars .br-readonly a { |
||||
cursor: default |
||||
} |
||||
|
||||
@media print { |
||||
.br-theme-css-stars .br-widget a:after { |
||||
content: "\2606"; |
||||
color: #000 |
||||
} |
||||
|
||||
.br-theme-css-stars .br-widget a.br-active:after, .br-theme-css-stars .br-widget a.br-selected:after { |
||||
content: "\2605"; |
||||
color: #000 |
||||
} |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget { |
||||
height: 28px; |
||||
white-space: nowrap |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget a { |
||||
font: normal normal normal 20px/1 FontAwesome; |
||||
text-rendering: auto; |
||||
-webkit-font-smoothing: antialiased; |
||||
text-decoration: none; |
||||
margin-right: 2px |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget a:after { |
||||
content: '\f005'; |
||||
color: #d2d2d2 |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget a.br-active:after { |
||||
color: #edb867 |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget a.br-selected:after { |
||||
color: #edb867 |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget .br-current-rating { |
||||
display: none |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-readonly a { |
||||
cursor: default |
||||
} |
||||
|
||||
@media print { |
||||
.br-theme-fontawesome-stars .br-widget a:after { |
||||
content: '\f006'; |
||||
color: #000 |
||||
} |
||||
|
||||
.br-theme-fontawesome-stars .br-widget a.br-active:after, .br-theme-fontawesome-stars .br-widget a.br-selected:after { |
||||
content: '\f005'; |
||||
color: #000 |
||||
} |
||||
} |
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 418 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 721 B |
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
@ -0,0 +1,16 @@ |
||||
import "./asserts/css/main.css"; |
||||
import './node_modules/jquery-ui-dist/jquery-ui.min.css'; |
||||
import "./node_modules/bootstrap/dist/css/bootstrap.min.css"; |
||||
|
||||
import './node_modules/jquery/dist/jquery.js'; |
||||
import './node_modules/jquery-ui-dist/jquery-ui.js'; |
||||
import './node_modules/magnific-popup/dist/jquery.magnific-popup.js'; |
||||
import './node_modules/jquery-bar-rating/dist/jquery.barrating.min.js'; |
||||
import './node_modules/bootstrap/dist/js/bootstrap.js'; |
||||
import './node_modules/jquery-autocomplete/jquery.autocomplete.js'; |
||||
|
||||
import "./asserts/js/ajax.js"; |
||||
import "./asserts/js/basket.tools.js"; |
||||
import "./asserts/js/common.js"; |
||||
import "./asserts/js/our_search_code.js"; |
||||
|
||||
@ -0,0 +1,29 @@ |
||||
{ |
||||
"name": "eshop", |
||||
"version": "1.0.0", |
||||
"description": "", |
||||
"main": "index.js", |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1", |
||||
"dev": "webpack --mode=development --watch", |
||||
"build": "webpack --mode=production" |
||||
}, |
||||
"author": "FUNNYDMAN", |
||||
"license": "ISC", |
||||
"devDependencies": { |
||||
"webpack": "^4.25.1", |
||||
"webpack-cli": "^3.1.2", |
||||
"css-loader": "^1.0.1", |
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0", |
||||
"file-loader": "^2.0.0", |
||||
"style-loader": "^0.23.1" |
||||
}, |
||||
"dependencies": { |
||||
"bootstrap": "3.3.7", |
||||
"jquery": "^3.3.1", |
||||
"jquery-autocomplete": "^1.2.8", |
||||
"jquery-bar-rating": "^1.2.2", |
||||
"jquery-ui-dist": "1.12.1", |
||||
"magnific-popup": "^1.1.0" |
||||
} |
||||
} |
||||
@ -0,0 +1,48 @@ |
||||
const path = require('path'); |
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
||||
const webpack = require('webpack'); |
||||
|
||||
module.exports = { |
||||
entry: './index.js', |
||||
output: { |
||||
filename: './js/build-min.js', |
||||
path: path.resolve(__dirname, 'dist') |
||||
}, |
||||
module: { |
||||
rules: [{ |
||||
test: /\.(css)$/, |
||||
use: ExtractTextPlugin.extract({ |
||||
fallback: 'style-loader', |
||||
use: ['css-loader'] |
||||
}) |
||||
}, |
||||
{ |
||||
test: /\.(png|svg|jpg|gif|jpeg)$/, |
||||
use: [ |
||||
{ |
||||
loader: 'file-loader', |
||||
options: {outputPath: 'img/'} |
||||
} |
||||
] |
||||
}, { |
||||
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, |
||||
use: [ |
||||
{ |
||||
loader: 'file-loader', |
||||
options: { |
||||
name: '[name].[ext]', |
||||
outputPath: 'fonts/' |
||||
} |
||||
} |
||||
] |
||||
} |
||||
] |
||||
}, |
||||
plugins: [ |
||||
new ExtractTextPlugin("css/build.css"), |
||||
new webpack.ProvidePlugin({ |
||||
$: "jquery", |
||||
jQuery: "jquery" |
||||
}) |
||||
] |
||||
}; |
||||
@ -1,74 +0,0 @@ |
||||
'use strict'; |
||||
|
||||
var autoprefixer = require('gulp-autoprefixer'), |
||||
path = require('path'), |
||||
minify = require('gulp-minify'), |
||||
cleanCss = require('gulp-clean-css'), |
||||
debug = require('gulp-debug'), |
||||
csso = require('gulp-csso'), |
||||
concatCss = require('gulp-concat-css'), |
||||
concatJs = require('gulp-concat'), |
||||
sourcemaps = require('gulp-sourcemaps'), |
||||
jshint = require('gulp-jshint'), |
||||
del = require('del'), |
||||
gulp = require('gulp'), |
||||
uglify = require('gulp-uglify'); |
||||
|
||||
const AUTOPREFIXER_BROWSERS = [ |
||||
'ie >= 10', |
||||
'ie_mob >= 10', |
||||
'ff >= 30', |
||||
'chrome >= 34', |
||||
'safari >= 7', |
||||
'opera >= 23', |
||||
'ios >= 7', |
||||
'android >= 4.4', |
||||
'bb >= 10' |
||||
]; |
||||
var basePath = path.dirname(__filename); |
||||
var staticPath = basePath + '/static/'; |
||||
|
||||
gulp.task('clean', gulp.series(function () { |
||||
return del([ |
||||
staticPath + 'css/build.css', |
||||
staticPath + 'js/build.js', |
||||
staticPath + 'js/build-min.js' |
||||
]); |
||||
})); |
||||
|
||||
gulp.task('minstyles', gulp.series(function () { |
||||
return del([staticPath + 'css/build.css']) |
||||
}, function () { |
||||
return gulp.src(['static/css/**/*.css'], {base: basePath}) |
||||
.pipe(autoprefixer({browsers: AUTOPREFIXER_BROWSERS})) |
||||
.pipe(concatCss('build.css')) |
||||
.pipe(sourcemaps.init()) |
||||
.pipe(cleanCss()) |
||||
.pipe(csso()) |
||||
.pipe(sourcemaps.write()) |
||||
.pipe(gulp.dest('static/css/', {base: basePath})); |
||||
})); |
||||
|
||||
gulp.task('minscripts', gulp.series(gulp.series(function () { |
||||
return del([staticPath + 'js/build.js']) |
||||
}, function () { |
||||
return gulp.src([ |
||||
'node_modules/jquery/dist/jquery.js', |
||||
'node_modules/jquery-ui-dist/jquery-ui.js', |
||||
'node_modules/magnific-popup/dist/jquery.magnific-popup.js', |
||||
'node_modules/jquery-bar-rating/dist/jquery.barrating.min.js', |
||||
'node_modules/bootstrap/dist/js/bootstrap.js', |
||||
'node_modules/jquery-autocomplete/jquery.autocomplete.js', |
||||
'static/js/**/*.js' |
||||
], {base: basePath}) |
||||
.pipe(jshint()) |
||||
.pipe(jshint.reporter('default')) |
||||
.pipe(uglify()) |
||||
.pipe(sourcemaps.init()) |
||||
.pipe(concatJs('build.js')) |
||||
.pipe(sourcemaps.write()) |
||||
.pipe(minify()) |
||||
.pipe(gulp.dest('static/js/', {base: basePath})); |
||||
}))); |
||||
|
||||
gulp.task('default', gulp.series('minstyles', 'minscripts')); |
||||
@ -1,40 +0,0 @@ |
||||
{ |
||||
"name": "local-minifier", |
||||
"version": "0.1.0", |
||||
"description": "A local environment to minify CSS, JS", |
||||
"license": "Apache-2.0", |
||||
"repository": { |
||||
"type": "git", |
||||
"url": "https://github.com/amardeeprai/local-minifier" |
||||
}, |
||||
"devDependencies": { |
||||
"del": "^2.0.2", |
||||
"gulp": "^4.0.0", |
||||
"gulp-minify-css": "^1.2.4", |
||||
"gulp-autoprefixer": "latest", |
||||
"gulp-clean-css": "^3.10.0", |
||||
"gulp-csso": "^3.0.1", |
||||
"gulp-concat": "^2.6.1", |
||||
"gulp-concat-css": "^3.1.0", |
||||
"gulp-debug": "^4.0.0", |
||||
"gulp-jshint": "^2.1.0", |
||||
"gulp-minify": "^3.1.0", |
||||
"gulp-rename": "^1.4.0", |
||||
"gulp-sourcemaps": "^2.6.4", |
||||
"gulp-uglify": "^2.0.0", |
||||
"jshint": "^2.9.6", |
||||
"minimatch": "3.0.2", |
||||
"run-sequence": "^1.2.2" |
||||
}, |
||||
"engines": { |
||||
"node": ">=0.12.0" |
||||
}, |
||||
"dependencies": { |
||||
"bootstrap": "3.3.7", |
||||
"jquery": "^3.3.1", |
||||
"jquery-autocomplete": "^1.2.8", |
||||
"jquery-bar-rating": "^1.2.2", |
||||
"jquery-ui-dist": "1.12.1", |
||||
"magnific-popup": "^1.1.0" |
||||
} |
||||
} |
||||