Index: /trunk/bp-core/admin/bp-core-admin.php
===================================================================
--- /trunk/bp-core/admin/bp-core-admin.php (revision 3476)
+++ /trunk/bp-core/admin/bp-core-admin.php (revision 3477)
@@ -262,5 +262,9 @@
function bp_core_add_admin_menu_styles() {
- wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.css' ) );
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+ wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.dev.css' ) );
+ else
+ wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.css' ) );
+
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
Index: /trunk/bp-core/admin/bp-core-upgrade.php
===================================================================
--- /trunk/bp-core/admin/bp-core-upgrade.php (revision 3476)
+++ /trunk/bp-core/admin/bp-core-upgrade.php (revision 3477)
@@ -1276,5 +1276,9 @@
function bp_core_add_admin_menu_styles() {
- wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.css' ) );
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+ wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.dev.css' ) );
+ else
+ wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( $path = '/buddypress' ) . '/bp-core/css/admin.css' ) );
+
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
Index: /trunk/bp-core/bp-core-widgets.php
===================================================================
--- /trunk/bp-core/bp-core-widgets.php (revision 3476)
+++ /trunk/bp-core/bp-core-widgets.php (revision 3477)
@@ -16,6 +16,10 @@
parent::WP_Widget( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
- if ( is_active_widget( false, false, $this->id_base ) )
- wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array('jquery') );
+ if ( is_active_widget( false, false, $this->id_base ) ) {
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+ wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.dev.js', array( 'jquery' ) );
+ else
+ wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array( 'jquery' ) );
+ }
}
Index: /trunk/bp-core/css/admin.css
===================================================================
--- /trunk/bp-core/css/admin.css (revision 3476)
+++ /trunk/bp-core/css/admin.css (revision 3477)
@@ -1,191 +1,1 @@
-div#bp-admin {
- background: #fff;
- margin: 25px 15px 25px 0;
- padding: 20px;
- -moz-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
- -moz-box-shadow: #eee 0 -1px 4px;
- -webkit-box-shadow: #eee 0 -1px 4px;
- -khtml-box-shadow: #eee 0 -1px 4px;
- box-shadow: #eee 0 -1px 4px;
- font-family: helvetica, arial, tahoma, sans-serif;
- color: #555;
- overflow: hidden;
- min-width: 680px;
-}
- div#bp-admin p { line-height: 170%; }
-
-div#bp-admin div#bp-admin-header {
- height: 60px;
-}
-
-div#bp-admin h3, div#bp-admin h4 {
- margin: 0;
-}
- div#bp-admin h2 {
- font-family: helvetica, arial, tahoma, sans-serif;
- color: #555;
- font-style: normal;
- font-weight: bold;
- font-size: 22px;
- }
-
- div#bp-admin h3 {
- text-indent: -999em;
- overflow: hidden;
- width: 212px;
- height: 49px;
- background: url( ../images/logo.gif ) top left no-repeat;
- border-right: 1px solid #eee;
- padding-right: 20px;
- float: left;
- }
-
- div#bp-admin h4 {
- padding-left: 20px;
- font-size: 28px;
- float: left;
- margin: 17px 0 0 0;
- }
-
-div#bp-admin-nav {
- background: #f0f0f0;
- margin: 15px -19px 10px -19px;
- padding: 8px 19px 0 19px;
- height: 30px;
-}
- div#bp-admin-nav ol {
- list-style-type: decimal;
- margin: 0;
- padding: 0;
- }
- div#bp-admin-nav ol li {
- float: left;
- margin: 0 10px 0 0;
- color: #bbb;
- }
- div#bp-admin-nav ol li {
- padding: 8px 12px;
- display: block;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- text-decoration: none;
- }
- div#bp-admin-nav ol li.current {
- background: #fff;
- color: #555;
- }
- div#bp-admin-nav ol li span.complete {
- background: url( ../images/completed.gif ) center left no-repeat;
- padding: 6px;
- }
-
-div#bp-admin div.left-col, div#bp-admin div.right-col {
- width: 323px;
- float: left;
- margin: 15px 30px 0 0;
-}
-div#bp-admin div.right-col { margin-right: 0; }
-
-div.component {
- width: 323px;
- margin: 10px 0 40px 0;
-}
- div.component div.radio {
- position: relative;
- background: #f4f4f4;
- padding: 5px 10px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- top: -6px;
- right: 10px;
- }
-
- div.component img {
- margin-top: 2px;
- }
-
- div.component p {
- margin-left: 4px;
- }
-
- div.component h5 {
- font-size: 15px;
- float: left;
- margin: 0 0 0 4px;
- }
-
- div.component div.radio {
- font-size: 11px;
- float: right;
- }
-
-div#bp-admin div.prev-next, div#bp-admin div.prev-next p,
-div#bp-admin div.submit, div#bp-admin div.submit p {
- margin: 0;
- padding: 0;
-}
-div#bp-admin div.submit { margin-top: 30px; }
-div#bp-admin div.prev-next { text-align: right; margin-top: 0; }
-
-div#bp-admin div.prev-next {
- border-bottom: 1px solid #f0f0f0;
- margin: 0 -20px;
- padding: 0 20px 10px;
-}
-
-div#bp-admin table td {
- font-family: helvetica, arial, tahoma, sans-serif;
-}
-
-div#bp-admin table.form-table th {
- border-right: 1px solid #eee;
- width: 208px;
- padding: 15px 25px 15px 0;
- color: #555;
-}
- div#bp-admin table.form-table tr {
- border-bottom: 1px dotted #f0f0f0;
- }
- div#bp-admin table.form-table td { padding-left: 25px; font-size: 12px; }
-
- div#bp-admin table.form-table th h5 {
- font-size: 14px;
- margin: 0;
- line-height: 150%;
- }
-
- div#bp-admin table.form-table th img {
- margin-top: 5px;
- }
-
- div#bp-admin table.form-table th p { margin: 3px 0 0 0; }
-
-div#bp-admin code, div#bp-admin kbd {
- font-size: 12px;
- background: #f0f0f0;
-}
-
-div#bp-admin div#message code, div#bp-admin div#message kbd {
- background: #ffe293;
-}
-
-a.button {
- padding-top: 4px;
-}
-
-a.installed, a.installed:hover, a.installed:active {
- padding-left: 15px;
- color: #888;
- border-color: #ccc;
- cursor: default;
-}
-
-a.installed span {
- background: url( ../images/installed.gif) left center no-repeat;
- padding: 6px 10px 7px 6px;
- margin-left: -5px;
-}
+div#bp-admin{background:#fff;margin:25px 15px 25px 0;padding:20px;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;-moz-box-shadow:#eee 0 -1px 4px;-webkit-box-shadow:#eee 0 -1px 4px;-khtml-box-shadow:#eee 0 -1px 4px;box-shadow:#eee 0 -1px 4px;font-family:helvetica,arial,tahoma,sans-serif;color:#555;overflow:hidden;min-width:680px;}div#bp-admin p{line-height:170%;}div#bp-admin div#bp-admin-header{height:60px;}div#bp-admin h3,div#bp-admin h4{margin:0;}div#bp-admin h2{font-family:helvetica,arial,tahoma,sans-serif;color:#555;font-style:normal;font-weight:bold;font-size:22px;}div#bp-admin h3{text-indent:-999em;overflow:hidden;width:212px;height:49px;background:url(../images/logo.gif) top left no-repeat;border-right:1px solid #eee;padding-right:20px;float:left;}div#bp-admin h4{padding-left:20px;font-size:28px;float:left;margin:17px 0 0 0;}div#bp-admin-nav{background:#f0f0f0;margin:15px -19px 10px -19px;padding:8px 19px 0 19px;height:30px;}div#bp-admin-nav ol{list-style-type:decimal;margin:0;padding:0;}div#bp-admin-nav ol li{float:left;margin:0 10px 0 0;color:#bbb;}div#bp-admin-nav ol li{padding:8px 12px;display:block;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none;}div#bp-admin-nav ol li.current{background:#fff;color:#555;}div#bp-admin-nav ol li span.complete{background:url(../images/completed.gif) center left no-repeat;padding:6px;}div#bp-admin div.left-col,div#bp-admin div.right-col{width:323px;float:left;margin:15px 30px 0 0;}div#bp-admin div.right-col{margin-right:0;}div.component{width:323px;margin:10px 0 40px 0;}div.component div.radio{position:relative;background:#f4f4f4;padding:5px 10px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-6px;right:10px;}div.component img{margin-top:2px;}div.component p{margin-left:4px;}div.component h5{font-size:15px;float:left;margin:0 0 0 4px;}div.component div.radio{font-size:11px;float:right;}div#bp-admin div.prev-next,div#bp-admin div.prev-next p,div#bp-admin div.submit,div#bp-admin div.submit p{margin:0;padding:0;}div#bp-admin div.submit{margin-top:30px;}div#bp-admin div.prev-next{text-align:right;margin-top:0;}div#bp-admin div.prev-next{border-bottom:1px solid #f0f0f0;margin:0 -20px;padding:0 20px 10px;}div#bp-admin table td{font-family:helvetica,arial,tahoma,sans-serif;}div#bp-admin table.form-table th{border-right:1px solid #eee;width:208px;padding:15px 25px 15px 0;color:#555;}div#bp-admin table.form-table tr{border-bottom:1px dotted #f0f0f0;}div#bp-admin table.form-table td{padding-left:25px;font-size:12px;}div#bp-admin table.form-table th h5{font-size:14px;margin:0;line-height:150%;}div#bp-admin table.form-table th img{margin-top:5px;}div#bp-admin table.form-table th p{margin:3px 0 0 0;}div#bp-admin code,div#bp-admin kbd{font-size:12px;background:#f0f0f0;}div#bp-admin div#message code,div#bp-admin div#message kbd{background:#ffe293;}a.button{padding-top:4px;}a.installed,a.installed:hover,a.installed:active{padding-left:15px;color:#888;border-color:#ccc;cursor:default;}a.installed span{background:url(../images/installed.gif) left center no-repeat;padding:6px 10px 7px 6px;margin-left:-5px;}
Index: /trunk/bp-core/js/widget-members.js
===================================================================
--- /trunk/bp-core/js/widget-members.js (revision 3476)
+++ /trunk/bp-core/js/widget-members.js (revision 3477)
@@ -1,48 +1,1 @@
-jQuery(document).ready( function() {
- jQuery(".widget div#members-list-options a").live('click',
- function() {
- jQuery('#ajax-loader-members').toggle();
-
- jQuery(".widget div#members-list-options a").removeClass("selected");
- jQuery(this).addClass('selected');
-
- jQuery.post( ajaxurl, {
- action: 'widget_members',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': jQuery("input#_wpnonce-members").val(),
- 'max-members': jQuery("input#members_widget_max").val(),
- 'filter': jQuery(this).attr('id')
- },
- function(response)
- {
- jQuery('#ajax-loader-members').toggle();
- member_wiget_response(response);
- });
-
- return false;
- }
- );
-});
-
-function member_wiget_response(response) {
- response = response.substr(0, response.length-1);
- response = response.split('[[SPLIT]]');
-
- if ( response[0] != "-1" ) {
- jQuery(".widget ul#members-list").fadeOut(200,
- function() {
- jQuery(".widget ul#members-list").html(response[1]);
- jQuery(".widget ul#members-list").fadeIn(200);
- }
- );
-
- } else {
- jQuery(".widget ul#members-list").fadeOut(200,
- function() {
- var message = '
' + response[1] + '
';
- jQuery(".widget ul#members-list").html(message);
- jQuery(".widget ul#members-list").fadeIn(200);
- }
- );
- }
-}
+jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").live("click",function(){jQuery("#ajax-loader-members").toggle();jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(a){jQuery("#ajax-loader-members").toggle();member_wiget_response(a)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b=""+a[1]+"
";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}};
Index: /trunk/bp-groups/bp-groups-widgets.php
===================================================================
--- /trunk/bp-groups/bp-groups-widgets.php (revision 3476)
+++ /trunk/bp-groups/bp-groups-widgets.php (revision 3477)
@@ -14,6 +14,10 @@
parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ), $widget_ops );
- if ( is_active_widget( false, false, $this->id_base ) )
- wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery') );
+ if ( is_active_widget( false, false, $this->id_base ) ) {
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+ wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.dev.js', array( 'jquery' ) );
+ else
+ wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array( 'jquery' ) );
+ }
}
Index: /trunk/bp-groups/js/widget-groups.js
===================================================================
--- /trunk/bp-groups/js/widget-groups.js (revision 3476)
+++ /trunk/bp-groups/js/widget-groups.js (revision 3477)
@@ -1,48 +1,1 @@
-jQuery(document).ready( function() {
- jQuery(".widget div#groups-list-options a").live('click',
- function() {
- jQuery('#ajax-loader-groups').toggle();
-
- jQuery(".widget div#groups-list-options a").removeClass("selected");
- jQuery(this).addClass('selected');
-
- jQuery.post( ajaxurl, {
- action: 'widget_groups_list',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': jQuery("input#_wpnonce-groups").val(),
- 'max_groups': jQuery("input#groups_widget_max").val(),
- 'filter': jQuery(this).attr('id')
- },
- function(response)
- {
- jQuery('#ajax-loader-groups').toggle();
- groups_wiget_response(response);
- });
-
- return false;
- }
- );
-});
-
-function groups_wiget_response(response) {
- response = response.substr(0, response.length-1);
- response = response.split('[[SPLIT]]');
-
- if ( response[0] != "-1" ) {
- jQuery(".widget ul#groups-list").fadeOut(200,
- function() {
- jQuery(".widget ul#groups-list").html(response[1]);
- jQuery(".widget ul#groups-list").fadeIn(200);
- }
- );
-
- } else {
- jQuery(".widget ul#groups-list").fadeOut(200,
- function() {
- var message = '' + response[1] + '
';
- jQuery(".widget ul#groups-list").html(message);
- jQuery(".widget ul#groups-list").fadeIn(200);
- }
- );
- }
-}
+jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").live("click",function(){jQuery("#ajax-loader-groups").toggle();jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(a){jQuery("#ajax-loader-groups").toggle();groups_wiget_response(a)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b=""+a[1]+"
";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}};
Index: /trunk/bp-messages/bp-messages-cssjs.php
===================================================================
--- /trunk/bp-messages/bp-messages-cssjs.php (revision 3476)
+++ /trunk/bp-messages/bp-messages-cssjs.php (revision 3477)
@@ -8,10 +8,17 @@
add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
- wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ) );
- wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.js' );
- wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
- wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js' );
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+ wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ) );
+ wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js' );
+ wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
+ wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.dev.js' );
+
+ } else {
+ wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ) );
+ wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.js' );
+ wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
+ wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js' );
+ }
}
-
}
add_action( 'wp', 'messages_add_autocomplete_js', 2 );
@@ -21,5 +28,9 @@
if ( $bp->current_component == $bp->messages->slug && 'compose' == $bp->current_action ) {
- wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css' );
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+ wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css' );
+ else
+ wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css' );
+
wp_print_styles();
}
Index: /trunk/bp-messages/css/autocomplete/jquery.autocompletefb.css
===================================================================
--- /trunk/bp-messages/css/autocomplete/jquery.autocompletefb.css (revision 3476)
+++ /trunk/bp-messages/css/autocomplete/jquery.autocompletefb.css (revision 3477)
@@ -1,85 +1,1 @@
-.ac_results {
- padding: 0px;
- overflow: hidden;
- z-index: 99999;
- background: #fff;
- border: 1px solid #ccc;
- -moz-border-radius-bottomleft: 3px;
- -khtml-border-bottom-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
- -moz-border-radius-bottomright: 3px;
- -khtml-border-bottom-right-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
- .ac_results ul {
- width: 100%;
- list-style-position: outside;
- list-style: none;
- padding: 0;
- margin: 0;
- }
-
- .ac_results li {
- margin: 0px;
- padding: 5px 10px;
- cursor: pointer;
- display: block;
- font-size: 1em;
- line-height: 16px;
- overflow: hidden;
- }
- .ac_results li img {
- margin-right: 5px;
- }
-
-.ac_loading {
- background : url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat;
-}
-
-.ac_odd {
- background-color: #f0f0f0;
-}
-
-.ac_over {
- background-color: #888;
- color: #fff;
-}
-
-ul.acfb-holder {
- margin : 0;
- height : auto !important;
- height : 1%;
- overflow: hidden;
- padding: 0;
- list-style: none;
-}
- ul.acfb-holder li {
- float : left;
- margin : 0 5px 4px 0;
- list-style-type: none;
- }
-
- ul.acfb-holder li.friend-tab {
- border-radius : 3px;
- -moz-border-radius : 3px;
- -webkit-border-radius : 3px;
- border : 1px solid #ffe7c7;
- padding : 2px 7px 2px;
- background : #FFF9DF;
- font-size: 1em;
- }
- li.friend-tab img.avatar {
- border-width: 2px !important;
- vertical-align: middle;
- }
-
- li.friend-tab span.p {
- padding-left: 5px;
- font-size: 0.8em;
- cursor: pointer;
- }
-
-input#send-to-input { width: 275px !important; }
-
+.ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;}.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0;}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden;}.ac_results li img{margin-right:5px;}.ac_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat;}.ac_odd{background-color:#f0f0f0;}.ac_over{background-color:#888;color:#fff;}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none;}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none;}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px 2px;background:#FFF9DF;font-size:1em;}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle;}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer;}input#send-to-input{width:275px!important;}
Index: /trunk/bp-messages/js/autocomplete/jquery.autocomplete.js
===================================================================
--- /trunk/bp-messages/js/autocomplete/jquery.autocomplete.js (revision 3476)
+++ /trunk/bp-messages/js/autocomplete/jquery.autocomplete.js (revision 3477)
@@ -1,3 +1,3 @@
-/*!
+/*
* Autocomplete - jQuery plugin 1.0 Beta
*
@@ -11,720 +11,3 @@
*
*/
-
-;(function($) {
-
-$.fn.extend({
- autocomplete: function(urlOrData, options) {
- var isUrl = typeof urlOrData == "string";
- options = $.extend({}, $.Autocompleter.defaults, {
- url: isUrl ? urlOrData : null,
- data: isUrl ? null : urlOrData,
- delay: isUrl ? $.Autocompleter.defaults.delay : 10,
- max: options && !options.scroll ? 10 : 150
- }, options);
-
- // if highlight is set to false, replace it with a do-nothing function
- options.highlight = options.highlight || function(value) { return value; };
-
- return this.each(function() {
- new $.Autocompleter(this, options);
- });
- },
- result: function(handler) {
- return this.bind("result", handler);
- },
- search: function(handler) {
- return this.trigger("search", [handler]);
- },
- flushCache: function() {
- return this.trigger("flushCache");
- },
- setOptions: function(options){
- return this.trigger("setOptions", [options]);
- },
- unautocomplete: function() {
- return this.trigger("unautocomplete");
- }
-});
-
-$.Autocompleter = function(input, options) {
-
- var KEY = {
- UP: 38,
- DOWN: 40,
- DEL: 46,
- TAB: 9,
- RETURN: 13,
- ESC: 27,
- COMMA: 188,
- PAGEUP: 33,
- PAGEDOWN: 34
- };
-
- // Create $ object for input element
- var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
-
- var timeout;
- var previousValue = "";
- var cache = $.Autocompleter.Cache(options);
- var hasFocus = 0;
- var lastKeyPressCode;
- var config = {
- mouseDownOnSelect: false
- };
- var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-
- $input.keydown(function(event) {
- // track last key pressed
- lastKeyPressCode = event.keyCode;
- switch(event.keyCode) {
-
- case KEY.UP:
- event.preventDefault();
- if ( select.visible() ) {
- select.prev();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.DOWN:
- event.preventDefault();
- if ( select.visible() ) {
- select.next();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.PAGEUP:
- event.preventDefault();
- if ( select.visible() ) {
- select.pageUp();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.PAGEDOWN:
- event.preventDefault();
- if ( select.visible() ) {
- select.pageDown();
- } else {
- onChange(0, true);
- }
- break;
-
- // matches also semicolon
- case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
- case KEY.TAB:
- case KEY.RETURN:
- if( selectCurrent() ){
- // make sure to blur off the current field
- if( !options.multiple )
- $input.blur();
- event.preventDefault();
- $input.focus();
- }
- break;
-
- case KEY.ESC:
- select.hide();
- break;
-
- default:
- clearTimeout(timeout);
- timeout = setTimeout(onChange, options.delay);
- break;
- }
- }).keypress(function() {
- // having fun with opera - remove this binding and Opera submits the form when we select an entry via return
- }).focus(function(){
- // track whether the field has focus, we shouldn't process any
- // results if the field no longer has focus
- hasFocus++;
- }).blur(function() {
- hasFocus = 0;
- if (!config.mouseDownOnSelect) {
- hideResults();
- }
- }).click(function() {
- // show select when clicking in a focused field
- if ( hasFocus++ > 1 && !select.visible() ) {
- onChange(0, true);
- }
- }).bind("search", function() {
- // TODO why not just specifying both arguments?
- var fn = (arguments.length > 1) ? arguments[1] : null;
- function findValueCallback(q, data) {
- var result;
- if( data && data.length ) {
- for (var i=0; i < data.length; i++) {
- if( data[i].result.toLowerCase() == q.toLowerCase() ) {
- result = data[i];
- break;
- }
- }
- }
- if( typeof fn == "function" ) fn(result);
- else $input.trigger("result", result && [result.data, result.value]);
- }
- $.each(trimWords($input.val()), function(i, value) {
- request(value, findValueCallback, findValueCallback);
- });
- }).bind("flushCache", function() {
- cache.flush();
- }).bind("setOptions", function() {
- $.extend(options, arguments[1]);
- // if we've updated the data, repopulate
- if ( "data" in arguments[1] )
- cache.populate();
- }).bind("unautocomplete", function() {
- select.unbind();
- $input.unbind();
- });
-
-
- function selectCurrent() {
- var selected = select.selected();
- if( !selected )
- return false;
-
- var v = selected.result;
- previousValue = v;
-
- if ( options.multiple ) {
- var words = trimWords($input.val());
- if ( words.length > 1 ) {
- v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
- }
- v += options.multipleSeparator;
- }
-
- $input.val(v);
- hideResultsNow();
- $input.trigger("result", [selected.data, selected.value]);
- return true;
- }
-
- function onChange(crap, skipPrevCheck) {
- if( lastKeyPressCode == KEY.DEL ) {
- select.hide();
- return;
- }
-
- var currentValue = $input.val();
-
- if ( !skipPrevCheck && currentValue == previousValue )
- return;
-
- previousValue = currentValue;
-
- currentValue = lastWord(currentValue);
- if ( currentValue.length >= options.minChars) {
- $input.addClass(options.loadingClass);
- jQuery('.ajax-loader').show();
- if (!options.matchCase)
- currentValue = currentValue.toLowerCase();
- request(currentValue, receiveData, hideResultsNow);
- } else {
- stopLoading();
- select.hide();
- }
- };
-
- function trimWords(value) {
- if ( !value ) {
- return [""];
- }
- var words = value.split( $.trim( options.multipleSeparator ) );
- var result = [];
- $.each(words, function(i, value) {
- if ( $.trim(value) )
- result[i] = $.trim(value);
- });
- return result;
- }
-
- function lastWord(value) {
- if ( !options.multiple )
- return value;
- var words = trimWords(value);
- return words[words.length - 1];
- }
-
- // fills in the input box w/the first match (assumed to be the best match)
- function autoFill(q, sValue){
- // autofill in the complete box w/the first match as long as the user hasn't entered in more data
- // if the last user key pressed was backspace, don't autofill
- if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != 8 ) {
- // fill in the value (keep the case the user has typed)
- $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
- // select the portion of the value not typed by the user (so the next character will erase)
- $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
- }
- };
-
- function hideResults() {
- clearTimeout(timeout);
- timeout = setTimeout(hideResultsNow, 200);
- };
-
- function hideResultsNow() {
- select.hide();
- clearTimeout(timeout);
- stopLoading();
- if (options.mustMatch) {
- // call search and run callback
- $input.search(
- function (result){
- // if no value found, clear the input box
- if( !result ) $input.val("");
- }
- );
- }
- };
-
- function receiveData(q, data) {
- if ( data && data.length && hasFocus ) {
- stopLoading();
- select.display(data, q);
-
- var newData = data[0].value.split(';');
- data.value = newData[0];
-
- autoFill(q, data.value);
- select.show();
- } else {
- hideResultsNow();
- }
- };
-
- function request(term, success, failure) {
- if (!options.matchCase)
- term = term.toLowerCase();
- var data = cache.load(term);
- // recieve the cached data
- if (data && data.length) {
- success(term, data);
- // if an AJAX url has been supplied, try loading the data now
- } else if( (typeof options.url == "string") && (options.url.length > 0) ){
-
- var extraParams = {};
- $.each(options.extraParams, function(key, param) {
- extraParams[key] = typeof param == "function" ? param() : param;
- });
-
- $.ajax({
- // try to leverage ajaxQueue plugin to abort previous requests
- mode: "abort",
- // limit abortion to this input
- port: "autocomplete" + input.name,
- dataType: options.dataType,
- url: options.url,
- data: $.extend({
- q: lastWord(term),
- limit: options.max,
- action: 'messages_autocomplete_results',
- 'cookie': encodeURIComponent(document.cookie)
- }, extraParams),
- success: function(data) {
- var parsed = options.parse && options.parse(data) || parse(data);
- cache.add(term, parsed);
- success(term, parsed);
- }
- });
- } else {
- failure(term);
- }
- };
-
- function parse(data) {
- var parsed = [];
- var rows = data.split("\n");
- for (var i=0; i < rows.length; i++) {
- var row = $.trim(rows[i]);
- if (row) {
- row = row.split("|");
- parsed[parsed.length] = {
- data: row,
- value: row[0],
- result: options.formatResult && options.formatResult(row, row[0]) || row[0]
- };
- }
- }
- return parsed;
- };
-
- function stopLoading() {
- $input.removeClass(options.loadingClass);
- jQuery('.ajax-loader').hide();
- };
-
-};
-
-$.Autocompleter.defaults = {
- inputClass: "ac_input",
- resultsClass: "ac_results",
- loadingClass: "ac_loading",
- minChars: 1,
- delay: 400,
- matchCase: false,
- matchSubset: true,
- matchContains: false,
- cacheLength: 10,
- max: 100,
- mustMatch: false,
- extraParams: {},
- selectFirst: true,
- formatItem: function(row) { return row[0]; },
- autoFill: false,
- width: 0,
- multiple: false,
- multipleSeparator: ", ",
- highlight: function(value, term) {
- return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1");
- },
- scroll: true,
- scrollHeight: 250,
- attachTo: 'body'
-};
-
-$.Autocompleter.Cache = function(options) {
-
- var data = {};
- var length = 0;
-
- function matchSubset(s, sub) {
- if (!options.matchCase)
- s = s.toLowerCase();
- var i = s.indexOf(sub);
- if (i == -1) return false;
- return i == 0 || options.matchContains;
- };
-
- function add(q, value) {
- if (length > options.cacheLength){
- flush();
- }
- if (!data[q]){
- length++;
- }
- data[q] = value;
- }
-
- function populate(){
- if( !options.data ) return false;
- // track the matches
- var stMatchSets = {},
- nullData = 0;
-
- // no url was specified, we need to adjust the cache length to make sure it fits the local data store
- if( !options.url ) options.cacheLength = 1;
-
- // track all options for minChars = 0
- stMatchSets[""] = [];
-
- // loop through the array and create a lookup structure
- for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
- var rawValue = options.data[i];
- // if rawValue is a string, make an array otherwise just reference the array
- rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-
- var value = options.formatItem(rawValue, i+1, options.data.length);
- if ( value === false )
- continue;
-
- var firstChar = value.charAt(0).toLowerCase();
- // if no lookup array for this character exists, look it up now
- if( !stMatchSets[firstChar] )
- stMatchSets[firstChar] = [];
-
- // if the match is a string
- var row = {
- value: value,
- data: rawValue,
- result: options.formatResult && options.formatResult(rawValue) || value
- };
-
- // push the current match into the set list
- stMatchSets[firstChar].push(row);
-
- // keep track of minChars zero items
- if ( nullData++ < options.max ) {
- stMatchSets[""].push(row);
- }
- };
-
- // add the data items to the cache
- $.each(stMatchSets, function(i, value) {
- // increase the cache size
- options.cacheLength++;
- // add to the cache
- add(i, value);
- });
- }
-
- // populate any existing data
- setTimeout(populate, 25);
-
- function flush(){
- data = {};
- length = 0;
- }
-
- return {
- flush: flush,
- add: add,
- populate: populate,
- load: function(q) {
- if (!options.cacheLength || !length)
- return null;
- /*
- * if dealing w/local data and matchContains than we must make sure
- * to loop through all the data collections looking for matches
- */
- if( !options.url && options.matchContains ){
- // track all matches
- var csub = [];
- // loop through all the data grids for matches
- for( var k in data ){
- // don't search through the stMatchSets[""] (minChars: 0) cache
- // this prevents duplicates
- if( k.length > 0 ){
- var c = data[k];
- $.each(c, function(i, x) {
- // if we've got a match, add it to the array
- if (matchSubset(x.value, q)) {
- csub.push(x);
- }
- });
- }
- }
- return csub;
- } else
- // if the exact item exists, use it
- if (data[q]){
- return data[q];
- } else
- if (options.matchSubset) {
- for (var i = q.length - 1; i >= options.minChars; i--) {
- var c = data[q.substr(0, i)];
- if (c) {
- var csub = [];
- $.each(c, function(i, x) {
- if (matchSubset(x.value, q)) {
- csub[csub.length] = x;
- }
- });
- return csub;
- }
- }
- }
- return null;
- }
- };
-};
-
-$.Autocompleter.Select = function (options, input, select, config) {
- var CLASSES = {
- ACTIVE: "ac_over"
- };
-
- var listItems,
- active = -1,
- data,
- term = "",
- needsInit = true,
- element,
- list;
-
- // Create results
- function init() {
- if (!needsInit)
- return;
- element = $("")
- .hide()
- .addClass(options.resultsClass)
- .css("position", "absolute")
- .appendTo(options.attachTo);
-
- list = $("").appendTo(element).mouseover( function(event) {
- if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
- active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
- $(target(event)).addClass(CLASSES.ACTIVE);
- }
- }).click(function(event) {
- $(target(event)).addClass(CLASSES.ACTIVE);
- select();
- input.focus();
- return false;
- }).mousedown(function() {
- config.mouseDownOnSelect = true;
- }).mouseup(function() {
- config.mouseDownOnSelect = false;
- });
-
- if( options.width > 0 )
- element.css("width", options.width);
-
- needsInit = false;
- }
-
- function target(event) {
- var element = event.target;
- while(element && element.tagName != "LI")
- element = element.parentNode;
- // more fun with IE, sometimes event.target is empty, just ignore it then
- if(!element)
- return [];
- return element;
- }
-
- function moveSelect(step) {
- listItems.slice(active, active + 1).removeClass();
- movePosition(step);
- var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
- if(options.scroll) {
- var offset = 0;
- listItems.slice(0, active).each(function() {
- offset += this.offsetHeight;
- });
- if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
- list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
- } else if(offset < list.scrollTop()) {
- list.scrollTop(offset);
- }
- }
- };
-
- function movePosition(step) {
- active += step;
- if (active < 0) {
- active = listItems.size() - 1;
- } else if (active >= listItems.size()) {
- active = 0;
- }
- }
-
- function limitNumberOfItems(available) {
- return options.max && options.max < available
- ? options.max
- : available;
- }
-
- function fillList() {
- list.empty();
- var max = limitNumberOfItems(data.length);
- for (var i=0; i < max; i++) {
- if (!data[i])
- continue;
- var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
- if ( formatted === false )
- continue;
- var li = $("- ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_event" : "ac_odd").appendTo(list)[0];
- $.data(li, "ac_data", data[i]);
- }
- listItems = list.find("li");
- if ( options.selectFirst ) {
- listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
- active = 0;
- }
- list.bgiframe();
- }
-
- return {
- display: function(d, q) {
- init();
- data = d;
- term = q;
- fillList();
- },
- next: function() {
- moveSelect(1);
- },
- prev: function() {
- moveSelect(-1);
- },
- pageUp: function() {
- if (active != 0 && active - 8 < 0) {
- moveSelect( -active );
- } else {
- moveSelect(-8);
- }
- },
- pageDown: function() {
- if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
- moveSelect( listItems.size() - 1 - active );
- } else {
- moveSelect(8);
- }
- },
- hide: function() {
- element && element.hide();
- active = -1;
- },
- visible : function() {
- return element && element.is(":visible");
- },
- current: function() {
- return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
- },
- show: function() {
- var offset = $(input).offset();
- element.css({
- width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
- top: offset.top + input.offsetHeight,
- left: offset.left
- }).show();
- if(options.scroll) {
- list.scrollTop(0);
- list.css({
- maxHeight: options.scrollHeight,
- overflow: 'auto'
- });
-
- if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
- var listHeight = 0;
- listItems.each(function() {
- listHeight += this.offsetHeight;
- });
- var scrollbarsVisible = listHeight > options.scrollHeight;
- list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
- if (!scrollbarsVisible) {
- // IE doesn't recalculate width when scrollbar disappears
- listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
- }
- }
-
- }
- },
- selected: function() {
- var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
- return selected && selected.length && $.data(selected[0], "ac_data");
- },
- unbind: function() {
- element && element.remove();
- }
- };
-};
-
-$.Autocompleter.Selection = function(field, start, end) {
- if( field.createTextRange ){
- var selRange = field.createTextRange();
- selRange.collapse(true);
- selRange.moveStart("character", start);
- selRange.moveEnd("character", end);
- selRange.select();
- } else if( field.setSelectionRange ){
- field.setSelectionRange(start, end);
- } else {
- if( field.selectionStart ){
- field.selectionStart = start;
- field.selectionEnd = end;
- }
- }
- field.focus();
-};
-
-})(jQuery);
+(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){if(!g.multiple){b.blur()}x.preventDefault();b.focus()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(){}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);jQuery(".ajax-loader").show();if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(a.trim(g.multipleSeparator));var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);var x=y[0].value.split(";");y.value=x[0];q(z,y.value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(y),limit:g.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1")},scroll:true,scrollHeight:250,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("
").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u=k.size()){f=0}}}function b(t){return e.max&&e.max").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery);
Index: /trunk/bp-messages/js/autocomplete/jquery.autocompletefb.js
===================================================================
--- /trunk/bp-messages/js/autocomplete/jquery.autocompletefb.js (revision 3476)
+++ /trunk/bp-messages/js/autocomplete/jquery.autocompletefb.js (revision 3477)
@@ -1,3 +1,3 @@
-/*!
+/*
* jQuery plugin: autoCompletefb(AutoComplete Facebook)
* @requires jQuery v1.2.2 or later
@@ -14,57 +14,3 @@
* http://www.gnu.org/licenses/gpl.html
*/
-
-jQuery.fn.autoCompletefb = function(options)
-{
- var tmp = this;
- var settings =
- {
- ul : tmp,
- urlLookup : [""],
- acOptions : {},
- foundClass : ".friend-tab",
- inputClass : ".send-to-input"
- }
-
- if(options) jQuery.extend(settings, options);
-
- var acfb =
- {
- params : settings,
- removeFind : function(o){
- acfb.removeUsername(o);
- jQuery(o).unbind('click').parent().remove();
- jQuery(settings.inputClass,tmp).focus();
- return tmp.acfb;
- },
- removeUsername: function(o){
- var newID = o.parentNode.id.split('-');
- jQuery('#send-to-usernames').removeClass(newID[1]);
- }
- }
-
- jQuery(settings.foundClass+" img.p").click(function(){
- acfb.removeFind(this);
- });
-
- jQuery(settings.inputClass,tmp).autocomplete(settings.urlLookup,settings.acOptions);
- jQuery(settings.inputClass,tmp).result(function(e,d,f){
- var f = settings.foundClass.replace(/\./,'');
- var d = String(d).split(' (');
- var un = d[1].substr(0, d[1].length-1);
- var ln = '#link-' + un;
- var l = jQuery(ln).attr('value');
- var v = '- '+d[0]+' X
';
- var x = jQuery(settings.inputClass,tmp).before(v);
-
- jQuery('#send-to-usernames').addClass(un);
-
- jQuery('.p',x[0].previousSibling).click(function(){
- acfb.removeFind(this);
- });
- jQuery(settings.inputClass,tmp).val('');
- });
-
- jQuery(settings.inputClass,tmp).focus();
- return acfb;
-}
+jQuery.fn.autoCompletefb=function(b){var c=this;var d={ul:c,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};if(b){jQuery.extend(d,b)}var a={params:d,removeFind:function(e){a.removeUsername(e);jQuery(e).unbind("click").parent().remove();jQuery(d.inputClass,c).focus();return c.acfb},removeUsername:function(f){var e=f.parentNode.id.split("-");jQuery("#send-to-usernames").removeClass(e[1])}};jQuery(d.foundClass+" img.p").click(function(){a.removeFind(this)});jQuery(d.inputClass,c).autocomplete(d.urlLookup,d.acOptions);jQuery(d.inputClass,c).result(function(n,o,m){var m=d.foundClass.replace(/\./,"");var o=String(o).split(" (");var j=o[1].substr(0,o[1].length-1);var k="#link-"+j;var h=jQuery(k).attr("value");var i='- '+o[0]+' X
';var g=jQuery(d.inputClass,c).before(i);jQuery("#send-to-usernames").addClass(j);jQuery(".p",g[0].previousSibling).click(function(){a.removeFind(this)});jQuery(d.inputClass,c).val("")});jQuery(d.inputClass,c).focus();return a};
Index: /trunk/bp-messages/js/autocomplete/jquery.dimensions.js
===================================================================
--- /trunk/bp-messages/js/autocomplete/jquery.dimensions.js (revision 3476)
+++ /trunk/bp-messages/js/autocomplete/jquery.dimensions.js (revision 3477)
@@ -1,3 +1,3 @@
-/*!
+/*
* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
@@ -11,107 +11,3 @@
* Requires: jQuery 1.2+
*/
-
-(function($){
-
-$.dimensions = {
- version: '@VERSION'
-};
-
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-$.each( [ 'Height', 'Width' ], function(i, name){
-
- // innerHeight and innerWidth
- $.fn[ 'inner' + name ] = function() {
- if (!this[0]) return;
-
- var torl = name == 'Height' ? 'Top' : 'Left', // top or left
- borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
-
- return this[ name.toLowerCase() ]() + num(this, 'padding' + torl) + num(this, 'padding' + borr);
- };
-
- // outerHeight and outerWidth
- $.fn[ 'outer' + name ] = function(options) {
- if (!this[0]) return;
-
- var torl = name == 'Height' ? 'Top' : 'Left', // top or left
- borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
-
- options = $.extend({ margin: false }, options || {});
-
- return this[ name.toLowerCase() ]()
- + num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')
- + num(this, 'padding' + torl) + num(this, 'padding' + borr)
- + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
- };
-});
-
-// Create scrollLeft and scrollTop methods
-$.each( ['Left', 'Top'], function(i, name) {
- $.fn[ 'scroll' + name ] = function(val) {
- if (!this[0]) return;
-
- return val != undefined ?
-
- // Set the scroll offset
- this.each(function() {
- this == window || this == document ?
- window.scrollTo(
- name == 'Left' ? val : $(window)[ 'scrollLeft' ](),
- name == 'Top' ? val : $(window)[ 'scrollTop' ]()
- ) :
- this[ 'scroll' + name ] = val;
- }) :
-
- // Return the scroll offset
- this[0] == window || this[0] == document ?
- self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||
- $.boxModel && document.documentElement[ 'scroll' + name ] ||
- document.body[ 'scroll' + name ] :
- this[0][ 'scroll' + name ];
- };
-});
-
-$.fn.extend({
- position: function() {
- var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
-
- if (elem) {
- // Get *real* offsetParent
- offsetParent = this.offsetParent();
-
- // Get correct offsets
- offset = this.offset();
- parentOffset = offsetParent.offset();
-
- // Subtract element margins
- offset.top -= num(elem, 'marginTop');
- offset.left -= num(elem, 'marginLeft');
-
- // Add offsetParent borders
- parentOffset.top += num(offsetParent, 'borderTopWidth');
- parentOffset.left += num(offsetParent, 'borderLeftWidth');
-
- // Subtract the two offsets
- results = {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- }
-
- return results;
- },
-
- offsetParent: function() {
- var offsetParent = this[0].offsetParent;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
- offsetParent = offsetParent.offsetParent;
- return $(offsetParent);
- }
-});
-
-var num = function(el, prop) {
- return parseInt($.css(el.jquery?el[0]:el,prop))||0;
-};
-
-})(jQuery);
+(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this[c.toLowerCase()]()+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var g=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});return this[c.toLowerCase()]()+a(this,"border"+g+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+g)+a(this,"padding"+e)+(f.margin?(a(this,"margin"+g)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});var a=function(c,d){return parseInt(b.css(c.jquery?c[0]:c,d))||0}})(jQuery);
Index: /trunk/bp-xprofile/admin/css/admin.css
===================================================================
--- /trunk/bp-xprofile/admin/css/admin.css (revision 3476)
+++ /trunk/bp-xprofile/admin/css/admin.css (revision 3477)
@@ -1,207 +1,1 @@
-/* Profile field group main admin page */
-#tabs {
- position: relative;
- }
- p.nofields {
- margin-top: 20px;
- }
-
- /* Field group tabs */
- ul#field-group-tabs {
- float: left;
- padding: 0 0 0 15px;
- display: none;
- }
- ul#field-group-tabs li {
- float: left;
- margin-bottom: -1px;
- background-color: #F7F6F1;
- margin-right: 8px;
- }
- ul#field-group-tabs li.ui-state-hover {
- background-color: #fafafa;
- }
- ul#field-group-tabs li.ui-state-hover a.ui-tab {
- border-color: #bbb #bbb #ccc #bbb;
- color: #888;
- }
- ul#field-group-tabs li.ui-state-acceptable a.ui-tab {
- border-color: #5a5 #5a5 #ccc #5a5;
- color: #8a8;
- background-image: url(../images/plus.gif);
- background-color: #efe;
- }
- ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab {
- background-color: #fff;
- background-image: url(../images/cross.gif);
- }
- ul#field-group-tabs li.drop-candidate a.ui-tab {
- background-color: #ffc;
- border-color: #aa5 #aa5 #ccc #aa5;
- color: #aa8;
- }
- ul#field-group-tabs li a.ui-tab {
- display: block;
- margin-top: 3px;
- padding: 8px 10px 8px 28px;
- border: 1px solid #ccc;
- border-bottom: none;
- -moz-border-radius: 5px 5px 0 0;
- -khtml-border-radius: 5px 5px 0 0;
- -webkit-border-radius: 5px 5px 0 0;
- border-radius: 5px 5px 0 0;
- text-decoration: none;
- background: url(../images/move-x.gif) 7px 55% no-repeat;
- color: #888;
- }
-
- /* Selected tab */
- ul#field-group-tabs li.ui-tabs-selected {
- background-color: #fff;
- }
- ul#field-group-tabs li.ui-tabs-selected a.ui-tab {
- margin-top: -1px;
- padding: 10px 10px 10px 28px;
- border: 1px solid #bbb;
- border-bottom: 1px solid transparent;
- color: #000;
- font-weight: bold;
- }
-
- /* Toolbar */
- .tab-toolbar {
- margin-top: 1px;
- clear: left;
- background-color: #fff;
- padding: 10px;
- border: 1px solid #bbb;
- }
-
- div.tab-wrapper {
- clear: left;
- margin-bottom: 20px;
- }
-
- .tab-wrapper fieldset {
- border: 1px solid #ddd;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- padding: 0 10px 10px;
- margin: 10px 0 0 0;
- position: relative;
- background-color: #fff;
- }
- .tab-wrapper fieldset fieldset {
- padding: 10px 10px 20px 10px;
- background-color: #fcfcfc;
- }
- .field-group fieldset:hover {
- background-color: #fafafa;
- border-color: #ccc;
- }
- fieldset div.field-wrapper {
- padding-left: 30px;
- background: url(../images/move.gif) 0px 3px no-repeat transparent;
- }
- fieldset.radio div div,
- fieldset.checkbox div div {
- float: left;
- }
- fieldset.radio div div label,
- fieldset.checkbox div div label {
- margin-right: 20px;
- }
-
- fieldset.clear-value {
- margin-left: 10px;
- }
- .field-group div.actions {
- display: none;
- position: absolute;
- right: 20px;
- top: 0;
- }
- .field-group fieldset:hover div.actions {
- display: block;
- }
- .field-group fieldset.ui-sortable-placeholder {
- border: 1px dashed #999;
- background-color: #eee;
- visibility: visible !important;
- }
-
- ul.forTab {
- list-style: none;
- padding: 0;
- margin: 0 0 0 1em;
- }
- ul.forTab li {
- margin: 0 0 1em 0;
- }
-
- ul.forTab li label {
- display: block;
- }
-
- ul.forTab li input {
- font-size: 1.4em;
- }
-
- p.success { background: green;}
- p.err {
- border-top: 2px solid red;
- border-bottom: 2px solid red;
- color: red;
- padding: 5px 0;
- width: 40%;
- }
-
- span.desc, span.signup-description {
- display: block;
- font-size: 11px;
- color: #555;
- }
-
- select.multi-select {
- width:90%;
- height:10em !important;
- }
-
-ul.multi-checkbox {
- margin: 0 5px 0 0px;
- padding: .5em .9em;
- height: 10em;
- overflow: auto;
- list-style: none;
- border: solid 1px #ccc;
- width: 90%;
-}
-
-ul.multi-checkbox li {
- padding: 0;
- margin: 0;
-}
-
-div.options-box {
- margin-left: 20px !important;
- margin-right: 10px !important;
- border-left: 4px solid #EAF3FA;
- padding-left: 15px;
-}
-
-th a {
- background: #fff;
- padding: 2px 5px;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- top: -2px;
-}
-
-textarea#description {
- border: 1px solid #ddd;
- width: 85%;
-}
+#tabs{position:relative;}p.nofields{margin-top:20px;}ul#field-group-tabs{float:left;padding:0 0 0 15px;display:none;}ul#field-group-tabs li{float:left;margin-bottom:-1px;background-color:#F7F6F1;margin-right:8px;}ul#field-group-tabs li.ui-state-hover{background-color:#fafafa;}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#bbb #bbb #ccc #bbb;color:#888;}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc #5a5;color:#8a8;background-image:url(../images/plus.gif);background-color:#efe;}ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab{background-color:#fff;background-image:url(../images/cross.gif);}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc #aa5;color:#aa8;}ul#field-group-tabs li a.ui-tab{display:block;margin-top:3px;padding:8px 10px 8px 28px;border:1px solid #ccc;border-bottom:none;-moz-border-radius:5px 5px 0 0;-khtml-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;text-decoration:none;background:url(../images/move-x.gif) 7px 55% no-repeat;color:#888;}ul#field-group-tabs li.ui-tabs-selected{background-color:#fff;}ul#field-group-tabs li.ui-tabs-selected a.ui-tab{margin-top:-1px;padding:10px 10px 10px 28px;border:1px solid #bbb;border-bottom:1px solid transparent;color:#000;font-weight:bold;}.tab-toolbar{margin-top:1px;clear:left;background-color:#fff;padding:10px;border:1px solid #bbb;}div.tab-wrapper{clear:left;margin-bottom:20px;}.tab-wrapper fieldset{border:1px solid #ddd;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;padding:0 10px 10px;margin:10px 0 0 0;position:relative;background-color:#fff;}.tab-wrapper fieldset fieldset{padding:10px 10px 20px 10px;background-color:#fcfcfc;}.field-group fieldset:hover{background-color:#fafafa;border-color:#ccc;}fieldset div.field-wrapper{padding-left:30px;background:url(../images/move.gif) 0 3px no-repeat transparent;}fieldset.radio div div,fieldset.checkbox div div{float:left;}fieldset.radio div div label,fieldset.checkbox div div label{margin-right:20px;}fieldset.clear-value{margin-left:10px;}.field-group div.actions{display:none;position:absolute;right:20px;top:0;}.field-group fieldset:hover div.actions{display:block;}.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#eee;visibility:visible!important;}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em;}ul.forTab li{margin:0 0 1em 0;}ul.forTab li label{display:block;}ul.forTab li input{font-size:1.4em;}p.success{background:green;}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%;}span.desc,span.signup-description{display:block;font-size:11px;color:#555;}select.multi-select{width:90%;height:10em!important;}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:solid 1px #ccc;width:90%;}ul.multi-checkbox li{padding:0;margin:0;}div.options-box{margin-left:20px!important;margin-right:10px!important;border-left:4px solid #EAF3FA;padding-left:15px;}th a{background:#fff;padding:2px 5px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-2px;}textarea#description{border:1px solid #ddd;width:85%;}
Index: /trunk/bp-xprofile/admin/js/admin.js
===================================================================
--- /trunk/bp-xprofile/admin/js/admin.js (revision 3476)
+++ /trunk/bp-xprofile/admin/js/admin.js (revision 3477)
@@ -1,218 +1,1 @@
-function add_option(forWhat) {
- var holder = document.getElementById(forWhat + "_more");
- var theId = document.getElementById(forWhat + '_option_number').value;
-
- var newDiv = document.createElement('p');
- newDiv.setAttribute('id', forWhat + '_div' + theId);
-
- var newOption = document.createElement('input');
- newOption.setAttribute('type', 'text');
- newOption.setAttribute('name', forWhat + '_option[' + theId + ']');
- newOption.setAttribute('id', forWhat + '_option' + theId);
-
- var label = document.createElement('label');
- label.setAttribute('for', forWhat + '_option' + theId);
-
- var txt = document.createTextNode("Option " + theId + ": ");
- label.appendChild(txt);
-
- var isDefault = document.createElement('input');
-
- if(forWhat == 'checkbox' || forWhat == 'multiselectbox') {
- isDefault.setAttribute('type', 'checkbox');
- isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option[' + theId + ']');
- } else {
- isDefault.setAttribute('type', 'radio');
- isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option');
- }
-
- isDefault.setAttribute('value', theId);
-
- var label1 = document.createElement('label');
- var txt1 = document.createTextNode(" Default Value ");
-
- label1.appendChild(txt1);
- label1.setAttribute('for', 'isDefault_' + forWhat + '_option[]');
- toDelete = document.createElement('a');
-
- toDeleteText = document.createTextNode('[x]');
- toDelete.setAttribute('href',"javascript:hide('" + forWhat + '_div' + theId + "')");
-
- toDelete.setAttribute('class','delete');
-
- toDelete.appendChild(toDeleteText);
-
- newDiv.appendChild(label);
- newDiv.appendChild(newOption);
- newDiv.appendChild(document.createTextNode(" "));
- newDiv.appendChild(isDefault);
- newDiv.appendChild(label1);
- newDiv.appendChild(toDelete);
- holder.appendChild(newDiv);
-
-
- theId++
- document.getElementById(forWhat + "_option_number").value = theId;
-}
-
-function show_options(forWhat) {
- document.getElementById("radio").style.display = "none";
- document.getElementById("selectbox").style.display = "none";
- document.getElementById("multiselectbox").style.display = "none";
- document.getElementById("checkbox").style.display = "none";
-
- if(forWhat == "radio")
- document.getElementById("radio").style.display = "";
-
- if(forWhat == "selectbox")
- document.getElementById("selectbox").style.display = "";
-
- if(forWhat == "multiselectbox")
- document.getElementById("multiselectbox").style.display = "";
-
- if(forWhat == "checkbox")
- document.getElementById("checkbox").style.display = "";
-}
-
-function hide(id) {
- if ( !document.getElementById(id) ) return false;
-
- document.getElementById(id).style.display = "none";
- document.getElementById(id).value = '';
-}
-
-// Set up deleting options ajax
-jQuery(document).ready( function() {
-
- jQuery("a.ajax-option-delete").click(
- function() {
- var theId = this.id.split('-');
- theId = theId[1];
-
- jQuery.post( ajaxurl, {
- action: 'xprofile_delete_option',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': jQuery("input#_wpnonce").val(),
-
- 'option_id': theId
- },
- function(response)
- {});
- }
- );
-});
-
-var fixHelper = function(e, ui) {
- ui.children().each(function() {
- jQuery(this).width( jQuery(this).width() );
- });
- return ui;
-};
-
-// Main XProfile behavior layer
-jQuery(document).ready( function() {
- /* Show object if JS is enabled */
- jQuery( "ul#field-group-tabs" ).show();
-
- /* Allow reordering of field group tabs */
- jQuery( "ul#field-group-tabs" ).sortable( {
- cursor: 'move',
- axis: 'x',
- opacity: 0.6,
- items: 'li',
- tolerance: 'pointer',
-
- update: function() {
- jQuery.post( ajaxurl, {
- action: 'xprofile_reorder_groups',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_reorder_groups': jQuery( "input#_wpnonce_reorder_groups" ).val(),
- 'group_order': jQuery(this).sortable( 'serialize' )
- },
- function(response){});
- }
- }).disableSelection();
-
- /* Allow reordering of fields within groups */
- jQuery( "fieldset.field-group" ).sortable({
- cursor: 'move',
- opacity: 0.3,
- items: 'fieldset',
- tolerance: 'pointer',
-
- update: function() {
- jQuery.post( ajaxurl, {
- action: 'xprofile_reorder_fields',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_reorder_fields': jQuery( "input#_wpnonce_reorder_fields" ).val(),
- 'field_order': jQuery(this).sortable( 'serialize' ),
- 'field_group_id': jQuery(this).attr( 'id' )
- },
- function(response)
- {});
- }
- })
-
- /* Disallow text selection */
- .disableSelection()
-
- /* Change cursor to move if JS is enabled */
- .css( 'cursor', 'move' );
-
- /* tabs init with a custom tab template and an "add" callback filling in the content */
- var $tab_items;
- var $tabs = jQuery( "#tabs" ).tabs();
- set_tab_items( $tabs );
-
- function set_tab_items( $tabs ) {
- $tab_items = jQuery( "ul:first li", $tabs ).droppable({
- accept: ".connectedSortable fieldset",
- hoverClass: "ui-state-hover",
- activeClass: "ui-state-acceptable",
- touch: "pointer",
- tolerance: "pointer",
-
- /* When field is dropped on tab */
- drop: function( ev, ui ) {
- /* The tab */
- var $item = jQuery(this);
-
- /* The tab body */
- var $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
-
- /* Remove helper class */
- jQuery($item).removeClass( 'drop-candidate' );
-
- /* Hide field, change selected tab, and show new placement */
- ui.draggable.hide( 'slow', function() {
-
- /* Select new tab as current */
- $tabs.tabs( 'select', $tab_items.index( $item ) );
-
- /* Show new placement */
- jQuery(this).appendTo($list).show( 'slow' ).animate( {opacity: "1"}, 500 );
-
- /* Refresh $list variable */
- $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
- jQuery($list).find( 'p.nofields' ).hide( 'slow' );
-
- /* Ajax update field locations and orders */
- jQuery.post( ajaxurl, {
- action: 'xprofile_reorder_fields',
- 'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_reorder_fields': jQuery( "input#_wpnonce_reorder_fields" ).val(),
- 'field_order': jQuery( $list ).sortable( 'serialize' ),
- 'field_group_id': jQuery( $list ).attr( 'id' )
- },
- function(response){});
- });
- },
- over: function( event, ui ) {
- jQuery(this).addClass( 'drop-candidate' );
- },
- out: function( event, ui ) {
- jQuery(this).removeClass( 'drop-candidate' );
- }
- });
- }
-});
+function add_option(f){var h=document.getElementById(f+"_more");var j=document.getElementById(f+"_option_number").value;var a=document.createElement("p");a.setAttribute("id",f+"_div"+j);var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("name",f+"_option["+j+"]");g.setAttribute("id",f+"_option"+j);var i=document.createElement("label");i.setAttribute("for",f+"_option"+j);var e=document.createTextNode("Option "+j+": ");i.appendChild(e);var b=document.createElement("input");if(f=="checkbox"||f=="multiselectbox"){b.setAttribute("type","checkbox");b.setAttribute("name","isDefault_"+f+"_option["+j+"]")}else{b.setAttribute("type","radio");b.setAttribute("name","isDefault_"+f+"_option")}b.setAttribute("value",j);var d=document.createElement("label");var c=document.createTextNode(" Default Value ");d.appendChild(c);d.setAttribute("for","isDefault_"+f+"_option[]");toDelete=document.createElement("a");toDeleteText=document.createTextNode("[x]");toDelete.setAttribute("href","javascript:hide('"+f+"_div"+j+"')");toDelete.setAttribute("class","delete");toDelete.appendChild(toDeleteText);a.appendChild(i);a.appendChild(g);a.appendChild(document.createTextNode(" "));a.appendChild(b);a.appendChild(d);a.appendChild(toDelete);h.appendChild(a);j++;document.getElementById(f+"_option_number").value=j}function show_options(a){document.getElementById("radio").style.display="none";document.getElementById("selectbox").style.display="none";document.getElementById("multiselectbox").style.display="none";document.getElementById("checkbox").style.display="none";if(a=="radio"){document.getElementById("radio").style.display=""}if(a=="selectbox"){document.getElementById("selectbox").style.display=""}if(a=="multiselectbox"){document.getElementById("multiselectbox").style.display=""}if(a=="checkbox"){document.getElementById("checkbox").style.display=""}}function hide(a){if(!document.getElementById(a)){return false}document.getElementById(a).style.display="none";document.getElementById(a).value=""}jQuery(document).ready(function(){jQuery("a.ajax-option-delete").click(function(){var a=this.id.split("-");a=a[1];jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:a},function(b){})})});var fixHelper=function(b,a){a.children().each(function(){jQuery(this).width(jQuery(this).width())});return a};jQuery(document).ready(function(){jQuery("ul#field-group-tabs").show();jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:0.6,items:"li",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(d){})}}).disableSelection();jQuery("fieldset.field-group").sortable({cursor:"move",opacity:0.3,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(d){})}}).disableSelection().css("cursor","move");var b;var a=jQuery("#tabs").tabs();c(a);function c(d){b=jQuery("ul:first li",d).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(g,h){var e=jQuery(this);var f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate");h.draggable.hide("slow",function(){d.tabs("select",b.index(e));jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500);f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(f).find("p.nofields").hide("slow");jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(i){})})},over:function(e,f){jQuery(this).addClass("drop-candidate")},out:function(e,f){jQuery(this).removeClass("drop-candidate")}})}});
Index: /trunk/bp-xprofile/bp-xprofile-cssjs.php
===================================================================
--- /trunk/bp-xprofile/bp-xprofile-cssjs.php (revision 3476)
+++ /trunk/bp-xprofile/bp-xprofile-cssjs.php (revision 3477)
@@ -1,11 +1,13 @@