refactored focus

master
Mark MacKay 2012-07-26 13:32:27 -05:00
parent cca7ae96b8
commit a975c1b935
4 changed files with 6 additions and 12 deletions

View File

@ -1879,11 +1879,8 @@
}
var closer = function(e){
//Method of Action specific to detect when the iframe has focus
if (top != self && !e.isTrigger) {
if(typeof top.exports.setEditorFocus == 'function') {
top.exports.setEditorFocus();
}
}
if((top != self && !e.isTrigger) && typeof top.exports.focus_editor == 'function') top.exports.focus_editor();
if (e.target.nodeName.toLowerCase() === "input") return false;
if (!$(e.target).hasClass("menu_title") && !$(e.target).parent().hasClass("menu_title")) {
if(!$(e.target).hasClass("disabled") && $(e.target).hasClass("menu_item")) blinker(e)

View File

@ -434,7 +434,7 @@ if(k){g.setColor("stroke",C);C!="none"&&g.getStrokeOpacity()!=1&&g.setPaintOpaci
if(a(k).parent().hasClass("tools_flyout"))return true;var C=C||"normal";u||a(".tools_flyout").fadeOut(C);a("#styleoverrides").text("");a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(k).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var k=null,u=null,C=R[0],D=false,P=false;a("#svgcanvas").bind("mousemove mouseup touchend",function(U){if(D!==false){C.scrollLeft-=U.clientX-k;C.scrollTop-=U.clientY-u;k=U.clientX;u=U.clientY;
if(U.type==="mouseup"||U.type==="touchend")D=false;return false}}).on("mousedown touchmove",function(U){if(U.button===1||P===true||U.originalEvent.touches&&U.originalEvent.touches.length>=2){D=true;k=U.clientX;u=U.clientY;return false}});a(window).mouseup(function(){D=false;a("body").removeClass("dragging")});a(document).bind("keydown","space",function(U){U.preventDefault();g.spaceKey=P=true}).bind("keyup","space",function(U){U.preventDefault();g.spaceKey=P=false}).bind("keydown","alt",function(){g.getMode()===
"zoom"&&R.addClass("out")}).bind("keyup","alt",function(){g.getMode()==="zoom"&&R.removeClass("out")})})();var ib=a(".menu"),Wa=function(k){k.target.style.background="#fff";setTimeout(function(){k.target.style.background="#ddd"},50);setTimeout(function(){k.target.style.background="#fff"},150);setTimeout(function(){k.target.style.background="#ddd"},200);setTimeout(function(){k.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").on("mousedown touchstart",
function(k){Wa(k)});a("svg, body").on("mousedown touchstart",function(k){top!=self&&!k.isTrigger&&typeof top.exports.setEditorFocus=="function"&&top.exports.setEditorFocus();if(k.target.nodeName.toLowerCase()!=="input")if(!a(k.target).hasClass("menu_title")&&!a(k.target).parent().hasClass("menu_title"))!a(k.target).hasClass("disabled")&&a(k.target).hasClass("menu_item")?Wa(k):a("#menu_bar").removeClass("active")});var Sa=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",
function(k){Wa(k)});a("svg, body").on("mousedown touchstart",function(k){top!=self&&!k.isTrigger&&typeof top.exports.focus_editor=="function"&&top.exports.focus_editor();if(k.target.nodeName.toLowerCase()!=="input")if(!a(k.target).hasClass("menu_title")&&!a(k.target).parent().hasClass("menu_title"))!a(k.target).hasClass("disabled")&&a(k.target).hasClass("menu_item")?Wa(k):a("#menu_bar").removeClass("active")});var Sa=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",
function(k,u,C,D){if(k.altKey){k.preventDefault();k=g.getZoom()*100;u=Sa.length;for(E=0;E<u;E++){C=Math.min(u,E+1);if(D>0)zoom=Sa[E]<=k?Sa[C]:zoom;if(D<0)zoom=Sa[E]<k?Sa[E]:zoom}zoom&&wa({value:zoom})}});a(".menu_title").on("mousedown",function(){a("#tools_shapelib").hide();a("#menu_bar").toggleClass("active");ib.removeClass("open");a(this).parent().addClass("open")}).on("mouseover",function(){ib.removeClass("open");a(this).parent().addClass("open")});c.addDropDown=function(k,u,C){if(a(k).length!=
0){var D=a(k).find("button"),P=a(k).find("ul").attr("id",a(k)[0].id+"-list");C||a("#option_lists").append(P);var U=false;C&&a(k).addClass("dropup");P.find("li").bind("mouseup",u);a(window).mouseup(function(){if(!U){D.removeClass("down");P.hide()}U=false});D.bind("mousedown",function(){if(D.hasClass("down")){D.removeClass("down");P.hide()}else{D.addClass("down");if(!C){var S=a(k).offset();P.css({top:S.top,left:S.left-110})}P.show();U=true}}).hover(function(){U=true}).mouseout(function(){U=false})}};
var Da=function(k,u,C,D){var P=a(k);u=a(u);var U=false,S=D.dropUp;S&&a(k).addClass("dropup");u.find("li").bind("mouseup",function(){if(D.seticon){yb("#cur_"+P[0].id,a(this).children());a(this).addClass("current").siblings().removeClass("current")}C.apply(this,arguments)});a(window).mouseup(function(){if(!U){P.removeClass("down");u.hide();u.css({top:0,left:0})}U=false});u.height();a(k).bind("mousedown",function(){var Y=a(k).offset();if(S){Y.top-=u.height();Y.left+=8}else Y.top+=a(k).height();a(u).offset(Y);

View File

@ -1879,11 +1879,8 @@
}
var closer = function(e){
//Method of Action specific to detect when the iframe has focus
if (top != self && !e.isTrigger) {
if(typeof top.exports.setEditorFocus == 'function') {
top.exports.setEditorFocus();
}
}
if((top != self && !e.isTrigger) && typeof top.exports.focus_editor == 'function') top.exports.focus_editor();
if (e.target.nodeName.toLowerCase() === "input") return false;
if (!$(e.target).hasClass("menu_title") && !$(e.target).parent().hasClass("menu_title")) {
if(!$(e.target).hasClass("disabled") && $(e.target).hasClass("menu_item")) blinker(e)

View File

@ -434,7 +434,7 @@ if(k){g.setColor("stroke",C);C!="none"&&g.getStrokeOpacity()!=1&&g.setPaintOpaci
if(a(k).parent().hasClass("tools_flyout"))return true;var C=C||"normal";u||a(".tools_flyout").fadeOut(C);a("#styleoverrides").text("");a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(k).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var k=null,u=null,C=R[0],D=false,P=false;a("#svgcanvas").bind("mousemove mouseup touchend",function(U){if(D!==false){C.scrollLeft-=U.clientX-k;C.scrollTop-=U.clientY-u;k=U.clientX;u=U.clientY;
if(U.type==="mouseup"||U.type==="touchend")D=false;return false}}).on("mousedown touchmove",function(U){if(U.button===1||P===true||U.originalEvent.touches&&U.originalEvent.touches.length>=2){D=true;k=U.clientX;u=U.clientY;return false}});a(window).mouseup(function(){D=false;a("body").removeClass("dragging")});a(document).bind("keydown","space",function(U){U.preventDefault();g.spaceKey=P=true}).bind("keyup","space",function(U){U.preventDefault();g.spaceKey=P=false}).bind("keydown","alt",function(){g.getMode()===
"zoom"&&R.addClass("out")}).bind("keyup","alt",function(){g.getMode()==="zoom"&&R.removeClass("out")})})();var ib=a(".menu"),Wa=function(k){k.target.style.background="#fff";setTimeout(function(){k.target.style.background="#ddd"},50);setTimeout(function(){k.target.style.background="#fff"},150);setTimeout(function(){k.target.style.background="#ddd"},200);setTimeout(function(){k.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").on("mousedown touchstart",
function(k){Wa(k)});a("svg, body").on("mousedown touchstart",function(k){top!=self&&!k.isTrigger&&typeof top.exports.setEditorFocus=="function"&&top.exports.setEditorFocus();if(k.target.nodeName.toLowerCase()!=="input")if(!a(k.target).hasClass("menu_title")&&!a(k.target).parent().hasClass("menu_title"))!a(k.target).hasClass("disabled")&&a(k.target).hasClass("menu_item")?Wa(k):a("#menu_bar").removeClass("active")});var Sa=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",
function(k){Wa(k)});a("svg, body").on("mousedown touchstart",function(k){top!=self&&!k.isTrigger&&typeof top.exports.focus_editor=="function"&&top.exports.focus_editor();if(k.target.nodeName.toLowerCase()!=="input")if(!a(k.target).hasClass("menu_title")&&!a(k.target).parent().hasClass("menu_title"))!a(k.target).hasClass("disabled")&&a(k.target).hasClass("menu_item")?Wa(k):a("#menu_bar").removeClass("active")});var Sa=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",
function(k,u,C,D){if(k.altKey){k.preventDefault();k=g.getZoom()*100;u=Sa.length;for(E=0;E<u;E++){C=Math.min(u,E+1);if(D>0)zoom=Sa[E]<=k?Sa[C]:zoom;if(D<0)zoom=Sa[E]<k?Sa[E]:zoom}zoom&&wa({value:zoom})}});a(".menu_title").on("mousedown",function(){a("#tools_shapelib").hide();a("#menu_bar").toggleClass("active");ib.removeClass("open");a(this).parent().addClass("open")}).on("mouseover",function(){ib.removeClass("open");a(this).parent().addClass("open")});c.addDropDown=function(k,u,C){if(a(k).length!=
0){var D=a(k).find("button"),P=a(k).find("ul").attr("id",a(k)[0].id+"-list");C||a("#option_lists").append(P);var U=false;C&&a(k).addClass("dropup");P.find("li").bind("mouseup",u);a(window).mouseup(function(){if(!U){D.removeClass("down");P.hide()}U=false});D.bind("mousedown",function(){if(D.hasClass("down")){D.removeClass("down");P.hide()}else{D.addClass("down");if(!C){var S=a(k).offset();P.css({top:S.top,left:S.left-110})}P.show();U=true}}).hover(function(){U=true}).mouseout(function(){U=false})}};
var Da=function(k,u,C,D){var P=a(k);u=a(u);var U=false,S=D.dropUp;S&&a(k).addClass("dropup");u.find("li").bind("mouseup",function(){if(D.seticon){yb("#cur_"+P[0].id,a(this).children());a(this).addClass("current").siblings().removeClass("current")}C.apply(this,arguments)});a(window).mouseup(function(){if(!U){P.removeClass("down");u.hide();u.css({top:0,left:0})}U=false});u.height();a(k).bind("mousedown",function(){var Y=a(k).offset();if(S){Y.top-=u.height();Y.left+=8}else Y.top+=a(k).height();a(u).offset(Y);