Skip to content

Commit

Permalink
Zepto, some minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietre committed Oct 28, 2011
1 parent ee8bf12 commit 48125a6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
18 changes: 9 additions & 9 deletions examples/usa.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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>

<ignore type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></ignore>
<script type="text/javascript" src="../../zepto/zepto.js"></script>
<script type="text/javascript" src="../../zepto/event.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="../jquery.imagemapster.js"></script>

<STYLE TYPE="text/css">
Expand Down Expand Up @@ -52,9 +52,9 @@


<div id="map_demo" style="width:920px; height:1000px;">


<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" >
<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>

Expand Down Expand Up @@ -139,7 +139,7 @@ <h1>Highlight Types</h1>
</div>

<script type="text/javascript">
(function($) {
(function($) {
if ($) {
$.fn.prop=$.fn.attr;
$.fn.animate = function(target) {
Expand Down Expand Up @@ -231,7 +231,7 @@ <h1>Highlight Types</h1>
$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>');
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);
}
Expand Down Expand Up @@ -374,9 +374,9 @@ <h1>Highlight Types</h1>
bindlinks();
$.mapster.impl.init();
$usamap.mapster(default_options);


});

});


// Utility functions
Expand Down
21 changes: 13 additions & 8 deletions jquery.imagemapster.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* ImageMapster 1.2.5 b23
/* ImageMapster 1.2.5 b24
Copyright 2011 James Treworgy
http://www.outsharked.com/imagemapster
https://github.com/jamietre/ImageMapster
Expand All @@ -8,6 +7,9 @@ A jQuery plugin to enhance image maps.
*/
/*
version 1.2.5
-- zepto compatible now
-- bug with rebinding
-- another safari problem attempt. looking good.
-- remove "attrmatches" to save space
-- offset 1 pixel strokes by 0.5 px to prevent the fuzzies
-- inore UI events during resize - causes issues
Expand Down Expand Up @@ -110,8 +112,6 @@ if (window.Zepto) {
} (jQuery));
}



(function ($) {
var methods;
$.fn.isJquery = $.fn.isJquery || true;
Expand All @@ -126,7 +126,7 @@ if (window.Zepto) {
};

$.mapster = {};
$.mapster.version = "1.2.5b23";
$.mapster.version = "1.2.5b24";
// utility functions
$.mapster.utils = {
// return four outer corners
Expand Down Expand Up @@ -716,6 +716,9 @@ if (window.Zepto) {
this.imgCssText = image.style.cssText || null;

this.initializeDefaults();
this.mousedown = function (e) {
e.preventDefault();
};

this.mouseover = function (e) {
var ar = me.getDataForArea(this), opts;
Expand Down Expand Up @@ -1280,7 +1283,8 @@ if (window.Zepto) {
if (!mapArea.nohref) {
$area.bind('mouseover.mapster', me.mouseover)
.bind('mouseout.mapster', me.mouseout)
.bind('click.mapster', me.click);
.bind('click.mapster', me.click)
.bind('mousedown.mapster', me.mousedown);
}
// Create a key if none was assigned by the user

Expand Down Expand Up @@ -1414,7 +1418,7 @@ if (window.Zepto) {

// release refs to DOM elements
u.each(this.data, function () {
//this.reset(preserveState);
this.reset(preserveState);
});
this.data = null;
if (!preserveState) {
Expand Down Expand Up @@ -2503,12 +2507,13 @@ if (window.Zepto) {
map_data = get_map_data(this);
// if already bound completely, do a total rebind
if (map_data) {
img.unbind();
me.unbind.apply(img);
if (!map_data.complete) {
// will be queued
img.bind();
return true;
}
map_data=null;
}

// ensure it's a valid image
Expand Down
8 changes: 8 additions & 0 deletions jquery.imagemapster.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions tests/test.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html >
<!DOCTYPE html >
<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.6.0/jquery.js"></script>
<script type="text/javascript" src="excanvas.min.js"></script>
<ignore type="text/javascript" src="../../zepto/zepto.js"></ignore >
<ignore type="text/javascript" src="../../zepto/event.js"></ignore >
<ignore type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></ignore>
<ignore type="text/javascript" src="excanvas.min.js"></ignore>
<script type="text/javascript" src="../../zepto/patched/zepto.js"></script>
<script type="text/javascript" src="../../zepto/patched/event.js"></script>
<script type="text/javascript" src="../jquery.imagemapster.js"></script>
<script type="text/javascript" src="simple-test.js"></script>
<script type="text/javascript" src="jquery.imagemapster.tests.js"></script>
Expand Down

0 comments on commit 48125a6

Please sign in to comment.