Commit 43c06167 authored by 神楽坂玲奈's avatar 神楽坂玲奈

deck builder mesiade

parent 888cd8e8
locale = 'zh'
class Card extends Spine.Model
@type = [
'Warrior',
'Spellcaster',
'Fairy',
'Fiend',
'Zombie',
'Machine',
'Aqua',
'Pyro',
'Rock',
'Winged_Beast',
'Plant',
'Insect',
'Thunder',
'Dragon',
'Beast',
'Beast-Warrior',
'Dinosaur',
'Fish',
'Sea_Serpent',
'Reptile',
'Psychic',
'Divine-Beast',
'Creator_God'
]
@configure "Card", "atk", "name"
@extend Spine.Model.Ajax
@extend Spine.Events
......@@ -25,12 +50,17 @@ class CardUsage extends Spine.Model
@belongsTo 'card', Card
class Deck extends Spine.Controller
events: "mouseenter .card": "show"
constructor: ->
super
CardUsage.bind("refresh change", @render)
render: =>
@html $("#card_template").tmpl(CardUsage.all())
show: (e) ->
card = $(e.target).tmplItem().data.card()
$("#card_image").attr 'src', "https://raw.github.com/zh99998/ygopro-images/master/#{card.id}.jpg"
$("#card_name").html card.name
decode = (str)->
key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789*-="
result = 0
......@@ -39,21 +69,22 @@ decode = (str)->
result += key.indexOf(char)
result
$('img#qrcode').attr('src', 'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=' + encodeURIComponent(location.href))
$('#name').html($.url().param('name'))
name = $.url().param('name')
cards_encoded = $.url().param('cards')
$('img#qrcode').attr('src', 'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=' + encodeURIComponent("http://my-card.in/decks/inline?name=#{name}&cards=#{cards_encoded}"))
$('#name').html(name)
$(document).ready ->
deck = []
cards_id = []
for i in [0...cards_encoded.length] by 5
decoded = decode(cards_encoded.substr(i, 5))
side = decoded >> 29
count = decoded >> 27 & 0x3
id = decoded & 0x07FFFFFF
cards_id.push id
deck.push {card_id: id, count: count, side: side}
deck = []
cards_id = []
for i in [0...cards_encoded.length] by 5
decoded = decode(cards_encoded.substr(i, 5))
side = decoded >> 29
count = decoded >> 27 & 0x3
id = decoded & 0x07FFFFFF
cards_id.push id
deck.push {card_id: id, count: count, side: side}
$('#cards').append($('<dt />', {text: id}))
$('#cards').append($('<dd />', {text: count}))
a = new Deck(el: $("#deck"))
Card.query {_id: { $in: cards_id}}, =>
CardUsage.refresh deck
\ No newline at end of file
a = new Deck(el: $("#deck"))
Card.query {_id: { $in: cards_id}}, =>
CardUsage.refresh deck
\ No newline at end of file
// Generated by CoffeeScript 1.4.0
(function() {
var Card, CardUsage, Deck, a, cards_encoded, cards_id, count, deck, decode, decoded, i, id, locale, side, _i, _ref,
var Card, CardUsage, Deck, cards_encoded, decode, locale, name,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
_this = this;
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
locale = 'zh';
......@@ -92,6 +91,10 @@
__extends(Deck, _super);
Deck.prototype.events = {
"mouseenter .card": "show"
};
function Deck() {
this.render = __bind(this.render, this);
Deck.__super__.constructor.apply(this, arguments);
......@@ -102,6 +105,13 @@
return this.html($("#card_template").tmpl(CardUsage.all()));
};
Deck.prototype.show = function(e) {
var card;
card = $(e.target).tmplItem().data.card();
$("#card_image").attr('src', "https://raw.github.com/zh99998/ygopro-images/master/" + card.id + ".jpg");
return $("#card_name").html(card.name);
};
return Deck;
})(Spine.Controller);
......@@ -118,45 +128,41 @@
return result;
};
$('img#qrcode').attr('src', 'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=' + encodeURIComponent(location.href));
$('#name').html($.url().param('name'));
name = $.url().param('name');
cards_encoded = $.url().param('cards');
deck = [];
cards_id = [];
for (i = _i = 0, _ref = cards_encoded.length; _i < _ref; i = _i += 5) {
decoded = decode(cards_encoded.substr(i, 5));
side = decoded >> 29;
count = decoded >> 27 & 0x3;
id = decoded & 0x07FFFFFF;
cards_id.push(id);
deck.push({
card_id: id,
count: count,
side: side
});
$('#cards').append($('<dt />', {
text: id
}));
$('#cards').append($('<dd />', {
text: count
}));
}
a = new Deck({
el: $("#deck")
});
Card.query({
_id: {
$in: cards_id
$('img#qrcode').attr('src', 'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=' + encodeURIComponent("http://my-card.in/decks/inline?name=" + name + "&cards=" + cards_encoded));
$('#name').html(name);
$(document).ready(function() {
var a, cards_id, count, deck, decoded, i, id, side, _i, _ref,
_this = this;
deck = [];
cards_id = [];
for (i = _i = 0, _ref = cards_encoded.length; _i < _ref; i = _i += 5) {
decoded = decode(cards_encoded.substr(i, 5));
side = decoded >> 29;
count = decoded >> 27 & 0x3;
id = decoded & 0x07FFFFFF;
cards_id.push(id);
deck.push({
card_id: id,
count: count,
side: side
});
}
}, function() {
return CardUsage.refresh(deck);
a = new Deck({
el: $("#deck")
});
return Card.query({
_id: {
$in: cards_id
}
}, function() {
return CardUsage.refresh(deck);
});
});
}).call(this);
// JavaScript Document
$(function() {
$(".advanced_search").toggle(
function () {
$(".submenu").show();
$(this).attr('class','advanced_search_expansion advanced_search');
},
function () {
$(".submenu").hide();
$(this).attr('class','advanced_search');
}
);
$(".main_area table thead tr th").live( 'mouseover', function(e){
$(this).find('.arrow').show();
});
$(".main_area table thead tr th").live('mouseout', function(e) {
$(this).find('.arrow').hide();
});
// $(".arrow").live('click', function(e) {
// $(this).next().show();
// });
$(".bottom_area div").click(function() {
$(this).addClass("bottom_button_active").removeClass("bottom_button");
$(this).siblings().addClass("bottom_button").removeClass("bottom_button_active");
var $dangqian = $(".card_frame .frame_element").eq($(".bottom_area div").index(this));
$dangqian.addClass("card_frame_focus");
$dangqian.siblings().removeClass("card_frame_focus");
});
});
function showMe(thisObj,id){
var objDiv=document.getElementById(id)
objDiv.style.display=(objDiv.style.display=="none")?'':"none"
document.onclick=function(e){
var o = o || window.event || e;
var obj=o.target || o.srcElement;
if (obj!=objDiv &&obj!=thisObj)objDiv.style.display='none'
}
}
/*主区域*/
body{margin:0;padding:0;background:#eee;}
.floatleft{float:left;} .floatright{float:right;}
.main_div{width:1000px;height:700px;margin:20px auto;border-radius:5px;}
.main_left{width:300px;height:700px;border-radius:5px;}
.main_right{width:700px;height:700px;border-radius:0 5px 5px 0;}
/*左边区域*/
.card_img{margin:10px 0 0 10px;height:auto;width:auto;}
.card_info{width:135px;height:180px;padding:15px 5px 5px 5px;margin:7px 0 0 10px;}
.card_name{width:300px;height:auto;padding:8px 0;margin:0;font-weight:bold;color:#999999;text-shadow:1px 1px 2px #cccccc;font-size:24px;text-align:center;background:#eeeeee;border:1px solid #cccccc;border-radius:5px 0 0 0;margin:0 0 0 -1px;}
.attr_name{width:62px;height:14px;padding:0 0 5px 0;margin:0 0 10px 0;color:#FFAD6E;font-size:12px;text-shadow:1px 1px 2px #eeeeee;text-align:right;border-bottom:1px dashed #cccccc;}
.attr_real{width:65px;height:14px;padding:0 0 5px 0;margin:0 0 10px 0;color:thead_bg#999999;font-size:12px;text-shadow:1px 1px 2px #eeeeee;border-bottom:1px dashed #cccccc;}
.more_info{margin:0;padding:0;height:370px;width:280px;font-size:12px;line-height:16px;letter-spacing:1px;color:#999999;display:none;}
.bottom_button_active{height:auto;width:auto;padding:8px 10px;margin:-1px 0 0 10px; border-left:1px solid #CCCCCC;border-top:1px solid #ffffff;border-right:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC; font-size:12px;border-radius:0 0 5px 5px;background:#ffffff;}
.bottom_button{height:auto;width:auto;padding:8px 10px;margin:-1px 0 0 10px;font-size:12px;border-radius:0 0 5px 5px;cursor:pointer;color:#999999;}
.bottom_button:hover{color:#ffffff;background:#CCCCCC;}
.bottom_area{height:45px;width:300px;margin:0;padding:0;background:#eeeeee;border-radius:0 0 5px 5px;}
.statistics{
margin:0;padding:0;height:370px;width:280px;font-size:12px;line-height:16px;letter-spacing:1px;color:#999999;display:none;
div{
line-height:24px;
label{float:left;color:#333333;}
}
}
.adjustment{margin:0;padding:0;height:370px;width:280px;font-size:12px;line-height:16px;letter-spacing:1px;color:#999999;display:none;}
.card_frame{
border-top:1px solid #cccccc;border-bottom:1px solid #cccccc;padding:10px;margin:15px 0 0 0;width:280px;height:370px;
.card_frame_focus{display:block;}
}
/*右边区域*/
/*搜索*/
.search_data{height:700px;width:518px;margin:0;padding:0;}
.advanced_search{font-size:12px;margin:0;width:48px;height:12px;padding:10px 12px;background:#ffffff;}
.advanced_search:hover{cursor:pointer;}
.advanced_search_father{width:80px;height:36px;overflow:hidden;margin:18px 0 0 0;padding:4px 0 0 4px;}
.submenu_mask{width:72px;height:12px;margin:-3px 0 0 0;background:#ffffff;}
.submenu_main{
width:415px;height:115px;font-size:12px;padding:8px;
label{width:50px;display: block;height:16px;float:left;font-size:14px;color:#666666;}
select{
float:left;margin:-4px 0 0 5px;border:1px solid #dddddd;padding:2px;
&.select_half{width:70px;}
&.select_full{width:145px;}
}
input[type="text"]{border:1px solid #dddddd;padding:1px 3px;}
input[type="button"]{border:1px solid #cccccc;padding:1px 3px;display: inline;float:left;width:45px;height:45px;margin:0 0 0 5px;background: -webkit-linear-gradient(#F2F2F2, #DBDBDB);background: -moz-linear-gradient(#F2F2F2, #DBDBDB);box-shadow:1px 1px 5px #ddd;filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFF2F2F2,endColorstr=#FFDBDBDB)";cursor:pointer;}
}
.submenu_mainLeft{width:200px;height:115px;float:left;margin:0 15px 0 0 ;}
.submenu_mainRight{width:200px;height:115px;float:left;}
.submenu_unit{height:24px;width:200px;padding:1px 0 0 0;margin:0 0 5px 0;float:left;}
.submenu_unitLarge{height:52px;width:149px;padding:1px 0 0 0;margin:0 0 5px 0;float:left;}
.search_results{width:auto;height:auto;margin:10px 0 0 12px;padding:0;font-size:12px;}
.serach_button{background:url(/assets/images/decks/search.png);border:none;width:20px;height:20px;margin:4px 5px 0 0;float:right;cursor:pointer;}
/*表格*/
.main_area{
width:508px;height:518px;margin:20px 0 0 10px;box-shadow:-2px 3px 5px #eeeeee inset;border-bottom:1px solid #eeeeee;position:relative;overflow:hidden;
table{position:absolute;
thead{
tr{
th{
width:96px;font-size:12px;border-width:0 1px 0 0;border-color:#eeeeee;border-style:solid;font-style:normal;color:#666666;text-align:left;
span{float:left;}
.arrow{
margin:0;height:33px;padding:0 0 0 2px;width:13px;display:none;float:right;
&:hover{
border:1px solid #CCCCCCC;background: -webkit-linear-gradient(#F0F0EF, #E8E8E8);background: -moz-linear-gradient(#F0F0EF, #E8E8E8);filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFF0F0EF,endColorstr=#FFE8E8E8)";box-shadow:0 0 2px #ccc;
}
&:active{background: -webkit-linear-gradient(#E8E8E8, #F0F0EF);background: -moz-linear-gradient(#E8E8E8, #F0F0EF);filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFE8E8E8,endColorstr=#FFF0F0EF)";}
img{margin:15px 0 0 0;}
}
}
}
}
tbody{
tr{
border-top:1px dashed #eeeeee;
&:hover{background-color:#F5F5F5;}/*box-shadow:0 0 5px #cccccc inset;*/
td{font-size:12px;color:#999999;padding:12px 5px;}
}
}
}
}
.thead_bg{
margin:2px 0 0 0;padding:0 0 1px 7px;height:33px;line-height:33px;position:relative;width:76px;filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFF3F3F2,endColorstr=#FFFFFFFF)";
&:hover{background: -webkit-linear-gradient(#F3F3F2, #FFFFFF);background: -moz-linear-gradient(#F3F3F2, #FFFFFF);border-bottom:1px solid #eeeeee;padding:0 0 0 7px;}
}
.filter_float{
position:absolute;padding:8px 10px;border:1px solid #cccccc;box-shadow:1px 1px 5px #dddddd;top:35px;left:85px;background:#ffffff;
div{
width:110px;height:28px;line-height:28px;
input{float:left;margin:8px 5px 0 0;}
label{float:left;}
}
}
.page{
max-width:518px;height:60px;padding:20px 15px 0 0;text-align:right;
a{margin:0 4px;}
}
.page_home{background:url('/assets/images/decks/page_arrows.gif') -26px 0 no-repeat;width:23px;height:17px;display:block;float:left;}
.page_pre{background:url('/assets/images/decks/page_arrows.gif') -1px 0 no-repeat;width:13px;height:17px;display:block;float:left;}
.page_next{background:url('/assets/images/decks/page_arrows.gif') -13px 0 no-repeat;width:13px;height:17px;display:block;float:left;}
.page_last{background:url('/assets/images/decks/page_arrows.gif') -47px 0 no-repeat;width:23px;height:17px;display:block;float:left;}
.page_num{
display:block;float:left;height:17px;line-height:17px;width:16px;font-size:14px;color:#999;text-decoration:none;text-align:center;
&:hover{text-decoration:underline;}
}
.card_group{
width:150px;height:565px;
h4{margin:8px 0;}
.jscroll-e{
.jscroll-h{border:none;}
}
}
/*操作区域*/
.operate_area{
width:162px;height:700px;padding:0 0 0 10px;
fieldset{
border:1px solid #cccccc;padding:5px;margin:14px 0 0 0;background:#F9F9F9;border-radius:6px;font-size:12px;color:#666666;height:586px;
legend{font-size:14px;color:#666666;margin:0 0 0 8px;font-size:14px;}
P{
padding:6px 0;
span{
&:hover{text-shadow:1px 1px 5px #999;}
}
i{float:right;padding:0 5px 0 0;color:#FFAD6E;}
}
}
}
.select_card{
width:150px;height:55px;padding:5px;border:1px solid #cccccc;background:#F9F9F9;border-radius:6px;margin:12px 0 0 0;
select{width:100px;float:left;border:1px solid #ccc;padding:1px;}
}
.select_cardOn{float:left;width:150px;height:23px;}
.select_cardUnder{float:left;height:32px;width:150px;}
.add_ope{
float:left;height:17px;padding:3px 0 0 3px;cursor:pointer;margin:-1px 0 0 3px;-moz-transition: all 0.5s ease-in;-webkit-transition: all 0.5s ease-in;
&:hover{height:23px;padding:0;-moz-transition: all 0.5s ease-in-out;-webkit-transition: all 0.5s ease-in-out;}
}
.rename_ope{
float:right;height:17px;cursor:pointer;margin:1px 2px 0 0;-moz-transition: all 0.5s ease-in;-moz-transform: translate(0px) rotate(-180deg);-webkit-transition: all 0.5s ease-in;-webkit-transform: translate(0px) rotate(-180deg);
&:hover{-moz-transition: all 0.5s ease-in-out;-moz-transform: translate(0px) rotate(180deg);-webkit-transition: all 0.5s ease-in-out;-webkit-transform: translate(0px) rotate(180deg);}
}
.donwload_out{float:left;height:25px;width:25px;cursor:pointer;background-image:url(/assets/images/decks/download_out.png);margin:6px 0 0 6px;}
.download_inner{
width:11px;height:18px;background:url(/assets/images/decks/download_inner.png);margin:3px 0 0 7px;
&:hover{-moz-transition: all 0.5s ease-in-out;-webkit-transition: all 0.5s ease-in-out;background-position:0 18px;}
}
.upload_inner{
width:11px;height:18px;background:url(/assets/images/decks/upload_inner.png);margin:3px 0 0 7px;
&:hover{-moz-transition: all 0.5s ease-in-out;-webkit-transition: all 0.5s ease-in-out;background-position:0 -18px;}
}
.upload_ope{float:left;height:25px;padding:5px 0 0 5px;cursor:pointer;}
.save_ope{float:left;height:25px;padding:5px 0 0 6px;cursor:pointer;}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
http://www.rjboy.cn
By sean at 2010.06 - 2011.03
Demo:
$(".container").hScrollPane({
mover:".press", //指定container对象下的哪个元素需要滚动位置 | 必传项;
moverW:function(){return $(".press").width();}(), //传入水平滚动对象的长度值,不传入的话默认直接获取mover的宽度值 | 可选项;
handleMinWidth:300, //指定handle的最小宽度,要固定handle的宽度请在css中设定handle的width属性(如 width:28px!important;),不传入则不设定最小宽度 | 可选项;
showArrow:true, //指定是否显示左右箭头,默认不显示 | 可选项;
dragable:false, //指定是否要支持拖动效果,默认可以拖动 | 可选项;
handleCssAlter:"draghandlealter", //指定拖动鼠标时滚动条的样式,不传入该参数则没有变化效果 | 可选项;
easing:true, //滚动是否需要滑动效果,默认有滑动效果 | 可选项;
mousewheel:{bind:true,moveLength:500} //mousewheel: bind->'true',绑定mousewheel事件; ->'false',不绑定mousewheel事件;moveLength是指定鼠标滚动一次移动的距离,默认值:{bind:true,moveLength:300} | 可选项;
});
*/
(function($){
$.extend(jQuery.easing,{
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
}
});
$.fn.hScrollPane=function(settings){
settings=$.extend(true,{},$.fn.hScrollPane.defaults,settings);
this.each(function(){
var container=$(this),
mover=container.find(settings.mover),
w=container.width(),
c=settings.moverW || mover.width(),
dragbar=(container.find(".hScrollPane_dragbar").length==0 && c>w ) ? container.append('<div class="hScrollPane_dragbar"><div class="hScrollPane_draghandle"></div></div>').find(".hScrollPane_dragbar") : container.find(".hScrollPane_dragbar"),//避免多次初始化时的重复append;
handle=dragbar.find(".hScrollPane_draghandle");
if(settings.showArrow){
container.append('<a href="###" class="hScrollPane_leftarrow"></a><a href="###" class="hScrollPane_rightarrow"></a>');
leftArrow=container.find(".hScrollPane_leftarrow");
rightArrow=container.find(".hScrollPane_rightarrow");
dragbar.css({
width:container.width()-leftArrow.outerWidth()*2,
left:leftArrow.outerWidth()
});
leftArrow.unbind();
rightArrow.unbind();
}else{
dragbar.css("width",container.width());
}
mover.stop().css("left","0px");
container.unbind();//避免多次初始化时的事件重复绑定;
handle.unbind();
dragbar.unbind();
handle.stop().css({
width:(w/c)*w >settings.handleMinWidth ? (w/c)*w : settings.handleMinWidth,
left:0
});
if(c<w){
dragbar.hide();
return false;
}else{
dragbar.show();
}
var maxlen=parseInt(dragbar.width())-parseInt(handle.outerWidth());
dragbar.bind("click",function(e){
var flag=e.pageX>handle.offset().left+handle.outerWidth() ? -1 : 1;
$.fn.hScrollPane.move(settings,mover,handle,w,c,maxlen,flag);
});
handle.bind("mousedown",function(e){
var x=e.pageX;
var hx=parseInt(handle.css("left"));
if(settings.handleCssAlter){$(this).addClass(settings.handleCssAlter);}
$(document).bind("mousemove",function(e){
var left=e.pageX-x+hx<0?0:(e.pageX-x+hx>=maxlen?maxlen:e.pageX-x+hx);
handle.stop().css({left:left});
if(settings.easing){
mover.stop().animate({
left:-left/maxlen*(c-w)
},{duration:1500,easing:'easeOutQuint',queue:false});
}else{
mover.css({left:-left/maxlen*(c-w)});
}
return false;
});
$(document).bind("mouseup",function(){
if(settings.handleCssAlter){handle.removeClass(settings.handleCssAlter);}
$(this).unbind("mousemove");
})
return false;
}).click(function(){
return false;
})
if(settings.dragable){
mover.bind("mousedown",function(e){
var x=e.pageX;
$(this).bind("mousemove",function(e){
$.fn.hScrollPane.move(settings,mover,handle,w,c,maxlen,x,e.pageX);
return false;
})
$(document).bind("mouseup",function(){
mover.unbind("mousemove");
})
})
}
if(settings.mousewheel.bind){
container.bind("mousewheel",function(event, delta){
$.fn.hScrollPane.move(settings,mover,handle,w,c,maxlen,delta);
return false;
});
}
if(settings.showArrow){
leftArrow.click(function(){
$.fn.hScrollPane.move(settings,mover,handle,w,c,maxlen,1);
return false;
}).focus(function(){this.blur();});
rightArrow.click(function(){
$.fn.hScrollPane.move(settings,mover,handle,w,c,maxlen,-1);
return false;
}).focus(function(){this.blur();});
}
this.ondragstart=function(){return false;}
this.onselectstart=function(){return false;}
})
}
$.fn.hScrollPane.defaults = {
showArrow:false,
handleMinWidth:0,
dragable:true,
easing:true,
mousewheel:{bind:true,moveLength:300}
};
$.fn.hScrollPane.move=function(settings,mover,handle,w,c,maxlen,x,nx){
if(arguments.length==7){
var left=parseInt(mover.css("left"))+x*settings.mousewheel.moveLength;
}else{
var left=parseInt(mover.css("left"))+((nx-x)/w)*(c-w);
}
left=left.toFixed(0);
left=left>0?0:left<w-c?w-c:left;
var handle_left=(left/(w-c))*maxlen;
if(settings.easing){
mover.stop().animate({
left:left
},{duration:1500,easing:'easeOutQuint',queue:false});
handle.stop().animate({
left:handle_left
},{duration:1500,easing:'easeOutQuint',queue:false});
}else{
mover.stop().animate({
left:left
},{duration:5,queue:false});
handle.css({left:handle_left});
}
}
})(jQuery);
\ No newline at end of file
/* Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
*
* $LastChangedDate: 2007-12-20 09:02:08 -0600 (Thu, 20 Dec 2007) $
* $Rev: 4265 $
*
* Version: 3.0
*
* Requires: $ 1.2.2+
*/
(function($) {
$.event.special.mousewheel = {
setup: function() {
var handler = $.event.special.mousewheel.handler;
// Fix pageX, pageY, clientX and clientY for mozilla
if ( $.browser.mozilla )
$(this).bind('mousemove.mousewheel', function(event) {
$.data(this, 'mwcursorposdata', {
pageX: event.pageX,
pageY: event.pageY,
clientX: event.clientX,
clientY: event.clientY
});
});
if ( this.addEventListener )
this.addEventListener( ($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
else
this.onmousewheel = handler;
},
teardown: function() {
var handler = $.event.special.mousewheel.handler;
$(this).unbind('mousemove.mousewheel');
if ( this.removeEventListener )
this.removeEventListener( ($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
else
this.onmousewheel = function(){};
$.removeData(this, 'mwcursorposdata');
},
handler: function(event) {
var args = Array.prototype.slice.call( arguments, 1 );
event = $.event.fix(event || window.event);
// Get correct pageX, pageY, clientX and clientY for mozilla
$.extend( event, $.data(this, 'mwcursorposdata') || {} );
var delta = 0, returnValue = true;
if ( event.wheelDelta ) delta = event.wheelDelta/120;
if ( event.detail ) delta = -event.detail/3;
//if ( $.browser.opera ) delta = -event.wheelDelta;
event.data = event.data || {};
event.type = "mousewheel";
// Add delta to the front of the arguments
args.unshift(delta);
// Add event to the front of the arguments
args.unshift(event);
return $.event.handle.apply(this, args);
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
})(jQuery);
\ No newline at end of file
/*
* jQuery Templates Plugin 1.0.0pre
* http://github.com/jquery/jquery-tmpl
* Requires jQuery 1.4.2
*
* Copyright 2011, Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i<j&&!(f=a.data(h[i++],"tmplItem")));if(f&&c)g[2]=function(b){a.tmpl.afterManip(this,b,k)};r.apply(this,g)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var i,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(j(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);i=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(j(c,null,i)):i},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?(a.template[c]=b):b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(h=j.length-1;h>=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery);
\ No newline at end of file
/**
*
* Copyright (c) 2009 Jun(qq100015091)
* http://www.xlabi.com
* http://www.xlabi.com/tp/jscroll.html
* jun5091@gmail.com
*/
/*--------------------------------------------------------------------------------------------------*/
$.fn.extend({//添加滚轮事件//by jun
mousewheel:function(Func){
return this.each(function(){
var _self = this;
_self.D = 0;//滚动方向
if($.browser.msie||$.browser.safari){
_self.onmousewheel=function(){_self.D = event.wheelDelta;event.returnValue = false;Func && Func.call(_self);};
}else{
_self.addEventListener("DOMMouseScroll",function(e){
_self.D = e.detail>0?-1:1;
e.preventDefault();
Func && Func.call(_self);
},false);
}
});
}
});
$.fn.extend({
jscroll:function(j){
return this.each(function(){
j = j || {}
j.Bar = j.Bar||{};//2级对象
j.Btn = j.Btn||{};//2级对象
j.Bar.Bg = j.Bar.Bg||{};//3级对象
j.Bar.Bd = j.Bar.Bd||{};//3级对象
j.Btn.uBg = j.Btn.uBg||{};//3级对象
j.Btn.dBg = j.Btn.dBg||{};//3级对象
var jun = { W:"15px"
,BgUrl:""
,Bg:"#efefef"
,Bar:{ Pos:"up"
,Bd:{Out:"#b5b5b5",Hover:"#ccc"}
,Bg:{Out:"#fff",Hover:"#fff",Focus:"orange"}}
,Btn:{ btn:true
,uBg:{Out:"#ccc",Hover:"#fff",Focus:"orange"}
,dBg:{Out:"#ccc",Hover:"#fff",Focus:"orange"}}
,Fn:function(){}}
j.W = j.W||jun.W;
j.BgUrl = j.BgUrl||jun.BgUrl;
j.Bg = j.Bg||jun.Bg;
j.Bar.Pos = j.Bar.Pos||jun.Bar.Pos;
j.Bar.Bd.Out = j.Bar.Bd.Out||jun.Bar.Bd.Out;
j.Bar.Bd.Hover = j.Bar.Bd.Hover||jun.Bar.Bd.Hover;
j.Bar.Bg.Out = j.Bar.Bg.Out||jun.Bar.Bg.Out;
j.Bar.Bg.Hover = j.Bar.Bg.Hover||jun.Bar.Bg.Hover;
j.Bar.Bg.Focus = j.Bar.Bg.Focus||jun.Bar.Bg.Focus;
j.Btn.btn = j.Btn.btn!=undefined?j.Btn.btn:jun.Btn.btn;
j.Btn.uBg.Out = j.Btn.uBg.Out||jun.Btn.uBg.Out;
j.Btn.uBg.Hover = j.Btn.uBg.Hover||jun.Btn.uBg.Hover;
j.Btn.uBg.Focus = j.Btn.uBg.Focus||jun.Btn.uBg.Focus;
j.Btn.dBg.Out = j.Btn.dBg.Out||jun.Btn.dBg.Out;
j.Btn.dBg.Hover = j.Btn.dBg.Hover||jun.Btn.dBg.Hover;
j.Btn.dBg.Focus = j.Btn.dBg.Focus||jun.Btn.dBg.Focus;
j.Fn = j.Fn||jun.Fn;
var _self = this;
var Stime,Sp=0,Isup=0;
$(_self).css({overflow:"hidden",position:"relative",padding:"0px"});
var dw = $(_self).width(), dh = $(_self).height()-1;
var sw = j.W ? parseInt(j.W) : 21;
var sl = dw - sw
var bw = j.Btn.btn==true ? sw : 0;
if($(_self).children(".jscroll-c").height()==null){//存在性检测
$(_self).wrapInner("<div class='jscroll-c' style='top:0px;z-index:9999;zoom:1;position:relative'></div>");
$(_self).children(".jscroll-c").prepend("<div style='height:0px;overflow:hidden'></div>");
$(_self).append("<div class='jscroll-e' unselectable='on' style=' height:100%;top:0px;right:0;-moz-user-select:none;position:absolute;overflow:hidden;z-index:10000;'><div class='jscroll-u' style='position:absolute;top:0px;width:100%;left:0;background:blue;overflow:hidden'></div><div class='jscroll-h' unselectable='on' style='background:green;position:absolute;left:0;-moz-user-select:none;border:1px solid'></div><div class='jscroll-d' style='position:absolute;bottom:0px;width:100%;left:0;background:blue;overflow:hidden'></div></div>");
}
var jscrollc = $(_self).children(".jscroll-c");
var jscrolle = $(_self).children(".jscroll-e");
var jscrollh = jscrolle.children(".jscroll-h");
var jscrollu = jscrolle.children(".jscroll-u");
var jscrolld = jscrolle.children(".jscroll-d");
if($.browser.msie){document.execCommand("BackgroundImageCache", false, true);}
jscrollc.css({"padding-right":sw});
jscrolle.css({width:sw,background:j.Bg,"background-image":j.BgUrl});
jscrollh.css({top:bw,background:j.Bar.Bg.Out,"background-image":j.BgUrl,"border-color":j.Bar.Bd.Out,width:sw-2});
jscrollu.css({height:bw,background:j.Btn.uBg.Out,"background-image":j.BgUrl});
jscrolld.css({height:bw,background:j.Btn.dBg.Out,"background-image":j.BgUrl});
jscrollh.hover(function(){if(Isup==0)$(this).css({background:j.Bar.Bg.Hover,"background-image":j.BgUrl,"border-color":j.Bar.Bd.Hover})},function(){if(Isup==0)$(this).css({background:j.Bar.Bg.Out,"background-image":j.BgUrl,"border-color":j.Bar.Bd.Out})})
jscrollu.hover(function(){if(Isup==0)$(this).css({background:j.Btn.uBg.Hover,"background-image":j.BgUrl})},function(){if(Isup==0)$(this).css({background:j.Btn.uBg.Out,"background-image":j.BgUrl})})
jscrolld.hover(function(){if(Isup==0)$(this).css({background:j.Btn.dBg.Hover,"background-image":j.BgUrl})},function(){if(Isup==0)$(this).css({background:j.Btn.dBg.Out,"background-image":j.BgUrl})})
var sch = jscrollc.height();
//var sh = Math.pow(dh,2) / sch ;//Math.pow(x,y)x的y次方
var sh = (dh-2*bw)*dh / sch
if(sh<10){sh=10}
var wh = sh/6//滚动时候跳动幅度
// sh = parseInt(sh);
var curT = 0,allowS=false;
jscrollh.height(sh);
if(sch<=dh){jscrollc.css({padding:0});jscrolle.css({display:"none"})}else{allowS=true;}
if(j.Bar.Pos!="up"){
curT=dh-sh-bw;
setT();
}
jscrollh.bind("mousedown",function(e){
j['Fn'] && j['Fn'].call(_self);
Isup=1;
jscrollh.css({background:j.Bar.Bg.Focus,"background-image":j.BgUrl})
var pageY = e.pageY ,t = parseInt($(this).css("top"));
$(document).mousemove(function(e2){
curT =t+ e2.pageY - pageY;//pageY浏览器可视区域鼠标位置,screenY屏幕可视区域鼠标位置
setT();
});
$(document).mouseup(function(){
Isup=0;
jscrollh.css({background:j.Bar.Bg.Out,"background-image":j.BgUrl,"border-color":j.Bar.Bd.Out})
$(document).unbind();
});
return false;
});
jscrollu.bind("mousedown",function(e){
j['Fn'] && j['Fn'].call(_self);
Isup=1;
jscrollu.css({background:j.Btn.uBg.Focus,"background-image":j.BgUrl})
_self.timeSetT("u");
$(document).mouseup(function(){
Isup=0;
jscrollu.css({background:j.Btn.uBg.Out,"background-image":j.BgUrl})
$(document).unbind();
clearTimeout(Stime);
Sp=0;
});
return false;
});
jscrolld.bind("mousedown",function(e){
j['Fn'] && j['Fn'].call(_self);
Isup=1;
jscrolld.css({background:j.Btn.dBg.Focus,"background-image":j.BgUrl})
_self.timeSetT("d");
$(document).mouseup(function(){
Isup=0;
jscrolld.css({background:j.Btn.dBg.Out,"background-image":j.BgUrl})
$(document).unbind();
clearTimeout(Stime);
Sp=0;
});
return false;
});
_self.timeSetT = function(d){
var self=this;
if(d=="u"){curT-=wh;}else{curT+=wh;}
setT();
Sp+=2;
var t =500 - Sp*50;
if(t<=0){t=0};
Stime = setTimeout(function(){self.timeSetT(d);},t);
}
jscrolle.bind("mousedown",function(e){
j['Fn'] && j['Fn'].call(_self);
curT = curT + e.pageY - jscrollh.offset().top - sh/2;
asetT();
return false;
});
function asetT(){
if(curT<bw){curT=bw;}
if(curT>dh-sh-bw){curT=dh-sh-bw;}
jscrollh.stop().animate({top:curT},100);
var scT = -((curT-bw)*sch/(dh-2*bw));
jscrollc.stop().animate({top:scT},1000);
};
function setT(){
if(curT<bw){curT=bw;}
if(curT>dh-sh-bw){curT=dh-sh-bw;}
jscrollh.css({top:curT});
var scT = -((curT-bw)*sch/(dh-2*bw));
jscrollc.css({top:scT});
};
$(_self).mousewheel(function(){
if(allowS!=true) return;
j['Fn'] && j['Fn'].call(_self);
if(this.D>0){curT-=wh;}else{curT+=wh;};
setT();
})
});
}
});
This diff is collapsed.
.line{-moz-box-shadow:0px 1px 4px #cccccc; -webkit-box-shadow:0px 1px 4px #cccccc; box-shadow:0px 1px 4px #cccccc;background:#ffffff;behavior:url('http://localhost/webCard/css/PIE.htc');}
.advanced_search_expansion{border:1px solid #cccccc;box-shadow:2px 2px 5px #cccccc;behavior:url('http://localhost/webCard/css/PIE.htc');}
.search_frame{margin:20px 0 0 10px;width:400px;background:#f5f5f5;height:25px;border:2px solid #ffffff;border-radius:3px;box-shadow:2px 2px 2px #ccc inset,0px 0px 4px #ccc;padding:0 0 0 5px;behavior:url('http://localhost/webCard/css/PIE.htc');}
.submenu{border:1px solid #cccccc;width:432px;height:128px;position:absolute;box-shadow:2px 2px 5px #CCCCCC;margin:52px 0 0 68px;display:none;background:#ffffff;behavior:url('http://localhost/webCard/css/PIE.htc');z-index:1;}
\ No newline at end of file
This diff is collapsed.
/* v1.0 | 20080212 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
.hScrollPane_dragbar,
.hScrollPane_draghandle,
.hScrollPane_leftarrow,.hScrollPane_rightarrow{}
.hScrollPane_dragbar{
position:absolute;
left:0px;
bottom:0px;
height:12px;
margin:0 auto;
background-position:left -32px;
background-color: #EFEFEF;
}
.hScrollPane_draghandle{
height:10px;
width:30px;
border:1px solid #B5B5B5;
overflow:hidden;
position:absolute;
top:0px;
left:0px;
cursor:default;
background-position:center -48px;
background-repeat:no-repeat;
background-color:#FFFFFF;
-moz-border-radius:2px;
-khtml-border-radius:2px;
-webkit-border-radius:2px;
border-radius:2px;
}
.hScrollPane_leftarrow,.hScrollPane_rightarrow{
display:inline-block;
height:16px;
width:17px;
overflow:hidden;
position:absolute;
bottom:0;
}
.hScrollPane_leftarrow{left:0;}
.hScrollPane_leftarrow:hover{background-position:left -64px;}
.hScrollPane_rightarrow{right:0; background-position:left -16px;}
.hScrollPane_rightarrow:hover{background-position:left -80px;}
.draghandlealter{
background-position:center -96px;
background-color:orange;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment