Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2013 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7219292 to your computer and use it in GitHub Desktop.
Save anonymous/7219292 to your computer and use it in GitHub Desktop.
function _select(){
var v=false,copytime=(new Date()).valueOf();
$(window).keydown(function(e){
if(e.keyCode==46){
$(".selected").remove();
}else if(e.keyCode==17||e.keyCode==91){
ctrl=true;
}else if(e.keyCode==67){
$("#copy.copy").click();
}else if(e.keyCode==86){
v=true;
}
if ((copytime!=(new Date()).valueOf()>1000)&&(ctrl&&v)) {
//console.log("ctrl+v")
if(copytime!=(new Date()).valueOf()){
var _this=$("#pause");
$(".icon").removeClass("selected");
var start_x=0,start_y=0;
start_x=e.clientX||0;
start_y=e.clientY||0;
console.warn("====================PAUSE BEGIN===================")
console.error(_copy.length,_copy)
if(_this.hasClass("pause"))
{
for(var i=0;i<(parseInt((_copy.length)/10)+1);i++)
{
var p=setPosition(start_x,start_y,150,150)
var px=p.x;
var py=p.y;
console.log("PAUSE AT:",px,py)
copyed_name=_copy[i*10+1]
copyed_logo=_copy[i*10+2]
copyed_type=_copy[i*10+3]
console.warn("ALL:",_copy,"i:",i)
console.warn("PAUSE:",_copy[i*10+1],_copy[i*10+2],_copy[i*10+3])
if(_this.hasClass("pause"))
{
var n=$(".icon[data-type="+copyed_type+"]").length;
var the_pause="<div class='icon selected' data-type='"+copyed_type+"'style='top:"+ py+"px;left:"+px+"px;'><a href='javascript:void(0);''><div><img src='"+copyed_logo+"'></div><h4>"+copyed_name+" <br/>副本"+n+"</h4></a></div>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment