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('shownick',"#shownick",false);
19 checkbox('twitterbg',"#twitterbg",false,function(){
20 if($.cookie('twitterbg') === 'true'){
22 url:'ajax/updateProfile.php?extra=bg',
29 $.cookie('Bgcolor', '');
30 $.cookie('Bgimage','');
31 $.cookie('Bgrepeat','no-repeat');
35 selectbox('homeInterval',"#homeInterval",function(){
36 $.cookie('intervalChanged','true',{expires:365});
38 selectbox('updatesInterval',"#updatesInterval",function(){
39 $.cookie('intervalChanged','true',{expires:365});
41 selectbox('fontsize',"#fontsize");
42 $('.bg_input').ColorPicker({
43 onBeforeShow: function () {
44 $(this).ColorPickerSetColor(this.value);
46 onSubmit: function(hsb, hex, rgb, el) {
48 $(el).ColorPickerHide();
49 $.cookie('bodyBg',"#" + hex,{expires:365});
51 updateSentTip('Setting saved successfully!',3000,'success');
53 }).bind('keyup', function(){
54 $(this).ColorPickerSetColor(this.value);
56 $('#reset_link').bind('click', function(e){
58 if(confirm("You will lose all customized settings!")){
59 $.cookie('myCSS', '/*default.css*/');
61 $.cookie('fontsize', '');
62 $.cookie('Bgcolor', '');
63 $.cookie('Bgimage','');
64 $.cookie('showpic','true');
65 $.cookie('shownick','false');
66 $.cookie('mediaPre','true');
67 $.cookie('p_avatar','false');
68 $.cookie('homeInterval',1);
69 $.cookie('updatesInterval',3);
71 updateSentTip('Setting Reset successfully!',3000,'success');
75 "Twitter Default":{theme:"/*default*/"},
76 "Dark Rabr":{theme:"@import url(themes/1.css);"},
77 "Monokai Python":{theme:"@import url(themes/2.css);"},
78 "Old Times":{theme:"@import url(themes/3.css);"},
79 "Pink":{theme:"@import url(themes/4.css);"},
80 "Warm @lgsoltek":{theme:"@import url(themes/5.css);"},
81 "Cold @lgsoltek":{theme:"@import url(themes/6.css);"},
82 "Green":{theme:"@import url(themes/7.css);"},
83 "Shine":{theme:"@import url(themes/8.css);"},
84 "Flew":{theme:"@import url(themes/9.css);"},
85 "Golden":{theme:"@import url(themes/10.css);"},
86 "#red":{theme:"@import url(themes/11.css);"},
87 "Storm":{theme:"@import url(themes/12.css);"},
88 "City":{theme:"@import url(themes/13.css);"},
89 "Cosmos":{theme:"@import url(themes/14.css);"},
90 "Pride (Rainbow)":{theme:"@import url(themes/15.css); /* Have a gay day! */"},
91 "Drop Bombs":{theme:"@import url(themes/16.css);"},
92 "Minimal":{theme:"@import url(themes/minimal.css);"},
94 $.each(style, function (i,o) {
95 $("#styleSelect").append('<option value="' + o.theme + '">' + i + '</option>');
97 var theme = $.cookie('theme') == undefined ? '/*default*/' : $.cookie('theme');
98 $("#styleSelect").change(function(){
100 $.cookie('theme',o,{expires:365});
101 $.cookie('Bgimage','');
103 updateSentTip('Themes Saved Successfully!',3000,'success');
106 $("textarea#myCSS").change(function(){
107 $.cookie('myCSS',$(this).val(),{expires:365});
109 updateSentTip('Themes saved successfully!',3000,'success');
111 $("#AvatarUpload").click(function (e) {
113 ProfileImageUpload();
115 $("#BackgroundUpload").click(function (e) {
117 ProfileBackgroundUpload();
119 $("#saveProfile").click(function(e){
122 url: 'ajax/updateProfile.php',
125 'name': $('input[name="name"]').val(),
126 'url' : $('input[name="url"]').val(),
127 'location': $('input[name="location"]').val(),
128 'description': $('textarea[name="description"]').text()
131 success: function(msg) {
132 if (msg.result == 'success') {
134 updateSentTip ('Profile updated successfully!',3000,'success');
136 updateSentTip ('Fail to update your profile, please try again',3000,'failure');
140 updateSentTip ('Fail to update your profile, please try again',3000,'failure');
145 $("#tile").click(function() {
146 ProfileBackgroundTile($(this).prop('checked'));
149 function checkbox(c,id,d,extra){
151 if ($.cookie (c) === null) {
152 $.cookie (c, d, { expires: 30 });
154 $id.prop('checked', $.cookie (c) === 'true').click(function (){
155 $.cookie(c,$id.prop("checked"),{expires:365});
156 if (extra != undefined) extra();
157 updateSentTip('Setting saved successfully!',1000,'success');
160 function selectbox(c,id,extra){
162 if($.cookie(c) != undefined){
163 $id.eq(0).val($.cookie(c));
165 $id.change(function (){
166 $.cookie(c,$id.find(':selected').val(),{expires:365});
167 if (extra != undefined) extra();
168 updateSentTip('Setting saved successfully!',1000,'success');
172 function ProfileImageUpload() {
173 updateSentTip("Uploading your profile image...", 10000, "ing");
175 url: 'ajax/uploadImage.php?do=profile',
178 fileElementId: 'profile_image',
180 success: function (data, status) {
181 if (typeof(console) !== 'undefined' && console != null) {
184 if (typeof(data.result) != 'undefined' && data.result == "success") {
186 url: '../ajax/updateProfile.php',
189 success: function(msg){
191 $("#avatarimg").attr("src",$.cookie("imgurl"));
194 updateSentTip("Your profile image has been uploaded!", 3000, "success");
196 updateSentTip("Failed to upload, please try again.", 3000, "failure");
199 error: function (data, status, e) {
200 updateSentTip("Failed to upload, please try again.", 3000, "failure");
206 function ProfileBackgroundUpload() {
207 updateSentTip("Uploading your profile background...", 10000, "ing");
209 url: 'ajax/uploadImage.php?do=background',
212 fileElementId: 'profile_background',
214 success: function (data, status) {
215 if (typeof(console) !== 'undefined' && console != null) {
218 if (typeof(data.result) != 'undefined' && data.result == "success") {
219 if ($.cookie('twitterbg') === 'true') {
221 url:'ajax/updateProfile.php?extra=bg',
223 success: function() { location.reload(); }
226 $("#backgroundimg").attr("src",data.url);
227 updateSentTip("Your profile background has been uploaded!", 3000, "success");
229 updateSentTip("Failed to upload, please try again.", 3000, "failure");
232 error: function (data, status, e) {
233 updateSentTip("Failed to upload, please try again.", 3000, "failure");
239 function ProfileBackgroundTile(tile) {
240 updateSentTip("Updating your profile background tile...", 3000, "ing");
242 url: 'ajax/uploadImage.php?do=background',
244 data: {'tile': tile},
246 success: function (data, status) {
247 if (typeof(console) !== 'undefined' && console != null) {
250 if (typeof(data.result) != 'undefined' && data.result == "success") {
251 if ($.cookie('twitterbg') === 'true') {
253 url:'ajax/updateProfile.php?extra=bg',
255 success: function() { location.reload(); }
258 var isok = data.tile === 'true';
259 if (isok != $("#tile").prop('checked')) {
260 $("#tile").prop('checked', isok);
261 updateSentTip("Failed to update, please try again.", 3000, "failure");
264 updateSentTip("Your profile background tile has been updated!", 3000, "success");
267 updateSentTip("Failed to update, please try again.", 3000, "failure");
270 error: function (data, status, e) {
271 updateSentTip("Failed to update, please try again.", 3000, "failure");