Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*var alertSound = window.localStorage.getItem("alertSound");
- if(alertSound == null)
- {
- alertSound = false;
- }
- else
- {
- $("#checkbox_sound").prop('checked', true);
- }*/
- var alertVibration = window.localStorage.getItem("alertVibration");
- if(alertVibration == null)
- {
- alertVibration = false;
- }
- else
- {
- $("#checkbox_vibration").prop('checked', true);
- }
- /*function soundSetting()
- {
- if($('#checkbox_sound').is(':checked'))
- {
- alertSound = true;
- window.localStorage.setItem("alertSound", true);
- }
- else
- {
- alertSound = false;
- window.localStorage.setItem("alertSound", false);
- }
- }*/
- function vibrationSetting()
- {
- if($('#checkbox_vibration').is(':checked'))
- {
- alertVibration = true;
- window.localStorage.setItem("alertVibration", true);
- }
- else
- {
- alertVibration = false;
- window.localStorage.removeItem("alertVibration");
- }
- }
- var alertPrivateVibration = window.localStorage.getItem("alertPrivateVibration");
- if(alertPrivateVibration == null)
- {
- alertPrivateVibration = false;
- }
- else
- {
- $("#checkbox_private_vibration").prop('checked', true);
- }
- function vibrationPrivateSetting()
- {
- if($('#checkbox_private_vibration').is(':checked'))
- {
- alertPrivateVibration = true;
- window.localStorage.setItem("alertPrivateVibration", true);
- }
- else
- {
- alertPrivateVibration = false;
- window.localStorage.removeItem("alertPrivateVibration");
- }
- }
- /*var alertPrivateText = window.localStorage.getItem("alertPrivateText");
- if(alertPrivateText == null)
- {
- alertPrivateText = false;
- }
- else
- {
- $("#checkbox_private_text").prop('checked', true);
- }
- function textPrivateSetting()
- {
- if($('#checkbox_private_text').is(':checked'))
- {
- alertPrivateText = true;
- window.localStorage.setItem("alertPrivateText", true);
- }
- else
- {
- alertPrivateText = false;
- window.localStorage.removeItem("alertPrivateText");
- }
- }*/
- var currentTheme = window.localStorage.getItem("theme");
- if(currentTheme == null)
- currentTheme = 'a';
- else
- changeTheme(currentTheme);
- function changeTheme(theme)
- {
- $("#navbar").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#popupNoInternetButton").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#content").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#leftpanelSettings").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#leftpanelUserProfile").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#leftpanelMoneyWithdraw").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#chatList").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#avatarSelect").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#leftpanelBuyCredits").removeClass("ui-body-" + currentTheme).addClass("ui-body-" + theme);
- $("#theme" + theme).prop('checked', true);
- if(theme != currentTheme)
- $("#theme" + currentTheme).prop('checked', false);
- currentTheme = theme;
- window.localStorage.setItem("theme", currentTheme);
- }
- var avatarChangeTime;
- function userAvatarUpdate()
- {
- if(!isInternetConnection)
- {
- noInternetAlert();
- return;
- }
- if(avatarChangeTime >= Math.floor((new Date()).getTime() / 1000))
- {
- showWarningMsg("Ne taip dažnai!");
- return;
- }
- var avatarURL = $("#userAvatarInput").val();
- if(avatarURL.length == "")
- {
- showWarningMsg("Įveskite nuorodą!");
- return;
- }
- if(avatarURL.length >= 120)
- {
- showWarningMsg("Nuoroda per ilga!");
- return;
- }
- $.mobile.loading('show');
- avatarChangeTime = Math.floor((new Date()).getTime() / 1000)+10;
- $.post("http://sarg.lt/app/avatar.php", {name: userName, avatar: avatarURL, code: "0ay3j5as1Zua55f9T9s2upo", token: userData["token"]}, function ( data )
- {
- if(data == -2)
- showWarningMsg("Bloga nuoroda!");
- else if(data == -1)
- showWarningMsg("Autorizacijos klaida!");
- else if(data == 0)
- showWarningMsg("Serveris nepasiekiamas!");
- else
- {
- userData["avatar"] = data;
- document.getElementById("avatarSelect").innerHTML = 'Avataras:<br><img src="' + userData["avatar"] + '" alt="Avatar" class="img-circle" width="50" height="50" ><br>\
- <br>Tinka .png arba .gif nedidesni už 100x100<input type="url" id="userAvatarInput" class="form-control input-sm" maxlength="120" placeholder="http://"/>\
- <button class="ui-btn" onclick="userAvatarUpdate()">Pakeisti</button>';
- }
- $.mobile.loading('hide');
- }
- );
- document.getElementById("userAvatarInput").value = '';
- }
Add Comment
Please, Sign In to add comment