Skip to content

Commit eaa3bbd

Browse files
authored
Merge pull request #24 from hartman/jquery3
Make jQuery 3 compatible
2 parents add2914 + 570884c commit eaa3bbd

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
e.source.postMessage('1,1','*');
4242
}
4343
}
44-
$(window).bind('message',wmaMessageHub);
44+
$(window).on('message',wmaMessageHub);
4545
</script>
4646
</head>
4747
<body>

index_dev.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
e.source.postMessage('1,1','*');
1919
}
2020
}
21-
$(window).bind('message',wmaMessageHub);
21+
$(window).on('message',wmaMessageHub);
2222
</script>
2323
</head>
2424
<body>

wikiminiatlas.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ jQuery(function ($) {
488488
}
489489
}
490490

491-
mapbutton.bind( 'click', { param:
491+
mapbutton.on( 'click', { param:
492492
marker.lat + '_' + marker.lon + '_' +
493493
wc.width + '_' + wc.height + '_' +
494494
site + '_' + zoomlevel + '_' + language + '&globe=' + globe }, showIFrame );
@@ -507,7 +507,7 @@ jQuery(function ($) {
507507
.css('padding', rtl ? '0px 3px 0px 0px' : '0px 0px 0px 3px' ).css('cursor', 'pointer')
508508
.attr('src', wc.buttonImage).attr('srcset', wc.buttonImage + ' 1x, ' + wc.buttonImage2x + ' 2x')
509509
.addClass('wmamapbutton noprint')
510-
.bind( 'click', { param:
510+
.on( 'click', { param:
511511
alat + '_' + alon + '_' +
512512
wc.width + '_' + wc.height + '_' +
513513
site + '_' + zoomlevel + '_' + language
@@ -691,13 +691,13 @@ jQuery(function ($) {
691691
adjusthelper();
692692

693693
$('body')
694-
.bind('mouseup.wmaresize', function(e) {
695-
$('body').unbind('mousemove.wmaresize');
696-
$('body').unbind('mouseup.wmaresize');
694+
.on('mouseup.wmaresize', function(e) {
695+
$('body').off('mousemove.wmaresize');
696+
$('body').off('mouseup.wmaresize');
697697
idle = true;
698698
wi.resizehelper.hide();
699699
} )
700-
.bind('mousemove.wmaresize', function(e) {
700+
.on('mousemove.wmaresize', function(e) {
701701
wc.width -= dir*(e.pageX-lastx);
702702
wc.height += (e.pageY-lasty);
703703
lastx = e.pageX; lasty = e.pageY;
@@ -713,7 +713,7 @@ jQuery(function ($) {
713713
);
714714
})();
715715

716-
$(window).bind('message', messageHub);
716+
$(window).on('message', messageHub);
717717

718718
// Fire event for other code to extend or integrate with WMA
719719
if (initPromises.length) {

wmacore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function wikiminiatlasInstall(wma_widget, url_params)
708708
$(document).on('keydown', wmaKeypress);
709709
$(document).on('contextmenu', function() { return false; });
710710

711-
$('body').bind('dragstart', function() { return false; })
711+
$('body').on('dragstart', function() { return false; })
712712
$('#wma_map').click(function(e) {
713713
// only count clicks if the mouse pointer has not moved between mouse down and mouse up!
714714
var r = wmaMouseCoords(e); //TODO: VERIFY this!!!!
@@ -797,7 +797,7 @@ function wikiminiatlasInstall(wma_widget, url_params)
797797
// initialize message passing
798798
if (window.postMessage)
799799
{
800-
$(window).bind('message', wmaReceiveMessage);
800+
$(window).on('message', wmaReceiveMessage);
801801
if (window != window.top)
802802
{
803803
try {

wmacore_dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function wikiminiatlasInstall(wma_widget, url_params)
708708
$(document).on('keydown', wmaKeypress);
709709
$(document).on('contextmenu', function() { return false; });
710710

711-
$('body').bind('dragstart', function() { return false; })
711+
$('body').on('dragstart', function() { return false; })
712712
$('#wma_map').click(function(e) {
713713
// only count clicks if the mouse pointer has not moved between mouse down and mouse up!
714714
var r = wmaMouseCoords(e); //TODO: VERIFY this!!!!
@@ -797,7 +797,7 @@ function wikiminiatlasInstall(wma_widget, url_params)
797797
// initialize message passing
798798
if (window.postMessage)
799799
{
800-
$(window).bind('message', wmaReceiveMessage);
800+
$(window).on('message', wmaReceiveMessage);
801801
if (window != window.top)
802802
{
803803
try {

0 commit comments

Comments
 (0)