Уборка Unreachable statement. Замена === на == и !== на != в яваскриптах из-за ошибок с нестрогой типизацией при переходе на 7.4.
This commit is contained in:
+3
-3
File diff suppressed because one or more lines are too long
+5
-5
@@ -16,8 +16,8 @@ function bodyLoaded() {
|
||||
//генерируем смайлики
|
||||
let i = 0,
|
||||
j = '';
|
||||
while (i !== -1) {
|
||||
if (top.sml[i] !== undefined) {
|
||||
while (i != -1) {
|
||||
if (top.sml[i] != undefined) {
|
||||
j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${top.sml[i]}\')" src="https://${c['img']}/i/smile/${top.sml[i]}.gif" width="${top.sml[i + 1]}" height="${top.sml[i + 2]}" title=":${top.sml[i]}:"/> `;
|
||||
} else i = -4;
|
||||
i += 3;
|
||||
@@ -28,7 +28,7 @@ function bodyLoaded() {
|
||||
|
||||
function startEngine() {
|
||||
//стандартные настройки
|
||||
if ($.cookie('chatCfg0') === undefined) {
|
||||
if ($.cookie('chatCfg0') == undefined) {
|
||||
$.cookie('chatCfg0', 2, {expires: 320});
|
||||
$.cookie('chatCfg1', 'Black', {expires: 320});
|
||||
}
|
||||
@@ -103,12 +103,12 @@ function saveChatConfig() {
|
||||
var i = 0;
|
||||
while (i != -1) {
|
||||
if ($('#chcf' + i).attr('id') != undefined) {
|
||||
if (i < 2 || i === 8) {
|
||||
if (i < 2 || i == 8) {
|
||||
$.cookie(`chatCfg${i}`, $(`#chcf${i}`).val(), {
|
||||
expires: 320
|
||||
});
|
||||
} else {
|
||||
if ($(`#chcf${i}`).attr('checked') === true) {
|
||||
if ($(`#chcf${i}`).attr('checked') == true) {
|
||||
$.cookie(`chatCfg${i}`, 1, {
|
||||
expires: 320
|
||||
});
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+44
-44
@@ -8,9 +8,9 @@
|
||||
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object' && typeof require === 'function') {
|
||||
} else if (typeof exports == 'object' && typeof require == 'function') {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
@@ -75,11 +75,11 @@
|
||||
triggerSelectOnValidInput: true,
|
||||
preventBadQueries: true,
|
||||
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
|
||||
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
|
||||
return suggestion.value.toLowerCase().indexOf(queryLowerCase) != -1;
|
||||
},
|
||||
paramName: 'query',
|
||||
transformResult: function (response) {
|
||||
return typeof response === 'string' ? $.parseJSON(response) : response;
|
||||
return typeof response == 'string' ? $.parseJSON(response) : response;
|
||||
},
|
||||
showNoSuggestionNotice: false,
|
||||
noSuggestionNotice: 'No results',
|
||||
@@ -140,7 +140,7 @@
|
||||
that.element.setAttribute('autocomplete', 'off');
|
||||
|
||||
that.killerFn = function (e) {
|
||||
if ($(e.target).closest('.' + that.options.containerClass).length === 0) {
|
||||
if ($(e.target).closest('.' + that.options.containerClass).length == 0) {
|
||||
that.killSuggestions();
|
||||
that.disableKillerFn();
|
||||
}
|
||||
@@ -157,7 +157,7 @@
|
||||
container.appendTo(options.appendTo);
|
||||
|
||||
// Only set width if it was provided:
|
||||
if (options.width !== 'auto') {
|
||||
if (options.width != 'auto') {
|
||||
container.width(options.width);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
containerParent = $container.parent().get(0);
|
||||
// Fix position automatically when appended to body.
|
||||
// In other cases force parameter must be given.
|
||||
if (containerParent !== document.body && !that.options.forceFixPosition) {
|
||||
if (containerParent != document.body && !that.options.forceFixPosition) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,16 +271,16 @@
|
||||
offset = that.el.offset(),
|
||||
styles = { 'top': offset.top, 'left': offset.left };
|
||||
|
||||
if (orientation === 'auto') {
|
||||
if (orientation == 'auto') {
|
||||
var viewPortHeight = $(window).height(),
|
||||
scrollTop = $(window).scrollTop(),
|
||||
topOverflow = -scrollTop + offset.top - containerHeight,
|
||||
bottomOverflow = scrollTop + viewPortHeight - (offset.top + height + containerHeight);
|
||||
|
||||
orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow) ? 'top' : 'bottom';
|
||||
orientation = (Math.max(topOverflow, bottomOverflow) == topOverflow) ? 'top' : 'bottom';
|
||||
}
|
||||
|
||||
if (orientation === 'top') {
|
||||
if (orientation == 'top') {
|
||||
styles.top += -containerHeight;
|
||||
} else {
|
||||
styles.top += height;
|
||||
@@ -288,7 +288,7 @@
|
||||
|
||||
// If container is not positioned to body,
|
||||
// correct its position using offset parent offset
|
||||
if(containerParent !== document.body) {
|
||||
if(containerParent != document.body) {
|
||||
var opacity = $container.css('opacity'),
|
||||
parentOffsetDiff;
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
}
|
||||
|
||||
// -2px to account for suggestions border.
|
||||
if (that.options.width === 'auto') {
|
||||
if (that.options.width == 'auto') {
|
||||
styles.width = (that.el.outerWidth() - 2) + 'px';
|
||||
}
|
||||
|
||||
@@ -342,13 +342,13 @@
|
||||
selectionStart = that.element.selectionStart,
|
||||
range;
|
||||
|
||||
if (typeof selectionStart === 'number') {
|
||||
return selectionStart === valLength;
|
||||
if (typeof selectionStart == 'number') {
|
||||
return selectionStart == valLength;
|
||||
}
|
||||
if (document.selection) {
|
||||
range = document.selection.createRange();
|
||||
range.moveStart('character', -valLength);
|
||||
return valLength === range.text.length;
|
||||
return valLength == range.text.length;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@@ -357,7 +357,7 @@
|
||||
var that = this;
|
||||
|
||||
// If suggestions are hidden and user presses arrow down, display suggestions:
|
||||
if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
|
||||
if (!that.disabled && !that.visible && e.which == keys.DOWN && that.currentValue) {
|
||||
that.suggest();
|
||||
return;
|
||||
}
|
||||
@@ -382,17 +382,17 @@
|
||||
that.selectHint();
|
||||
return;
|
||||
}
|
||||
if (that.selectedIndex === -1) {
|
||||
if (that.selectedIndex == -1) {
|
||||
that.hide();
|
||||
return;
|
||||
}
|
||||
that.select(that.selectedIndex);
|
||||
if (that.options.tabDisabled === false) {
|
||||
if (that.options.tabDisabled == false) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case keys.RETURN:
|
||||
if (that.selectedIndex === -1) {
|
||||
if (that.selectedIndex == -1) {
|
||||
that.hide();
|
||||
return;
|
||||
}
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
clearInterval(that.onChangeInterval);
|
||||
|
||||
if (that.currentValue !== that.el.val()) {
|
||||
if (that.currentValue != that.el.val()) {
|
||||
that.findBestHint();
|
||||
if (that.options.deferRequestBy > 0) {
|
||||
// Defer lookup in case when value changes very quickly:
|
||||
@@ -448,7 +448,7 @@
|
||||
query = that.getQuery(value),
|
||||
index;
|
||||
|
||||
if (that.selection && that.currentValue !== query) {
|
||||
if (that.selection && that.currentValue != query) {
|
||||
that.selection = null;
|
||||
(options.onInvalidateSelection || $.noop).call(that.element);
|
||||
}
|
||||
@@ -460,7 +460,7 @@
|
||||
// Check existing suggestion for the match before proceeding:
|
||||
if (options.triggerSelectOnValidInput) {
|
||||
index = that.findSuggestionIndex(query);
|
||||
if (index !== -1) {
|
||||
if (index != -1) {
|
||||
that.select(index);
|
||||
return;
|
||||
}
|
||||
@@ -479,7 +479,7 @@
|
||||
queryLowerCase = query.toLowerCase();
|
||||
|
||||
$.each(that.suggestions, function (i, suggestion) {
|
||||
if (suggestion.value.toLowerCase() === queryLowerCase) {
|
||||
if (suggestion.value.toLowerCase() == queryLowerCase) {
|
||||
index = i;
|
||||
return false;
|
||||
}
|
||||
@@ -532,7 +532,7 @@
|
||||
options.params[options.paramName] = q;
|
||||
params = options.ignoreParams ? null : options.params;
|
||||
|
||||
if (options.onSearchStart.call(that.element, options.params) === false) {
|
||||
if (options.onSearchStart.call(that.element, options.params) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@
|
||||
i = badQueries.length;
|
||||
|
||||
while (i--) {
|
||||
if (q.indexOf(badQueries[i]) === 0) {
|
||||
if (q.indexOf(badQueries[i]) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -614,7 +614,7 @@
|
||||
},
|
||||
|
||||
suggest: function () {
|
||||
if (this.suggestions.length === 0) {
|
||||
if (this.suggestions.length == 0) {
|
||||
if (this.options.showNoSuggestionNotice) {
|
||||
this.noSuggestions();
|
||||
} else {
|
||||
@@ -638,7 +638,7 @@
|
||||
formatGroup = function (suggestion, index) {
|
||||
var currentCategory = suggestion.data[groupBy];
|
||||
|
||||
if (category === currentCategory){
|
||||
if (category == currentCategory){
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@
|
||||
|
||||
if (options.triggerSelectOnValidInput) {
|
||||
index = that.findSuggestionIndex(value);
|
||||
if (index !== -1) {
|
||||
if (index != -1) {
|
||||
that.select(index);
|
||||
return;
|
||||
}
|
||||
@@ -717,7 +717,7 @@
|
||||
// because if instance was created before input had width, it will be zero.
|
||||
// Also it adjusts if input width has changed.
|
||||
// -2px to account for suggestions border.
|
||||
if (options.width === 'auto') {
|
||||
if (options.width == 'auto') {
|
||||
width = that.el.outerWidth() - 2;
|
||||
container.width(width > 0 ? width : 300);
|
||||
}
|
||||
@@ -733,7 +733,7 @@
|
||||
}
|
||||
|
||||
$.each(that.suggestions, function (i, suggestion) {
|
||||
var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
|
||||
var foundMatch = suggestion.value.toLowerCase().indexOf(value) == 0;
|
||||
if (foundMatch) {
|
||||
bestMatch = suggestion;
|
||||
}
|
||||
@@ -749,7 +749,7 @@
|
||||
if (suggestion) {
|
||||
hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);
|
||||
}
|
||||
if (that.hintValue !== hintValue) {
|
||||
if (that.hintValue != hintValue) {
|
||||
that.hintValue = hintValue;
|
||||
that.hint = suggestion;
|
||||
(this.options.onHint || $.noop)(hintValue);
|
||||
@@ -758,7 +758,7 @@
|
||||
|
||||
verifySuggestionsFormat: function (suggestions) {
|
||||
// If suggestions is string array, convert them to supported format:
|
||||
if (suggestions.length && typeof suggestions[0] === 'string') {
|
||||
if (suggestions.length && typeof suggestions[0] == 'string') {
|
||||
return $.map(suggestions, function (value) {
|
||||
return { value: value, data: null };
|
||||
});
|
||||
@@ -770,7 +770,7 @@
|
||||
validateOrientation: function(orientation, fallback) {
|
||||
orientation = $.trim(orientation || '').toLowerCase();
|
||||
|
||||
if($.inArray(orientation, ['auto', 'bottom', 'top']) === -1){
|
||||
if($.inArray(orientation, ['auto', 'bottom', 'top']) == -1){
|
||||
orientation = fallback;
|
||||
}
|
||||
|
||||
@@ -786,13 +786,13 @@
|
||||
// Cache results if cache is not disabled:
|
||||
if (!options.noCache) {
|
||||
that.cachedResponse[cacheKey] = result;
|
||||
if (options.preventBadQueries && result.suggestions.length === 0) {
|
||||
if (options.preventBadQueries && result.suggestions.length == 0) {
|
||||
that.badQueries.push(originalQuery);
|
||||
}
|
||||
}
|
||||
|
||||
// Return if originalQuery is not matching current query:
|
||||
if (originalQuery !== that.getQuery(that.currentValue)) {
|
||||
if (originalQuery != that.getQuery(that.currentValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -811,7 +811,7 @@
|
||||
|
||||
that.selectedIndex = index;
|
||||
|
||||
if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
|
||||
if (that.selectedIndex != -1 && children.length > that.selectedIndex) {
|
||||
activeItem = children.get(that.selectedIndex);
|
||||
$(activeItem).addClass(selected);
|
||||
return activeItem;
|
||||
@@ -836,11 +836,11 @@
|
||||
moveUp: function () {
|
||||
var that = this;
|
||||
|
||||
if (that.selectedIndex === -1) {
|
||||
if (that.selectedIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (that.selectedIndex === 0) {
|
||||
if (that.selectedIndex == 0) {
|
||||
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
|
||||
that.selectedIndex = -1;
|
||||
that.el.val(that.currentValue);
|
||||
@@ -854,7 +854,7 @@
|
||||
moveDown: function () {
|
||||
var that = this;
|
||||
|
||||
if (that.selectedIndex === (that.suggestions.length - 1)) {
|
||||
if (that.selectedIndex == (that.suggestions.length - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@
|
||||
|
||||
that.currentValue = that.getValue(suggestion.value);
|
||||
|
||||
if (that.currentValue !== that.el.val() && !that.options.preserveInput) {
|
||||
if (that.currentValue != that.el.val() && !that.options.preserveInput) {
|
||||
that.el.val(that.currentValue);
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@
|
||||
currentValue = that.currentValue;
|
||||
parts = currentValue.split(delimiter);
|
||||
|
||||
if (parts.length === 1) {
|
||||
if (parts.length == 1) {
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@
|
||||
var dataKey = 'autocomplete';
|
||||
// If function invoked without argument return
|
||||
// instance of the first matched element:
|
||||
if (arguments.length === 0) {
|
||||
if (arguments.length == 0) {
|
||||
return this.first().data(dataKey);
|
||||
}
|
||||
|
||||
@@ -952,8 +952,8 @@
|
||||
var inputElement = $(this),
|
||||
instance = inputElement.data(dataKey);
|
||||
|
||||
if (typeof options === 'string') {
|
||||
if (instance && typeof instance[options] === 'function') {
|
||||
if (typeof options == 'string') {
|
||||
if (instance && typeof instance[options] == 'function') {
|
||||
instance[options](args);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
} else if (typeof exports == 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
if (s.indexOf('"') == 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
if (arguments.length > 1 && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
if (typeof options.expires == 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
@@ -87,14 +87,14 @@
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
if (key && key == name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
if (!key && (cookie = read(cookie)) != undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
if ($.cookie(key) == undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
if (value == null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
|
||||
Vendored
+422
-422
File diff suppressed because it is too large
Load Diff
+13
-13
@@ -97,7 +97,7 @@
|
||||
|
||||
d.isopera = ("opera" in window);
|
||||
d.isopera12 = (d.isopera&&("getUserMedia" in navigator));
|
||||
d.isoperamini = (Object.prototype.toString.call(window.operamini) === "[object OperaMini]");
|
||||
d.isoperamini = (Object.prototype.toString.call(window.operamini) == "[object OperaMini]");
|
||||
|
||||
d.isie = (("all" in document) && ("attachEvent" in domtest) && !d.isopera);
|
||||
d.isieold = (d.isie && !("msInterpolationMode" in domtest.style)); // IE6 and older
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
d.hasmousecapture = ("setCapture" in domtest);
|
||||
|
||||
d.hasMutationObserver = (clsMutationObserver !== false);
|
||||
d.hasMutationObserver = (clsMutationObserver != false);
|
||||
|
||||
domtest = null; //memory released
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
this.doc = self.opt.doc;
|
||||
this.iddoc = (this.doc&&this.doc[0])?this.doc[0].id||'':'';
|
||||
this.ispage = /BODY|HTML/.test((self.opt.win)?self.opt.win[0].nodeName:this.doc[0].nodeName);
|
||||
this.haswrapper = (self.opt.win!==false);
|
||||
this.haswrapper = (self.opt.win!=false);
|
||||
this.win = self.opt.win||(this.ispage?$(window):this.doc);
|
||||
this.docscroll = (this.ispage&&!this.haswrapper)?$(window):this.win;
|
||||
this.body = $("body");
|
||||
@@ -545,7 +545,7 @@
|
||||
while (el && el.id != id) {
|
||||
el = el.parentNode||false;
|
||||
}
|
||||
return (el!==false);
|
||||
return (el!=false);
|
||||
};
|
||||
|
||||
function getZIndex() {
|
||||
@@ -851,12 +851,12 @@
|
||||
|
||||
}
|
||||
|
||||
if (self.opt.autohidemode===false) {
|
||||
if (self.opt.autohidemode==false) {
|
||||
self.autohidedom = false;
|
||||
self.rail.css({opacity:self.opt.cursoropacitymax});
|
||||
if (self.railh) self.railh.css({opacity:self.opt.cursoropacitymax});
|
||||
}
|
||||
else if (self.opt.autohidemode===true) {
|
||||
else if (self.opt.autohidemode==true) {
|
||||
self.autohidedom = $().add(self.rail);
|
||||
if (cap.isie8) self.autohidedom=self.autohidedom.add(self.cursor);
|
||||
if (self.railh) self.autohidedom=self.autohidedom.add(self.railh);
|
||||
@@ -1603,7 +1603,7 @@
|
||||
|
||||
if (!self.ispage&&!self.haswrapper) {
|
||||
// redesigned MutationObserver for Chrome18+/Firefox14+/iOS6+ with support for: remove div, add/remove content
|
||||
if (clsMutationObserver !== false) {
|
||||
if (clsMutationObserver != false) {
|
||||
self.observer = new clsMutationObserver(function(mutations) {
|
||||
mutations.forEach(self.onAttributeChange);
|
||||
});
|
||||
@@ -1735,7 +1735,7 @@
|
||||
}
|
||||
|
||||
if (!self.rail.drag||self.rail.drag.pt!=1) {
|
||||
if ((typeof py != "undefined")&&(py!==false)) {
|
||||
if ((typeof py != "undefined")&&(py!=false)) {
|
||||
self.scroll.y = Math.round(py * 1/self.scrollratio.y);
|
||||
}
|
||||
if (typeof px != "undefined") {
|
||||
@@ -2004,7 +2004,7 @@
|
||||
e.pageX = e.clientX + document.documentElement.scrollLeft;
|
||||
e.pageY = e.clientY + document.documentElement.scrollTop;
|
||||
}
|
||||
return ((fn.call(el,e)===false)||bubble===false) ? self.cancelEvent(e) : true;
|
||||
return ((fn.call(el,e)==false)||bubble==false) ? self.cancelEvent(e) : true;
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -2104,8 +2104,8 @@
|
||||
|
||||
if (cap.isie9) self.win[0].detachEvent("onpropertychange",self.onAttributeChange); //IE9 DOMAttrModified bug
|
||||
|
||||
if (self.observer !== false) self.observer.disconnect();
|
||||
if (self.observerremover !== false) self.observerremover.disconnect();
|
||||
if (self.observer != false) self.observer.disconnect();
|
||||
if (self.observerremover != false) self.observerremover.disconnect();
|
||||
|
||||
self.events = null;
|
||||
|
||||
@@ -2136,7 +2136,7 @@
|
||||
var lst = $.nicescroll;
|
||||
lst.each(function(i){
|
||||
if (!this) return;
|
||||
if(this.id === self.id) {
|
||||
if(this.id == self.id) {
|
||||
delete lst[i];
|
||||
for(var b=++i;b<lst.length;b++,i++) lst[i]=lst[b];
|
||||
lst.length--;
|
||||
@@ -2496,7 +2496,7 @@
|
||||
}
|
||||
|
||||
this.doScrollPos = function(x,y,spd) { //no-trans
|
||||
var y = ((typeof y == "undefined")||(y===false)) ? self.getScrollTop(true) : y;
|
||||
var y = ((typeof y == "undefined")||(y==false)) ? self.getScrollTop(true) : y;
|
||||
|
||||
if ((self.timer)&&(self.newscrolly==y)&&(self.newscrollx==x)) return true;
|
||||
|
||||
|
||||
+10
-10
@@ -216,7 +216,7 @@ var chat = {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof window.online_send_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) {
|
||||
if (typeof window.online_send_jqxhr == "undefined" || window.online_jqxhr.readyState == 4) {
|
||||
window.online_send_jqxhr = $.post('online.php?r' + c.rnd + '&cas' + ((new Date().getTime()) + Math.random()), {
|
||||
msg: textmsg,
|
||||
key: this.key,
|
||||
@@ -339,7 +339,7 @@ var chat = {
|
||||
}
|
||||
if (this.nozpros == 0) {
|
||||
|
||||
if (typeof window.online_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) {
|
||||
if (typeof window.online_jqxhr == "undefined" || window.online_jqxhr.readyState == 4) {
|
||||
window.online_jqxhr = $.getJSON(`online.php?r${c.rnd}&cas${((new Date().getTime()) + Math.random())}`, {key: this.key, mid: this.msg_id, r1: aot[0], r2: aot[1], r3: aot[2], rndo: c.rnd}, function (data) {
|
||||
if (data.rnd != null) {
|
||||
chat.genchatData(data);
|
||||
@@ -524,8 +524,8 @@ var chat = {
|
||||
sendMsg: function(data) {
|
||||
|
||||
|
||||
// Если системное сообщение от моба - длина массива === 10
|
||||
// Иначе - длина массива === 17
|
||||
// Если системное сообщение от моба - длина массива == 10
|
||||
// Иначе - длина массива == 17
|
||||
|
||||
// data[0] - какое-то число
|
||||
// data[1] - видимо номер сообщения в чате за всё время
|
||||
@@ -668,7 +668,7 @@ var chat = {
|
||||
if (data[6] != 'Black' && data[6] != '') {
|
||||
|
||||
var voiceMessageReg = data[5].match(/audio_[0-9]{10}[.]mp3/g)
|
||||
if (voiceMessageReg !== null) {
|
||||
if (voiceMessageReg != null) {
|
||||
msg += `<font color="${data[6]}">
|
||||
<audio id="audioPlayerChat" controls style="width:300px;max-width:400px;" height="20px";>
|
||||
<source src="/audio/${voiceMessageReg[0]}" type="audio/mp3">
|
||||
@@ -678,7 +678,7 @@ var chat = {
|
||||
}
|
||||
else {
|
||||
|
||||
if (data.length === 10) {
|
||||
if (data.length == 10) {
|
||||
msg += `<font color="${data[6]}">${data[5]}</font>`;
|
||||
}
|
||||
else {
|
||||
@@ -689,7 +689,7 @@ var chat = {
|
||||
} else {
|
||||
|
||||
var voiceMessageReg = data[5].match(/audio_[0-9]{10}[.]mp3/g)
|
||||
if (voiceMessageReg !== null) {
|
||||
if (voiceMessageReg != null) {
|
||||
msg += `<audio id="audioPlayerChat" controls style="width:300px;max-width:400px;" height="20px";>
|
||||
<source src="/audio/${voiceMessageReg[0]}" type="audio/mp3">
|
||||
</audio>`
|
||||
@@ -977,11 +977,11 @@ var chat = {
|
||||
|
||||
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
|
||||
|
||||
if (isInternetExplorer && window.document["Sound"] && typeof window.document["Sound"].SetVariable !== "undefined") {
|
||||
if (isInternetExplorer && window.document["Sound"] && typeof window.document["Sound"].SetVariable != "undefined") {
|
||||
window.document["Sound"].SetVariable("Volume", svolm);
|
||||
window.document["Sound"].SetVariable("Sndplay", s);
|
||||
}
|
||||
else if(document.getElementById('Sound2') && typeof document.getElementById('Sound2').SetVariable !== "undefined") {
|
||||
else if(document.getElementById('Sound2') && typeof document.getElementById('Sound2').SetVariable != "undefined") {
|
||||
document.getElementById('Sound2').SetVariable("Volume", svolm);
|
||||
document.getElementById('Sound2').SetVariable("Sndplay", s);
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ var chat = {
|
||||
var timerMlSecMessage = 1
|
||||
|
||||
setIntervalSound = setTimeout(function tickMlsec() {
|
||||
if (timerSecMessage === 60) {
|
||||
if (timerSecMessage == 60) {
|
||||
flagVoice = !flagVoice
|
||||
|
||||
chat.styleRecordButton({
|
||||
|
||||
@@ -4,7 +4,7 @@ import { allowRender, cleanState, setStep } from './redux/actions.js';
|
||||
import { dispatch, getState, subscribe } from './redux/store.js';
|
||||
|
||||
const openRegistrationTrainingModal = () => {
|
||||
if (localStorage.getItem('modalTest') === 'kravich') {
|
||||
if (localStorage.getItem('modalTest') == 'kravich') {
|
||||
createModalElements();
|
||||
dispatch(allowRender());
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,18 +6,18 @@ const training_handler = () => {
|
||||
return condition ? '/api/training/complete' : '/api/training/go_back';
|
||||
};
|
||||
|
||||
request.open('POST', url(training_data().answer === null || training_data().answer === get_user_answer()))
|
||||
request.open('POST', url(training_data().answer == null || training_data().answer == get_user_answer()))
|
||||
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
||||
request.onreadystatechange = function () {//Call a function when the state changes.
|
||||
if (request.readyState === 4) {
|
||||
if(request.status === 200) {
|
||||
if (request.readyState == 4) {
|
||||
if(request.status == 200) {
|
||||
parent.frames['main'].location.reload();
|
||||
}
|
||||
|
||||
if(request.responseText !== '') {
|
||||
if(request.responseText != '') {
|
||||
let response = JSON.parse(request.responseText);
|
||||
|
||||
if (response.message !== undefined) {
|
||||
if (response.message != undefined) {
|
||||
alert(response.message);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ const training_handler = () => {
|
||||
}
|
||||
|
||||
function get_user_answer() {
|
||||
if(training_data().answer === '') {
|
||||
if(training_data().answer == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ function get_user_answer() {
|
||||
}
|
||||
|
||||
(function () {
|
||||
if (typeof window.CustomEvent === "function") return false;
|
||||
if (typeof window.CustomEvent == "function") return false;
|
||||
function CustomEvent(event, params) {
|
||||
params = params || { bubbles: false, cancelable: false, detail: null };
|
||||
var evt = document.createEvent('CustomEvent');
|
||||
@@ -71,7 +71,7 @@ $modal = function (options) {
|
||||
modal_content,
|
||||
modalFooterHTML = '';
|
||||
|
||||
if(training_data().answer !== '') {
|
||||
if(training_data().answer != '') {
|
||||
modalInputAnswer = '<br><br><input name="user_answer" placeholder="Укажите ответ"/>';
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ $modal = function (options) {
|
||||
}
|
||||
|
||||
function _handlerCloseModal(e) {
|
||||
if (e.target.dataset.dismiss === 'modal') {
|
||||
if (e.target.dataset.dismiss == 'modal') {
|
||||
_hideModal();
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ let modal = $modal({
|
||||
});
|
||||
|
||||
document.addEventListener('click', function (e) {
|
||||
if (e.target.dataset.handler === 'next_step') {
|
||||
if (e.target.dataset.handler == 'next_step') {
|
||||
training_handler()
|
||||
}
|
||||
})
|
||||
@@ -98,9 +98,9 @@ class ModalLocalStorage {
|
||||
}
|
||||
|
||||
removeData(name) {
|
||||
if (name === 'step') {
|
||||
if (name == 'step') {
|
||||
localStorage.removeItem(this.stepItemName);
|
||||
} else if (name === 'hide') {
|
||||
} else if (name == 'hide') {
|
||||
localStorage.removeItem(this.hideRegistrationModal);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user