add public design files
This commit is contained in:
1071
design/atomic/js/SortedTable3_2.js
Normal file
1071
design/atomic/js/SortedTable3_2.js
Normal file
File diff suppressed because it is too large
Load Diff
143
design/atomic/js/ajax_cart.js
Normal file
143
design/atomic/js/ajax_cart.js
Normal file
@@ -0,0 +1,143 @@
|
||||
// корзина
|
||||
$('form.variants').live('submit', function(e) {
|
||||
e.preventDefault();// return;
|
||||
button = $(this).find('input[type="submit"]');
|
||||
button2 = $(this).find('button[type="submit"]');
|
||||
if($(this).find('input[name=variant]:checked').size()>0)
|
||||
variant = $(this).find('input[name=variant]:checked').val();
|
||||
if($(this).find('select[name=variant]').size()>0)
|
||||
variant = $(this).find('select').val();
|
||||
var fav = '';
|
||||
var favs = $(this).find('#params input, #params select');
|
||||
if($(favs).length > 0){
|
||||
fav = $(favs).serialize();
|
||||
}
|
||||
yandexReachGoal('korzina');
|
||||
$.ajax({
|
||||
url: "ajax/cart.php",
|
||||
/*data: {variant: variant},*/
|
||||
data: {variant: variant,amount: $(this).find('select[name="amount"]').val(),feature: fav},
|
||||
dataType: 'json',
|
||||
success: function(data){ console.log(button2);
|
||||
$('#cart_informer').html(data);
|
||||
$('#top-shopcart').addClass('notempty');
|
||||
if(button.length && button.attr('data-result-text')) button.val(button.attr('data-result-text'));
|
||||
if(button2.length && button2.attr('data-result-text')) button2.text(button2.attr('data-result-text')).attr('disabled', true);
|
||||
|
||||
|
||||
$(document).trigger( "update.shopcart" ); //событие добавления в корзину
|
||||
|
||||
}
|
||||
});
|
||||
var o1 = $(this).offset();
|
||||
var o2 = $('#cart_informer').offset();
|
||||
var dx = o1.left - o2.left;
|
||||
var dy = o1.top - o2.top;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
$(this).closest('.product').find('.image img').effect("transfer", { to: $("#cart_informer"), className: "transfer_class" }, distance);
|
||||
$('.transfer_class').html($(this).closest('.product').find('.image').html());
|
||||
$('.transfer_class').find('img').css('height', '100%');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.keypress').on('keypress', function(event){
|
||||
var key, keyChar;
|
||||
if(!event) var event = window.event;
|
||||
if (event.keyCode) key = event.keyCode;
|
||||
else if(event.which) key = event.which;
|
||||
if(key==null || key==0 || key==8 || key==13 || key==9 || key==46 || key==37 || key==39 ) return true;
|
||||
keyChar=String.fromCharCode(key);
|
||||
if(!/\d/.test(keyChar))
|
||||
return false;
|
||||
});
|
||||
$('.filter .block.range_slider').each(function(){
|
||||
var th = this;
|
||||
|
||||
var min = parseFloat($(th).find('input.min').val());
|
||||
var max = parseFloat($(th).find('input.max').val());
|
||||
var current_min = parseFloat($(th).find('input.current_min').val());
|
||||
var current_max = parseFloat($(th).find('input.current_max').val());
|
||||
$(th).find("div.slider").slider({
|
||||
range: true,
|
||||
min: min,
|
||||
max: max,
|
||||
values:[current_min,current_max],
|
||||
range:true,
|
||||
slide:function(event, ui){
|
||||
$(th).find("input.imin").val($(th).find("div.slider").slider("values",0));
|
||||
$(th).find("input.imax").val($(th).find("div.slider").slider("values",1));
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
$(th).find("input.imin").val($(th).find("div.slider").slider("values",0));
|
||||
$(th).find("input.imax").val($(th).find("div.slider").slider("values",1));
|
||||
}
|
||||
});
|
||||
$(th).find("input.imin").change(function(){
|
||||
var value1=$(th).find("input.imin").val();
|
||||
var value2=$(th).find("input.imax").val();
|
||||
if(parseInt(value1) > parseInt(value2)){
|
||||
value1 = value2;
|
||||
$(th).find("input.min").val(value1);
|
||||
}
|
||||
$(th).find("div.slider").slider("values",0,value1);
|
||||
});
|
||||
$(th).find("input.imax").change(function(){
|
||||
var value1=$(th).find("input.imin").val();
|
||||
var value2=$(th).find("input.imax").val();
|
||||
if(parseInt(value1) > parseInt(value2)){
|
||||
value2 = value1;
|
||||
$(th).find("input.max").val(value2);
|
||||
}
|
||||
$(th).find("div.slider").slider("values",1,value2);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function ajaxFormRequest(form, callback, callbackbf) {
|
||||
jQuery.ajax({
|
||||
url: form.action,
|
||||
type: form.method,
|
||||
dataType: "html",
|
||||
data: jQuery(form).serialize(),
|
||||
success: callback,
|
||||
beforeSend: callbackbf
|
||||
});
|
||||
}
|
||||
jQuery('form.ajaxform').submit(function(e){
|
||||
e.preventDefault();
|
||||
var form = this;
|
||||
var p = $(form).find('input[name=phone]');
|
||||
if(p.val().length < 5){
|
||||
p.after('<p class="hel-block">Введите телефон</p>');
|
||||
return false;
|
||||
}
|
||||
ajaxFormRequest(form, function(dat){
|
||||
jQuery(form)[0].reset();
|
||||
// jQuery.fancybox.hideActivity();
|
||||
jQuery.fancybox(dat);
|
||||
}, function(){
|
||||
//$.fancybox.showActivity();
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery('input.preorder').click(function (e) {
|
||||
var th = this;
|
||||
var varik = $(th).attr('data-id');
|
||||
jQuery.fancybox({
|
||||
href: '#amount'+varik,
|
||||
onComplete: function(){
|
||||
jQuery('#fancybox-content').css('border-width',0);
|
||||
jQuery('#fancybox-outer').css('background','none');
|
||||
}
|
||||
});
|
||||
e.preventDefault();
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
BIN
design/atomic/js/bxslider/images/bx_loader.gif
Normal file
BIN
design/atomic/js/bxslider/images/bx_loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
BIN
design/atomic/js/bxslider/images/controls.png
Normal file
BIN
design/atomic/js/bxslider/images/controls.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
177
design/atomic/js/bxslider/jquery.bxslider.css
Normal file
177
design/atomic/js/bxslider/jquery.bxslider.css
Normal file
@@ -0,0 +1,177 @@
|
||||
/** VARIABLES
|
||||
===================================*/
|
||||
/** RESET AND LAYOUT
|
||||
===================================*/
|
||||
.bx-wrapper {
|
||||
position: relative;
|
||||
margin-bottom: 60px;
|
||||
padding: 0;
|
||||
*zoom: 1;
|
||||
-ms-touch-action: pan-y;
|
||||
touch-action: pan-y;
|
||||
}
|
||||
.bx-wrapper img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
}
|
||||
.bxslider {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
ul.bxslider {
|
||||
list-style: none;
|
||||
}
|
||||
.bx-viewport {
|
||||
/*fix other elements on the page moving (on Chrome)*/
|
||||
-webkit-transform: translatez(0);
|
||||
}
|
||||
/** THEME
|
||||
===================================*/
|
||||
.bx-wrapper {
|
||||
-moz-box-shadow: 0 0 5px #ccc;
|
||||
-webkit-box-shadow: 0 0 5px #ccc;
|
||||
box-shadow: 0 0 5px #ccc;
|
||||
border: 5px solid #fff;
|
||||
background: #fff;
|
||||
}
|
||||
.bx-wrapper .bx-pager,
|
||||
.bx-wrapper .bx-controls-auto {
|
||||
position: absolute;
|
||||
bottom: -30px;
|
||||
width: 100%;
|
||||
}
|
||||
/* LOADER */
|
||||
.bx-wrapper .bx-loading {
|
||||
min-height: 50px;
|
||||
background: url('images/bx_loader.gif') center center no-repeat #ffffff;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2000;
|
||||
}
|
||||
/* PAGER */
|
||||
.bx-wrapper .bx-pager {
|
||||
text-align: center;
|
||||
font-size: .85em;
|
||||
font-family: Arial;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a {
|
||||
background: #666;
|
||||
text-indent: -9999px;
|
||||
display: block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin: 0 5px;
|
||||
outline: 0;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a:hover,
|
||||
.bx-wrapper .bx-pager.bx-default-pager a.active,
|
||||
.bx-wrapper .bx-pager.bx-default-pager a:focus {
|
||||
background: #000;
|
||||
}
|
||||
.bx-wrapper .bx-pager-item,
|
||||
.bx-wrapper .bx-controls-auto .bx-controls-auto-item {
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
*zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
.bx-wrapper .bx-pager-item {
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
/* DIRECTION CONTROLS (NEXT / PREV) */
|
||||
.bx-wrapper .bx-prev {
|
||||
left: 10px;
|
||||
background: url('images/controls.png') no-repeat 0 -32px;
|
||||
}
|
||||
.bx-wrapper .bx-prev:hover,
|
||||
.bx-wrapper .bx-prev:focus {
|
||||
background-position: 0 0;
|
||||
}
|
||||
.bx-wrapper .bx-next {
|
||||
right: 10px;
|
||||
background: url('images/controls.png') no-repeat -43px -32px;
|
||||
}
|
||||
.bx-wrapper .bx-next:hover,
|
||||
.bx-wrapper .bx-next:focus {
|
||||
background-position: -43px 0;
|
||||
}
|
||||
.bx-wrapper .bx-controls-direction a {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -16px;
|
||||
outline: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
text-indent: -9999px;
|
||||
z-index: 9999;
|
||||
}
|
||||
.bx-wrapper .bx-controls-direction a.disabled {
|
||||
display: none;
|
||||
}
|
||||
/* AUTO CONTROLS (START / STOP) */
|
||||
.bx-wrapper .bx-controls-auto {
|
||||
text-align: center;
|
||||
}
|
||||
.bx-wrapper .bx-controls-auto .bx-start {
|
||||
display: block;
|
||||
text-indent: -9999px;
|
||||
width: 10px;
|
||||
height: 11px;
|
||||
outline: 0;
|
||||
background: url('images/controls.png') -86px -11px no-repeat;
|
||||
margin: 0 3px;
|
||||
}
|
||||
.bx-wrapper .bx-controls-auto .bx-start:hover,
|
||||
.bx-wrapper .bx-controls-auto .bx-start.active,
|
||||
.bx-wrapper .bx-controls-auto .bx-start:focus {
|
||||
background-position: -86px 0;
|
||||
}
|
||||
.bx-wrapper .bx-controls-auto .bx-stop {
|
||||
display: block;
|
||||
text-indent: -9999px;
|
||||
width: 9px;
|
||||
height: 11px;
|
||||
outline: 0;
|
||||
background: url('images/controls.png') -86px -44px no-repeat;
|
||||
margin: 0 3px;
|
||||
}
|
||||
.bx-wrapper .bx-controls-auto .bx-stop:hover,
|
||||
.bx-wrapper .bx-controls-auto .bx-stop.active,
|
||||
.bx-wrapper .bx-controls-auto .bx-stop:focus {
|
||||
background-position: -86px -33px;
|
||||
}
|
||||
/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
|
||||
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
|
||||
text-align: left;
|
||||
width: 80%;
|
||||
}
|
||||
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
|
||||
right: 0;
|
||||
width: 35px;
|
||||
}
|
||||
/* IMAGE CAPTIONS */
|
||||
.bx-wrapper .bx-caption {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: #666;
|
||||
background: rgba(80, 80, 80, 0.75);
|
||||
width: 100%;
|
||||
}
|
||||
.bx-wrapper .bx-caption span {
|
||||
color: #fff;
|
||||
font-family: Arial;
|
||||
display: block;
|
||||
font-size: .85em;
|
||||
padding: 10px;
|
||||
}
|
||||
1607
design/atomic/js/bxslider/jquery.bxslider.js
Normal file
1607
design/atomic/js/bxslider/jquery.bxslider.js
Normal file
File diff suppressed because it is too large
Load Diff
1
design/atomic/js/bxslider/jquery.bxslider.min.css
vendored
Normal file
1
design/atomic/js/bxslider/jquery.bxslider.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.bx-wrapper{position:relative;margin-bottom:60px;padding:0;-ms-touch-action:pan-y;touch-action:pan-y;-moz-box-shadow:0 0 5px #ccc;-webkit-box-shadow:0 0 5px #ccc;box-shadow:0 0 5px #ccc;border:5px solid #fff;background:#fff}.bx-wrapper img{max-width:100%;display:block}.bxslider{margin:0;padding:0}ul.bxslider{list-style:none}.bx-viewport{-webkit-transform:translatez(0)}.bx-wrapper .bx-controls-auto,.bx-wrapper .bx-pager{position:absolute;bottom:-30px;width:100%}.bx-wrapper .bx-loading{min-height:50px;background:url(images/bx_loader.gif) center center no-repeat #fff;height:100%;width:100%;position:absolute;top:0;left:0;z-index:2000}.bx-wrapper .bx-pager{text-align:center;font-size:.85em;font-family:Arial;font-weight:700;color:#666;padding-top:20px}.bx-wrapper .bx-pager.bx-default-pager a{background:#666;text-indent:-9999px;display:block;width:10px;height:10px;margin:0 5px;outline:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.bx-wrapper .bx-pager.bx-default-pager a.active,.bx-wrapper .bx-pager.bx-default-pager a:focus,.bx-wrapper .bx-pager.bx-default-pager a:hover{background:#000}.bx-wrapper .bx-controls-auto .bx-controls-auto-item,.bx-wrapper .bx-pager-item{display:inline-block;vertical-align:bottom}.bx-wrapper .bx-pager-item{font-size:0;line-height:0}.bx-wrapper .bx-prev{left:10px;background:url(images/controls.png) 0 -32px no-repeat}.bx-wrapper .bx-prev:focus,.bx-wrapper .bx-prev:hover{background-position:0 0}.bx-wrapper .bx-next{right:10px;background:url(images/controls.png) -43px -32px no-repeat}.bx-wrapper .bx-next:focus,.bx-wrapper .bx-next:hover{background-position:-43px 0}.bx-wrapper .bx-controls-direction a{position:absolute;top:50%;margin-top:-16px;outline:0;width:32px;height:32px;text-indent:-9999px;z-index:9999}.bx-wrapper .bx-controls-direction a.disabled{display:none}.bx-wrapper .bx-controls-auto{text-align:center}.bx-wrapper .bx-controls-auto .bx-start{display:block;text-indent:-9999px;width:10px;height:11px;outline:0;background:url(images/controls.png) -86px -11px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-start.active,.bx-wrapper .bx-controls-auto .bx-start:focus,.bx-wrapper .bx-controls-auto .bx-start:hover{background-position:-86px 0}.bx-wrapper .bx-controls-auto .bx-stop{display:block;text-indent:-9999px;width:9px;height:11px;outline:0;background:url(images/controls.png) -86px -44px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-stop.active,.bx-wrapper .bx-controls-auto .bx-stop:focus,.bx-wrapper .bx-controls-auto .bx-stop:hover{background-position:-86px -33px}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager{text-align:left;width:80%}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto{right:0;width:35px}.bx-wrapper .bx-caption{position:absolute;bottom:0;left:0;background:#666;background:rgba(80,80,80,.75);width:100%}.bx-wrapper .bx-caption span{color:#fff;font-family:Arial;display:block;font-size:.85em;padding:10px}
|
||||
7
design/atomic/js/bxslider/jquery.bxslider.min.js
vendored
Normal file
7
design/atomic/js/bxslider/jquery.bxslider.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
48
design/atomic/js/collapse-panel.js
Normal file
48
design/atomic/js/collapse-panel.js
Normal file
@@ -0,0 +1,48 @@
|
||||
(function($) {
|
||||
$.fn.panels = function() {
|
||||
$this = $(this); console.log($this)
|
||||
$(this).find('.panel-body').hide();
|
||||
$(this).find('.panel-title').prepend('<div class="pull-right collapse-button"><span class="glyphicon glyphicon-menu-hamburger"></span></div>');
|
||||
$(this).each(function() {
|
||||
$(this).find('.collapse-button').css('cursor','pointer').click(function() {
|
||||
$this.find('.panel-body').slideToggle('fast');
|
||||
});
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
//$('.collapse-panel').panels();
|
||||
|
||||
$('.collapse-panel').each(function(){
|
||||
var $el = $(this);
|
||||
$el.find('.panel-body').hide();
|
||||
$el.find('.panel-title').prepend('<div class="pull-right collapse-button"><span class="glyphicon glyphicon-menu-hamburger"></span></div>');
|
||||
|
||||
$el.find('.collapse-button').css('cursor','pointer').click(function() {
|
||||
$el.find('.panel-body').slideToggle('fast');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if ($('.container').width() < 940){
|
||||
$('.panel-body').hide();
|
||||
} else {
|
||||
$('.panel-body').show();
|
||||
}
|
||||
|
||||
if($('.services-mobile-menu li.active').length){
|
||||
$('.services-mobile-menu .panel-body').show();
|
||||
$('.services-mobile-menu li.active>ul').show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//$(window).resize(function() {
|
||||
// if ($('.container').width() < 940){
|
||||
// $('.panel-body').hide();
|
||||
// } else {
|
||||
// $('.panel-body').show();
|
||||
// }
|
||||
//});
|
||||
884
design/atomic/js/common7_3_3.js
Normal file
884
design/atomic/js/common7_3_3.js
Normal file
File diff suppressed because one or more lines are too long
1
design/atomic/js/etoSlider.js
Normal file
1
design/atomic/js/etoSlider.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(e){e.fn.etoslider=function(){this.each(function(){function E(){u=t.width();a=Math.ceil(u/o*100);f=Math.ceil(i/100*a);f=f>=i?f:i;l=u>=o?u:o;c=(s-f)/2;h=(u-l)/2;n.each(function(t,n){e(this).width(l).height(f).css("margin-top",c).css("margin-left",h).css("position","absolute").css("left",0).css("top",0)})}function S(){n.each(function(t,r){t++;e(this).css("opacity",t==1?1:0).addClass(t==1?"current-slide first-slide":"").addClass(t==n.length?"last-slide":"").addClass("eto-slide-"+t);y+='<span class="eto-slide-'+t+'"></span>'});v=t.find(".first-slide");m=t.find(".last-slide");t.append('<div class="slider-buttons" style="position:absolute; bottom:40px; right:40px; z-index:100;">'+y+"</div>");b=t.find(".slider-buttons").children("span");b.each(function(n,i){e(this).click(function(n){clearInterval(t.si);t.find(".slider-buttons span").removeClass("active");r=t.find("img."+e(this).attr("class"));e(this).addClass("active");t.find("img").removeClass("current-slide").animate({opacity:0},{queue:false,duration:"slow"});r.addClass("current-slide").animate({opacity:1},{queue:false,duration:"slow"});t.si=setInterval(x,7e3)})});T();t.si=setInterval(x,7e3)}function x(){p=t.find(".current-slide");if(!p.hasClass("last-slide")){d=p.next("img");p.removeClass("current-slide").animate({opacity:0},{queue:false,duration:"slow"});d.addClass("current-slide").animate({opacity:1},{queue:false,duration:"slow"})}else{m.removeClass("current-slide").animate({opacity:0},{queue:false,duration:"slow"});v.addClass("current-slide").animate({opacity:1},{queue:false,duration:"slow"})}T()}function T(){t.find(".slider-buttons span").removeClass("active");buttonClass=t.find(".current-slide").attr("class").replace("first-slide","").replace("last-slide","").replace("current-slide","").replace(/^\s+|\s+$/g,"");t.find(".slider-buttons span."+buttonClass).addClass("active")}var t=e(this),n=t.children("img"),r,i=n.height(),s=t.height(),o=n.width(),u,a,f,l,c,h,p,d,v,m,g,y="",b,w;n.removeAttr("width").removeAttr("height");t.css("position","relative");E();e(window).resize(function(e){E()});S()})}})(jQuery)
|
||||
292
design/atomic/js/extra.js
Normal file
292
design/atomic/js/extra.js
Normal file
@@ -0,0 +1,292 @@
|
||||
function staticLoadScriptUrl(url)
|
||||
{
|
||||
document.write('<script src="', url, '" type="text/javascript"><\/script>');
|
||||
}
|
||||
|
||||
//staticLoadScriptUrl(" https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.min.js");
|
||||
|
||||
(function($) {
|
||||
$.fn.equalHeights = function() {
|
||||
var maxHeight = 0,
|
||||
$this = $(this);
|
||||
$this.each(function() {
|
||||
var height = $(this).innerHeight();
|
||||
if (height > maxHeight) {
|
||||
maxHeight = height;
|
||||
}
|
||||
});
|
||||
return $this.css('height', maxHeight);
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(function() {
|
||||
$(".input_search").autocomplete({
|
||||
serviceUrl:'/ajax/search_products.php',
|
||||
minChars:1,
|
||||
noCache: false,
|
||||
open: function() { $('#div .ui-menu').width(300) },
|
||||
onSelect:
|
||||
function(value, data){
|
||||
$(".input_search").closest('form').submit();
|
||||
},
|
||||
fnFormatResult:
|
||||
function(value, data, currentValue){
|
||||
var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g');
|
||||
var pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';
|
||||
return (data.image?"<img align=absmiddle src='"+data.image+"'> ":'') + value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#sort-services').change(function(){
|
||||
|
||||
var val = $('#sort-services').find('option:selected').val();
|
||||
var url = document.location.pathname.replace(/\/filter-[^/]+\//, '/');
|
||||
url = url.replace(/\/page-[0-9]+\//, '/');
|
||||
if(val != 0) url += 'filter-' + val + '/';
|
||||
//console.log(url)
|
||||
document.location.href = url;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(window).load(function(){
|
||||
$('[data-validation="phone"]').mask('+7(999) 999 - 99 - 99');
|
||||
});
|
||||
|
||||
$(document).ready(function(e) {
|
||||
|
||||
|
||||
|
||||
$('.pdf-download-content a').each(function() {
|
||||
|
||||
//console.log( 'test' );
|
||||
|
||||
if ($(this).attr('href')) {
|
||||
if ($(this).attr('href').indexOf('.pdf') > 0) {
|
||||
var thisText = $(this).html(),
|
||||
parentText = $(this).parent().html(),
|
||||
addText = parentText.replace(thisText, ''),
|
||||
insert = '<div class="pdf-download"><span><a target="_blank" href="' + $(this).attr('href') + '">' + $(this).html() + '</a><p>' + addText + '</p></span></div>';
|
||||
$(this).parent().html(insert);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.pdf-download').each(function() {
|
||||
var $el = $(this);
|
||||
var href = $el.find('a').attr('href');
|
||||
$el.css('cursor', 'pointer');
|
||||
|
||||
$el.wrap('<a href="'+href+'" target="_blank" />');
|
||||
|
||||
//$el.click(function() {
|
||||
//window.location.href = href;
|
||||
//});
|
||||
});
|
||||
|
||||
|
||||
$('#top-shopcart').fadeIn();
|
||||
|
||||
//$('[data-validation="phone"]').mask('+7(999) 999 - 99 - 99');
|
||||
|
||||
$(window).scroll(function () {if ($(this).scrollTop() > 0) {$('#scroller').fadeIn();} else {$('#scroller').fadeOut();}});
|
||||
$('#scroller').click(function () {$('body,html').animate({scrollTop: 0}, 400); return false;});
|
||||
$('.copyright .ch').after(" " + (new Date).getFullYear());
|
||||
var amount = parseInt($('#b_count3').text());
|
||||
if(amount == 0)
|
||||
{
|
||||
$('#top-shopcart').removeClass('notempty');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#top-shopcart').addClass('notempty');
|
||||
}
|
||||
$('.content table:not("form table")').removeAttr('style').removeAttr('class').removeAttr('border').removeAttr('cellpadding').removeAttr('cellspacing').removeAttr('align').addClass('table table-striped table-bordered');
|
||||
$('.content table td:not("form table td")').removeAttr('style').removeAttr('class').removeAttr('align').removeAttr('valign').addClass('td');
|
||||
$('.content table td img:not("form table td img")').each(function(){
|
||||
var _img = $(this);
|
||||
if(_img.hasClass('zooming')){
|
||||
_img.removeAttr('style').removeAttr('class').addClass('img-thumbnail zooming');
|
||||
}else{
|
||||
_img.removeAttr('style').removeAttr('class').addClass('img-thumbnail');
|
||||
}
|
||||
});
|
||||
$('.content table td a:not("form table td a")').removeAttr('style').removeAttr('class').addClass('w');
|
||||
$('.content form.variants select').addClass('form-control');
|
||||
|
||||
$('img.zooming').each(function(){
|
||||
var href = $(this).attr('src');
|
||||
var title = $(this).attr('alt');
|
||||
var src = $(this).attr('data-src');
|
||||
if(typeof src != 'undefined' && src) href = src;
|
||||
$(this).wrap('<a href="'+href+'" title="'+title+'" class="_zooming" rel="group777" />');
|
||||
//$(this).parent().wrap('<div class="col-sm-6 mb"/>');
|
||||
});
|
||||
|
||||
$('a._zooming').fancybox({
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false
|
||||
},
|
||||
title: {
|
||||
//type: 'inside'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function vk()
|
||||
{
|
||||
/*setTimeout(function(){
|
||||
$('#vk_groups').find('iframe').remove();
|
||||
VK.Widgets.Group("vk_groups", {mode: 0, width: $('#vk_groups').parent().width()-2, height: 256, color1: 'FFFFFF', color2: '2B587A', color3: '2e3338'}, 60705350);
|
||||
}, 300); */
|
||||
}
|
||||
function heightElems()
|
||||
{
|
||||
if ($('body').hasClass('desktop')) {
|
||||
$('.home-output .product-image').height('auto').equalHeights();
|
||||
$('.home-output .product-name').height('auto').equalHeights();
|
||||
$('.brands .brand .brand-image').height('auto').equalHeights();
|
||||
$('.brands .brand .brand-name').height('auto').equalHeights();
|
||||
$('.categories .category .category-image').height('auto').equalHeights();
|
||||
$('.categories .category .category-name').height('auto').equalHeights();
|
||||
$('.articles .article .article-image').height('auto').equalHeights();
|
||||
$('.articles .article .article-name').height('auto').equalHeights();
|
||||
$('.blog-unit').height('auto').equalHeights();
|
||||
} else if ($('body').hasClass('mobile')) {
|
||||
$('.home-output .product').height('auto').equalHeights();
|
||||
$('.brands .brand').height('auto').equalHeights();
|
||||
$('.categories .category').height('auto').equalHeights();
|
||||
$('.articles .article').height('auto').equalHeights();
|
||||
$('.blog-unit').height('auto').equalHeights();
|
||||
}
|
||||
}
|
||||
$(window).load(function() {
|
||||
heightElems();
|
||||
vk();
|
||||
});
|
||||
$(window).resize(function() {
|
||||
heightElems();
|
||||
vk();
|
||||
});
|
||||
if ($('body').hasClass('mobile')) {
|
||||
$('.table').wrap('<div class="table-responsive"></div>');
|
||||
}
|
||||
$('.slh0 span').remove();
|
||||
|
||||
$('#c_submit').attr('disabled', false);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
if ($('#contact-form-replacer').length) { // move contact form on /articles/ustanovochnye-tsentry/
|
||||
$('#hideContactForm').find('.contact-form').addClass('replaced-form');
|
||||
var replacedForm = $('#hideContactForm').html();
|
||||
$('#hideContactForm').remove();
|
||||
$('#contact-form-replacer').replaceWith(replacedForm);
|
||||
$('#chCallbackForm').sendForm({'header' : '#chCallbackFormHeader'});
|
||||
$('[data-validation="phone"]').mask('+7(999) 999 - 99 - 99');
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
});
|
||||
|
||||
|
||||
function sendCallback(){
|
||||
var name = $('#c_name').val();
|
||||
var tel = $('#c_tel').val();
|
||||
var tema = $('#c_tema').val();
|
||||
|
||||
if(tel.length < 5){
|
||||
formError('tel','номер телефона'); return;
|
||||
}
|
||||
|
||||
$('#c_submit').attr('disabled', true).html('<i>отправка...</i>');
|
||||
$.post('/ajax/sendCallback.php',{name:name,tel:tel,tema:tema},function(){
|
||||
var msg = 'Ваше сообщение успешно отправлено';
|
||||
$('#call_form').html('<div class="alert alert-success">'+msg+'</div>');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function formError(id,msg){
|
||||
|
||||
$('#c_'+id).after('<div class="alert alert-error" id="form_error">Укажите '+msg+'</div>');
|
||||
|
||||
$('#c_'+id).focus();
|
||||
$('#c_'+id).keyup(function(){$('#form_error').remove();});
|
||||
}
|
||||
|
||||
//send forms
|
||||
(function($) {
|
||||
$.fn.sendForm = function(options) { //console.log(Math.random(), this)
|
||||
var settings = $.extend({
|
||||
'header': '#header'
|
||||
}, options);
|
||||
var form = this,
|
||||
header = $(settings.header),
|
||||
user = 0;
|
||||
if (form.find('input[name="user"]').val() == '') {
|
||||
user = 1;
|
||||
}
|
||||
form.find('input,textarea,button').removeAttr('disabled');
|
||||
form.find('.form-submit').click(function() {
|
||||
form.find('input').each(function(index, element) {
|
||||
if (index == 0 && user == 0) {
|
||||
$(this).addClass('focus');
|
||||
}
|
||||
if (index == 1 && user == 1) {
|
||||
$(this).addClass('focus');
|
||||
}
|
||||
});
|
||||
var required = [];
|
||||
form.find('[data-validation]').each(function(index, element) {
|
||||
required[index] = {
|
||||
name: $(this).attr('name'),
|
||||
validation: $(this).attr('data-validation')
|
||||
};
|
||||
});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/mailer/',
|
||||
data: {
|
||||
formData: form.serializeArray(),
|
||||
requiredData: required
|
||||
},
|
||||
success: function(response) {
|
||||
//console.log(response);
|
||||
if (response.indexOf('}') > -1) {
|
||||
var responseObj = jQuery.parseJSON(response),
|
||||
i = 0;
|
||||
$.each(responseObj, function(key, value) {
|
||||
if (i == 0) {
|
||||
//form.find('[name="' + value + '"]').focus(); // off focus, for replace placeholders (crutch), because use "maskedinput"
|
||||
i++;
|
||||
}
|
||||
form.find('[name="' + value + '"]').addClass('required').change(function() {
|
||||
$(this).removeClass('required');
|
||||
});
|
||||
});
|
||||
} else {
|
||||
form.find('.focus').focus();
|
||||
form.find('input,textarea,button').attr('disabled', 'disabled');
|
||||
header.html(response);
|
||||
}
|
||||
|
||||
// replace placeholders (crutch) //////////////////////////////////////////////////
|
||||
$('input.required[data-validation="phone"]').attr('placeholder','Введите телефон');
|
||||
$('input.required[data-validation="email"]').attr('placeholder','или Email');
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
if(options.callback) options.callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#bottomForm').sendForm({'header' : '#bottomFormHeader'});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
2
design/atomic/js/jquery-1.8.min.js
vendored
Normal file
2
design/atomic/js/jquery-1.8.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
46
design/atomic/js/jquery-ui.min.js
vendored
Normal file
46
design/atomic/js/jquery-ui.min.js
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* jQuery UI Effects 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/
|
||||
*/
|
||||
jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
|
||||
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
||||
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
|
||||
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
|
||||
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
|
||||
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
|
||||
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
|
||||
d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
|
||||
f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
|
||||
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
|
||||
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
|
||||
d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement;
|
||||
if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});
|
||||
return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,
|
||||
arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/
|
||||
2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,
|
||||
d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,
|
||||
a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,
|
||||
d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=
|
||||
0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;
|
||||
if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,
|
||||
a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Transfer 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Transfer
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
|
||||
b.dequeue()})})}})(jQuery);
|
||||
;
|
||||
5
design/atomic/js/jquery.flexslider-min.js
vendored
Normal file
5
design/atomic/js/jquery.flexslider-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1181
design/atomic/js/jquery.flexslider.js
Normal file
1181
design/atomic/js/jquery.flexslider.js
Normal file
File diff suppressed because it is too large
Load Diff
864
design/atomic/js/jquery.form.js
Normal file
864
design/atomic/js/jquery.form.js
Normal file
@@ -0,0 +1,864 @@
|
||||
/*!
|
||||
* jQuery Form Plugin
|
||||
* version: 2.80 (25-MAY-2011)
|
||||
* @requires jQuery v1.3.2 or later
|
||||
*
|
||||
* Examples and documentation at: http://malsup.com/jquery/form/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
/*
|
||||
Usage Note:
|
||||
-----------
|
||||
Do not use both ajaxSubmit and ajaxForm on the same form. These
|
||||
functions are intended to be exclusive. Use ajaxSubmit if you want
|
||||
to bind your own submit handler to the form. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').bind('submit', function(e) {
|
||||
e.preventDefault(); // <-- important
|
||||
$(this).ajaxSubmit({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Use ajaxForm when you want the plugin to manage all the event binding
|
||||
for you. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').ajaxForm({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
|
||||
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
||||
at the appropriate time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ajaxSubmit() provides a mechanism for immediately submitting
|
||||
* an HTML form using AJAX.
|
||||
*/
|
||||
$.fn.ajaxSubmit = function(options) {
|
||||
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
|
||||
if (!this.length) {
|
||||
log('ajaxSubmit: skipping submit process - no element selected');
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof options == 'function') {
|
||||
options = { success: options };
|
||||
}
|
||||
|
||||
var action = this.attr('action');
|
||||
var url = (typeof action === 'string') ? $.trim(action) : '';
|
||||
url = url || window.location.href || '';
|
||||
if (url) {
|
||||
// clean url (don't include hash vaue)
|
||||
url = (url.match(/^([^#]+)/)||[])[1];
|
||||
}
|
||||
|
||||
options = $.extend(true, {
|
||||
url: url,
|
||||
success: $.ajaxSettings.success,
|
||||
type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
||||
}, options);
|
||||
|
||||
// hook for manipulating the form data before it is extracted;
|
||||
// convenient for use with rich editors like tinyMCE or FCKEditor
|
||||
var veto = {};
|
||||
this.trigger('form-pre-serialize', [this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
// provide opportunity to alter form data before it is serialized
|
||||
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSerialize callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
var n,v,a = this.formToArray(options.semantic);
|
||||
if (options.data) {
|
||||
options.extraData = options.data;
|
||||
for (n in options.data) {
|
||||
if(options.data[n] instanceof Array) {
|
||||
for (var k in options.data[n]) {
|
||||
a.push( { name: n, value: options.data[n][k] } );
|
||||
}
|
||||
}
|
||||
else {
|
||||
v = options.data[n];
|
||||
v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
|
||||
a.push( { name: n, value: v } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// give pre-submit callback an opportunity to abort the submit
|
||||
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSubmit callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
// fire vetoable 'validate' event
|
||||
this.trigger('form-submit-validate', [a, this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
var q = $.param(a);
|
||||
|
||||
if (options.type.toUpperCase() == 'GET') {
|
||||
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
||||
options.data = null; // data is null for 'get'
|
||||
}
|
||||
else {
|
||||
options.data = q; // data is the query string for 'post'
|
||||
}
|
||||
|
||||
var $form = this, callbacks = [];
|
||||
if (options.resetForm) {
|
||||
callbacks.push(function() { $form.resetForm(); });
|
||||
}
|
||||
if (options.clearForm) {
|
||||
callbacks.push(function() { $form.clearForm(); });
|
||||
}
|
||||
|
||||
// perform a load on the target only if dataType is not provided
|
||||
if (!options.dataType && options.target) {
|
||||
var oldSuccess = options.success || function(){};
|
||||
callbacks.push(function(data) {
|
||||
var fn = options.replaceTarget ? 'replaceWith' : 'html';
|
||||
$(options.target)[fn](data).each(oldSuccess, arguments);
|
||||
});
|
||||
}
|
||||
else if (options.success) {
|
||||
callbacks.push(options.success);
|
||||
}
|
||||
|
||||
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
||||
var context = options.context || options; // jQuery 1.4+ supports scope context
|
||||
for (var i=0, max=callbacks.length; i < max; i++) {
|
||||
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
||||
}
|
||||
};
|
||||
|
||||
// are there files to upload?
|
||||
var fileInputs = $('input:file', this).length > 0;
|
||||
var mp = 'multipart/form-data';
|
||||
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
|
||||
|
||||
// options.iframe allows user to force iframe mode
|
||||
// 06-NOV-09: now defaulting to iframe mode if file input is detected
|
||||
if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
|
||||
// hack to fix Safari hang (thanks to Tim Molendijk for this)
|
||||
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
|
||||
if (options.closeKeepAlive) {
|
||||
$.get(options.closeKeepAlive, function() { fileUpload(a); });
|
||||
}
|
||||
else {
|
||||
fileUpload(a);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.ajax(options);
|
||||
}
|
||||
|
||||
// fire 'notify' event
|
||||
this.trigger('form-submit-notify', [this, options]);
|
||||
return this;
|
||||
|
||||
|
||||
// private function for handling file uploads (hat tip to YAHOO!)
|
||||
function fileUpload(a) {
|
||||
var form = $form[0], i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
|
||||
|
||||
if (a) {
|
||||
// ensure that every serialized input is still enabled
|
||||
for (i=0; i < a.length; i++) {
|
||||
$(form[a[i].name]).attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
if ($(':input[name=submit],:input[id=submit]', form).length) {
|
||||
// if there is an input with a name or id of 'submit' then we won't be
|
||||
// able to invoke the submit fn on the form (at least not x-browser)
|
||||
alert('Error: Form elements must not have name or id of "submit".');
|
||||
return;
|
||||
}
|
||||
|
||||
s = $.extend(true, {}, $.ajaxSettings, options);
|
||||
s.context = s.context || s;
|
||||
id = 'jqFormIO' + (new Date().getTime());
|
||||
if (s.iframeTarget) {
|
||||
$io = $(s.iframeTarget);
|
||||
n = $io.attr('name');
|
||||
if (n == null)
|
||||
$io.attr('name', id);
|
||||
else
|
||||
id = n;
|
||||
}
|
||||
else {
|
||||
$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
|
||||
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
|
||||
}
|
||||
io = $io[0];
|
||||
|
||||
|
||||
xhr = { // mock object
|
||||
aborted: 0,
|
||||
responseText: null,
|
||||
responseXML: null,
|
||||
status: 0,
|
||||
statusText: 'n/a',
|
||||
getAllResponseHeaders: function() {},
|
||||
getResponseHeader: function() {},
|
||||
setRequestHeader: function() {},
|
||||
abort: function(status) {
|
||||
var e = (status === 'timeout' ? 'timeout' : 'aborted');
|
||||
log('aborting upload... ' + e);
|
||||
this.aborted = 1;
|
||||
$io.attr('src', s.iframeSrc); // abort op in progress
|
||||
xhr.error = e;
|
||||
s.error && s.error.call(s.context, xhr, e, e);
|
||||
g && $.event.trigger("ajaxError", [xhr, s, e]);
|
||||
s.complete && s.complete.call(s.context, xhr, e);
|
||||
}
|
||||
};
|
||||
|
||||
g = s.global;
|
||||
// trigger ajax global events so that activity/block indicators work like normal
|
||||
if (g && ! $.active++) {
|
||||
$.event.trigger("ajaxStart");
|
||||
}
|
||||
if (g) {
|
||||
$.event.trigger("ajaxSend", [xhr, s]);
|
||||
}
|
||||
|
||||
if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
|
||||
if (s.global) {
|
||||
$.active--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (xhr.aborted) {
|
||||
return;
|
||||
}
|
||||
|
||||
// add submitting element to data if we know it
|
||||
sub = form.clk;
|
||||
if (sub) {
|
||||
n = sub.name;
|
||||
if (n && !sub.disabled) {
|
||||
s.extraData = s.extraData || {};
|
||||
s.extraData[n] = sub.value;
|
||||
if (sub.type == "image") {
|
||||
s.extraData[n+'.x'] = form.clk_x;
|
||||
s.extraData[n+'.y'] = form.clk_y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// take a breath so that pending repaints get some cpu time before the upload starts
|
||||
function doSubmit() {
|
||||
// make sure form attrs are set
|
||||
var t = $form.attr('target'), a = $form.attr('action');
|
||||
|
||||
// update form attrs in IE friendly way
|
||||
form.setAttribute('target',id);
|
||||
if (form.getAttribute('method') != 'POST') {
|
||||
form.setAttribute('method', 'POST');
|
||||
}
|
||||
if (form.getAttribute('action') != s.url) {
|
||||
form.setAttribute('action', s.url);
|
||||
}
|
||||
|
||||
// ie borks in some cases when setting encoding
|
||||
if (! s.skipEncodingOverride) {
|
||||
$form.attr({
|
||||
encoding: 'multipart/form-data',
|
||||
enctype: 'multipart/form-data'
|
||||
});
|
||||
}
|
||||
|
||||
// support timout
|
||||
if (s.timeout) {
|
||||
timeoutHandle = setTimeout(function() { timedOut = true; cb(true); }, s.timeout);
|
||||
}
|
||||
|
||||
// add "extra" data to form if provided in options
|
||||
var extraInputs = [];
|
||||
try {
|
||||
if (s.extraData) {
|
||||
for (var n in s.extraData) {
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
|
||||
.appendTo(form)[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!s.iframeTarget) {
|
||||
// add iframe to doc and submit the form
|
||||
$io.appendTo('body');
|
||||
io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
finally {
|
||||
// reset attrs and remove "extra" input elements
|
||||
form.setAttribute('action',a);
|
||||
if(t) {
|
||||
form.setAttribute('target', t);
|
||||
} else {
|
||||
$form.removeAttr('target');
|
||||
}
|
||||
$(extraInputs).remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (s.forceSync) {
|
||||
doSubmit();
|
||||
}
|
||||
else {
|
||||
setTimeout(doSubmit, 10); // this lets dom updates render
|
||||
}
|
||||
|
||||
var data, doc, domCheckCount = 50, callbackProcessed;
|
||||
|
||||
function cb(e) {
|
||||
if (xhr.aborted || callbackProcessed) {
|
||||
return;
|
||||
}
|
||||
if (e === true && xhr) {
|
||||
xhr.abort('timeout');
|
||||
return;
|
||||
}
|
||||
|
||||
var doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
|
||||
if (!doc || doc.location.href == s.iframeSrc) {
|
||||
// response not received yet
|
||||
if (!timedOut)
|
||||
return;
|
||||
}
|
||||
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
|
||||
|
||||
var status = 'success', errMsg;
|
||||
try {
|
||||
if (timedOut) {
|
||||
throw 'timeout';
|
||||
}
|
||||
|
||||
var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
|
||||
log('isXml='+isXml);
|
||||
if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
|
||||
if (--domCheckCount) {
|
||||
// in some browsers (Opera) the iframe DOM is not always traversable when
|
||||
// the onload callback fires, so we loop a bit to accommodate
|
||||
log('requeing onLoad callback, DOM not available');
|
||||
setTimeout(cb, 250);
|
||||
return;
|
||||
}
|
||||
// let this fall through because server response could be an empty document
|
||||
//log('Could not access iframe DOM after mutiple tries.');
|
||||
//throw 'DOMException: not available';
|
||||
}
|
||||
|
||||
//log('response detected');
|
||||
var docRoot = doc.body ? doc.body : doc.documentElement;
|
||||
xhr.responseText = docRoot ? docRoot.innerHTML : null;
|
||||
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
||||
if (isXml)
|
||||
s.dataType = 'xml';
|
||||
xhr.getResponseHeader = function(header){
|
||||
var headers = {'content-type': s.dataType};
|
||||
return headers[header];
|
||||
};
|
||||
// support for XHR 'status' & 'statusText' emulation :
|
||||
if (docRoot) {
|
||||
xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
|
||||
xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
|
||||
}
|
||||
|
||||
var dt = s.dataType || '';
|
||||
var scr = /(json|script|text)/.test(dt.toLowerCase());
|
||||
if (scr || s.textarea) {
|
||||
// see if user embedded response in textarea
|
||||
var ta = doc.getElementsByTagName('textarea')[0];
|
||||
if (ta) {
|
||||
xhr.responseText = ta.value;
|
||||
// support for XHR 'status' & 'statusText' emulation :
|
||||
xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
|
||||
xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
|
||||
}
|
||||
else if (scr) {
|
||||
// account for browsers injecting pre around json response
|
||||
var pre = doc.getElementsByTagName('pre')[0];
|
||||
var b = doc.getElementsByTagName('body')[0];
|
||||
if (pre) {
|
||||
xhr.responseText = pre.textContent ? pre.textContent : pre.innerHTML;
|
||||
}
|
||||
else if (b) {
|
||||
xhr.responseText = b.innerHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
|
||||
xhr.responseXML = toXml(xhr.responseText);
|
||||
}
|
||||
|
||||
try {
|
||||
data = httpData(xhr, s.dataType, s);
|
||||
}
|
||||
catch (e) {
|
||||
status = 'parsererror';
|
||||
xhr.error = errMsg = (e || status);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
log('error caught',e);
|
||||
status = 'error';
|
||||
xhr.error = errMsg = (e || status);
|
||||
}
|
||||
|
||||
if (xhr.aborted) {
|
||||
log('upload aborted');
|
||||
status = null;
|
||||
}
|
||||
|
||||
if (xhr.status) { // we've set xhr.status
|
||||
status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
|
||||
}
|
||||
|
||||
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
||||
if (status === 'success') {
|
||||
s.success && s.success.call(s.context, data, 'success', xhr);
|
||||
g && $.event.trigger("ajaxSuccess", [xhr, s]);
|
||||
}
|
||||
else if (status) {
|
||||
if (errMsg == undefined)
|
||||
errMsg = xhr.statusText;
|
||||
s.error && s.error.call(s.context, xhr, status, errMsg);
|
||||
g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
|
||||
}
|
||||
|
||||
g && $.event.trigger("ajaxComplete", [xhr, s]);
|
||||
|
||||
if (g && ! --$.active) {
|
||||
$.event.trigger("ajaxStop");
|
||||
}
|
||||
|
||||
s.complete && s.complete.call(s.context, xhr, status);
|
||||
|
||||
callbackProcessed = true;
|
||||
if (s.timeout)
|
||||
clearTimeout(timeoutHandle);
|
||||
|
||||
// clean up
|
||||
setTimeout(function() {
|
||||
if (!s.iframeTarget)
|
||||
$io.remove();
|
||||
xhr.responseXML = null;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
|
||||
if (window.ActiveXObject) {
|
||||
doc = new ActiveXObject('Microsoft.XMLDOM');
|
||||
doc.async = 'false';
|
||||
doc.loadXML(s);
|
||||
}
|
||||
else {
|
||||
doc = (new DOMParser()).parseFromString(s, 'text/xml');
|
||||
}
|
||||
return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
|
||||
};
|
||||
var parseJSON = $.parseJSON || function(s) {
|
||||
return window['eval']('(' + s + ')');
|
||||
};
|
||||
|
||||
var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
|
||||
|
||||
var ct = xhr.getResponseHeader('content-type') || '',
|
||||
xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
|
||||
data = xml ? xhr.responseXML : xhr.responseText;
|
||||
|
||||
if (xml && data.documentElement.nodeName === 'parsererror') {
|
||||
$.error && $.error('parsererror');
|
||||
}
|
||||
if (s && s.dataFilter) {
|
||||
data = s.dataFilter(data, type);
|
||||
}
|
||||
if (typeof data === 'string') {
|
||||
if (type === 'json' || !type && ct.indexOf('json') >= 0) {
|
||||
data = parseJSON(data);
|
||||
} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
|
||||
$.globalEval(data);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ajaxForm() provides a mechanism for fully automating form submission.
|
||||
*
|
||||
* The advantages of using this method instead of ajaxSubmit() are:
|
||||
*
|
||||
* 1: This method will include coordinates for <input type="image" /> elements (if the element
|
||||
* is used to submit the form).
|
||||
* 2. This method will include the submit element's name/value data (for the element that was
|
||||
* used to submit the form).
|
||||
* 3. This method binds the submit() method to the form for you.
|
||||
*
|
||||
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
|
||||
* passes the options argument along after properly binding events for submit elements and
|
||||
* the form itself.
|
||||
*/
|
||||
$.fn.ajaxForm = function(options) {
|
||||
// in jQuery 1.3+ we can fix mistakes with the ready state
|
||||
if (this.length === 0) {
|
||||
var o = { s: this.selector, c: this.context };
|
||||
if (!$.isReady && o.s) {
|
||||
log('DOM not ready, queuing ajaxForm');
|
||||
$(function() {
|
||||
$(o.s,o.c).ajaxForm(options);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
// is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
|
||||
log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
|
||||
return this;
|
||||
}
|
||||
|
||||
return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
|
||||
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
|
||||
e.preventDefault();
|
||||
$(this).ajaxSubmit(options);
|
||||
}
|
||||
}).bind('click.form-plugin', function(e) {
|
||||
var target = e.target;
|
||||
var $el = $(target);
|
||||
if (!($el.is(":submit,input:image"))) {
|
||||
// is this a child element of the submit el? (ex: a span within a button)
|
||||
var t = $el.closest(':submit');
|
||||
if (t.length == 0) {
|
||||
return;
|
||||
}
|
||||
target = t[0];
|
||||
}
|
||||
var form = this;
|
||||
form.clk = target;
|
||||
if (target.type == 'image') {
|
||||
if (e.offsetX != undefined) {
|
||||
form.clk_x = e.offsetX;
|
||||
form.clk_y = e.offsetY;
|
||||
} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
|
||||
var offset = $el.offset();
|
||||
form.clk_x = e.pageX - offset.left;
|
||||
form.clk_y = e.pageY - offset.top;
|
||||
} else {
|
||||
form.clk_x = e.pageX - target.offsetLeft;
|
||||
form.clk_y = e.pageY - target.offsetTop;
|
||||
}
|
||||
}
|
||||
// clear form vars
|
||||
setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
|
||||
});
|
||||
};
|
||||
|
||||
// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
|
||||
$.fn.ajaxFormUnbind = function() {
|
||||
return this.unbind('submit.form-plugin click.form-plugin');
|
||||
};
|
||||
|
||||
/**
|
||||
* formToArray() gathers form element data into an array of objects that can
|
||||
* be passed to any of the following ajax functions: $.get, $.post, or load.
|
||||
* Each object in the array has both a 'name' and 'value' property. An example of
|
||||
* an array for a simple login form might be:
|
||||
*
|
||||
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
||||
*
|
||||
* It is this array that is passed to pre-submit callback functions provided to the
|
||||
* ajaxSubmit() and ajaxForm() methods.
|
||||
*/
|
||||
$.fn.formToArray = function(semantic) {
|
||||
var a = [];
|
||||
if (this.length === 0) {
|
||||
return a;
|
||||
}
|
||||
|
||||
var form = this[0];
|
||||
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
||||
if (!els) {
|
||||
return a;
|
||||
}
|
||||
|
||||
var i,j,n,v,el,max,jmax;
|
||||
for(i=0, max=els.length; i < max; i++) {
|
||||
el = els[i];
|
||||
n = el.name;
|
||||
if (!n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (semantic && form.clk && el.type == "image") {
|
||||
// handle image inputs on the fly when semantic == true
|
||||
if(!el.disabled && form.clk == el) {
|
||||
a.push({name: n, value: $(el).val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
v = $.fieldValue(el, true);
|
||||
if (v && v.constructor == Array) {
|
||||
for(j=0, jmax=v.length; j < jmax; j++) {
|
||||
a.push({name: n, value: v[j]});
|
||||
}
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined') {
|
||||
a.push({name: n, value: v});
|
||||
}
|
||||
}
|
||||
|
||||
if (!semantic && form.clk) {
|
||||
// input type=='image' are not found in elements array! handle it here
|
||||
var $input = $(form.clk), input = $input[0];
|
||||
n = input.name;
|
||||
if (n && !input.disabled && input.type == 'image') {
|
||||
a.push({name: n, value: $input.val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes form data into a 'submittable' string. This method will return a string
|
||||
* in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.formSerialize = function(semantic) {
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(this.formToArray(semantic));
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes all field elements in the jQuery object into a query string.
|
||||
* This method will return a string in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.fieldSerialize = function(successful) {
|
||||
var a = [];
|
||||
this.each(function() {
|
||||
var n = this.name;
|
||||
if (!n) {
|
||||
return;
|
||||
}
|
||||
var v = $.fieldValue(this, successful);
|
||||
if (v && v.constructor == Array) {
|
||||
for (var i=0,max=v.length; i < max; i++) {
|
||||
a.push({name: n, value: v[i]});
|
||||
}
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined') {
|
||||
a.push({name: this.name, value: v});
|
||||
}
|
||||
});
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(a);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value(s) of the element in the matched set. For example, consider the following form:
|
||||
*
|
||||
* <form><fieldset>
|
||||
* <input name="A" type="text" />
|
||||
* <input name="A" type="text" />
|
||||
* <input name="B" type="checkbox" value="B1" />
|
||||
* <input name="B" type="checkbox" value="B2"/>
|
||||
* <input name="C" type="radio" value="C1" />
|
||||
* <input name="C" type="radio" value="C2" />
|
||||
* </fieldset></form>
|
||||
*
|
||||
* var v = $(':text').fieldValue();
|
||||
* // if no values are entered into the text inputs
|
||||
* v == ['','']
|
||||
* // if values entered into the text inputs are 'foo' and 'bar'
|
||||
* v == ['foo','bar']
|
||||
*
|
||||
* var v = $(':checkbox').fieldValue();
|
||||
* // if neither checkbox is checked
|
||||
* v === undefined
|
||||
* // if both checkboxes are checked
|
||||
* v == ['B1', 'B2']
|
||||
*
|
||||
* var v = $(':radio').fieldValue();
|
||||
* // if neither radio is checked
|
||||
* v === undefined
|
||||
* // if first radio is checked
|
||||
* v == ['C1']
|
||||
*
|
||||
* The successful argument controls whether or not the field element must be 'successful'
|
||||
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
||||
* The default value of the successful argument is true. If this value is false the value(s)
|
||||
* for each element is returned.
|
||||
*
|
||||
* Note: This method *always* returns an array. If no valid value can be determined the
|
||||
* array will be empty, otherwise it will contain one or more values.
|
||||
*/
|
||||
$.fn.fieldValue = function(successful) {
|
||||
for (var val=[], i=0, max=this.length; i < max; i++) {
|
||||
var el = this[i];
|
||||
var v = $.fieldValue(el, successful);
|
||||
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
|
||||
continue;
|
||||
}
|
||||
v.constructor == Array ? $.merge(val, v) : val.push(v);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value of the field element.
|
||||
*/
|
||||
$.fieldValue = function(el, successful) {
|
||||
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
||||
if (successful === undefined) {
|
||||
successful = true;
|
||||
}
|
||||
|
||||
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
|
||||
(t == 'checkbox' || t == 'radio') && !el.checked ||
|
||||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
|
||||
tag == 'select' && el.selectedIndex == -1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (tag == 'select') {
|
||||
var index = el.selectedIndex;
|
||||
if (index < 0) {
|
||||
return null;
|
||||
}
|
||||
var a = [], ops = el.options;
|
||||
var one = (t == 'select-one');
|
||||
var max = (one ? index+1 : ops.length);
|
||||
for(var i=(one ? index : 0); i < max; i++) {
|
||||
var op = ops[i];
|
||||
if (op.selected) {
|
||||
var v = op.value;
|
||||
if (!v) { // extra pain for IE...
|
||||
v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
|
||||
}
|
||||
if (one) {
|
||||
return v;
|
||||
}
|
||||
a.push(v);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return $(el).val();
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the form data. Takes the following actions on the form's input fields:
|
||||
* - input text fields will have their 'value' property set to the empty string
|
||||
* - select elements will have their 'selectedIndex' property set to -1
|
||||
* - checkbox and radio inputs will have their 'checked' property set to false
|
||||
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
||||
* - button elements will *not* be effected
|
||||
*/
|
||||
$.fn.clearForm = function() {
|
||||
return this.each(function() {
|
||||
$('input,select,textarea', this).clearFields();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the selected form elements.
|
||||
*/
|
||||
$.fn.clearFields = $.fn.clearInputs = function() {
|
||||
return this.each(function() {
|
||||
var t = this.type, tag = this.tagName.toLowerCase();
|
||||
if (t == 'text' || t == 'password' || tag == 'textarea') {
|
||||
this.value = '';
|
||||
}
|
||||
else if (t == 'checkbox' || t == 'radio') {
|
||||
this.checked = false;
|
||||
}
|
||||
else if (tag == 'select') {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets the form data. Causes all form elements to be reset to their original value.
|
||||
*/
|
||||
$.fn.resetForm = function() {
|
||||
return this.each(function() {
|
||||
// guard against an input with the name of 'reset'
|
||||
// note that IE reports the reset function as an 'object'
|
||||
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
|
||||
this.reset();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Enables or disables any matching elements.
|
||||
*/
|
||||
$.fn.enable = function(b) {
|
||||
if (b === undefined) {
|
||||
b = true;
|
||||
}
|
||||
return this.each(function() {
|
||||
this.disabled = !b;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks/unchecks any matching checkboxes or radio buttons and
|
||||
* selects/deselects and matching option elements.
|
||||
*/
|
||||
$.fn.selected = function(select) {
|
||||
if (select === undefined) {
|
||||
select = true;
|
||||
}
|
||||
return this.each(function() {
|
||||
var t = this.type;
|
||||
if (t == 'checkbox' || t == 'radio') {
|
||||
this.checked = select;
|
||||
}
|
||||
else if (this.tagName.toLowerCase() == 'option') {
|
||||
var $sel = $(this).parent('select');
|
||||
if (select && $sel[0] && $sel[0].type == 'select-one') {
|
||||
// deselect all other options
|
||||
$sel.find('option').selected(false);
|
||||
}
|
||||
this.selected = select;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// helper fn for console logging
|
||||
function log() {
|
||||
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(msg);
|
||||
}
|
||||
else if (window.opera && window.opera.postError) {
|
||||
window.opera.postError(msg);
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
213
design/atomic/js/jquery.idealforms2.js
Normal file
213
design/atomic/js/jquery.idealforms2.js
Normal file
@@ -0,0 +1,213 @@
|
||||
/* ----------------------------------------
|
||||
|
||||
* Ideal Forms 1.02
|
||||
* Copyright 2011, Cedric Ruiz
|
||||
* Free to use under the GPL license.
|
||||
* http://www.spacirdesigns.com
|
||||
|
||||
-----------------------------------------*/
|
||||
|
||||
/* ---------------------------------------
|
||||
Set min-width
|
||||
----------------------------------------*/
|
||||
var setMinWidth = function (el) {
|
||||
var minWidth = 0;
|
||||
el
|
||||
.each(function () {
|
||||
var width = $(this).width();
|
||||
if (width > minWidth) {
|
||||
minWidth = width;
|
||||
}
|
||||
})
|
||||
.width(minWidth);
|
||||
};
|
||||
|
||||
/* ---------------------------------------
|
||||
Start plugin
|
||||
----------------------------------------*/
|
||||
(function ($) {
|
||||
|
||||
$.fn.idealforms = function () {
|
||||
this.each(function () {
|
||||
|
||||
var $idealform,
|
||||
$labels,
|
||||
$selects,
|
||||
$radios,
|
||||
$checks;
|
||||
|
||||
$idealform = $(this);
|
||||
$idealform.addClass('idealform');
|
||||
|
||||
/* ---------------------------------------
|
||||
Label
|
||||
----------------------------------------*/
|
||||
|
||||
$labels = $idealform.find('div').children('label').addClass('main-label');
|
||||
$labels.filter('.required').prepend('<span>*</span>');
|
||||
setMinWidth($labels);
|
||||
|
||||
/* ---------------------------------------
|
||||
Select
|
||||
----------------------------------------*/
|
||||
|
||||
$selects = $idealform.find('select');
|
||||
|
||||
var Idealselect = function (select) {
|
||||
|
||||
var that = this;
|
||||
|
||||
// Build markup
|
||||
that.build = function () {
|
||||
var $options,
|
||||
$selected,
|
||||
_options = '',
|
||||
output;
|
||||
$options = select.find('option');
|
||||
$selected = $options.filter(':selected');
|
||||
$options.each(function () {
|
||||
_options += '<li><a href="#">' + $(this).text() + '</a></li>';
|
||||
});
|
||||
output =
|
||||
'<ul class="idealselect">' +
|
||||
'<li>' +
|
||||
'<a href="#" class="idealselect-title">' + $selected.text() + '<span><small></small></span></a>' +
|
||||
'<ul>' + _options + '</ul>' +
|
||||
'</li>' +
|
||||
'</ul>';
|
||||
return output;
|
||||
};
|
||||
|
||||
that.el = $(that.build()); // Wrap in jquery object
|
||||
that.title = that.el.find('.idealselect-title');
|
||||
that.menu = that.el.find('ul');
|
||||
that.items = that.menu.find('a');
|
||||
|
||||
// Events
|
||||
that.events = {
|
||||
open : function () {
|
||||
that.el.addClass('open');
|
||||
that.menu.show();
|
||||
},
|
||||
close : function () {
|
||||
that.el.removeClass('open');
|
||||
that.menu.scrollTop(0);
|
||||
that.menu.hide();
|
||||
},
|
||||
change : function () {
|
||||
var idx = $(this).parent().index();
|
||||
that.title.text($(this).text()).append('<span><small></small></span>');
|
||||
select.find('option').eq(idx).attr('selected', 'selected');
|
||||
select.trigger('change');
|
||||
that.events.close();
|
||||
}
|
||||
};
|
||||
|
||||
// Initializate
|
||||
that.init = function () {
|
||||
|
||||
// Calculate width & height and insert idealselect
|
||||
var $idealselect = that.el.insertAfter(select),
|
||||
$items = $idealselect.find('ul a'),
|
||||
$menu = $idealselect.find('ul'),
|
||||
setWidth = function () {
|
||||
|
||||
if($menu.outerWidth() < 7) {
|
||||
$menu.width(218);
|
||||
$idealselect.width(220);
|
||||
} else{
|
||||
$menu.width($menu.outerWidth());
|
||||
$idealselect.width($menu.outerWidth());
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
if ($items.length > 15) {
|
||||
setWidth();
|
||||
$menu.height($items.outerHeight() * 15);
|
||||
} else {
|
||||
setWidth();
|
||||
$menu.css('overflow-y', 'hidden');
|
||||
}
|
||||
|
||||
that.menu.hide();
|
||||
|
||||
// Bind events
|
||||
that.el.find('a').click(function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// that.el.on('mouseleave', that.events.close);
|
||||
//that.title.on('click', that.events.open);
|
||||
|
||||
|
||||
|
||||
that.title.on('click2', that.events.open);
|
||||
that.title.on('click3', that.events.close);
|
||||
that.title.click(function(){
|
||||
//alert(that.el.attr('class'));
|
||||
if(that.el.hasClass('open')){
|
||||
that.title.trigger('click3');
|
||||
} else {
|
||||
that.title.trigger('click2');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// чтобы закрыть селект при щелчке вне его
|
||||
$(document).click(function(event) {
|
||||
if ($(event.target).closest('.idealselect').length) return;
|
||||
that.title.trigger('click3');
|
||||
// event.stopPropagation();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// that.menu.on('mouseleave', that.events.close);
|
||||
that.items.on('click', that.events.change);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// Create & Insert all idealselects
|
||||
$selects.each(function () {
|
||||
var idealselect = new Idealselect($(this));
|
||||
idealselect.init();
|
||||
});
|
||||
|
||||
/* ---------------------------------------
|
||||
Radio & Check
|
||||
----------------------------------------*/
|
||||
|
||||
$radios = $idealform.find(':radio');
|
||||
$checks = $idealform.find(':checkbox');
|
||||
|
||||
// Radio
|
||||
$radios.each(function () {
|
||||
$(this)
|
||||
.after('<span class="radio"></span>')
|
||||
.parents('ul').addClass('idealradio');
|
||||
if ($(this).is(':checked')) {
|
||||
$(this).next('span').addClass('checked');
|
||||
}
|
||||
}).change(function () {
|
||||
$(this).parents('ul').find('span').removeClass('checked');
|
||||
$(this).next('span').addClass('checked');
|
||||
});
|
||||
|
||||
// Check
|
||||
$checks.each(function () {
|
||||
$(this)
|
||||
.after('<span class="check"></span>')
|
||||
.parents('ul').addClass('idealcheck');
|
||||
if ($(this).is(':checked')) {
|
||||
$(this).next('span').addClass('checked');
|
||||
}
|
||||
}).change(function () {
|
||||
$(this).next('span').toggleClass('checked');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
4
design/atomic/js/jquery.jcarousel.min.js
vendored
Normal file
4
design/atomic/js/jquery.jcarousel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44
design/atomic/js/jquery.liHarmonica.js
Normal file
44
design/atomic/js/jquery.liHarmonica.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* jQuery liHarmonica v 1.0
|
||||
*
|
||||
* Copyright 2013, Linnik Yura | LI MASS CODE | http://masscode.ru
|
||||
* http://masscode.ru
|
||||
* Free to use
|
||||
*
|
||||
* 04.01.2013
|
||||
*/
|
||||
(function($){
|
||||
$.fn.liHarmonica = function(params){
|
||||
var p = $.extend({
|
||||
currentClass:'cur', //Класс для выделенного пункта меню
|
||||
onlyOne:true, //true - открытым может быть только один пункт,
|
||||
//false - число открытых одновременно пунктов не ограничено
|
||||
speed:500 //Скорость анимации
|
||||
}, params);
|
||||
return this.each(function(){
|
||||
var
|
||||
el = $(this).addClass('harmonica'),
|
||||
linkItem = $('ul',el).prev('a');
|
||||
el.children(':last').addClass('last');
|
||||
$('ul',el).each(function(){
|
||||
$(this).children(':last').addClass('last');
|
||||
});
|
||||
$('ul',el).prev('a').addClass('harFull');
|
||||
el.find('.'+p.currentClass).parents('ul').show().prev('a').addClass(p.currentClass).addClass('harOpen');
|
||||
linkItem.on('click',function(){
|
||||
if($(this).next('ul').is(':hidden')){
|
||||
$(this).addClass('harOpen');
|
||||
}else{
|
||||
$(this).removeClass('harOpen');
|
||||
}
|
||||
if(p.onlyOne){
|
||||
$(this).closest('ul').closest('ul').find('ul').not($(this).next('ul')).slideUp(p.speed).prev('a').removeClass('harOpen');
|
||||
$(this).next('ul').slideToggle(p.speed);
|
||||
}else{
|
||||
$(this).next('ul').stop(true).slideToggle(p.speed);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
63
design/atomic/js/peel.js
Normal file
63
design/atomic/js/peel.js
Normal file
@@ -0,0 +1,63 @@
|
||||
var jaaspeel = new Object();
|
||||
|
||||
jaaspeel.ad_url = escape('http://www.atomicgarage.1gb.ru');
|
||||
|
||||
jaaspeel.small_path = '/design/sport01/images/small.swf';
|
||||
jaaspeel.small_image = escape('/design/sport01/images/small.jpg');
|
||||
jaaspeel.small_width = '100';
|
||||
jaaspeel.small_height = '100';
|
||||
jaaspeel.small_params = 'ico=' + jaaspeel.small_image;
|
||||
|
||||
jaaspeel.big_path = '/design/sport01/images/large.swf';
|
||||
jaaspeel.big_image = escape('/design/sport01/images/large.jpg');
|
||||
jaaspeel.big_width = '650';
|
||||
jaaspeel.big_height = '650';
|
||||
jaaspeel.big_params = 'big=' + jaaspeel.big_image + '&ad_url=' + jaaspeel.ad_url;
|
||||
|
||||
function sizeup987(){
|
||||
document.getElementById('jcornerBig').style.top = '0px';
|
||||
document.getElementById('jcornerSmall').style.top = '-1000px';
|
||||
}
|
||||
|
||||
function sizedown987(){
|
||||
document.getElementById("jcornerSmall").style.top = "0px";
|
||||
document.getElementById("jcornerBig").style.top = "-1000px";
|
||||
}
|
||||
|
||||
jaaspeel.putObjects = function () {
|
||||
// <jcornerSmall>
|
||||
document.write('<div id="jcornerSmall" style="position:absolute;width:'+ jaaspeel.small_width +'px;height:'+ jaaspeel.small_height +'px;z-index:9999;right:0px;top:0px;">');
|
||||
// object
|
||||
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"');
|
||||
document.write(' id="jcornerSmallObject" width="'+jaaspeel.small_width+'" height="'+jaaspeel.small_height+'">');
|
||||
// object params
|
||||
document.write(' <param name="allowScriptAccess" value="always"/> ');
|
||||
document.write(' <param name="movie" value="'+ jaaspeel.small_path +'?'+ jaaspeel.small_params +'"/>');
|
||||
document.write(' <param name="wmode" value="transparent" />');
|
||||
document.write(' <param name="quality" value="high" /> ');
|
||||
document.write(' <param name="FlashVars" value="'+jaaspeel.small_params+'"/>');
|
||||
// embed
|
||||
document.write('<embed src="'+ jaaspeel.small_path + '?' + jaaspeel.small_params +'" name="jcornerSmallObject" wmode="transparent" quality="high" width="'+ jaaspeel.small_width +'" height="'+ jaaspeel.small_height +'" flashvars="'+ jaaspeel.small_params +'" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
|
||||
document.write('</object></div>');
|
||||
document.write('</script>');
|
||||
// </jcornerSmall>
|
||||
// <jcornerBig>
|
||||
document.write('<div id="jcornerBig" style="position:absolute;width:'+ jaaspeel.big_width +'px;height:'+ jaaspeel.big_height +'px;z-index:9999;right:0px;top:0px;">');
|
||||
// object
|
||||
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"');
|
||||
document.write(' id="jcornerBigObject" width="'+ jaaspeel.big_width +'" height="'+ jaaspeel.big_height +'">');
|
||||
// object params
|
||||
document.write(' <param name="allowScriptAccess" value="always"/> ');
|
||||
document.write(' <param name="movie" value="'+ jaaspeel.big_path +'?'+ jaaspeel.big_params +'"/>');
|
||||
document.write(' <param name="wmode" value="transparent"/>');
|
||||
document.write(' <param name="quality" value="high" /> ');
|
||||
document.write(' <param name="FlashVars" value="'+ jaaspeel.big_params +'"/>');
|
||||
// embed
|
||||
document.write('<embed src="'+ jaaspeel.big_path + '?' + jaaspeel.big_params +'" id="jcornerBigEmbed" name="jcornerBigObject" wmode="transparent" quality="high" width="'+ jaaspeel.big_width +'" height="'+ jaaspeel.big_height +'" flashvars="'+ jaaspeel.big_params +'" swliveconnect="true" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
|
||||
document.write('</object></div>');
|
||||
// </jcornerBig>
|
||||
setTimeout('document.getElementById("jcornerBig").style.top = "-1000px";',1000);
|
||||
}
|
||||
jaaspeel.putObjects();
|
||||
951
design/atomic/js/popover.js
Normal file
951
design/atomic/js/popover.js
Normal file
File diff suppressed because one or more lines are too long
80
design/atomic/js/project.js
Normal file
80
design/atomic/js/project.js
Normal file
@@ -0,0 +1,80 @@
|
||||
// Звёздный рейтинг товаров
|
||||
$.fn.rater = function (options) {
|
||||
var opts = $.extend({}, $.fn.rater.defaults, options);
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var $on = $this.find('.rater-starsOn');
|
||||
var $off = $this.find('.rater-starsOff');
|
||||
opts.size = $on.height();
|
||||
if (opts.rating == undefined) opts.rating = $on.width() / opts.size;
|
||||
if (opts.id == undefined) opts.id = $this.attr('id');
|
||||
|
||||
$off.mousemove(function (e) {
|
||||
var left = e.clientX - $off.offset().left;
|
||||
var width = $off.width() - ($off.width() - left);
|
||||
width = Math.ceil(width / (opts.size / opts.step)) * opts.size / opts.step;
|
||||
$on.width(width);
|
||||
}).hover(function (e) { $on.addClass('rater-starsHover'); }, function (e) {
|
||||
$on.removeClass('rater-starsHover'); $on.width(opts.rating * opts.size);
|
||||
}).click(function (e) {
|
||||
var r = Math.round($on.width() / $off.width() * (opts.units * opts.step)) / opts.step;
|
||||
$off.unbind('click').unbind('mousemove').unbind('mouseenter').unbind('mouseleave');
|
||||
$off.css('cursor', 'default'); $on.css('cursor', 'default');
|
||||
$.fn.rater.rate($this, opts, r);
|
||||
}).css('cursor', 'pointer'); $on.css('cursor', 'pointer');
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.rater.defaults = {
|
||||
postHref: location.href,
|
||||
units: 5,
|
||||
step: 1
|
||||
};
|
||||
|
||||
$.fn.rater.rate = function ($this, opts, rating) {
|
||||
var $on = $this.find('.rater-starsOn');
|
||||
var $off = $this.find('.rater-starsOff');
|
||||
$off.fadeTo(600, 0.4, function () {
|
||||
$.ajax({
|
||||
url: opts.postHref,
|
||||
type: "POST",
|
||||
data: 'id=' + opts.id + '&rating=' + rating,
|
||||
complete: function (req) {
|
||||
if (req.status == 200) { //success
|
||||
opts.rating = parseFloat(req.responseText);
|
||||
|
||||
if (opts.rating > 0) {
|
||||
opts.rating = parseFloat(req.responseText);
|
||||
$off.fadeTo(200, 0.1, function () {
|
||||
$on.removeClass('rater-starsHover').width(opts.rating * opts.size);
|
||||
var $count = $this.find('.rater-rateCount');
|
||||
$count.text(parseInt($count.text()) + 1);
|
||||
$this.find('.rater-rating').text(opts.rating.toFixed(1));
|
||||
$off.fadeTo(200, 1);
|
||||
});
|
||||
//alert('Спасибо! Ваш голос учтен.');
|
||||
}
|
||||
else
|
||||
if (opts.rating == -1) {
|
||||
$off.fadeTo(200, 0.6, function () {
|
||||
$this.find('.test-text').text('Вы уже голосовали!');
|
||||
});
|
||||
//alert('Вы уже голосовали за данный товар!');
|
||||
}
|
||||
else {
|
||||
$off.fadeTo(200, 0.6, function () {
|
||||
$this.find('.test-text').text('Вы уже голосовали!');
|
||||
});
|
||||
//alert('Вы уже голосовали за данный товар!');
|
||||
}
|
||||
} else { //failure
|
||||
alert(req.responseText);
|
||||
$on.removeClass('rater-starsHover').width(opts.rating * opts.size);
|
||||
$this.rater(opts);
|
||||
$off.fadeTo(2200, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// end
|
||||
62
design/atomic/js/shopcart-view.js
Normal file
62
design/atomic/js/shopcart-view.js
Normal file
@@ -0,0 +1,62 @@
|
||||
//(function($) {
|
||||
// // корзина каталога, переключение видов
|
||||
// function topCart(update) {
|
||||
// var notempty = $('#top-shopcart').hasClass('notempty'); // пустая ли корзина
|
||||
// if ((update == 0 && (notempty)) || update == 1) //если корзина не пустая (при загрузке и скроллинге страницы) или по событию добавления товара
|
||||
// {
|
||||
// if ($(window).scrollTop() > 120) { //если скроллинг страницы более 120px (высота корзины "в шапке")
|
||||
// $('#top-shopcart').addClass('always-on-top'); // вкл. корзину
|
||||
// } else { //если скроллинг страницы менее 120px
|
||||
// $('#top-shopcart').removeClass('always-on-top'); // откл. корзину
|
||||
// }
|
||||
// }
|
||||
// if ($('body').hasClass('mobile') && !$('body').hasClass('tablet')) { //если мобильный телефон но не планшет
|
||||
// $('#top-shopcart').addClass('always-on-top'); // обратно вкл. корзину
|
||||
// $('body').css('margin-top', '50px'); // отодвигаем тело документа на 75px (высота корзины "всегда на виду")
|
||||
// }
|
||||
// }
|
||||
// $(document).ready(function() {
|
||||
// topCart(0);
|
||||
// });
|
||||
// $(window).scroll(function() {
|
||||
// topCart(0);
|
||||
// });
|
||||
// $(document).on("update.shopcart", function() {
|
||||
// topCart(1);
|
||||
// });
|
||||
//})(jQuery);
|
||||
|
||||
(function($) {
|
||||
// корзина каталога, переключение видов
|
||||
function topCart(updateCart) {
|
||||
|
||||
var topShopcart = $('#top-shopcart'), // корзина
|
||||
alwaysOnTopClass = 'always-on-top', // класс для корзины "всегда на виду"
|
||||
howScrollToEnable = 120, // прокрутка до включения корзины "всегда на виду"
|
||||
alwaysOnTopHeight = topShopcart.outerHeight(true), // высота корзины "всегда на виду"
|
||||
notEmptyCart = topShopcart.hasClass('notempty'), // пустая ли корзина?
|
||||
whatsHappening = (updateCart) ? 'updateCart' : 'windowScrollOrDocumentReady', // что происходит?
|
||||
doAction = ((whatsHappening == 'windowScrollOrDocumentReady' && notEmptyCart) || whatsHappening == 'updateCart'), // выполнять?
|
||||
scrollDown = ($(window).scrollTop() > howScrollToEnable), // прокрутка страницы больше прокрутки до включения
|
||||
mobilePhone = ($('body').hasClass('mobile') && !$('body').hasClass('tablet')); // мобильный телефон?
|
||||
if (doAction)
|
||||
{
|
||||
(scrollDown) ? topShopcart.addClass(alwaysOnTopClass) : topShopcart.removeClass(alwaysOnTopClass);
|
||||
}
|
||||
|
||||
if (mobilePhone)
|
||||
{
|
||||
topShopcart.addClass(alwaysOnTopClass);
|
||||
$('body').css('margin-top', alwaysOnTopHeight + 'px');
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
topCart(false);
|
||||
});
|
||||
$(window).scroll(function() {
|
||||
topCart(false);
|
||||
});
|
||||
$(document).on("update.shopcart", function() {
|
||||
topCart(true);
|
||||
});
|
||||
})(jQuery);
|
||||
396
design/atomic/js/slides.js
Normal file
396
design/atomic/js/slides.js
Normal file
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
* Slides, A Slideshow Plugin for jQuery
|
||||
* Intructions: http://slidesjs.com
|
||||
* By: Nathan Searles, http://nathansearles.com
|
||||
* Version: 1.1.2
|
||||
* Updated: February 14th, 2011
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.slides = function(option) {
|
||||
option = $.extend({}, $.fn.slides.option, option);
|
||||
return this.each(function() {
|
||||
$('.' + option.container, $(this)).children().wrapAll('<div class="slides_control"/>');
|
||||
var elem = $(this),
|
||||
control = $('.slides_control', elem),
|
||||
total = control.children().size(),
|
||||
width = control.children().outerWidth(),
|
||||
height = control.children().outerHeight(),
|
||||
start = option.start - 1,
|
||||
effect = option.effect.indexOf(',') < 0 ? option.effect : option.effect.replace(' ', '').split(',')[0],
|
||||
paginationEffect = option.effect.indexOf(',') < 0 ? effect : option.effect.replace(' ', '').split(',')[1],
|
||||
next = 0,
|
||||
prev = 0,
|
||||
number = 0,
|
||||
current = 0,
|
||||
loaded, active, clicked, position, direction, imageParent;
|
||||
if (total < 2) {
|
||||
return;
|
||||
}
|
||||
if (start < 0) {
|
||||
start = 0;
|
||||
};
|
||||
if (start > total) {
|
||||
start = total - 1;
|
||||
};
|
||||
if (option.start) {
|
||||
current = start;
|
||||
};
|
||||
if (option.randomize) {
|
||||
control.randomize();
|
||||
}
|
||||
$('.' + option.container, elem).css({
|
||||
overflow: 'hidden',
|
||||
position: 'relative'
|
||||
});
|
||||
control.children().css({
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: control.children().outerWidth(),
|
||||
zIndex: 0,
|
||||
display: 'none'
|
||||
});
|
||||
control.css({
|
||||
position: 'relative',
|
||||
width: (width * 3),
|
||||
height: height,
|
||||
left: -width
|
||||
});
|
||||
$('.' + option.container, elem).css({
|
||||
display: 'block'
|
||||
});
|
||||
if (option.autoHeight) {
|
||||
control.children().css({
|
||||
height: 'auto'
|
||||
});
|
||||
control.animate({
|
||||
height: control.children(':eq(' + start + ')').outerHeight()
|
||||
}, option.autoHeightSpeed);
|
||||
}
|
||||
if (option.preload && control.find('img').length) {
|
||||
$('.' + option.container, elem).css({
|
||||
background: 'url(' + option.preloadImage + ') no-repeat 50% 50%'
|
||||
});
|
||||
var img = control.find('img:eq(' + start + ')').attr('src') + '?' + (new Date()).getTime();
|
||||
if ($('img', elem).parent().attr('class') != 'slides_control') {
|
||||
imageParent = control.children(':eq(0)')[0].tagName.toLowerCase();
|
||||
} else {
|
||||
imageParent = control.find('img:eq(' + start + ')');
|
||||
}
|
||||
control.find('img:eq(' + start + ')').attr('src', img).load(function() {
|
||||
control.find(imageParent + ':eq(' + start + ')').fadeIn(option.fadeSpeed, function() {
|
||||
$(this).css({
|
||||
zIndex: 5
|
||||
});
|
||||
elem.css({
|
||||
background: ''
|
||||
});
|
||||
loaded = true;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
control.children(':eq(' + start + ')').fadeIn(option.fadeSpeed, function() {
|
||||
loaded = true;
|
||||
});
|
||||
}
|
||||
if (option.bigTarget) {
|
||||
control.children().css({
|
||||
cursor: 'pointer'
|
||||
});
|
||||
control.children().click(function() {
|
||||
animate('next', effect);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
if (option.hoverPause && option.play) {
|
||||
control.children().bind('mouseover', function() {
|
||||
stop();
|
||||
});
|
||||
control.children().bind('mouseleave', function() {
|
||||
pause();
|
||||
});
|
||||
}
|
||||
if (option.generateNextPrev) {
|
||||
$('.' + option.container, elem).after('<a href="#" class="' + option.prev + '">Prev</a>');
|
||||
$('.' + option.prev, elem).after('<a href="#" class="' + option.next + '">Next</a>');
|
||||
}
|
||||
$('.' + option.next, elem).click(function(e) {
|
||||
e.preventDefault();
|
||||
if (option.play) {
|
||||
pause();
|
||||
};
|
||||
animate('next', effect);
|
||||
});
|
||||
$('.' + option.prev, elem).click(function(e) {
|
||||
e.preventDefault();
|
||||
if (option.play) {
|
||||
pause();
|
||||
};
|
||||
animate('prev', effect);
|
||||
});
|
||||
if (option.generatePagination) {
|
||||
elem.append('<ul class=' + option.paginationClass + '></ul>');
|
||||
control.children().each(function() {
|
||||
$('.' + option.paginationClass, elem).append('<li><a href="#' + number + '">' + (number + 1) + '</a></li>');
|
||||
number++;
|
||||
});
|
||||
} else {
|
||||
$('.' + option.paginationClass + ' li a', elem).each(function() {
|
||||
$(this).attr('href', '#' + number);
|
||||
number++;
|
||||
});
|
||||
}
|
||||
$('.' + option.paginationClass + ' li:eq(' + start + ')', elem).addClass('active');
|
||||
$('.' + option.paginationClass + ' li a', elem).click(function() {
|
||||
if (option.play) {
|
||||
pause();
|
||||
};
|
||||
clicked = $(this).attr('href').match('[^#/]+$');
|
||||
if (current != clicked) {
|
||||
animate('pagination', paginationEffect, clicked);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('a.link', elem).click(function() {
|
||||
if (option.play) {
|
||||
pause();
|
||||
};
|
||||
clicked = $(this).attr('href').match('[^#/]+$') - 1;
|
||||
if (current != clicked) {
|
||||
animate('pagination', paginationEffect, clicked);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (option.play) {
|
||||
playInterval = setInterval(function() {
|
||||
animate('next', effect);
|
||||
}, option.play);
|
||||
elem.data('interval', playInterval);
|
||||
};
|
||||
|
||||
function stop() {
|
||||
clearInterval(elem.data('interval'));
|
||||
};
|
||||
|
||||
function pause() {
|
||||
if (option.pause) {
|
||||
clearTimeout(elem.data('pause'));
|
||||
clearInterval(elem.data('interval'));
|
||||
pauseTimeout = setTimeout(function() {
|
||||
clearTimeout(elem.data('pause'));
|
||||
playInterval = setInterval(function() {
|
||||
animate("next", effect);
|
||||
}, option.play);
|
||||
elem.data('interval', playInterval);
|
||||
}, option.pause);
|
||||
elem.data('pause', pauseTimeout);
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
};
|
||||
|
||||
function animate(direction, effect, clicked) {
|
||||
if (!active && loaded) {
|
||||
active = true;
|
||||
switch (direction) {
|
||||
case 'next':
|
||||
prev = current;
|
||||
next = current + 1;
|
||||
next = total === next ? 0 : next;
|
||||
position = width * 2;
|
||||
direction = -width * 2;
|
||||
current = next;
|
||||
break;
|
||||
case 'prev':
|
||||
prev = current;
|
||||
next = current - 1;
|
||||
next = next === -1 ? total - 1 : next;
|
||||
position = 0;
|
||||
direction = 0;
|
||||
current = next;
|
||||
break;
|
||||
case 'pagination':
|
||||
next = parseInt(clicked, 10);
|
||||
prev = $('.' + option.paginationClass + ' li.active a', elem).attr('href').match('[^#/]+$');
|
||||
if (next > prev) {
|
||||
position = width * 2;
|
||||
direction = -width * 2;
|
||||
} else {
|
||||
position = 0;
|
||||
direction = 0;
|
||||
}
|
||||
current = next;
|
||||
break;
|
||||
}
|
||||
if (effect === 'fade') {
|
||||
option.animationStart();
|
||||
if (option.crossfade) {
|
||||
control.children(':eq(' + next + ')', elem).css({
|
||||
zIndex: 10
|
||||
}).fadeIn(option.fadeSpeed, function() {
|
||||
if (option.autoHeight) {
|
||||
control.animate({
|
||||
height: control.children(':eq(' + next + ')', elem).outerHeight()
|
||||
}, option.autoHeightSpeed, function() {
|
||||
control.children(':eq(' + prev + ')', elem).css({
|
||||
display: 'none',
|
||||
zIndex: 0
|
||||
});
|
||||
control.children(':eq(' + next + ')', elem).css({
|
||||
zIndex: 0
|
||||
});
|
||||
option.animationComplete(next + 1);
|
||||
active = false;
|
||||
});
|
||||
} else {
|
||||
control.children(':eq(' + prev + ')', elem).css({
|
||||
display: 'none',
|
||||
zIndex: 0
|
||||
});
|
||||
control.children(':eq(' + next + ')', elem).css({
|
||||
zIndex: 0
|
||||
});
|
||||
option.animationComplete(next + 1);
|
||||
active = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
option.animationStart();
|
||||
control.children(':eq(' + prev + ')', elem).fadeOut(option.fadeSpeed, function() {
|
||||
if (option.autoHeight) {
|
||||
control.animate({
|
||||
height: control.children(':eq(' + next + ')', elem).outerHeight()
|
||||
}, option.autoHeightSpeed, function() {
|
||||
control.children(':eq(' + next + ')', elem).fadeIn(option.fadeSpeed);
|
||||
});
|
||||
} else {
|
||||
control.children(':eq(' + next + ')', elem).fadeIn(option.fadeSpeed, function() {
|
||||
if ($.browser.msie) {
|
||||
$(this).get(0).style.removeAttribute('filter');
|
||||
}
|
||||
});
|
||||
}
|
||||
option.animationComplete(next + 1);
|
||||
active = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
control.children(':eq(' + next + ')').css({
|
||||
left: position,
|
||||
display: 'block'
|
||||
});
|
||||
if (option.autoHeight) {
|
||||
option.animationStart();
|
||||
control.animate({
|
||||
left: direction,
|
||||
height: control.children(':eq(' + next + ')').outerHeight()
|
||||
}, option.slideSpeed, function() {
|
||||
control.css({
|
||||
left: -width
|
||||
});
|
||||
control.children(':eq(' + next + ')').css({
|
||||
left: width,
|
||||
zIndex: 5
|
||||
});
|
||||
control.children(':eq(' + prev + ')').css({
|
||||
left: width,
|
||||
display: 'none',
|
||||
zIndex: 0
|
||||
});
|
||||
option.animationComplete(next + 1);
|
||||
active = false;
|
||||
});
|
||||
} else {
|
||||
option.animationStart();
|
||||
control.animate({
|
||||
left: direction
|
||||
}, option.slideSpeed, function() {
|
||||
control.css({
|
||||
left: -width
|
||||
});
|
||||
control.children(':eq(' + next + ')').css({
|
||||
left: width,
|
||||
zIndex: 5
|
||||
});
|
||||
control.children(':eq(' + prev + ')').css({
|
||||
left: width,
|
||||
display: 'none',
|
||||
zIndex: 0
|
||||
});
|
||||
option.animationComplete(next + 1);
|
||||
active = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
if (option.pagination) {
|
||||
$('.' + option.paginationClass + ' li.active', elem).removeClass('active');
|
||||
$('.' + option.paginationClass + ' li:eq(' + next + ')', elem).addClass('active');
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
$.fn.slides.option = {
|
||||
preload: false,
|
||||
preloadImage: '../images/loading.gif',
|
||||
container: 'slides_container',
|
||||
generateNextPrev: false,
|
||||
next: 'next',
|
||||
prev: 'prev',
|
||||
pagination: true,
|
||||
generatePagination: true,
|
||||
paginationClass: 'pagination',
|
||||
fadeSpeed: 350,
|
||||
slideSpeed: 350,
|
||||
start: 1,
|
||||
effect: 'slide',
|
||||
crossfade: false,
|
||||
randomize: false,
|
||||
play: 0,
|
||||
pause: 0,
|
||||
hoverPause: false,
|
||||
autoHeight: false,
|
||||
autoHeightSpeed: 350,
|
||||
bigTarget: false,
|
||||
animationStart: function() {},
|
||||
animationComplete: function() {}
|
||||
};
|
||||
$.fn.randomize = function(callback) {
|
||||
function randomizeOrder() {
|
||||
return (Math.round(Math.random()) - 0.5);
|
||||
}
|
||||
return ($(this).each(function() {
|
||||
var $this = $(this);
|
||||
var $children = $this.children();
|
||||
var childCount = $children.length;
|
||||
if (childCount > 1) {
|
||||
$children.hide();
|
||||
var indices = [];
|
||||
for (i = 0; i < childCount; i++) {
|
||||
indices[indices.length] = i;
|
||||
}
|
||||
indices = indices.sort(randomizeOrder);
|
||||
$.each(indices, function(j, k) {
|
||||
var $child = $children.eq(k);
|
||||
var $clone = $child.clone(true);
|
||||
$clone.show().appendTo($this);
|
||||
if (callback !== undefined) {
|
||||
callback($child, $clone);
|
||||
}
|
||||
$child.remove();
|
||||
});
|
||||
}
|
||||
}));
|
||||
};
|
||||
})(jQuery);
|
||||
38
design/atomic/js/slides.min.js
vendored
Normal file
38
design/atomic/js/slides.min.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Slides, A Slideshow Plugin for jQuery
|
||||
* Intructions: http://slidesjs.com
|
||||
* By: Nathan Searles, http://nathansearles.com
|
||||
* Version: 1.1.2
|
||||
* Updated: February 14th, 2011
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
(function($){$.fn.slides=function(option){option=$.extend({},$.fn.slides.option,option);return this.each(function(){$('.'+option.container,$(this)).children().wrapAll('<div class="slides_control"/>');var elem=$(this),control=$('.slides_control',elem),total=control.children().size(),width=control.children().outerWidth(),height=control.children().outerHeight(),start=option.start-1,effect=option.effect.indexOf(',')<0?option.effect:option.effect.replace(' ','').split(',')[0],paginationEffect=option.effect.indexOf(',')<0?effect:option.effect.replace(' ','').split(',')[1],next=0,prev=0,number=0,current=0,loaded,active,clicked,position,direction,imageParent;if(total<2){return;}
|
||||
if(start<0){start=0;};if(start>total){start=total-1;};if(option.start){current=start;};if(option.randomize){control.randomize();}
|
||||
$('.'+option.container,elem).css({overflow:'hidden',position:'relative'});control.children().css({position:'absolute',top:0,left:control.children().outerWidth(),zIndex:0,display:'none'});control.css({position:'relative',width:(width*3),height:height,left:-width});$('.'+option.container,elem).css({display:'block'});if(option.autoHeight){control.children().css({height:'auto'});control.animate({height:control.children(':eq('+start+')').outerHeight()},option.autoHeightSpeed);}
|
||||
if(option.preload&&control.find('img').length){$('.'+option.container,elem).css({background:'url('+option.preloadImage+') no-repeat 50% 50%'});var img=control.find('img:eq('+start+')').attr('src')+'?'+(new Date()).getTime();if($('img',elem).parent().attr('class')!='slides_control'){imageParent=control.children(':eq(0)')[0].tagName.toLowerCase();}else{imageParent=control.find('img:eq('+start+')');}
|
||||
control.find('img:eq('+start+')').attr('src',img).load(function(){control.find(imageParent+':eq('+start+')').fadeIn(option.fadeSpeed,function(){$(this).css({zIndex:5});elem.css({background:''});loaded=true;});});}else{control.children(':eq('+start+')').fadeIn(option.fadeSpeed,function(){loaded=true;});}
|
||||
if(option.bigTarget){control.children().css({cursor:'pointer'});control.children().click(function(){animate('next',effect);return false;});}
|
||||
if(option.hoverPause&&option.play){control.children().bind('mouseover',function(){stop();});control.children().bind('mouseleave',function(){pause();});}
|
||||
if(option.generateNextPrev){$('.'+option.container,elem).after('<a href="#" class="'+option.prev+'">Prev</a>');$('.'+option.prev,elem).after('<a href="#" class="'+option.next+'">Next</a>');}
|
||||
$('.'+option.next,elem).click(function(e){e.preventDefault();if(option.play){pause();};animate('next',effect);});$('.'+option.prev,elem).click(function(e){e.preventDefault();if(option.play){pause();};animate('prev',effect);});if(option.generatePagination){elem.append('<ul class='+option.paginationClass+'></ul>');control.children().each(function(){$('.'+option.paginationClass,elem).append('<li><a href="#'+number+'">'+(number+1)+'</a></li>');number++;});}else{$('.'+option.paginationClass+' li a',elem).each(function(){$(this).attr('href','#'+number);number++;});}
|
||||
$('.'+option.paginationClass+' li:eq('+start+')',elem).addClass('active');$('.'+option.paginationClass+' li a',elem).click(function(){if(option.play){pause();};clicked=$(this).attr('href').match('[^#/]+$');if(current!=clicked){animate('pagination',paginationEffect,clicked);}
|
||||
return false;});$('a.link',elem).click(function(){if(option.play){pause();};clicked=$(this).attr('href').match('[^#/]+$')-1;if(current!=clicked){animate('pagination',paginationEffect,clicked);}
|
||||
return false;});if(option.play){playInterval=setInterval(function(){animate('next',effect);},option.play);elem.data('interval',playInterval);};function stop(){clearInterval(elem.data('interval'));};function pause(){if(option.pause){clearTimeout(elem.data('pause'));clearInterval(elem.data('interval'));pauseTimeout=setTimeout(function(){clearTimeout(elem.data('pause'));playInterval=setInterval(function(){animate("next",effect);},option.play);elem.data('interval',playInterval);},option.pause);elem.data('pause',pauseTimeout);}else{stop();}};function animate(direction,effect,clicked){if(!active&&loaded){active=true;switch(direction){case'next':prev=current;next=current+1;next=total===next?0:next;position=width*2;direction=-width*2;current=next;break;case'prev':prev=current;next=current-1;next=next===-1?total-1:next;position=0;direction=0;current=next;break;case'pagination':next=parseInt(clicked,10);prev=$('.'+option.paginationClass+' li.active a',elem).attr('href').match('[^#/]+$');if(next>prev){position=width*2;direction=-width*2;}else{position=0;direction=0;}
|
||||
current=next;break;}
|
||||
if(effect==='fade'){option.animationStart();if(option.crossfade){control.children(':eq('+next+')',elem).css({zIndex:10}).fadeIn(option.fadeSpeed,function(){if(option.autoHeight){control.animate({height:control.children(':eq('+next+')',elem).outerHeight()},option.autoHeightSpeed,function(){control.children(':eq('+prev+')',elem).css({display:'none',zIndex:0});control.children(':eq('+next+')',elem).css({zIndex:0});option.animationComplete(next+1);active=false;});}else{control.children(':eq('+prev+')',elem).css({display:'none',zIndex:0});control.children(':eq('+next+')',elem).css({zIndex:0});option.animationComplete(next+1);active=false;}});}else{option.animationStart();control.children(':eq('+prev+')',elem).fadeOut(option.fadeSpeed,function(){if(option.autoHeight){control.animate({height:control.children(':eq('+next+')',elem).outerHeight()},option.autoHeightSpeed,function(){control.children(':eq('+next+')',elem).fadeIn(option.fadeSpeed);});}else{control.children(':eq('+next+')',elem).fadeIn(option.fadeSpeed,function(){if($.browser.msie){$(this).get(0).style.removeAttribute('filter');}});}
|
||||
option.animationComplete(next+1);active=false;});}}else{control.children(':eq('+next+')').css({left:position,display:'block'});if(option.autoHeight){option.animationStart();control.animate({left:direction,height:control.children(':eq('+next+')').outerHeight()},option.slideSpeed,function(){control.css({left:-width});control.children(':eq('+next+')').css({left:width,zIndex:5});control.children(':eq('+prev+')').css({left:width,display:'none',zIndex:0});option.animationComplete(next+1);active=false;});}else{option.animationStart();control.animate({left:direction},option.slideSpeed,function(){control.css({left:-width});control.children(':eq('+next+')').css({left:width,zIndex:5});control.children(':eq('+prev+')').css({left:width,display:'none',zIndex:0});option.animationComplete(next+1);active=false;});}}
|
||||
if(option.pagination){$('.'+option.paginationClass+' li.active',elem).removeClass('active');$('.'+option.paginationClass+' li:eq('+next+')',elem).addClass('active');}}};});};$.fn.slides.option={preload:false,preloadImage:'/img/loading.gif',container:'slides_container',generateNextPrev:false,next:'next',prev:'prev',pagination:true,generatePagination:true,paginationClass:'pagination',fadeSpeed:350,slideSpeed:350,start:1,effect:'slide',crossfade:false,randomize:false,play:0,pause:0,hoverPause:false,autoHeight:false,autoHeightSpeed:350,bigTarget:false,animationStart:function(){},animationComplete:function(){}};$.fn.randomize=function(callback){function randomizeOrder(){return(Math.round(Math.random())-0.5);}
|
||||
return($(this).each(function(){var $this=$(this);var $children=$this.children();var childCount=$children.length;if(childCount>1){$children.hide();var indices=[];for(i=0;i<childCount;i++){indices[indices.length]=i;}
|
||||
indices=indices.sort(randomizeOrder);$.each(indices,function(j,k){var $child=$children.eq(k);var $clone=$child.clone(true);$clone.show().appendTo($this);if(callback!==undefined){callback($child,$clone);}
|
||||
$child.remove();});}}));};})(jQuery);
|
||||
7
design/atomic/js/sm.slider/jquery.smslider.min.js
vendored
Normal file
7
design/atomic/js/sm.slider/jquery.smslider.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* smSlider 0.1
|
||||
* http://sashamochalin.github.io/smSlider/
|
||||
*
|
||||
* Copyright © 2013 Sasha Mochalin
|
||||
*/
|
||||
(function(a){a.fn.smSlider=function(b){var c={start:0,transition:"animate",activeClass:"activ",autoArr:true,innerBlock:"sm_slider-inner",prev:"sm_prev",next:"sm_next",children:"sm_slide",pagination:true,typeCtrl:"dots",subMenu:false,subMenuClass:"sm_submenu-item",autoPlay:false,delay:5000,hoverPause:true,easing:"swing",duration:600,flexible:false,animationStart:function(){},animationComplete:function(){}};var b=a.extend(c,b);return this.each(function(){var m=true;var q=function(y,x){if(m){m=false;var v=h;var w=-1*v;if(x=="next"){currPos=w;nextPos=v}else{currPos=v;nextPos=w}if(b.transition!="fader"){d.children("."+b.children+"."+b.activeClass).stop().animate({left:currPos},{duration:b.duration,easing:b.easing,complete:function(){a(this).removeClass(b.activeClass);if(b.animationComplete){b.animationComplete(y)}}});n.eq(y).css("left",nextPos).addClass(b.activeClass).stop().animate({left:0},{duration:b.duration,easing:b.easing,complete:function(){m=true}})}else{d.children("."+b.children+"."+b.activeClass).stop().fadeOut({duration:b.duration,easing:b.easing,complete:function(){a(this).removeClass(b.activeClass);if(b.animationComplete){b.animationComplete(y)}}});n.eq(y).stop().fadeIn({duration:b.duration,easing:b.easing,complete:function(){m=true}}).addClass(b.activeClass)}if(b.animationStart){b.animationStart(y)}if(b.pagination){t.removeClass(b.activeClass);t.eq(y).addClass(b.activeClass)}if(b.subMenu){r.removeClass(b.activeClass);r.eq(y).addClass(b.activeClass)}}else{return false}};var g=a(this);var h=g.width();var j=g.height();if(b.flexible){a(window).resize(function(){h=g.width()})}var d=g.children("ul").addClass(b.innerBlock);d.css({height:j,overflow:"hidden",position:"relative",width:"100%"});var n=d.children("li").addClass(b.children);var f=n.length;if(b.start>f-1){var o=f-1}else{var o=b.start}n.appendTo(d);n.eq(o).addClass(b.activeClass);if(f>1){var s=a("<i/>");if(b.autoArr){var u=s.clone().addClass(b.prev);var e=s.clone().addClass(b.next);u.appendTo(g);e.appendTo(g)}else{var u=a("."+b.prev);var e=a("."+b.next)}if(b.pagination){var l=a("<ul/>").addClass("sm_nav");var t=a("<li/>");l.appendTo(g);if(b.typeCtrl!="numeric"){for(i=0;i<f;i++){t.clone().data({index:i}).addClass("sm_nav-item").html(s.clone()).appendTo(l)}}else{for(i=0;i<f;i++){t.clone().data({index:i}).addClass("sm_nav-item").text(i+1).appendTo(l)}}var t=g.find(".sm_nav-item");t.eq(o).addClass(b.activeClass)}if(b.subMenu){var r=a("."+b.subMenuClass);r.eq(o).addClass(b.activeClass)}}if(b.autoPlay&&(f>1)){var p=null;var k=function(){o++;if(o>=f){o=0}q(o,"next")};p=setInterval(k,b.delay);if(b.hoverPause){a(this).hover(function(){p=clearInterval(p)},function(){p=setInterval(k,b.delay)})}}if(f>1){u.bind("click",function(){if(m){o--;if(o<0){o=f-1}q(o,"prev")}});e.bind("click",function(){if(m){o++;if(o>=f){o=0}q(o,"next")}});if(b.pagination){t.on("click",function(){if(m){navIndex=a(this).data("index");if(navIndex>o){direction="next"}else{direction="prev"}if(a(this).data("index")!=o){o=navIndex;q(o,direction)}}})}if(b.subMenu){r.bind("click",function(){if(m){subIndex=a(this).data("index");if(subIndex>o){direction="next"}else{direction="prev"}if((subIndex!=o)&&(subIndex<=(f-1))){o=subIndex;q(o,direction)}}})}}})}})(jQuery);
|
||||
BIN
design/atomic/js/sm.slider/sm_arr.png
Normal file
BIN
design/atomic/js/sm.slider/sm_arr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
111
design/atomic/js/sm.slider/smslider.css
Normal file
111
design/atomic/js/sm.slider/smslider.css
Normal file
@@ -0,0 +1,111 @@
|
||||
.sm_slide {
|
||||
color: #3d3d3d;
|
||||
display: none;
|
||||
font-size: 100px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sm_slide.activ {
|
||||
display: block;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.sm_slide img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.sm_prev, .sm_next {
|
||||
background: url(sm_arr.png) no-repeat;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-style: normal;
|
||||
height: 64px;
|
||||
margin: -31px 0 0 0;
|
||||
opacity: .3;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 60px;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.sm_prev {
|
||||
background-position: 20px -50px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.sm_next {
|
||||
background-position: -40px -50px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.sm_prev:hover {
|
||||
background-position: 20px 14px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sm_next:hover {
|
||||
background-position: -40px 14px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sm_nav {
|
||||
bottom: 0px;
|
||||
clear: both;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding: 5px 0px;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.sm_nav-item {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 14px;
|
||||
padding: 4px;
|
||||
width: 14px;
|
||||
z-index: 999;
|
||||
list-style-type: none;
|
||||
font-size: 11px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.sm_nav-item i {
|
||||
display: block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
left: 4px;
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
-ms-border-radius: 6px;
|
||||
-o-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
background-color: #7f7f7f;
|
||||
}
|
||||
|
||||
.sm_nav-item.active, .sm_nav-item.active:hover {
|
||||
cursor: default;
|
||||
color: #7e7e7e;
|
||||
}
|
||||
|
||||
.sm_nav-item.active i{
|
||||
background-color: #bfbfbf;
|
||||
}
|
||||
|
||||
.sm_nav-item:hover i {
|
||||
background: #7f7f7f;
|
||||
}
|
||||
|
||||
.sm_nav-item.active:hover i{
|
||||
background-color: #bfbfbf;
|
||||
}
|
||||
15
design/atomic/js/tabs.js
Normal file
15
design/atomic/js/tabs.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// JavaScript Document
|
||||
(function($) {
|
||||
$(function() {
|
||||
|
||||
$('ul.tabs').each(function() {
|
||||
$(this).find('li').each(function(i) {
|
||||
$(this).click(function(){
|
||||
$(this).addClass('current').siblings().removeClass('current')
|
||||
.parents('div.section').find('div.box').hide().end().find('div.box:eq('+i+')').fadeIn(150);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
})(jQuery)
|
||||
Reference in New Issue
Block a user