Changeset 309 for trunk/bp-xprofile/bp-xprofile-cssjs.php
- Timestamp:
- 09/09/2008 06:52:13 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-xprofile/bp-xprofile-cssjs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-cssjs.php
r251 r309 2 2 3 3 function xprofile_add_signup_css() { 4 if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' ) { 5 ?> 6 <style type="text/css"> 7 8 table#extraFields td label, 9 div.radio span, 10 div.checkbox span { 11 font-weight: bold; 12 display: block; 13 float: left; 14 width: 115px; 15 } 16 17 table#extraFields td input { 18 font-size: 24px; 19 width: 280px; 20 } 21 22 table#extraFields td textarea { 23 width: 280px; 24 height: 120px; 25 } 26 27 table#extraFields td select { 28 width: 280px; 29 } 30 31 table#extraFields td div.datefield select { 32 width: auto; 33 } 34 35 table#extraFields td div.radio label, 36 table#extraFields td div.checkbox label { 37 display: inline; 38 font-weight: normal; 39 float: none; 40 } 41 42 table#extraFields td div.radio input, 43 table#extraFields td div.checkbox input { 44 width: auto; 45 } 46 47 span.desc { 48 margin-left: 115px; 49 font-weight: normal; 50 } 51 52 div.error { 53 font-weight: bold; 54 margin: 10px 0 10px 113px; 55 } 56 57 </style> 58 <?php 59 } 4 if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' ) 5 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/signup.css" type="text/css" />'; 60 6 } 61 7 add_action( 'wp_head', 'xprofile_add_signup_css' ); 62 8 63 9 64 function xprofile_add_css() { 65 global $userdata, $wpdb; 66 67 ?> 68 <style type="text/css"> 69 70 tr.header td { 71 border-bottom: 2px solid #eee; 72 font-weight: bold; 73 } 74 75 tr.core td { color: #999; } 76 77 thead tr th { 78 font-size: 16px; 79 } 80 81 #profilePicture { 82 margin: 0 0 0 -280px; 83 float: left; 84 width: 280px; 85 } 86 87 #currentPicture { 88 padding: 15px; 89 width: 280px; 90 margin-left: 280px; 91 } 92 93 #currentPicture img, #otherPictures img { 94 border: 1px solid #ccc; 95 padding: 4px; 96 background: #fff; 97 } 98 #otherPictures img:hover { 99 background: #f0f0f0; 100 } 101 102 #currentPicture a, #otherPictures a { border: none; } 103 104 #otherPictures { 105 float: right; 106 padding: 20px; 107 margin-left: 300px; 108 margin-top: -5px; 109 } 110 111 #otherPictures ul { 112 list-style: none; 113 margin: 0; 114 padding: 0; 115 } 116 #otherPictures ul li { 117 float: left; 118 margin: 0 10px 10px 0; 119 } 120 121 #profilePicture form { 122 border: 1px solid #ccc; 123 width: 255px; 124 margin-top: 20px; 125 padding: 5px; 126 } 127 #profilePicture form h3 { 128 background: #fafafa; 129 margin: 0 0 15px 0; 130 padding: 10px; 131 } 132 133 ul.forTab { 134 list-style: none; 135 padding: 0; 136 margin: 0 0 0 1em; 137 } 138 ul.forTab li { 139 margin: 0 0 1em 0; 140 } 141 142 ul.forTab li label { 143 display: block; 144 145 } 146 147 ul.forTab li input { 148 font-size: 1.4em; 149 } 150 151 p.success { background: green;} 152 p.err { 153 border-top: 2px solid red; 154 border-bottom: 2px solid red; 155 color: red; 156 padding: 5px 0; 157 width: 40%; 158 } 159 160 span.desc, span.signup-description { 161 display: block; 162 font-size: 11px; 163 color: #555; 164 } 165 166 select.multi-select{ 167 width:90%; 168 height:10em !important; 169 } 170 171 ul.multi-checkbox { 172 margin: 0 5px 0 0px; 173 padding: .5em .9em; 174 height: 10em; 175 overflow: auto; 176 list-style: none; 177 border: solid 1px #ccc; 178 width:90%; 179 } 180 181 ul.multi-checkbox li{ 182 padding: 0; 183 margin: 0; 184 } 185 186 div.options-box { 187 margin-left: 20px !important; 188 margin-right: 10px !important; 189 border-left: 4px solid #EAF3FA; 190 padding-left: 15px; 191 } 192 193 th a { 194 background: #fff; 195 padding: 2px 5px; 196 -moz-border-radius: 3px; 197 -khtml-border-radius: 3px; 198 -webkit-border-radius: 3px; 199 border-radius: 3px; 200 top: -2px; 201 } 202 203 </style> 204 <?php 205 //} 206 } 207 208 function xprofile_add_js() { 10 function xprofile_add_admin_css() { 209 11 if ( strpos( $_GET['page'], 'xprofile' ) !== false ) { 210 ?> 211 <script type="text/javascript"> 212 var ajaxurl = '<?php echo get_option('siteurl') . "/wp-admin/admin-ajax.php"; ?>'; 213 214 function add_option(forWhat) { 215 var holder = document.getElementById(forWhat + "_more"); 216 var theId = document.getElementById(forWhat + '_option_number').value; 217 218 var newDiv = document.createElement('p'); 219 newDiv.setAttribute('id', forWhat + '_div' + theId); 220 221 var newOption = document.createElement('input'); 222 newOption.setAttribute('type', 'text'); 223 newOption.setAttribute('name', forWhat + '_option[' + theId + ']'); 224 newOption.setAttribute('id', forWhat + '_option' + theId); 225 226 var label = document.createElement('label'); 227 label.setAttribute('for', forWhat + '_option' + theId); 228 229 var txt = document.createTextNode("Option " + theId + ": "); 230 label.appendChild(txt); 231 232 var isDefault = document.createElement('input'); 233 234 if(forWhat == 'checkbox' || forWhat == 'multiselectbox') { 235 isDefault.setAttribute('type', 'checkbox'); 236 isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option[' + theId + ']'); 237 } else { 238 isDefault.setAttribute('type', 'radio'); 239 isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option'); 240 } 241 242 isDefault.setAttribute('value', theId); 243 244 var label1 = document.createElement('label'); 245 var txt1 = document.createTextNode(" Default Value "); 246 247 label1.appendChild(txt1); 248 label1.setAttribute('for', 'isDefault_' + forWhat + '_option[]'); 249 toDelete = document.createElement('a'); 250 251 toDeleteText = document.createTextNode('[x]'); 252 toDelete.setAttribute('href',"javascript:hide('" + forWhat + '_div' + theId + "')"); 253 254 toDelete.setAttribute('class','delete'); 255 256 toDelete.appendChild(toDeleteText); 257 258 newDiv.appendChild(label); 259 newDiv.appendChild(newOption); 260 newDiv.appendChild(document.createTextNode(" ")); 261 newDiv.appendChild(isDefault); 262 newDiv.appendChild(label1); 263 newDiv.appendChild(toDelete); 264 holder.appendChild(newDiv); 265 266 267 theId++ 268 document.getElementById(forWhat + "_option_number").value = theId; 269 } 270 271 function show_options(forWhat) { 272 document.getElementById("radio").style.display = "none"; 273 document.getElementById("selectbox").style.display = "none"; 274 document.getElementById("multiselectbox").style.display = "none"; 275 document.getElementById("checkbox").style.display = "none"; 276 277 if(forWhat == "radio") { 278 document.getElementById("radio").style.display = ""; 279 } 280 281 if(forWhat == "selectbox") { 282 document.getElementById("selectbox").style.display = ""; 283 } 284 285 if(forWhat == "multiselectbox") { 286 document.getElementById("multiselectbox").style.display = ""; 287 } 288 289 if(forWhat == "checkbox") { 290 document.getElementById("checkbox").style.display = ""; 291 } 292 } 293 294 function reorderFields(table, row, field_ids) { 295 jQuery.post( ajaxurl, { 296 action: 'xprofile_reorder_fields', 297 'cookie': encodeURIComponent(document.cookie), 298 '_wpnonce': jQuery("input#_wpnonce").val(), 299 'group': table.id.split('_')[1], 300 'row': row, 301 'field_ids': field_ids 302 }, 303 function(response) { 304 305 }, 306 1250 307 ); 308 } 309 310 function hide(id) { 311 if ( !document.getElementById(id) ) return false; 312 313 document.getElementById(id).style.display = "none"; 314 document.getElementById(id).value = ''; 315 } 316 317 // Set up deleting options ajax 318 jQuery(document).ready( function() { 319 var links = jQuery("a.ajax-option-delete"); 320 321 jQuery.each(links, 322 function(link, val) { 323 link.click( 324 function() { 325 } 326 ); 327 } 328 ); 329 330 jQuery("a.ajax-option-delete").click( 331 function() { 332 alert(ajaxUrl); 333 alert("test"); 334 return false; 335 var theId = this.id.split('-'); 336 theId = theId[1]; 337 338 jQuery.post( ajaxurl, { 339 action: 'xprofile_delete_option', 340 'cookie': encodeURIComponent(document.cookie), 341 '_wpnonce': jQuery("input#_wpnonce").val(), 342 343 'option_id': theId 344 }, 345 function(response) 346 { 347 alert(response); 348 }); 349 350 351 } 352 ); 353 }); 354 </script> 355 356 <?php 12 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />'; 357 13 } 358 14 } 15 add_action( 'admin_head', 'xprofile_add_admin_css' ); 16 17 18 function xprofile_add_admin_js() { 19 if ( strpos( $_GET['page'], 'xprofile' ) !== false ) { 20 wp_enqueue_script( 'bp-xprofile-admin-js', get_option('siteurl') . "/wp-content/mu-plugins/bp-xprofile/js/admin.js" ); 21 add_action( 'admin_head', 'bp_core_add_cropper_js' ); 22 } 23 } 24 add_action( 'admin_menu', 'xprofile_add_admin_js' ); 25 359 26 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)