root / trunk / web / dojo / dojox / drawing / plugins / tools / Zoom.js
History | View | Annotate | Download (1.73 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.drawing.plugins.tools.Zoom"]){ |
||
9 | dojo._hasResource["dojox.drawing.plugins.tools.Zoom"]=true; |
||
10 | dojo.provide("dojox.drawing.plugins.tools.Zoom");
|
||
11 | dojo.require("dojox.drawing.plugins._Plugin");
|
||
12 | (function(){
|
||
13 | var _1=Math.pow(2,0.25),_2=10,_3=0.1,_4=1,dt=dojox.drawing.plugins.tools; |
||
14 | dt.ZoomIn=dojox.drawing.util.oo.declare(function(_5){
|
||
15 | },{}); |
||
16 | dt.ZoomIn=dojox.drawing.util.oo.declare(dojox.drawing.plugins._Plugin,function(_6){
|
||
17 | },{type:"dojox.drawing.plugins.tools.ZoomIn",onZoomIn:function(){ |
||
18 | _4*=_1; |
||
19 | _4=Math.min(_4,_2); |
||
20 | this.canvas.setZoom(_4);
|
||
21 | this.mouse.setZoom(_4);
|
||
22 | },onClick:function(){ |
||
23 | this.onZoomIn();
|
||
24 | }}); |
||
25 | dt.Zoom100=dojox.drawing.util.oo.declare(dojox.drawing.plugins._Plugin,function(_7){
|
||
26 | },{type:"dojox.drawing.plugins.tools.Zoom100",onZoom100:function(){ |
||
27 | _4=1;
|
||
28 | this.canvas.setZoom(_4);
|
||
29 | this.mouse.setZoom(_4);
|
||
30 | },onClick:function(){ |
||
31 | this.onZoom100();
|
||
32 | }}); |
||
33 | dt.ZoomOut=dojox.drawing.util.oo.declare(dojox.drawing.plugins._Plugin,function(_8){
|
||
34 | },{type:"dojox.drawing.plugins.tools.ZoomOut",onZoomOut:function(){ |
||
35 | _4/=_1; |
||
36 | _4=Math.max(_4,_3); |
||
37 | this.canvas.setZoom(_4);
|
||
38 | this.mouse.setZoom(_4);
|
||
39 | },onClick:function(){ |
||
40 | this.onZoomOut();
|
||
41 | }}); |
||
42 | dt.ZoomIn.setup={name:"dojox.drawing.plugins.tools.ZoomIn",tooltip:"Zoom In"}; |
||
43 | dojox.drawing.register(dt.ZoomIn.setup,"plugin");
|
||
44 | dt.Zoom100.setup={name:"dojox.drawing.plugins.tools.Zoom100",tooltip:"Zoom to 100%"}; |
||
45 | dojox.drawing.register(dt.Zoom100.setup,"plugin");
|
||
46 | dt.ZoomOut.setup={name:"dojox.drawing.plugins.tools.ZoomOut",tooltip:"Zoom In"}; |
||
47 | dojox.drawing.register(dt.ZoomOut.setup,"plugin");
|
||
48 | })(); |
||
49 | } |