Changeset 2017322
- Timestamp:
- 01/23/2019 04:39:32 AM (7 years ago)
- Location:
- cometchat/trunk
- Files:
-
- 3 edited
-
comet-admin.php (modified) (2 diffs)
-
comet-ready.php (modified) (2 diffs)
-
js/admin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cometchat/trunk/comet-admin.php
r2015193 r2017322 1 1 <?php 2 2 wp_enqueue_style("ccadmin", plugin_dir_url( __FILE__ ).'css/comet-admin.css'); 3 wp_enqueue_script("comet-admin", plugin_dir_url( __FILE__ ).'js/admin.js'); 3 4 wp_enqueue_script("comet-admin", plugin_dir_url( __FILE__ ).'js/comet-admin.js'); 4 5 … … 29 30 </p> 30 31 <p style="margin-top: 20px;"> 31 <button type="button" class="button-primary" onclick=" window.open('<?php echo $adminpanelurl; ?>');">32 <button type="button" class="button-primary" onclick="cometGOPanel('<?php echo $adminpanelurl; ?>');"> 32 33 Launch Admin Panel 33 34 </button> -
cometchat/trunk/comet-ready.php
r2015193 r2017322 1 1 <?php 2 2 wp_enqueue_style("ccadmin", plugin_dir_url( __FILE__ ).'css/comet-ready.css'); 3 wp_enqueue_script("comet-admin", plugin_dir_url( __FILE__ ).'js/admin.js'); 3 4 ?> 4 5 … … 18 19 <p>We have pre-enabled our Docked Layout for your convenience. </p> 19 20 <div> 20 <button type="submit" value = "submit" id = "save" class = "button-primary" onclick=" window.open('<?php echo $adminpanelurl; ?>');">Launch Admin Panel</button>21 <button type="submit" value = "submit" id = "save" class = "button-primary" onclick=" window.location.reload();">Go To Settings</button>21 <button type="submit" value = "submit" id = "save" class = "button-primary" onclick="cometGOPanel('<?php echo $adminpanelurl; ?>');">Launch Admin Panel</button> 22 <button type="submit" value = "submit" id = "save" class = "button-primary" onclick="cometGoSettings();">Go To Settings</button> 22 23 </div> 23 24 </div> -
cometchat/trunk/js/admin.js
r2015193 r2017322 1 (function($) { 1 function cometGOPanel(url) { 2 if(typeof(url) == 'undefined') { 3 return; 4 } 5 window.open(url); 6 } 2 7 3 var show_friends; 4 var bp_group_sync; 5 6 jQuery(document).ready(function() { 7 jQuery('#save').on('click', function(e) { 8 console.log('clicked'); 9 show_friends = jQuery("input.show_friends[type=checkbox]:checked").val(); 10 if(show_friends == '' || show_friends == undefined){ 11 show_friends = "false"; 12 }else{ 13 show_friends = "true"; 14 } 15 16 bp_group_sync = jQuery("input.bp_group_sync[type=checkbox]:checked").val(); 17 if(bp_group_sync == '' || bp_group_sync == undefined){ 18 bp_group_sync = "false"; 19 }else{ 20 bp_group_sync = "true"; 21 } 22 23 data = { 24 'action': 'cc_action', 25 'api': 'cometchat_friend_ajax', 26 'show_friends': show_friends, 27 'bp_group_sync': bp_group_sync 28 } 29 30 jQuery.post(ajaxurl, data, function(response){ 31 jQuery("#success").html("<div class='updated'><p>Settings successfully saved!</p></div>"); 32 jQuery(".updated").fadeOut(3000); 33 }); 34 }); 35 }); 8 function cometGoSettings() { 9 window.location.reload(); 10 }
Note: See TracChangeset
for help on using the changeset viewer.