Permalink
Browse files

Merge pull request #3807 from tinoest/SMF2.1-JS

Updating SMF to support jQuery 3.x
  • Loading branch information...
2 parents e5becb3 + eb6e746 commit 01aa553409b8ceff921d2cf95c09d3fa35946a3d @live627 live627 committed on GitHub Jan 11, 2017
View
@@ -2150,13 +2150,13 @@ function loadTheme($id_theme = 0, $initialize = true)
// Add the JQuery library to the list of files to load.
if (isset($modSettings['jquery_source']) && $modSettings['jquery_source'] == 'cdn')
- loadJavaScriptFile('https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', array('external' => true), 'smf_jquery');
+ loadJavaScriptFile('https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js', array('external' => true), 'smf_jquery');
elseif (isset($modSettings['jquery_source']) && $modSettings['jquery_source'] == 'local')
- loadJavaScriptFile('jquery-2.1.4.min.js', array('seed' => false), 'smf_jquery');
+ loadJavaScriptFile('jquery-3.1.1.min.js', array('seed' => false), 'smf_jquery');
elseif (isset($modSettings['jquery_source'], $modSettings['jquery_custom']) && $modSettings['jquery_source'] == 'custom')
- loadJavaScriptFile($modSettings['jquery_custom'], array(), 'smf_jquery');
+ loadJavaScriptFile($modSettings['jquery_custom'], array('external' => true), 'smf_jquery');
// Auto loading? template_javascript() will take care of the local half of this.
else
@@ -3513,4 +3513,4 @@ function set_avatar_data($data = array())
);
}
-?>
+?>
@@ -181,7 +181,7 @@ function show_msg() {
}
function show_progress() {
- $(\'#show_progress\').load("progress.php");
+ $(\'#show_progress\').on("load", "progress.php");
setTimeout(\'show_progress()\', 1500);
}
@@ -268,4 +268,4 @@ function template_attachment_paths()
template_show_list('attach_paths');
}
-?>
+?>
Oops, something went wrong.
Oops, something went wrong.
@@ -188,7 +188,7 @@
removeKeyboardScrolling: function () {
this.$element
.removeAttr('tabindex')
- .unbind("keydown", this.elementKeydown);
+ .off("keydown", this.elementKeydown);
},
bindEvents: function () {
@@ -277,9 +277,9 @@
},
removeMouseMoveScrolling: function () {
- this.$thumb.unbind();
- $(document).unbind("mouseup", this.documentMouseup);
- $(document).unbind("mousemove", this.documentMousemove);
+ this.$thumb.off();
+ $(document).off("mouseup", this.documentMouseup);
+ $(document).off("mousemove", this.documentMousemove);
},
initMouseWheelScrolling: function () {
@@ -293,7 +293,7 @@
},
removeMouseWheelScrolling: function () {
- this.scrollable.$element.unbind("mousewheel");
+ this.scrollable.$element.off("mousewheel");
},
initTouchScrolling: function () {
@@ -332,7 +332,7 @@
},
removeMouseClickScrolling: function () {
- this.$scrollBar.unbind("click", this.scrollBarClick);
+ this.$scrollBar.off("click", this.scrollBarClick);
},
initWindowResize: function () {
@@ -346,7 +346,7 @@
},
removeWindowResize: function () {
- $(window).unbind("resize", this.windowResize);
+ $(window).off("resize", this.windowResize);
},
isKeyScrolling: function (key) {
@@ -764,11 +764,11 @@
$.fn.extend({
mousewheel: function (fn) {
- return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
+ return fn ? this.on("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function (fn) {
- return this.unbind("mousewheel", fn);
+ return this.off("mousewheel", fn);
}
});
Oops, something went wrong.
@@ -172,14 +172,14 @@
// create the tip move with the cursor
if (oSettings.followMouse)
{
- $(this).bind("mousemove", function(event){
+ $(this).on("mousemove", function(event){
positionTooltip(event);
return false;
});
}
// clear the tip on a click
- $(this).bind("click", function(event){
+ $(this).on("click", function(event){
hideTooltip(this);
return true;
});
@@ -757,4 +757,4 @@ $(function() {
$( '.hide_popup' ).click(function() {
$( '#mobile_user_menu' ).hide();
});
-});
+});
View
@@ -1794,7 +1794,7 @@ function template_install_above()
<link rel="stylesheet" href="Themes/default/css/install.css?alp21">
', $txt['lang_rtl'] == true ? '<link rel="stylesheet" href="Themes/default/css/rtl.css?alp21">' : '', '
- <script src="Themes/default/scripts/jquery-2.1.4.min.js"></script>
+ <script src="Themes/default/scripts/jquery-3.1.1.min.js"></script>
<script src="Themes/default/scripts/script.js"></script>
</head>
<body><div id="footerfix">

0 comments on commit 01aa553

Please sign in to comment.