<script> |
|
var hostname = location.hostname; |
|
|
|
if (hostname == 'www.bazili.ir' || hostname == 'bazili.ir') { |
|
window.operator = 'mtn'; |
|
window.operatorId = '2'; |
|
} |
|
|
|
if (hostname == 'www.xbuzzi.ir' || hostname == 'xbuzzi.ir') { |
|
window.operator = 'mci'; |
|
window.operatorId = '1'; |
|
} |
|
|
|
if (window.operatorId == 'undefined') { |
|
window.operator = 'mci'; |
|
window.operatorId = '1'; |
|
} |
|
|
|
if (window.operator == 'mtn') { |
|
|
|
$.ajax({ |
|
url: "http://79.175.154.136/api/v1/user", |
|
success: function(response) { |
|
if (response != null) { |
|
if (response.data != "") { |
|
window.msisdn = response.data; |
|
$('#without_msisdn').css('display', 'none'); |
|
$('#with_msisdn').css('display', 'block'); |
|
|
|
$.ajax({ |
|
url: "/Home/IsSubscribe" + "?msisdn=" + window.msisdn, |
|
success: function(response) { |
|
console.log(response); |
|
}, |
|
async: false |
|
}); |
|
} else { |
|
$('#with_msisdn').css('display', 'none'); |
|
$('#without_msisdn').css('display', 'block'); |
|
} |
|
} |
|
}, |
|
async: false |
|
}); |
|
|
|
} else if (window.operator == 'mci'){ |
|
|
|
$.ajax({ |
|
url: "http://79.175.154.132//user", |
|
success: function(response) { |
|
if (response != null) { |
|
if (response.data != "") { |
|
window.msisdn = response.data; |
|
$.ajax({ |
|
url: "/Home/IsSubscribe" + "?msisdn=" + window.msisdn, |
|
success: function(response) { |
|
console.log(response); |
|
|
|
}, |
|
async: false |
|
}); |
|
} |
|
} |
|
}, |
|
async: false |
|
}); |
|
|
|
} |
|
|
|
|
|
//mixitup |
|
var mixer = mixitup('#game_container', |
|
{ |
|
selectors: { |
|
target: '.game-item' |
|
}, |
|
classNames: { |
|
block: 'filter-group', /* mixitup */ |
|
elementFilter: 'filter-btn' /* control */ |
|
}, |
|
load: { |
|
filter: ".mix" |
|
} |
|
}); |
|
|
|
//$('.container').mixitup({ |
|
// load: { |
|
// sort: 'order:asc' |
|
// }, |
|
// animation: { |
|
// effects: 'fade rotateZ(-180deg)', |
|
// duration: 700 |
|
// }, |
|
// selectors: { |
|
// target: '.filter-group a', |
|
// filter: '.filter-btn' |
|
// }, |
|
// callbacks: { |
|
// onMixEnd: function (state) { |
|
// console.log(state); |
|
// } |
|
// } |
|
//}); |
|
|
|
|
|
//start shuffle ----------------------------------------------------- |
|
|
|
//var Shuffle = window.shuffle; |
|
//var Demo = function (element) { |
|
// this.element = element; |
|
|
|
// this.addShuffleEventListeners(); |
|
|
|
// this.shuffle = new Shuffle(element, { |
|
// itemSelector: '.game-item', |
|
// sizer: element.querySelector('.my-sizer-element') |
|
// }); |
|
|
|
// this._activeFilters = []; |
|
|
|
// this.addFilterButtons(); |
|
// this.addSearchFilter(); |
|
|
|
// this.mode = 'exclusive'; |
|
//}; |
|
|
|
|
|
//Demo.prototype.toArray = function (arrayLike) { |
|
// return Array.prototype.slice.call(arrayLike); |
|
//}; |
|
|
|
//Demo.prototype.toggleMode = function () { |
|
// if (this.mode === 'additive') { |
|
// this.mode = 'exclusive'; |
|
// } else { |
|
// this.mode = 'additive'; |
|
// } |
|
//}; |
|
|
|
//Demo.prototype.addShuffleEventListeners = function () { |
|
// var handler = function (event) { |
|
// }; |
|
|
|
// this.element.addEventListener(Shuffle.EventType.LAYOUT, handler, false); |
|
// this.element.addEventListener(Shuffle.EventType.REMOVED, handler, false); |
|
//}; |
|
|
|
//Demo.prototype.addFilterButtons = function () { |
|
// var options = document.querySelector('.filter-group'); |
|
|
|
// if (!options) { |
|
// return; |
|
// } |
|
|
|
// var filterButtons = this.toArray( |
|
// options.children |
|
// ); |
|
|
|
// filterButtons.forEach(function (button) { |
|
// button.addEventListener('click', this._handleFilterClick.bind(this), false); |
|
// }, this); |
|
//}; |
|
|
|
//Demo.prototype._handleFilterClick = function (evt) { |
|
// var btn = evt.currentTarget; |
|
// var isActive = btn.classList.contains('active'); |
|
// var btnGroup = btn.getAttribute('data-value'); |
|
|
|
// if (this.mode === 'additive') { |
|
// if (isActive) { |
|
// this._activeFilters.splice(this._activeFilters.indexOf(btnGroup)); |
|
// } else { |
|
// this._activeFilters.push(btnGroup); |
|
// } |
|
|
|
// btn.classList.toggle('active'); |
|
|
|
// this.shuffle.filter(this._activeFilters); |
|
|
|
// } else { |
|
// this._removeActiveClassFromChildren(btn.parentNode); |
|
|
|
// var filterGroup; |
|
// if (isActive) { |
|
// btn.classList.remove('active'); |
|
// filterGroup = Shuffle.ALL_ITEMS; |
|
// } else { |
|
// btn.classList.add('active'); |
|
// filterGroup = btnGroup; |
|
// } |
|
|
|
// this.shuffle.filter(filterGroup); |
|
// } |
|
//}; |
|
|
|
|
|
//Demo.prototype._removeActiveClassFromChildren = function (parent) { |
|
// var children = parent.children; |
|
// for (var i = children.length - 1; i >= 0; i--) { |
|
// children[i].classList.remove('active'); |
|
// } |
|
//}; |
|
|
|
//Demo.prototype.addSearchFilter = function () { |
|
// var searchInput = document.querySelector('.js-shuffle-search'); |
|
|
|
// if (!searchInput) { |
|
// return; |
|
// } |
|
|
|
// searchInput.addEventListener('keyup', this._handleSearchKeyup.bind(this)); |
|
//}; |
|
|
|
//Demo.prototype._handleSearchKeyup = function (evt) { |
|
// var searchText = evt.target.value.toLowerCase(); |
|
// this.shuffle.filter(function (element, shuffle) { |
|
|
|
// if (shuffle.group !== Shuffle.ALL_ITEMS) { |
|
// var groups = element.getAttribute('data-group'); |
|
// var isElementInCurrentGroup = groups.indexOf(shuffle.group) !== -1; |
|
|
|
// if (!isElementInCurrentGroup) { |
|
// return false; |
|
// } |
|
// } |
|
|
|
// var titleElement = element.querySelector('.card-title'); |
|
// var titleText = titleElement.textContent.toLowerCase().trim(); |
|
|
|
// return titleText.indexOf(searchText) !== -1; |
|
// }); |
|
//}; |
|
|
|
//document.addEventListener('DOMContentLoaded', function () { |
|
// window.demo = new Demo(document.getElementById('game_container')); |
|
//}); |
|
|
|
//------------------------------------------------------------------------------ |
|
|
|
//------------------------------------------------------------------------------ |
|
|
|
$('#txt_search').on('keyup', |
|
function() { |
|
var value = this.value; |
|
console.log($('.game-list .game-item:first-child').find('.card-title').text()); |
|
|
|
$('.game-list .game-item').each(function(elem) { |
|
if ($(this).find('.card-title').text().search(value) > -1) { |
|
$(this).show(); |
|
} else { |
|
$(this).hide(); |
|
} |
|
}); |
|
}); |
|
|
|
</script> |
|
|
|
|
|
<script> |
|
$(home).toggleClass("active"); |
|
$.ajax({ |
|
url: "http://79.175.154.132/user", |
|
success: function (response) { |
|
if (response != null) { |
|
window.msisdn = response.data; |
|
} |
|
}, |
|
async: false |
|
}); |
|
|
|
function defaultImage(image) { |
|
image.onerror = ""; |
|
image.src = "/Content/img/base/default-game.jpg"; |
|
return true; |
|
} |
|
|
|
var ua = navigator.userAgent.toLowerCase(); |
|
if (0 <= ua.indexOf("android")) { |
|
window.android = true; |
|
// alert('android'); |
|
} |
|
|
|
|
|
</script> |
|