"+c+""),b.nav.createEvents(),a.reload()},a.removeSlide=function(a){b.$el.children(":nth-child("+(a+1||0)+")").remove(),b.vars.allSlidesWidth=getCurrentTotalWidth(b.$el)},a.getActiveIndex=function(){return b.vars.currentIndex},a.getCurrentPos=function(){return a.translate3d().x},a.getIndexByPosition=function(a){return b.anim.getLandingSlideIndex(-a)}}}},{}],4:[function(a){(function(b){"use strict";b.isExplorer=!!document.documentMode,a("./polyfills");var c=a("./carousel"),d=a("./external_funcs"),e={duration:350,swipe_sensitivity:150,disable_slide:!1,disable_clicktoslide:!1,disable_scroll:!1,start:0,one_item:!1,pan_threshold:.3,disable_autowidth:!1,parent_width:!1,swipe_out:!1,left_sided:!1,infinite:!1};$.fn.itemslide=function(a){var b=$.extend(!0,{},c);d.apply(this,b),b.create($.extend(e,a),this)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./carousel":2,"./external_funcs":3,"./polyfills":7}],5:[function(a,b){b.exports={add:function(a,b,c,d){var e=0,f=4;d.mousewheel(function(g){if(!c.get_vertical_pan()){var h=g.deltaFactor>=100||g.deltaFactor%1==0;if(!h&&(e++,e==f))return void(e=0);g.preventDefault();var i=a.vars.currentIndex-((0==g.deltaX?g.deltaY:g.deltaX)>0?1:-1);if(i>=d.children("li").length||0>i)return;a.vars.velocity=0,b.gotoSlideByIndex(i)}})}}},{}],6:[function(a,b){function c(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}function d(a){return null==$.fn.jquery?a.changedTouches[0]:a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]}var e=function(a,b){function e(a){if("true"!==$(a.target).attr("no-drag")&&h.end_animation){var b;b="touchstart"==a.type?d(a):a,l=Date.now(),m=1,n=0,o=b.pageX,p=b.pageY,s=!1,q=!1,h.savedSlide=$(this),h.savedSlideIndex=h.savedSlide.index(),r=0,$(window).on("mousemove touchmove",function(a){f(a)}),c()}}function f(a){var c;if("touchmove"==a.type?(c=d(a),Math.abs(c.pageX-o)>10&&(n=1),n&&a.preventDefault()):(c=a,i.disable_slide||i.swipe_out||a.preventDefault()),j.direction=-(c.pageX-o)>0?1:-1,b.isOutBoundaries()?u&&(t=c.pageX,u=0):(u||(b.currentLandPos=h.translate3d().x,o=c.pageX),u=1),1==r&&(h.children().css("height",j.slideHeight),h.savedSlide.wrapAll(""),r=-1),Math.abs(c.pageX-o)>6&&(!s&&h.end_animation&&(q=!0),window.cancelAnimationFrame(b.slidesGlobalID)),Math.abs(c.pageY-p)>6&&!q&&h.end_animation&&(s=!0),q){if(i.disable_slide)return;i.left_sided&&(b.currentLandPos=clamp(-(j.allSlidesWidth-h.parent().width()),0,b.currentLandPos)),s=!1,h.translate3d((0==u?t-o+(c.pageX-t)/4:c.pageX-o)+b.currentLandPos),h.trigger("changePos"),h.trigger("pan")}else s&&i.swipe_out&&(a.preventDefault(),$(".itemslide_slideoutwrap").translate3d(0,c.pageY-p),-1!=r&&(r=1))}function g(a){if(m){m=!1;var c;if(c="touchend"==a.type?d(a):a,$(window).off("mousemove touchmove"),s&&i.swipe_out)return s=!1,void k();if(h.end_animation&&!i.disable_slide){var e=Date.now()-l;e++,j.velocity=-(c.pageX-o)/e,j.direction=j.velocity>0?1:-1,j.distanceFromStart=(c.pageX-o)*j.direction*-1;var f=b.getLandingSlideIndex(j.velocity*i.swipe_sensitivity-h.translate3d().x);if(j.distanceFromStart>6)return void b.gotoSlideByIndex(f)}h.trigger({type:"clickSlide",slide:h.savedSlideIndex}),h.savedSlideIndex==j.currentIndex||i.disable_clicktoslide||(a.preventDefault(),b.gotoSlideByIndex(h.savedSlideIndex))}}var h=a.$el,i=a.options,j=a.vars,k=a.swipeOut;this.createEvents=function(){h.children().on("mousedown touchstart",function(a){e.call(this,a)}),$(window).on("mouseup touchend",function(a){g(a)})},this.createEvents();var l,m,n,o,p,q,r,s=!1;this.get_vertical_pan=function(){return s};var t,u};b.exports=e},{}],7:[function(){"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),$.fn.outerWidth||($.fn.outerWidth=function(){if($(this)[0]instanceof Element){var a=$(this)[0],b=a.offsetWidth,c=getComputedStyle(a);return b+=parseInt(c.marginLeft)+parseInt(c.marginRight)}})},{}],8:[function(a,b){function c(a){function b(){if(p=Date.now()-i,o)$(".itemslide_slideoutwrap").translate3d(0,j-easeOutBack(p,0,j-h,250,0)),e.savedSlide.css("opacity",m-easeOutBack(p,0,m,250,0)*(n?-1:1));else{if(n)return $(".itemslide_slideoutwrap").children().unwrap(),$(s).children().unwrap(),e.children().css("height",""),e.end_animation=!0,void(p=0);$(s).translate3d(0-easeOutBack(p-250,0,0+e.savedSlide.width(),125,0)*(r?-1:1),0)}return 1==q&&($(".itemslide_slideoutwrap").children().unwrap(),e.savedSlideIndex==g.currentIndex&&$(s).children(":nth-child(1)").addClass("itemslide-active"),e.savedSlideIndex!=e.children().length-1||r||e.savedSlideIndex!=g.currentIndex||(f.duration=200,a.anim.gotoSlideByIndex(e.children().length-2)),0==e.savedSlideIndex&&0!=g.currentIndex&&(p=500),q=-1),p>=250&&(o=!1,-1!=q&&(q=1),p>=375)?($(s).children().unwrap(),e.removeSlide(c.index()),(0==e.savedSlideIndex&&0!=g.currentIndex||r)&&a.anim.gotoSlideByIndex(g.currentIndex-1,!0),f.duration=l,p=0,void(e.end_animation=!0)):void(k=requestAnimationFrame(b))}var c,d,e=a.$el,f=a.options,g=a.vars,h=-400,i=Date.now(),j=0,k=0,l=0,m=0;e.end_animation=!0,e.savedSlideIndex=0;var n=!1;a.swipeOut=function(){j=$(".itemslide_slideoutwrap").translate3d().y,d=0>j,h=d?-400:400,Math.abs(0-j)<50?(n=!0,h=0):(n=!1,e.trigger({type:"swipeout",slide:e.savedSlideIndex})),q=0,l=f.duration,c=e.savedSlide,i=Date.now(),m=e.savedSlide.css("opacity"),e.savedSlideIndex")):(r=!1,e.children(":nth-child(n+"+(e.savedSlideIndex+2)+")").wrapAll("")),o=!0,e.end_animation=!1,k=requestAnimationFrame(b)};var o=!0,p=0,q=0,r=!1,s=".itemslide_move"}b.exports={slideout:c}},{}]},{},[4]);
/*css
//==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>==>>>
//
// PicSlider v4.0
// Copyright (c) phpkobo.com ( http://jpn.phpkobo.com/ )
// Email : admin@phpkobo.com
// ID : PICSLD-400J
//
//==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<==<<<
*/
//-- [polyfill] trim
if (!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
};
}
//-- [polyfill] JSON
if (!window.JSON) {
window.JSON = {
parse: function(sJSON) { return eval('(' + sJSON + ')'); },
stringify: (function () {
var toString = Object.prototype.toString;
var isArray = Array.isArray || function (a) { return toString.call(a) === '[object Array]'; };
var escMap = {'"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t'};
var escFunc = function (m) { return escMap[m] || '\\u' + (m.charCodeAt(0) + 0x10000).toString(16).substr(1); };
var escRE = /[\\"\u0000-\u001F\u2028\u2029]/g;
return function stringify(value) {
if (value == null) {
return 'null';
} else if (typeof value === 'number') {
return isFinite(value) ? value.toString() : 'null';
} else if (typeof value === 'boolean') {
return value.toString();
} else if (typeof value === 'object') {
if (typeof value.toJSON === 'function') {
return stringify(value.toJSON());
} else if (isArray(value)) {
var res = '[';
for (var i = 0; i < value.length; i++) {
res += (i ? ', ' : '') + stringify(value[i]);
}
return res + ']';
} else if (toString.call(value) === '[object Object]') {
var tmp = [];
for (var k in value) {
if (value.hasOwnProperty(k)) {
tmp.push(stringify(k) + ': ' + stringify(value[k]));
}
}
return '{' + tmp.join(', ') + '}';
}
}
return '"' + value.toString().replace(escRE, escFunc) + '"';
};
})()
};
}
function printError( msg ) {
console.log( msg );
};
function hsc( s ) {
return $("").text(s).html();
};
function ajaxSend( requ, obj, func ) {
$.ajax({
url:appcfg.url_server,
data:"requ="+encodeURIComponent(JSON.stringify(requ)),
dataType:"jsonp",
success:function(resp){
func.call(obj,resp);
},
error:function( jqXHR, textStatus, errorThrown ){
var s = "[$.ajax.error]\n";
s += jqXHR.responseText+"\n";
s += textStatus+"\n";
s += errorThrown;
printError( s );
}
});
};
function CPicSlider( opt ) {
for( var key in opt ) { this[key] = opt[key]; }
if ( this.jqo_ctar.length ) {
this.setup();
}
};
CPicSlider.prototype = {
setup :function() {
var _this = this;
this.rs = null;
//-- show info
if ( appcfg.info ) {
console.log("INFO","[jQuery version]",$.fn.jquery);
}
//-- init
},
printHtml : function( html, state ) {
var _this = this;
//-- render html
this.jqo_ctar.html(html);
//-- jqo_keep
var jqo_slider = this.jqo_ctar.find("ul");
var jqo_keep = this.jqo_ctar.find(".psd-keep");
jqo_keep.html(jqo_slider.html());
//-- init parameters for renda
var jqo = this.jqo_ctar.find(".psd-ctar");
var max_hit = parseInt(jqo.attr("data-max-hit"));
var click_interval = parseInt(jqo.attr("data-click-interval"));
var hitmsg = jqo.attr("data-hitmsg");
//-- setup and trim hitmsg array
var hmx = [];
hitmsg = hitmsg.trim();
if ( hitmsg ) {
hmx = hitmsg.split(",");
for( var i=0; i").attr("class","psd-hitmsg")
jqo_slider.find("li").click(function(e){
if ( cnt >= max_hit ) {
return;
}
//-- cancel fadeout
jqo_hitmsg.stop(true,false);
//-- find the index of clicked image
var idx = $(this).index();
//-- is this image the same as the last-clicked image?
if ( idx == idx_prev ) {
cnt++;
} else {
idx_prev = idx;
cnt = 1;
}
//console.log(idx + ":" + cnt);
//-- get anchor div
var jqo_anchor = $(this).find(".psd-anchor");
//-- calc hit position in psd-anchor
var anchor_xy = jqo_anchor.offset();
var xy = {
top : e.pageY - anchor_xy.top,
left : e.pageX - anchor_xy.left
};
//-- setup hitmsg div
jqo_hitmsg
.css({
display:"block",
width:"auto",
"max-width":"auto",
"white-space":"nowrap",
"word-wrap":"break-word",
visibility:"hidden",
top:xy.top+"px",
left:xy.left+"px"
})
if (( cnt <= hitmsg_len ) && ( hmx[cnt-1] )) {
jqo_hitmsg.html(hmx[cnt-1]);
jqo_anchor.html(jqo_hitmsg);
//-- center hitmsg div horizontally
var w_anc = jqo_anchor.width();
var w_hit = jqo_hitmsg.outerWidth(true);
var left = 0;
if ( w_hit >= w_anc ) {
jqo_hitmsg.css({
width:w_anc+"px",
"max-width":w_anc+"px",
"word-break":"break-all",
"white-space":"normal"
});
} else {
if ( xy.left+w_hit/2 < w_anc ) {
left = parseInt(xy.left-w_hit/2);
} else {
left = w_anc - w_hit;
}
if ( left < 0 ) { left = 0; }
}
jqo_hitmsg.css({
left:left+"px"
});
//-- center hitmsg div vertically
var h_anc = jqo_anchor.height();
var h_hit = jqo_hitmsg.outerHeight(true);
var top = 0;
if ( h_hit < h_anc ) {
if ( xy.top+h_hit/2 < h_anc ) {
top = parseInt(xy.top-h_hit/2);
} else {
top = h_anc - h_hit;
}
if ( top < 0 ) { top = 0; }
}
jqo_hitmsg.css({
top:top+"px"
});
//-- display hitmsg
jqo_hitmsg.css({
opacity:1,
display:"block",
visibility:"visible"
});
}
//-- does max_hit reach?
if ( cnt == max_hit ) {
jqo_slider.find("li").eq(idx).fadeOut(500,function(){
jqo_slider.removeSlide(idx);
idx_prev = -1;
cnt = 0;
jqo_slider.reload();
onRemove();
});
} else {
jqo_hitmsg.animate({
opacity:0
},click_interval,function(){
idx_prev = -1;
cnt = 0;
});
}
});
}
//-- restore when all are swiped out
jqo_slider.on('swipeout', function(event) {
onRemove();
});
};
run_slider();
}
};
var instance_class = CPicSlider;
var style_id_prefix = "picslider-style-id-";
//-----------------------------------------------------------
// CApp
//-----------------------------------------------------------
var CApp = {
initApp : function() {
var _this = this;
this.wid = 0;
this.imap = {};
$(document).ready(function(){
_this.setup();
});
},
setup : function() {
var _this = this;
this.cnt = 0;
$("."+appcfg.cls_selector).each(function(){
_this.setupInstance($(this));
});
if ( this.cnt == 0 ) {
return;
}
var iids = [];
for( iid in this.imap ) {
iids.push(iid);
}
if ( iids.length ) {
var requ = {
"cmd":"init",
"iids":iids
};
ajaxSend(requ,_this,function(resp){
if ( resp.result == "OK" ) {
this.draw(resp);
this.setup();
} else {
var s = "[non-OK] " + resp.result;
printError( s );
}
});
}
},
setupInstance : function( jqo ) {
if ( parseInt(jqo.attr("data-wid")) ) {
return;
}
this.wid++;
var wid = this.wid;
jqo.attr("data-wid",wid);
var iid = jqo.attr("data-iid");
if ( !iid ) { return; }
var iobj = new instance_class({
jqo_ctar:jqo,
wid:wid,
iid:iid
});
this.addIMap(iid,iobj);
this.cnt++;
},
addIMap : function( iid, iobj ) {
if (!( iid in this.imap )) {
this.imap[iid] = [];
}
this.imap[iid].push(iobj);
},
insertCss : function( iid, txt ) {
var id = style_id_prefix + iid;
if ( $("#"+id).length == 0 ) {
var style = document.createElement("style");
style.type = "text/css";
style.id = id;
if (style.styleSheet){
style.styleSheet.cssText = txt;
} else {
style.appendChild(document.createTextNode(txt));
}
document.getElementsByTagName("head")[0].appendChild(style);
}
},
draw : function( resp ) {
for( iid in resp.cssx ) {
this.insertCss(iid,resp.cssx[iid]);
}
for( iid in this.imap ) {
var ls = this.imap[iid];
for( var i=0; i