2 checkbox('showpic',"#showpic",true);
3 checkbox('mediaPre',"#mediaPreSelect",true);
4 checkbox('p_avatar',"#proxifyAvatar",false,function(){
5 var imgurl = $.cookie('imgurl');
6 if(imgurl.indexOf('img.php') > -1) {
7 imgurl = imgurl.substr(15);
9 imgurl = 'img.php?imgurl='+imgurl;
11 $.cookie('imgurl',imgurl,{expires:365});
14 checkbox('autoscroll',"#autoscroll",true);
15 checkbox('sidebarscroll',"#sidebarscroll",true,function(){
16 $(window).unbind('scroll',scroller);
18 checkbox('twitterbg',"#twitterbg",false,function(){
19 if($.cookie('twitterbg') === 'true'){
21 url:'ajax/updateProfile.php?extra=bg',
28 $.cookie('Bgcolor', '');
29 $.cookie('Bgimage','');
30 $.cookie('Bgrepeat','no-repeat');
34 selectbox('homeInterval',"#homeInterval",function(){
35 $.cookie('intervalChanged','true',{expires:365});
37 selectbox('updatesInterval',"#updatesInterval",function(){
38 $.cookie('intervalChanged','true',{expires:365});
40 selectbox('fontsize',"#fontsize");
41 $('.bg_input').ColorPicker({
42 onBeforeShow: function () {
43 $(this).ColorPickerSetColor(this.value);
45 onSubmit: function(hsb, hex, rgb, el) {
47 $(el).ColorPickerHide();
48 $.cookie('bodyBg',"#" + hex,{expires:365});
50 updateSentTip('Setting saved successfully!',3000,'success');
52 }).bind('keyup', function(){
53 $(this).ColorPickerSetColor(this.value);
55 $('#reset_link').bind('click', function(e){
57 if(confirm("You will lose all customized settings!")){
58 $.cookie('myCSS', '/*default.css*/');
60 $.cookie('fontsize', '');
61 $.cookie('Bgcolor', '');
62 $.cookie('Bgimage','');
63 $.cookie('showpic','true');
64 $.cookie('mediaPre','true');
65 $.cookie('p_avatar','false');
66 $.cookie('homeInterval',1);
67 $.cookie('updatesInterval',3);
69 updateSentTip('Setting Reset successfully!',3000,'success');
73 "Twitter Default":{theme:"/*default*/"},
74 "Dark Rabr":{theme:"@import url(themes/1.css);"},
75 "Monokai Python":{theme:"@import url(themes/2.css);"},
76 "Old Times":{theme:"@import url(themes/3.css);"},
77 "Pink":{theme:"@import url(themes/4.css);"},
78 "Warm @lgsoltek":{theme:"@import url(themes/5.css);"},
79 "Cold @lgsoltek":{theme:"@import url(themes/6.css);"},
80 "Green":{theme:"@import url(themes/7.css);"},
81 "Shine":{theme:"@import url(themes/8.css);"},
82 "Flew":{theme:"@import url(themes/9.css);"},
83 "Golden":{theme:"@import url(themes/10.css);"},
84 "#red":{theme:"@import url(themes/11.css);"},
85 "Storm":{theme:"@import url(themes/12.css);"},
86 "City":{theme:"@import url(themes/13.css);"},
87 "Cosmos":{theme:"@import url(themes/14.css);"},
88 "Pride (Rainbow)":{theme:"@import url(themes/15.css); /* Have a gay day! */"},
89 "Drop Bombs":{theme:"@import url(themes/16.css);"},
90 "Minimal":{theme:"@import url(themes/minimal.css);"},
92 $.each(style, function (i,o) {
93 $("#styleSelect").append('<option value="' + o.theme + '">' + i + '</option>');
95 var theme = $.cookie('theme') == undefined ? '/*default*/' : $.cookie('theme');
96 $("#styleSelect").change(function(){
98 $.cookie('theme',o,{expires:365});
99 $.cookie('Bgimage','');
101 updateSentTip('Themes Saved Successfully!',3000,'success');
104 $("textarea#myCSS").change(function(){
105 $.cookie('myCSS',$(this).val(),{expires:365});
107 updateSentTip('Themes saved successfully!',3000,'success');
109 $("#AvatarUpload").click(function (e) {
111 ProfileImageUpload();
113 $("#saveProfile").click(function(e){
116 url: 'ajax/updateProfile.php',
119 'name': $('input[name="name"]').val(),
120 'url' : $('input[name="url"]').val(),
121 'location': $('input[name="location"]').val(),
122 'description': $('textarea[name="description"]').text()
125 success: function(msg) {
126 if (msg.result == 'success') {
128 updateSentTip ('Profile updated successfully!',3000,'success');
130 updateSentTip ('Fail to update your profile, please try again',3000,'failure');
134 updateSentTip ('Fail to update your profile, please try again',3000,'failure');
139 function checkbox(c,id,d,extra){
141 if ($.cookie (c) === null) {
142 $.cookie (c, d, { expires: 30 });
144 $id.prop('checked', $.cookie (c) === 'true').click(function (){
145 $.cookie(c,$id.prop("checked"),{expires:365});
146 if (extra != undefined) extra();
147 updateSentTip('Setting saved successfully!',1000,'success');
150 function selectbox(c,id,extra){
152 if($.cookie(c) != undefined){
153 $id.eq(0).val($.cookie(c));
155 $id.change(function (){
156 $.cookie(c,$id.find(':selected').val(),{expires:365});
157 if (extra != undefined) extra();
158 updateSentTip('Setting saved successfully!',1000,'success');
162 function ProfileImageUpload() {
163 updateSentTip("Uploading your profile image...", 10000, "ing");
165 url: 'ajax/uploadImage.php?do=profile',
168 fileElementId: 'profile_image',
170 success: function (data, status) {
171 if (typeof(console) !== 'undefined' && console != null) {
174 if (typeof(data.result) != 'undefined' && data.result == "success") {
176 url: '../ajax/updateProfile.php',
179 success: function(msg){
181 $(".settings > img").attr("src",$.cookie("imgurl"));
184 updateSentTip("Your profile image has been uploaded!", 3000, "success");
186 updateSentTip("Failed to upload, please try again.", 3000, "failure");
189 error: function (data, status, e) {
190 updateSentTip("Failed to upload, please try again.", 3000, "failure");