first commit
49
rus/admin/_V4/_lib/ImageMapster-master/.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
|
||||
*.jpg binary
|
||||
*.png binary
|
||||
*.gif binary
|
||||
|
||||
*.cs -text diff=csharp
|
||||
*.vb -text
|
||||
*.c -text
|
||||
*.cpp -text
|
||||
*.cxx -text
|
||||
*.h -text
|
||||
*.hxx -text
|
||||
*.py -text
|
||||
*.rb -text
|
||||
*.java -text
|
||||
*.html -text
|
||||
*.htm -text
|
||||
*.css -text
|
||||
*.scss -text
|
||||
*.sass -text
|
||||
*.less -text
|
||||
*.js -text
|
||||
*.lisp -text
|
||||
*.clj -text
|
||||
*.sql -text
|
||||
*.php -text
|
||||
*.lua -text
|
||||
*.m -text
|
||||
*.asm -text
|
||||
*.erl -text
|
||||
*.fs -text
|
||||
*.fsx -text
|
||||
*.hs -text
|
||||
|
||||
*.csproj -text merge=union
|
||||
*.vbproj -text merge=union
|
||||
*.fsproj -text merge=union
|
||||
*.dbproj -text merge=union
|
||||
*.sln -text merge=union
|
||||
15
rus/admin/_V4/_lib/ImageMapster-master/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#################
|
||||
## Nonpublic stuff and generated junk
|
||||
#################
|
||||
|
||||
examples_source/
|
||||
archived/
|
||||
website/
|
||||
./*.zip
|
||||
./*.js
|
||||
src/*.min.js
|
||||
*.sln
|
||||
*.suo
|
||||
*.bat
|
||||
tests/*.min.js
|
||||
|
||||
260
rus/admin/_V4/_lib/ImageMapster-master/CHANGES.md
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
####Version 1.3.0 (planned)
|
||||
|
||||
Features:
|
||||
|
||||
* Return promises from asynchronous events rather than requiring callbacks like "onConfigured"
|
||||
* Return a non-jQuery object exposing the imagemapster API to simplify coding against it
|
||||
|
||||
####Version 1.2.14 (unreleased)
|
||||
|
||||
* Enable mouseover events when touchscreen found (to account for proliferation of machines with mouse pointer + touchscreen)
|
||||
* TODO - detect input device actively to determine when highlight effect should be enabled
|
||||
|
||||
####Version 1.2.13
|
||||
|
||||
* Fix problem with mouseoutdelay=01
|
||||
|
||||
####Version 1.2.12
|
||||
|
||||
* Fix issue with $.inArray on IE8
|
||||
* Fix problem with boundList when using "set" to toggle a multiple areas at once (from 1.2.11 issue - not quite fixed)
|
||||
|
||||
####Version 1.2.11
|
||||
|
||||
* Fix problem de-selecting boundlist when using "set" to toggle
|
||||
|
||||
####Version 1.2.10
|
||||
|
||||
* [Issue 120](https://github.com/jamietre/ImageMapster/issues/114) 1.2.9 broke IE9
|
||||
|
||||
####Version 1.2.9
|
||||
|
||||
* [Issue 114](https://github.com/jamietre/ImageMapster/issues/114) Fix jQuery 1.9 compatibility problem
|
||||
|
||||
####version 1.2.8
|
||||
|
||||
* [Issue 108](https://github.com/jamietre/ImageMapster/issues/108) Opacity of tooltip container not preserved
|
||||
* [Issue 107](https://github.com/jamietre/ImageMapster/issues/107) mouseoutDelay broken
|
||||
|
||||
####version 1.2.7
|
||||
|
||||
* [Issue 95](https://github.com/jamietre/ImageMapster/issues/95) SingleSelect broken in 1.2.6.099
|
||||
* [Issue 87](https://github.com/jamietre/ImageMapster/issues/87) Resize callback not working
|
||||
* [Issue 84](https://github.com/jamietre/ImageMapster/issues/84) Mouseover events not completely suppressed on mobile
|
||||
* Tooltip enhancements: tooltips can be called against arbitrary elements.
|
||||
* AltImage enhancements: see below
|
||||
|
||||
*tooltip-enhancements branch*
|
||||
|
||||
* [Issue 72](https://github.com/jamietre/ImageMapster/issues/72): `scaleMap` not working propery when using bootstrap (css on `body` causing incorrect evaluation of native image size)
|
||||
* Enhanced tooltip API to allow creating arbitrary tool tips bound to any area, or at an arbitrary position.
|
||||
|
||||
*altimage-enhancements branch*
|
||||
|
||||
* Add `altImages` option that accepts an option defining aliases to alternate images. The name of each property is an alias that can be specified as a valid `altImage` option value elsewhere
|
||||
|
||||
Example use of this option:
|
||||
|
||||
|
||||
|
||||
altImages: {
|
||||
roadmap: 'images/usamap-roads.png',
|
||||
elevation: 'images/uasmap-elevation.png'
|
||||
}
|
||||
|
||||
then:
|
||||
|
||||
$('img').mapster('set',true,'AZ', {
|
||||
altImage: 'roadmap'
|
||||
});
|
||||
|
||||
|
||||
The aliases can also be used in the initial configuration options, both globally and for specific areas.
|
||||
|
||||
|
||||
####version 1.2.6 - 2012.07.13
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
* [Issue #69](https://github.com/jamietre/ImageMapster/issues/69) `fill` setting not being honored sometimes in IE6-8
|
||||
* [Issue #68](https://github.com/jamietre/ImageMapster/issues/68) Accept `areas` array with dangling commas
|
||||
|
||||
####version 1.2.5 - 2012.06.19
|
||||
|
||||
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [Issue #59](https://github.com/jamietre/ImageMapster/issues/59), [Issue #55](https://github.com/jamietre/ImageMapster/issues/55) Opacity/fade effects not working right in IE8
|
||||
* [Issue #58](https://github.com/jamietre/ImageMapster/issues/58) Resize not changing CSS for the `div` contiainer around the image elements
|
||||
* [Issue #53](https://github.com/jamietre/ImageMapster/issues/53) Not working in Google Chrome with Adblock plugin
|
||||
* [Issue #44](https://github.com/jamietre/ImageMapster/issues/44) Incorrect opacity with altImage
|
||||
* [Issue #36](https://github.com/jamietre/ImageMapster/issues/36) Resize firing callback before resize is finished
|
||||
* Rebind not cleaning up resources properly
|
||||
* Offset 1 pixel strokes by 0.5 px to prevent the fuzzies
|
||||
* Ignore UI events during resize - can cause problems if highlights are activated during an effect
|
||||
|
||||
|
||||
Features:
|
||||
|
||||
* [Issue #52](https://github.com/jamietre/ImageMapster/issues/52) Add "clickNavigate" feature to allow basic imagemap functionality
|
||||
* Add "highlight" option to programatically set/unset the highlight effect (as if a user just moused over an area vs. clicked)
|
||||
* Detect touchscreen devices and disable "mouseover"
|
||||
* [Issue #11](https://github.com/jamietre/ImageMapster/issues/11) Detect excanvas automatically and force into IE mode if present
|
||||
|
||||
Notes
|
||||
|
||||
* refactor into modular architecture
|
||||
* tighten up tooltip code a little
|
||||
* Removed "attrmatches" jQuery selector exetnsion, recoded as a function, removed from tests
|
||||
* Queue all methods (highlight, data, tooltip) so configuration delays don't cause problems
|
||||
* Unbind "load" event explicitly from images added.
|
||||
* Add dynamic images to DOM instead of loading through Javascript
|
||||
* Ignore missing keys on some operations to increase stability with bad data
|
||||
* Trim results of string splits so spaces don't cause problems
|
||||
* Yet more tweaking of image loading detection
|
||||
* Refactor "graphics" into an object and instantiate for each instance. "load" callbacks were changing event order, resulting in the single instance getting wires crossed. Isolated
|
||||
each map instance completely, problem solved.
|
||||
* Fix canvases re-ordered after first selection making effect sometimes inconsistent
|
||||
* Fix resize bug when area groups are used
|
||||
|
||||
####version 1.2.4 - 2011.09.27
|
||||
|
||||
* [Issue #14](https://github.com/jamietre/ImageMapster/issues/14) Resize bug in IE <9 fixed
|
||||
|
||||
####version 1.2.3
|
||||
|
||||
* Resize with multiple images affecting other images - fixed
|
||||
|
||||
####version 1.2.2 - 2011.09.22
|
||||
|
||||
* masks not working in Firefox 6.0 only. behavior of context.globalCompositeOperation='source-out' and
|
||||
save/restore somehow changed in ff6. updated code to not depend (possibly) on idiosyncracies of chrome
|
||||
and ie9. honestly not sure why it worked before as it appears I may have been doing something wrong,
|
||||
but the code is more explicit now and it works across all browsers.
|
||||
|
||||
####version 1.2.1
|
||||
|
||||
* Click callback "this" is not set - fixed
|
||||
* Replace u.isFunction with $.isFunction to save a few bytes
|
||||
|
||||
####version 1.2
|
||||
|
||||
* fixed fader problem for old IE (again, really this time)
|
||||
* allow selecting includeKeys areas from staticState areas
|
||||
* test browser features for filter vs. opacity
|
||||
* "resize" option
|
||||
* improve startup speed by eliminating need for setTimeout callback
|
||||
* address startup bug when images aren't loaded and there are lots of images
|
||||
* fixed exception when "set" with no data for key
|
||||
* bug when multiple images bound on same page * another IE tweak: blur() on mouseover/click to remove browser-rendered border around area
|
||||
* force "border=0" on image to ensure consistent display across bind/unbind in IE
|
||||
* Fixed broken "onMouseover" option, added tests for onMouseover/onMouseout.
|
||||
* many performance improvements, tests, refactoring some old inefficient code.
|
||||
* fix css flickering when debinding/rebinding in HTML5 browsers
|
||||
* add "scaleMap" option to automatically resize image maps when a bound image is resized dynamically. Enabled by default if an image is displayed at a size other than its native size.
|
||||
|
||||
####version 1.1.3
|
||||
|
||||
* revised "highlight" method API (previously undocumented). Added tests & documented.
|
||||
* added a generic prototype for parsing method data to improve consistency & stability
|
||||
* added tests for tooltip external & event bound invocation
|
||||
* added invoking tooltip from area, e.g. $('some-area').mapster('tooltip')
|
||||
* added invoking tooltip from key, e.g. .mapster('tooltip',key);
|
||||
* Bug fix for get_options, showToolTip (related)
|
||||
* Bug fix - area id 0 on VML rendereding deselection causes all selections to disappear (introduced in beta 2)
|
||||
* Changed "get" to return true "selected" state and not "isSelected()" which includes staticState items in selected.
|
||||
* Bug fix - stroke sometimes rendered improperly when using render-specific options
|
||||
* change onClick handler to BEFORE action, permit canceling of action by returning false
|
||||
* refactor into mostly OO design - functional design was getting unwieldy.
|
||||
* fix bugs related to cascading of "staticState" options
|
||||
* add "snapshot" option
|
||||
* check for existing wrapper, skip if it already exists
|
||||
* remove map data when unbinding+preserveState -- it should act as if not there
|
||||
* IE performance improvements (optimizing rendering code a little bit)
|
||||
|
||||
####version 1.1.2 - 2011.06-15
|
||||
|
||||
* minor bugfix release
|
||||
|
||||
####version 1.1.1 - 2011.06.03
|
||||
|
||||
* Performance improvement: cache area groups on map binding to eliminate need for attribute selector
|
||||
* Significant enhancement to permit complex area grouping and area exclusions (masks):
|
||||
* added: mapKey can contain multiple keys, allowing an area to be a member of multiple groups
|
||||
* added: "noHrefIsMask" option to determine "nohref" attribute treatment
|
||||
* added: "isMask" option (area-specific)
|
||||
* added: "includeKeys" option (area-specific)
|
||||
* added: 'highlight' method to enable highlighting of areas from code
|
||||
* bufgix: fading didn't work in IE6-7, some Operas. Should work in all browsers except IE8 now.
|
||||
* bugfix: ignore areas with no mapkey when it is provided
|
||||
* bugfix: not binding properly when no mapkey provided
|
||||
|
||||
####version 1.1
|
||||
|
||||
* added: per-action options (highlight, select)
|
||||
* fixed some memory leaks
|
||||
* minor performance improvements
|
||||
* cleanup in VML mode
|
||||
* fix IE9 canvas support (fader problem)
|
||||
* fix flickering on fades when moving quickly
|
||||
* add altImage options
|
||||
* added onConfigured callback
|
||||
* fixed problems with cleanup (not removing wrap)
|
||||
* added failure timeout for configure
|
||||
|
||||
####Version 1.0.10 - 2011.05.12
|
||||
|
||||
* ignore errors when binding mapster to invalid elements
|
||||
* minor performance improvements
|
||||
* fixed command queue problem (broke in 1.0.9) for commands issued after bind, but before image is ready
|
||||
* enhanced tests
|
||||
|
||||
####version 1.0.9 - 2011.05.10
|
||||
|
||||
* added "unbind" option to remove mapster from an image
|
||||
* add 'options' option
|
||||
* add 'rebind' option
|
||||
* add isDeselectable option
|
||||
* handle exceptions better (when acting on unbound images)
|
||||
* add 'get' method to retrieve selections
|
||||
* add unbind options
|
||||
* clear command queue after processing
|
||||
|
||||
####version 1.0.8 - 2011.05.05
|
||||
|
||||
* Handle problem when "img.complete" is not true at config time and "set" commands are issued after initial config call but before config is complete. Queue any "set" commands and process them after the timer callback.
|
||||
* Pass listTarget to onClick callback even when !isSelectable (previously passed null)
|
||||
* Pass ref to toolTip element on callback
|
||||
* Don't show tooltip again if the one for an area is already displayed
|
||||
* Add singleSelect option - clears any other selected item when a new item is selected
|
||||
|
||||
####Version 1.0.6 - 2011.04.27
|
||||
|
||||
* Problem when not using mapKey
|
||||
* staticState=false not working
|
||||
|
||||
####Version 1.0.5 - 2011.04.26
|
||||
|
||||
* Corrected jquery attribute selector (not using quote marks)
|
||||
* added area persistence behavior options
|
||||
* tooltips not working in Firefox - bug in area data management. Deprecated use of jquery.data for passing area-specific options, added "areas" option to replace
|
||||
* fixed "showToolTip" default property name (was showToolTips) - should have had no effect
|
||||
|
||||
####Version 1.0.4 - 2011.04.20
|
||||
|
||||
* allow using jQuery object for toolTip text
|
||||
* happy earth day
|
||||
|
||||
####Version 1.0.3
|
||||
|
||||
* missing preventDefault on click (post refactor issue)
|
||||
|
||||
####Version 1.0.2
|
||||
|
||||
* fixed tooltip in IE6
|
||||
|
||||
####Version 1.0.0 - 2011.04.19 - **first official release**
|
||||
|
||||
* refactored from remaining old to use a clean namespace
|
||||
* added simple mouseover dialog
|
||||
143
rus/admin/_V4/_lib/ImageMapster-master/README.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
###**ImageMapster:** A Jquery Plugin to make image maps useful.
|
||||
|
||||
ImageMapster activates the areas in HTML imagemaps so you can highlight and select them. It has lots of other features for manual control, tooltips, resizing, and more. It is designed to be compatible with every common platform, and is tested with Internet Explorer 6-10, Firefox 3.0+, Safari, Opera, and Chrome. It works on mobile devices and doesn't use Flash.
|
||||
|
||||
### Release Information
|
||||
|
||||
See the [change log](https://github.com/jamietre/ImageMapster/blob/master/CHANGES.md) for details on the current release.
|
||||
|
||||
Read the [release notes](http://blog.outsharked.com/2012/06/imagemapster-125-released.html) for 1.2.5, the last significant update.
|
||||
|
||||
### Find out More
|
||||
|
||||
There are lots of examples and documentation on the [ImageMapster web site.](http://www.outsharked.com/imagemapster)
|
||||
|
||||
You can find the [source code on GitHub.](https://github.com/jamietre/ImageMapster) If you have a problem, please file a bug report there!
|
||||
|
||||
<b>Questions?</b>
|
||||
|
||||
- I write about ImageMapster on my blog from time to time. See [posts about imagemapster.](http://blog.outsharked.com/search/label/imagemapster)
|
||||
|
||||
- Take a look at [ImageMapster questions on StackOverflow](http://stackoverflow.com/search?q=imagemapster); there are quite a few. Maybe someone's asked the same question already.
|
||||
|
||||
- There are also some very detailed discussions in the [GitHub issues](https://github.com/jamietre/imagemapster/issues?direction=desc&labels=support&page=1&sort=created&state=closed) section that I've flagged as "support".
|
||||
|
||||
- You can also check the [feedback](http://www.outsharked.com/imagemapster/default.aspx?feedback.html) page on the project web site.
|
||||
|
||||
- Still can't figure it out? [email me directly](mailto:alien@outsharked.com) if you still need help. I will respond as time permits, but I will always respond.
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
----
|
||||
|
||||
Active all image maps on the page with default options: on mouseover areas are highlighted with a gray fill with no border, and clicking an area causes it to become selected.
|
||||
|
||||
$('img').mapster();
|
||||
|
||||
Activate image maps with some specific options.
|
||||
|
||||
$('img').mapster( {
|
||||
fillColor: 'ff0000',
|
||||
stroke: true,
|
||||
singleSelect: true
|
||||
});
|
||||
|
||||
|
||||
### Manual Control
|
||||
|
||||
----
|
||||
|
||||
There are lots of ways to manipulate the imagemap from Javascript. Here area a few; see the project web site for complete documentation.
|
||||
|
||||
**select**: Cause an area to become "selected"
|
||||
|
||||
$('area').mapster('select');
|
||||
|
||||
Programatically select elements from the image map. The programmatic selection/deselection methods will not honor the staticState property.
|
||||
|
||||
**deselect**: Cause an area to become "selected"
|
||||
|
||||
$('area').mapster('deselect');
|
||||
|
||||
**set**: select or deselect an element. If `selected` is true, the area is selected, if false, it is deselected.
|
||||
|
||||
$('area').mapster('set',selected);
|
||||
|
||||
You can also select or deselect areas using a their `mapKey`. This is an attribute on each area in your HTML that identifies it. You define a mapKey using a configuration option: `mapKey: 'data-key'`.
|
||||
|
||||
$('img').mapster('set',true,'key1,key2');
|
||||
|
||||
If two areas share the same value for the `mapKey` they will be automatically grouped together when activated. You can also use the values of the mapKey to select areas from code.
|
||||
|
||||
You can pass options to change the rendering effects when using set as the last parameter:
|
||||
|
||||
$('img').mapster('set',true,'key', {fillColor: 'ff0000'} );
|
||||
|
||||
MapKeys can contain more than one value. The first value always defines groups when you mouse over. Other values can be used to create logical groups. For example:
|
||||
|
||||
<img id="usamap" src="map.jpeg" usemap="#usa">
|
||||
<map name="usa">
|
||||
<area data-key="maine,new-england,really-cold" shape="poly" coords="...">
|
||||
<area data-key="new-hampshire,new-england,really-cold" shape="poly" coords="...">
|
||||
<area data-key="vermont,new-england,really-cold" shape="poly" coords="...">
|
||||
<area data-key="connecticut,new-england" shape="poly" coords="...">
|
||||
<area data-key="rhode-island,new-england" shape="poly" coords="...">
|
||||
<area data-key="massachusetts,new-england" shape="poly" coords="...">
|
||||
<!-- more states... -->
|
||||
</map>
|
||||
|
||||
$('#usamap').mapster( { mapKey: 'data-key' } );
|
||||
|
||||
Mousing over each state would cause just that state to be higlighted. You can also select other logical groups from code code:
|
||||
|
||||
// select all New England states
|
||||
$('img').mapster('set',true,'new-england');
|
||||
|
||||
// select just Maine, New Hampshire & Vermont
|
||||
$('img').mapster('set',true,'really-cold');
|
||||
|
||||
Groups created this way are *independent* of the primary group. If you select "new-england" from code, you can't unselect just "MA" by clicking on it. You would have to unselect "new-england" from code.
|
||||
|
||||
To simply indentify a set of areas to turn on or off, but not treat them as a logical group, you can use CSS classes and select areas directly, or use the <code>keys</code> option to identify the primary keys associated with a group (see documentation).
|
||||
|
||||
|
||||
----
|
||||
### Options
|
||||
|
||||
Please see github repository for complete documentation.
|
||||
|
||||
### Zepto Compatibility
|
||||
|
||||
Newer versions of Zepto don't seem to work any more (as of 1.2.5). I didn't want this to hold up the ever-delayed release even further so I didn't figure out why.
|
||||
|
||||
In theory it should work; you need to use the "jquery.imagemapster.zepto.js" build. This patches a few holes in Zepto that ImageMapster needs. It is safe to use the zepto version with jQuery.
|
||||
|
||||
### Build instructions
|
||||
|
||||
The source code is broken into several modules to make management easier and to make it possible to create feature-targeted builds. A rakefile is included that creates and minifies the two release builds (with and without Zepto support):
|
||||
|
||||
`rake`
|
||||
|
||||
### Code use license.
|
||||
|
||||
LICENSE (MIT License)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
31
rus/admin/_V4/_lib/ImageMapster-master/bower.json
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "ImageMapster",
|
||||
"version": "1.2.5",
|
||||
"homepage": "https://github.com/jamietre/ImageMapster",
|
||||
"description": "ImageMapster activates the areas in HTML imagemaps so you can highlight and select them. It has lots of other features for manual control, tooltips, resizing, and more. It is designed to be compatiable with every common platform, and is tested with Internet Explorer 6-10, Firefox 3.0+, Safari, Opera, and Chrome. It works on mobile devices and doesn't use Flash.",
|
||||
"main": "dist/jquery.imagemapster.js",
|
||||
"keywords": [
|
||||
"jquery",
|
||||
"imagemapster",
|
||||
"activate",
|
||||
"area",
|
||||
"html"
|
||||
],
|
||||
"authors": [
|
||||
"James Treworgy <jamie@outsharked.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests",
|
||||
"build",
|
||||
"examples",
|
||||
"src"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "latest"
|
||||
}
|
||||
}
|
||||
12
rus/admin/_V4/_lib/ImageMapster-master/build/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
**Building ImageMapster from Source**
|
||||
|
||||
A rakefile is included as a standardized way to build the project. It should work for all environments and will build and minify the output. You need to have Ruby installed as well as uglifier (UglifyJS) gem. To install uglifier just do this (assuming Ruby exists):
|
||||
|
||||
<code>\> gem install uglifier</code>
|
||||
|
||||
To build:
|
||||
|
||||
<code>\> rake</code>
|
||||
|
||||
There used to be a couple batch files for building this with nonstandard tools. Since Uglifier now works on windows, they're deprecated, and rake is the right way to build this.
|
||||
|
||||
176
rus/admin/_V4/_lib/ImageMapster-master/build/rakefile
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
require 'rake'
|
||||
require 'rake/packagetask'
|
||||
|
||||
MAPSTER_VERSION = "unknown"
|
||||
|
||||
MAPSTER_ROOT = File.expand_path(File.dirname(__FILE__))
|
||||
MAPSTER_SRC = File.join(MAPSTER_ROOT, '../src')
|
||||
MAPSTER_DIST = File.join(MAPSTER_ROOT, '../dist')
|
||||
MAPSTER_PKG = File.join(MAPSTER_ROOT, '../pkg')
|
||||
|
||||
MAPSTER_COMPONENTS = [
|
||||
'license',
|
||||
'redist/when',
|
||||
'core',
|
||||
'graphics',
|
||||
'mapimage',
|
||||
'mapdata',
|
||||
'areadata',
|
||||
'areacorners',
|
||||
'scale',
|
||||
'tooltip'
|
||||
]
|
||||
|
||||
|
||||
MAPSTER_ZEPTO_COMPONENTS = [
|
||||
'license',
|
||||
'zepto',
|
||||
'redist/when',
|
||||
'core',
|
||||
'graphics',
|
||||
'mapdata',
|
||||
'mapimage',
|
||||
'areadata',
|
||||
'areacorners',
|
||||
'scale',
|
||||
'tooltip'
|
||||
]
|
||||
|
||||
#task :default => [:clean, :concat, :concatzepto, :dist]
|
||||
task :default => [:clean, :concat, :dist]
|
||||
|
||||
desc "Clean the distribution directory."
|
||||
task :clean do
|
||||
rm_rf MAPSTER_DIST
|
||||
mkdir MAPSTER_DIST
|
||||
end
|
||||
|
||||
def normalize_whitespace(filename)
|
||||
contents = File.readlines(filename)
|
||||
contents.each { |line| line.sub!(/\s+$/, "") }
|
||||
File.open(filename, "w") do |file|
|
||||
file.write contents.join("\n").sub(/(\n+)?\Z/m, "\n")
|
||||
end
|
||||
end
|
||||
|
||||
desc "Strip trailing whitespace and ensure each file ends with a newline"
|
||||
task :whitespace do
|
||||
Dir["src/**/*"].each do |filename|
|
||||
normalize_whitespace(filename) if File.file?(filename)
|
||||
end
|
||||
end
|
||||
|
||||
desc "Concatenate source files to build jquery.imagemapster.js"
|
||||
task :concat, [:addons] => :whitespace do |task, args|
|
||||
# colon-separated arguments such as `concat[foo:bar:-baz]` specify
|
||||
# which components to add or exclude, depending on if it starts with "-"
|
||||
add, exclude = args[:addons].to_s.split(':').partition {|c| c !~ /^-/ }
|
||||
exclude.each {|c| c.sub!('-', '') }
|
||||
files = (MAPSTER_COMPONENTS | add) - exclude
|
||||
|
||||
unless files == MAPSTER_COMPONENTS
|
||||
puts "Building jquery.imagemapster.js by including: #{files.join(', ')}"
|
||||
end
|
||||
|
||||
File.open(File.join(MAPSTER_DIST, 'jquery.imagemapster.js'), 'w') do |f|
|
||||
f.puts files.map { |component|
|
||||
File.read File.join(MAPSTER_SRC, "#{component}.js")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
desc "Concatenate source files to build jquery.imagemapster.zepto.js"
|
||||
task :concatzepto, [:addons] => :whitespace do |task, args|
|
||||
# colon-separated arguments such as `concat[foo:bar:-baz]` specify
|
||||
# which components to add or exclude, depending on if it starts with "-"
|
||||
add, exclude = args[:addons].to_s.split(':').partition {|c| c !~ /^-/ }
|
||||
exclude.each {|c| c.sub!('-', '') }
|
||||
files = (MAPSTER_ZEPTO_COMPONENTS | add) - exclude
|
||||
|
||||
unless files == MAPSTER_ZEPTO_COMPONENTS
|
||||
puts "Building jquery.imagemapster.zepto.js by including: #{files.join(', ')}"
|
||||
end
|
||||
|
||||
File.open(File.join(MAPSTER_DIST, 'jquery.imagemapster.zepto.js'), 'w') do |f|
|
||||
f.puts files.map { |component|
|
||||
File.read File.join(MAPSTER_SRC, "#{component}.js")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def google_compiler(src, target)
|
||||
puts "Minifying #{src} with Google Closure Compiler..."
|
||||
`java -jar vendor/google-compiler/compiler.jar --js #{src} --summary_detail_level 3 --js_output_file #{target}`
|
||||
end
|
||||
|
||||
def yui_compressor(src, target)
|
||||
puts "Minifying #{src} with YUI Compressor..."
|
||||
`java -jar vendor/yuicompressor/yuicompressor-2.4.2.jar #{src} -o #{target}`
|
||||
end
|
||||
|
||||
def uglifyjs(src, target)
|
||||
begin
|
||||
require 'uglifier'
|
||||
rescue LoadError => e
|
||||
if verbose
|
||||
puts "\nYou'll need the 'uglifier' gem for minification. Just run:\n\n"
|
||||
puts " $ gem install uglifier"
|
||||
puts "\nand you should be all set.\n\n"
|
||||
exit
|
||||
end
|
||||
return false
|
||||
end
|
||||
puts "Minifying #{src} with UglifyJS..."
|
||||
File.open(target, "w"){|f| f.puts Uglifier.new.compile(File.read(src))}
|
||||
end
|
||||
|
||||
def process_minified(src, target)
|
||||
msize = File.size(File.join(MAPSTER_DIST,'jquery.imagemapster.min.js'))
|
||||
osize = File.size(src)
|
||||
|
||||
puts "Original version: %.3fk" % (osize/1024.0)
|
||||
puts "Minified: %.3fk" % (msize/1024.0)
|
||||
end
|
||||
|
||||
desc "Generates a minified version for distribution, using UglifyJS."
|
||||
task :dist do
|
||||
src, target = File.join(MAPSTER_DIST,'jquery.imagemapster.js'), File.join(MAPSTER_DIST,'jquery.imagemapster.min.js')
|
||||
uglifyjs src, target
|
||||
#src, target = File.join(MAPSTER_DIST,'jquery.imagemapster.zepto.js'), File.join(MAPSTER_DIST,'jquery.imagemapster.zepto.min.js')
|
||||
#uglifyjs src, target
|
||||
process_minified src, target
|
||||
end
|
||||
|
||||
desc "Generates a minified version for distribution using the Google Closure compiler."
|
||||
task :googledist do
|
||||
src, target = File.join(MAPSTER_DIST,'jquery.imagemapster.js'), File.join(MAPSTER_DIST,'jquery.imagemapster.min.js')
|
||||
google_compiler src, target
|
||||
process_minified src, target
|
||||
end
|
||||
|
||||
desc "Generates a minified version for distribution using the YUI compressor."
|
||||
task :yuidist do
|
||||
src, target = File.join(MAPSTER_DIST,'jquery.imagemapster.js'), File.join(MAPSTER_DIST,'jquery.imagemapster.min.js')
|
||||
yui_compressor src, target
|
||||
process_minified src, target
|
||||
end
|
||||
|
||||
desc "Generate docco documentation from sources."
|
||||
task :docs do
|
||||
puts "Generating docs..."
|
||||
puts "Note: to work, install node.js first, then install docco with 'sudo npm install docco -g'."
|
||||
puts `docco src/*`
|
||||
end
|
||||
|
||||
Rake::PackageTask.new('mapster', MAPSTER_VERSION) do |package|
|
||||
package.need_tar_gz = true
|
||||
package.need_zip = true
|
||||
package.package_dir = MAPSTER_PKG
|
||||
package.package_files.include(
|
||||
'README.md',
|
||||
'dist/**/*',
|
||||
'src/**/*',
|
||||
'test/**/*',
|
||||
'examples/**/*'
|
||||
)
|
||||
end
|
||||
4691
rus/admin/_V4/_lib/ImageMapster-master/dist/jquery.imagemapster.js
vendored
Normal file
16
rus/admin/_V4/_lib/ImageMapster-master/dist/jquery.imagemapster.min.js
vendored
Normal file
165
rus/admin/_V4/_lib/ImageMapster-master/examples/altimages.html
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>-->
|
||||
<script type="text/javascript" src="redist/jquery.1.7.2.min.js"></script>
|
||||
<script type="text/javascript" src="../src/redist/when.js"></script>
|
||||
<script type="text/javascript" src="../src/core.js"></script>
|
||||
<script type="text/javascript" src="../src/graphics.js"></script>
|
||||
<script type="text/javascript" src="../src/mapimage.js"></script>
|
||||
<script type="text/javascript" src="../src/mapdata.js"></script>
|
||||
<script type="text/javascript" src="../src/areadata.js"></script>
|
||||
<script type="text/javascript" src="../src/areacorners.js"></script>
|
||||
<script type="text/javascript" src="../src/scale.js"></script>
|
||||
<script type="text/javascript" src="../src/tooltip.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var img = $('img');
|
||||
|
||||
$('#az-test').bind('click',function() {
|
||||
img.mapster('set',true,'AZ', { altImage: 'img2'});
|
||||
});
|
||||
|
||||
img.mapster({
|
||||
mapKey: 'state',
|
||||
altImages: {
|
||||
img2: '../examples/images/usa_map_720_alt_2.jpg',
|
||||
img3: '../examples/images/usa_map_720_alt_3.jpg',
|
||||
img4: '../examples/images/usa_map_720_alt_3.jpg',
|
||||
img5: '../examples/images/usa_map_720_alt_5.jpg'
|
||||
},
|
||||
|
||||
areas: [
|
||||
{
|
||||
key: 'TX',
|
||||
stroke: true,
|
||||
render_highlight: {
|
||||
altImage: 'img5'
|
||||
},
|
||||
render_select: {
|
||||
|
||||
stroke: false,
|
||||
fillOpacity: 0.3,
|
||||
altImageOpacity: 0.5,
|
||||
altImage: 'img5'
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'NM',
|
||||
render_select: {
|
||||
fillOpacity: 0.2
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a id="az-test" href="#">click to bind az with altimage2</a>
|
||||
<img src="../examples/images/usa_map_720.png"
|
||||
usemap="#usa" style="width:600px;height:371px;">
|
||||
<map id="usa_image_map" name="usa">
|
||||
<area href="#" state="NH" full="New Hampshire" shape="rect" coords="512,29,586,44">
|
||||
<area href="#" state="VT" full="Vermont" shape="rect" coords="543,49,586,62">
|
||||
<area href="#" state="MA" full="Massachusetts" shape="rect" coords="515,68,585,80">
|
||||
<area href="#" state="RI" full="Rhode Island" shape="rect" coords="650,149,711,161">
|
||||
<area href="#" state="CT" full="Connecticut" shape="rect" coords="655,167,711,179">
|
||||
<area href="#" state="NJ" full="New Jersey" shape="rect" coords="656,185,711,198">
|
||||
<area href="#" state="DE" full="Delaware" shape="rect" coords="665,204,711,216">
|
||||
<area href="#" state="MD" full="Maryland" shape="rect" coords="667,223,711,235">
|
||||
<area href="#" state="DC" full="District of Columbia" shape="rect" coords="654,239,711,252">
|
||||
<area href="#" state="WV" full="West Virginia" shape="rect" coords="649,257,711,270">
|
||||
<area href="#" state="SC" full="South Carolina" shape="poly" coords="551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,520,270,526,267,531,266,543,266,545,267,546,270,549,269,559,269,560,269,570,275,577,281,573,284,572,289,571,293,569,294,569,296,567,296,566,299,563,301,562,303,561,304,558,306,556,307,557,309,553,313,551,314">
|
||||
<area href="#" state="HI" full="Hawaii" shape="poly" coords="169,391,170,389,172,388,172,389,170,391,169,391">
|
||||
<area href="#" state="HI" shape="poly" coords="176,389,181,390,182,390,183,387,183,385,180,384,177,386,176,389">
|
||||
<area href="#" state="HI" shape="poly" coords="199,395,201,400,203,399,204,399,205,400,208,400,208,398,206,398,205,395,203,392,199,395,199,395">
|
||||
<area href="#" state="HI" shape="poly" coords="213,402,214,401,218,401,218,401,222,401,222,402,221,404,217,403,213,402">
|
||||
<area href="#" state="HI" shape="poly" coords="217,406,218,409,221,407,221,407,220,405,217,405,217,406">
|
||||
<area href="#" state="HI" shape="poly" coords="222,405,224,403,227,404,230,405,233,407,233,409,231,410,227,411,226,410,222,405">
|
||||
<area href="#" state="HI" shape="poly" coords="234,416,236,415,238,416,243,419,245,421,247,422,248,425,251,428,251,428,248,431,245,431,244,431,242,432,240,435,239,437,237,437,235,435,234,431,235,430,233,426,232,425,232,422,233,422,235,419,236,419,234,418,234,416">
|
||||
<area href="#" state="AK" full="Alaska" shape="poly" coords="114,344,114,405,116,406,118,406,119,405,121,405,121,407,125,413,126,414,128,413,129,413,129,410,131,410,131,409,133,408,135,410,135,412,137,413,137,414,140,416,143,420,145,422,146,425,147,428,151,428,155,430,155,434,156,436,155,438,154,440,152,439,152,437,149,436,149,435,148,436,149,437,149,440,148,440,146,440,145,438,146,440,146,441,146,441,143,437,143,435,141,434,141,430,140,430,140,433,140,433,139,430,138,428,137,427,138,431,138,432,137,431,134,427,133,426,132,424,131,422,130,421,130,419,131,419,131,418,129,419,127,417,125,415,122,413,119,411,119,409,119,407,118,409,116,410,113,409,109,407,105,407,104,407,100,404,98,404,96,400,94,400,92,401,92,404,92,402,93,403,92,406,95,404,95,405,92,408,91,408,91,407,90,406,89,407,87,405,85,407,83,408,81,410,77,410,77,408,80,408,80,407,78,407,79,404,80,402,80,401,80,400,84,398,85,399,86,399,86,398,83,397,80,399,77,401,77,404,75,405,72,406,70,408,70,410,71,410,72,411,70,414,65,417,60,420,59,421,54,422,50,423,52,424,51,425,50,426,49,425,46,425,46,427,45,427,45,425,43,426,41,427,38,426,36,428,34,428,32,428,31,429,29,428,27,428,26,428,25,429,24,428,24,427,26,426,31,426,34,425,35,424,38,423,39,422,41,422,42,424,43,423,44,422,47,421,49,420,50,420,50,420,51,420,52,418,55,416,56,414,58,410,59,410,59,407,58,409,56,409,55,407,54,407,53,408,53,410,53,410,51,406,50,407,50,406,50,405,47,405,45,406,43,406,44,404,44,403,44,401,45,401,46,401,45,399,45,396,45,395,44,396,40,396,38,395,38,392,37,390,37,389,38,389,38,387,39,386,38,386,38,386,37,384,38,380,41,378,43,377,44,374,46,374,48,374,48,376,50,376,53,374,53,374,54,375,56,375,57,374,58,371,58,366,56,367,54,368,53,367,50,366,47,366,44,363,44,360,44,359,43,357,41,355,42,354,47,353,48,353,49,354,50,354,50,353,53,353,54,353,55,353,54,355,54,356,56,357,59,359,61,358,59,355,59,353,59,352,56,350,56,350,56,349,56,346,54,342,52,339,54,338,56,338,58,338,61,338,64,335,65,333,67,332,68,332,71,332,73,330,74,330,74,331,78,331,80,329,80,329,83,330,85,332,84,332,85,333,86,332,89,332,89,335,90,336,95,337,100,340,101,339,105,341,107,341,108,340,111,341,114,344">
|
||||
<area href="#" state="AK" shape="poly" coords="31,365,32,368,32,369,30,368,29,366,28,365,26,365,26,363,27,361,28,363,29,364,31,365">
|
||||
<area href="#" state="AK" shape="poly" coords="29,389,32,389,35,390,35,391,34,393,32,393,29,391,29,389">
|
||||
<area href="#" state="AK" shape="poly" coords="14,378,15,380,16,381,15,382,14,380,14,378,14,378">
|
||||
<area href="#" state="AK" shape="poly" coords="4,431,7,430,9,429,11,429,11,431,13,431,14,429,14,428,16,428,18,430,17,431,14,432,12,431,9,431,6,431,5,432,4,431">
|
||||
<area href="#" state="AK" shape="poly" coords="40,428,41,430,42,428,41,428,40,428">
|
||||
<area href="#" state="AK" shape="poly" coords="42,431,43,428,44,429,44,431,42,431">
|
||||
<area href="#" state="AK" shape="poly" coords="59,429,60,430,61,429,60,428,59,429">
|
||||
<area href="#" state="AK" shape="poly" coords="65,420,66,424,68,425,72,422,75,421,74,419,74,417,73,418,71,418,71,417,73,417,76,416,77,415,74,414,75,413,73,414,70,417,66,419,65,420">
|
||||
<area href="#" state="AK" shape="poly" coords="96,406,98,404,97,403,95,404,96,406">
|
||||
<area href="#" state="FL" full="Florida" shape="poly" coords="548,337,549,343,552,350,556,356,558,361,562,365,565,368,566,370,565,371,565,372,566,377,569,380,571,383,573,387,577,393,578,399,578,407,578,409,578,411,576,413,577,413,576,415,576,417,577,419,575,421,572,422,569,422,569,423,567,424,566,423,565,422,565,421,564,418,562,414,559,413,557,413,556,413,554,410,553,407,551,404,550,404,549,405,548,405,546,401,544,398,542,395,540,392,537,390,539,388,541,384,541,383,538,383,536,383,537,383,539,384,538,387,537,388,536,385,535,381,535,379,536,376,536,369,533,366,533,364,529,363,527,362,526,361,524,359,523,357,521,356,519,353,516,353,514,351,512,351,509,352,509,353,509,354,509,355,507,355,504,357,502,359,499,359,497,360,497,358,495,356,493,356,492,355,486,352,481,350,477,351,473,351,469,353,466,353,466,347,464,346,463,344,463,342,470,341,489,339,494,339,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337">
|
||||
<area href="#" state="FL" shape="poly" coords="557,434,558,433,560,433,560,431,562,430,563,431,564,431,564,431,562,432,559,433,557,434,557,434">
|
||||
<area href="#" state="FL" shape="poly" coords="566,430,567,431,569,429,573,426,576,423,578,419,578,417,578,415,578,415,577,417,576,420,574,425,571,428,568,428,566,430">
|
||||
<area href="#" state="GA" full="Georgia" shape="poly" coords="500,274,497,275,490,275,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337,547,332,548,325,550,322,549,320,552,315,551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,514,272,510,273,505,274,500,274">
|
||||
<area href="#" state="AL" full="Alabama" shape="poly" coords="453,353,452,342,450,329,450,318,451,296,451,284,451,279,457,278,476,277,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,499,339,494,339,489,339,470,341,463,342,463,344,464,346,466,347,467,353,461,355,460,355,461,353,461,353,459,348,458,348,457,351,456,353,455,353,453,353">
|
||||
<area href="#" state="NC" full="North Carolina" shape="poly" coords="603,231,605,234,607,239,608,241,609,242,608,242,608,243,608,246,606,247,605,248,605,251,602,252,600,251,599,251,598,251,598,251,598,252,599,252,600,253,599,257,602,257,602,259,604,257,605,257,603,260,601,263,600,263,599,263,597,263,593,265,589,269,587,272,585,277,584,278,581,279,577,281,570,275,560,269,559,269,549,269,546,270,545,267,543,266,531,266,526,267,520,270,515,272,514,272,510,273,505,274,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,533,244,539,243,550,242,563,239,578,237,591,234,599,232,603,231">
|
||||
<area href="#" state="NC" shape="poly" coords="606,255,608,253,610,251,611,251,611,249,611,245,610,243,609,242,610,242,612,245,612,248,612,251,610,252,608,254,607,255,606,255">
|
||||
<area href="#" state="TN" full="Tennessee" shape="poly" coords="505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,431,260,429,265,428,267,428,270,427,272,424,274,425,276,425,279,423,281,429,281,447,279,451,279,457,278,476,277,484,276,490,275,497,275,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,529,243,527,245,521,245,512,246,505,247">
|
||||
<area href="#" state="RI" full="Rhode Island" shape="poly" coords="633,145,633,142,632,139,632,134,635,134,637,134,639,137,641,140,639,142,638,141,638,143,635,144,633,145">
|
||||
<area href="#" state="CT" full="Connecticut" shape="poly" coords="634,145,633,142,632,139,632,134,628,135,612,139,612,141,614,146,614,152,613,154,614,155,617,153,620,151,621,149,622,149,624,149,628,148,634,145">
|
||||
<area href="#" state="MA" full="Massachusetts" shape="poly" coords="653,140,654,140,654,139,655,139,656,140,655,141,652,141,653,140">
|
||||
<area href="#" state="MA" shape="poly" coords="645,141,647,139,648,139,650,140,648,141,647,142,645,141">
|
||||
<area href="#" state="MA" shape="poly" coords="620,125,633,122,635,122,636,119,639,118,641,122,639,125,639,126,641,128,641,128,642,128,644,129,647,134,650,134,651,134,653,132,652,130,650,129,649,129,648,128,649,128,650,128,652,128,653,131,654,132,654,134,651,135,648,137,645,140,644,141,644,140,646,140,646,138,645,136,644,137,643,138,643,140,641,140,639,137,637,134,635,134,632,134,628,135,612,139,611,134,611,127,615,126,620,125">
|
||||
<area href="#" state="ME" full="Maine" shape="poly" coords="669,71,671,72,672,75,672,76,671,80,669,80,667,83,663,86,660,85,659,86,658,87,657,88,659,89,658,89,658,92,656,92,656,90,656,89,655,89,653,87,652,88,653,89,653,90,653,91,653,93,653,95,652,96,650,97,650,98,646,101,644,101,644,100,641,103,642,105,641,106,641,110,640,115,638,114,638,112,635,111,635,109,629,92,626,81,628,81,629,81,629,80,629,75,631,72,632,69,631,68,631,63,632,62,632,60,632,59,632,56,633,52,635,46,637,43,638,43,638,43,638,44,639,45,641,46,642,45,642,44,645,42,647,41,647,41,652,43,653,44,659,65,664,65,665,67,665,70,667,72,668,72,668,71,667,71,669,71">
|
||||
<area href="#" state="ME" shape="poly" coords="654,92,655,92,656,92,656,94,655,95,654,92">
|
||||
<area href="#" state="ME" shape="poly" coords="659,88,660,89,662,87,662,86,660,86,659,88">
|
||||
<area href="#" state="NH" shape="poly" coords="639,118,639,117,640,115,638,114,638,112,635,111,635,109,629,92,626,81,626,81,625,83,624,82,623,81,623,83,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,633,122,635,122,636,119,639,118">
|
||||
<area href="#" state="VT" shape="poly" coords="611,127,611,123,609,115,608,115,606,113,607,112,606,110,605,107,605,104,605,100,603,95,602,92,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,615,126,611,127">
|
||||
<area href="#" state="NY" full="New York" shape="poly" coords="600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,541,148,542,147,542,146,543,146,545,144,545,143,547,141,548,140,548,140,547,137,545,137,544,133,546,131,549,131,552,129,554,129,559,129,560,130,562,130,563,129,565,128,569,128,570,127,572,125,572,123,574,123,575,122,575,120,575,119,575,118,575,116,575,115,574,115,572,115,572,114,572,112,576,108,577,107,578,105,580,102,582,99,584,98,585,96,587,95,591,95,593,95,597,93,602,92,603,95,605,100,605,104,605,107,606,110,607,112,606,113,608,115,609,115,611,123,611,127,611,134,611,138,612,141,614,146,614,152,613,154,614,155,614,156,612,158,613,158,614,158,614,158,616,155,617,155,618,155,620,155,626,153,628,151,629,150,632,151,629,154,626,155,621,160,620,160,615,161,612,162,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="NJ" full="New Jersey" shape="poly" coords="600,152,599,155,599,156,597,158,597,160,598,161,598,163,596,164,597,165,597,166,599,167,600,168,602,170,604,171,604,172,602,174,601,176,599,178,598,179,597,179,597,180,596,182,597,184,599,185,603,188,606,188,606,189,605,190,605,191,606,191,608,190,608,186,611,183,613,179,614,175,613,174,613,167,611,164,611,165,609,165,608,165,609,164,611,163,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="PA" full="Pennsylvania" shape="poly" coords="597,179,598,179,599,178,601,176,602,174,604,172,604,171,602,170,600,168,599,167,597,166,597,165,596,164,598,163,598,161,597,160,597,158,599,156,599,155,600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,535,153,534,154,531,156,533,170,534,178,537,191,540,191,549,190,576,185,587,182,593,181,594,180,596,179,597,179">
|
||||
<area href="#" state="DE" shape="poly" coords="596,182,597,180,597,179,596,179,594,180,593,182,594,185,596,188,597,196,599,200,602,200,606,199,605,194,604,194,602,192,600,189,599,186,597,185,596,183,596,182">
|
||||
<area href="#" state="MD" shape="poly" coords="606,199,602,200,599,200,597,196,596,188,594,185,593,181,587,182,576,185,549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,587,207,589,208,590,208,591,206,590,205,590,203,588,202,587,198,588,194,588,193,587,191,590,188,591,186,591,187,590,188,590,191,590,192,591,192,591,196,590,197,590,200,590,199,591,197,593,199,591,200,591,203,593,205,596,205,597,205,599,209,600,209,600,212,599,215,599,220,599,222,601,222,602,219,602,217,602,212,605,208,606,203,606,199">
|
||||
<area href="#" state="MD" shape="poly" coords="595,206,596,208,596,209,596,211,596,206,595,206">
|
||||
<area href="#" state="WV" shape="poly" coords="549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,571,195,566,193,563,192,563,196,563,197,562,200,561,200,559,202,559,204,557,204,556,206,555,210,554,210,552,209,551,208,550,208,550,211,548,216,545,224,545,224,545,227,544,228,542,227,540,230,538,229,537,232,530,233,528,234,527,233,525,233,524,230,521,229,520,227,518,224,517,223,515,221,515,221,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,177,537,191,540,191,549,190">
|
||||
<area href="#" state="VA" full="Virginia" shape="poly" coords="524,230,525,233,527,233,528,234,530,233,532,232,538,229,540,230,542,227,544,228,545,227,545,224,545,224,548,216,550,211,550,208,551,208,552,209,554,210,555,210,556,206,557,204,559,204,559,202,561,200,562,200,563,197,563,196,563,192,566,193,571,195,572,191,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,585,208,589,209,590,210,593,210,594,212,593,215,594,215,594,217,596,218,596,220,593,219,593,220,594,221,594,221,596,222,596,224,596,225,595,227,595,227,597,227,599,226,600,226,603,231,599,232,591,234,578,237,563,239,550,242,539,243,533,244,530,243,529,243,527,245,521,245,512,246,505,247,507,246,511,244,514,242,514,241,515,239,518,236,521,233,524,230">
|
||||
<area href="#" state="KY" full="Kentucky" shape="poly" coords="524,230,521,233,518,236,515,239,514,241,514,242,511,244,507,246,505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,432,255,434,254,435,253,435,251,436,249,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,449,233,450,232,455,231,458,231,458,233,460,233,461,230,463,230,464,231,465,232,467,231,467,229,469,227,470,227,470,228,473,228,474,227,474,225,476,222,479,220,480,216,482,216,485,215,487,213,486,212,485,211,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,216,515,221,515,221,517,223,518,224,520,227,521,229,524,230">
|
||||
<area href="#" state="OH" full="Ohio" shape="poly" coords="531,156,526,159,523,161,521,163,518,166,515,167,513,167,509,169,508,169,505,167,501,167,500,166,497,165,494,166,487,167,481,167,482,179,483,188,485,205,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,178,533,170,531,156">
|
||||
<area href="#" state="MI" full="Michigan" shape="poly" coords="422,74,423,73,425,72,428,69,430,68,431,69,427,73,424,74,422,75,422,74">
|
||||
<area href="#" state="MI" shape="poly" coords="484,98,485,99,487,99,488,98,485,96,484,96,483,97,484,98">
|
||||
<area href="#" state="MI" shape="poly" coords="506,143,503,137,502,131,500,128,498,127,497,128,494,129,493,133,491,135,490,136,489,135,490,129,491,127,491,125,493,124,493,116,491,115,491,114,490,113,491,112,491,113,491,111,490,110,489,107,487,107,484,107,480,104,478,104,477,104,476,104,474,103,473,104,470,106,470,108,471,108,473,109,473,110,471,110,470,110,468,111,468,113,468,114,468,118,466,119,465,119,465,116,467,115,467,113,467,113,465,113,464,116,462,117,461,118,461,119,461,119,461,122,459,122,459,122,460,125,459,128,458,131,458,135,458,136,458,137,458,138,458,140,460,145,462,149,463,152,463,156,462,161,460,164,460,166,458,168,457,169,461,169,476,167,481,167,481,167,487,167,494,166,498,165,497,164,497,164,499,161,500,159,500,156,501,155,502,155,502,152,503,149,504,150,504,151,505,151,506,150,506,143">
|
||||
<area href="#" state="MI" shape="poly" coords="410,95,412,95,414,94,416,92,416,92,417,92,421,91,423,89,426,88,426,87,428,85,429,84,430,83,431,81,434,80,438,79,439,80,439,80,436,81,435,83,433,84,433,86,431,88,431,90,431,90,432,89,434,87,436,89,437,89,440,89,440,90,442,92,444,94,446,94,448,93,449,95,450,95,451,94,452,94,453,93,456,91,458,90,463,89,467,89,468,87,470,87,470,92,470,92,472,92,473,92,478,91,479,90,479,90,479,95,482,98,483,98,484,99,483,99,482,99,479,98,478,99,476,99,474,100,473,100,468,99,464,99,464,101,458,101,457,102,455,104,455,105,455,105,453,104,450,106,449,106,449,104,448,104,447,107,446,110,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95">
|
||||
<area href="#" state="WY" full="Wyoming" shape="poly" coords="257,119,249,118,226,116,214,114,194,111,179,109,178,117,175,135,171,157,170,164,169,173,174,174,186,176,192,176,207,178,234,181,252,182,255,150,257,132,257,119">
|
||||
<area href="#" state="MT" full="Montana" shape="poly" coords="259,104,260,95,261,77,262,66,263,56,240,53,219,51,197,48,174,44,161,41,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,179,109,194,111,214,114,226,116,249,118,257,119,259,107,259,104">
|
||||
<area href="#" state="ID" full="Idaho" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,117,81,118,74,120,62,124,47,126,38,127,35,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,175,135,172,157,168,156,162,155,155,154,146,152,137,151,131,149,124,148,117,146,102,143">
|
||||
<area href="#" state="WA" full="Washington" shape="poly" coords="68,19,71,20,78,22,84,23,98,28,116,32,127,35,126,38,124,47,120,62,118,74,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,45,57,44,58,42,56,42,54,44,53,46,50,44,50,44,47,47,47,45,44,44,40,44,38,44,32,43,29,44,23,47,23,48,25,50,27,53,29,56,30,58,30,60,32,62,32,64,32,64,30,65,29,67,29,67,29,67,31,65,31,65,32,66,33,67,35,68,37,69,36,69,35,68,35,68,32,68,31,68,30,68,29,69,26,68,24,67,20,67,20,68,19">
|
||||
<area href="#" state="WA" shape="poly" coords="61,23,62,23,62,24,64,23,65,23,66,24,65,26,65,26,65,28,64,28,63,26,63,26,62,27,61,26,61,23">
|
||||
<area shape="circle" state="TX" coords="300,350,30" nohref>
|
||||
<area href="#" state="TX" full="Texas" shape="poly" coords="259,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,370,307,372,305,374,306,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,374,369,367,372,366,374,364,375,362,376,362,377,358,380,356,382,352,385,347,386,343,389,342,390,338,392,335,393,332,397,329,397,329,398,330,400,329,404,329,407,328,410,327,413,328,415,329,420,329,425,331,426,330,428,328,429,324,426,320,425,319,425,317,425,314,423,310,422,304,419,302,417,302,412,299,411,299,409,299,409,299,406,299,406,298,405,299,402,298,400,296,399,293,396,290,392,287,389,287,388,284,379,283,376,282,374,282,374,278,370,275,368,275,367,274,365,269,365,263,364,261,362,258,364,255,365,254,367,253,370,250,374,248,376,246,375,245,374,243,374,241,372,241,372,239,371,236,369,230,363,229,360,229,354,227,350,226,347,224,347,224,345,221,344,219,342,214,337,213,335,210,332,209,329,207,327,206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256">
|
||||
<area href="#" state="TX" shape="poly" coords="332,426,331,421,329,416,329,410,329,404,332,399,335,395,337,393,338,393,334,398,331,403,329,407,329,411,329,416,332,421,332,425,332,425,332,426">
|
||||
|
||||
<area href="#" state="CA" full="California" shape="poly" coords="99,296,102,295,104,293,104,291,101,291,101,290,101,289,101,285,103,284,105,282,105,278,107,276,108,275,110,273,112,272,112,271,111,270,110,269,110,266,107,262,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,58,133,48,130,39,127,34,125,26,123,20,122,20,125,19,131,15,139,13,141,13,142,11,143,11,146,10,148,12,151,13,154,14,156,14,161,13,164,12,167,11,170,13,173,14,176,17,180,17,182,17,185,17,185,17,187,21,191,20,194,20,195,20,197,20,203,21,205,23,207,25,207,26,209,24,212,23,213,22,213,22,216,22,218,24,221,26,225,26,228,27,230,30,235,31,236,32,239,32,239,32,241,32,242,31,248,30,249,32,251,35,251,38,253,41,254,43,254,45,257,47,260,48,262,51,263,54,264,56,266,56,268,55,268,55,269,57,269,59,269,62,273,65,276,65,278,67,281,67,283,67,290,68,291,74,292,89,294,99,296">
|
||||
<area href="#" state="CA" shape="poly" coords="35,259,36,260,36,261,34,261,33,260,33,259,35,259">
|
||||
<area href="#" state="CA" shape="poly" coords="37,259,38,258,40,260,42,261,41,261,38,261,37,260,37,259">
|
||||
<area href="#" state="CA" shape="poly" coords="52,273,53,275,53,275,55,276,55,275,54,274,53,272,52,272,52,273">
|
||||
<area href="#" state="CA" shape="poly" coords="50,279,52,282,53,283,52,284,51,282,50,279">
|
||||
<area href="#" state="AZ" full="Arizona" shape="poly" coords="100,296,98,297,98,298,98,299,112,306,120,312,131,318,143,326,152,327,172,330,173,320,176,301,181,262,184,239,165,237,146,233,122,229,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,107,262,110,266,110,269,111,270,112,271,112,272,110,273,108,275,107,276,105,278,105,282,103,284,101,285,101,289,101,290,101,291,104,291,104,293,102,295,100,296">
|
||||
<area href="#" state="NV" full="Nevada" shape="poly" coords="102,143,117,146,124,148,131,149,137,151,136,155,133,167,131,182,129,189,128,199,125,211,123,221,122,230,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,92,141,102,143">
|
||||
<area href="#" state="UT" full="Utah" shape="poly" coords="184,240,165,237,146,233,122,229,123,221,125,211,128,199,129,189,131,182,133,167,136,155,137,151,146,152,155,154,162,155,168,156,172,157,170,164,169,173,174,174,186,176,193,176,191,192,188,209,185,229,185,237,184,240">
|
||||
<area href="#" state="CO" full="Colorado" shape="poly" coords="272,248,275,201,276,185,252,182,234,181,207,178,192,176,191,192,188,209,185,229,185,237,184,240,209,242,236,246,260,248,264,248,272,248">
|
||||
<area href="#" state="NM" full="New Mexico" shape="poly" coords="206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256,260,248,236,246,209,242,184,240,181,262,176,301,173,320,172,330,183,331,184,324,196,326,206,327">
|
||||
<area href="#" state="OR" full="Oregon" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,42,60,41,65,38,72,36,77,32,87,28,97,22,106,20,108,20,114,19,119,20,122,26,123,34,125,39,127,48,130,58,133,68,135">
|
||||
<area href="#" state="OR" shape="poly" coords="102,143,68,135,92,141,102,143">
|
||||
<area href="#" state="ND" full="North Dakota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,314,59,300,58,281,57,263,56,262,66,261,77,260,95,259,104,300,107,342,107">
|
||||
<area href="#" state="SD" full="South Dakota" shape="poly" coords="343,162,343,161,341,159,343,155,344,152,341,150,341,148,342,146,344,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107,300,107,259,104,259,107,257,119,257,132,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,343,162">
|
||||
<area href="#" state="NE" full="Nebraska" shape="poly" coords="352,194,353,195,353,197,354,200,356,203,352,203,320,203,291,201,275,200,276,185,252,182,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,344,162,344,167,347,172,347,176,349,178,349,182,350,185,350,190,352,194">
|
||||
<area href="#" state="IA" full="Iowa" shape="poly" coords="411,161,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,350,190,350,185,349,182,349,178,347,176,347,172,344,167,344,162,342,161,341,159,343,155,344,152,341,150,341,148,342,146,343,146,352,146,388,146,401,146,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161">
|
||||
<area href="#" state="MS" full="Mississippipi" shape="poly" coords="453,353,452,354,449,354,448,353,446,353,441,355,440,354,438,357,437,358,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,429,281,447,279,451,279,451,284,451,296,450,318,450,329,452,342,453,353">
|
||||
<area href="#" state="IN" full="Indiana" shape="poly" coords="449,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,452,171,452,172,453,172,455,170,457,169,461,169,476,167,481,167,481,167,482,179,483,188,485,205,485,209,485,211,486,212,487,213,485,215,482,216,480,216,479,220,476,222,474,225,474,227,473,228,470,228,470,227,469,227,467,229,467,231,465,232,464,231,463,230,461,230,460,233,458,233,458,231,455,231,450,232,449,233">
|
||||
<area href="#" state="IL" full="Illinois" shape="poly" coords="448,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,449,170,448,168,447,165,446,164,445,162,444,158,437,159,418,161,411,160,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,195,403,197,403,200,404,206,410,211,414,213,413,217,414,218,419,218,421,219,421,221,419,226,419,228,420,231,425,235,428,236,429,239,431,241,431,243,431,246,433,248,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,448,233">
|
||||
<area href="#" state="MN" full="Minnesota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,357,59,357,53,358,53,359,53,361,54,362,58,362,62,364,63,367,63,368,65,372,65,372,66,376,66,376,65,377,65,378,64,379,65,381,65,384,67,388,68,389,68,390,68,391,68,392,70,393,71,394,71,395,71,395,72,397,73,399,73,400,72,402,70,404,69,404,71,405,71,406,71,407,71,413,71,414,73,415,73,415,72,419,72,418,74,415,75,408,78,405,80,403,81,401,84,399,86,398,87,395,91,394,91,392,93,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,146,401,146,388,146,352,146,343,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107">
|
||||
<area href="#" state="WI" full="Wisconsin" shape="poly" coords="444,158,444,155,443,152,443,148,442,146,443,143,443,141,444,140,444,137,443,134,444,134,445,131,446,130,445,128,445,127,446,125,448,120,449,116,449,113,449,113,449,113,446,118,444,121,443,122,442,124,441,125,440,126,439,125,439,125,440,122,441,119,443,118,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95,410,96,410,96,409,95,407,95,406,95,404,95,404,95,404,94,406,92,407,91,405,89,404,90,401,92,396,94,394,95,392,94,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161,418,161,437,159,444,158">
|
||||
<area href="#" state="MO" full="Missouri" shape="poly" coords="404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,353,195,353,197,354,200,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251,365,254,366,259,383,258,400,258,415,257,423,257,424,259,424,261,422,263,421,265,425,266,429,265,431,260,431,256,433,255,434,254,435,253,435,251,436,249,435,248,433,248,431,246,431,243,431,241,429,239,428,236,425,235,420,231,419,228,419,226,421,221,421,219,419,218,414,218,413,217,414,213,410,211,404,206,403,200,403,197,404,196">
|
||||
<area href="#" state="AR" full="Arkansas" shape="poly" coords="429,265,425,266,421,265,422,263,424,261,424,259,423,257,415,257,400,258,383,258,366,259,367,264,367,270,368,278,368,305,370,307,372,305,374,306,374,314,391,314,404,314,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,425,280,425,276,424,274,427,272,428,270,428,267,429,265">
|
||||
<area href="#" state="OK" full="Oklahoma" shape="poly" coords="272,248,264,248,260,248,260,248,260,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,368,278,367,270,367,264,366,259,365,254,365,251,356,251,322,251,290,249,272,248">
|
||||
<area href="#" state="KS" full="Kansas" shape="poly" coords="365,251,356,251,322,251,290,249,272,248,275,200,291,201,320,203,352,203,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251">
|
||||
<area href="#" state="LA" full="Louisiana" shape="poly" coords="437,357,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,404,314,391,314,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,382,367,388,366,395,369,400,370,403,369,405,370,407,371,408,369,406,368,404,368,401,367,406,366,407,366,410,366,410,368,410,370,414,370,416,371,415,372,414,373,415,374,421,377,424,376,425,374,426,374,428,372,428,373,429,375,428,376,428,377,431,375,432,373,433,373,431,372,431,371,431,370,433,370,434,369,434,369,440,374,441,374,443,374,444,375,446,373,446,372,445,372,443,370,438,369,436,368,437,366,438,366,439,365,437,365,437,365,440,365,441,362,440,361,440,359,439,359,437,361,437,362,434,362,434,361,435,359,437,358,437,357">
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 3 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 136 KiB |
4
rus/admin/_V4/_lib/ImageMapster-master/examples/redist/jquery.1.7.2.min.js
vendored
Normal file
102
rus/admin/_V4/_lib/ImageMapster-master/examples/shapes-ie.html
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>shapes</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
|
||||
<script type="text/javascript" src="../dist/jquery.imagemapster.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
function state_change(data) {
|
||||
//alert(data.state+":"+data.selected);
|
||||
}
|
||||
$('img').mapster({
|
||||
onStateChange: state_change,
|
||||
fillColor: '0a7a0a',
|
||||
fillOpacity: 0.7,
|
||||
mapKey: "group",
|
||||
noHrefIsMask: false,
|
||||
render_select: {
|
||||
fillColor: 'adadad',
|
||||
fillOpacity: 0.5
|
||||
|
||||
},
|
||||
areas: [
|
||||
{
|
||||
key: 'blue-circle',
|
||||
includeKeys: 'rectangle'
|
||||
},
|
||||
{
|
||||
key: 'rectangle',
|
||||
stroke: true,
|
||||
strokeWidth: 3
|
||||
},
|
||||
{
|
||||
key: 'outer-circle',
|
||||
includeKeys: 'outer-circle-perimeter,inner-circle-perimeter'
|
||||
},
|
||||
{
|
||||
key: 'inner-circle',
|
||||
stroke: true,
|
||||
strokeColor: 'adadad',
|
||||
strokeWidth:3,
|
||||
fill: true
|
||||
|
||||
},
|
||||
{
|
||||
key: 'outer-circle-perimeter',
|
||||
stroke: true,
|
||||
strokeWidth:3,
|
||||
fill: false
|
||||
|
||||
},
|
||||
{
|
||||
key: 'inner-circle-perimeter',
|
||||
stroke: true,
|
||||
strokeWidth: 3,
|
||||
fill: false
|
||||
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
||||
|
||||
<h2>Shapes Demo (For Full IE Compatibility)</h2>
|
||||
<p>While masks sort of work for Internet Explorer 6-8, if you really want to create areas within areas, you can use polygons to split
|
||||
a shape into two connecting parts and combine them as a group. This example is created by rendering the outer circle in two
|
||||
"c-shaped" halves and rendering the inner circle separately. The other "shapes" demo uses masks and much less markup to do the same thing,
|
||||
but more complex situations where the inner area is not a solid color might not work as well in IE.</p>
|
||||
<p><ul><li>The outer circle is selected independently from the inner circle.</li>
|
||||
<li>The rightmost rectangle is selected with the center circle (and has independent rendering options), but does not itself respond to mouse events.</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p><a href="/imagemapster">Return to ImageMapster home</a></p>
|
||||
<img src="images/shapes.jpg" width="512" height="176" border="0" alt="" usemap="#shapes_Map">
|
||||
<map name="shapes_Map">
|
||||
<!-- ImageReady Slices (shapes.jpg) -->
|
||||
<area shape="rect" group="rectangle" alt="" coords="378,39,463,116" nohref>
|
||||
<area shape="poly" group="blue-circle" alt="" coords="286,34, 298,42, 308,54, 314,79, 307,103, 292,118, 270,125, 242,122, 227,112, 216,97, 212,73, 219,53, 227,43, 240,34, 264,29" href="#">
|
||||
<area shape="poly" group="outer-circle" alt="" coords="100,22, 100,46, 90,47, 88,48, 82,51, 73,58, 66,68, 64,81, 65,90, 66,92, 69,98, 77,107, 85,112, 95,115, 100,115, 100,139, 93,138, 83,137, 81,136, 73,133, 71,132, 60,125, 49,113, 42,99, 39,85, 40,69, 41,67, 44,57, 51,45, 65,32, 81,25, 85,24, 91,23" href="#">
|
||||
<area shape="poly" group="outer-circle" alt="" coords="108,23, 123,26, 139,35, 151,48, 158,62, 161,76, 160,92, 159,94, 156,104, 149,116, 135,129, 125,134, 115,137, 109,138, 100,138, 100,115, 111,114, 113,113, 122,108, 132,98, 135,92, 137,83, 136,71, 135,69, 132,63, 124,54, 113,48, 109,47, 105,46, 100,46, 100,22"
|
||||
href="#">
|
||||
<!-- End ImageReady Slices -->
|
||||
|
||||
<area shape="circle" group="inner-circle" coords="101,81,36" href="#">
|
||||
|
||||
<!-- concentric circles for stroke highlighting -->
|
||||
<area shape="circle" group="inner-circle-perimeter" coords="101,81,36" nohref>
|
||||
<area shape="circle" group="outer-circle-perimeter" coords="100,81,59" nohref>
|
||||
<!-- End circles -->
|
||||
|
||||
</map>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
111
rus/admin/_V4/_lib/ImageMapster-master/examples/shapes.html
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>shapes</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../src/redist/when.js"></script>
|
||||
<script type="text/javascript" src="../src/core.js"></script>
|
||||
<script type="text/javascript" src="../src/graphics.js"></script>
|
||||
<script type="text/javascript" src="../src/mapimage.js"></script>
|
||||
<script type="text/javascript" src="../src/mapdata.js"></script>
|
||||
<script type="text/javascript" src="../src/areadata.js"></script>
|
||||
<script type="text/javascript" src="../src/areacorners.js"></script>
|
||||
<script type="text/javascript" src="../src/scale.js"></script>
|
||||
<script type="text/javascript" src="../src/tooltip.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
function state_change(data) {
|
||||
//alert(data.state+":"+data.selected);
|
||||
}
|
||||
$('img').mapster({
|
||||
noHrefIsMask: false,
|
||||
onStateChange: state_change,
|
||||
fillColor: '0a7a0a',
|
||||
fillOpacity: 0.7,
|
||||
mapKey: "group",
|
||||
strokeWidth: 2,
|
||||
stroke:true,
|
||||
strokeColor: 'F88017',
|
||||
render_select: {
|
||||
fillColor: 'adadad',
|
||||
fillOpacity: 0.5
|
||||
|
||||
},
|
||||
areas: [
|
||||
{
|
||||
key: 'blue-circle',
|
||||
includeKeys: 'rectangle',
|
||||
stroke:false
|
||||
},
|
||||
{
|
||||
key: 'rectangle',
|
||||
stroke: true,
|
||||
strokeWidth: 3
|
||||
},
|
||||
{
|
||||
key: 'outer-circle',
|
||||
includeKeys: 'inner-circle-mask,outer-circle-mask',
|
||||
stroke: true
|
||||
},
|
||||
{
|
||||
key: 'outer-circle-mask',
|
||||
isMask: true,
|
||||
fillColorMask: 'ff002a'
|
||||
},
|
||||
{
|
||||
key: 'inner-circle-mask',
|
||||
fillColorMask: 'ffffff',
|
||||
isMask: true
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
||||
|
||||
<h2>Shapes Demo</h2>
|
||||
<p>This demo shows some advanced features using multiple groups and exclusions.<p>
|
||||
<p><ul><li>The outer circle is selected independently from the inner circle.</li>
|
||||
<li>The inner circle area is used twice - once as an exclusion from the outer circle to create the ring effect, and again as its own
|
||||
area. This is done by specifying two different groups in its "mapKey" and then specifying options for both to create the desired effect.</li>
|
||||
<li>The small circle within the ring when highlighed is another exclusion and shows excluding multiple areas.</li>
|
||||
<li>The rightmost rectangle is selected with the center circle (and has independent rendering options), but does not itself respond to mouse events.</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
With Internet Explorer 6-8, masking is not possible. In this case the effect is simulated by rendering the masked area with a specific color
|
||||
that can be defined with the "fillColorMask" option. This option is ignored when using HTML5 canvases. The default is white, which is used
|
||||
for the inner circle, and 2nd small circle in the ring is set specifically to match the color of the ring area.
|
||||
</p>
|
||||
<p><a href="/imagemapster">Return to ImageMapster home</a></p>
|
||||
<img src="images/shapes.jpg" width="512" height="176" border="0" alt="" usemap="#shapes_Map">
|
||||
<map name="shapes_Map">
|
||||
<!-- ImageReady Slices (shapes.jpg) -->
|
||||
<area shape="rect" group="rectangle" alt="" coords="378,39,463,116" href="#">
|
||||
<area shape="poly" group="blue-circle" alt="" coords="286,34, 298,42, 308,54, 314,79, 307,103, 292,118, 270,125, 242,122, 227,112, 216,97, 212,73, 219,53, 227,43, 240,34, 264,29" href="#">
|
||||
<!--
|
||||
<area shape="poly" group="outer-circle" alt="" coords="100,22, 100,46, 90,47, 88,48, 82,51, 73,58, 66,68, 64,81, 65,90, 66,92, 69,98, 77,107, 85,112, 95,115, 100,115, 100,139, 93,138, 83,137, 81,136, 73,133, 71,132, 60,125, 49,113, 42,99, 39,85, 40,69, 41,67, 44,57, 51,45, 65,32, 81,25, 85,24, 91,23" href="#">
|
||||
<area shape="poly" group="outer-circle" alt="" coords="108,23, 123,26, 139,35, 151,48, 158,62, 161,76, 160,92, 159,94, 156,104, 149,116, 135,129, 125,134, 115,137, 109,138, 100,138, 100,115, 111,114, 113,113, 122,108, 132,98, 135,92, 137,83, 136,71, 135,69, 132,63, 124,54, 113,48, 109,47, 105,46, 100,46, 100,22"
|
||||
href="#">
|
||||
|
||||
<area shape="circle" group="inner-circle" coords="101,81,36" href="#">
|
||||
-->
|
||||
<!-- concentric circles for stroke highlighting -->
|
||||
<area shape="circle" group="inner-circle,inner-circle-mask" coords="101,81,36" href="#">
|
||||
<area shape="circle" group="outer-circle-mask" coords="148,81,12" nohref >
|
||||
<area shape="circle" group="outer-circle" coords="100,81,59" href="#">
|
||||
<!-- End circles -->
|
||||
|
||||
</map>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
155
rus/admin/_V4/_lib/ImageMapster-master/examples/tooltips.html
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Tooltip Examples</title>
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../src/redist/when.js"></script>
|
||||
<script type="text/javascript" src="../src/core.js"></script>
|
||||
<script type="text/javascript" src="../src/graphics.js"></script>
|
||||
<script type="text/javascript" src="../src/mapdata.js"></script>
|
||||
<script type="text/javascript" src="../src/mapimage.js"></script>
|
||||
<script type="text/javascript" src="../src/areadata.js"></script>
|
||||
<script type="text/javascript" src="../src/areacorners.js"></script>
|
||||
<script type="text/javascript" src="../src/scale.js"></script>
|
||||
<script type="text/javascript" src="../src/tooltip.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body
|
||||
{
|
||||
font-family: Arial, Helvetica;
|
||||
font-size: 12px;
|
||||
}
|
||||
h1
|
||||
{
|
||||
padding-top: 4px; padding-bottom:4px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
input[type="text"]
|
||||
{
|
||||
width:30px;
|
||||
}
|
||||
td
|
||||
{
|
||||
padding: 6px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
div.label
|
||||
{
|
||||
clear:both;
|
||||
float:left;
|
||||
width:100px;
|
||||
height:24px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
div.input
|
||||
{
|
||||
float:left;
|
||||
height:24px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
function state_change(data) {
|
||||
//alert(data.state+":"+data.selected);
|
||||
}
|
||||
$('b').bind('mouseover', function() {
|
||||
$('img').mapster('tooltip',this,"The text is: " + $(this).text());
|
||||
|
||||
});
|
||||
|
||||
$('img').mapster({
|
||||
showToolTip: true,
|
||||
noHrefIsMask: false,
|
||||
onStateChange: state_change,
|
||||
fillColor: '0a7a0a',
|
||||
fillOpacity: 0.7,
|
||||
mapKey: "group",
|
||||
strokeWidth: 2,
|
||||
stroke:true,
|
||||
strokeColor: 'F88017',
|
||||
render_select: {
|
||||
fillColor: 'adadad',
|
||||
fillOpacity: 0.5
|
||||
|
||||
},
|
||||
areas: [
|
||||
{
|
||||
key: 'blue-circle',
|
||||
includeKeys: 'rectangle',
|
||||
stroke:false,
|
||||
toolTip: 'blue circle (really a poly)'
|
||||
|
||||
},
|
||||
{
|
||||
key: 'rectangle',
|
||||
stroke: true,
|
||||
strokeWidth: 3,
|
||||
toolTip: 'rectangle'
|
||||
},
|
||||
{
|
||||
key: 'outer-circle',
|
||||
includeKeys: 'inner-circle-mask,outer-circle-mask',
|
||||
stroke: true,
|
||||
toolTip: 'outer circle (a real circle)'
|
||||
},
|
||||
{
|
||||
key: 'outer-circle-mask',
|
||||
isMask: true,
|
||||
fillColorMask: 'ff002a'
|
||||
},
|
||||
{
|
||||
key: 'inner-circle-mask',
|
||||
fillColorMask: 'ffffff',
|
||||
isMask: true
|
||||
},
|
||||
{
|
||||
key: 'inner-circle',
|
||||
toolTip: 'inner circle'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2>Advanced ToolTip Example</h2>
|
||||
<p>
|
||||
This shows how to use new ToolTip features in 1.2.6 to render tooltips manually, and for any area (inside or outside an imagemap)
|
||||
</p>
|
||||
|
||||
<img src="images/shapes.jpg" width="512" height="176" border="0" alt="" usemap="#shapes_Map">
|
||||
<map name="shapes_Map">
|
||||
<!-- ImageReady Slices (shapes.jpg) -->
|
||||
<area shape="rect" group="rectangle" alt="" coords="378,39,463,116" href="#">
|
||||
<area shape="poly" group="blue-circle" alt="" coords="286,34, 298,42, 308,54, 314,79, 307,103, 292,118, 270,125, 242,122, 227,112, 216,97, 212,73, 219,53, 227,43, 240,34, 264,29" href="#">
|
||||
<!--
|
||||
<area shape="poly" group="outer-circle" alt="" coords="100,22, 100,46, 90,47, 88,48, 82,51, 73,58, 66,68, 64,81, 65,90, 66,92, 69,98, 77,107, 85,112, 95,115, 100,115, 100,139, 93,138, 83,137, 81,136, 73,133, 71,132, 60,125, 49,113, 42,99, 39,85, 40,69, 41,67, 44,57, 51,45, 65,32, 81,25, 85,24, 91,23" href="#">
|
||||
<area shape="poly" group="outer-circle" alt="" coords="108,23, 123,26, 139,35, 151,48, 158,62, 161,76, 160,92, 159,94, 156,104, 149,116, 135,129, 125,134, 115,137, 109,138, 100,138, 100,115, 111,114, 113,113, 122,108, 132,98, 135,92, 137,83, 136,71, 135,69, 132,63, 124,54, 113,48, 109,47, 105,46, 100,46, 100,22"
|
||||
href="#">
|
||||
|
||||
<area shape="circle" group="inner-circle" coords="101,81,36" href="#">
|
||||
-->
|
||||
<!-- concentric circles for stroke highlighting -->
|
||||
<area shape="circle" group="inner-circle,inner-circle-mask" coords="101,81,36" href="#">
|
||||
<area shape="circle" group="outer-circle-mask" coords="148,81,12" nohref >
|
||||
<area shape="circle" group="outer-circle" coords="100,81,59" href="#">
|
||||
<!-- End circles -->
|
||||
|
||||
</map>
|
||||
|
||||
<div style="top:400; left:200;max-width: 200px;border: 1px solid black; margin:10px; padding:10px;">
|
||||
This is a div. <b style="border: 1px solid red;">This is some content.</b> Thi
|
||||
</div>
|
||||
</html>
|
||||
572
rus/admin/_V4/_lib/ImageMapster-master/examples/usa.html
Normal file
|
|
@ -0,0 +1,572 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Untitled Document</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="../../zepto/src/zepto.js"></script>
|
||||
<script type="text/javascript" src="../../zepto/src/event.js"></script>
|
||||
<script type="text/javascript" src="../../zepto/src/fx.js"></script>
|
||||
<script type="text/javascript" src="../src/zepto.js"></script>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="../dist/jquery.imagemapster.js"></script>
|
||||
-->
|
||||
|
||||
<script type="text/javascript" src="../src/redist/when.js"></script>
|
||||
<script type="text/javascript" src="../src/core.js"></script>
|
||||
<script type="text/javascript" src="../src/graphics.js"></script>
|
||||
<script type="text/javascript" src="../src/mapimage.js"></script>
|
||||
<script type="text/javascript" src="../src/mapdata.js"></script>
|
||||
<script type="text/javascript" src="../src/areadata.js"></script>
|
||||
<script type="text/javascript" src="../src/areacorners.js"></script>
|
||||
<script type="text/javascript" src="../src/scale.js"></script>
|
||||
<script type="text/javascript" src="../src/tooltip.js"></script>
|
||||
|
||||
|
||||
<STYLE TYPE="text/css">
|
||||
|
||||
body
|
||||
{
|
||||
font-family: Arial, Helvetica;
|
||||
font-size: 12px;
|
||||
}
|
||||
h1
|
||||
{
|
||||
padding-top: 4px; padding-bottom:4px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
input[type="text"]
|
||||
{
|
||||
width:30px;
|
||||
}
|
||||
td
|
||||
{
|
||||
padding: 6px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
div.label
|
||||
{
|
||||
clear:both;
|
||||
float:left;
|
||||
width:100px;
|
||||
height:24px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
div.input
|
||||
{
|
||||
float:left;
|
||||
height:24px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</STYLE>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<div id="map_demo" style="width:920px; height:1000px;">
|
||||
<p><b>Disclaimer:</b> This demo is old and the code is stylistically bad and probably difficult to understand. I <b>strongly</b> recommend using the online demos at <a href="http://www.outsharked.com/imagemapster">the project web site</a>
|
||||
as references for learning how to use imagemapster. I have kept this in the project mostly as a way to play with different options,
|
||||
but the code is a poor example of style and I would not advise using it as a learning tool.
|
||||
</p>
|
||||
<div style="width:720px; border:0; overflow: hidden; float:left;">
|
||||
<img style="width:720px;border:0;" id="usa_image" src="images/usa_map_720.png" usemap="#usa" >
|
||||
</div>
|
||||
<div id="statelist" style="float:left; padding-left: 10px; width:180px; height: 445px; overflow-y: scroll;"></div>
|
||||
|
||||
<div style="clear:both; height:8px;"></div>
|
||||
<div>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
<b>Using This Demonstration</b>
|
||||
<ul><li>Change rendering options for highlight or select and click "update" to cause them to take effect.</li>
|
||||
<li>If you change the "Highlight Fill" or "Selection Fill" option, the map and all other options will be reset. (As of version 1.2.4.043 the fill type can't be changed after the map is bound.)</li>
|
||||
</ul>
|
||||
<p>Choose the style in which highlights will be rendered. For fill, "normal" uses solid color fills. The other options use an alternate image as the source of the fill.
|
||||
"Alternate image" requires HTML5 canvas support. In browsers that do not support it, typically Internet Explorer < 9, it will always look the same as "normal."</p>
|
||||
|
||||
Make changes to the options below and click here to update the map: <input id="update" type="submit" value="Update">
|
||||
|
||||
|
||||
<table>
|
||||
<tr><th colspan="3">
|
||||
<h1>Image Size</h1>
|
||||
</th></tr>
|
||||
<tr><td colspan="3">
|
||||
<b>You can change the size</b> of an image just by changing the width or height attributes. Size (enter width only, max. 720): <input id="img_width" type="text"><br>
|
||||
</td></tr>
|
||||
|
||||
<tr><th>
|
||||
<h1>Highlight Types</h1>
|
||||
</th>
|
||||
<th><h1>Selection Styles</h1></th>
|
||||
<th><h1>Options</h1></th>
|
||||
</tr>
|
||||
<tr><td width="33%" valign="top">
|
||||
<i>Choose the style in which highlights will be rendered.</i><br /><br />
|
||||
<div class="label">Highlight fill:</div><select id="highlight_style">
|
||||
<option value="0">Normal</option>
|
||||
<option value="1">Alternate Image 1</option>
|
||||
<option value="2">Alternate Image 2</option>
|
||||
<option value="3">Alternate Image 3</option>
|
||||
<option value="4">Alternate Image 4</option>
|
||||
<option value="5">Alternate Image 5</option>
|
||||
</select><br />
|
||||
<div class="label">Stroke (border):</div> <div class="input"><input id="stroke_highlight" type="checkbox"></div>
|
||||
<div class="label">Stroke width:</div><div class="input"> <input id="strokewidth_highlight" type="text" ></div>
|
||||
<div class="label">Stroke opacity:</div> <div class="input"><input id="strokeopacity_highlight" type="text"></div>
|
||||
<div class="label">Fill opacity:</div><div class="input"><input id="fill_highlight" type="text"></div>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<i>Choose the style in which selections will be rendered.</i><br /><br />
|
||||
<div class="label">Selection fill:</div> <select id="select_style">
|
||||
<option value="0">Normal</option>
|
||||
<option value="1">Alternate Image 1</option>
|
||||
<option value="2">Alternate Image 2</option>
|
||||
<option value="3">Alternate Image 3</option>
|
||||
<option value="4">Alternate Image 4</option>
|
||||
<option value="5">Alternate Image 5</option>
|
||||
</select><br />
|
||||
<div class="label">Stroke:</div><div class="input"> <input id="stroke_select" type="checkbox" /></div>
|
||||
<div class="label">Stroke width:</div> <div class="input"><input id="strokewidth_select" type="text"></div>
|
||||
<div class="label">Stroke opacity:</div><div class="input"> <input id="strokeopacity_select" type="text"></div>
|
||||
<div class="label">Fill opacity:</div> <div class="input"><input id="fill_select" type="text"></div>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<br />
|
||||
<a id="tooltip" href="#">Enable/disable toolTips.</a> [<span id="tooltip_state">disabled</span>]<br>
|
||||
<a id="single_select" href="#">Enable/disable singleSelect.</a> [<span id="single_select_state">disabled</span>]<br>
|
||||
<a id="is_deselectable" href="#">Enable/disable isDeselectable.</a> [<span id="is_deselectable_state">enabled</span>]<br>
|
||||
|
||||
<a id="unbind_link" href="#">Unbind the map.</a><br>
|
||||
<a id="rebind_link" href="#">Rebind the map.</a><br>
|
||||
<a id="unbind_link_preserve" href="#">Click here to unbind, preserving state.</a><br>
|
||||
Mouseout delay: <input type="text" id="mouseout-delay" value="0" style="width:30px;">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr><th colspan="3"><h1>Get Data Out</h1></th></tr>
|
||||
<tr><td colspan="3">
|
||||
<a id="show_selected" href="#">Click here to show selected items:</a>
|
||||
<span id="selections"></span>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
if (window.Zepto) {
|
||||
jQuery = Zepto;
|
||||
(function ($) {
|
||||
if ($) {
|
||||
$.fn.prop = $.fn.attr;
|
||||
}
|
||||
} (jQuery));
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var $statelist, $usamap, ratio,
|
||||
mapsterConfigured = function () {
|
||||
// set html settings values
|
||||
var opts = $usamap.mapster('get_options', null, true);
|
||||
if (!ratio) {
|
||||
ratio = $usamap.width() / $usamap.height();
|
||||
}
|
||||
$('#stroke_highlight').prop("checked", opts.render_highlight.stroke);
|
||||
$('#strokewidth_highlight').val(opts.render_highlight.strokeWidth);
|
||||
$('#fill_highlight').val(opts.render_highlight.fillOpacity);
|
||||
$('#strokeopacity_highlight').val(opts.render_highlight.strokeOpacity);
|
||||
$('#stroke_select').prop("checked", opts.render_select.stroke);
|
||||
$('#strokewidth_select').val(opts.render_select.strokeWidth);
|
||||
$('#fill_select').val(opts.render_select.fillOpacity);
|
||||
$('#strokeopacity_select').val(opts.render_select.strokeOpacity);
|
||||
$('#mouseout-delay').val(opts.mouseoutDelay);
|
||||
$('#img_width').val($usamap.width());
|
||||
},
|
||||
default_options =
|
||||
{
|
||||
fillOpacity: 0.5,
|
||||
render_highlight: {
|
||||
fillColor: '2aff00',
|
||||
stroke: true
|
||||
},
|
||||
render_select: {
|
||||
fillColor: 'ff000c',
|
||||
stroke: false
|
||||
},
|
||||
//render_zoom: {
|
||||
// altImage: 'images/usa_map_huge.jpg'
|
||||
//},
|
||||
mouseoutDelay: 0,
|
||||
fadeInterval: 50,
|
||||
isSelectable: true,
|
||||
singleSelect: false,
|
||||
mapKey: 'state',
|
||||
mapValue: 'full',
|
||||
listKey: 'name',
|
||||
listSelectedAttribute: 'checked',
|
||||
sortList: "asc",
|
||||
onGetList: addCheckBoxes,
|
||||
//onClick: function (e) {
|
||||
// styleCheckbox(e.selected, e.listTarget);
|
||||
// if (!utils.isScrolledIntoView(e.listTarget, false, $statelist)) {
|
||||
// utils.centerOn($statelist, e.listTarget);
|
||||
// }
|
||||
//if (e.key==='OH') {
|
||||
// $usamap.mapster('zoom','OH');
|
||||
// return false;
|
||||
//}
|
||||
// return true;
|
||||
//},
|
||||
onConfigured: mapsterConfigured,
|
||||
showToolTip: false,
|
||||
toolTipClose: ["area-mouseout"],
|
||||
areas: [
|
||||
{ key: "TX",
|
||||
toolTip: $('<div>Don\'t mess with Texas. Why? <a href="http://dontmesswithtexas.org/" target="_blank">Click here</a> for more info.</div>')
|
||||
|
||||
},
|
||||
{ key: "ME",
|
||||
toolTip: $('<div style="margin:auto; width:100px;"><img src="images/lobster-small.gif"/></div><div style="clear:both;"></div><p>Trees, ocean, lobsters, it\'s all here.</p>'),
|
||||
selected: true
|
||||
|
||||
},
|
||||
{ key: "AK",
|
||||
toolTip: "Alaska.. wild, and cold. And, you cannot select this area, but you can see the tooltip.",
|
||||
isSelectable: false
|
||||
},
|
||||
{ key: "WA",
|
||||
staticState: true
|
||||
},
|
||||
{ key: "OR",
|
||||
staticState: false
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
function styleCheckbox(selected, $checkbox) {
|
||||
var nowWeight = selected ? "bold" : "normal";
|
||||
$checkbox.closest('div').css("font-weight", nowWeight);
|
||||
}
|
||||
|
||||
function addCheckBoxes(items) {
|
||||
var item, selected;
|
||||
$statelist.children().remove();
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
selected = items[i].isSelected();
|
||||
item = $('<div><input type="checkbox" name="' + items[i].key + '"' + (selected ? "checked" : "") + '><span class="sel" key="' + items[i].key + '">' + items[i].value + '</span></div>');
|
||||
|
||||
$statelist.append(item);
|
||||
}
|
||||
$statelist.find('span.sel').unbind('click').bind('click', function (e) {
|
||||
var key = $(this).attr('key');
|
||||
$usamap.mapster('highlight', true, key);
|
||||
});
|
||||
// return the list to mapster so it can bind to it
|
||||
return $statelist.find('input[type="checkbox"]').unbind('click').click(function (e) {
|
||||
var selected = $(this).is(':checked');
|
||||
$usamap.mapster('set', selected, $(this).attr('name'));
|
||||
styleCheckbox(selected, $(this));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$statelist = $('#statelist');
|
||||
$usamap = $('#usa_image');
|
||||
function bindlinks() {
|
||||
$('*').unbind();
|
||||
$("#unbind_link").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
$usamap.mapster("unbind");
|
||||
$usamap.width(720);
|
||||
bindlinks();
|
||||
});
|
||||
$("#rebind_link").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
$usamap.mapster(default_options);
|
||||
});
|
||||
|
||||
$("#unbind_link_preserve").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
$usamap.mapster("unbind", true);
|
||||
bindlinks();
|
||||
});
|
||||
$("#tooltip").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
var state = !$usamap.mapster('get_options').showToolTip;
|
||||
$('#tooltip_state').text(state ? "enabled" : "disabled");
|
||||
$usamap.mapster("set_options", { showToolTip: state });
|
||||
});
|
||||
$("#show_selected").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
$('#selections').text($("#usa_image").mapster("get"));
|
||||
});
|
||||
$("#single_select").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
var state = !$usamap.mapster('get_options').singleSelect;
|
||||
$('#single_select_state').text(state ? "enabled" : "disabled");
|
||||
$usamap.mapster("set_options", { singleSelect: state });
|
||||
});
|
||||
$("#is_deselectable").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
var state = !$usamap.mapster('get_options').isDeselectable;
|
||||
$('#is_deselectable_state').text(state ? "enabled" : "disabled");
|
||||
$usamap.mapster("set_options", { isDeselectable: state });
|
||||
});
|
||||
function getSelected(sel) {
|
||||
var item=$();
|
||||
sel.each(function() {
|
||||
if (this.selected) {
|
||||
item=item.add(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
return item;
|
||||
|
||||
}
|
||||
|
||||
function getFillOptions(el) {
|
||||
var new_options,
|
||||
val = getSelected($(el).find("option")).val();
|
||||
|
||||
if (val > "0") {
|
||||
new_options = {
|
||||
altImage: 'images/usa_map_720_alt_' + val + '.jpg',
|
||||
stroke: true
|
||||
};
|
||||
} else {
|
||||
new_options = {
|
||||
altImage: null,
|
||||
stroke: false
|
||||
};
|
||||
}
|
||||
return new_options;
|
||||
}
|
||||
|
||||
function getNewOptions() {
|
||||
var options,
|
||||
render_highlight = getFillOptions($('#highlight_style')),
|
||||
render_select = getFillOptions($('#select_style'));
|
||||
|
||||
options = $.extend({},
|
||||
default_options,
|
||||
{
|
||||
render_select: render_select,
|
||||
render_highlight: render_highlight
|
||||
});
|
||||
|
||||
return options;
|
||||
|
||||
}
|
||||
$("#highlight_style, #select_style").bind("change", function (e) {
|
||||
e.preventDefault();
|
||||
$statelist.children().remove();
|
||||
|
||||
$usamap.mapster(getNewOptions());
|
||||
|
||||
});
|
||||
$("#update").click(function (e) {
|
||||
var newOpts = {};
|
||||
function setOption(base, opt, value) {
|
||||
if (value !== '' && value !== null) {
|
||||
base[opt] = value;
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
newOpts.render_highlight = {};
|
||||
setOption(newOpts.render_highlight, "stroke", $('#stroke_highlight').prop("checked"));
|
||||
|
||||
setOption(newOpts.render_highlight, "strokeWidth", $('#strokewidth_highlight').val());
|
||||
setOption(newOpts.render_highlight, "fillOpacity", $('#fill_highlight').val());
|
||||
setOption(newOpts.render_highlight, "strokeOpacity", $('#strokeopacity_highlight').val());
|
||||
|
||||
newOpts.render_select = {};
|
||||
setOption(newOpts.render_select, "stroke", $('#stroke_select').prop("checked"));
|
||||
setOption(newOpts.render_select, "strokeWidth", $('#strokewidth_select').val());
|
||||
setOption(newOpts.render_select, "fillOpacity", $('#fill_select').val());
|
||||
setOption(newOpts.render_select, "strokeOpacity", $('#strokeopacity_select').val());
|
||||
setOption(newOpts, "mouseoutDelay", $('#mouseout-delay').val());
|
||||
var width = parseInt($('#img_width').val(), 10);
|
||||
|
||||
if ($usamap.width() != width) {
|
||||
$('#update').prop("disabled",true);
|
||||
$usamap.mapster('resize', width, null, 1000,function() {
|
||||
$('#update').prop("disabled",false);
|
||||
});
|
||||
} else {
|
||||
$usamap.mapster('set_options', newOpts);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bindlinks();
|
||||
|
||||
$usamap.mapster(default_options);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Utility functions
|
||||
// If you are copying code you probably won't need these.
|
||||
|
||||
|
||||
var utils = {};
|
||||
// Tells if an element is completely visible. if the 2nd parm is true, it only looks at the top.
|
||||
|
||||
utils.isScrolledIntoView = function (elem, topOnly, container) {
|
||||
var useWindow = false, docViewTop, docViewBottom, elemTop, elemBottom;
|
||||
|
||||
if (!container) {
|
||||
container = window;
|
||||
useWindow = true;
|
||||
}
|
||||
|
||||
|
||||
if (useWindow) {
|
||||
docViewTop = $(container).scrollTop();
|
||||
elemTop = elem.offset().top;
|
||||
} else {
|
||||
docViewTop = 0;
|
||||
elemTop = elem.position().top;
|
||||
}
|
||||
docViewBottom = docViewTop + $(container).height();
|
||||
elemBottom = elemTop + elem.height();
|
||||
|
||||
|
||||
if (topOnly) {
|
||||
return elemTop >= docViewTop && elemTop <= docViewBottom;
|
||||
} else {
|
||||
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));
|
||||
}
|
||||
};
|
||||
|
||||
utils.centerOn = function ($container, $element) {
|
||||
$container.animate({
|
||||
scrollTop: $element.position().top - ($container.height() / 2)
|
||||
}, 'slow');
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<map id="usa_image_map" name="usa">
|
||||
<area href="http://www.washingtonpost.com" state="NH" full="New Hampshire" shape="rect" coords="512,29,586,44">
|
||||
<area href="#" state="VT" full="Vermont" shape="rect" coords="543,49,586,62">
|
||||
<area href="#" state="MA" full="Massachusetts" shape="rect" coords="515,68,585,80">
|
||||
<area href="#" state="RI" full="Rhode Island" shape="rect" coords="650,149,711,161">
|
||||
<area href="#" state="CT" full="Connecticut" shape="rect" coords="655,167,711,179">
|
||||
<area href="#" state="NJ" full="New Jersey" shape="rect" coords="656,185,711,198">
|
||||
<area href="#" state="DE" full="Delaware" shape="rect" coords="665,204,711,216">
|
||||
<area href="#" state="MD" full="Maryland" shape="rect" coords="667,223,711,235">
|
||||
<area href="#" state="DC" full="District of Columbia" shape="rect" coords="654,239,711,252">
|
||||
<area href="#" state="WV" full="West Virginia" shape="rect" coords="649,257,711,270">
|
||||
<area href="#" state="SC" full="South Carolina" shape="poly" coords="551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,520,270,526,267,531,266,543,266,545,267,546,270,549,269,559,269,560,269,570,275,577,281,573,284,572,289,571,293,569,294,569,296,567,296,566,299,563,301,562,303,561,304,558,306,556,307,557,309,553,313,551,314">
|
||||
<area href="#" state="HI" full="Hawaii" shape="poly" coords="169,391,170,389,172,388,172,389,170,391,169,391">
|
||||
<area href="#" state="HI" shape="poly" coords="176,389,181,390,182,390,183,387,183,385,180,384,177,386,176,389">
|
||||
<area href="#" state="HI" shape="poly" coords="199,395,201,400,203,399,204,399,205,400,208,400,208,398,206,398,205,395,203,392,199,395,199,395">
|
||||
<area href="#" state="HI" shape="poly" coords="213,402,214,401,218,401,218,401,222,401,222,402,221,404,217,403,213,402">
|
||||
<area href="#" state="HI" shape="poly" coords="217,406,218,409,221,407,221,407,220,405,217,405,217,406">
|
||||
<area href="#" state="HI" shape="poly" coords="222,405,224,403,227,404,230,405,233,407,233,409,231,410,227,411,226,410,222,405">
|
||||
<area href="#" state="HI" shape="poly" coords="234,416,236,415,238,416,243,419,245,421,247,422,248,425,251,428,251,428,248,431,245,431,244,431,242,432,240,435,239,437,237,437,235,435,234,431,235,430,233,426,232,425,232,422,233,422,235,419,236,419,234,418,234,416">
|
||||
<area href="#" state="AK" full="Alaska" shape="poly" coords="114,344,114,405,116,406,118,406,119,405,121,405,121,407,125,413,126,414,128,413,129,413,129,410,131,410,131,409,133,408,135,410,135,412,137,413,137,414,140,416,143,420,145,422,146,425,147,428,151,428,155,430,155,434,156,436,155,438,154,440,152,439,152,437,149,436,149,435,148,436,149,437,149,440,148,440,146,440,145,438,146,440,146,441,146,441,143,437,143,435,141,434,141,430,140,430,140,433,140,433,139,430,138,428,137,427,138,431,138,432,137,431,134,427,133,426,132,424,131,422,130,421,130,419,131,419,131,418,129,419,127,417,125,415,122,413,119,411,119,409,119,407,118,409,116,410,113,409,109,407,105,407,104,407,100,404,98,404,96,400,94,400,92,401,92,404,92,402,93,403,92,406,95,404,95,405,92,408,91,408,91,407,90,406,89,407,87,405,85,407,83,408,81,410,77,410,77,408,80,408,80,407,78,407,79,404,80,402,80,401,80,400,84,398,85,399,86,399,86,398,83,397,80,399,77,401,77,404,75,405,72,406,70,408,70,410,71,410,72,411,70,414,65,417,60,420,59,421,54,422,50,423,52,424,51,425,50,426,49,425,46,425,46,427,45,427,45,425,43,426,41,427,38,426,36,428,34,428,32,428,31,429,29,428,27,428,26,428,25,429,24,428,24,427,26,426,31,426,34,425,35,424,38,423,39,422,41,422,42,424,43,423,44,422,47,421,49,420,50,420,50,420,51,420,52,418,55,416,56,414,58,410,59,410,59,407,58,409,56,409,55,407,54,407,53,408,53,410,53,410,51,406,50,407,50,406,50,405,47,405,45,406,43,406,44,404,44,403,44,401,45,401,46,401,45,399,45,396,45,395,44,396,40,396,38,395,38,392,37,390,37,389,38,389,38,387,39,386,38,386,38,386,37,384,38,380,41,378,43,377,44,374,46,374,48,374,48,376,50,376,53,374,53,374,54,375,56,375,57,374,58,371,58,366,56,367,54,368,53,367,50,366,47,366,44,363,44,360,44,359,43,357,41,355,42,354,47,353,48,353,49,354,50,354,50,353,53,353,54,353,55,353,54,355,54,356,56,357,59,359,61,358,59,355,59,353,59,352,56,350,56,350,56,349,56,346,54,342,52,339,54,338,56,338,58,338,61,338,64,335,65,333,67,332,68,332,71,332,73,330,74,330,74,331,78,331,80,329,80,329,83,330,85,332,84,332,85,333,86,332,89,332,89,335,90,336,95,337,100,340,101,339,105,341,107,341,108,340,111,341,114,344">
|
||||
<area href="#" state="AK" shape="poly" coords="31,365,32,368,32,369,30,368,29,366,28,365,26,365,26,363,27,361,28,363,29,364,31,365">
|
||||
<area href="#" state="AK" shape="poly" coords="29,389,32,389,35,390,35,391,34,393,32,393,29,391,29,389">
|
||||
<area href="#" state="AK" shape="poly" coords="14,378,15,380,16,381,15,382,14,380,14,378,14,378">
|
||||
<area href="#" state="AK" shape="poly" coords="4,431,7,430,9,429,11,429,11,431,13,431,14,429,14,428,16,428,18,430,17,431,14,432,12,431,9,431,6,431,5,432,4,431">
|
||||
<area href="#" state="AK" shape="poly" coords="40,428,41,430,42,428,41,428,40,428">
|
||||
<area href="#" state="AK" shape="poly" coords="42,431,43,428,44,429,44,431,42,431">
|
||||
<area href="#" state="AK" shape="poly" coords="59,429,60,430,61,429,60,428,59,429">
|
||||
<area href="#" state="AK" shape="poly" coords="65,420,66,424,68,425,72,422,75,421,74,419,74,417,73,418,71,418,71,417,73,417,76,416,77,415,74,414,75,413,73,414,70,417,66,419,65,420">
|
||||
<area href="#" state="AK" shape="poly" coords="96,406,98,404,97,403,95,404,96,406">
|
||||
<area href="#" state="FL" full="Florida" shape="poly" coords="548,337,549,343,552,350,556,356,558,361,562,365,565,368,566,370,565,371,565,372,566,377,569,380,571,383,573,387,577,393,578,399,578,407,578,409,578,411,576,413,577,413,576,415,576,417,577,419,575,421,572,422,569,422,569,423,567,424,566,423,565,422,565,421,564,418,562,414,559,413,557,413,556,413,554,410,553,407,551,404,550,404,549,405,548,405,546,401,544,398,542,395,540,392,537,390,539,388,541,384,541,383,538,383,536,383,537,383,539,384,538,387,537,388,536,385,535,381,535,379,536,376,536,369,533,366,533,364,529,363,527,362,526,361,524,359,523,357,521,356,519,353,516,353,514,351,512,351,509,352,509,353,509,354,509,355,507,355,504,357,502,359,499,359,497,360,497,358,495,356,493,356,492,355,486,352,481,350,477,351,473,351,469,353,466,353,466,347,464,346,463,344,463,342,470,341,489,339,494,339,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337">
|
||||
<area href="#" state="FL" shape="poly" coords="557,434,558,433,560,433,560,431,562,430,563,431,564,431,564,431,562,432,559,433,557,434,557,434">
|
||||
<area href="#" state="FL" shape="poly" coords="566,430,567,431,569,429,573,426,576,423,578,419,578,417,578,415,578,415,577,417,576,420,574,425,571,428,568,428,566,430">
|
||||
<area href="#" state="GA" full="Georgia" shape="poly" coords="500,274,497,275,490,275,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337,547,332,548,325,550,322,549,320,552,315,551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,514,272,510,273,505,274,500,274">
|
||||
<area href="#" state="AL" full="Alabama" shape="poly" coords="453,353,452,342,450,329,450,318,451,296,451,284,451,279,457,278,476,277,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,499,339,494,339,489,339,470,341,463,342,463,344,464,346,466,347,467,353,461,355,460,355,461,353,461,353,459,348,458,348,457,351,456,353,455,353,453,353">
|
||||
<area href="#" state="NC" full="North Carolina" shape="poly" coords="603,231,605,234,607,239,608,241,609,242,608,242,608,243,608,246,606,247,605,248,605,251,602,252,600,251,599,251,598,251,598,251,598,252,599,252,600,253,599,257,602,257,602,259,604,257,605,257,603,260,601,263,600,263,599,263,597,263,593,265,589,269,587,272,585,277,584,278,581,279,577,281,570,275,560,269,559,269,549,269,546,270,545,267,543,266,531,266,526,267,520,270,515,272,514,272,510,273,505,274,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,533,244,539,243,550,242,563,239,578,237,591,234,599,232,603,231">
|
||||
<area href="#" state="NC" shape="poly" coords="606,255,608,253,610,251,611,251,611,249,611,245,610,243,609,242,610,242,612,245,612,248,612,251,610,252,608,254,607,255,606,255">
|
||||
<area href="#" state="TN" full="Tennessee" shape="poly" coords="505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,431,260,429,265,428,267,428,270,427,272,424,274,425,276,425,279,423,281,429,281,447,279,451,279,457,278,476,277,484,276,490,275,497,275,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,529,243,527,245,521,245,512,246,505,247">
|
||||
<area href="#" state="RI" full="Rhode Island" shape="poly" coords="633,145,633,142,632,139,632,134,635,134,637,134,639,137,641,140,639,142,638,141,638,143,635,144,633,145">
|
||||
<area href="#" state="CT" full="Connecticut" shape="poly" coords="634,145,633,142,632,139,632,134,628,135,612,139,612,141,614,146,614,152,613,154,614,155,617,153,620,151,621,149,622,149,624,149,628,148,634,145">
|
||||
<area href="#" state="MA" full="Massachusetts" shape="poly" coords="653,140,654,140,654,139,655,139,656,140,655,141,652,141,653,140">
|
||||
<area href="#" state="MA" shape="poly" coords="645,141,647,139,648,139,650,140,648,141,647,142,645,141">
|
||||
<area href="#" state="MA" shape="poly" coords="620,125,633,122,635,122,636,119,639,118,641,122,639,125,639,126,641,128,641,128,642,128,644,129,647,134,650,134,651,134,653,132,652,130,650,129,649,129,648,128,649,128,650,128,652,128,653,131,654,132,654,134,651,135,648,137,645,140,644,141,644,140,646,140,646,138,645,136,644,137,643,138,643,140,641,140,639,137,637,134,635,134,632,134,628,135,612,139,611,134,611,127,615,126,620,125">
|
||||
<area href="#" state="ME" full="Maine" shape="poly" coords="669,71,671,72,672,75,672,76,671,80,669,80,667,83,663,86,660,85,659,86,658,87,657,88,659,89,658,89,658,92,656,92,656,90,656,89,655,89,653,87,652,88,653,89,653,90,653,91,653,93,653,95,652,96,650,97,650,98,646,101,644,101,644,100,641,103,642,105,641,106,641,110,640,115,638,114,638,112,635,111,635,109,629,92,626,81,628,81,629,81,629,80,629,75,631,72,632,69,631,68,631,63,632,62,632,60,632,59,632,56,633,52,635,46,637,43,638,43,638,43,638,44,639,45,641,46,642,45,642,44,645,42,647,41,647,41,652,43,653,44,659,65,664,65,665,67,665,70,667,72,668,72,668,71,667,71,669,71">
|
||||
<area href="#" state="ME" shape="poly" coords="654,92,655,92,656,92,656,94,655,95,654,92">
|
||||
<area href="#" state="ME" shape="poly" coords="659,88,660,89,662,87,662,86,660,86,659,88">
|
||||
<area href="#" state="NH" shape="poly" coords="639,118,639,117,640,115,638,114,638,112,635,111,635,109,629,92,626,81,626,81,625,83,624,82,623,81,623,83,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,633,122,635,122,636,119,639,118">
|
||||
<area href="#" state="VT" shape="poly" coords="611,127,611,123,609,115,608,115,606,113,607,112,606,110,605,107,605,104,605,100,603,95,602,92,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,615,126,611,127">
|
||||
<area href="#" state="NY" full="New York" shape="poly" coords="600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,541,148,542,147,542,146,543,146,545,144,545,143,547,141,548,140,548,140,547,137,545,137,544,133,546,131,549,131,552,129,554,129,559,129,560,130,562,130,563,129,565,128,569,128,570,127,572,125,572,123,574,123,575,122,575,120,575,119,575,118,575,116,575,115,574,115,572,115,572,114,572,112,576,108,577,107,578,105,580,102,582,99,584,98,585,96,587,95,591,95,593,95,597,93,602,92,603,95,605,100,605,104,605,107,606,110,607,112,606,113,608,115,609,115,611,123,611,127,611,134,611,138,612,141,614,146,614,152,613,154,614,155,614,156,612,158,613,158,614,158,614,158,616,155,617,155,618,155,620,155,626,153,628,151,629,150,632,151,629,154,626,155,621,160,620,160,615,161,612,162,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="NJ" full="New Jersey" shape="poly" coords="600,152,599,155,599,156,597,158,597,160,598,161,598,163,596,164,597,165,597,166,599,167,600,168,602,170,604,171,604,172,602,174,601,176,599,178,598,179,597,179,597,180,596,182,597,184,599,185,603,188,606,188,606,189,605,190,605,191,606,191,608,190,608,186,611,183,613,179,614,175,613,174,613,167,611,164,611,165,609,165,608,165,609,164,611,163,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="PA" full="Pennsylvania" shape="poly" coords="597,179,598,179,599,178,601,176,602,174,604,172,604,171,602,170,600,168,599,167,597,166,597,165,596,164,598,163,598,161,597,160,597,158,599,156,599,155,600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,535,153,534,154,531,156,533,170,534,178,537,191,540,191,549,190,576,185,587,182,593,181,594,180,596,179,597,179">
|
||||
<area href="#" state="DE" shape="poly" coords="596,182,597,180,597,179,596,179,594,180,593,182,594,185,596,188,597,196,599,200,602,200,606,199,605,194,604,194,602,192,600,189,599,186,597,185,596,183,596,182">
|
||||
<area href="#" state="MD" shape="poly" coords="606,199,602,200,599,200,597,196,596,188,594,185,593,181,587,182,576,185,549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,587,207,589,208,590,208,591,206,590,205,590,203,588,202,587,198,588,194,588,193,587,191,590,188,591,186,591,187,590,188,590,191,590,192,591,192,591,196,590,197,590,200,590,199,591,197,593,199,591,200,591,203,593,205,596,205,597,205,599,209,600,209,600,212,599,215,599,220,599,222,601,222,602,219,602,217,602,212,605,208,606,203,606,199">
|
||||
<area href="#" state="MD" shape="poly" coords="595,206,596,208,596,209,596,211,596,206,595,206">
|
||||
<area href="#" state="WV" shape="poly" coords="549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,571,195,566,193,563,192,563,196,563,197,562,200,561,200,559,202,559,204,557,204,556,206,555,210,554,210,552,209,551,208,550,208,550,211,548,216,545,224,545,224,545,227,544,228,542,227,540,230,538,229,537,232,530,233,528,234,527,233,525,233,524,230,521,229,520,227,518,224,517,223,515,221,515,221,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,177,537,191,540,191,549,190">
|
||||
<area href="#" state="VA" full="Virginia" shape="poly" coords="524,230,525,233,527,233,528,234,530,233,532,232,538,229,540,230,542,227,544,228,545,227,545,224,545,224,548,216,550,211,550,208,551,208,552,209,554,210,555,210,556,206,557,204,559,204,559,202,561,200,562,200,563,197,563,196,563,192,566,193,571,195,572,191,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,585,208,589,209,590,210,593,210,594,212,593,215,594,215,594,217,596,218,596,220,593,219,593,220,594,221,594,221,596,222,596,224,596,225,595,227,595,227,597,227,599,226,600,226,603,231,599,232,591,234,578,237,563,239,550,242,539,243,533,244,530,243,529,243,527,245,521,245,512,246,505,247,507,246,511,244,514,242,514,241,515,239,518,236,521,233,524,230">
|
||||
<area href="#" state="KY" full="Kentucky" shape="poly" coords="524,230,521,233,518,236,515,239,514,241,514,242,511,244,507,246,505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,432,255,434,254,435,253,435,251,436,249,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,449,233,450,232,455,231,458,231,458,233,460,233,461,230,463,230,464,231,465,232,467,231,467,229,469,227,470,227,470,228,473,228,474,227,474,225,476,222,479,220,480,216,482,216,485,215,487,213,486,212,485,211,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,216,515,221,515,221,517,223,518,224,520,227,521,229,524,230">
|
||||
<area href="#" state="OH" full="Ohio" shape="poly" coords="531,156,526,159,523,161,521,163,518,166,515,167,513,167,509,169,508,169,505,167,501,167,500,166,497,165,494,166,487,167,481,167,482,179,483,188,485,205,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,178,533,170,531,156">
|
||||
<area href="#" state="MI" full="Michigan" shape="poly" coords="422,74,423,73,425,72,428,69,430,68,431,69,427,73,424,74,422,75,422,74">
|
||||
<area href="#" state="MI" shape="poly" coords="484,98,485,99,487,99,488,98,485,96,484,96,483,97,484,98">
|
||||
<area href="#" state="MI" shape="poly" coords="506,143,503,137,502,131,500,128,498,127,497,128,494,129,493,133,491,135,490,136,489,135,490,129,491,127,491,125,493,124,493,116,491,115,491,114,490,113,491,112,491,113,491,111,490,110,489,107,487,107,484,107,480,104,478,104,477,104,476,104,474,103,473,104,470,106,470,108,471,108,473,109,473,110,471,110,470,110,468,111,468,113,468,114,468,118,466,119,465,119,465,116,467,115,467,113,467,113,465,113,464,116,462,117,461,118,461,119,461,119,461,122,459,122,459,122,460,125,459,128,458,131,458,135,458,136,458,137,458,138,458,140,460,145,462,149,463,152,463,156,462,161,460,164,460,166,458,168,457,169,461,169,476,167,481,167,481,167,487,167,494,166,498,165,497,164,497,164,499,161,500,159,500,156,501,155,502,155,502,152,503,149,504,150,504,151,505,151,506,150,506,143">
|
||||
<area href="#" state="MI" shape="poly" coords="410,95,412,95,414,94,416,92,416,92,417,92,421,91,423,89,426,88,426,87,428,85,429,84,430,83,431,81,434,80,438,79,439,80,439,80,436,81,435,83,433,84,433,86,431,88,431,90,431,90,432,89,434,87,436,89,437,89,440,89,440,90,442,92,444,94,446,94,448,93,449,95,450,95,451,94,452,94,453,93,456,91,458,90,463,89,467,89,468,87,470,87,470,92,470,92,472,92,473,92,478,91,479,90,479,90,479,95,482,98,483,98,484,99,483,99,482,99,479,98,478,99,476,99,474,100,473,100,468,99,464,99,464,101,458,101,457,102,455,104,455,105,455,105,453,104,450,106,449,106,449,104,448,104,447,107,446,110,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95">
|
||||
<area href="#" state="WY" full="Wyoming" shape="poly" coords="257,119,249,118,226,116,214,114,194,111,179,109,178,117,175,135,171,157,170,164,169,173,174,174,186,176,192,176,207,178,234,181,252,182,255,150,257,132,257,119">
|
||||
<area href="#" state="MT" full="Montana" shape="poly" coords="259,104,260,95,261,77,262,66,263,56,240,53,219,51,197,48,174,44,161,41,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,179,109,194,111,214,114,226,116,249,118,257,119,259,107,259,104">
|
||||
<area href="#" state="ID" full="Idaho" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,117,81,118,74,120,62,124,47,126,38,127,35,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,175,135,172,157,168,156,162,155,155,154,146,152,137,151,131,149,124,148,117,146,102,143">
|
||||
<area href="#" state="WA" full="Washington" shape="poly" coords="68,19,71,20,78,22,84,23,98,28,116,32,127,35,126,38,124,47,120,62,118,74,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,45,57,44,58,42,56,42,54,44,53,46,50,44,50,44,47,47,47,45,44,44,40,44,38,44,32,43,29,44,23,47,23,48,25,50,27,53,29,56,30,58,30,60,32,62,32,64,32,64,30,65,29,67,29,67,29,67,31,65,31,65,32,66,33,67,35,68,37,69,36,69,35,68,35,68,32,68,31,68,30,68,29,69,26,68,24,67,20,67,20,68,19">
|
||||
<area href="#" state="WA" shape="poly" coords="61,23,62,23,62,24,64,23,65,23,66,24,65,26,65,26,65,28,64,28,63,26,63,26,62,27,61,26,61,23">
|
||||
|
||||
<area shape="circle" state="TX" coords="300,350,30" nohref>
|
||||
<area shape="circle" state="TX" coords="260,350,20" nohref>
|
||||
<area href="#" state="TX" full="Texas" shape="poly" coords="259,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,370,307,372,305,374,306,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,374,369,367,372,366,374,364,375,362,376,362,377,358,380,356,382,352,385,347,386,343,389,342,390,338,392,335,393,332,397,329,397,329,398,330,400,329,404,329,407,328,410,327,413,328,415,329,420,329,425,331,426,330,428,328,429,324,426,320,425,319,425,317,425,314,423,310,422,304,419,302,417,302,412,299,411,299,409,299,409,299,406,299,406,298,405,299,402,298,400,296,399,293,396,290,392,287,389,287,388,284,379,283,376,282,374,282,374,278,370,275,368,275,367,274,365,269,365,263,364,261,362,258,364,255,365,254,367,253,370,250,374,248,376,246,375,245,374,243,374,241,372,241,372,239,371,236,369,230,363,229,360,229,354,227,350,226,347,224,347,224,345,221,344,219,342,214,337,213,335,210,332,209,329,207,327,206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256">
|
||||
<area href="#" state="TX" shape="poly" coords="332,426,331,421,329,416,329,410,329,404,332,399,335,395,337,393,338,393,334,398,331,403,329,407,329,411,329,416,332,421,332,425,332,425,332,426">
|
||||
|
||||
<area href="#" state="CA" full="California" shape="poly" coords="99,296,102,295,104,293,104,291,101,291,101,290,101,289,101,285,103,284,105,282,105,278,107,276,108,275,110,273,112,272,112,271,111,270,110,269,110,266,107,262,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,58,133,48,130,39,127,34,125,26,123,20,122,20,125,19,131,15,139,13,141,13,142,11,143,11,146,10,148,12,151,13,154,14,156,14,161,13,164,12,167,11,170,13,173,14,176,17,180,17,182,17,185,17,185,17,187,21,191,20,194,20,195,20,197,20,203,21,205,23,207,25,207,26,209,24,212,23,213,22,213,22,216,22,218,24,221,26,225,26,228,27,230,30,235,31,236,32,239,32,239,32,241,32,242,31,248,30,249,32,251,35,251,38,253,41,254,43,254,45,257,47,260,48,262,51,263,54,264,56,266,56,268,55,268,55,269,57,269,59,269,62,273,65,276,65,278,67,281,67,283,67,290,68,291,74,292,89,294,99,296">
|
||||
<area href="#" state="CA" shape="poly" coords="35,259,36,260,36,261,34,261,33,260,33,259,35,259">
|
||||
<area href="#" state="CA" shape="poly" coords="37,259,38,258,40,260,42,261,41,261,38,261,37,260,37,259">
|
||||
<area href="#" state="CA" shape="poly" coords="52,273,53,275,53,275,55,276,55,275,54,274,53,272,52,272,52,273">
|
||||
<area href="#" state="CA" shape="poly" coords="50,279,52,282,53,283,52,284,51,282,50,279">
|
||||
<area href="#" state="AZ" full="Arizona" shape="poly" coords="100,296,98,297,98,298,98,299,112,306,120,312,131,318,143,326,152,327,172,330,173,320,176,301,181,262,184,239,165,237,146,233,122,229,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,107,262,110,266,110,269,111,270,112,271,112,272,110,273,108,275,107,276,105,278,105,282,103,284,101,285,101,289,101,290,101,291,104,291,104,293,102,295,100,296">
|
||||
<area href="#" state="NV" full="Nevada" shape="poly" coords="102,143,117,146,124,148,131,149,137,151,136,155,133,167,131,182,129,189,128,199,125,211,123,221,122,230,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,92,141,102,143">
|
||||
<area href="#" state="UT" full="Utah" shape="poly" coords="184,240,165,237,146,233,122,229,123,221,125,211,128,199,129,189,131,182,133,167,136,155,137,151,146,152,155,154,162,155,168,156,172,157,170,164,169,173,174,174,186,176,193,176,191,192,188,209,185,229,185,237,184,240">
|
||||
<area href="#" state="CO" full="Colorado" shape="poly" coords="272,248,275,201,276,185,252,182,234,181,207,178,192,176,191,192,188,209,185,229,185,237,184,240,209,242,236,246,260,248,264,248,272,248">
|
||||
<area href="#" state="NM" full="New Mexico" shape="poly" coords="206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256,260,248,236,246,209,242,184,240,181,262,176,301,173,320,172,330,183,331,184,324,196,326,206,327">
|
||||
<area href="#" state="OR" full="Oregon" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,42,60,41,65,38,72,36,77,32,87,28,97,22,106,20,108,20,114,19,119,20,122,26,123,34,125,39,127,48,130,58,133,68,135">
|
||||
<area href="#" state="OR" shape="poly" coords="102,143,68,135,92,141,102,143">
|
||||
<area href="#" state="ND" full="North Dakota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,314,59,300,58,281,57,263,56,262,66,261,77,260,95,259,104,300,107,342,107">
|
||||
<area href="#" state="SD" full="South Dakota" shape="poly" coords="343,162,343,161,341,159,343,155,344,152,341,150,341,148,342,146,344,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107,300,107,259,104,259,107,257,119,257,132,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,343,162">
|
||||
<area href="#" state="NE" full="Nebraska" shape="poly" coords="352,194,353,195,353,197,354,200,356,203,352,203,320,203,291,201,275,200,276,185,252,182,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,344,162,344,167,347,172,347,176,349,178,349,182,350,185,350,190,352,194">
|
||||
<area href="#" state="IA" full="Iowa" shape="poly" coords="411,161,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,350,190,350,185,349,182,349,178,347,176,347,172,344,167,344,162,342,161,341,159,343,155,344,152,341,150,341,148,342,146,343,146,352,146,388,146,401,146,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161">
|
||||
<area href="#" state="MS" full="Mississippipi" shape="poly" coords="453,353,452,354,449,354,448,353,446,353,441,355,440,354,438,357,437,358,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,429,281,447,279,451,279,451,284,451,296,450,318,450,329,452,342,453,353">
|
||||
<area href="#" state="IN" full="Indiana" shape="poly" coords="449,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,452,171,452,172,453,172,455,170,457,169,461,169,476,167,481,167,481,167,482,179,483,188,485,205,485,209,485,211,486,212,487,213,485,215,482,216,480,216,479,220,476,222,474,225,474,227,473,228,470,228,470,227,469,227,467,229,467,231,465,232,464,231,463,230,461,230,460,233,458,233,458,231,455,231,450,232,449,233">
|
||||
<area href="#" state="IL" full="Illinois" shape="poly" coords="448,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,449,170,448,168,447,165,446,164,445,162,444,158,437,159,418,161,411,160,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,195,403,197,403,200,404,206,410,211,414,213,413,217,414,218,419,218,421,219,421,221,419,226,419,228,420,231,425,235,428,236,429,239,431,241,431,243,431,246,433,248,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,448,233">
|
||||
<area href="#" state="MN" full="Minnesota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,357,59,357,53,358,53,359,53,361,54,362,58,362,62,364,63,367,63,368,65,372,65,372,66,376,66,376,65,377,65,378,64,379,65,381,65,384,67,388,68,389,68,390,68,391,68,392,70,393,71,394,71,395,71,395,72,397,73,399,73,400,72,402,70,404,69,404,71,405,71,406,71,407,71,413,71,414,73,415,73,415,72,419,72,418,74,415,75,408,78,405,80,403,81,401,84,399,86,398,87,395,91,394,91,392,93,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,146,401,146,388,146,352,146,343,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107">
|
||||
<area href="#" state="WI" full="Wisconsin" shape="poly" coords="444,158,444,155,443,152,443,148,442,146,443,143,443,141,444,140,444,137,443,134,444,134,445,131,446,130,445,128,445,127,446,125,448,120,449,116,449,113,449,113,449,113,446,118,444,121,443,122,442,124,441,125,440,126,439,125,439,125,440,122,441,119,443,118,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95,410,96,410,96,409,95,407,95,406,95,404,95,404,95,404,94,406,92,407,91,405,89,404,90,401,92,396,94,394,95,392,94,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161,418,161,437,159,444,158">
|
||||
<area href="#" state="MO" full="Missouri" shape="poly" coords="404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,353,195,353,197,354,200,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251,365,254,366,259,383,258,400,258,415,257,423,257,424,259,424,261,422,263,421,265,425,266,429,265,431,260,431,256,433,255,434,254,435,253,435,251,436,249,435,248,433,248,431,246,431,243,431,241,429,239,428,236,425,235,420,231,419,228,419,226,421,221,421,219,419,218,414,218,413,217,414,213,410,211,404,206,403,200,403,197,404,196">
|
||||
<area href="#" state="AR" full="Arkansas" shape="poly" coords="429,265,425,266,421,265,422,263,424,261,424,259,423,257,415,257,400,258,383,258,366,259,367,264,367,270,368,278,368,305,370,307,372,305,374,306,374,314,391,314,404,314,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,425,280,425,276,424,274,427,272,428,270,428,267,429,265">
|
||||
<area href="#" state="OK" full="Oklahoma" shape="poly" coords="272,248,264,248,260,248,260,248,260,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,368,278,367,270,367,264,366,259,365,254,365,251,356,251,322,251,290,249,272,248">
|
||||
<area href="#" state="KS" full="Kansas" shape="poly" coords="365,251,356,251,322,251,290,249,272,248,275,200,291,201,320,203,352,203,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251">
|
||||
<area href="#" state="LA" full="Louisiana" shape="poly" coords="437,357,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,404,314,391,314,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,382,367,388,366,395,369,400,370,403,369,405,370,407,371,408,369,406,368,404,368,401,367,406,366,407,366,410,366,410,368,410,370,414,370,416,371,415,372,414,373,415,374,421,377,424,376,425,374,426,374,428,372,428,373,429,375,428,376,428,377,431,375,432,373,433,373,431,372,431,371,431,370,433,370,434,369,434,369,440,374,441,374,443,374,444,375,446,373,446,372,445,372,443,370,438,369,436,368,437,366,438,366,439,365,437,365,437,365,440,365,441,362,440,361,440,359,439,359,437,361,437,362,434,362,434,361,435,359,437,358,437,357">
|
||||
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
||||
128
rus/admin/_V4/_lib/ImageMapster-master/examples/vegetables.html
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Untitled Document</title>
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script>
|
||||
<script type="text/javascript" src="../dist/jquery.imagemapster.js"></script>
|
||||
|
||||
<STYLE TYPE="text/css">
|
||||
|
||||
p, div {
|
||||
font-family: Arial, Helvetica, Sans Serif;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
}
|
||||
</STYLE>
|
||||
</head>
|
||||
|
||||
<body >
|
||||
|
||||
|
||||
<div id="veg_demo" style="width:640px; margin: auto;">
|
||||
<p>Simple example demonstrating <b>singleClick</b> which permits only one area to be selected, and changing a tooltip on the fly.
|
||||
the dip has a tooltip, which is different if asparagus is selected. This also shows how to use area-specific options to control
|
||||
the styling of each area individually. Some areas use different colors for selection to ensure that the highlight is visible
|
||||
even though each area is a substantially different color.
|
||||
|
||||
</p>
|
||||
<div style="clear:both;margin-left:80px;">
|
||||
<img id="veg" src="images/vegetables.jpg" usemap="#veg" >
|
||||
</div>
|
||||
<div style="clear:both; height:8px;"></div>
|
||||
<div id="selections" style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
var image = $('img');
|
||||
var xref = {
|
||||
carrots: "<b>Carrots</b> are delicious and may turn your skin orange!",
|
||||
asparagus: "<b>Asparagus</b> is one of the first vegetables of the spring. Being a dark green, it's great for you, and has interesting side effects.",
|
||||
squash: "<b>Squash</b> is a winter vegetable, and not eaten raw too much. Is that really squash?",
|
||||
redpepper: "<b>Red peppers</b> are actually the same as green peppers, they've just been left on the vine longer. Delicious when fire-roasted.",
|
||||
yellowpepper: "Similar to red peppers, <b>yellow peppers</b> are sometimes sweeter.",
|
||||
celery: "<b>Celery</b> is a fascinating vegetable. Being mostly water, it actually takes your body more calories to process it than it provides.",
|
||||
cucumbers: "<b>Cucumbers</b> are cool.",
|
||||
broccoli: "<b>Broccoli</b> is like a forest of goodness in your mouth. And very good for you. Eat lots of broccoli!",
|
||||
dip: "Everything here is good for you but this one. <b>Don't be a dip!</b>"
|
||||
};
|
||||
var defaultDipTooltip = 'I know you want the dip. But it\'s loaded with saturated fat, just skip it and enjoy as many delicious, crisp vegetables as you can eat.';
|
||||
|
||||
image.mapster(
|
||||
{
|
||||
fillOpacity: 0.4,
|
||||
fillColor: "d42e16",
|
||||
strokeColor: "3320FF",
|
||||
strokeOpacity: 0.8,
|
||||
strokeWidth: 4,
|
||||
stroke: true,
|
||||
isSelectable: true,
|
||||
singleSelect: true,
|
||||
mapKey: 'name',
|
||||
listKey: 'name',
|
||||
onClick: function (e) {
|
||||
var newToolTip = defaultDipTooltip;
|
||||
$('#selections').html(xref[e.key]);
|
||||
if (e.key==='asparagus') {
|
||||
newToolTip = "OK. I know I have come down on the dip before, but let's be real. Raw asparagus without any of that " +
|
||||
"delicious ranch and onion dressing slathered all over it is not so good.";
|
||||
}
|
||||
image.mapster('set_options',{areas: [{
|
||||
key: "dip",
|
||||
toolTip: newToolTip
|
||||
}]
|
||||
});
|
||||
},
|
||||
showToolTip: true,
|
||||
toolTipClose: ["tooltip-click", "area-click"],
|
||||
areas: [
|
||||
{
|
||||
key: "redpepper",
|
||||
fillColor: "ffffff"
|
||||
},
|
||||
{
|
||||
key: "yellowpepper",
|
||||
fillColor: "000000"
|
||||
},
|
||||
{
|
||||
key: "carrots",
|
||||
fillColor: "000000"
|
||||
},
|
||||
{
|
||||
key: "dip",
|
||||
toolTip: defaultDipTooltip
|
||||
},
|
||||
{
|
||||
key: "asparagus",
|
||||
strokeColor: "FFFFFF"
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<map id="veg_map" name="veg">
|
||||
<area shape="poly" name="redpepper" coords="412,156, 427,161, 429,163, 444,153, 453,155, 457,159, 452,168, 459,174, 455,178, 460,179, 463,193, 460,203, 441,214, 436,217, 458,238, 469,257, 479,267, 478,269, 479,285, 458,309, 436,310, 414,305, 410,323, 397,334, 379,313, 389,316, 401,320, 399,305, 382,300, 371,290,
|
||||
367,296, 366,298,
|
||||
338,274, 332,272, 300,239, 316,238, 316,234, 313,230, 328,225, 333,213, 338,196, 333,181, 337,166, 345,145" href="#">
|
||||
<area shape="poly" name="celery" coords="147,131, 156,143, 163,146, 177,129, 175,138, 177,138, 182,144, 180,164, 148,169, 139,171, 144,180, 141,198, 139,208, 140,222, 127,237, 148,216, 163,212, 166,216, 160,223, 163,233, 153,281, 135,318, 129,313, 122,322, 117,320, 99,301, 98,293, 85,300, 80,303, 74,300,
|
||||
64,285, 76,272, 98,249,
|
||||
94,246, 72,261, 57,258, 62,251, 60,248, 47,228, 51,207, 71,195, 72,192, 38,202, 33,195, 30,173, 147,127" href="#">
|
||||
<area shape="poly" name="carrots" coords="175,74, 170,80, 154,85, 189,103, 190,111, 182,111, 179,98, 157,95, 142,111, 140,128, 38,169, 39,163, 74,143, 74,141, 56,135, 52,115, 79,111, 78,106, 63,98, 71,91, 81,88, 82,83, 91,75, 136,74, 174,70" href="#">
|
||||
<area shape="poly" name="asparagus" coords="224,25, 239,33, 244,36, 247,32, 327,23, 344,31, 343,36, 319,41, 315,42, 302,52, 272,61, 265,64, 270,73, 256,67, 248,60, 187,55, 192,58, 192,60, 184,64, 185,67, 176,67, 173,69, 142,67, 146,63, 135,59, 123,57, 142,44, 145,42, 143,39, 145,32, 207,38, 185,18, 212,19,
|
||||
220,22" href="#">
|
||||
<area shape="poly" name="squash" coords="388,26, 391,38, 394,43, 395,46, 425,58, 427,68, 428,92, 386,125, 371,132, 374,124, 377,118, 374,105, 371,105, 370,107, 364,102, 368,97, 356,87, 353,89, 348,86, 322,87, 314,100, 314,102, 282,85, 278,84, 273,74, 272,68, 319,46, 346,31" href="#">
|
||||
<area shape="poly" name="yellowpepper" coords="237,222, 246,254, 255,291, 262,323, 271,322, 285,350, 306,352, 307,365, 298,374, 285,366, 270,375, 249,378, 244,384, 231,389, 215,373, 210,363, 203,357, 199,368, 184,361, 175,349, 162,356, 140,340, 143,305, 161,252, 168,224, 188,240, 194,223, 198,232, 213,226, 224,224,
|
||||
229,218" href="#">
|
||||
<area shape="poly" name="broccoli" coords="341,89, 342,91, 360,95, 353,100, 360,104, 364,109, 368,115, 369,112, 367,110, 376,111, 373,123, 367,128, 362,128, 359,131, 348,134, 345,137, 340,138, 341,148, 334,167, 323,172, 315,165, 315,162, 312,165, 311,172, 293,167, 292,141, 298,136, 307,134, 322,129, 328,128,
|
||||
329,116, 319,109, 314,104,
|
||||
317,93, 332,84" href="#">
|
||||
<area shape="poly" name="broccoli" coords="328,178, 338,197, 337,202, 330,215, 328,217, 325,228, 307,234, 305,239, 287,225, 287,216, 286,212, 282,216, 277,212, 277,185, 284,179, 310,175" href="#">
|
||||
<area shape="poly" name="dip" coords="253,102, 277,100, 280,105, 290,107, 295,111, 304,130, 290,140, 287,147, 240,157, 238,159, 227,153, 203,146, 198,125, 200,116, 214,102, 231,102" href="#">
|
||||
|
||||
</map>
|
||||
|
||||
|
||||
<body>
|
||||
150
rus/admin/_V4/_lib/ImageMapster-master/src/areacorners.js
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
/* areacorners.js
|
||||
determine the best place to put a box of dimensions (width,height) given a circle, rect or poly
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var u=$.mapster.utils;
|
||||
|
||||
|
||||
/**
|
||||
* Compute positions that will place a target with dimensions [width,height] outside
|
||||
* but near the boundaries of the elements "elements". When an imagemap is passed, the
|
||||
*
|
||||
* @param {Element|Element[]} elements An element or an array of elements (such as a jQuery object)
|
||||
* @param {Element} image The image to which area elements are bound, if this is an image map.
|
||||
* @param {Element} container The contianer in which the target must be constrained (or document, if missing)
|
||||
* @param {int} width The width of the target object
|
||||
* @return {object} a structure with the x and y positions
|
||||
*/
|
||||
u.areaCorners = function (elements, image, container, width, height) {
|
||||
var pos,found, minX, minY, maxX, maxY, bestMinX, bestMaxX, bestMinY, bestMaxY, curX, curY, nest, j,
|
||||
offsetx=0,
|
||||
offsety=0,
|
||||
rootx,
|
||||
rooty,
|
||||
iCoords,radius,angle,el,
|
||||
coords=[];
|
||||
|
||||
// if a single element was passed, map it to an array
|
||||
|
||||
elements = elements.length ?
|
||||
elements:
|
||||
[elements];
|
||||
|
||||
container = container ?
|
||||
$(container):
|
||||
$(document.body);
|
||||
|
||||
// get the relative root of calculation
|
||||
|
||||
pos = container.offset();
|
||||
rootx = pos.left;
|
||||
rooty = pos.top;
|
||||
|
||||
// with areas, all we know about is relative to the top-left corner of the image. We need to add an offset compared to
|
||||
// the actual container. After this calculation, offsetx/offsety can be added to either the area coords, or the target's
|
||||
// absolute position to get the correct top/left boundaries of the container.
|
||||
|
||||
if (image) {
|
||||
pos = $(image).offset();
|
||||
offsetx = pos.left;
|
||||
offsety = pos.top;
|
||||
}
|
||||
|
||||
// map the coordinates of any type of shape to a poly and use the logic. simpler than using three different
|
||||
// calculation methods. Circles use a 20 degree increment for this estimation.
|
||||
|
||||
for (j=0;j<elements.length;j++)
|
||||
{
|
||||
el=elements[j];
|
||||
if (el.nodeName==='AREA') {
|
||||
iCoords = u.split(el.coords,parseInt);
|
||||
|
||||
switch(el.shape) {
|
||||
case 'circle':
|
||||
curX=iCoords[0];
|
||||
curY=iCoords[1];
|
||||
radius=iCoords[2];
|
||||
coords=[];
|
||||
for (j=0;j<360;j+=20) {
|
||||
angle=j*Math.PI/180;
|
||||
coords.push(curX+radius*Math.cos(angle),curY+radius*Math.sin(angle));
|
||||
}
|
||||
break;
|
||||
case 'rect':
|
||||
coords.push(iCoords[0],iCoords[1],iCoords[2],iCoords[1],iCoords[2],iCoords[3],iCoords[0],iCoords[3]);
|
||||
break;
|
||||
default:
|
||||
coords=coords.concat(iCoords);
|
||||
break;
|
||||
}
|
||||
|
||||
// map area positions to it's real position in the container
|
||||
|
||||
for (j=0;j<coords.length;j+=2)
|
||||
{
|
||||
coords[j]=parseInt(coords[j],10)+offsetx;
|
||||
coords[j+1]=parseInt(coords[j+1],10)+offsety;
|
||||
}
|
||||
} else {
|
||||
el=$(el);
|
||||
pos = el.position();
|
||||
coords.push(pos.left,pos.top,
|
||||
pos.left+el.width(),pos.top,
|
||||
pos.left+el.width(),pos.top+el.height(),
|
||||
pos.left,pos.top+el.height());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
minX = minY = bestMinX = bestMinY = 999999;
|
||||
maxX = maxY = bestMaxX = bestMaxY = -1;
|
||||
|
||||
for (j = coords.length - 2; j >= 0; j -= 2) {
|
||||
curX = coords[j];
|
||||
curY = coords[j + 1];
|
||||
|
||||
if (curX < minX) {
|
||||
minX = curX;
|
||||
bestMaxY = curY;
|
||||
}
|
||||
if (curX > maxX) {
|
||||
maxX = curX;
|
||||
bestMinY = curY;
|
||||
}
|
||||
if (curY < minY) {
|
||||
minY = curY;
|
||||
bestMaxX = curX;
|
||||
}
|
||||
if (curY > maxY) {
|
||||
maxY = curY;
|
||||
bestMinX = curX;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// try to figure out the best place for the tooltip
|
||||
|
||||
if (width && height) {
|
||||
found=false;
|
||||
$.each([[bestMaxX - width, minY - height], [bestMinX, minY - height],
|
||||
[minX - width, bestMaxY - height], [minX - width, bestMinY],
|
||||
[maxX,bestMaxY - height], [ maxX,bestMinY],
|
||||
[bestMaxX - width, maxY], [bestMinX, maxY]
|
||||
],function (i, e) {
|
||||
if (!found && (e[0] > rootx && e[1] > rooty)) {
|
||||
nest = e;
|
||||
found=true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// default to lower-right corner if nothing fit inside the boundaries of the image
|
||||
|
||||
if (!found) {
|
||||
nest=[maxX,maxY];
|
||||
}
|
||||
}
|
||||
return nest;
|
||||
};
|
||||
} (jQuery));
|
||||
298
rus/admin/_V4/_lib/ImageMapster-master/src/areadata.js
Normal file
|
|
@ -0,0 +1,298 @@
|
|||
/* areadata.js
|
||||
AreaData and MapArea protoypes
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var m = $.mapster, u = m.utils;
|
||||
|
||||
/**
|
||||
* Select this area
|
||||
*
|
||||
* @param {AreaData} me AreaData context
|
||||
* @param {object} options Options for rendering the selection
|
||||
*/
|
||||
function select(options) {
|
||||
// need to add the new one first so that the double-opacity effect leaves the current one highlighted for singleSelect
|
||||
|
||||
var me=this, o = me.owner;
|
||||
if (o.options.singleSelect) {
|
||||
o.clearSelections();
|
||||
}
|
||||
|
||||
// because areas can overlap - we can't depend on the selection state to tell us anything about the inner areas.
|
||||
// don't check if it's already selected
|
||||
if (!me.isSelected()) {
|
||||
if (options) {
|
||||
|
||||
// cache the current options, and map the altImageId if an altimage
|
||||
// was passed
|
||||
|
||||
me.optsCache = $.extend(me.effectiveRenderOptions('select'),
|
||||
options,
|
||||
{
|
||||
altImageId: o.images.add(options.altImage)
|
||||
});
|
||||
}
|
||||
|
||||
me.drawSelection();
|
||||
|
||||
me.selected = true;
|
||||
me.changeState('select', true);
|
||||
}
|
||||
|
||||
if (o.options.singleSelect) {
|
||||
o.graphics.refreshSelections();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deselect this area, optionally deferring finalization so additional areas can be deselected
|
||||
* in a single operation
|
||||
*
|
||||
* @param {boolean} partial when true, the caller must invoke "finishRemoveSelection" to render
|
||||
*/
|
||||
|
||||
function deselect(partial) {
|
||||
var me=this;
|
||||
me.selected = false;
|
||||
me.changeState('select', false);
|
||||
|
||||
// release information about last area options when deselecting.
|
||||
|
||||
me.optsCache=null;
|
||||
me.owner.graphics.removeSelections(me.areaId);
|
||||
|
||||
// Complete selection removal process. This is separated because it's very inefficient to perform the whole
|
||||
// process for multiple removals, as the canvas must be totally redrawn at the end of the process.ar.remove
|
||||
|
||||
if (!partial) {
|
||||
me.owner.removeSelectionFinish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the selection state of this area
|
||||
* @param {object} options Rendering options, if toggling on
|
||||
* @return {bool} The new selection state
|
||||
*/
|
||||
function toggle(options) {
|
||||
var me=this;
|
||||
if (!me.isSelected()) {
|
||||
me.select(options);
|
||||
}
|
||||
else {
|
||||
me.deselect();
|
||||
}
|
||||
return me.isSelected();
|
||||
}
|
||||
|
||||
/**
|
||||
* An AreaData object; represents a conceptual area that can be composed of
|
||||
* one or more MapArea objects
|
||||
*
|
||||
* @param {MapData} owner The MapData object to which this belongs
|
||||
* @param {string} key The key for this area
|
||||
* @param {string} value The mapValue string for this area
|
||||
*/
|
||||
|
||||
m.AreaData = function (owner, key, value) {
|
||||
$.extend(this,{
|
||||
owner: owner,
|
||||
key: key || '',
|
||||
// means this represents the first key in a list of keys (it's the area group that gets highlighted on mouseover)
|
||||
isPrimary: true,
|
||||
areaId: -1,
|
||||
href: '',
|
||||
value: value || '',
|
||||
options:{},
|
||||
// "null" means unchanged. Use "isSelected" method to just test true/false
|
||||
selected: null,
|
||||
// xref to MapArea objects
|
||||
areasXref: [],
|
||||
// (temporary storage) - the actual area moused over
|
||||
area: null,
|
||||
// the last options used to render this. Cache so when re-drawing after a remove, changes in options won't
|
||||
// break already selected things.
|
||||
optsCache: null
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* The public API for AreaData object
|
||||
*/
|
||||
|
||||
m.AreaData.prototype = {
|
||||
constuctor: m.AreaData,
|
||||
select: select,
|
||||
deselect: deselect,
|
||||
toggle: toggle,
|
||||
areas: function() {
|
||||
var i,result=[];
|
||||
for (i=0;i<this.areasXref.length;i++) {
|
||||
result.push(this.owner.mapAreas[this.areasXref[i]]);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
// return all coordinates for all areas
|
||||
coords: function(offset) {
|
||||
var coords = [];
|
||||
$.each(this.areas(), function (i, el) {
|
||||
coords = coords.concat(el.coords(offset));
|
||||
});
|
||||
return coords;
|
||||
},
|
||||
reset: function () {
|
||||
$.each(this.areas(), function (i, e) {
|
||||
e.reset();
|
||||
});
|
||||
this.areasXref = [];
|
||||
this.options = null;
|
||||
},
|
||||
// Return the effective selected state of an area, incorporating staticState
|
||||
isSelectedOrStatic: function () {
|
||||
|
||||
var o = this.effectiveOptions();
|
||||
return u.isBool(o.staticState) ? o.staticState :
|
||||
this.isSelected();
|
||||
},
|
||||
isSelected: function () {
|
||||
return u.isBool(this.selected) ? this.selected :
|
||||
u.isBool(this.owner.area_options.selected) ? this.owner.area_options.selected : false;
|
||||
},
|
||||
isSelectable: function () {
|
||||
return u.isBool(this.effectiveOptions().staticState) ? false :
|
||||
(u.isBool(this.owner.options.staticState) ? false : u.boolOrDefault(this.effectiveOptions().isSelectable,true));
|
||||
},
|
||||
isDeselectable: function () {
|
||||
return u.isBool(this.effectiveOptions().staticState) ? false :
|
||||
(u.isBool(this.owner.options.staticState) ? false : u.boolOrDefault(this.effectiveOptions().isDeselectable,true));
|
||||
},
|
||||
isNotRendered: function() {
|
||||
var area = $(this.area);
|
||||
return area.attr('nohref') ||
|
||||
!area.attr('href') ||
|
||||
this.effectiveOptions().isMask;
|
||||
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Return the overall options effective for this area.
|
||||
* This should get the default options, and merge in area-specific options, finally
|
||||
* overlaying options passed by parameter
|
||||
*
|
||||
* @param {[type]} options options which will supercede all other options for this area
|
||||
* @return {[type]} the combined options
|
||||
*/
|
||||
|
||||
effectiveOptions: function (options) {
|
||||
|
||||
var opts = u.updateProps({},
|
||||
this.owner.area_options,
|
||||
this.options,
|
||||
options || {},
|
||||
{
|
||||
id: this.areaId
|
||||
}
|
||||
);
|
||||
|
||||
opts.selected = this.isSelected();
|
||||
|
||||
return opts;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the options effective for this area for a "render" or "highlight" mode.
|
||||
* This should get the default options, merge in the areas-specific options,
|
||||
* and then the mode-specific options.
|
||||
* @param {string} mode 'render' or 'highlight'
|
||||
* @param {[type]} options options which will supercede all other options for this area
|
||||
* @return {[type]} the combined options
|
||||
*/
|
||||
|
||||
effectiveRenderOptions: function (mode, options) {
|
||||
var allOpts,opts=this.optsCache;
|
||||
|
||||
if (!opts || mode==='highlight') {
|
||||
allOpts = this.effectiveOptions(options);
|
||||
opts = u.updateProps({},
|
||||
allOpts,
|
||||
allOpts["render_" + mode]
|
||||
);
|
||||
|
||||
if (mode!=='highlight') {
|
||||
this.optsCache=opts;
|
||||
}
|
||||
}
|
||||
return $.extend({},opts);
|
||||
},
|
||||
|
||||
// Fire callback on area state change
|
||||
changeState: function (state_type, state) {
|
||||
if ($.isFunction(this.owner.options.onStateChange)) {
|
||||
this.owner.options.onStateChange.call(this.owner.image,
|
||||
{
|
||||
key: this.key,
|
||||
state: state_type,
|
||||
selected: state
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
// highlight this area
|
||||
|
||||
highlight: function (options) {
|
||||
var o = this.owner;
|
||||
if (this.effectiveOptions().highlight) {
|
||||
o.graphics.addShapeGroup(this, "highlight",options);
|
||||
}
|
||||
o.setHighlightId(this.areaId);
|
||||
this.changeState('highlight', true);
|
||||
},
|
||||
|
||||
// select this area. if "callEvent" is true then the state change event will be called. (This method can be used
|
||||
// during config operations, in which case no event is indicated)
|
||||
|
||||
drawSelection: function () {
|
||||
|
||||
|
||||
this.owner.graphics.addShapeGroup(this, "select");
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
// represents an HTML area
|
||||
m.MapArea = function (owner,areaEl,keys) {
|
||||
if (!owner) {
|
||||
return;
|
||||
}
|
||||
var me = this;
|
||||
me.owner = owner; // a MapData object
|
||||
me.area = areaEl;
|
||||
me.areaDataXref=[]; // a list of map_data.data[] id's for each areaData object containing this
|
||||
me.originalCoords = [];
|
||||
$.each(u.split(areaEl.coords), function (i, el) {
|
||||
me.originalCoords.push(parseFloat(el));
|
||||
});
|
||||
me.length = me.originalCoords.length;
|
||||
me.shape = areaEl.shape.toLowerCase();
|
||||
me.nohref = areaEl.nohref || !areaEl.href;
|
||||
me.configure(keys);
|
||||
};
|
||||
m.MapArea.prototype= {
|
||||
constructor: m.MapArea,
|
||||
configure: function(keys) {
|
||||
this.keys = u.split(keys);
|
||||
},
|
||||
reset: function() {
|
||||
this.area=null;
|
||||
},
|
||||
coords: function (offset) {
|
||||
return $.map(this.originalCoords,function(e) {
|
||||
return offset ? e : e+offset;
|
||||
});
|
||||
}
|
||||
};
|
||||
} (jQuery));
|
||||
1049
rus/admin/_V4/_lib/ImageMapster-master/src/core.js
Normal file
444
rus/admin/_V4/_lib/ImageMapster-master/src/graphics.js
Normal file
|
|
@ -0,0 +1,444 @@
|
|||
/* graphics.js
|
||||
Graphics object handles all rendering.
|
||||
*/
|
||||
(function ($) {
|
||||
var p, m=$.mapster,
|
||||
u=m.utils,
|
||||
canvasMethods,
|
||||
vmlMethods;
|
||||
|
||||
/**
|
||||
* Implemenation to add each area in an AreaData object to the canvas
|
||||
* @param {Graphics} graphics The target graphics object
|
||||
* @param {AreaData} areaData The AreaData object (a collection of area elements and metadata)
|
||||
* @param {object} options Rendering options to apply when rendering this group of areas
|
||||
*/
|
||||
function addShapeGroupImpl(graphics, areaData, options) {
|
||||
var me = graphics,
|
||||
md = me.map_data,
|
||||
isMask = options.isMask;
|
||||
|
||||
// first get area options. Then override fade for selecting, and finally merge in the
|
||||
// "select" effect options.
|
||||
|
||||
$.each(areaData.areas(), function (i,e) {
|
||||
options.isMask = isMask || (e.nohref && md.options.noHrefIsMask);
|
||||
me.addShape(e, options);
|
||||
});
|
||||
|
||||
// it's faster just to manipulate the passed options isMask property and restore it, than to
|
||||
// copy the object each time
|
||||
|
||||
options.isMask=isMask;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a hex value to decimal
|
||||
* @param {string} hex A hexadecimal toString
|
||||
* @return {int} Integer represenation of the hex string
|
||||
*/
|
||||
|
||||
function hex_to_decimal(hex) {
|
||||
return Math.max(0, Math.min(parseInt(hex, 16), 255));
|
||||
}
|
||||
function css3color(color, opacity) {
|
||||
return 'rgba(' + hex_to_decimal(color.substr(0, 2)) + ','
|
||||
+ hex_to_decimal(color.substr(2, 2)) + ','
|
||||
+ hex_to_decimal(color.substr(4, 2)) + ',' + opacity + ')';
|
||||
}
|
||||
/**
|
||||
* An object associated with a particular map_data instance to manage renderin.
|
||||
* @param {MapData} map_data The MapData object bound to this instance
|
||||
*/
|
||||
|
||||
m.Graphics = function (map_data) {
|
||||
//$(window).unload($.mapster.unload);
|
||||
// create graphics functions for canvas and vml browsers. usage:
|
||||
// 1) init with map_data, 2) call begin with canvas to be used (these are separate b/c may not require canvas to be specified
|
||||
// 3) call add_shape_to for each shape or mask, 4) call render() to finish
|
||||
|
||||
var me = this;
|
||||
me.active = false;
|
||||
me.canvas = null;
|
||||
me.width = 0;
|
||||
me.height = 0;
|
||||
me.shapes = [];
|
||||
me.masks = [];
|
||||
me.map_data = map_data;
|
||||
};
|
||||
|
||||
p = m.Graphics.prototype= {
|
||||
constructor: m.Graphics,
|
||||
|
||||
/**
|
||||
* Initiate a graphics request for a canvas
|
||||
* @param {Element} canvas The canvas element that is the target of this operation
|
||||
* @param {string} [elementName] The name to assign to the element (VML only)
|
||||
*/
|
||||
|
||||
begin: function(canvas, elementName) {
|
||||
var c = $(canvas);
|
||||
|
||||
this.elementName = elementName;
|
||||
this.canvas = canvas;
|
||||
|
||||
this.width = c.width();
|
||||
this.height = c.height();
|
||||
this.shapes = [];
|
||||
this.masks = [];
|
||||
this.active = true;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Add an area to be rendered to this canvas.
|
||||
* @param {MapArea} mapArea The MapArea object to render
|
||||
* @param {object} options An object containing any rendering options that should override the
|
||||
* defaults for the area
|
||||
*/
|
||||
|
||||
addShape: function(mapArea, options) {
|
||||
var addto = options.isMask ? this.masks : this.shapes;
|
||||
addto.push({ mapArea: mapArea, options: options });
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a canvas that is sized and styled for the MapData object
|
||||
* @param {MapData} mapData The MapData object that will receive this new canvas
|
||||
* @return {Element} A canvas element
|
||||
*/
|
||||
|
||||
createVisibleCanvas: function (mapData) {
|
||||
return $(this.createCanvasFor(mapData))
|
||||
.addClass('mapster_el')
|
||||
.css(m.canvas_style)[0];
|
||||
},
|
||||
|
||||
/**
|
||||
* Add a group of shapes from an AreaData object to the canvas
|
||||
*
|
||||
* @param {AreaData} areaData An AreaData object (a set of area elements)
|
||||
* @param {string} mode The rendering mode, "select" or "highlight". This determines the target
|
||||
* canvas and which default options to use.
|
||||
* @param {striong} options Rendering options
|
||||
*/
|
||||
|
||||
addShapeGroup: function (areaData, mode,options) {
|
||||
// render includeKeys first - because they could be masks
|
||||
var me = this,
|
||||
list, name, canvas,
|
||||
map_data = this.map_data,
|
||||
opts = areaData.effectiveRenderOptions(mode);
|
||||
|
||||
if (options) {
|
||||
$.extend(opts,options);
|
||||
}
|
||||
|
||||
if (mode === 'select') {
|
||||
name = "static_" + areaData.areaId.toString();
|
||||
canvas = map_data.base_canvas;
|
||||
} else {
|
||||
canvas = map_data.overlay_canvas;
|
||||
}
|
||||
|
||||
me.begin(canvas, name);
|
||||
|
||||
if (opts.includeKeys) {
|
||||
list = u.split(opts.includeKeys);
|
||||
$.each(list, function (i,e) {
|
||||
var areaData = map_data.getDataForKey(e.toString());
|
||||
addShapeGroupImpl(me,areaData, areaData.effectiveRenderOptions(mode));
|
||||
});
|
||||
}
|
||||
|
||||
addShapeGroupImpl(me,areaData, opts);
|
||||
me.render();
|
||||
if (opts.fade) {
|
||||
|
||||
// fading requires special handling for IE. We must access the fill elements directly. The fader also has to deal with
|
||||
// the "opacity" attribute (not css)
|
||||
|
||||
u.fader(m.hasCanvas() ?
|
||||
canvas :
|
||||
$(canvas).find('._fill').not('.mapster_mask'),
|
||||
0,
|
||||
m.hasCanvas() ?
|
||||
1 :
|
||||
opts.fillOpacity,
|
||||
opts.fadeDuration);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// These prototype methods are implementation dependent
|
||||
};
|
||||
|
||||
function noop() {}
|
||||
|
||||
|
||||
// configure remaining prototype methods for ie or canvas-supporting browser
|
||||
|
||||
canvasMethods = {
|
||||
renderShape: function (context, mapArea, offset) {
|
||||
var i,
|
||||
c = mapArea.coords(null,offset);
|
||||
|
||||
switch (mapArea.shape) {
|
||||
case 'rect':
|
||||
context.rect(c[0], c[1], c[2] - c[0], c[3] - c[1]);
|
||||
break;
|
||||
case 'poly':
|
||||
context.moveTo(c[0], c[1]);
|
||||
|
||||
for (i = 2; i < mapArea.length; i += 2) {
|
||||
context.lineTo(c[i], c[i + 1]);
|
||||
}
|
||||
context.lineTo(c[0], c[1]);
|
||||
break;
|
||||
case 'circ':
|
||||
case 'circle':
|
||||
context.arc(c[0], c[1], c[2], 0, Math.PI * 2, false);
|
||||
break;
|
||||
}
|
||||
},
|
||||
addAltImage: function (context, image, mapArea, options) {
|
||||
context.beginPath();
|
||||
|
||||
this.renderShape(context, mapArea);
|
||||
context.closePath();
|
||||
context.clip();
|
||||
|
||||
context.globalAlpha = options.altImageOpacity || options.fillOpacity;
|
||||
|
||||
context.drawImage(image, 0, 0, mapArea.owner.scaleInfo.width, mapArea.owner.scaleInfo.height);
|
||||
},
|
||||
render: function () {
|
||||
// firefox 6.0 context.save() seems to be broken. to work around, we have to draw the contents on one temp canvas,
|
||||
// the mask on another, and merge everything. ugh. fixed in 1.2.2. unfortunately this is a lot more code for masks,
|
||||
// but no other way around it that i can see.
|
||||
|
||||
var maskCanvas, maskContext,
|
||||
me = this,
|
||||
md = me.map_data,
|
||||
hasMasks = me.masks.length,
|
||||
shapeCanvas = me.createCanvasFor(md),
|
||||
shapeContext = shapeCanvas.getContext('2d'),
|
||||
context = me.canvas.getContext('2d');
|
||||
|
||||
if (hasMasks) {
|
||||
maskCanvas = me.createCanvasFor(md);
|
||||
maskContext = maskCanvas.getContext('2d');
|
||||
maskContext.clearRect(0, 0, maskCanvas.width, maskCanvas.height);
|
||||
|
||||
$.each(me.masks, function (i,e) {
|
||||
maskContext.save();
|
||||
maskContext.beginPath();
|
||||
me.renderShape(maskContext, e.mapArea);
|
||||
maskContext.closePath();
|
||||
maskContext.clip();
|
||||
maskContext.lineWidth = 0;
|
||||
maskContext.fillStyle = '#000';
|
||||
maskContext.fill();
|
||||
maskContext.restore();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$.each(me.shapes, function (i,s) {
|
||||
shapeContext.save();
|
||||
if (s.options.fill) {
|
||||
if (s.options.altImageId) {
|
||||
me.addAltImage(shapeContext, md.images[s.options.altImageId], s.mapArea, s.options);
|
||||
} else {
|
||||
shapeContext.beginPath();
|
||||
me.renderShape(shapeContext, s.mapArea);
|
||||
shapeContext.closePath();
|
||||
//shapeContext.clip();
|
||||
shapeContext.fillStyle = css3color(s.options.fillColor, s.options.fillOpacity);
|
||||
shapeContext.fill();
|
||||
}
|
||||
}
|
||||
shapeContext.restore();
|
||||
});
|
||||
|
||||
|
||||
// render strokes at end since masks get stroked too
|
||||
|
||||
$.each(me.shapes.concat(me.masks), function (i,s) {
|
||||
var offset = s.options.strokeWidth === 1 ? 0.5 : 0;
|
||||
// offset applies only when stroke width is 1 and stroke would render between pixels.
|
||||
|
||||
if (s.options.stroke) {
|
||||
shapeContext.save();
|
||||
shapeContext.strokeStyle = css3color(s.options.strokeColor, s.options.strokeOpacity);
|
||||
shapeContext.lineWidth = s.options.strokeWidth;
|
||||
|
||||
shapeContext.beginPath();
|
||||
|
||||
me.renderShape(shapeContext, s.mapArea, offset);
|
||||
shapeContext.closePath();
|
||||
shapeContext.stroke();
|
||||
shapeContext.restore();
|
||||
}
|
||||
});
|
||||
|
||||
if (hasMasks) {
|
||||
// render the new shapes against the mask
|
||||
|
||||
maskContext.globalCompositeOperation = "source-out";
|
||||
maskContext.drawImage(shapeCanvas, 0, 0);
|
||||
|
||||
// flatten into the main canvas
|
||||
context.drawImage(maskCanvas, 0, 0);
|
||||
} else {
|
||||
context.drawImage(shapeCanvas, 0, 0);
|
||||
}
|
||||
|
||||
me.active = false;
|
||||
return me.canvas;
|
||||
},
|
||||
|
||||
// create a canvas mimicing dimensions of an existing element
|
||||
createCanvasFor: function (md) {
|
||||
return $('<canvas width="' + md.scaleInfo.width + '" height="' +md.scaleInfo.height + '"></canvas>')[0];
|
||||
},
|
||||
clearHighlight: function () {
|
||||
var c = this.map_data.overlay_canvas;
|
||||
c.getContext('2d').clearRect(0, 0, c.width, c.height);
|
||||
},
|
||||
// Draw all items from selected_list to a new canvas, then swap with the old one. This is used to delete items when using canvases.
|
||||
refreshSelections: function () {
|
||||
var canvas_temp, map_data = this.map_data;
|
||||
// draw new base canvas, then swap with the old one to avoid flickering
|
||||
canvas_temp = map_data.base_canvas;
|
||||
|
||||
map_data.base_canvas = this.createVisibleCanvas(map_data);
|
||||
$(map_data.base_canvas).hide();
|
||||
$(canvas_temp).before(map_data.base_canvas);
|
||||
|
||||
map_data.redrawSelections();
|
||||
|
||||
$(map_data.base_canvas).show();
|
||||
$(canvas_temp).remove();
|
||||
}
|
||||
};
|
||||
|
||||
vmlMethods = {
|
||||
|
||||
renderShape: function (mapArea, options, cssclass) {
|
||||
var me = this, fill,stroke, e, t_fill, el_name, el_class, template, c = mapArea.coords();
|
||||
el_name = me.elementName ? 'name="' + me.elementName + '" ' : '';
|
||||
el_class = cssclass ? 'class="' + cssclass + '" ' : '';
|
||||
|
||||
t_fill = '<v:fill color="#' + options.fillColor + '" class="_fill" opacity="' +
|
||||
(options.fill ?
|
||||
options.fillOpacity :
|
||||
0) +
|
||||
'" /><v:stroke class="_fill" opacity="' +
|
||||
options.strokeOpacity + '"/>';
|
||||
|
||||
|
||||
stroke = options.stroke ?
|
||||
' strokeweight=' + options.strokeWidth + ' stroked="t" strokecolor="#' +
|
||||
options.strokeColor + '"' :
|
||||
' stroked="f"';
|
||||
|
||||
fill = options.fill ?
|
||||
' filled="t"' :
|
||||
' filled="f"';
|
||||
|
||||
switch (mapArea.shape) {
|
||||
case 'rect':
|
||||
template = '<v:rect ' + el_class + el_name + fill + stroke +
|
||||
' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' +
|
||||
c[0] + 'px;top:' + c[1] + 'px;width:' + (c[2] - c[0]) +
|
||||
'px;height:' + (c[3] - c[1]) + 'px;">' + t_fill + '</v:rect>';
|
||||
break;
|
||||
case 'poly':
|
||||
template = '<v:shape ' + el_class + el_name + fill + stroke + ' coordorigin="0,0" coordsize="' + me.width + ',' + me.height
|
||||
+ '" path="m ' + c[0] + ',' + c[1] + ' l ' + c.slice(2).join(',')
|
||||
+ ' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:' + me.width + 'px;height:' + me.height + 'px;">' + t_fill + '</v:shape>';
|
||||
break;
|
||||
case 'circ':
|
||||
case 'circle':
|
||||
template = '<v:oval ' + el_class + el_name + fill + stroke
|
||||
+ ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + (c[0] - c[2]) + 'px;top:' + (c[1] - c[2])
|
||||
+ 'px;width:' + (c[2] * 2) + 'px;height:' + (c[2] * 2) + 'px;">' + t_fill + '</v:oval>';
|
||||
break;
|
||||
}
|
||||
e = $(template);
|
||||
$(me.canvas).append(e);
|
||||
|
||||
return e;
|
||||
},
|
||||
render: function () {
|
||||
var opts, me = this;
|
||||
|
||||
$.each(this.shapes, function (i,e) {
|
||||
me.renderShape(e.mapArea, e.options);
|
||||
});
|
||||
|
||||
if (this.masks.length) {
|
||||
$.each(this.masks, function (i,e) {
|
||||
opts = u.updateProps({},
|
||||
e.options, {
|
||||
fillOpacity: 1,
|
||||
fillColor: e.options.fillColorMask
|
||||
});
|
||||
me.renderShape(e.mapArea, opts, 'mapster_mask');
|
||||
});
|
||||
}
|
||||
|
||||
this.active = false;
|
||||
return this.canvas;
|
||||
},
|
||||
|
||||
createCanvasFor: function (md) {
|
||||
var w = md.scaleInfo.width,
|
||||
h = md.scaleInfo.height;
|
||||
return $('<var width="' + w + '" height="' + h
|
||||
+ '" style="zoom:1;overflow:hidden;display:block;width:'
|
||||
+ w + 'px;height:' + h + 'px;"></var>')[0];
|
||||
},
|
||||
|
||||
clearHighlight: function () {
|
||||
$(this.map_data.overlay_canvas).children().remove();
|
||||
},
|
||||
// remove single or all selections
|
||||
removeSelections: function (area_id) {
|
||||
if (area_id >= 0) {
|
||||
$(this.map_data.base_canvas).find('[name="static_' + area_id.toString() + '"]').remove();
|
||||
}
|
||||
else {
|
||||
$(this.map_data.base_canvas).children().remove();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// for all methods with two implemenatations, add a function that will automatically replace itself with the correct
|
||||
// method on first invocation
|
||||
|
||||
$.each(['renderShape',
|
||||
'addAltImage',
|
||||
'render',
|
||||
'createCanvasFor',
|
||||
'clearHighlight',
|
||||
'removeSelections',
|
||||
'refreshSelections'],
|
||||
function(i,e) {
|
||||
p[e]=(function(method) {
|
||||
return function() {
|
||||
p[method] = (m.hasCanvas() ?
|
||||
canvasMethods[method] :
|
||||
vmlMethods[method]) || noop;
|
||||
|
||||
return p[method].apply(this,arguments);
|
||||
};
|
||||
}(e));
|
||||
});
|
||||
|
||||
|
||||
} (jQuery));
|
||||
37
rus/admin/_V4/_lib/ImageMapster-master/src/license.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* ImageMapster
|
||||
Version: 1.2.14-beta1 (6/18/2013)
|
||||
|
||||
Copyright 2011-2012 James Treworgy
|
||||
|
||||
http://www.outsharked.com/imagemapster
|
||||
https://github.com/jamietre/ImageMapster
|
||||
|
||||
A jQuery plugin to enhance image maps.
|
||||
|
||||
*/
|
||||
|
||||
;
|
||||
|
||||
/// LICENSE (MIT License)
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining
|
||||
/// a copy of this software and associated documentation files (the
|
||||
/// "Software"), to deal in the Software without restriction, including
|
||||
/// without limitation the rights to use, copy, modify, merge, publish,
|
||||
/// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
/// permit persons to whom the Software is furnished to do so, subject to
|
||||
/// the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be
|
||||
/// included in all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
/// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
/// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
/// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
/// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
/// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
/// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
///
|
||||
/// January 19, 2011
|
||||
|
||||
926
rus/admin/_V4/_lib/ImageMapster-master/src/mapdata.js
Normal file
|
|
@ -0,0 +1,926 @@
|
|||
/* mapdata.js
|
||||
the MapData object, repesents an instance of a single bound imagemap
|
||||
*/
|
||||
|
||||
|
||||
(function ($) {
|
||||
|
||||
var m = $.mapster,
|
||||
u = m.utils;
|
||||
|
||||
/**
|
||||
* Set default values for MapData object properties
|
||||
* @param {MapData} me The MapData object
|
||||
*/
|
||||
|
||||
function initializeDefaults(me) {
|
||||
$.extend(me,{
|
||||
complete: false, // (bool) when configuration is complete
|
||||
map: null, // ($) the image map
|
||||
base_canvas: null, // (canvas|var) where selections are rendered
|
||||
overlay_canvas: null, // (canvas|var) where highlights are rendered
|
||||
commands: [], // {} commands that were run before configuration was completed (b/c images weren't loaded)
|
||||
data: [], // MapData[] area groups
|
||||
mapAreas: [], // MapArea[] list. AreaData entities contain refs to this array, so options are stored with each.
|
||||
_xref: {}, // (int) xref of mapKeys to data[]
|
||||
highlightId: -1, // (int) the currently highlighted element.
|
||||
currentAreaId: -1,
|
||||
_tooltip_events: [], // {} info on events we bound to a tooltip container, so we can properly unbind them
|
||||
scaleInfo: null, // {} info about the image size, scaling, defaults
|
||||
index: -1, // index of this in map_cache - so we have an ID to use for wraper div
|
||||
activeAreaEvent: null
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all image-containing options from an options object;
|
||||
* that is, containers that may have an "altImage" property
|
||||
*
|
||||
* @param {object} obj An options object
|
||||
* @return {object[]} An array of objects
|
||||
*/
|
||||
function getOptionImages(obj) {
|
||||
return [obj, obj.render_highlight, obj.render_select];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all the altImage references, adding them to the library so they can be preloaded
|
||||
* and aliased.
|
||||
*
|
||||
* @param {MapData} me The MapData object on which to operate
|
||||
*/
|
||||
function configureAltImages(me)
|
||||
{
|
||||
var opts = me.options,
|
||||
mi = me.images;
|
||||
|
||||
// add alt images
|
||||
|
||||
if (m.hasCanvas()) {
|
||||
// map altImage library first
|
||||
|
||||
$.each(opts.altImages || {}, function(i,e) {
|
||||
mi.add(e,i);
|
||||
});
|
||||
|
||||
// now find everything else
|
||||
|
||||
$.each([opts].concat(opts.areas),function(i,e) {
|
||||
$.each(getOptionImages(e),function(i2,e2) {
|
||||
if (e2 && e2.altImage) {
|
||||
e2.altImageId=mi.add(e2.altImage);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// set area_options
|
||||
me.area_options = u.updateProps({}, // default options for any MapArea
|
||||
m.area_defaults,
|
||||
opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue a mouse move action based on current delay settings
|
||||
* (helper for mouseover/mouseout handlers)
|
||||
*
|
||||
* @param {MapData} me The MapData context
|
||||
* @param {number} delay The number of milliseconds to delay the action
|
||||
* @param {AreaData} area AreaData affected
|
||||
* @param {Deferred} deferred A deferred object to return (instead of a new one)
|
||||
* @return {Promise} A promise that resolves when the action is completed
|
||||
*/
|
||||
function queueMouseEvent(me,delay,area, deferred) {
|
||||
|
||||
deferred = deferred || u.when.defer();
|
||||
|
||||
function cbFinal(areaId) {
|
||||
if (me.currentAreaId!==areaId && me.highlightId>=0) {
|
||||
deferred.resolve();
|
||||
}
|
||||
}
|
||||
if (me.activeAreaEvent) {
|
||||
window.clearTimeout(me.activeAreaEvent);
|
||||
me.activeAreaEvent=0;
|
||||
}
|
||||
if (delay<0) {
|
||||
deferred.reject();
|
||||
} else {
|
||||
if (area.owner.currentAction || delay) {
|
||||
me.activeAreaEvent = window.setTimeout((function() {
|
||||
return function() {
|
||||
queueMouseEvent(me,0,area,deferred);
|
||||
};
|
||||
}(area)),
|
||||
delay || 100);
|
||||
} else {
|
||||
cbFinal(area.areaId);
|
||||
}
|
||||
}
|
||||
return deferred;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mousedown event. This is captured only to prevent browser from drawing an outline around an
|
||||
* area when it's clicked.
|
||||
*
|
||||
* @param {EventData} e jQuery event data
|
||||
*/
|
||||
|
||||
function mousedown(e) {
|
||||
if (!m.hasCanvas()) {
|
||||
this.blur();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mouseover event. Handle highlight rendering and client callback on mouseover
|
||||
*
|
||||
* @param {MapData} me The MapData context
|
||||
* @param {EventData} e jQuery event data
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
|
||||
function mouseover(me,e) {
|
||||
var arData = me.getAllDataForArea(this),
|
||||
ar=arData.length ? arData[0] : null;
|
||||
|
||||
// mouseover events are ignored entirely while resizing, though we do care about mouseout events
|
||||
// and must queue the action to keep things clean.
|
||||
|
||||
if (!ar || ar.isNotRendered() || ar.owner.currentAction) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (me.currentAreaId === ar.areaId) {
|
||||
return;
|
||||
}
|
||||
if (me.highlightId !== ar.areaId) {
|
||||
me.clearEffects();
|
||||
|
||||
ar.highlight();
|
||||
|
||||
if (me.options.showToolTip) {
|
||||
$.each(arData,function(i,e) {
|
||||
if (e.effectiveOptions().toolTip) {
|
||||
e.showToolTip();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
me.currentAreaId = ar.areaId;
|
||||
|
||||
if ($.isFunction(me.options.onMouseover)) {
|
||||
me.options.onMouseover.call(this,
|
||||
{
|
||||
e: e,
|
||||
options:ar.effectiveOptions(),
|
||||
key: ar.key,
|
||||
selected: ar.isSelected()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mouseout event.
|
||||
*
|
||||
* @param {MapData} me The MapData context
|
||||
* @param {EventData} e jQuery event data
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
|
||||
function mouseout(me,e) {
|
||||
var newArea,
|
||||
ar = me.getDataForArea(this),
|
||||
opts = me.options;
|
||||
|
||||
|
||||
if (me.currentAreaId<0 || !ar) {
|
||||
return;
|
||||
}
|
||||
|
||||
newArea=me.getDataForArea(e.relatedTarget);
|
||||
|
||||
if (newArea === ar) {
|
||||
return;
|
||||
}
|
||||
|
||||
me.currentAreaId = -1;
|
||||
ar.area=null;
|
||||
|
||||
queueMouseEvent(me,opts.mouseoutDelay,ar)
|
||||
.then(me.clearEffects);
|
||||
|
||||
if ($.isFunction(opts.onMouseout)) {
|
||||
opts.onMouseout.call(this,
|
||||
{
|
||||
e: e,
|
||||
options: opts,
|
||||
key: ar.key,
|
||||
selected: ar.isSelected()
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear any active tooltip or highlight
|
||||
*
|
||||
* @param {MapData} me The MapData context
|
||||
* @param {EventData} e jQuery event data
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
|
||||
function clearEffects(me) {
|
||||
var opts = me.options;
|
||||
|
||||
me.ensureNoHighlight();
|
||||
|
||||
if (opts.toolTipClose
|
||||
&& $.inArray('area-mouseout', opts.toolTipClose) >= 0
|
||||
&& me.activeToolTip)
|
||||
{
|
||||
me.clearToolTip();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mouse click event handler
|
||||
*
|
||||
* @param {MapData} me The MapData context
|
||||
* @param {EventData} e jQuery event data
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
|
||||
function click(me,e) {
|
||||
var selected, list, list_target, newSelectionState, canChangeState, cbResult,
|
||||
that = this,
|
||||
ar = me.getDataForArea(this),
|
||||
opts = me.options;
|
||||
|
||||
function clickArea(ar) {
|
||||
var areaOpts,target;
|
||||
canChangeState = (ar.isSelectable() &&
|
||||
(ar.isDeselectable() || !ar.isSelected()));
|
||||
|
||||
if (canChangeState) {
|
||||
newSelectionState = !ar.isSelected();
|
||||
} else {
|
||||
newSelectionState = ar.isSelected();
|
||||
}
|
||||
|
||||
list_target = m.getBoundList(opts, ar.key);
|
||||
|
||||
if ($.isFunction(opts.onClick))
|
||||
{
|
||||
cbResult= opts.onClick.call(that,
|
||||
{
|
||||
e: e,
|
||||
listTarget: list_target,
|
||||
key: ar.key,
|
||||
selected: newSelectionState
|
||||
});
|
||||
|
||||
if (u.isBool(cbResult)) {
|
||||
if (!cbResult) {
|
||||
return false;
|
||||
}
|
||||
target = $(ar.area).attr('href');
|
||||
if (target!=='#') {
|
||||
window.location.href=target;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (canChangeState) {
|
||||
selected = ar.toggle();
|
||||
}
|
||||
|
||||
if (opts.boundList && opts.boundList.length > 0) {
|
||||
m.setBoundListProperties(opts, list_target, ar.isSelected());
|
||||
}
|
||||
|
||||
areaOpts = ar.effectiveOptions();
|
||||
if (areaOpts.includeKeys) {
|
||||
list = u.split(areaOpts.includeKeys);
|
||||
$.each(list, function (i, e) {
|
||||
var ar = me.getDataForKey(e.toString());
|
||||
if (!ar.options.isMask) {
|
||||
clickArea(ar);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
mousedown.call(this,e);
|
||||
|
||||
if (opts.clickNavigate && ar.href) {
|
||||
window.location.href=ar.href;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ar && !ar.owner.currentAction) {
|
||||
opts = me.options;
|
||||
clickArea(ar);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prototype for a MapData object, representing an ImageMapster bound object
|
||||
* @param {Element} image an IMG element
|
||||
* @param {object} options ImageMapster binding options
|
||||
*/
|
||||
m.MapData = function (image, options)
|
||||
{
|
||||
var me = this;
|
||||
|
||||
// (Image) main map image
|
||||
|
||||
me.image = image;
|
||||
|
||||
me.images = new m.MapImages(me);
|
||||
me.graphics = new m.Graphics(me);
|
||||
|
||||
// save the initial style of the image for unbinding. This is problematic, chrome
|
||||
// duplicates styles when assigning, and cssText is apparently not universally supported.
|
||||
// Need to do something more robust to make unbinding work universally.
|
||||
|
||||
me.imgCssText = image.style.cssText || null;
|
||||
|
||||
initializeDefaults(me);
|
||||
|
||||
me.configureOptions(options);
|
||||
|
||||
// create context-bound event handlers from our private functions
|
||||
|
||||
me.mouseover = function(e) { mouseover.call(this,me,e); };
|
||||
me.mouseout = function(e) { mouseout.call(this,me,e); };
|
||||
me.click = function(e) { click.call(this,me,e); };
|
||||
me.clearEffects = function(e) { clearEffects.call(this,me,e); };
|
||||
};
|
||||
|
||||
m.MapData.prototype = {
|
||||
constructor: m.MapData,
|
||||
|
||||
/**
|
||||
* Set target.options from defaults + options
|
||||
* @param {[type]} target The target
|
||||
* @param {[type]} options The options to merge
|
||||
*/
|
||||
|
||||
configureOptions: function(options) {
|
||||
this.options= u.updateProps({}, m.defaults, options);
|
||||
},
|
||||
|
||||
/**
|
||||
* Ensure all images are loaded
|
||||
* @return {Promise} A promise that resolves when the images have finished loading (or fail)
|
||||
*/
|
||||
|
||||
bindImages: function() {
|
||||
var me=this,
|
||||
mi = me.images;
|
||||
|
||||
// reset the images if this is a rebind
|
||||
|
||||
if (mi.length>2) {
|
||||
mi.splice(2);
|
||||
} else if (mi.length===0) {
|
||||
|
||||
// add the actual main image
|
||||
mi.add(me.image);
|
||||
// will create a duplicate of the main image, we need this to get raw size info
|
||||
mi.add(me.image.src);
|
||||
}
|
||||
|
||||
configureAltImages(me);
|
||||
|
||||
return me.images.bind();
|
||||
},
|
||||
|
||||
/**
|
||||
* Test whether an async action is currently in progress
|
||||
* @return {Boolean} true or false indicating state
|
||||
*/
|
||||
|
||||
isActive: function() {
|
||||
return !this.complete || this.currentAction;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return an object indicating the various states. This isn't really used by
|
||||
* production code.
|
||||
*
|
||||
* @return {object} An object with properties for various states
|
||||
*/
|
||||
|
||||
state: function () {
|
||||
return {
|
||||
complete: this.complete,
|
||||
resizing: this.currentAction==='resizing',
|
||||
zoomed: this.zoomed,
|
||||
zoomedArea: this.zoomedArea,
|
||||
scaleInfo: this.scaleInfo
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a unique ID for the wrapper of this imagemapster
|
||||
* @return {string} A string that is unique to this image
|
||||
*/
|
||||
|
||||
wrapId: function () {
|
||||
return 'mapster_wrap_' + this.index;
|
||||
},
|
||||
_idFromKey: function (key) {
|
||||
return typeof key === "string" && this._xref.hasOwnProperty(key) ?
|
||||
this._xref[key] : -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return a comma-separated string of all selected keys
|
||||
* @return {string} CSV of all keys that are currently selected
|
||||
*/
|
||||
|
||||
getSelected: function () {
|
||||
var result = '';
|
||||
$.each(this.data, function (i,e) {
|
||||
if (e.isSelected()) {
|
||||
result += (result ? ',' : '') + this.key;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get an array of MapAreas associated with a specific AREA based on the keys for that area
|
||||
* @param {Element} area An HTML AREA
|
||||
* @param {number} atMost A number limiting the number of areas to be returned (typically 1 or 0 for no limit)
|
||||
* @return {MapArea[]} Array of MapArea objects
|
||||
*/
|
||||
|
||||
getAllDataForArea:function (area,atMost) {
|
||||
var i,ar, result,
|
||||
me=this,
|
||||
key = $(area).filter('area').attr(me.options.mapKey);
|
||||
|
||||
if (key) {
|
||||
result=[];
|
||||
key = u.split(key);
|
||||
|
||||
for (i=0;i<(atMost || key.length);i++) {
|
||||
ar = me.data[me._idFromKey(key[i])];
|
||||
if (ar){
|
||||
ar.area=area.length ? area[0]:area;
|
||||
// set the actual area moused over/selected
|
||||
// TODO: this is a brittle model for capturing which specific area - if this method was not used,
|
||||
// ar.area could have old data. fix this.
|
||||
result.push(ar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
getDataForArea: function(area) {
|
||||
var ar=this.getAllDataForArea(area,1);
|
||||
return ar ? ar[0] || null : null;
|
||||
},
|
||||
getDataForKey: function (key) {
|
||||
return this.data[this._idFromKey(key)];
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the primary keys associated with an area group.
|
||||
* If this is a primary key, it will be returned.
|
||||
*
|
||||
* @param {string key An area key
|
||||
* @return {string} A CSV of area keys
|
||||
*/
|
||||
|
||||
getKeysForGroup: function(key) {
|
||||
var ar=this.getDataForKey(key);
|
||||
|
||||
return !ar ? '':
|
||||
ar.isPrimary ?
|
||||
ar.key :
|
||||
this.getPrimaryKeysForMapAreas(ar.areas()).join(',');
|
||||
},
|
||||
|
||||
/**
|
||||
* given an array of MapArea object, return an array of its unique primary keys
|
||||
* @param {MapArea[]} areas The areas to analyze
|
||||
* @return {string[]} An array of unique primary keys
|
||||
*/
|
||||
|
||||
getPrimaryKeysForMapAreas: function(areas)
|
||||
{
|
||||
var keys=[];
|
||||
$.each(areas,function(i,e) {
|
||||
if ($.inArray(e.keys[0],keys)<0) {
|
||||
keys.push(e.keys[0]);
|
||||
}
|
||||
});
|
||||
return keys;
|
||||
},
|
||||
getData: function (obj) {
|
||||
if (typeof obj === 'string') {
|
||||
return this.getDataForKey(obj);
|
||||
} else if (obj && obj.mapster || u.isElement(obj)) {
|
||||
return this.getDataForArea(obj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
// remove highlight if present, raise event
|
||||
ensureNoHighlight: function () {
|
||||
var ar;
|
||||
if (this.highlightId >= 0) {
|
||||
this.graphics.clearHighlight();
|
||||
ar = this.data[this.highlightId];
|
||||
ar.changeState('highlight', false);
|
||||
this.setHighlightId(-1);
|
||||
}
|
||||
},
|
||||
setHighlightId: function(id) {
|
||||
this.highlightId = id;
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear all active selections on this map
|
||||
*/
|
||||
|
||||
clearSelections: function () {
|
||||
$.each(this.data, function (i,e) {
|
||||
if (e.selected) {
|
||||
e.deselect(true);
|
||||
}
|
||||
});
|
||||
this.removeSelectionFinish();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Set area options from an array of option data.
|
||||
*
|
||||
* @param {object[]} areas An array of objects containing area-specific options
|
||||
*/
|
||||
|
||||
setAreaOptions: function (areas) {
|
||||
var i, area_options, ar;
|
||||
areas = areas || [];
|
||||
|
||||
// refer by: map_data.options[map_data.data[x].area_option_id]
|
||||
|
||||
for (i = areas.length - 1; i >= 0; i--) {
|
||||
area_options = areas[i];
|
||||
if (area_options) {
|
||||
ar = this.getDataForKey(area_options.key);
|
||||
if (ar) {
|
||||
u.updateProps(ar.options, area_options);
|
||||
|
||||
// TODO: will not deselect areas that were previously selected, so this only works
|
||||
// for an initial bind.
|
||||
|
||||
if (u.isBool(area_options.selected)) {
|
||||
ar.selected = area_options.selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// keys: a comma-separated list
|
||||
drawSelections: function (keys) {
|
||||
var i, key_arr = u.asArray(keys);
|
||||
|
||||
for (i = key_arr.length - 1; i >= 0; i--) {
|
||||
this.data[key_arr[i]].drawSelection();
|
||||
}
|
||||
},
|
||||
redrawSelections: function () {
|
||||
$.each(this.data, function (i, e) {
|
||||
if (e.isSelectedOrStatic()) {
|
||||
e.drawSelection();
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
///called when images are done loading
|
||||
initialize: function () {
|
||||
var imgCopy, base_canvas, overlay_canvas, wrap, parentId, css, i,size,
|
||||
img,sort_func, sorted_list, scale,
|
||||
me = this,
|
||||
opts = me.options;
|
||||
|
||||
if (me.complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
img = $(me.image);
|
||||
|
||||
parentId = img.parent().attr('id');
|
||||
|
||||
// create a div wrapper only if there's not already a wrapper, otherwise, own it
|
||||
|
||||
if (parentId && parentId.length >= 12 && parentId.substring(0, 12) === "mapster_wrap") {
|
||||
wrap = img.parent();
|
||||
wrap.attr('id', me.wrapId());
|
||||
} else {
|
||||
wrap = $('<div id="' + me.wrapId() + '"></div>');
|
||||
|
||||
if (opts.wrapClass) {
|
||||
if (opts.wrapClass === true) {
|
||||
wrap.addClass(img[0].className);
|
||||
}
|
||||
else {
|
||||
wrap.addClass(opts.wrapClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
me.wrapper = wrap;
|
||||
|
||||
// me.images[1] is the copy of the original image. It should be loaded & at its native size now so we can obtain the true
|
||||
// width & height. This is needed to scale the imagemap if not being shown at its native size. It is also needed purely
|
||||
// to finish binding in case the original image was not visible. It can be impossible in some browsers to obtain the
|
||||
// native size of a hidden image.
|
||||
|
||||
me.scaleInfo = scale = u.scaleMap(me.images[0],me.images[1], opts.scaleMap);
|
||||
|
||||
me.base_canvas = base_canvas = me.graphics.createVisibleCanvas(me);
|
||||
me.overlay_canvas = overlay_canvas = me.graphics.createVisibleCanvas(me);
|
||||
|
||||
// Now we got what we needed from the copy -clone from the original image again to make sure any other attributes are copied
|
||||
imgCopy = $(me.images[1])
|
||||
.addClass('mapster_el '+ me.images[0].className)
|
||||
.attr({id:null, usemap: null});
|
||||
|
||||
size=u.size(me.images[0]);
|
||||
|
||||
if (size.complete) {
|
||||
imgCopy.css({
|
||||
width: size.width,
|
||||
height: size.height
|
||||
});
|
||||
}
|
||||
|
||||
me.buildDataset();
|
||||
|
||||
// now that we have processed all the areas, set css for wrapper, scale map if needed
|
||||
|
||||
css = {
|
||||
display: 'block',
|
||||
position: 'relative',
|
||||
padding: 0,
|
||||
width: scale.width,
|
||||
height: scale.height
|
||||
};
|
||||
|
||||
if (opts.wrapCss) {
|
||||
$.extend(css, opts.wrapCss);
|
||||
}
|
||||
// if we were rebinding with an existing wrapper, the image will aready be in it
|
||||
if (img.parent()[0] !== me.wrapper[0]) {
|
||||
|
||||
img.before(me.wrapper);
|
||||
}
|
||||
|
||||
wrap.css(css);
|
||||
|
||||
// move all generated images into the wrapper for easy removal later
|
||||
|
||||
$(me.images.slice(2)).hide();
|
||||
for (i = 1; i < me.images.length; i++) {
|
||||
wrap.append(me.images[i]);
|
||||
}
|
||||
|
||||
//me.images[1].style.cssText = me.image.style.cssText;
|
||||
|
||||
wrap.append(base_canvas)
|
||||
.append(overlay_canvas)
|
||||
.append(img.css(m.canvas_style));
|
||||
|
||||
// images[0] is the original image with map, images[1] is the copy/background that is visible
|
||||
|
||||
u.setOpacity(me.images[0], 0);
|
||||
$(me.images[1]).show();
|
||||
|
||||
u.setOpacity(me.images[1],1);
|
||||
|
||||
if (opts.isSelectable && opts.onGetList) {
|
||||
sorted_list = me.data.slice(0);
|
||||
if (opts.sortList) {
|
||||
if (opts.sortList === "desc") {
|
||||
sort_func = function (a, b) {
|
||||
return a === b ? 0 : (a > b ? -1 : 1);
|
||||
};
|
||||
}
|
||||
else {
|
||||
sort_func = function (a, b) {
|
||||
return a === b ? 0 : (a < b ? -1 : 1);
|
||||
};
|
||||
}
|
||||
|
||||
sorted_list.sort(function (a, b) {
|
||||
a = a.value;
|
||||
b = b.value;
|
||||
return sort_func(a, b);
|
||||
});
|
||||
}
|
||||
|
||||
me.options.boundList = opts.onGetList.call(me.image, sorted_list);
|
||||
}
|
||||
|
||||
me.complete=true;
|
||||
me.processCommandQueue();
|
||||
|
||||
if (opts.onConfigured && typeof opts.onConfigured === 'function') {
|
||||
opts.onConfigured.call(img, true);
|
||||
}
|
||||
},
|
||||
|
||||
// when rebind is true, the MapArea data will not be rebuilt.
|
||||
buildDataset: function(rebind) {
|
||||
var sel,areas,j,area_id,$area,area,curKey,mapArea,key,keys,mapAreaId,group_value,dataItem,href,
|
||||
me=this,
|
||||
opts=me.options,
|
||||
default_group;
|
||||
|
||||
function addAreaData(key, value) {
|
||||
var dataItem = new m.AreaData(me, key, value);
|
||||
dataItem.areaId = me._xref[key] = me.data.push(dataItem) - 1;
|
||||
return dataItem.areaId;
|
||||
}
|
||||
|
||||
me._xref = {};
|
||||
me.data = [];
|
||||
if (!rebind) {
|
||||
me.mapAreas=[];
|
||||
}
|
||||
|
||||
default_group = !opts.mapKey;
|
||||
if (default_group) {
|
||||
opts.mapKey = 'data-mapster-key';
|
||||
}
|
||||
|
||||
// the [attribute] selector is broken on old IE with jQuery. hasVml() is a quick and dirty
|
||||
// way to test for that
|
||||
|
||||
sel = m.hasVml() ? 'area' :
|
||||
(default_group ?
|
||||
'area[coords]' :
|
||||
'area[' + opts.mapKey + ']');
|
||||
|
||||
areas = $(me.map).find(sel).unbind('.mapster');
|
||||
|
||||
for (mapAreaId = 0;mapAreaId<areas.length; mapAreaId++) {
|
||||
area_id = 0;
|
||||
area = areas[mapAreaId];
|
||||
$area = $(area);
|
||||
|
||||
// skip areas with no coords - selector broken for older ie
|
||||
if (!area.coords) {
|
||||
continue;
|
||||
}
|
||||
// Create a key if none was assigned by the user
|
||||
|
||||
if (default_group) {
|
||||
curKey=String(mapAreaId);
|
||||
$area.attr('data-mapster-key', curKey);
|
||||
|
||||
} else {
|
||||
curKey = area.getAttribute(opts.mapKey);
|
||||
}
|
||||
|
||||
// conditions for which the area will be bound to mouse events
|
||||
// only bind to areas that don't have nohref. ie 6&7 cannot detect the presence of nohref, so we have to also not bind if href is missing.
|
||||
|
||||
if (rebind) {
|
||||
mapArea = me.mapAreas[$area.data('mapster')-1];
|
||||
mapArea.configure(curKey);
|
||||
} else {
|
||||
mapArea = new m.MapArea(me, area,curKey);
|
||||
me.mapAreas.push(mapArea);
|
||||
}
|
||||
|
||||
keys = mapArea.keys; // converted to an array by mapArea
|
||||
|
||||
|
||||
// Iterate through each mapKey assigned to this area
|
||||
for (j = keys.length - 1; j >= 0; j--) {
|
||||
key = keys[j];
|
||||
|
||||
if (opts.mapValue) {
|
||||
group_value = $area.attr(opts.mapValue);
|
||||
}
|
||||
if (default_group) {
|
||||
// set an attribute so we can refer to the area by index from the DOM object if no key
|
||||
area_id = addAreaData(me.data.length, group_value);
|
||||
dataItem = me.data[area_id];
|
||||
dataItem.key = key = area_id.toString();
|
||||
}
|
||||
else {
|
||||
area_id = me._xref[key];
|
||||
if (area_id >= 0) {
|
||||
dataItem = me.data[area_id];
|
||||
if (group_value && !me.data[area_id].value) {
|
||||
dataItem.value = group_value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
area_id = addAreaData(key, group_value);
|
||||
dataItem = me.data[area_id];
|
||||
dataItem.isPrimary=j===0;
|
||||
}
|
||||
}
|
||||
mapArea.areaDataXref.push(area_id);
|
||||
dataItem.areasXref.push(mapAreaId);
|
||||
}
|
||||
|
||||
href=$area.attr('href');
|
||||
if (href && href!=='#' && !dataItem.href)
|
||||
{
|
||||
dataItem.href=href;
|
||||
}
|
||||
|
||||
if (!mapArea.nohref) {
|
||||
$area.bind('click.mapster', me.click)
|
||||
.bind('mouseover.mapster, touchstart.mapster', me.mouseover)
|
||||
.bind('mouseout.mapster, touchend.mapster', me.mouseout)
|
||||
.bind('mousedown.mapster', me.mousedown);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// store an ID with each area.
|
||||
$area.data("mapster", mapAreaId+1);
|
||||
}
|
||||
|
||||
// TODO listenToList
|
||||
// if (opts.listenToList && opts.nitG) {
|
||||
// opts.nitG.bind('click.mapster', event_hooks[map_data.hooks_index].listclick_hook);
|
||||
// }
|
||||
|
||||
// populate areas from config options
|
||||
me.setAreaOptions(opts.areas);
|
||||
me.redrawSelections();
|
||||
|
||||
},
|
||||
processCommandQueue: function() {
|
||||
|
||||
var cur,me=this;
|
||||
while (!me.currentAction && me.commands.length) {
|
||||
cur = me.commands[0];
|
||||
me.commands.splice(0,1);
|
||||
m.impl[cur.command].apply(cur.that, cur.args);
|
||||
}
|
||||
},
|
||||
clearEvents: function () {
|
||||
$(this.map).find('area')
|
||||
.unbind('.mapster');
|
||||
$(this.images)
|
||||
.unbind('.mapster');
|
||||
},
|
||||
_clearCanvases: function (preserveState) {
|
||||
// remove the canvas elements created
|
||||
if (!preserveState) {
|
||||
$(this.base_canvas).remove();
|
||||
}
|
||||
$(this.overlay_canvas).remove();
|
||||
},
|
||||
clearMapData: function (preserveState) {
|
||||
var me = this;
|
||||
this._clearCanvases(preserveState);
|
||||
|
||||
// release refs to DOM elements
|
||||
$.each(this.data, function (i, e) {
|
||||
e.reset();
|
||||
});
|
||||
this.data = null;
|
||||
if (!preserveState) {
|
||||
// get rid of everything except the original image
|
||||
this.image.style.cssText = this.imgCssText;
|
||||
$(this.wrapper).before(this.image).remove();
|
||||
}
|
||||
|
||||
me.images.clear();
|
||||
|
||||
this.image = null;
|
||||
u.ifFunction(this.clearTooltip, this);
|
||||
},
|
||||
|
||||
// Compelete cleanup process for deslecting items. Called after a batch operation, or by AreaData for single
|
||||
// operations not flagged as "partial"
|
||||
|
||||
removeSelectionFinish: function () {
|
||||
var g = this.graphics;
|
||||
|
||||
g.refreshSelections();
|
||||
// do not call ensure_no_highlight- we don't really want to unhilight it, just remove the effect
|
||||
g.clearHighlight();
|
||||
}
|
||||
};
|
||||
} (jQuery));
|
||||
277
rus/admin/_V4/_lib/ImageMapster-master/src/mapimage.js
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
/* mapimage.js
|
||||
the MapImage object, repesents an instance of a single bound imagemap
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
var m = $.mapster,
|
||||
u = m.utils,
|
||||
ap=[];
|
||||
/**
|
||||
* An object encapsulating all the images used by a MapData.
|
||||
*/
|
||||
|
||||
m.MapImages = function(owner) {
|
||||
this.owner = owner;
|
||||
this.clear();
|
||||
};
|
||||
|
||||
|
||||
m.MapImages.prototype = {
|
||||
constructor: m.MapImages,
|
||||
|
||||
/* interface to make this array-like */
|
||||
|
||||
slice: function() {
|
||||
return ap.slice.apply(this,arguments);
|
||||
},
|
||||
splice: function() {
|
||||
ap.slice.apply(this.status,arguments);
|
||||
var result= ap.slice.apply(this,arguments);
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* a boolean value indicates whether all images are done loading
|
||||
* @return {bool} true when all are done
|
||||
*/
|
||||
complete: function() {
|
||||
return $.inArray(false, this.status) < 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Save an image in the images array and return its index
|
||||
* @param {Image} image An Image object
|
||||
* @return {int} the index of the image
|
||||
*/
|
||||
|
||||
_add: function(image) {
|
||||
var index = ap.push.call(this,image)-1;
|
||||
this.status[index] = false;
|
||||
return index;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the index of an Image within the images array
|
||||
* @param {Image} img An Image
|
||||
* @return {int} the index within the array, or -1 if it was not found
|
||||
*/
|
||||
|
||||
indexOf: function(image) {
|
||||
return u.indexOf(this,image);
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear this object and reset it to its initial state after binding.
|
||||
*/
|
||||
|
||||
clear: function() {
|
||||
var me=this;
|
||||
|
||||
if (me.ids && me.ids.length>0) {
|
||||
$.each(me.ids,function(i,e) {
|
||||
delete me[e];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of the cross-reference IDs bound to this object
|
||||
* @type {string[]}
|
||||
*/
|
||||
|
||||
me.ids=[];
|
||||
|
||||
/**
|
||||
* Length property for array-like behavior, set to zero when initializing. Array prototype
|
||||
* methods will update it after that.
|
||||
*
|
||||
* @type {int}
|
||||
*/
|
||||
|
||||
me.length=0;
|
||||
|
||||
/**
|
||||
* the loaded status of the corresponding image
|
||||
* @type {boolean[]}
|
||||
*/
|
||||
|
||||
me.status=[];
|
||||
|
||||
|
||||
// actually erase the images
|
||||
|
||||
me.splice(0);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Bind an image to the map and add it to the queue to be loaded; return an ID that
|
||||
* can be used to reference the
|
||||
*
|
||||
* @param {Image|string} image An Image object or a URL to an image
|
||||
* @param {string} [id] An id to refer to this image
|
||||
* @returns {int} an ID referencing the index of the image object in
|
||||
* map_data.images
|
||||
*/
|
||||
|
||||
add: function(image,id) {
|
||||
var index,src,me = this;
|
||||
|
||||
if (!image) { return; }
|
||||
|
||||
if (typeof image === 'string') {
|
||||
src = image;
|
||||
image = me[src];
|
||||
if (typeof image==='object') {
|
||||
return me.indexOf(image);
|
||||
}
|
||||
|
||||
image = $('<img />')
|
||||
.addClass('mapster_el')
|
||||
.hide();
|
||||
|
||||
index=me._add(image[0]);
|
||||
|
||||
image
|
||||
.bind('load',function(e) {
|
||||
me.imageLoaded.call(me,e);
|
||||
})
|
||||
.bind('error',function(e) {
|
||||
me.imageLoadError.call(me,e);
|
||||
});
|
||||
|
||||
image.attr('src', src);
|
||||
} else {
|
||||
|
||||
// use attr because we want the actual source, not the resolved path the browser will return directly calling image.src
|
||||
|
||||
index=me._add($(image)[0]);
|
||||
}
|
||||
if (id) {
|
||||
if (this[id]) {
|
||||
throw(id+" is already used or is not available as an altImage alias.");
|
||||
}
|
||||
me.ids.push(id);
|
||||
me[id]=me[index];
|
||||
}
|
||||
return index;
|
||||
},
|
||||
|
||||
/**
|
||||
* Bind the images in this object,
|
||||
* @param {boolean} retry when true, indicates that the function is calling itself after failure
|
||||
* @return {Promise} a promise that resolves when the images have finished loading
|
||||
*/
|
||||
|
||||
bind: function(retry) {
|
||||
var me = this,
|
||||
promise,
|
||||
triesLeft = me.owner.options.configTimeout / 200,
|
||||
|
||||
/* A recursive function to continue checking that the images have been
|
||||
loaded until a timeout has elapsed */
|
||||
|
||||
check=function() {
|
||||
var i;
|
||||
|
||||
// refresh status of images
|
||||
|
||||
i=me.length;
|
||||
|
||||
while (i-->0) {
|
||||
if (!me.isLoaded(i)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check to see if every image has already been loaded
|
||||
|
||||
if (me.complete()) {
|
||||
me.resolve();
|
||||
} else {
|
||||
// to account for failure of onLoad to fire in rare situations
|
||||
if (triesLeft-- > 0) {
|
||||
me.imgTimeout=window.setTimeout(function() {
|
||||
check.call(me,true);
|
||||
}, 50);
|
||||
} else {
|
||||
me.imageLoadError.call(me);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
promise = me.deferred=u.defer();
|
||||
|
||||
check();
|
||||
return promise;
|
||||
},
|
||||
|
||||
resolve: function() {
|
||||
var me=this,
|
||||
resolver=me.deferred;
|
||||
|
||||
if (resolver) {
|
||||
// Make a copy of the resolver before calling & removing it to ensure
|
||||
// it is not called twice
|
||||
me.deferred=null;
|
||||
resolver.resolve();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for image onload
|
||||
* @param {object} e jQuery event data
|
||||
*/
|
||||
|
||||
imageLoaded: function(e) {
|
||||
var me=this,
|
||||
index = me.indexOf(e.target);
|
||||
|
||||
if (index>=0) {
|
||||
|
||||
me.status[index] = true;
|
||||
if ($.inArray(false, me.status) < 0) {
|
||||
me.resolve();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for onload error
|
||||
* @param {object} e jQuery event data
|
||||
*/
|
||||
|
||||
imageLoadError: function(e) {
|
||||
clearTimeout(this.imgTimeout);
|
||||
this.triesLeft=0;
|
||||
var err = e ? 'The image ' + e.target.src + ' failed to load.' :
|
||||
'The images never seemed to finish loading. You may just need to increase the configTimeout if images could take a long time to load.';
|
||||
throw err;
|
||||
},
|
||||
/**
|
||||
* Test if the image at specificed index has finished loading
|
||||
* @param {int} index The image index
|
||||
* @return {boolean} true if loaded, false if not
|
||||
*/
|
||||
|
||||
isLoaded: function(index) {
|
||||
var img,
|
||||
me=this,
|
||||
status=me.status;
|
||||
|
||||
if (status[index]) { return true; }
|
||||
img = me[index];
|
||||
|
||||
if (typeof img.complete !== 'undefined') {
|
||||
status[index]=img.complete;
|
||||
} else {
|
||||
status[index]=!!u.imgWidth(img);
|
||||
}
|
||||
// if complete passes, the image is loaded, but may STILL not be available because of stuff like adblock.
|
||||
// make sure it is.
|
||||
|
||||
return status[index];
|
||||
}
|
||||
};
|
||||
} (jQuery));
|
||||
784
rus/admin/_V4/_lib/ImageMapster-master/src/redist/when.js
Normal file
|
|
@ -0,0 +1,784 @@
|
|||
/** @license MIT License (c) copyright B Cavalier & J Hann */
|
||||
|
||||
/**
|
||||
* when
|
||||
* A lightweight CommonJS Promises/A and when() implementation
|
||||
*
|
||||
* when is part of the cujo.js family of libraries (http://cujojs.com/)
|
||||
*
|
||||
* Licensed under the MIT License at:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* @version 1.2.0
|
||||
*/
|
||||
|
||||
/*lint-ignore-start*/
|
||||
|
||||
(function (define) {
|
||||
define(function () {
|
||||
var freeze, reduceArray, slice, undef;
|
||||
|
||||
//
|
||||
// Public API
|
||||
//
|
||||
|
||||
when.defer = defer;
|
||||
when.reject = reject;
|
||||
when.isPromise = isPromise;
|
||||
|
||||
when.all = all;
|
||||
when.some = some;
|
||||
when.any = any;
|
||||
|
||||
when.map = map;
|
||||
when.reduce = reduce;
|
||||
|
||||
when.chain = chain;
|
||||
|
||||
/** Object.freeze */
|
||||
freeze = Object.freeze || function (o) { return o; };
|
||||
|
||||
/**
|
||||
* Trusted Promise constructor. A Promise created from this constructor is
|
||||
* a trusted when.js promise. Any other duck-typed promise is considered
|
||||
* untrusted.
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function Promise() { }
|
||||
|
||||
Promise.prototype = freeze({
|
||||
always: function (alwaysback, progback) {
|
||||
return this.then(alwaysback, alwaysback, progback);
|
||||
},
|
||||
|
||||
otherwise: function (errback) {
|
||||
return this.then(undef, errback);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create an already-resolved promise for the supplied value
|
||||
* @private
|
||||
*
|
||||
* @param value anything
|
||||
* @return {Promise}
|
||||
*/
|
||||
function resolved(value) {
|
||||
|
||||
var p = new Promise();
|
||||
|
||||
p.then = function (callback) {
|
||||
var nextValue;
|
||||
try {
|
||||
if (callback) nextValue = callback(value);
|
||||
return promise(nextValue === undef ? value : nextValue);
|
||||
} catch (e) {
|
||||
return rejected(e);
|
||||
}
|
||||
};
|
||||
|
||||
return freeze(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an already-rejected {@link Promise} with the supplied
|
||||
* rejection reason.
|
||||
* @private
|
||||
*
|
||||
* @param reason rejection reason
|
||||
* @return {Promise}
|
||||
*/
|
||||
function rejected(reason) {
|
||||
|
||||
var p = new Promise();
|
||||
|
||||
p.then = function (callback, errback) {
|
||||
var nextValue;
|
||||
try {
|
||||
if (errback) {
|
||||
nextValue = errback(reason);
|
||||
return promise(nextValue === undef ? reason : nextValue)
|
||||
}
|
||||
|
||||
return rejected(reason);
|
||||
|
||||
} catch (e) {
|
||||
return rejected(e);
|
||||
}
|
||||
};
|
||||
|
||||
return freeze(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a rejected promise for the supplied promiseOrValue. If
|
||||
* promiseOrValue is a value, it will be the rejection value of the
|
||||
* returned promise. If promiseOrValue is a promise, its
|
||||
* completion value will be the rejected value of the returned promise
|
||||
*
|
||||
* @param promiseOrValue {*} the rejected value of the returned {@link Promise}
|
||||
*
|
||||
* @return {Promise} rejected {@link Promise}
|
||||
*/
|
||||
function reject(promiseOrValue) {
|
||||
return when(promiseOrValue, function (value) {
|
||||
return rejected(value);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new, CommonJS compliant, Deferred with fully isolated
|
||||
* resolver and promise parts, either or both of which may be given out
|
||||
* safely to consumers.
|
||||
* The Deferred itself has the full API: resolve, reject, progress, and
|
||||
* then. The resolver has resolve, reject, and progress. The promise
|
||||
* only has then.
|
||||
*
|
||||
* @memberOf when
|
||||
* @function
|
||||
*
|
||||
* @returns {Deferred}
|
||||
*/
|
||||
function defer() {
|
||||
var deferred, promise, listeners, progressHandlers, _then, _progress, complete;
|
||||
|
||||
listeners = [];
|
||||
progressHandlers = [];
|
||||
|
||||
/**
|
||||
* Pre-resolution then() that adds the supplied callback, errback, and progback
|
||||
* functions to the registered listeners
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param [callback] {Function} resolution handler
|
||||
* @param [errback] {Function} rejection handler
|
||||
* @param [progback] {Function} progress handler
|
||||
*
|
||||
* @throws {Error} if any argument is not null, undefined, or a Function
|
||||
*/
|
||||
_then = function unresolvedThen(callback, errback, progback) {
|
||||
var deferred = defer();
|
||||
|
||||
listeners.push(function (promise) {
|
||||
promise.then(callback, errback)
|
||||
.then(deferred.resolve, deferred.reject, deferred.progress);
|
||||
});
|
||||
|
||||
progback && progressHandlers.push(progback);
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Registers a handler for this {@link Deferred}'s {@link Promise}. Even though all arguments
|
||||
* are optional, each argument that *is* supplied must be null, undefined, or a Function.
|
||||
* Any other value will cause an Error to be thrown.
|
||||
*
|
||||
* @memberOf Promise
|
||||
*
|
||||
* @param [callback] {Function} resolution handler
|
||||
* @param [errback] {Function} rejection handler
|
||||
* @param [progback] {Function} progress handler
|
||||
*
|
||||
* @throws {Error} if any argument is not null, undefined, or a Function
|
||||
*/
|
||||
function then(callback, errback, progback) {
|
||||
return _then(callback, errback, progback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves this {@link Deferred}'s {@link Promise} with val as the
|
||||
* resolution value.
|
||||
*
|
||||
* @memberOf Resolver
|
||||
*
|
||||
* @param val anything
|
||||
*/
|
||||
function resolve(val) {
|
||||
complete(resolved(val));
|
||||
}
|
||||
|
||||
/**
|
||||
* Rejects this {@link Deferred}'s {@link Promise} with err as the
|
||||
* reason.
|
||||
*
|
||||
* @memberOf Resolver
|
||||
*
|
||||
* @param err anything
|
||||
*/
|
||||
function reject(err) {
|
||||
complete(rejected(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param update
|
||||
*/
|
||||
_progress = function (update) {
|
||||
var progress, i = 0;
|
||||
while (progress = progressHandlers[i++]) progress(update);
|
||||
};
|
||||
|
||||
/**
|
||||
* Emits a progress update to all progress observers registered with
|
||||
* this {@link Deferred}'s {@link Promise}
|
||||
*
|
||||
* @memberOf Resolver
|
||||
*
|
||||
* @param update anything
|
||||
*/
|
||||
function progress(update) {
|
||||
_progress(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transition from pre-resolution state to post-resolution state, notifying
|
||||
* all listeners of the resolution or rejection
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param completed {Promise} the completed value of this deferred
|
||||
*/
|
||||
complete = function (completed) {
|
||||
var listener, i = 0;
|
||||
|
||||
// Replace _then with one that directly notifies with the result.
|
||||
_then = completed.then;
|
||||
|
||||
// Replace complete so that this Deferred can only be completed
|
||||
// once. Also Replace _progress, so that subsequent attempts to issue
|
||||
// progress throw.
|
||||
complete = _progress = function alreadyCompleted() {
|
||||
// TODO: Consider silently returning here so that parties who
|
||||
// have a reference to the resolver cannot tell that the promise
|
||||
// has been resolved using try/catch
|
||||
throw new Error("already completed");
|
||||
};
|
||||
|
||||
// Free progressHandlers array since we'll never issue progress events
|
||||
// for this promise again now that it's completed
|
||||
progressHandlers = undef;
|
||||
|
||||
// Notify listeners
|
||||
// Traverse all listeners registered directly with this Deferred
|
||||
|
||||
while (listener = listeners[i++]) {
|
||||
listener(completed);
|
||||
}
|
||||
|
||||
listeners = [];
|
||||
};
|
||||
|
||||
/**
|
||||
* The full Deferred object, with both {@link Promise} and {@link Resolver}
|
||||
* parts
|
||||
* @class Deferred
|
||||
* @name Deferred
|
||||
*/
|
||||
deferred = {};
|
||||
|
||||
// Promise and Resolver parts
|
||||
// Freeze Promise and Resolver APIs
|
||||
|
||||
promise = new Promise();
|
||||
promise.then = deferred.then = then;
|
||||
|
||||
/**
|
||||
* The {@link Promise} for this {@link Deferred}
|
||||
* @memberOf Deferred
|
||||
* @name promise
|
||||
* @type {Promise}
|
||||
*/
|
||||
deferred.promise = freeze(promise);
|
||||
|
||||
/**
|
||||
* The {@link Resolver} for this {@link Deferred}
|
||||
* @memberOf Deferred
|
||||
* @name resolver
|
||||
* @class Resolver
|
||||
*/
|
||||
deferred.resolver = freeze({
|
||||
resolve: (deferred.resolve = resolve),
|
||||
reject: (deferred.reject = reject),
|
||||
progress: (deferred.progress = progress)
|
||||
});
|
||||
|
||||
return deferred;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if promiseOrValue is a promise or not. Uses the feature
|
||||
* test from http://wiki.commonjs.org/wiki/Promises/A to determine if
|
||||
* promiseOrValue is a promise.
|
||||
*
|
||||
* @param promiseOrValue anything
|
||||
*
|
||||
* @returns {Boolean} true if promiseOrValue is a {@link Promise}
|
||||
*/
|
||||
function isPromise(promiseOrValue) {
|
||||
return promiseOrValue && typeof promiseOrValue.then === 'function';
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an observer for a promise or immediate value.
|
||||
*
|
||||
* @function
|
||||
* @name when
|
||||
* @namespace
|
||||
*
|
||||
* @param promiseOrValue anything
|
||||
* @param {Function} [callback] callback to be called when promiseOrValue is
|
||||
* successfully resolved. If promiseOrValue is an immediate value, callback
|
||||
* will be invoked immediately.
|
||||
* @param {Function} [errback] callback to be called when promiseOrValue is
|
||||
* rejected.
|
||||
* @param {Function} [progressHandler] callback to be called when progress updates
|
||||
* are issued for promiseOrValue.
|
||||
*
|
||||
* @returns {Promise} a new {@link Promise} that will complete with the return
|
||||
* value of callback or errback or the completion value of promiseOrValue if
|
||||
* callback and/or errback is not supplied.
|
||||
*/
|
||||
function when(promiseOrValue, callback, errback, progressHandler) {
|
||||
// Get a promise for the input promiseOrValue
|
||||
// See promise()
|
||||
var trustedPromise = promise(promiseOrValue);
|
||||
|
||||
// Register promise handlers
|
||||
return trustedPromise.then(callback, errback, progressHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns promiseOrValue if promiseOrValue is a {@link Promise}, a new Promise if
|
||||
* promiseOrValue is a foreign promise, or a new, already-resolved {@link Promise}
|
||||
* whose resolution value is promiseOrValue if promiseOrValue is an immediate value.
|
||||
*
|
||||
* Note that this function is not safe to export since it will return its
|
||||
* input when promiseOrValue is a {@link Promise}
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param promiseOrValue anything
|
||||
*
|
||||
* @returns Guaranteed to return a trusted Promise. If promiseOrValue is a when.js {@link Promise}
|
||||
* returns promiseOrValue, otherwise, returns a new, already-resolved, when.js {@link Promise}
|
||||
* whose resolution value is:
|
||||
* * the resolution value of promiseOrValue if it's a foreign promise, or
|
||||
* * promiseOrValue if it's a value
|
||||
*/
|
||||
function promise(promiseOrValue) {
|
||||
var promise, deferred;
|
||||
|
||||
if (promiseOrValue instanceof Promise) {
|
||||
// It's a when.js promise, so we trust it
|
||||
promise = promiseOrValue;
|
||||
|
||||
} else {
|
||||
// It's not a when.js promise. Check to see if it's a foreign promise
|
||||
// or a value.
|
||||
|
||||
deferred = defer();
|
||||
if (isPromise(promiseOrValue)) {
|
||||
// It's a compliant promise, but we don't know where it came from,
|
||||
// so we don't trust its implementation entirely. Introduce a trusted
|
||||
// middleman when.js promise
|
||||
|
||||
// IMPORTANT: This is the only place when.js should ever call .then() on
|
||||
// an untrusted promise.
|
||||
promiseOrValue.then(deferred.resolve, deferred.reject, deferred.progress);
|
||||
promise = deferred.promise;
|
||||
|
||||
} else {
|
||||
// It's a value, not a promise. Create an already-resolved promise
|
||||
// for it.
|
||||
deferred.resolve(promiseOrValue);
|
||||
promise = deferred.promise;
|
||||
}
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a promise that will resolve when howMany of the supplied promisesOrValues
|
||||
* have resolved. The resolution value of the returned promise will be an array of
|
||||
* length howMany containing the resolutions values of the triggering promisesOrValues.
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promisesOrValues {Array} array of anything, may contain a mix
|
||||
* of {@link Promise}s and values
|
||||
* @param howMany
|
||||
* @param [callback]
|
||||
* @param [errback]
|
||||
* @param [progressHandler]
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function some(promisesOrValues, howMany, callback, errback, progressHandler) {
|
||||
|
||||
checkCallbacks(2, arguments);
|
||||
|
||||
return when(promisesOrValues, function (promisesOrValues) {
|
||||
|
||||
var toResolve, results, ret, deferred, resolver, rejecter, handleProgress, len, i;
|
||||
|
||||
len = promisesOrValues.length >>> 0;
|
||||
|
||||
toResolve = Math.max(0, Math.min(howMany, len));
|
||||
results = [];
|
||||
deferred = defer();
|
||||
ret = when(deferred, callback, errback, progressHandler);
|
||||
|
||||
// Wrapper so that resolver can be replaced
|
||||
function resolve(val) {
|
||||
resolver(val);
|
||||
}
|
||||
|
||||
// Wrapper so that rejecter can be replaced
|
||||
function reject(err) {
|
||||
rejecter(err);
|
||||
}
|
||||
|
||||
// Wrapper so that progress can be replaced
|
||||
function progress(update) {
|
||||
handleProgress(update);
|
||||
}
|
||||
|
||||
function complete() {
|
||||
resolver = rejecter = handleProgress = noop;
|
||||
}
|
||||
|
||||
// No items in the input, resolve immediately
|
||||
if (!toResolve) {
|
||||
deferred.resolve(results);
|
||||
|
||||
} else {
|
||||
// Resolver for promises. Captures the value and resolves
|
||||
// the returned promise when toResolve reaches zero.
|
||||
// Overwrites resolver var with a noop once promise has
|
||||
// be resolved to cover case where n < promises.length
|
||||
resolver = function (val) {
|
||||
// This orders the values based on promise resolution order
|
||||
// Another strategy would be to use the original position of
|
||||
// the corresponding promise.
|
||||
results.push(val);
|
||||
|
||||
if (! --toResolve) {
|
||||
complete();
|
||||
deferred.resolve(results);
|
||||
}
|
||||
};
|
||||
|
||||
// Rejecter for promises. Rejects returned promise
|
||||
// immediately, and overwrites rejecter var with a noop
|
||||
// once promise to cover case where n < promises.length.
|
||||
// TODO: Consider rejecting only when N (or promises.length - N?)
|
||||
// promises have been rejected instead of only one?
|
||||
rejecter = function (err) {
|
||||
complete();
|
||||
deferred.reject(err);
|
||||
};
|
||||
|
||||
handleProgress = deferred.progress;
|
||||
|
||||
// TODO: Replace while with forEach
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (i in promisesOrValues) {
|
||||
when(promisesOrValues[i], resolve, reject, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a promise that will resolve only once all the supplied promisesOrValues
|
||||
* have resolved. The resolution value of the returned promise will be an array
|
||||
* containing the resolution values of each of the promisesOrValues.
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promisesOrValues {Array|Promise} array of anything, may contain a mix
|
||||
* of {@link Promise}s and values
|
||||
* @param [callback] {Function}
|
||||
* @param [errback] {Function}
|
||||
* @param [progressHandler] {Function}
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function all(promisesOrValues, callback, errback, progressHandler) {
|
||||
|
||||
checkCallbacks(1, arguments);
|
||||
|
||||
return when(promisesOrValues, function (promisesOrValues) {
|
||||
return _reduce(promisesOrValues, reduceIntoArray, []);
|
||||
}).then(callback, errback, progressHandler);
|
||||
}
|
||||
|
||||
function reduceIntoArray(current, val, i) {
|
||||
current[i] = val;
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a promise that will resolve when any one of the supplied promisesOrValues
|
||||
* has resolved. The resolution value of the returned promise will be the resolution
|
||||
* value of the triggering promiseOrValue.
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promisesOrValues {Array|Promise} array of anything, may contain a mix
|
||||
* of {@link Promise}s and values
|
||||
* @param [callback] {Function}
|
||||
* @param [errback] {Function}
|
||||
* @param [progressHandler] {Function}
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function any(promisesOrValues, callback, errback, progressHandler) {
|
||||
|
||||
function unwrapSingleResult(val) {
|
||||
return callback ? callback(val[0]) : val[0];
|
||||
}
|
||||
|
||||
return some(promisesOrValues, 1, unwrapSingleResult, errback, progressHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Traditional map function, similar to `Array.prototype.map()`, but allows
|
||||
* input to contain {@link Promise}s and/or values, and mapFunc may return
|
||||
* either a value or a {@link Promise}
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promise {Array|Promise} array of anything, may contain a mix
|
||||
* of {@link Promise}s and values
|
||||
* @param mapFunc {Function} mapping function mapFunc(value) which may return
|
||||
* either a {@link Promise} or value
|
||||
*
|
||||
* @returns {Promise} a {@link Promise} that will resolve to an array containing
|
||||
* the mapped output values.
|
||||
*/
|
||||
function map(promise, mapFunc) {
|
||||
return when(promise, function (array) {
|
||||
return _map(array, mapFunc);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Private map helper to map an array of promises
|
||||
* @private
|
||||
*
|
||||
* @param promisesOrValues {Array}
|
||||
* @param mapFunc {Function}
|
||||
* @return {Promise}
|
||||
*/
|
||||
function _map(promisesOrValues, mapFunc) {
|
||||
|
||||
var results, len, i;
|
||||
|
||||
// Since we know the resulting length, we can preallocate the results
|
||||
// array to avoid array expansions.
|
||||
len = promisesOrValues.length >>> 0;
|
||||
results = new Array(len);
|
||||
|
||||
// Since mapFunc may be async, get all invocations of it into flight
|
||||
// asap, and then use reduce() to collect all the results
|
||||
for (i = 0; i < len; i++) {
|
||||
if (i in promisesOrValues)
|
||||
results[i] = when(promisesOrValues[i], mapFunc);
|
||||
}
|
||||
|
||||
// Could use all() here, but that would result in another array
|
||||
// being allocated, i.e. map() would end up allocating 2 arrays
|
||||
// of size len instead of just 1. Since all() uses reduce()
|
||||
// anyway, avoid the additional allocation by calling reduce
|
||||
// directly.
|
||||
return _reduce(results, reduceIntoArray, results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Traditional reduce function, similar to `Array.prototype.reduce()`, but
|
||||
* input may contain {@link Promise}s and/or values, and reduceFunc
|
||||
* may return either a value or a {@link Promise}, *and* initialValue may
|
||||
* be a {@link Promise} for the starting value.
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promise {Array|Promise} array of anything, may contain a mix
|
||||
* of {@link Promise}s and values. May also be a {@link Promise} for
|
||||
* an array.
|
||||
* @param reduceFunc {Function} reduce function reduce(currentValue, nextValue, index, total),
|
||||
* where total is the total number of items being reduced, and will be the same
|
||||
* in each call to reduceFunc.
|
||||
* @param initialValue starting value, or a {@link Promise} for the starting value
|
||||
*
|
||||
* @returns {Promise} that will resolve to the final reduced value
|
||||
*/
|
||||
function reduce(promise, reduceFunc, initialValue) {
|
||||
var args = slice.call(arguments, 1);
|
||||
return when(promise, function (array) {
|
||||
return _reduce.apply(undef, [array].concat(args));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Private reduce to reduce an array of promises
|
||||
* @private
|
||||
*
|
||||
* @param promisesOrValues {Array}
|
||||
* @param reduceFunc {Function}
|
||||
* @param initialValue {*}
|
||||
* @return {Promise}
|
||||
*/
|
||||
function _reduce(promisesOrValues, reduceFunc, initialValue) {
|
||||
|
||||
var total, args;
|
||||
|
||||
total = promisesOrValues.length;
|
||||
|
||||
// Skip promisesOrValues, since it will be used as 'this' in the call
|
||||
// to the actual reduce engine below.
|
||||
|
||||
// Wrap the supplied reduceFunc with one that handles promises and then
|
||||
// delegates to the supplied.
|
||||
|
||||
args = [
|
||||
function (current, val, i) {
|
||||
return when(current, function (c) {
|
||||
return when(val, function (value) {
|
||||
return reduceFunc(c, value, i, total);
|
||||
});
|
||||
});
|
||||
}
|
||||
];
|
||||
|
||||
if (arguments.length > 2) args.push(initialValue);
|
||||
|
||||
return reduceArray.apply(promisesOrValues, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that resolution of promiseOrValue will complete resolver with the completion
|
||||
* value of promiseOrValue, or instead with resolveValue if it is provided.
|
||||
*
|
||||
* @memberOf when
|
||||
*
|
||||
* @param promiseOrValue
|
||||
* @param resolver {Resolver}
|
||||
* @param [resolveValue] anything
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function chain(promiseOrValue, resolver, resolveValue) {
|
||||
var useResolveValue = arguments.length > 2;
|
||||
|
||||
return when(promiseOrValue,
|
||||
function (val) {
|
||||
if (useResolveValue) val = resolveValue;
|
||||
resolver.resolve(val);
|
||||
return val;
|
||||
},
|
||||
function (e) {
|
||||
resolver.reject(e);
|
||||
return rejected(e);
|
||||
},
|
||||
resolver.progress
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Utility functions
|
||||
//
|
||||
|
||||
/**
|
||||
* Helper that checks arrayOfCallbacks to ensure that each element is either
|
||||
* a function, or null or undefined.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param arrayOfCallbacks {Array} array to check
|
||||
* @throws {Error} if any element of arrayOfCallbacks is something other than
|
||||
* a Functions, null, or undefined.
|
||||
*/
|
||||
function checkCallbacks(start, arrayOfCallbacks) {
|
||||
var arg, i = arrayOfCallbacks.length;
|
||||
while (i > start) {
|
||||
arg = arrayOfCallbacks[--i];
|
||||
if (arg != null && typeof arg != 'function') throw new Error('callback is not a function');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No-Op function used in method replacement
|
||||
* @private
|
||||
*/
|
||||
function noop() { }
|
||||
|
||||
slice = [].slice;
|
||||
|
||||
// ES5 reduce implementation if native not available
|
||||
// See: http://es5.github.com/#x15.4.4.21 as there are many
|
||||
// specifics and edge cases.
|
||||
reduceArray = [].reduce ||
|
||||
function (reduceFunc /*, initialValue */) {
|
||||
// ES5 dictates that reduce.length === 1
|
||||
|
||||
// This implementation deviates from ES5 spec in the following ways:
|
||||
// 1. It does not check if reduceFunc is a Callable
|
||||
|
||||
var arr, args, reduced, len, i;
|
||||
|
||||
i = 0;
|
||||
arr = Object(this);
|
||||
len = arr.length >>> 0;
|
||||
args = arguments;
|
||||
|
||||
// If no initialValue, use first item of array (we know length !== 0 here)
|
||||
// and adjust i to start at second item
|
||||
if (args.length <= 1) {
|
||||
// Skip to the first real element in the array
|
||||
for (; ; ) {
|
||||
if (i in arr) {
|
||||
reduced = arr[i++];
|
||||
break;
|
||||
}
|
||||
|
||||
// If we reached the end of the array without finding any real
|
||||
// elements, it's a TypeError
|
||||
if (++i >= len) {
|
||||
throw new TypeError();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If initialValue provided, use it
|
||||
reduced = args[1];
|
||||
}
|
||||
|
||||
// Do the actual reduce
|
||||
for (; i < len; ++i) {
|
||||
// Skip holes
|
||||
if (i in arr)
|
||||
reduced = reduceFunc(reduced, arr[i], i, arr);
|
||||
}
|
||||
|
||||
return reduced;
|
||||
};
|
||||
|
||||
return when;
|
||||
});
|
||||
})(typeof define == 'function'
|
||||
? define
|
||||
: function (factory) {
|
||||
typeof module != 'undefined'
|
||||
? (module.exports = factory())
|
||||
: (jQuery.mapster_when = factory());
|
||||
}
|
||||
// Boilerplate for AMD, Node, and browser global
|
||||
);
|
||||
/*lint-ignore-end*/
|
||||
326
rus/admin/_V4/_lib/ImageMapster-master/src/scale.js
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
/* scale.js: resize and zoom functionality
|
||||
requires areacorners.js, when.js
|
||||
*/
|
||||
|
||||
|
||||
(function ($) {
|
||||
var m = $.mapster, u = m.utils, p = m.MapArea.prototype;
|
||||
|
||||
m.utils.getScaleInfo = function (eff, actual) {
|
||||
var pct;
|
||||
if (!actual) {
|
||||
pct = 1;
|
||||
actual=eff;
|
||||
} else {
|
||||
pct = eff.width / actual.width || eff.height / actual.height;
|
||||
// make sure a float error doesn't muck us up
|
||||
if (pct > 0.98 && pct < 1.02) { pct = 1; }
|
||||
}
|
||||
return {
|
||||
scale: (pct !== 1),
|
||||
scalePct: pct,
|
||||
realWidth: actual.width,
|
||||
realHeight: actual.height,
|
||||
width: eff.width,
|
||||
height: eff.height,
|
||||
ratio: eff.width / eff.height
|
||||
};
|
||||
};
|
||||
// Scale a set of AREAs, return old data as an array of objects
|
||||
m.utils.scaleMap = function (image, imageRaw, scale) {
|
||||
|
||||
// stunningly, jQuery width can return zero even as width does not, seems to happen only
|
||||
// with adBlock or maybe other plugins. These must interfere with onload events somehow.
|
||||
|
||||
|
||||
var vis=u.size(image),
|
||||
raw=u.size(imageRaw,true);
|
||||
|
||||
if (!raw.complete()) {
|
||||
throw("Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.");
|
||||
}
|
||||
if (!vis.complete()) {
|
||||
vis=raw;
|
||||
}
|
||||
return this.getScaleInfo(vis, scale ? raw : null);
|
||||
};
|
||||
|
||||
/**
|
||||
* Resize the image map. Only one of newWidth and newHeight should be passed to preserve scale
|
||||
*
|
||||
* @param {int} width The new width OR an object containing named parameters matching this function sig
|
||||
* @param {int} height The new height
|
||||
* @param {int} effectDuration Time in ms for the resize animation, or zero for no animation
|
||||
* @param {function} callback A function to invoke when the operation finishes
|
||||
* @return {promise} NOT YET IMPLEMENTED
|
||||
*/
|
||||
|
||||
m.MapData.prototype.resize = function (width, height, duration, callback) {
|
||||
var p,promises,newsize,els, highlightId, ratio,
|
||||
me = this;
|
||||
|
||||
// allow omitting duration
|
||||
callback = callback || duration;
|
||||
|
||||
function sizeCanvas(canvas, w, h) {
|
||||
if (m.hasCanvas()) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
} else {
|
||||
$(canvas).width(w);
|
||||
$(canvas).height(h);
|
||||
}
|
||||
}
|
||||
|
||||
// Finalize resize action, do callback, pass control to command queue
|
||||
|
||||
function cleanupAndNotify() {
|
||||
|
||||
me.currentAction = '';
|
||||
|
||||
if ($.isFunction(callback)) {
|
||||
callback();
|
||||
}
|
||||
|
||||
me.processCommandQueue();
|
||||
}
|
||||
|
||||
// handle cleanup after the inner elements are resized
|
||||
|
||||
function finishResize() {
|
||||
sizeCanvas(me.overlay_canvas, width, height);
|
||||
|
||||
// restore highlight state if it was highlighted before
|
||||
if (highlightId >= 0) {
|
||||
var areaData = me.data[highlightId];
|
||||
areaData.tempOptions = { fade: false };
|
||||
me.getDataForKey(areaData.key).highlight();
|
||||
areaData.tempOptions = null;
|
||||
}
|
||||
sizeCanvas(me.base_canvas, width, height);
|
||||
me.redrawSelections();
|
||||
cleanupAndNotify();
|
||||
}
|
||||
|
||||
function resizeMapData() {
|
||||
$(me.image).css(newsize);
|
||||
// start calculation at the same time as effect
|
||||
me.scaleInfo = u.getScaleInfo({
|
||||
width: width,
|
||||
height: height
|
||||
},
|
||||
{
|
||||
width: me.scaleInfo.realWidth,
|
||||
height: me.scaleInfo.realHeight
|
||||
});
|
||||
$.each(me.data, function (i, e) {
|
||||
$.each(e.areas(), function (i, e) {
|
||||
e.resize();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (me.scaleInfo.width === width && me.scaleInfo.height === height) {
|
||||
return;
|
||||
}
|
||||
|
||||
highlightId = me.highlightId;
|
||||
|
||||
|
||||
if (!width) {
|
||||
ratio = height / me.scaleInfo.realHeight;
|
||||
width = Math.round(me.scaleInfo.realWidth * ratio);
|
||||
}
|
||||
if (!height) {
|
||||
ratio = width / me.scaleInfo.realWidth;
|
||||
height = Math.round(me.scaleInfo.realHeight * ratio);
|
||||
}
|
||||
|
||||
newsize = { 'width': String(width) + 'px', 'height': String(height) + 'px' };
|
||||
if (!m.hasCanvas()) {
|
||||
$(me.base_canvas).children().remove();
|
||||
}
|
||||
|
||||
// resize all the elements that are part of the map except the image itself (which is not visible)
|
||||
// but including the div wrapper
|
||||
els = $(me.wrapper).find('.mapster_el').add(me.wrapper);
|
||||
|
||||
if (duration) {
|
||||
promises = [];
|
||||
me.currentAction = 'resizing';
|
||||
els.each(function (i, e) {
|
||||
p = u.defer();
|
||||
promises.push(p);
|
||||
|
||||
$(e).animate(newsize, {
|
||||
duration: duration,
|
||||
complete: p.resolve,
|
||||
easing: "linear"
|
||||
});
|
||||
});
|
||||
|
||||
p = u.defer();
|
||||
promises.push(p);
|
||||
|
||||
// though resizeMapData is not async, it needs to be finished just the same as the animations,
|
||||
// so add it to the "to do" list.
|
||||
|
||||
u.when.all(promises).then(finishResize);
|
||||
resizeMapData();
|
||||
p.resolve();
|
||||
} else {
|
||||
els.css(newsize);
|
||||
resizeMapData();
|
||||
finishResize();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
m.MapArea = u.subclass(m.MapArea, function () {
|
||||
//change the area tag data if needed
|
||||
this.base.init();
|
||||
if (this.owner.scaleInfo.scale) {
|
||||
this.resize();
|
||||
}
|
||||
});
|
||||
|
||||
p.coords = function (percent, coordOffset) {
|
||||
var j, newCoords = [],
|
||||
pct = percent || this.owner.scaleInfo.scalePct,
|
||||
offset = coordOffset || 0;
|
||||
|
||||
if (pct === 1 && coordOffset === 0) {
|
||||
return this.originalCoords;
|
||||
}
|
||||
|
||||
for (j = 0; j < this.length; j++) {
|
||||
//amount = j % 2 === 0 ? xPct : yPct;
|
||||
newCoords.push(Math.round(this.originalCoords[j] * pct) + offset);
|
||||
}
|
||||
return newCoords;
|
||||
};
|
||||
p.resize = function () {
|
||||
this.area.coords = this.coords().join(',');
|
||||
};
|
||||
|
||||
p.reset = function () {
|
||||
this.area.coords = this.coords(1).join(',');
|
||||
};
|
||||
|
||||
m.impl.resize = function (width, height, duration, callback) {
|
||||
if (!width && !height) {
|
||||
return false;
|
||||
}
|
||||
var x= (new m.Method(this,
|
||||
function () {
|
||||
this.resize(width, height, duration, callback);
|
||||
},
|
||||
null,
|
||||
{
|
||||
name: 'resize',
|
||||
args: arguments
|
||||
}
|
||||
)).go();
|
||||
return x;
|
||||
};
|
||||
|
||||
/*
|
||||
m.impl.zoom = function (key, opts) {
|
||||
var options = opts || {};
|
||||
|
||||
function zoom(areaData) {
|
||||
// this will be MapData object returned by Method
|
||||
|
||||
var scroll, corners, height, width, ratio,
|
||||
diffX, diffY, ratioX, ratioY, offsetX, offsetY, newWidth, newHeight, scrollLeft, scrollTop,
|
||||
padding = options.padding || 0,
|
||||
scrollBarSize = areaData ? 20 : 0,
|
||||
me = this,
|
||||
zoomOut = false;
|
||||
|
||||
if (areaData) {
|
||||
// save original state on first zoom operation
|
||||
if (!me.zoomed) {
|
||||
me.zoomed = true;
|
||||
me.preZoomWidth = me.scaleInfo.width;
|
||||
me.preZoomHeight = me.scaleInfo.height;
|
||||
me.zoomedArea = areaData;
|
||||
if (options.scroll) {
|
||||
me.wrapper.css({ overflow: 'auto' });
|
||||
}
|
||||
}
|
||||
corners = $.mapster.utils.areaCorners(areaData.coords(1, 0));
|
||||
width = me.wrapper.innerWidth() - scrollBarSize - padding * 2;
|
||||
height = me.wrapper.innerHeight() - scrollBarSize - padding * 2;
|
||||
diffX = corners.maxX - corners.minX;
|
||||
diffY = corners.maxY - corners.minY;
|
||||
ratioX = width / diffX;
|
||||
ratioY = height / diffY;
|
||||
ratio = Math.min(ratioX, ratioY);
|
||||
offsetX = (width - diffX * ratio) / 2;
|
||||
offsetY = (height - diffY * ratio) / 2;
|
||||
|
||||
newWidth = me.scaleInfo.realWidth * ratio;
|
||||
newHeight = me.scaleInfo.realHeight * ratio;
|
||||
scrollLeft = (corners.minX) * ratio - padding - offsetX;
|
||||
scrollTop = (corners.minY) * ratio - padding - offsetY;
|
||||
} else {
|
||||
if (!me.zoomed) {
|
||||
return;
|
||||
}
|
||||
zoomOut = true;
|
||||
newWidth = me.preZoomWidth;
|
||||
newHeight = me.preZoomHeight;
|
||||
scrollLeft = null;
|
||||
scrollTop = null;
|
||||
}
|
||||
|
||||
this.resize({
|
||||
width: newWidth,
|
||||
height: newHeight,
|
||||
duration: options.duration,
|
||||
scroll: scroll,
|
||||
scrollLeft: scrollLeft,
|
||||
scrollTop: scrollTop,
|
||||
// closure so we can be sure values are correct
|
||||
callback: (function () {
|
||||
var isZoomOut = zoomOut,
|
||||
scroll = options.scroll,
|
||||
areaD = areaData;
|
||||
return function () {
|
||||
if (isZoomOut) {
|
||||
me.preZoomWidth = null;
|
||||
me.preZoomHeight = null;
|
||||
me.zoomed = false;
|
||||
me.zoomedArea = false;
|
||||
if (scroll) {
|
||||
me.wrapper.css({ overflow: 'inherit' });
|
||||
}
|
||||
} else {
|
||||
// just to be sure it wasn't canceled & restarted
|
||||
me.zoomedArea = areaD;
|
||||
}
|
||||
};
|
||||
} ())
|
||||
});
|
||||
}
|
||||
return (new m.Method(this,
|
||||
function (opts) {
|
||||
zoom.call(this);
|
||||
},
|
||||
function () {
|
||||
zoom.call(this.owner, this);
|
||||
},
|
||||
{
|
||||
name: 'zoom',
|
||||
args: arguments,
|
||||
first: true,
|
||||
key: key
|
||||
}
|
||||
)).go();
|
||||
|
||||
|
||||
};
|
||||
*/
|
||||
} (jQuery));
|
||||
402
rus/admin/_V4/_lib/ImageMapster-master/src/tooltip.js
Normal file
|
|
@ -0,0 +1,402 @@
|
|||
/* tooltip.js - tooltip functionality
|
||||
requires areacorners.js
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
var m = $.mapster, u = m.utils;
|
||||
|
||||
$.extend(m.defaults, {
|
||||
toolTipContainer: '<div style="border: 2px solid black; background: #EEEEEE; width:160px; padding:4px; margin: 4px; -moz-box-shadow: 3px 3px 5px #535353; ' +
|
||||
'-webkit-box-shadow: 3px 3px 5px #535353; box-shadow: 3px 3px 5px #535353; -moz-border-radius: 6px 6px 6px 6px; -webkit-border-radius: 6px; ' +
|
||||
'border-radius: 6px 6px 6px 6px; opacity: 0.9;"></div>',
|
||||
showToolTip: false,
|
||||
toolTipFade: true,
|
||||
toolTipClose: ['area-mouseout','image-mouseout'],
|
||||
onShowToolTip: null,
|
||||
onHideToolTip: null
|
||||
});
|
||||
|
||||
$.extend(m.area_defaults, {
|
||||
toolTip: null,
|
||||
toolTipClose: null
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Show a tooltip positioned near this area.
|
||||
*
|
||||
* @param {string|jquery} html A string of html or a jQuery object containing the tooltip content.
|
||||
* @param {string|jquery} [template] The html template in which to wrap the content
|
||||
* @param {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
* @return {jquery} The tooltip that was created
|
||||
*/
|
||||
|
||||
function createToolTip(html, template, css) {
|
||||
var tooltip;
|
||||
|
||||
// wrap the template in a jQuery object, or clone the template if it's already one.
|
||||
// This assumes that anything other than a string is a jQuery object; if it's not jQuery will
|
||||
// probably throw an error.
|
||||
|
||||
if (template) {
|
||||
tooltip = typeof template === 'string' ?
|
||||
$(template) :
|
||||
$(template).clone();
|
||||
|
||||
tooltip.append(html);
|
||||
} else {
|
||||
tooltip=$(html);
|
||||
}
|
||||
|
||||
// always set display to block, or the positioning css won't work if the end user happened to
|
||||
// use a non-block type element.
|
||||
|
||||
tooltip.css($.extend((css || {}),{
|
||||
display:"block",
|
||||
position:"absolute"
|
||||
})).hide();
|
||||
|
||||
$('body').append(tooltip);
|
||||
|
||||
// we must actually add the tooltip to the DOM and "show" it in order to figure out how much space it
|
||||
// consumes, and then reposition it with that knowledge.
|
||||
// We also cache the actual opacity setting to restore finally.
|
||||
|
||||
tooltip.attr("data-opacity",tooltip.css("opacity"))
|
||||
.css("opacity",0);
|
||||
|
||||
// doesn't really show it because opacity=0
|
||||
|
||||
return tooltip.show();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show a tooltip positioned near this area.
|
||||
*
|
||||
* @param {jquery} tooltip The tooltip
|
||||
* @param {object} [options] options for displaying the tooltip.
|
||||
* @config {int} [left] The 0-based absolute x position for the tooltip
|
||||
* @config {int} [top] The 0-based absolute y position for the tooltip
|
||||
* @config {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
* @config {bool} [fadeDuration] When non-zero, the duration in milliseconds of a fade-in effect for the tooltip.
|
||||
*/
|
||||
|
||||
function showToolTipImpl(tooltip,options)
|
||||
{
|
||||
var tooltipCss = {
|
||||
"left": options.left + "px",
|
||||
"top": options.top + "px"
|
||||
},
|
||||
actalOpacity=tooltip.attr("data-opacity") || 0,
|
||||
zindex = tooltip.css("z-index");
|
||||
|
||||
if (parseInt(zindex,10)===0
|
||||
|| zindex === "auto") {
|
||||
tooltipCss["z-index"] = 9999;
|
||||
}
|
||||
|
||||
tooltip.css(tooltipCss)
|
||||
.addClass('mapster_tooltip');
|
||||
|
||||
|
||||
if (options.fadeDuration && options.fadeDuration>0) {
|
||||
u.fader(tooltip[0], 0, actalOpacity, options.fadeDuration);
|
||||
} else {
|
||||
u.setOpacity(tooltip[0], actalOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide and remove active tooltips
|
||||
*
|
||||
* @param {MapData} this The mapdata object to which the tooltips belong
|
||||
*/
|
||||
|
||||
m.MapData.prototype.clearToolTip = function() {
|
||||
if (this.activeToolTip) {
|
||||
this.activeToolTip.stop().remove();
|
||||
this.activeToolTip = null;
|
||||
this.activeToolTipID = null;
|
||||
u.ifFunction(this.options.onHideToolTip, this);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Configure the binding between a named tooltip closing option, and a mouse event.
|
||||
*
|
||||
* If a callback is passed, it will be called when the activating event occurs, and the tooltip will
|
||||
* only closed if it returns true.
|
||||
*
|
||||
* @param {MapData} [this] The MapData object to which this tooltip belongs.
|
||||
* @param {String} option The name of the tooltip closing option
|
||||
* @param {String} event UI event to bind to this option
|
||||
* @param {Element} target The DOM element that is the target of the event
|
||||
* @param {Function} [beforeClose] Callback when the tooltip is closed
|
||||
* @param {Function} [onClose] Callback when the tooltip is closed
|
||||
*/
|
||||
function bindToolTipClose(options, bindOption, event, target, beforeClose, onClose) {
|
||||
var event_name = event + '.mapster-tooltip';
|
||||
|
||||
if ($.inArray(bindOption, options) >= 0) {
|
||||
target.unbind(event_name)
|
||||
.bind(event_name, function (e) {
|
||||
if (!beforeClose || beforeClose.call(this,e)) {
|
||||
target.unbind('.mapster-tooltip');
|
||||
if (onClose) {
|
||||
onClose.call(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
object: target,
|
||||
event: event_name
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a tooltip.
|
||||
*
|
||||
* @param {string|jquery} [tooltip] A string of html or a jQuery object containing the tooltip content.
|
||||
*
|
||||
* @param {string|jquery} [target] The target of the tooltip, to be used to determine positioning. If null,
|
||||
* absolute position values must be passed with left and top.
|
||||
*
|
||||
* @param {string|jquery} [image] If target is an [area] the image that owns it
|
||||
*
|
||||
* @param {string|jquery} [container] An element within which the tooltip must be bounded
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param {object|string|jQuery} [options] options to apply when creating this tooltip - OR -
|
||||
* The markup, or a jquery object, containing the data for the tooltip
|
||||
*
|
||||
* @config {string} [closeEvents] A string with one or more comma-separated values that determine when the tooltip
|
||||
* closes: 'area-click','tooltip-click','image-mouseout' are valid values
|
||||
* then no template will be used.
|
||||
* @config {int} [offsetx] the horizontal amount to offset the tooltip
|
||||
* @config {int} [offsety] the vertical amount to offset the tooltip
|
||||
* @config {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
*/
|
||||
|
||||
function showToolTip(tooltip,target,image,container,options) {
|
||||
var corners,
|
||||
ttopts = {};
|
||||
|
||||
options = options || {};
|
||||
|
||||
|
||||
if (target) {
|
||||
|
||||
corners = u.areaCorners(target,image,container,
|
||||
tooltip.outerWidth(true),
|
||||
tooltip.outerHeight(true));
|
||||
|
||||
// Try to upper-left align it first, if that doesn't work, change the parameters
|
||||
|
||||
ttopts.left = corners[0];
|
||||
ttopts.top = corners[1];
|
||||
|
||||
} else {
|
||||
|
||||
ttopts.left = options.left;
|
||||
ttopts.top = options.top;
|
||||
}
|
||||
|
||||
ttopts.left += (options.offsetx || 0);
|
||||
ttopts.top +=(options.offsety || 0);
|
||||
|
||||
ttopts.css= options.css;
|
||||
ttopts.fadeDuration = options.fadeDuration;
|
||||
|
||||
showToolTipImpl(tooltip,ttopts);
|
||||
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a tooltip positioned near this area.
|
||||
*
|
||||
* @param {string|jquery} [content] A string of html or a jQuery object containing the tooltip content.
|
||||
|
||||
* @param {object|string|jQuery} [options] options to apply when creating this tooltip - OR -
|
||||
* The markup, or a jquery object, containing the data for the tooltip
|
||||
* @config {string|jquery} [container] An element within which the tooltip must be bounded
|
||||
* @config {bool} [template] a template to use instead of the default. If this property exists and is null,
|
||||
* then no template will be used.
|
||||
* @config {string} [closeEvents] A string with one or more comma-separated values that determine when the tooltip
|
||||
* closes: 'area-click','tooltip-click','image-mouseout' are valid values
|
||||
* then no template will be used.
|
||||
* @config {int} [offsetx] the horizontal amount to offset the tooltip
|
||||
* @config {int} [offsety] the vertical amount to offset the tooltip
|
||||
* @config {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
*/
|
||||
m.AreaData.prototype.showToolTip= function(content,options) {
|
||||
var tooltip, closeOpts, target, tipClosed, template,
|
||||
ttopts = {},
|
||||
ad=this,
|
||||
md=ad.owner,
|
||||
areaOpts = ad.effectiveOptions();
|
||||
|
||||
// copy the options object so we can update it
|
||||
options = options ? $.extend({},options) : {};
|
||||
|
||||
content = content || areaOpts.toolTip;
|
||||
closeOpts = options.closeEvents || areaOpts.toolTipClose || md.options.toolTipClose || 'tooltip-click';
|
||||
|
||||
template = typeof options.template !== 'undefined' ?
|
||||
options.template :
|
||||
md.options.toolTipContainer;
|
||||
|
||||
options.closeEvents = typeof closeOpts === 'string' ?
|
||||
closeOpts = u.split(closeOpts) :
|
||||
closeOpts;
|
||||
|
||||
options.fadeDuration = options.fadeDuration ||
|
||||
(md.options.toolTipFade ?
|
||||
(md.options.fadeDuration || areaOpts.fadeDuration) : 0);
|
||||
|
||||
target = ad.area ?
|
||||
ad.area :
|
||||
$.map(ad.areas(),
|
||||
function(e) {
|
||||
return e.area;
|
||||
});
|
||||
|
||||
if (md.activeToolTipID===ad.areaId) {
|
||||
return;
|
||||
}
|
||||
|
||||
md.clearToolTip();
|
||||
|
||||
md.activeToolTip = tooltip = createToolTip(content,
|
||||
template,
|
||||
options.css);
|
||||
|
||||
md.activeToolTipID = ad.areaId;
|
||||
|
||||
tipClosed = function() {
|
||||
md.clearToolTip();
|
||||
};
|
||||
|
||||
bindToolTipClose(closeOpts,'area-click', 'click', $(md.map), null, tipClosed);
|
||||
bindToolTipClose(closeOpts,'tooltip-click', 'click', tooltip,null, tipClosed);
|
||||
bindToolTipClose(closeOpts,'image-mouseout', 'mouseout', $(md.image), function(e) {
|
||||
return (e.relatedTarget && e.relatedTarget.nodeName!=='AREA' && e.relatedTarget!==ad.area);
|
||||
}, tipClosed);
|
||||
|
||||
|
||||
showToolTip(tooltip,
|
||||
target,
|
||||
md.image,
|
||||
options.container,
|
||||
template,
|
||||
options);
|
||||
|
||||
u.ifFunction(md.options.onShowToolTip, ad.area,
|
||||
{
|
||||
toolTip: tooltip,
|
||||
options: ttopts,
|
||||
areaOptions: areaOpts,
|
||||
key: ad.key,
|
||||
selected: ad.isSelected()
|
||||
});
|
||||
|
||||
return tooltip;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Parse an object that could be a string, a jquery object, or an object with a "contents" property
|
||||
* containing html or a jQuery object.
|
||||
*
|
||||
* @param {object|string|jQuery} options The parameter to parse
|
||||
* @return {string|jquery} A string or jquery object
|
||||
*/
|
||||
function getHtmlFromOptions(options) {
|
||||
|
||||
// see if any html was passed as either the options object itself, or the content property
|
||||
|
||||
return (options ?
|
||||
((typeof options === 'string' || options.jquery) ?
|
||||
options :
|
||||
options.content) :
|
||||
null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate or remove a tooltip for an area. When this method is called on an area, the
|
||||
* key parameter doesn't apply and "options" is the first parameter.
|
||||
*
|
||||
* When called with no parameters, or "key" is a falsy value, any active tooltip is cleared.
|
||||
*
|
||||
* When only a key is provided, the default tooltip for the area is used.
|
||||
*
|
||||
* When html is provided, this is used instead of the default tooltip.
|
||||
*
|
||||
* When "noTemplate" is true, the default tooltip template will not be used either, meaning only
|
||||
* the actual html passed will be used.
|
||||
*
|
||||
* @param {string|AreaElement} key The area for which to activate a tooltip, or a DOM element.
|
||||
*
|
||||
* @param {object|string|jquery} [options] options to apply when creating this tooltip - OR -
|
||||
* The markup, or a jquery object, containing the data for the tooltip
|
||||
* @config {string|jQuery} [content] the inner content of the tooltip; the tooltip text or HTML
|
||||
* @config {Element|jQuery} [container] the inner content of the tooltip; the tooltip text or HTML
|
||||
* @config {bool} [template] a template to use instead of the default. If this property exists and is null,
|
||||
* then no template will be used.
|
||||
* @config {int} [offsetx] the horizontal amount to offset the tooltip.
|
||||
* @config {int} [offsety] the vertical amount to offset the tooltip.
|
||||
* @config {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
* @config {string|object} [css] CSS to apply to the outermost element of the tooltip
|
||||
* @config {bool} [fadeDuration] When non-zero, the duration in milliseconds of a fade-in effect for the tooltip.
|
||||
* @return {jQuery} The jQuery object
|
||||
*/
|
||||
|
||||
m.impl.tooltip = function (key,options) {
|
||||
return (new m.Method(this,
|
||||
function mapData() {
|
||||
var tooltip, target, md=this;
|
||||
if (!key) {
|
||||
md.clearToolTip();
|
||||
} else {
|
||||
target=$(key);
|
||||
if (md.activeToolTipID ===target[0]) {
|
||||
return;
|
||||
}
|
||||
md.clearToolTip();
|
||||
|
||||
md.activeToolTip = tooltip = createToolTip(getHtmlFromOptions(options),
|
||||
options.template || md.options.toolTipContainer,
|
||||
options.css);
|
||||
md.activeToolTipID = target[0];
|
||||
|
||||
bindToolTipClose(['tooltip-click'],'tooltip-click', 'click', tooltip, null, function() {
|
||||
md.clearToolTip();
|
||||
});
|
||||
|
||||
md.activeToolTip = tooltip = showToolTip(tooltip,
|
||||
target,
|
||||
md.image,
|
||||
options.container,
|
||||
options);
|
||||
}
|
||||
},
|
||||
function areaData() {
|
||||
if ($.isPlainObject(key) && !options) {
|
||||
options = key;
|
||||
}
|
||||
|
||||
this.showToolTip(getHtmlFromOptions(options),options);
|
||||
},
|
||||
{
|
||||
name: 'tooltip',
|
||||
args: arguments,
|
||||
key: key
|
||||
}
|
||||
)).go();
|
||||
};
|
||||
} (jQuery));
|
||||
103
rus/admin/_V4/_lib/ImageMapster-master/src/zepto.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/* zepto.js
|
||||
Monkey patch for Zepto to add some methods ImageMapster needs
|
||||
*/
|
||||
|
||||
/*global Zepto: true, jQuery: true */
|
||||
|
||||
if (window.Zepto) {
|
||||
jQuery = Zepto;
|
||||
|
||||
(function ($) {
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
|
||||
$.css=function( elem, name ) {
|
||||
|
||||
return getComputedStyle(elem,name);
|
||||
};
|
||||
|
||||
$.trim = function (str) {
|
||||
return str.replace(/^\s+/, '').replace(/\s+$/, '');
|
||||
};
|
||||
$.inArray = function (target, arr) {
|
||||
return arr.indexOf(target);
|
||||
};
|
||||
/*lint-ignore-start*/
|
||||
$.isEmptyObject=function(obj) {
|
||||
for ( var name in obj ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
$.isWindow = function(obj) {
|
||||
return obj && typeof obj === "object" && "setInterval" in obj;
|
||||
};
|
||||
|
||||
$.isPlainObject= function( obj ) {
|
||||
// Must be an Object.
|
||||
// Because of IE, we also have to check the presence of the constructor property.
|
||||
// Make sure that DOM nodes and window objects don't pass through, as well
|
||||
if ( !obj || typeof obj !== "object" || obj.nodeType || $.isWindow( obj ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// Not own constructor property must be Object
|
||||
if ( obj.constructor &&
|
||||
!hasOwn.call(obj, "constructor") &&
|
||||
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
||||
return false;
|
||||
}
|
||||
} catch ( e ) {
|
||||
// IE8,9 Will throw exceptions on certain host objects #9897
|
||||
return false;
|
||||
}
|
||||
|
||||
// Own properties are enumerated firstly, so to speed up,
|
||||
// if last one is own, then all properties are own.
|
||||
|
||||
var key;
|
||||
for ( key in obj ) {}
|
||||
|
||||
return typeof key === 'undefined' || hasOwn.call( obj, key );
|
||||
}
|
||||
/*lint-ignore-end*/
|
||||
$.fn.clone = function () {
|
||||
var ret = $();
|
||||
this.each(function () {
|
||||
ret = ret.add(this.cloneNode(true));
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
$.fn.stop=function() {
|
||||
return this;
|
||||
};
|
||||
$.fn.elOrEmpty = function () {
|
||||
return this.length ? this[0] : {};
|
||||
};
|
||||
$.each(["Height", "Width"], function( i, name ) {
|
||||
//var type = name.toLowerCase();
|
||||
// outerHeight and outerWidth
|
||||
//$.fn[ "outer" + name ] = function( margin ) {
|
||||
// var elem = this[0],
|
||||
// cl=margin?"margin":"border";
|
||||
// return elem ?
|
||||
// elem.style ?
|
||||
// (parseFloat( $.css( elem, cl+'-top-'+type)+ ) :
|
||||
// this[ type ]() :
|
||||
// null;
|
||||
// };
|
||||
$.fn["outer"+name]=function() {
|
||||
return this[name.toLowerCase()]();
|
||||
};
|
||||
});
|
||||
$.fn.position = $.fn.position || function () {
|
||||
var el = this.elOrEmpty();
|
||||
return {
|
||||
left: this.left,
|
||||
top: this.top
|
||||
};
|
||||
};
|
||||
$.browser = {};
|
||||
$.browser.msie = false;
|
||||
} (jQuery));
|
||||
}
|
||||
11
rus/admin/_V4/_lib/ImageMapster-master/tests/README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#### Tests for ImageMapster
|
||||
|
||||
5/15/2012
|
||||
|
||||
I am in the process of revising the test suite to use IQTest, a promise-aware testing framework I am developing. You can find the source on my github portal. This framework is designed around the assertions from [buster.js]
|
||||
(http://busterjs.org/) and uses the [when.js](https://github.com/cujojs/) promise library. The goal is a framwork that permits using a terse syntax that can incorporate callbacks in a single statement without the need for excessively verbose syntax.
|
||||
|
||||
The dev code (1.2.4.067) is considered stable; it will become an official release when I'm finished updating the tests..
|
||||
|
||||
The old tests (loaded from `test.html`) are no longer supported. They are still here until I finish the update but should not be considered functional.
|
||||
|
||||
110
rus/admin/_V4/_lib/ImageMapster-master/tests/core.tests.js
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*global Test: true, iqtest */
|
||||
/*jslint onevar: false */
|
||||
|
||||
this.tests = this.tests || [];
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("utility","tests for core/common functionality")
|
||||
.add("Utility Functions", function (a, r) {
|
||||
var result,
|
||||
mu = $.mapster.utils;
|
||||
|
||||
a.isTrue(mu.isBool(true), "isBool returns true=true");
|
||||
a.isTrue(mu.isBool(false), "isBool returns false=true");
|
||||
|
||||
a.isFalse(mu.isBool(null), "isBool returns null=false");
|
||||
|
||||
a.equals(mu.boolOrDefault(true), true, "boolOrDefault(true) returns true");
|
||||
a.equals(mu.boolOrDefault(false), false, "boolOrDefault(false) returns false");
|
||||
a.equals(mu.boolOrDefault("something"), false, "boolOrDefault('something') (a truthy value) returns false");
|
||||
a.equals(mu.boolOrDefault(null), false, "boolOrDefault(null) (a falsy value) returns false");
|
||||
a.equals(mu.boolOrDefault(true, "foo"), true, "boolOrDefault(true) with default value returns true");
|
||||
a.equals(mu.boolOrDefault(false, "foo"), false, "boolOrDefault(false) with default value returns false");
|
||||
a.equals(mu.boolOrDefault("something", "foo"), "foo", "boolOrDefault('something') (a falsy value) with default value returns default");
|
||||
a.equals(mu.boolOrDefault(undefined, "foo"), "foo", "boolOrDefault(undefined) (a falsy value) with default value returns default");
|
||||
|
||||
// test the extend-like function
|
||||
|
||||
var obj = { a: "a", b: "b" };
|
||||
var otherObj = { a: "a2", b: "b2", c: "c" };
|
||||
var arrObj = { a: [1, 2], b: { a: "a2", b: "b2"} };
|
||||
|
||||
result = mu.updateProps({}, arrObj);
|
||||
a.equals([1, 2], result.a, "Array copied as array");
|
||||
|
||||
result = mu.updateProps(obj, otherObj);
|
||||
|
||||
a.equals(result, { a: "a2", b: "b2" }, "Merge with extra properties - no add");
|
||||
|
||||
// input object should be affected
|
||||
a.equals(obj, { a: "a2", b: "b2" }, "Test input object following merge matches output");
|
||||
|
||||
result = mu.updateProps(otherObj, obj, otherObj);
|
||||
a.equals(result, { a: "a2", b: "b2", c: "c" }, "Merge with extra properties - add");
|
||||
|
||||
otherObj = { a: "a3" };
|
||||
result = mu.updateProps(obj, otherObj);
|
||||
|
||||
// ut.assertPropsEq(function () { return u.updateProps(result, otherObj); }, { a: "a3", b: "b2", c: "c" }, "Merge with missing properties");
|
||||
|
||||
// test several at once
|
||||
obj = { a: "unchanged-a", b: "unchanged-b" };
|
||||
otherObj = { b: "b4" };
|
||||
var otherObj2 = { a: "a4" };
|
||||
|
||||
a.equals(mu.updateProps(obj, otherObj, otherObj2), { a: "a4", b: "b4" }, "Merge with mutiple inputs");
|
||||
|
||||
var templateObj = { p1: "prop1", p2: "prop2" };
|
||||
otherObj = { p1: "newProp1", p3: "prop3", p4: "prop4" };
|
||||
|
||||
a.equals(mu.updateProps({}, templateObj, otherObj), { p1: "newProp1", p2: "prop2" }, "Template works.");
|
||||
|
||||
var expectedResult = { p1: "newProp1", p2: "prop2", p4: "prop4" };
|
||||
//ut.assertPropsEq(u.updateProps({},templateObj, otherObj, ), expectedResult, "Ignore works.");
|
||||
|
||||
templateObj.p3 = { subp1: "subprop1", subp2: "subprop2" };
|
||||
templateObj.p4 = null;
|
||||
|
||||
result = { };
|
||||
expectedResult.p3 = otherObj.p3;
|
||||
|
||||
mu.updateProps(result, templateObj, otherObj);
|
||||
a.equals(result, expectedResult, "Copying a sub-object - start");
|
||||
|
||||
delete otherObj.p3;
|
||||
result.p3 = { existing: "bar" };
|
||||
|
||||
expectedResult.p3 = templateObj.p3;
|
||||
expectedResult.p3.existing = "bar";
|
||||
|
||||
mu.updateProps(result, templateObj, otherObj);
|
||||
a.equals(result, expectedResult, "Deep works");
|
||||
|
||||
// test indexOfProp
|
||||
|
||||
obj = { test: "test" };
|
||||
var arr = [{ name: "test1", value: "value1" }, { name: "test2", value: "value2" }, { name: "test3", value: obj}];
|
||||
|
||||
var index = mu.indexOfProp(arr, "name", "test2");
|
||||
a.equals(index, 1, "arrayIndexOfProp returns correct value for string");
|
||||
|
||||
index = mu.indexOfProp(arr, "value", obj);
|
||||
a.equals(index, 2, "arrayIndexOfProp returns correct value for object & last element");
|
||||
|
||||
index = mu.indexOfProp(arr, "name", "test1");
|
||||
a.equals(index, 0, "arrayIndexOfProp returns correct value for first element");
|
||||
|
||||
index = mu.indexOfProp(arr, "foo", "bar");
|
||||
a.equals(index, -1, "Missing property handled correctly");
|
||||
|
||||
index = mu.indexOfProp(arr, "name", "bar");
|
||||
a.equals(index, -1, "Missing property value handled correctly");
|
||||
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
43
rus/admin/_V4/_lib/ImageMapster-master/tests/data.tests.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*global iqtest, u, map_options, image, group_setup */
|
||||
/*jslint onevar: false */
|
||||
|
||||
this.tests = this.tests || [];
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("data","data access features (non-UI)")
|
||||
.add("'keys' method", function (a, r) {
|
||||
var map;
|
||||
// create a promise from the "onConfigured" callback
|
||||
this.when(function(cb) {
|
||||
map=image.mapster(
|
||||
u.extend({},map_options,{
|
||||
onConfigured: cb
|
||||
}
|
||||
));
|
||||
}).then(function() {
|
||||
|
||||
var keys=map.mapster('keys','TX');
|
||||
a.equals('TX',keys,"Got primary key for something with only one key");
|
||||
|
||||
keys=map.mapster('keys','ME');
|
||||
a.equals('ME',keys,"Got primary key for something with multiple keys");
|
||||
|
||||
keys=map.mapster('keys','new-england');
|
||||
a.collectionEquals('ME,VT,NH,CT,RI,MA',keys,"Got primary key for something with multiple keys");
|
||||
|
||||
keys=map.mapster('keys','new-england',true);
|
||||
a.collectionEquals('ME,VT,NH,CT,RI,MA,new-england,really-cold',keys,"Got primary key for something with multiple keys");
|
||||
|
||||
keys = $('area[state="HI"]').mapster('keys');
|
||||
a.equals('HI',keys,"Got primary key from an area");
|
||||
|
||||
var areas = $('area[state="HI"],area[state*="new-england"]');
|
||||
keys = areas.mapster('keys');
|
||||
a.collectionEquals('HI,ME,VT,NH,CT,RI,MA',keys,"Got primary key for something with multiple keys");
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
83
rus/admin/_V4/_lib/ImageMapster-master/tests/events.tests.js
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*global Test: true, iqtest, image, map_options, areas */
|
||||
/*jslint onevar: false */
|
||||
|
||||
this.tests = this.tests || [];
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("events","tests for imagemapster events")
|
||||
.add("Mouse Events", function (a, r) {
|
||||
|
||||
var me = this,
|
||||
getPromise = function(name) {
|
||||
return me.promises(name);
|
||||
},
|
||||
map = image.mapster($.extend(map_options, {
|
||||
onConfigured: getPromise("configured").resolve
|
||||
}));
|
||||
|
||||
function setCallback(opt,cb) {
|
||||
var obj = {};
|
||||
obj[opt]=function(e) {
|
||||
e.this_context = this;
|
||||
cb(e);
|
||||
};
|
||||
map.mapster('set_options', obj);
|
||||
}
|
||||
|
||||
getPromise("configured").then(function() {
|
||||
setCallback('onMouseover',getPromise("mouseover1").resolve);
|
||||
areas.find('area[state="NV"]').first().mouseover();
|
||||
});
|
||||
|
||||
getPromise("mouseover1").then(function(e) {
|
||||
a.truthy(e, "Mouseover fired for Nevada");
|
||||
a.equals(e.selected, false, "Selected state returned correctly");
|
||||
a.equals(e.key, "NV", "Key returned correctly");
|
||||
|
||||
setCallback('onMouseover',getPromise("mouseover2").resolve);
|
||||
areas.find('area[state="AK"]').first().mouseover();
|
||||
});
|
||||
|
||||
|
||||
getPromise("mouseover2").then(function(e) {
|
||||
a.truthy(e, "Mouseover fired for Alaska");
|
||||
a.equals(e.selected, true, "Selected state returned correctly");
|
||||
a.equals(e.key, "AK", "Key returned correctly");
|
||||
|
||||
setCallback('onMouseout',getPromise("mouseout1").resolve);
|
||||
areas.find('area[state="AK"]').first().mouseout();
|
||||
});
|
||||
|
||||
getPromise("mouseout1").then(function(e) {
|
||||
a.truthy(e, "Mouseout fired for Nevada");
|
||||
a.equals("AK",e.key,"Correct key returned by mouseout");
|
||||
a.equals(e.selected, true, "Selected state returned correctly");
|
||||
|
||||
setCallback('onClick',getPromise("click1").resolve);
|
||||
areas.find('area[state="GA"]').first().click();
|
||||
});
|
||||
|
||||
|
||||
getPromise("click1").then(function(e) {
|
||||
a.equals(e.key, "GA", "Click callback fired for Georgia, and key was correct");
|
||||
a.equals(e.selected, true, "Click callback fired for Georgia, and selected was correct");
|
||||
a.equals(e.this_context, areas.find('area[state="GA"]')[0], "Click callback fired for Georgia, and 'this' was correct");
|
||||
|
||||
setCallback('onClick',getPromise("click2").resolve);
|
||||
areas.find('area[state="OR"]').first().click();
|
||||
});
|
||||
|
||||
getPromise("click2").then(function(e) {
|
||||
a.equals(e.key, "OR", "Click callback fired for Oregon, and key was correct");
|
||||
a.equals(e.selected, false, "Click callback fired for Oregon, and selected was correct");
|
||||
getPromise("finished").resolve();
|
||||
});
|
||||
|
||||
a.resolves(getPromise("finished"),"The last test was run");
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
71
rus/admin/_V4/_lib/ImageMapster-master/tests/global.tests.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
|
||||
Shared resources, setup & teardown. This must be included for all tests.
|
||||
|
||||
*/
|
||||
|
||||
/*global Test: true, iqtest */
|
||||
/*jslint onevar: false */
|
||||
|
||||
var image, areas, map_options, map_copy,
|
||||
u = iqtest.impl.utility;
|
||||
|
||||
$(document).ready(function() {
|
||||
map_copy= $('#usa_image').clone();
|
||||
});
|
||||
|
||||
var group_setup=function() {
|
||||
// start with a clean mapster slate
|
||||
$('img').mapster('unbind');
|
||||
|
||||
// always start with a clean map for each group
|
||||
$('#usa_image').replaceWith(map_copy.clone());
|
||||
|
||||
image = $('#usa_image');
|
||||
areas = $('#usa_image_map');
|
||||
|
||||
map_options = {
|
||||
isSelectable: true,
|
||||
singleSelect: false,
|
||||
mapKey: 'state',
|
||||
mapValue: 'full',
|
||||
listKey: 'name',
|
||||
listSelectedAttribute: 'checked',
|
||||
sortList: "asc",
|
||||
showToolTip: true,
|
||||
toolTipClose: ["area-mouseout"],
|
||||
areas: [
|
||||
{
|
||||
key: "TX",
|
||||
selected: true
|
||||
}
|
||||
,
|
||||
{
|
||||
key: "AK",
|
||||
isSelectable: false,
|
||||
selected: true
|
||||
}
|
||||
,
|
||||
{
|
||||
key: "WA",
|
||||
staticState: true
|
||||
}
|
||||
,
|
||||
{
|
||||
key: "OR",
|
||||
staticState: false
|
||||
},
|
||||
{
|
||||
key: "CA",
|
||||
toolTip: $('<div>Don\'t mess with Louisiana. Why ? <a href = "http://dontmesswithtexas.org/" target="_blank" > Click here </a> for more info. </div> ')
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
// create a default setup
|
||||
|
||||
iqtest.configure({
|
||||
setup: group_setup
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>ImageMapster Browser Test Runner</title>
|
||||
|
||||
<script type="text/javascript" src="redist/jquery.1.9.1.js"></script>
|
||||
<!--<script type="text/javascript" src="redist/zepto.js"></script>-->
|
||||
|
||||
<script type="text/javascript" src="redist/common.utils.1.0.js"></script>
|
||||
<script type="text/javascript" src="redist/iqtest-browser-default.js" ></script>
|
||||
|
||||
<script type="text/javascript" src="global.tests.js" ></script>
|
||||
<script type="text/javascript" src="core.tests.js" ></script>
|
||||
<script type="text/javascript" src="data.tests.js" ></script>
|
||||
<script type="text/javascript" src="resize.tests.js" ></script>
|
||||
<script type="text/javascript" src="events.tests.js" ></script>
|
||||
<script type="text/javascript" src="migrated.tests.js" ></script>
|
||||
<script type="text/javascript" src="tooltip.tests.js" ></script>
|
||||
|
||||
<!--<script type="text/javascript" src="../src/zepto.js"></script>-->
|
||||
|
||||
<script type="text/javascript" src="../src/redist/when.js"></script>
|
||||
<script type="text/javascript" src="../src/core.js"></script>
|
||||
<script type="text/javascript" src="../src/graphics.js"></script>
|
||||
<script type="text/javascript" src="../src/mapimage.js"></script>
|
||||
<script type="text/javascript" src="../src/mapdata.js"></script>
|
||||
<script type="text/javascript" src="../src/areadata.js"></script>
|
||||
<script type="text/javascript" src="../src/areacorners.js"></script>
|
||||
<script type="text/javascript" src="../src/scale.js"></script>
|
||||
<script type="text/javascript" src="../src/tooltip.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="../dist/jquery.imagemapster.js"></script>
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
/*jslint onevar: false */
|
||||
/*global tests, when, iqtest,u */
|
||||
|
||||
// the "tests" variable is created or populated by each included test.
|
||||
|
||||
var allSel = 'input[type="checkbox"]',
|
||||
checkedSel = 'input[type="checkbox"]:checked',
|
||||
runCount = 0,
|
||||
activeGroups=[];
|
||||
|
||||
// set up some global stuff for the tests to use
|
||||
|
||||
function enableTestLink() {
|
||||
$('#startTest').toggle(!!$(checkedSel).length);
|
||||
}
|
||||
function runActiveGroups(nextIndex,lastIndex) {
|
||||
var next = nextIndex || 0,
|
||||
last = lastIndex || activeGroups.length-1,
|
||||
cur = activeGroups[next];
|
||||
|
||||
cur.run().then(function() {
|
||||
if (next<last) {
|
||||
// use a timer to break the promise chain between test groups.
|
||||
window.setTimeout(function() {
|
||||
runActiveGroups(next+1,last);
|
||||
},50);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function startTests() {
|
||||
var testGroups,
|
||||
stopped = false;
|
||||
|
||||
function error(message) {
|
||||
$('#wrap').text(message);
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
if (runCount > 0) {
|
||||
$('#oldRuns').append($('<hr />Prior Test Run #' + runCount + '<hr />'))
|
||||
.append($('#wrap').children());
|
||||
|
||||
$('#wrap').empty();
|
||||
}
|
||||
runCount++;
|
||||
activeGroups=[];
|
||||
|
||||
testGroups= $('input[type="checkbox"]:checked');
|
||||
testGroups.each(function (i, e) {
|
||||
// invoke the test method, and when it returns itself from the promise,
|
||||
// add it to the group.
|
||||
var cur,
|
||||
testName = $(e).val();
|
||||
|
||||
cur = tests.first(function() {
|
||||
return this.name===testName;
|
||||
});
|
||||
|
||||
if (!cur) {
|
||||
error("Couldn't find a test named '" + testName + "'");
|
||||
return;
|
||||
}
|
||||
|
||||
activeGroups.push(cur);
|
||||
|
||||
});
|
||||
|
||||
runActiveGroups();
|
||||
|
||||
if (!stopped) {
|
||||
$('#rerunTest').show();
|
||||
}
|
||||
|
||||
}
|
||||
function buildCheckboxList() {
|
||||
var container = $('#test-checkboxes');
|
||||
$.each(tests,function(i,e) {
|
||||
container.append('<li><input type="checkbox" value="{0}" /> {1}</li>'
|
||||
.format(e.name,e.desc ? e.name+': '+e.desc : e.desc));
|
||||
});
|
||||
}
|
||||
|
||||
function bindUIEvents() {
|
||||
|
||||
$(allSel).bind('change',function() {
|
||||
enableTestLink();
|
||||
});
|
||||
$('#testSelectAll').bind('click',function(e)
|
||||
{
|
||||
var checked=$(checkedSel),
|
||||
all = $(allSel);
|
||||
if (checked.length && checked.length===all.length){
|
||||
all.prop('checked',false);
|
||||
} else {
|
||||
all.prop('checked',true);
|
||||
}
|
||||
enableTestLink();
|
||||
});
|
||||
$('#toggleTestImage').bind('click',function(e)
|
||||
{
|
||||
$('#testElements').toggle('fast');
|
||||
});
|
||||
|
||||
enableTestLink();
|
||||
|
||||
$('#rerunTest').bind('click', function (e) {
|
||||
runActiveGroups();
|
||||
}).hide();
|
||||
|
||||
$('#startTest').bind('click',startTests);
|
||||
}
|
||||
|
||||
function configureTests() {
|
||||
tests.forEach(function(e) {
|
||||
e.writer("html",$('#wrap'));
|
||||
});
|
||||
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
buildCheckboxList();
|
||||
bindUIEvents();
|
||||
configureTests();
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
li {
|
||||
list-style-type: none;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>ImageMapster Test Runner</h1>
|
||||
<div>
|
||||
<b>Choose tests to run: </b>
|
||||
<a href="#" id="testSelectAll">select all</a>
|
||||
<a href="#" id="startTest">run tests</a>
|
||||
|
||||
<ul id="test-checkboxes">
|
||||
</ul>
|
||||
|
||||
<a href="#" id="rerunTest">rerun last group</a>
|
||||
</div>
|
||||
|
||||
<div id="wrap" >
|
||||
</div>
|
||||
<div id="oldRuns">
|
||||
</div>
|
||||
|
||||
<a href="#" id="toggleTestImage">show/hide test image</a>
|
||||
|
||||
<div id="testElements" style="margin-top: 20px; border: 1px solid black; display: none;">
|
||||
<img id="usa_image" src="images/usa_map_720.png" width="720" height="445" usemap="#usa" >
|
||||
<map id="usa_image_map" name="usa">
|
||||
<area href="#" state="ME,new-england,really-cold" full="Maine" shape="poly" coords="669,71,671,72,672,75,672,76,671,80,669,80,667,83,663,86,660,85,659,86,658,87,657,88,659,89,658,89,658,92,656,92,656,90,656,89,655,89,653,87,652,88,653,89,653,90,653,91,653,93,653,95,652,96,650,97,650,98,646,101,644,101,644,100,641,103,642,105,641,106,641,110,640,115,638,114,638,112,635,111,635,109,629,92,626,81,628,81,629,81,629,80,629,75,631,72,632,69,631,68,631,63,632,62,632,60,632,59,632,56,633,52,635,46,637,43,638,43,638,43,638,44,639,45,641,46,642,45,642,44,645,42,647,41,647,41,652,43,653,44,659,65,664,65,665,67,665,70,667,72,668,72,668,71,667,71,669,71">
|
||||
<area href="#" state="ME,new-england,really-cold" shape="poly" coords="654,92,655,92,656,92,656,94,655,95,654,92">
|
||||
<area href="#" state="ME,new-england,really-cold" shape="poly" coords="659,88,660,89,662,87,662,86,660,86,659,88">
|
||||
|
||||
<area href="#" state="NH,new-england,really-cold" shape="poly" coords="639,118,639,117,640,115,638,114,638,112,635,111,635,109,629,92,626,81,626,81,625,83,624,82,623,81,623,83,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,633,122,635,122,636,119,639,118">
|
||||
<area href="#" state="NH,new-england,really-cold" full="New Hampshire" shape="rect" coords="512,29,586,44">
|
||||
|
||||
<area href="#" state="VT,new-england,really-cold" full="Vermont" shape="rect" coords="543,49,586,62">
|
||||
<area href="#" state="VT,new-england,really-cold" shape="poly" coords="611,127,611,123,609,115,608,115,606,113,607,112,606,110,605,107,605,104,605,100,603,95,602,92,622,87,622,91,623,93,623,96,621,99,619,100,619,101,620,102,620,108,619,115,619,118,620,119,620,122,620,124,620,125,615,126,611,127">
|
||||
|
||||
<area href="#" state="MA,new-england" full="Massachusetts" shape="rect" coords="515,68,585,80">
|
||||
<area href="#" state="MA,new-england" full="Massachusetts" shape="poly" coords="653,140,654,140,654,139,655,139,656,140,655,141,652,141,653,140">
|
||||
<area href="#" state="MA,new-england" shape="poly" coords="645,141,647,139,648,139,650,140,648,141,647,142,645,141">
|
||||
<area href="#" state="MA,new-england" shape="poly" coords="620,125,633,122,635,122,636,119,639,118,641,122,639,125,639,126,641,128,641,128,642,128,644,129,647,134,650,134,651,134,653,132,652,130,650,129,649,129,648,128,649,128,650,128,652,128,653,131,654,132,654,134,651,135,648,137,645,140,644,141,644,140,646,140,646,138,645,136,644,137,643,138,643,140,641,140,639,137,637,134,635,134,632,134,628,135,612,139,611,134,611,127,615,126,620,125">
|
||||
|
||||
<area href="#" state="CT,new-england" full="Connecticut" shape="poly" coords="634,145,633,142,632,139,632,134,628,135,612,139,612,141,614,146,614,152,613,154,614,155,617,153,620,151,621,149,622,149,624,149,628,148,634,145">
|
||||
<area href="#" state="CT,new-england" full="Connecticut" shape="rect" coords="655,167,711,179">
|
||||
|
||||
<area href="#" state="RI,new-england" full="Rhode Island" shape="rect" coords="650,149,711,161">
|
||||
<area href="#" state="RI,new-england" full="Rhode Island" shape="poly" coords="633,145,633,142,632,139,632,134,635,134,637,134,639,137,641,140,639,142,638,141,638,143,635,144,633,145">
|
||||
|
||||
<area href="#" state="NJ" full="New Jersey" shape="rect" coords="656,185,711,198">
|
||||
<area href="#" state="DE" full="Delaware" shape="rect" coords="665,204,711,216">
|
||||
<area href="#" state="MD" full="Maryland" shape="rect" coords="667,223,711,235">
|
||||
<area href="#" state="DC" full="District of Columbia" shape="rect" coords="654,239,711,252">
|
||||
<area href="#" state="WV" full="West Virginia" shape="rect" coords="649,257,711,270">
|
||||
<area href="#" state="SC" full="South Carolina" shape="poly" coords="551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,520,270,526,267,531,266,543,266,545,267,546,270,549,269,559,269,560,269,570,275,577,281,573,284,572,289,571,293,569,294,569,296,567,296,566,299,563,301,562,303,561,304,558,306,556,307,557,309,553,313,551,314">
|
||||
<area href="#" state="HI" full="Hawaii" shape="poly" coords="169,391,170,389,172,388,172,389,170,391,169,391">
|
||||
<area href="#" state="HI" shape="poly" coords="176,389,181,390,182,390,183,387,183,385,180,384,177,386,176,389">
|
||||
<area href="#" state="HI" shape="poly" coords="199,395,201,400,203,399,204,399,205,400,208,400,208,398,206,398,205,395,203,392,199,395,199,395">
|
||||
<area href="#" state="HI" shape="poly" coords="213,402,214,401,218,401,218,401,222,401,222,402,221,404,217,403,213,402">
|
||||
<area href="#" state="HI" shape="poly" coords="217,406,218,409,221,407,221,407,220,405,217,405,217,406">
|
||||
<area href="#" state="HI" shape="poly" coords="222,405,224,403,227,404,230,405,233,407,233,409,231,410,227,411,226,410,222,405">
|
||||
<area href="#" state="HI" shape="poly" coords="234,416,236,415,238,416,243,419,245,421,247,422,248,425,251,428,251,428,248,431,245,431,244,431,242,432,240,435,239,437,237,437,235,435,234,431,235,430,233,426,232,425,232,422,233,422,235,419,236,419,234,418,234,416">
|
||||
<area href="#" state="AK" full="Alaska" shape="poly" coords="114,344,114,405,116,406,118,406,119,405,121,405,121,407,125,413,126,414,128,413,129,413,129,410,131,410,131,409,133,408,135,410,135,412,137,413,137,414,140,416,143,420,145,422,146,425,147,428,151,428,155,430,155,434,156,436,155,438,154,440,152,439,152,437,149,436,149,435,148,436,149,437,149,440,148,440,146,440,145,438,146,440,146,441,146,441,143,437,143,435,141,434,141,430,140,430,140,433,140,433,139,430,138,428,137,427,138,431,138,432,137,431,134,427,133,426,132,424,131,422,130,421,130,419,131,419,131,418,129,419,127,417,125,415,122,413,119,411,119,409,119,407,118,409,116,410,113,409,109,407,105,407,104,407,100,404,98,404,96,400,94,400,92,401,92,404,92,402,93,403,92,406,95,404,95,405,92,408,91,408,91,407,90,406,89,407,87,405,85,407,83,408,81,410,77,410,77,408,80,408,80,407,78,407,79,404,80,402,80,401,80,400,84,398,85,399,86,399,86,398,83,397,80,399,77,401,77,404,75,405,72,406,70,408,70,410,71,410,72,411,70,414,65,417,60,420,59,421,54,422,50,423,52,424,51,425,50,426,49,425,46,425,46,427,45,427,45,425,43,426,41,427,38,426,36,428,34,428,32,428,31,429,29,428,27,428,26,428,25,429,24,428,24,427,26,426,31,426,34,425,35,424,38,423,39,422,41,422,42,424,43,423,44,422,47,421,49,420,50,420,50,420,51,420,52,418,55,416,56,414,58,410,59,410,59,407,58,409,56,409,55,407,54,407,53,408,53,410,53,410,51,406,50,407,50,406,50,405,47,405,45,406,43,406,44,404,44,403,44,401,45,401,46,401,45,399,45,396,45,395,44,396,40,396,38,395,38,392,37,390,37,389,38,389,38,387,39,386,38,386,38,386,37,384,38,380,41,378,43,377,44,374,46,374,48,374,48,376,50,376,53,374,53,374,54,375,56,375,57,374,58,371,58,366,56,367,54,368,53,367,50,366,47,366,44,363,44,360,44,359,43,357,41,355,42,354,47,353,48,353,49,354,50,354,50,353,53,353,54,353,55,353,54,355,54,356,56,357,59,359,61,358,59,355,59,353,59,352,56,350,56,350,56,349,56,346,54,342,52,339,54,338,56,338,58,338,61,338,64,335,65,333,67,332,68,332,71,332,73,330,74,330,74,331,78,331,80,329,80,329,83,330,85,332,84,332,85,333,86,332,89,332,89,335,90,336,95,337,100,340,101,339,105,341,107,341,108,340,111,341,114,344">
|
||||
<area href="#" state="AK" shape="poly" coords="31,365,32,368,32,369,30,368,29,366,28,365,26,365,26,363,27,361,28,363,29,364,31,365">
|
||||
<area href="#" state="AK" shape="poly" coords="29,389,32,389,35,390,35,391,34,393,32,393,29,391,29,389">
|
||||
<area href="#" state="AK" shape="poly" coords="14,378,15,380,16,381,15,382,14,380,14,378,14,378">
|
||||
<area href="#" state="AK" shape="poly" coords="4,431,7,430,9,429,11,429,11,431,13,431,14,429,14,428,16,428,18,430,17,431,14,432,12,431,9,431,6,431,5,432,4,431">
|
||||
<area href="#" state="AK" shape="poly" coords="40,428,41,430,42,428,41,428,40,428">
|
||||
<area href="#" state="AK" shape="poly" coords="42,431,43,428,44,429,44,431,42,431">
|
||||
<area href="#" state="AK" shape="poly" coords="59,429,60,430,61,429,60,428,59,429">
|
||||
<area href="#" state="AK" shape="poly" coords="65,420,66,424,68,425,72,422,75,421,74,419,74,417,73,418,71,418,71,417,73,417,76,416,77,415,74,414,75,413,73,414,70,417,66,419,65,420">
|
||||
<area href="#" state="AK" shape="poly" coords="96,406,98,404,97,403,95,404,96,406">
|
||||
<area href="#" state="FL" full="Florida" shape="poly" coords="548,337,549,343,552,350,556,356,558,361,562,365,565,368,566,370,565,371,565,372,566,377,569,380,571,383,573,387,577,393,578,399,578,407,578,409,578,411,576,413,577,413,576,415,576,417,577,419,575,421,572,422,569,422,569,423,567,424,566,423,565,422,565,421,564,418,562,414,559,413,557,413,556,413,554,410,553,407,551,404,550,404,549,405,548,405,546,401,544,398,542,395,540,392,537,390,539,388,541,384,541,383,538,383,536,383,537,383,539,384,538,387,537,388,536,385,535,381,535,379,536,376,536,369,533,366,533,364,529,363,527,362,526,361,524,359,523,357,521,356,519,353,516,353,514,351,512,351,509,352,509,353,509,354,509,355,507,355,504,357,502,359,499,359,497,360,497,358,495,356,493,356,492,355,486,352,481,350,477,351,473,351,469,353,466,353,466,347,464,346,463,344,463,342,470,341,489,339,494,339,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337">
|
||||
<area href="#" state="FL" shape="poly" coords="557,434,558,433,560,433,560,431,562,430,563,431,564,431,564,431,562,432,559,433,557,434,557,434">
|
||||
<area href="#" state="FL" shape="poly" coords="566,430,567,431,569,429,573,426,576,423,578,419,578,417,578,415,578,415,577,417,576,420,574,425,571,428,568,428,566,430">
|
||||
<area href="#" state="GA" full="Georgia" shape="poly" coords="500,274,497,275,490,275,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,498,339,500,341,501,343,507,343,515,342,530,341,534,341,538,341,538,343,540,344,540,341,539,337,539,336,544,337,548,337,547,332,548,325,550,322,549,320,552,315,551,314,551,314,548,314,548,312,547,310,545,308,544,308,542,304,540,299,537,299,536,297,535,295,533,293,532,293,530,290,528,289,524,287,524,287,523,284,522,284,520,280,518,280,515,278,513,277,513,276,514,275,515,274,515,272,514,272,510,273,505,274,500,274">
|
||||
<area href="#" state="AL" full="Alabama" shape="poly" coords="453,353,452,342,450,329,450,318,451,296,451,284,451,279,457,278,476,277,484,276,484,278,484,279,485,281,487,287,489,295,490,299,491,302,492,308,494,312,495,314,496,317,497,317,497,319,496,323,496,325,496,326,497,329,497,333,497,335,497,336,498,336,499,339,494,339,489,339,470,341,463,342,463,344,464,346,466,347,467,353,461,355,460,355,461,353,461,353,459,348,458,348,457,351,456,353,455,353,453,353">
|
||||
<area href="#" state="NC" full="North Carolina" shape="poly" coords="603,231,605,234,607,239,608,241,609,242,608,242,608,243,608,246,606,247,605,248,605,251,602,252,600,251,599,251,598,251,598,251,598,252,599,252,600,253,599,257,602,257,602,259,604,257,605,257,603,260,601,263,600,263,599,263,597,263,593,265,589,269,587,272,585,277,584,278,581,279,577,281,570,275,560,269,559,269,549,269,546,270,545,267,543,266,531,266,526,267,520,270,515,272,514,272,510,273,505,274,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,533,244,539,243,550,242,563,239,578,237,591,234,599,232,603,231">
|
||||
<area href="#" state="NC" shape="poly" coords="606,255,608,253,610,251,611,251,611,249,611,245,610,243,609,242,610,242,612,245,612,248,612,251,610,252,608,254,607,255,606,255">
|
||||
<area href="#" state="TN" full="Tennessee" shape="poly" coords="505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,431,260,429,265,428,267,428,270,427,272,424,274,425,276,425,279,423,281,429,281,447,279,451,279,457,278,476,277,484,276,490,275,497,275,500,274,500,271,501,269,503,269,504,266,507,264,509,263,512,260,516,259,516,257,519,254,520,254,523,252,525,252,527,252,527,250,530,248,530,246,530,243,529,243,527,245,521,245,512,246,505,247">
|
||||
<area href="#" state="NY" full="New York" shape="poly" coords="600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,541,148,542,147,542,146,543,146,545,144,545,143,547,141,548,140,548,140,547,137,545,137,544,133,546,131,549,131,552,129,554,129,559,129,560,130,562,130,563,129,565,128,569,128,570,127,572,125,572,123,574,123,575,122,575,120,575,119,575,118,575,116,575,115,574,115,572,115,572,114,572,112,576,108,577,107,578,105,580,102,582,99,584,98,585,96,587,95,591,95,593,95,597,93,602,92,603,95,605,100,605,104,605,107,606,110,607,112,606,113,608,115,609,115,611,123,611,127,611,134,611,138,612,141,614,146,614,152,613,154,614,155,614,156,612,158,613,158,614,158,614,158,616,155,617,155,618,155,620,155,626,153,628,151,629,150,632,151,629,154,626,155,621,160,620,160,615,161,612,162,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="NJ" full="New Jersey" shape="poly" coords="600,152,599,155,599,156,597,158,597,160,598,161,598,163,596,164,597,165,597,166,599,167,600,168,602,170,604,171,604,172,602,174,601,176,599,178,598,179,597,179,597,180,596,182,597,184,599,185,603,188,606,188,606,189,605,190,605,191,606,191,608,190,608,186,611,183,613,179,614,175,613,174,613,167,611,164,611,165,609,165,608,165,609,164,611,163,611,162,611,160,611,158,611,156,609,155,605,155,603,154,600,152">
|
||||
<area href="#" state="PA" full="Pennsylvania" shape="poly" coords="597,179,598,179,599,178,601,176,602,174,604,172,604,171,602,170,600,168,599,167,597,166,597,165,596,164,598,163,598,161,597,160,597,158,599,156,599,155,600,152,599,152,598,152,596,150,594,146,592,146,590,144,577,147,545,153,539,155,539,149,535,153,534,154,531,156,533,170,534,178,537,191,540,191,549,190,576,185,587,182,593,181,594,180,596,179,597,179">
|
||||
<area href="#" state="DE" shape="poly" coords="596,182,597,180,597,179,596,179,594,180,593,182,594,185,596,188,597,196,599,200,602,200,606,199,605,194,604,194,602,192,600,189,599,186,597,185,596,183,596,182">
|
||||
<area href="#" state="MD" shape="poly" coords="606,199,602,200,599,200,597,196,596,188,594,185,593,181,587,182,576,185,549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,587,207,589,208,590,208,591,206,590,205,590,203,588,202,587,198,588,194,588,193,587,191,590,188,591,186,591,187,590,188,590,191,590,192,591,192,591,196,590,197,590,200,590,199,591,197,593,199,591,200,591,203,593,205,596,205,597,205,599,209,600,209,600,212,599,215,599,220,599,222,601,222,602,219,602,217,602,212,605,208,606,203,606,199">
|
||||
<area href="#" state="MD" shape="poly" coords="595,206,596,208,596,209,596,211,596,206,595,206">
|
||||
<area href="#" state="WV" shape="poly" coords="549,190,550,194,551,197,551,197,552,196,554,194,556,194,557,192,558,191,559,191,561,191,563,189,565,188,566,188,567,188,569,190,571,191,572,192,571,195,566,193,563,192,563,196,563,197,562,200,561,200,559,202,559,204,557,204,556,206,555,210,554,210,552,209,551,208,550,208,550,211,548,216,545,224,545,224,545,227,544,228,542,227,540,230,538,229,537,232,530,233,528,234,527,233,525,233,524,230,521,229,520,227,518,224,517,223,515,221,515,221,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,177,537,191,540,191,549,190">
|
||||
<area href="#" state="VA" full="Virginia" shape="poly" coords="524,230,525,233,527,233,528,234,530,233,532,232,538,229,540,230,542,227,544,228,545,227,545,224,545,224,548,216,550,211,550,208,551,208,552,209,554,210,555,210,556,206,557,204,559,204,559,202,561,200,562,200,563,197,563,196,563,192,566,193,571,195,572,191,575,193,575,195,578,196,580,197,581,196,582,197,581,200,581,201,580,203,580,205,580,206,584,207,585,208,589,209,590,210,593,210,594,212,593,215,594,215,594,217,596,218,596,220,593,219,593,220,594,221,594,221,596,222,596,224,596,225,595,227,595,227,597,227,599,226,600,226,603,231,599,232,591,234,578,237,563,239,550,242,539,243,533,244,530,243,529,243,527,245,521,245,512,246,505,247,507,246,511,244,514,242,514,241,515,239,518,236,521,233,524,230">
|
||||
<area href="#" state="KY" full="Kentucky" shape="poly" coords="524,230,521,233,518,236,515,239,514,241,514,242,511,244,507,246,505,247,467,251,456,252,453,252,450,252,450,255,444,255,439,256,431,256,432,255,434,254,435,253,435,251,436,249,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,449,233,450,232,455,231,458,231,458,233,460,233,461,230,463,230,464,231,465,232,467,231,467,229,469,227,470,227,470,228,473,228,474,227,474,225,476,222,479,220,480,216,482,216,485,215,487,213,486,212,485,211,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,216,515,221,515,221,517,223,518,224,520,227,521,229,524,230">
|
||||
<area href="#" state="OH" full="Ohio" shape="poly" coords="531,156,526,159,523,161,521,163,518,166,515,167,513,167,509,169,508,169,505,167,501,167,500,166,497,165,494,166,487,167,481,167,482,179,483,188,485,205,485,209,488,209,491,209,493,210,494,213,498,213,499,215,500,215,503,214,505,214,506,215,508,213,509,212,510,212,511,214,512,215,515,217,516,216,518,216,518,214,518,213,519,209,519,206,521,206,521,207,521,208,523,207,524,206,523,205,523,203,523,202,525,200,526,199,527,199,529,198,531,195,533,193,533,188,533,185,533,182,533,179,533,178,534,178,533,170,531,156">
|
||||
<area href="#" state="MI" full="Michigan" shape="poly" coords="422,74,423,73,425,72,428,69,430,68,431,69,427,73,424,74,422,75,422,74">
|
||||
<area href="#" state="MI" shape="poly" coords="484,98,485,99,487,99,488,98,485,96,484,96,483,97,484,98">
|
||||
<area href="#" state="MI" shape="poly" coords="506,143,503,137,502,131,500,128,498,127,497,128,494,129,493,133,491,135,490,136,489,135,490,129,491,127,491,125,493,124,493,116,491,115,491,114,490,113,491,112,491,113,491,111,490,110,489,107,487,107,484,107,480,104,478,104,477,104,476,104,474,103,473,104,470,106,470,108,471,108,473,109,473,110,471,110,470,110,468,111,468,113,468,114,468,118,466,119,465,119,465,116,467,115,467,113,467,113,465,113,464,116,462,117,461,118,461,119,461,119,461,122,459,122,459,122,460,125,459,128,458,131,458,135,458,136,458,137,458,138,458,140,460,145,462,149,463,152,463,156,462,161,460,164,460,166,458,168,457,169,461,169,476,167,481,167,481,167,487,167,494,166,498,165,497,164,497,164,499,161,500,159,500,156,501,155,502,155,502,152,503,149,504,150,504,151,505,151,506,150,506,143">
|
||||
<area href="#" state="MI" shape="poly" coords="410,95,412,95,414,94,416,92,416,92,417,92,421,91,423,89,426,88,426,87,428,85,429,84,430,83,431,81,434,80,438,79,439,80,439,80,436,81,435,83,433,84,433,86,431,88,431,90,431,90,432,89,434,87,436,89,437,89,440,89,440,90,442,92,444,94,446,94,448,93,449,95,450,95,451,94,452,94,453,93,456,91,458,90,463,89,467,89,468,87,470,87,470,92,470,92,472,92,473,92,478,91,479,90,479,90,479,95,482,98,483,98,484,99,483,99,482,99,479,98,478,99,476,99,474,100,473,100,468,99,464,99,464,101,458,101,457,102,455,104,455,105,455,105,453,104,450,106,449,106,449,104,448,104,447,107,446,110,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95">
|
||||
<area href="#" state="WY" full="Wyoming" shape="poly" coords="257,119,249,118,226,116,214,114,194,111,179,109,178,117,175,135,171,157,170,164,169,173,174,174,186,176,192,176,207,178,234,181,252,182,255,150,257,132,257,119">
|
||||
<area href="#" state="MT" full="Montana" shape="poly" coords="259,104,260,95,261,77,262,66,263,56,240,53,219,51,197,48,174,44,161,41,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,179,109,194,111,214,114,226,116,249,118,257,119,259,107,259,104">
|
||||
<area href="#" state="ID" full="Idaho" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,117,81,118,74,120,62,124,47,126,38,127,35,137,37,134,52,137,57,135,61,137,64,139,65,142,73,144,75,145,76,147,77,147,78,142,91,142,93,144,95,145,95,148,93,149,92,150,93,149,97,152,106,154,107,155,108,156,110,155,112,156,115,157,116,158,113,161,113,163,115,164,114,167,114,170,116,172,115,173,113,175,113,176,113,176,116,178,117,175,135,172,157,168,156,162,155,155,154,146,152,137,151,131,149,124,148,117,146,102,143">
|
||||
<area href="#" state="WA" full="Washington" shape="poly" coords="68,19,71,20,78,22,84,23,98,28,116,32,127,35,126,38,124,47,120,62,118,74,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,45,57,44,58,42,56,42,54,44,53,46,50,44,50,44,47,47,47,45,44,44,40,44,38,44,32,43,29,44,23,47,23,48,25,50,27,53,29,56,30,58,30,60,32,62,32,64,32,64,30,65,29,67,29,67,29,67,31,65,31,65,32,66,33,67,35,68,37,69,36,69,35,68,35,68,32,68,31,68,30,68,29,69,26,68,24,67,20,67,20,68,19">
|
||||
<area href="#" state="WA" shape="poly" coords="61,23,62,23,62,24,64,23,65,23,66,24,65,26,65,26,65,28,64,28,63,26,63,26,62,27,61,26,61,23">
|
||||
<area href="#" state="TX" full="Texas" shape="poly" coords="259,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,370,307,372,305,374,306,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,374,369,367,372,366,374,364,375,362,376,362,377,358,380,356,382,352,385,347,386,343,389,342,390,338,392,335,393,332,397,329,397,329,398,330,400,329,404,329,407,328,410,327,413,328,415,329,420,329,425,331,426,330,428,328,429,324,426,320,425,319,425,317,425,314,423,310,422,304,419,302,417,302,412,299,411,299,409,299,409,299,406,299,406,298,405,299,402,298,400,296,399,293,396,290,392,287,389,287,388,284,379,283,376,282,374,282,374,278,370,275,368,275,367,274,365,269,365,263,364,261,362,258,364,255,365,254,367,253,370,250,374,248,376,246,375,245,374,243,374,241,372,241,372,239,371,236,369,230,363,229,360,229,354,227,350,226,347,224,347,224,345,221,344,219,342,214,337,213,335,210,332,209,329,207,327,206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256">
|
||||
<area href="#" state="TX" shape="poly" coords="332,426,331,421,329,416,329,410,329,404,332,399,335,395,337,393,338,393,334,398,331,403,329,407,329,411,329,416,332,421,332,425,332,425,332,426">
|
||||
<area shape="circle" state="TX" coords="300,350,30" nohref>
|
||||
<area href="#" state="CA" full="California" shape="poly" coords="99,296,102,295,104,293,104,291,101,291,101,290,101,289,101,285,103,284,105,282,105,278,107,276,108,275,110,273,112,272,112,271,111,270,110,269,110,266,107,262,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,58,133,48,130,39,127,34,125,26,123,20,122,20,125,19,131,15,139,13,141,13,142,11,143,11,146,10,148,12,151,13,154,14,156,14,161,13,164,12,167,11,170,13,173,14,176,17,180,17,182,17,185,17,185,17,187,21,191,20,194,20,195,20,197,20,203,21,205,23,207,25,207,26,209,24,212,23,213,22,213,22,216,22,218,24,221,26,225,26,228,27,230,30,235,31,236,32,239,32,239,32,241,32,242,31,248,30,249,32,251,35,251,38,253,41,254,43,254,45,257,47,260,48,262,51,263,54,264,56,266,56,268,55,268,55,269,57,269,59,269,62,273,65,276,65,278,67,281,67,283,67,290,68,291,74,292,89,294,99,296">
|
||||
<area href="#" state="CA" shape="poly" coords="35,259,36,260,36,261,34,261,33,260,33,259,35,259">
|
||||
<area href="#" state="CA" shape="poly" coords="37,259,38,258,40,260,42,261,41,261,38,261,37,260,37,259">
|
||||
<area href="#" state="CA" shape="poly" coords="52,273,53,275,53,275,55,276,55,275,54,274,53,272,52,272,52,273">
|
||||
<area href="#" state="CA" shape="poly" coords="50,279,52,282,53,283,52,284,51,282,50,279">
|
||||
<area href="#" state="AZ" full="Arizona" shape="poly" coords="100,296,98,297,98,298,98,299,112,306,120,312,131,318,143,326,152,327,172,330,173,320,176,301,181,262,184,239,165,237,146,233,122,229,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,107,262,110,266,110,269,111,270,112,271,112,272,110,273,108,275,107,276,105,278,105,282,103,284,101,285,101,289,101,290,101,291,104,291,104,293,102,295,100,296">
|
||||
<area href="#" state="NV" full="Nevada" shape="poly" coords="102,143,117,146,124,148,131,149,137,151,136,155,133,167,131,182,129,189,128,199,125,211,123,221,122,230,119,242,119,242,118,245,116,245,115,242,113,242,113,241,112,241,111,242,110,242,110,248,110,248,109,258,108,260,106,257,95,241,81,220,65,195,56,182,57,177,62,158,68,135,92,141,102,143">
|
||||
<area href="#" state="UT" full="Utah" shape="poly" coords="184,240,165,237,146,233,122,229,123,221,125,211,128,199,129,189,131,182,133,167,136,155,137,151,146,152,155,154,162,155,168,156,172,157,170,164,169,173,174,174,186,176,193,176,191,192,188,209,185,229,185,237,184,240">
|
||||
<area href="#" state="CO" full="Colorado" shape="poly" coords="272,248,275,201,276,185,252,182,234,181,207,178,192,176,191,192,188,209,185,229,185,237,184,240,209,242,236,246,260,248,264,248,272,248">
|
||||
<area href="#" state="NM" full="New Mexico" shape="poly" coords="206,327,205,323,211,324,232,326,253,327,254,310,257,270,259,256,260,256,260,248,236,246,209,242,184,240,181,262,176,301,173,320,172,330,183,331,184,324,196,326,206,327">
|
||||
<area href="#" state="OR" full="Oregon" shape="poly" coords="102,143,105,130,108,117,110,114,111,110,110,108,109,108,108,107,108,107,109,104,112,101,113,100,114,99,114,97,115,96,118,92,121,89,121,86,119,84,118,81,107,79,96,76,85,76,85,75,81,77,77,77,76,75,75,76,71,75,71,74,67,73,66,73,63,72,62,74,57,73,53,70,53,69,53,64,52,61,49,61,48,59,47,59,42,60,41,65,38,72,36,77,32,87,28,97,22,106,20,108,20,114,19,119,20,122,26,123,34,125,39,127,48,130,58,133,68,135">
|
||||
<area href="#" state="OR" shape="poly" coords="102,143,68,135,92,141,102,143">
|
||||
<area href="#" state="ND" full="North Dakota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,314,59,300,58,281,57,263,56,262,66,261,77,260,95,259,104,300,107,342,107">
|
||||
<area href="#" state="SD" full="South Dakota" shape="poly" coords="343,162,343,161,341,159,343,155,344,152,341,150,341,148,342,146,344,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107,300,107,259,104,259,107,257,119,257,132,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,343,162">
|
||||
<area href="#" state="NE" full="Nebraska" shape="poly" coords="352,194,353,195,353,197,354,200,356,203,352,203,320,203,291,201,275,200,276,185,252,182,255,151,266,152,281,152,294,153,311,154,319,154,320,155,324,158,325,158,328,157,331,157,333,157,334,158,338,158,340,160,341,161,341,163,342,163,344,162,344,167,347,172,347,176,349,178,349,182,350,185,350,190,352,194">
|
||||
<area href="#" state="IA" full="Iowa" shape="poly" coords="411,161,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,350,190,350,185,349,182,349,178,347,176,347,172,344,167,344,162,342,161,341,159,343,155,344,152,341,150,341,148,342,146,343,146,352,146,388,146,401,146,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161">
|
||||
<area href="#" state="MS" full="Mississippipi" shape="poly" coords="453,353,452,354,449,354,448,353,446,353,441,355,440,354,438,357,437,358,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,429,281,447,279,451,279,451,284,451,296,450,318,450,329,452,342,453,353">
|
||||
<area href="#" state="IN" full="Indiana" shape="poly" coords="449,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,452,171,452,172,453,172,455,170,457,169,461,169,476,167,481,167,481,167,482,179,483,188,485,205,485,209,485,211,486,212,487,213,485,215,482,216,480,216,479,220,476,222,474,225,474,227,473,228,470,228,470,227,469,227,467,229,467,231,465,232,464,231,463,230,461,230,460,233,458,233,458,231,455,231,450,232,449,233">
|
||||
<area href="#" state="IL" full="Illinois" shape="poly" coords="448,233,448,230,449,227,450,225,452,222,453,219,453,215,452,213,452,211,452,207,452,202,451,190,450,179,449,170,449,170,448,168,447,165,446,164,445,162,444,158,437,159,418,161,411,160,411,162,413,162,413,163,414,164,417,167,417,169,417,171,416,174,415,176,413,177,412,177,408,179,407,180,407,182,407,182,409,183,409,186,407,188,407,188,407,191,406,191,404,192,404,193,404,194,404,195,403,197,403,200,404,206,410,211,414,213,413,217,414,218,419,218,421,219,421,221,419,226,419,228,420,231,425,235,428,236,429,239,431,241,431,243,431,246,433,248,435,248,435,246,437,245,439,245,440,245,443,246,444,246,444,245,443,242,443,241,445,240,446,239,448,239,447,238,446,236,448,236,448,233">
|
||||
<area href="#" state="MN" full="Minnesota" shape="poly" coords="342,107,341,101,341,96,339,86,338,80,338,77,336,73,336,65,337,63,335,59,357,59,357,53,358,53,359,53,361,54,362,58,362,62,364,63,367,63,368,65,372,65,372,66,376,66,376,65,377,65,378,64,379,65,381,65,384,67,388,68,389,68,390,68,391,68,392,70,393,71,394,71,395,71,395,72,397,73,399,73,400,72,402,70,404,69,404,71,405,71,406,71,407,71,413,71,414,73,415,73,415,72,419,72,418,74,415,75,408,78,405,80,403,81,401,84,399,86,398,87,395,91,394,91,392,93,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,146,401,146,388,146,352,146,343,146,344,141,344,119,343,117,340,115,339,113,339,112,341,111,342,110,342,107">
|
||||
<area href="#" state="WI" full="Wisconsin" shape="poly" coords="444,158,444,155,443,152,443,148,442,146,443,143,443,141,444,140,444,137,443,134,444,134,445,131,446,130,445,128,445,127,446,125,448,120,449,116,449,113,449,113,449,113,446,118,444,121,443,122,442,124,441,125,440,126,439,125,439,125,440,122,441,119,443,118,443,116,442,116,441,115,440,107,437,107,437,104,428,103,425,102,419,100,413,99,410,95,410,96,410,96,409,95,407,95,406,95,404,95,404,95,404,94,406,92,407,91,405,89,404,90,401,92,396,94,394,95,392,94,392,94,390,95,389,98,389,104,389,105,385,107,383,112,383,112,386,113,386,116,385,119,385,121,385,126,387,128,389,128,391,131,393,131,396,135,401,138,403,140,404,145,404,148,406,149,406,150,404,152,404,155,407,158,408,158,410,158,411,161,418,161,437,159,444,158">
|
||||
<area href="#" state="MO" full="Missouri" shape="poly" coords="404,196,401,193,400,191,395,192,387,192,369,193,359,193,353,194,352,194,353,195,353,197,354,200,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251,365,254,366,259,383,258,400,258,415,257,423,257,424,259,424,261,422,263,421,265,425,266,429,265,431,260,431,256,433,255,434,254,435,253,435,251,436,249,435,248,433,248,431,246,431,243,431,241,429,239,428,236,425,235,420,231,419,228,419,226,421,221,421,219,419,218,414,218,413,217,414,213,410,211,404,206,403,200,403,197,404,196">
|
||||
<area href="#" state="AR" full="Arkansas" shape="poly" coords="429,265,425,266,421,265,422,263,424,261,424,259,423,257,415,257,400,258,383,258,366,259,367,264,367,270,368,278,368,305,370,307,372,305,374,306,374,314,391,314,404,314,413,314,413,312,413,309,412,307,413,305,412,304,413,303,413,299,416,296,415,295,418,291,419,290,419,289,419,287,421,284,423,283,423,281,425,280,425,276,424,274,427,272,428,270,428,267,429,265">
|
||||
<area href="#" state="OK" full="Oklahoma" shape="poly" coords="272,248,264,248,260,248,260,248,260,256,275,257,298,258,296,275,296,288,296,289,299,292,301,293,302,293,302,291,303,293,305,293,305,291,307,293,306,295,309,296,311,296,314,296,316,298,317,296,320,297,322,299,323,299,323,301,324,302,326,300,327,300,329,300,329,302,333,304,334,303,335,300,336,300,337,302,340,302,343,303,345,304,347,303,347,301,350,301,351,302,353,300,354,300,355,302,358,302,359,300,360,300,362,302,364,304,366,304,368,305,368,278,367,270,367,264,366,259,365,254,365,251,356,251,322,251,290,249,272,248">
|
||||
<area href="#" state="KS" full="Kansas" shape="poly" coords="365,251,356,251,322,251,290,249,272,248,275,200,291,201,320,203,352,203,356,203,359,205,361,205,362,206,362,208,360,209,360,210,362,213,363,215,365,216,366,225,365,251">
|
||||
<area href="#" state="LA" full="Louisiana" shape="poly" coords="437,357,437,356,436,353,433,350,434,345,434,344,432,344,426,345,409,346,408,344,409,338,411,334,415,328,414,326,415,326,416,324,414,323,414,321,413,318,413,314,404,314,391,314,374,314,374,321,375,329,376,331,377,334,378,338,381,341,381,344,382,344,381,350,379,354,380,356,380,358,380,363,378,365,379,368,382,367,388,366,395,369,400,370,403,369,405,370,407,371,408,369,406,368,404,368,401,367,406,366,407,366,410,366,410,368,410,370,414,370,416,371,415,372,414,373,415,374,421,377,424,376,425,374,426,374,428,372,428,373,429,375,428,376,428,377,431,375,432,373,433,373,431,372,431,371,431,370,433,370,434,369,434,369,440,374,441,374,443,374,444,375,446,373,446,372,445,372,443,370,438,369,436,368,437,366,438,366,439,365,437,365,437,365,440,365,441,362,440,361,440,359,439,359,437,361,437,362,434,362,434,361,435,359,437,358,437,357">
|
||||
</map>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 55 KiB |
242
rus/admin/_V4/_lib/ImageMapster-master/tests/migrated.tests.js
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
/*global iqtest, map_options */
|
||||
/*jslint onevar: false */
|
||||
|
||||
this.tests = this.tests || [];
|
||||
(function() {
|
||||
|
||||
function attrMatches(jq, attr, matches) {
|
||||
var list = matches.split(','), result = $();
|
||||
jq.each(function () {
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if ($(this).is("[" + attr + "='" + list[i] + "']")) {
|
||||
result = result.add(this);
|
||||
i = list.length;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("basic","manipulation tests - migrated from old test suite (not organized)")
|
||||
.add("Migrated tests", function (a, r) {
|
||||
var me=this,
|
||||
getPromise= function(name) {
|
||||
return me.promises(name);
|
||||
},mu = $.mapster.utils;
|
||||
|
||||
// Save current state to see if we cleaned up properly later
|
||||
var domCount = $('#test_elements *').length;
|
||||
var map = $('img').mapster();
|
||||
|
||||
// // testing with no canvas on a browser that doesn't support it anyway doesn't make sense, regular test will cover it
|
||||
// var has_canvas = (document.namespaces && document.namespaces.g_vml_) ? false :
|
||||
// $('<canvas></canvas>')[0].getContext ? true : false;
|
||||
|
||||
// if (!has_canvas && disableCanvas) {
|
||||
// map.mapster('unbind');
|
||||
// a.pass("The browser does not support canvases: this test was skipped.")
|
||||
// return;
|
||||
// }
|
||||
|
||||
map.mapster('unbind');
|
||||
|
||||
// var oldHasCanvas = $.mapster.hasCanvas;
|
||||
// if (disableCanvas) {
|
||||
// $.mapster.hasCanvas=false;
|
||||
// }
|
||||
|
||||
|
||||
// test using only bound images
|
||||
var isObfuscated = map.mapster("test","typeof m === 'undefined'");
|
||||
if (!isObfuscated) {
|
||||
map = $('img').mapster(map_options);
|
||||
a.equals(1,map.mapster("test", "typeof m !== 'undefined' && m.map_cache && m.map_cache.length"),
|
||||
"Only imagemap bound images were obtained on generic create");
|
||||
|
||||
map = $('img,div').mapster({ mapKey: "state" });
|
||||
|
||||
a.equals(1,map.mapster("test", "typeof m !== 'undefined' && m.map_cache && m.map_cache.length"),
|
||||
"Only imagemap bound images were obtained on generic create with other elements");
|
||||
|
||||
|
||||
}
|
||||
map = $("#usa_image").mapster($.extend(map_options, {
|
||||
onConfigured: getPromise("configured").resolve
|
||||
}));
|
||||
|
||||
|
||||
getPromise("configured").then(function() {
|
||||
|
||||
var initialOpts = mu.updateProps({}, $.mapster.defaults, map_options);
|
||||
var opts = map.mapster('get_options');
|
||||
a.equals(opts, initialOpts, "Options retrieved match initial options");
|
||||
|
||||
// todo - test new options options
|
||||
//opts = map.mapster('get_options',null,true);
|
||||
//initialOpts.render_select = u.mergeObjects({template:$.mapster.render_defaults });
|
||||
|
||||
var newOpts = { isSelectable: false, areas: [{ key: 'MT', isDeselectable: false}] };
|
||||
map.mapster('set_options', newOpts);
|
||||
opts = map.mapster('get_options');
|
||||
|
||||
// to compare this we have to ignore areas, since they won't be the same object
|
||||
|
||||
var expectedNewOpts = $.extend({},initialOpts);
|
||||
expectedNewOpts.isSelectable = false;
|
||||
|
||||
a.propertyValueEquals(opts,expectedNewOpts, "Options retrieved match updated value");
|
||||
a.equals(opts.areas.length, 6, "Area option was added");
|
||||
|
||||
// restore original options before continuing
|
||||
opts = map.mapster('set_options', { isSelectable: true, areas: [{ key: 'MT', isDeselectable: true}] });
|
||||
|
||||
a.equals(!!map.mapster, true, "Plugin returns jQuery object");
|
||||
a.equals(map, $("#usa_image"), "Plugin returns jquery same object as invocation");
|
||||
|
||||
// order is not guaranteed - this is the order the areas are created.
|
||||
var selected = map.mapster('get');
|
||||
|
||||
// This test should NOT show "WA" because StaticState items are not considered "selected"
|
||||
|
||||
a.collectionEquals(selected, "AK,TX", "Initially selected items returned with 'get'");
|
||||
|
||||
|
||||
selected = map.mapster('get', 'TX');
|
||||
a.equals(selected, true, "Initially selected single item returned true with 'get'");
|
||||
selected = map.mapster('get', 'ME');
|
||||
a.equals(selected, false, "Initially deselected single item returned false with 'get'");
|
||||
|
||||
|
||||
// Test setting/getting via area
|
||||
|
||||
// AK was already selected, should be ignored
|
||||
|
||||
attrMatches($('area'), "state", "AK,HI,LA").mapster('set', true);
|
||||
var area_sel = map.mapster('get');
|
||||
a.collectionEquals(area_sel, "HI,AK,LA,TX", "Set using area works");
|
||||
|
||||
map.mapster('set', false, 'LA,TX');
|
||||
a.collectionEquals("HI,AK", map.mapster('get'), "unset using keys works");
|
||||
|
||||
map.mapster('set', true, 'ME,OH,TX');
|
||||
a.collectionEquals("HI,AK,ME,OH,TX", map.mapster('get'), "set using keys works");
|
||||
|
||||
// test toggling: AK should go off, MT should go on
|
||||
var areas = $('area[state=AK]').first();
|
||||
areas = areas.add($('area[state=MT]').first());
|
||||
areas.mapster('set');
|
||||
a.collectionEquals("HI,ME,OH,TX,MT", map.mapster('get'), "toggling keys works");
|
||||
|
||||
// test clicking
|
||||
$('area[state="AZ"]').first().click();
|
||||
selected = map.mapster('get', 'AZ');
|
||||
a.equals(true, selected, "Click-selected area returned 'get'");
|
||||
a.collectionEquals("HI,ME,OH,TX,MT,AZ", map.mapster('get'), "Complete list returned with 'get'");
|
||||
|
||||
/// try to click select "staticstate areas
|
||||
|
||||
$('area[state="OR"]').first().click();
|
||||
selected = map.mapster('get', 'OR');
|
||||
a.equals(selected, false, "Cannot select 'staticState=false' area with click");
|
||||
|
||||
selected = map.mapster('get', 'WA');
|
||||
a.equals(selected, false, "staticState=true area is considered not selected");
|
||||
|
||||
opts = map.mapster('get_options', 'WA');
|
||||
a.equals(opts.staticState, true, "get effective options returned correct static state for WA");
|
||||
|
||||
opts = map.mapster('get_options', 'OR');
|
||||
a.equals(opts.staticState, false, "get effective options returned correct static state for OR");
|
||||
|
||||
|
||||
$('area[state="WA"]').first().click();
|
||||
selected = map.mapster('get', 'WA');
|
||||
a.equals(selected, false, "Cannot change selection state of 'staticState=true' area with click");
|
||||
|
||||
// do it programatically
|
||||
|
||||
map.mapster('set', true, 'OR');
|
||||
selected = map.mapster('get', 'OR');
|
||||
a.equals(selected, true, "Can select 'staticState=false' area with 'set'");
|
||||
|
||||
map.mapster('set', false, 'WA');
|
||||
a.equals(map.mapster('get', 'WA'), false, "Can deselect staticState=true' area with 'set'");
|
||||
|
||||
// test rebind
|
||||
newOpts = map.mapster('get_options');
|
||||
newOpts.singleSelect = true;
|
||||
map.mapster('rebind', newOpts);
|
||||
a.collectionEquals(map.mapster('get'), 'TX,AK', "Rebind with singleSelect reverted to original state");
|
||||
|
||||
map.mapster('set', true, "MI");
|
||||
a.equals(map.mapster('get'), 'MI', "Single select worked.");
|
||||
|
||||
map.mapster('set_options', { isDeselectable: false });
|
||||
$('area[state="MI"]').first().click();
|
||||
a.equals(map.mapster('get', 'MI'), true, "Cannot deselect single selected item with isDeselectable=false");
|
||||
|
||||
$('area[state="UT"]').first().click();
|
||||
|
||||
a.equals(map.mapster('get'), 'UT', "New single state selected");
|
||||
|
||||
map.mapster('set_options', { singleSelect: false, isDeselectable: true, areas: [{ key: 'ME', isDeselectable: false}] });
|
||||
|
||||
$('area[state="UT"]').first().click();
|
||||
a.equals(map.mapster('get', 'UT'), false, "Was able to deselect item after removing singleSelect");
|
||||
|
||||
map.mapster('set', true, "CA,HI,ME");
|
||||
|
||||
|
||||
$('area[state="ME"]').first().click();
|
||||
a.equals(map.mapster('get', 'ME'), true, "Could not deselect one item marked as !isDeselectable");
|
||||
$('area[state="CA"]').first().click();
|
||||
a.equals(map.mapster('get', 'CA'), false, "Could deselect other items ");
|
||||
|
||||
// Test manual highlighting
|
||||
|
||||
a.equals(map.mapster('highlight'), null, "nothing is highlighted");
|
||||
|
||||
$('area[state="CA"]').first().mapster('highlight');
|
||||
|
||||
a.equals(map.mapster('highlight'), "CA", "highlighted manually");
|
||||
|
||||
map.mapster('highlight', "LA");
|
||||
|
||||
a.equals(map.mapster('highlight'), "LA", "highlighted manually using other technique");
|
||||
|
||||
map.mapster('highlight', false);
|
||||
|
||||
a.equals(map.mapster('highlight'), null, "everything unhighlighted");
|
||||
|
||||
// restore internal canvas setting or these tests won't work
|
||||
// if (disableCanvas) {
|
||||
// map.mapster('test', 'has_canvas=true');
|
||||
// } else {
|
||||
|
||||
// // cleanup tests - skip to play with map afterwards
|
||||
// // return;
|
||||
|
||||
// if (has_canvas) {
|
||||
// a.equals($('canvas').length, 2, 'There are 2 canvases.');
|
||||
// map.mapster(map_options);
|
||||
// a.equals($('canvas').length, 2, 'There are 2 canvases (recreate was clean)');
|
||||
// }
|
||||
// }
|
||||
map.mapster('unbind');
|
||||
a.equals($('canvas').length, 0, 'No canvases remain after an unbind.');
|
||||
|
||||
a.equals($('#test_elements *').length, domCount, "# elements in DOM is the same.");
|
||||
|
||||
// if (disableCanvas) {
|
||||
// $.mapster.hasCanvas=oldHasCanvas;
|
||||
// }
|
||||
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
}());
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,321 @@
|
|||
/* common.utils.js: a core framework library of utilities and polyfills.
|
||||
|
||||
This adds utility functions into a namespace u.
|
||||
|
||||
Standard polyfills are automatically added to their prototypes. The following nonstandard prototype
|
||||
changes are made:
|
||||
|
||||
String.format
|
||||
String.split with trim option
|
||||
Array.contains
|
||||
Array.first
|
||||
|
||||
You can remove the call to u.polyfill to prevent the nonstandard changes.
|
||||
|
||||
Version 1.0
|
||||
James Treworgy
|
||||
*/
|
||||
|
||||
/*global define, require, module */
|
||||
/*jslint curly: false */
|
||||
(function (define) {
|
||||
define(function () {
|
||||
var u,nativeSplit=String.prototype.split;
|
||||
|
||||
/* General puropose functions */
|
||||
|
||||
function isBool(obj) {
|
||||
return typeof obj === 'boolean';
|
||||
}
|
||||
function isString(obj) {
|
||||
return typeof obj === 'string';
|
||||
}
|
||||
function isUndefined(obj) {
|
||||
return typeof obj === 'undefined';
|
||||
}
|
||||
function isArray(obj) {
|
||||
return obj && obj.constructor === Array;
|
||||
}
|
||||
|
||||
/* prototype extension functions - these must be called with a context */
|
||||
|
||||
// trim a string leading & trailing whitespace
|
||||
function stringTrim() {
|
||||
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
||||
}
|
||||
|
||||
// generic iterator. when trim is true, string values are trimmed.
|
||||
function forEach(cb, trim) {
|
||||
var coll = this,
|
||||
i, val;
|
||||
if (isString(coll)) {
|
||||
coll = coll.split(',');
|
||||
}
|
||||
if (isArray(coll)) {
|
||||
for (i = 0; i < coll.length; i++) {
|
||||
val = isString(coll[i]) ?
|
||||
stringTrim.call(coll[i]) :
|
||||
coll[i];
|
||||
|
||||
if (cb.call(val, i, val) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i in coll) {
|
||||
if (coll.hasOwnProperty(i)) {
|
||||
if (cb.call(coll[i], i, coll[i]) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// string format function
|
||||
function format() {
|
||||
var args = (arguments.length === 1 && $.isArray(arguments[0])) ?
|
||||
arguments[0] :
|
||||
arguments;
|
||||
return this.replace(/\{(\d+)\}/g, function (match, number) {
|
||||
var num = parseInt(number,10);
|
||||
return !isUndefined(args[num])
|
||||
? String(args[num])
|
||||
: match;
|
||||
});
|
||||
}
|
||||
|
||||
// a split function that trims its results. any 'true' bool parameter will be interpreted as a flag to trim
|
||||
function stringSplit(delimiter, trimResults) {
|
||||
var result = [],
|
||||
delim = isString(delimiter) ?
|
||||
delimiter : ',',
|
||||
trim = isBool(delimiter) ?
|
||||
delimiter :
|
||||
isBool(trimResults) ?
|
||||
trimResults : false;
|
||||
|
||||
forEach.call(nativeSplit.call(this,delim || ','), function (i, e) {
|
||||
result.push(trim ? stringTrim(e) : e);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// polyfills
|
||||
|
||||
function arrayForEach(action, that) {
|
||||
for (var i = 0, n = this.length; i < n; i++)
|
||||
if (i in this)
|
||||
action.call(that, this[i], i, this);
|
||||
}
|
||||
|
||||
function arrayIndexOf(find, i /*opt*/) {
|
||||
if (i === undefined) i = 0;
|
||||
if (i < 0) i += this.length;
|
||||
if (i < 0) i = 0;
|
||||
for (var n = this.length; i < n; i++)
|
||||
if (i in this && this[i] === find)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// returns true if the element exists
|
||||
function arrayContains(val) {
|
||||
return arrayIndexOf.call(this, val) >= 0;
|
||||
}
|
||||
|
||||
// NONSTANDARD
|
||||
|
||||
// return the first element where filter returns true
|
||||
function arrayFirst(filter) {
|
||||
var i,undef;
|
||||
|
||||
if (!filter) {
|
||||
return this.length>0 ? this[0] : undef;
|
||||
}
|
||||
|
||||
for (i = 0; i < this.length; i++) {
|
||||
if (filter.call(this[i], i, this[i])) {
|
||||
return this[i];
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
function arrayLastIndexOf(find, i /*opt*/) {
|
||||
if (i === undefined) i = this.length - 1;
|
||||
if (i < 0) i += this.length;
|
||||
if (i > this.length - 1) i = this.length - 1;
|
||||
for (i++; i-- > 0; ) /* i++ because from-argument is sadly inclusive */
|
||||
if (i in this && this[i] === find)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
function arrayMap(mapper, that /*opt*/) {
|
||||
var n, i, other = new Array(this.length);
|
||||
for (i = 0, n = this.length; i < n; i++)
|
||||
if (i in this)
|
||||
other[i] = mapper.call(that, this[i], i, this);
|
||||
return other;
|
||||
}
|
||||
|
||||
function arrayFilter(filter, that /*opt*/) {
|
||||
var i, n, other = [], v;
|
||||
for (i = 0, n = this.length; i < n; i++)
|
||||
if (i in this && filter.call(that, v = this[i], i, this))
|
||||
other.push(v);
|
||||
return other;
|
||||
}
|
||||
|
||||
function arrayEvery(tester, that /*opt*/) {
|
||||
for (var i = 0, n = this.length; i < n; i++)
|
||||
if (i in this && !tester.call(that, this[i], i, this))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function arraySome(tester, that /*opt*/) {
|
||||
for (var i = 0, n = this.length; i < n; i++)
|
||||
if (i in this && tester.call(that, this[i], i, this))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
u = {
|
||||
// when onlyInSource is true, properties will not be added - only updated
|
||||
// passing a falsy value as the target results in a new object being created
|
||||
// and onlyInTarget is irrelevant
|
||||
extend: function (target) {
|
||||
var prop, source, sources, i,
|
||||
li = arguments.length,
|
||||
lastBool = u.isBool(arguments[li - 1]),
|
||||
len = lastBool ?
|
||||
li - 2 : li - 1,
|
||||
emptyTarget = !target,
|
||||
onlyInTarget = lastBool ?
|
||||
arguments[len + 1] : false;
|
||||
|
||||
target = target || {};
|
||||
|
||||
sources = u.toArray(arguments, 1, len + 1);
|
||||
|
||||
for (i = 0; i < sources.length; i++) {
|
||||
source = sources[i];
|
||||
for (prop in source) {
|
||||
if (source.hasOwnProperty(prop)
|
||||
&& (emptyTarget || !onlyInTarget || target.hasOwnProperty(prop))) {
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
// start honoring onlyInTarget after the first source
|
||||
emptyTarget = false;
|
||||
}
|
||||
return target;
|
||||
},
|
||||
// copy selected properties to a new object
|
||||
filterProps: function (source, what) {
|
||||
var target = {},
|
||||
props = u.isArray(what) ?
|
||||
what :
|
||||
what.split(',');
|
||||
|
||||
u.each(props, function (i, prop) {
|
||||
target[prop] = source[prop];
|
||||
});
|
||||
return target;
|
||||
},
|
||||
toArray: function (arrLike, first, last) {
|
||||
return Array.prototype.slice.call(arrLike, first || 0, last || arrLike.length);
|
||||
},
|
||||
isArray: isArray,
|
||||
arrayIndexOf: function (arr, val) {
|
||||
return arrayIndexOf.call(arr, val);
|
||||
},
|
||||
inArray: function (arr, val) {
|
||||
return arrayContains.call(arr, val);
|
||||
},
|
||||
isFunction: function (obj) {
|
||||
return typeof obj === 'function';
|
||||
},
|
||||
isUndefined: isUndefined,
|
||||
isString: isString,
|
||||
isBool: isBool,
|
||||
isValueType: function (obj) {
|
||||
return u.inArray(['boolean', 'number', 'string'], typeof (obj));
|
||||
},
|
||||
trim: function (str) {
|
||||
return stringTrim.call(str);
|
||||
},
|
||||
//split with trim (why would you want it any other way?)
|
||||
split: function (str, delim) {
|
||||
return stringSplit.call(str, delim);
|
||||
},
|
||||
// replaces {0}.. {n} with the ordinal valued parameter. You can also pass an
|
||||
// array instead of multiple parameters
|
||||
format: function () {
|
||||
return format.apply(arguments[0], u.toArray(arguments, 1));
|
||||
},
|
||||
// usual each, if you happen to pass a string, it will split it on commas.
|
||||
// it will always trim string values in an array.
|
||||
each: function (coll, cb) {
|
||||
return forEach.call(coll, cb);
|
||||
},
|
||||
donothing: function () { },
|
||||
// add nonstandard polyfills
|
||||
polyfill: function () {
|
||||
|
||||
Array.prototype.contains = arrayContains;
|
||||
Array.prototype.first = arrayFirst;
|
||||
|
||||
String.prototype.format = format;
|
||||
|
||||
// always replace split, ours is better
|
||||
if (String.prototype.split !== stringSplit) {
|
||||
String.prototype.split = stringSplit;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// add required polyfills
|
||||
|
||||
if (!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = arrayIndexOf;
|
||||
}
|
||||
if (!Array.prototype.trim) {
|
||||
Array.prototype.trim = stringTrim;
|
||||
}
|
||||
if (!Array.prototype.lastIndexOf) {
|
||||
Array.prototype.lastIndexOf = arrayLastIndexOf;
|
||||
}
|
||||
if (!Array.prototype.forEach) {
|
||||
Array.prototype.forEach = arrayForEach;
|
||||
}
|
||||
if (!Array.prototype.filter) {
|
||||
Array.prototype.filter = arrayFilter;
|
||||
}
|
||||
if (!Array.prototype.every) {
|
||||
Array.prototype.every = arrayEvery;
|
||||
}
|
||||
if (!Array.prototype.some) {
|
||||
Array.prototype.some = arraySome;
|
||||
}
|
||||
if (!Array.prototype.map) {
|
||||
Array.prototype.map = arrayMap;
|
||||
}
|
||||
u.polyfill();
|
||||
|
||||
return u;
|
||||
});
|
||||
} (typeof define === 'function'
|
||||
? define
|
||||
: function (factory) {
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = factory();
|
||||
} else {
|
||||
this.common = this.common || {};
|
||||
this.common.utils = factory();
|
||||
}
|
||||
}
|
||||
// Boilerplate for AMD, Node, and browser global
|
||||
));
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
document.createElement("canvas").getContext||function(){function Z(){return this.context_||(this.context_=new C(this))}function $(a,b){var c=P.call(arguments,2);return function(){return a.apply(b,c.concat(P.call(arguments)))}}function Q(a){return String(a).replace(/&/g,"&").replace(/"/g,""")}function R(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function S(a){R(a,"g_vml_","urn:schemas-microsoft-com:vml");R(a,"g_o_","urn:schemas-microsoft-com:office:office");if(!a.styleSheets.ex_canvas_){a=
|
||||
a.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function aa(a){var b=a.srcElement;switch(a.propertyName){case "width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstChild.style.width=b.clientWidth+"px";break;case "height":b.getContext().clearRect();b.style.height=b.attributes.height.nodeValue+"px";b.firstChild.style.height=b.clientHeight+"px";break}}function ba(a){a=
|
||||
a.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+"px";a.firstChild.style.height=a.clientHeight+"px"}}function D(){return[[1,0,0],[0,1,0],[0,0,1]]}function u(a,b){for(var c=D(),d=0;d<3;d++)for(var e=0;e<3;e++){for(var f=0,h=0;h<3;h++)f+=a[d][h]*b[h][e];c[d][e]=f}return c}function T(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=a.shadowOffsetX;
|
||||
b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function U(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1);b=a.substring(b+1,c).split(",");if(b.length!=4||a.charAt(3)!="a")b[3]=1;return b}function E(a){return parseFloat(a)/100}function F(a,b,c){return Math.min(c,Math.max(b,a))}function ca(a){var b,c;c=parseFloat(a[0])/
|
||||
360%360;c<0&&c++;b=F(E(a[1]),0,1);a=F(E(a[2]),0,1);if(b==0)b=a=c=a;else{var d=a<0.5?a*(1+b):a+b-a*b,e=2*a-d;b=G(e,d,c+1/3);a=G(e,d,c);c=G(e,d,c-1/3)}return"#"+v[Math.floor(b*255)]+v[Math.floor(a*255)]+v[Math.floor(c*255)]}function G(a,b,c){c<0&&c++;c>1&&c--;return 6*c<1?a+(b-a)*6*c:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}function H(a){if(a in I)return I[a];var b,c=1;a=String(a);if(a.charAt(0)=="#")b=a;else if(/^rgb/.test(a)){c=U(a);b="#";for(var d,e=0;e<3;e++){d=c[e].indexOf("%")!=-1?Math.floor(E(c[e])*
|
||||
255):+c[e];b+=v[F(d,0,255)]}c=+c[3]}else if(/^hsl/.test(a)){c=U(a);b=ca(c);c=c[3]}else b=da[a]||a;return I[a]={color:b,alpha:c}}function ea(a){if(J[a])return J[a];var b=document.createElement("div").style;try{b.font=a}catch(c){}return J[a]={style:b.fontStyle||w.style,variant:b.fontVariant||w.variant,weight:b.fontWeight||w.weight,size:b.fontSize||w.size,family:b.fontFamily||w.family}}function fa(a,b){var c={};for(var d in a)c[d]=a[d];b=parseFloat(b.currentStyle.fontSize);d=parseFloat(a.size);c.size=
|
||||
typeof a.size=="number"?a.size:a.size.indexOf("px")!=-1?d:a.size.indexOf("em")!=-1?b*d:a.size.indexOf("%")!=-1?b/100*d:a.size.indexOf("pt")!=-1?d/0.75:b;c.size*=0.981;return c}function ga(a){return a.style+" "+a.variant+" "+a.weight+" "+a.size+"px "+a.family}function ha(a){return ia[a]||"square"}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=l*1;this.globalAlpha=
|
||||
1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(false);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function V(a,b,c,d){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,
|
||||
cp1y:b.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y});a.currentX_=d.x;a.currentY_=d.y}function W(a,b){var c=H(a.strokeStyle),d=c.color;c=c.alpha*a.globalAlpha;var e=a.lineScale_*a.lineWidth;if(e<1)c*=e;b.push("<g_vml_:stroke",' opacity="',c,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',ha(a.lineCap),'"',' weight="',e,'px"',' color="',d,'" />')}function X(a,b,c,d){var e=a.fillStyle,f=a.arcScaleX_,h=a.arcScaleY_,j=d.x-c.x,m=d.y-c.y;if(e instanceof x){var k=0;d={x:0,y:0};var q=0,
|
||||
o=1;if(e.type_=="gradient"){k=e.x1_/f;c=e.y1_/h;var n=p(a,e.x0_/f,e.y0_/h);k=p(a,k,c);k=Math.atan2(k.x-n.x,k.y-n.y)*180/Math.PI;if(k<0)k+=360;if(k<1.0E-6)k=0}else{n=p(a,e.x0_,e.y0_);d={x:(n.x-c.x)/j,y:(n.y-c.y)/m};j/=f*l;m/=h*l;o=r.max(j,m);q=2*e.r0_/o;o=2*e.r1_/o-q}f=e.colors_;f.sort(function(A,ja){return A.offset-ja.offset});h=f.length;n=f[0].color;c=f[h-1].color;j=f[0].alpha*a.globalAlpha;a=f[h-1].alpha*a.globalAlpha;m=[];for(var s=0;s<h;s++){var y=f[s];m.push(y.offset*o+q+" "+y.color)}b.push('<g_vml_:fill type="',
|
||||
e.type_,'"',' method="none" focus="100%"',' color="',n,'"',' color2="',c,'"',' colors="',m.join(","),'"',' opacity="',a,'"',' g_o_:opacity2="',j,'"',' angle="',k,'"',' focusposition="',d.x,",",d.y,'" />')}else if(e instanceof K)j&&m&&b.push("<g_vml_:fill",' position="',-c.x/j*f*f,",",-c.y/m*h*h,'"',' type="tile"',' src="',e.src_,'" />');else{e=H(a.fillStyle);b.push('<g_vml_:fill color="',e.color,'" opacity="',e.alpha*a.globalAlpha,'" />')}}function p(a,b,c){a=a.m_;return{x:l*(b*a[0][0]+c*a[1][0]+
|
||||
a[2][0])-t,y:l*(b*a[0][1]+c*a[1][1]+a[2][1])-t}}function ka(a){return isFinite(a[0][0])&&isFinite(a[0][1])&&isFinite(a[1][0])&&isFinite(a[1][1])&&isFinite(a[2][0])&&isFinite(a[2][1])}function z(a,b,c){if(ka(b)){a.m_=b;if(c)a.lineScale_=la(ma(b[0][0]*b[1][1]-b[0][1]*b[1][0]))}}function x(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function K(a,b){na(a);switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=
|
||||
b;break;default:L("SYNTAX_ERR")}this.src_=a.src;this.width_=a.width;this.height_=a.height}function L(a){throw new M(a);}function na(a){if(!a||a.nodeType!=1||a.tagName!="IMG")L("TYPE_MISMATCH_ERR");a.readyState!="complete"&&L("INVALID_STATE_ERR")}function M(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var r=Math,i=r.round,N=r.sin,O=r.cos,ma=r.abs,la=r.sqrt,l=10,t=l/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var P=Array.prototype.slice;S(document);var Y={init:function(a){a=a||
|
||||
document;a.createElement("canvas");a.attachEvent("onreadystatechange",$(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;b<a.length;b++)this.initElement(a[b])},initElement:function(a){if(!a.getContext){a.getContext=Z;S(a.ownerDocument);a.innerHTML="";a.attachEvent("onpropertychange",aa);a.attachEvent("onresize",ba);var b=a.attributes;if(b.width&&b.width.specified)a.style.width=b.width.nodeValue+"px";else a.width=a.clientWidth;if(b.height&&b.height.specified)a.style.height=
|
||||
b.height.nodeValue+"px";else a.height=a.clientHeight}return a}};Y.init();for(var v=[],g=0;g<16;g++)for(var B=0;B<16;B++)v[g*16+B]=g.toString(16)+B.toString(16);var da={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",
|
||||
cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",
|
||||
firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",
|
||||
lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",
|
||||
mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",
|
||||
skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},I={},w={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},J={},ia={butt:"flat",round:"round"};g=C.prototype;g.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=
|
||||
null}this.element_.innerHTML=""};g.beginPath=function(){this.currentPath_=[]};g.moveTo=function(a,b){a=p(this,a,b);this.currentPath_.push({type:"moveTo",x:a.x,y:a.y});this.currentX_=a.x;this.currentY_=a.y};g.lineTo=function(a,b){a=p(this,a,b);this.currentPath_.push({type:"lineTo",x:a.x,y:a.y});this.currentX_=a.x;this.currentY_=a.y};g.bezierCurveTo=function(a,b,c,d,e,f){e=p(this,e,f);a=p(this,a,b);c=p(this,c,d);V(this,a,c,e)};g.quadraticCurveTo=function(a,b,c,d){a=p(this,a,b);c=p(this,c,d);d={x:this.currentX_+
|
||||
2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};V(this,d,{x:d.x+(c.x-this.currentX_)/3,y:d.y+(c.y-this.currentY_)/3},c)};g.arc=function(a,b,c,d,e,f){c*=l;var h=f?"at":"wa",j=a+O(d)*c-t,m=b+N(d)*c-t;d=a+O(e)*c-t;e=b+N(e)*c-t;if(j==d&&!f)j+=0.125;a=p(this,a,b);j=p(this,j,m);d=p(this,d,e);this.currentPath_.push({type:h,x:a.x,y:a.y,radius:c,xStart:j.x,yStart:j.y,xEnd:d.x,yEnd:d.y})};g.rect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);
|
||||
this.closePath()};g.strokeRect=function(a,b,c,d){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.stroke();this.currentPath_=e};g.fillRect=function(a,b,c,d){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill();this.currentPath_=e};g.createLinearGradient=function(a,b,c,d){var e=new x("gradient");e.x0_=a;e.y0_=b;e.x1_=
|
||||
c;e.y1_=d;return e};g.createRadialGradient=function(a,b,c,d,e,f){var h=new x("gradientradial");h.x0_=a;h.y0_=b;h.r0_=c;h.x1_=d;h.y1_=e;h.r1_=f;return h};g.drawImage=function(a){var b,c,d,e,f,h,j,m;d=a.runtimeStyle.width;e=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var k=a.width,q=a.height;a.runtimeStyle.width=d;a.runtimeStyle.height=e;if(arguments.length==3){b=arguments[1];c=arguments[2];f=h=0;j=d=k;m=e=q}else if(arguments.length==5){b=arguments[1];c=arguments[2];
|
||||
d=arguments[3];e=arguments[4];f=h=0;j=k;m=q}else if(arguments.length==9){f=arguments[1];h=arguments[2];j=arguments[3];m=arguments[4];b=arguments[5];c=arguments[6];d=arguments[7];e=arguments[8]}else throw Error("Invalid number of arguments");var o=p(this,b,c),n=[];n.push(" <g_vml_:group",' coordsize="',l*10,",",l*10,'"',' coordorigin="0,0"',' style="width:',10,"px;height:",10,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var s=[];s.push("M11=",this.m_[0][0],
|
||||
",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",i(o.x/l),",","Dy=",i(o.y/l),"");var y=p(this,b+d,c),A=p(this,b,c+e);b=p(this,b+d,c+e);o.x=r.max(o.x,y.x,A.x,b.x);o.y=r.max(o.y,y.y,A.y,b.y);n.push("padding:0 ",i(o.x/l),"px ",i(o.y/l),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",s.join(""),", sizingmethod='clip');")}else n.push("top:",i(o.y/l),"px;left:",i(o.x/l),"px;");n.push(' ">','<g_vml_:image src="',a.src,'"',' style="width:',l*d,"px;"," height:",
|
||||
l*e,'px"',' cropleft="',f/k,'"',' croptop="',h/q,'"',' cropright="',(k-f-j)/k,'"',' cropbottom="',(q-h-m)/q,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",n.join(""))};g.stroke=function(a){var b=[];b.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',l*10,",",l*10,'"',' stroked="',!a,'"',' path="');for(var c={x:null,y:null},d={x:null,y:null},e=0;e<this.currentPath_.length;e++){var f=this.currentPath_[e];
|
||||
switch(f.type){case "moveTo":b.push(" m ",i(f.x),",",i(f.y));break;case "lineTo":b.push(" l ",i(f.x),",",i(f.y));break;case "close":b.push(" x ");f=null;break;case "bezierCurveTo":b.push(" c ",i(f.cp1x),",",i(f.cp1y),",",i(f.cp2x),",",i(f.cp2y),",",i(f.x),",",i(f.y));break;case "at":case "wa":b.push(" ",f.type," ",i(f.x-this.arcScaleX_*f.radius),",",i(f.y-this.arcScaleY_*f.radius)," ",i(f.x+this.arcScaleX_*f.radius),",",i(f.y+this.arcScaleY_*f.radius)," ",i(f.xStart),",",i(f.yStart)," ",i(f.xEnd),
|
||||
",",i(f.yEnd));break}if(f){if(c.x==null||f.x<c.x)c.x=f.x;if(d.x==null||f.x>d.x)d.x=f.x;if(c.y==null||f.y<c.y)c.y=f.y;if(d.y==null||f.y>d.y)d.y=f.y}}b.push(' ">');a?X(this,b,c,d):W(this,b);b.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};g.fill=function(){this.stroke(true)};g.closePath=function(){this.currentPath_.push({type:"close"})};g.save=function(){var a={};T(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=u(D(),this.m_)};g.restore=function(){if(this.aStack_.length){T(this.aStack_.pop(),
|
||||
this);this.m_=this.mStack_.pop()}};g.translate=function(a,b){z(this,u([[1,0,0],[0,1,0],[a,b,1]],this.m_),false)};g.rotate=function(a){var b=O(a);a=N(a);z(this,u([[b,a,0],[-a,b,0],[0,0,1]],this.m_),false)};g.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,u([[a,0,0],[0,b,0],[0,0,1]],this.m_),true)};g.transform=function(a,b,c,d,e,f){z(this,u([[a,b,0],[c,d,0],[e,f,1]],this.m_),true)};g.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],true)};g.drawText_=function(a,
|
||||
b,c,d,e){var f=this.m_;d=0;var h=1E3,j={x:0,y:0},m=[],k=fa(ea(this.font),this.element_),q=ga(k),o=this.element_.currentStyle,n=this.textAlign.toLowerCase();switch(n){case "left":case "center":case "right":break;case "end":n=o.direction=="ltr"?"right":"left";break;case "start":n=o.direction=="rtl"?"right":"left";break;default:n="left"}switch(this.textBaseline){case "hanging":case "top":j.y=k.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":j.y=
|
||||
-k.size/2.25;break}switch(n){case "right":d=1E3;h=0.05;break;case "center":d=h=500;break}b=p(this,b+j.x,c+j.y);m.push('<g_vml_:line from="',-d,' 0" to="',h,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!e,'" stroked="',!!e,'" style="position:absolute;width:1px;height:1px;">');e?W(this,m):X(this,m,{x:-d,y:0},{x:h,y:k.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=i(b.x/l)+","+i(b.y/l);m.push('<g_vml_:skew on="t" matrix="',
|
||||
e,'" ',' offset="',b,'" origin="',d,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',Q(a),'" style="v-text-align:',n,";font:",Q(q),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",m.join(""))};g.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,false)};g.strokeText=function(a,b,c,d){this.drawText_(a,b,c,d,true)};g.measureText=function(a){if(!this.textMeasureEl_){this.element_.insertAdjacentHTML("beforeEnd",'<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>');
|
||||
this.textMeasureEl_=this.element_.lastChild}var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};g.clip=function(){};g.arcTo=function(){};g.createPattern=function(a,b){return new K(a,b)};x.prototype.addColorStop=function(a,b){b=H(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};g=M.prototype=new Error;g.INDEX_SIZE_ERR=1;g.DOMSTRING_SIZE_ERR=
|
||||
2;g.HIERARCHY_REQUEST_ERR=3;g.WRONG_DOCUMENT_ERR=4;g.INVALID_CHARACTER_ERR=5;g.NO_DATA_ALLOWED_ERR=6;g.NO_MODIFICATION_ALLOWED_ERR=7;g.NOT_FOUND_ERR=8;g.NOT_SUPPORTED_ERR=9;g.INUSE_ATTRIBUTE_ERR=10;g.INVALID_STATE_ERR=11;g.SYNTAX_ERR=12;g.INVALID_MODIFICATION_ERR=13;g.NAMESPACE_ERR=14;g.INVALID_ACCESS_ERR=15;g.VALIDATION_ERR=16;g.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=Y;CanvasRenderingContext2D=C;CanvasGradient=x;CanvasPattern=K;DOMException=M}();
|
||||
9266
rus/admin/_V4/_lib/ImageMapster-master/tests/redist/jquery.1.7.1.js
Normal file
9597
rus/admin/_V4/_lib/ImageMapster-master/tests/redist/jquery.1.9.1.js
Normal file
92
rus/admin/_V4/_lib/ImageMapster-master/tests/redist/when.js
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/* when */
|
||||
/** @license MIT License (c) copyright B Cavalier & J Hann */
|
||||
(function(a){a(function(){var g,n,q;function j(){}function c(s){return new Array(s);
|
||||
}g=Object.freeze||function(s){return s;};n=[].reduce||function(x){var t,s,w,v,u;u=0;
|
||||
t=Object(this);v=t.length>>>0;s=arguments;if(s.length<=1){for(;;){if(u in t){w=t[u++];
|
||||
break;}if(++u>=v){throw new TypeError();}}}else{w=s[1];}for(;u<v;++u){if(u in t){w=x(w,t[u],u,t);
|
||||
}}return w;};function l(){}function f(){var v,A,D,w,z,t,s,u;w=[];z=[];t=function F(H,J,L){var G,I,K=arguments.length;
|
||||
while(K){G=arguments[--K];if(G!=null&&typeof G!="function"){throw new Error("callback is not a function");
|
||||
}}I=f();w.push({deferred:I,resolve:H,reject:J});L&&z.push(L);return I.promise;};function E(G,H,I){return t(G,H,I);
|
||||
}function C(G){u("resolve",G);}function B(G){u("reject",G);}s=function(I){var H,G=0;
|
||||
while(H=z[G++]){H(I);}};function y(G){s(G);}u=function(K,J){var I=t;t=function H(L,M){var N=I(L,M);
|
||||
x(K);return N;};u=s=function G(){throw new Error("already completed");};z=q;D=J;x(K);
|
||||
};function x(N){var K,J,M,H,L,I=0;L=w;w=[];while(K=L[I++]){J=K.deferred;H=K[N];try{M=H?H(D):D;
|
||||
if(h(M)){r(M,J.resolve,J.reject,J.progress);}else{J[N](M===q?D:M);}}catch(G){J.reject(G);
|
||||
}}}v=new l();A=new l();A.then=v.then=E;v.promise=g(A);v.resolver=g({resolve:(v.resolve=C),reject:(v.reject=B),progress:(v.progress=y)});
|
||||
if(arguments&&arguments.length){E.apply(null,arguments);}return v;}function h(s){return s&&typeof s.then==="function";
|
||||
}function r(v,s,t,u){var w=k(v);return w.then(s,t,u);}function k(u){var t,s;if(u instanceof l){t=u;
|
||||
}else{s=f();if(h(u)){u.then(s.resolve,s.reject,s.progress);}else{s.resolve(u);}t=s.promise;
|
||||
}return t;}function p(C,x,s,v,B){var J,H,I,u,G,E,w,z,y;z=C.length>>>0;J=Math.max(0,Math.min(x,z));
|
||||
H=[];u=f();I=r(u,s,v,B);function F(K){G(K);}function D(K){E(K);}function A(K){w(K);
|
||||
}function t(){G=E=w=j;}if(!J){u.resolve(H);}else{G=function(K){H.push(K);if(!--J){t();
|
||||
u.resolve(H);}};E=function(K){t();u.reject(K);};w=u.progress;for(y=0;y<z;++y){if(y in C){r(C[y],F,D,A);
|
||||
}}}return I;}function b(w,s,t,u){var x,v;x=c(w.length);v=m(w,o,x);return r(v,s,t,u);
|
||||
}function o(s,u,t){s[t]=u;return s;}function d(v,s,t,u){function w(x){return s(x[0]);
|
||||
}return p(v,1,w,t,u);}function i(u,t){var v,s;s=u.length;v=c(s);for(;s>=0;--s){if(s in u){v[s]=r(u[s],t);
|
||||
}}return m(v,o,v);}function m(u,v,t){var w,s;w=u.length;s=[function(x,z,y){return r(x,function(A){return r(z,function(B){return v(A,B,y,w);
|
||||
});});}];if(arguments.length>=3){s.push(t);}return k(n.apply(u,s));}function e(s,t,u){var v=arguments.length>2;
|
||||
return r(s,function(w){t.resolve(v?u:w);},t.reject,t.progress);}r.defer=f;r.isPromise=h;
|
||||
r.some=p;r.all=b;r.any=d;r.reduce=m;r.map=i;r.chain=e;return r;});})(typeof define=="function"?define:function(a){typeof module!="undefined"?(module.exports=a()):(this.when=a());
|
||||
});
|
||||
|
||||
|
||||
(function(define) {
|
||||
define(['./when'], function(when) {
|
||||
|
||||
var undef;
|
||||
|
||||
/**
|
||||
* Returns a new promise that will automatically reject after msec if
|
||||
* the supplied promise doesn't resolve or reject before that.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* var d = when.defer();
|
||||
* // Setup d however you need
|
||||
*
|
||||
* // return a new promise that will timeout if we don't resolve/reject first
|
||||
* return timeout(d, 1000);
|
||||
*
|
||||
* @param promise anything - any promise or value that should trigger
|
||||
* the returned promise to resolve or reject before the msec timeout
|
||||
* @param msec {Number} timeout in milliseconds
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
return function timeout(promise, msec) {
|
||||
var deferred, timeout;
|
||||
|
||||
deferred = when.defer();
|
||||
|
||||
timeout = setTimeout(function onTimeout() {
|
||||
timeout && deferred.reject(new Error('timed out'));
|
||||
}, msec);
|
||||
|
||||
function cancelTimeout() {
|
||||
clearTimeout(timeout);
|
||||
timeout = undef;
|
||||
}
|
||||
|
||||
when(promise, deferred.resolve, deferred.reject);
|
||||
|
||||
return deferred.then(
|
||||
function(value) {
|
||||
cancelTimeout();
|
||||
return value;
|
||||
},
|
||||
function(reason) {
|
||||
cancelTimeout();
|
||||
throw reason;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
});
|
||||
})(typeof define == 'function'
|
||||
? define
|
||||
: function (deps, factory) { typeof module != 'undefined'
|
||||
? (module.exports = factory(require('./when')))
|
||||
: (this.when_timeout = factory(this.when));
|
||||
}
|
||||
// Boilerplate for AMD, Node, and browser global
|
||||
);
|
||||
1355
rus/admin/_V4/_lib/ImageMapster-master/tests/redist/zepto.js
Normal file
34
rus/admin/_V4/_lib/ImageMapster-master/tests/resize.tests.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*global Test: true, iqtest */
|
||||
/*jslint onevar: false */
|
||||
|
||||
this.tests = this.tests || [];
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("resize","resize feature")
|
||||
.add("Initial binding", function (a, r) {
|
||||
var img = $('img'),
|
||||
map = img.mapster();
|
||||
|
||||
var x=img.width(), y=img.height();
|
||||
|
||||
this.when(function(cb) {
|
||||
map.mapster('resize',200,0,cb);
|
||||
}).then(function() {
|
||||
var expectedHeight = Math.round(200/x*y);
|
||||
a.equals(200,img.width(),"image width is correct after resize");
|
||||
a.equals(expectedHeight,img.height(),"image height is correct after resize");
|
||||
|
||||
var wrapper = img.closest('div');
|
||||
|
||||
a.equals('mapster_wrap',wrapper.attr('id').substring(0,12),"sanity check - we have the wrapper element");
|
||||
a.equals(200,wrapper.width(),"wrapper width matches image width");
|
||||
a.equals(expectedHeight,wrapper.height(),"wrapper height matches image height");
|
||||
});
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
/*global Test: true, iqtest, image, map_options, areas, */
|
||||
/*jslint onevar: false */
|
||||
|
||||
|
||||
|
||||
this.tests = this.tests || [];
|
||||
|
||||
this.tests.push(
|
||||
iqtest.create("tooltips","tests for imagemapster tooltips")
|
||||
.add("Imagemap tooltips", function (a, r) {
|
||||
|
||||
var me=this,
|
||||
getPromise= function(name) {
|
||||
return me.promises(name);
|
||||
},
|
||||
options = $.extend(map_options, {
|
||||
onConfigured: getPromise("configured").resolve
|
||||
}),
|
||||
map = image.mapster(options);
|
||||
|
||||
function setCallback(option,cb) {
|
||||
var obj = {};
|
||||
obj[option]=cb ?
|
||||
function(e) {
|
||||
e = e || {};
|
||||
e.this_context = this;
|
||||
cb(e);
|
||||
}: null;
|
||||
map.mapster('set_options', obj);
|
||||
}
|
||||
|
||||
|
||||
map.mapster('set_options',{
|
||||
areas: [{
|
||||
key: 'TX',
|
||||
toolTip: "Don't mess with Texas",
|
||||
toolTipClose: 'tooltip-click'
|
||||
}]
|
||||
});
|
||||
|
||||
getPromise("configured").then(function() {
|
||||
a.equals(0,$('.mapster_tooltip').length);
|
||||
|
||||
setCallback("onShowToolTip",getPromise("shown1").resolve);
|
||||
$('area[state=TX]').mouseover();
|
||||
|
||||
getPromise("shown1").then(function() {
|
||||
a.equals(1,$('.mapster_tooltip').length,"Tooltip was shown");
|
||||
|
||||
setCallback("onShowToolTip",null);
|
||||
setCallback("onMouseover",getPromise("removed1").resolve);
|
||||
$('area[state=NV]').mouseover();
|
||||
});
|
||||
|
||||
getPromise("removed1").then(function() {
|
||||
a.equals(0,$('.mapster_tooltip').length,"Activating another area removes tooltip");
|
||||
|
||||
setCallback("onMouseover",null);
|
||||
setCallback("onShowToolTip",getPromise("shown2").resolve);
|
||||
$('area[state=TX]').mouseover();
|
||||
});
|
||||
|
||||
getPromise("shown2").then(function() {
|
||||
a.equals(1,$('.mapster_tooltip').length,"Tooltip whas shown again");
|
||||
|
||||
setCallback("onShowToolTip",null);
|
||||
setCallback("onHideToolTip",getPromise("click1").resolve);
|
||||
$('.mapster_tooltip').click();
|
||||
});
|
||||
|
||||
getPromise("click1").then(function() {
|
||||
a.equals(0,$('.mapster_tooltip').length,"Clicking tooltip removes it");
|
||||
getPromise("finished").resolve();
|
||||
});
|
||||
});
|
||||
|
||||
a.resolves(getPromise("finished"),"The last test resolved");
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||