first commit

This commit is contained in:
2024-11-10 21:08:49 +01:00
commit 0d932ce5ee
14455 changed files with 2567501 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
(function () {
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
var field = document.getElementById( 'bbp-badge' ),
bee = document.getElementById( 'bbp-bee' ),
max_x = field.clientWidth - bee.offsetWidth,
max_y = field.clientHeight - bee.offsetHeight,
angle = 95,
offset = 95,
duration = 4,
canvas = 50,
start = null,
variance = 1;
function step( timestamp ) {
var progress, x, y;
if ( start === null ) {
start = timestamp;
variance = 1;
angle = 95;
}
progress = ( timestamp - start ) / duration / 1000;
angle = ( 360 * progress ) + offset;
x = variance * Math.sin( progress * 2 * Math.PI );
y = Math.cos( progress * 2 * Math.PI );
bee.style.left = max_x / 2 + ( canvas * x ) + 'px';
bee.style.bottom = max_y / 2 + ( canvas * y ) + 'px';
bee.style.transform = 'rotate(' + angle + 'deg)';
bee.style.webkitTransform = 'rotate(' + angle + 'deg)';
// Reset
if ( progress >= 1 ) {
start = null;
}
requestAnimationFrame( step );
}
requestAnimationFrame( step );
})();

View File

@@ -0,0 +1,3 @@
/*! This file is automatically generated. */
!function(){function e(t){var u,w,b;null===l&&(l=t,d=1,a=95),a=360*(u=(t-l)/r/1e3)+m,w=d*Math.sin(2*u*Math.PI),b=Math.cos(2*u*Math.PI),n.style.left=i/2+s*w+"px",n.style.bottom=o/2+s*b+"px",n.style.transform="rotate("+a+"deg)",n.style.webkitTransform="rotate("+a+"deg)",u>=1&&(l=null),requestAnimationFrame(e)}window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var t=document.getElementById("bbp-badge"),n=document.getElementById("bbp-bee"),i=t.clientWidth-n.offsetWidth,o=t.clientHeight-n.offsetHeight,a=95,m=95,r=4,s=50,l=null,d=1;requestAnimationFrame(e)}();

View File

@@ -0,0 +1,15 @@
jQuery( document ).ready( function() {
var bbp_author_id = jQuery( '#bbp_author_id' );
bbp_author_id.suggest(
bbp_author_id.data( 'ajax-url' ),
{
minchars: 1, // Allow single-digit user IDs
onSelect: function() {
var value = this.value;
bbp_author_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
}
}
);
} );

View File

@@ -0,0 +1,3 @@
/*! This file is automatically generated. */
jQuery(document).ready(function(){var a=jQuery("#bbp_author_id");a.suggest(a.data("ajax-url"),{minchars:1,onSelect:function(){var u=this.value;a.val(u.substr(0,u.indexOf(" ")))}})});

View File

@@ -0,0 +1,344 @@
/*jshint sub:true*/
/* global document, jQuery, ajaxurl, BBP_Converter */
jQuery( document ).ready( function ( $ ) {
'use strict';
// Variables
var message = $( '#bbp-converter-message' ),
stop = $( '#bbp-converter-stop' ),
start = $( '#bbp-converter-start' ),
restart = $( '#_bbp_converter_restart' ),
status = $( '#bbp-converter-status' ),
spinner = $( '#bbp-converter-spinner' ),
settings = $( '#bbp-converter-settings' ),
password = $( '#_bbp_converter_db_pass' ),
toggle = $( '.bbp-db-pass-toggle' ),
step_p = $( '#bbp-converter-step-percentage' ),
total_p = $( '#bbp-converter-total-percentage' ),
fields = settings.find( 'table:first-of-type input, table:first-of-type select' );
/**
* Show/hide db password button toggle
*
* @since 2.6.0 bbPress (r6676)
*
* @param {element} e
*/
toggle.on( 'click', function( e ) {
var type = ( password.attr( 'type' ) === 'password' ) ? 'text' : 'password';
password.attr( 'type', type );
toggle
.toggleClass( 'password' )
.toggleClass( 'text' );
e.preventDefault();
});
/**
* Start button click
*
* @since 2.6.0 bbPress (r6470)
*
* @param {element} e
*/
start.on( 'click', function( e ) {
bbp_converter_user_start();
e.preventDefault();
} );
/**
* Stop button click
*
* @since 2.6.0 bbPress (r6470)
*
* @param {element} e
*/
$( stop ).on( 'click', function( e ) {
bbp_converter_user_stop();
e.preventDefault();
} );
/**
* Start the converter
*
* @since 2.6.0 bbPress (r6470)
*
* @returns {void}
*/
function bbp_converter_user_start() {
bbp_converter_start();
}
/**
* Stop the converter
*
* @since 2.6.0 bbPress (r6470)
*
* @returns {void}
*/
function bbp_converter_user_stop() {
bbp_converter_stop(
BBP_Converter.strings.button_continue,
BBP_Converter.strings.import_stopped_user
);
}
/**
* Return values of converter settings
*
* @since 2.6.0 bbPress (r6470)
*
* @returns {converterL#2.bbp_converter_settings.values}
*/
function bbp_converter_settings() {
var values = {};
$.each( settings.serializeArray(), function( i, field ) {
values[ field.name ] = field.value;
} );
if ( values['_bbp_converter_restart'] ) {
restart.removeAttr( 'checked' );
}
if ( values['_bbp_converter_delay_time'] ) {
BBP_Converter.state.delay = parseInt( values['_bbp_converter_delay_time'], 10 ) * 1000;
}
values['action'] = 'bbp_converter_process';
values['_ajax_nonce'] = BBP_Converter.ajax_nonce;
return values;
}
/**
* Run the converter step
*
* @since 2.6.0 bbPress (r6470)
*
* @returns {void}
*/
function bbp_converter_post() {
$.post( ajaxurl, bbp_converter_settings(), function( response ) {
// Parse the json response
try {
var data = response.data;
// Success
if ( true === response.success ) {
bbp_converter_step( data );
// Failure
} else {
bbp_converter_stop();
}
} catch( e ) {
bbp_converter_stop();
}
}, 'json' );
}
/**
* Process the next step
*
* @since 2.6.0 bbPress (r6600)
*
* @param {object} data
* @returns {void}
*/
function bbp_converter_step( data ) {
// Bail if not running
if ( ! BBP_Converter.state.running ) {
return;
}
// Do the step
bbp_converter_log( data.progress );
bbp_converter_percentages( data.step_percent, data.total_percent );
bbp_converter_status( data );
bbp_converter_wait();
// Done
if ( data.current_step === data.final_step ) {
bbp_converter_stop(
BBP_Converter.strings.button_start,
BBP_Converter.strings.import_complete
);
}
}
/**
* Wait to do the next AJAX request
*
* @since 2.6.0 bbPress (r6600)
*
* @returns {void}
*/
function bbp_converter_wait() {
clearTimeout( BBP_Converter.state.running );
// Bail if not running
if ( ! BBP_Converter.state.running ) {
return;
}
// Wait, then POST
BBP_Converter.state.running = setTimeout( function() {
bbp_converter_post();
}, parseInt( BBP_Converter.state.delay, 10 ) );
}
/**
* Start the converter and set the various flags
*
* @since 2.6.0 bbPress (r6600)
*
* @returns {void}
*/
function bbp_converter_start() {
clearTimeout( BBP_Converter.state.running );
clearInterval( BBP_Converter.state.status );
BBP_Converter.state.running = true;
var log = BBP_Converter.strings.start_continue;
if ( false === BBP_Converter.state.started ) {
log = BBP_Converter.strings.start_start;
BBP_Converter.state.started = true;
}
bbp_converter_update(
BBP_Converter.strings.button_continue,
log,
BBP_Converter.strings.status_starting
);
message.addClass( 'started' );
start.hide();
stop.show();
console.log( fields );
spinner.css( 'visibility', 'visible' );
fields.prop( 'readonly', true );
bbp_converter_post();
}
/**
* Stop the converter, and update the UI
*
* @since 2.6.0 bbPress (r6470)
*
* @param {string} button New text for button
* @param {string} log New text to add to import monitor
*
* @returns {void}
*/
function bbp_converter_stop( button, log ) {
clearTimeout( BBP_Converter.state.running );
clearInterval( BBP_Converter.state.status );
BBP_Converter.state.running = false;
BBP_Converter.state.status = false;
if ( ! button ) {
button = BBP_Converter.strings.button_continue;
}
if ( ! log ) {
log = BBP_Converter.strings.status_stopped;
}
bbp_converter_update(
button,
log,
BBP_Converter.strings.status_stopped
);
start.show();
stop.hide();
spinner.css( 'visibility', 'hidden' );
fields.prop( 'readonly', false );
}
/**
* Update the various screen texts
*
* @since 2.6.0 bbPress (r6600)
*
* @param {string} b_text
* @param {string} p_text
* @param {string} s_text
*
* @returns {void}
*/
function bbp_converter_update( b_text, p_text, s_text ) {
start.val( b_text );
bbp_converter_log( p_text );
status.text( s_text );
}
/**
* Update the status
*
* @since 2.6.0 bbPress (r6513)
*
* @param {object} data
*
* @returns {void}
*/
function bbp_converter_status( data ) {
var remaining = parseInt( BBP_Converter.state.delay, 10 ) / 1000;
status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) );
clearInterval( BBP_Converter.state.status );
BBP_Converter.state.status = setInterval( function() {
remaining--;
status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) );
if ( remaining <= 0 ) {
clearInterval( BBP_Converter.state.status );
if ( parseInt( data.current_step, 10 ) < parseInt( data.final_step, 10 ) ) {
status.text( BBP_Converter.strings.status_up_next.replace( '%s', data.current_step ) );
} else {
status.text( BBP_Converter.strings.status_complete );
}
}
}, 1000 );
}
/**
* Prepend some text to the import monitor
*
* @since 2.6.0 bbPress (r6470)
*
* @param {string} text Text to prepend to the import monitor
*
* @returns {void}
*/
function bbp_converter_log( text ) {
text = '<p>' + text + '</p>';
message.prepend( text );
}
/**
* Prepend some text to the import monitor
*
* @since 2.6.0 bbPress (r6470)
*
* @returns {void}
*/
function bbp_converter_percentages( step_percent, total_percent ) {
step_p.width( step_percent + '%' );
total_p.width( total_percent + '%' );
}
} );

View File

@@ -0,0 +1,3 @@
/*! This file is automatically generated. */
jQuery(document).ready(function(t){"use strict";function e(){i()}function r(){c(BBP_Converter.strings.button_continue,BBP_Converter.strings.import_stopped_user)}function n(){var e={};return t.each(d.serializeArray(),function(t,r){e[r.name]=r.value}),e._bbp_converter_restart&&g.removeAttr("checked"),e._bbp_converter_delay_time&&(BBP_Converter.state.delay=1e3*parseInt(e._bbp_converter_delay_time,10)),e.action="bbp_converter_process",e._ajax_nonce=BBP_Converter.ajax_nonce,e}function s(){t.post(ajaxurl,n(),function(t){try{var e=t.data;!0===t.success?o(e):c()}catch(t){c()}},"json")}function o(t){BBP_Converter.state.running&&(p(t.progress),B(t.step_percent,t.total_percent),u(t),a(),t.current_step===t.final_step&&c(BBP_Converter.strings.button_start,BBP_Converter.strings.import_complete))}function a(){clearTimeout(BBP_Converter.state.running),BBP_Converter.state.running&&(BBP_Converter.state.running=setTimeout(function(){s()},parseInt(BBP_Converter.state.delay,10)))}function i(){clearTimeout(BBP_Converter.state.running),clearInterval(BBP_Converter.state.status),BBP_Converter.state.running=!0;var t=BBP_Converter.strings.start_continue;!1===BBP_Converter.state.started&&(t=BBP_Converter.strings.start_start,BBP_Converter.state.started=!0),_(BBP_Converter.strings.button_continue,t,BBP_Converter.strings.status_starting),v.addClass("started"),b.hide(),l.show(),console.log(h),P.css("visibility","visible"),h.prop("readonly",!0),s()}function c(t,e){clearTimeout(BBP_Converter.state.running),clearInterval(BBP_Converter.state.status),BBP_Converter.state.running=!1,BBP_Converter.state.status=!1,t||(t=BBP_Converter.strings.button_continue),e||(e=BBP_Converter.strings.status_stopped),_(t,e,BBP_Converter.strings.status_stopped),b.show(),l.hide(),P.css("visibility","hidden"),h.prop("readonly",!1)}function _(t,e,r){b.val(t),p(e),C.text(r)}function u(t){var e=parseInt(BBP_Converter.state.delay,10)/1e3;C.text(BBP_Converter.strings.status_counting.replace("%s",e)),clearInterval(BBP_Converter.state.status),BBP_Converter.state.status=setInterval(function(){e--,C.text(BBP_Converter.strings.status_counting.replace("%s",e)),e<=0&&(clearInterval(BBP_Converter.state.status),parseInt(t.current_step,10)<parseInt(t.final_step,10)?C.text(BBP_Converter.strings.status_up_next.replace("%s",t.current_step)):C.text(BBP_Converter.strings.status_complete))},1e3)}function p(t){t="<p>"+t+"</p>",v.prepend(t)}function B(t,e){m.width(t+"%"),x.width(e+"%")}var v=t("#bbp-converter-message"),l=t("#bbp-converter-stop"),b=t("#bbp-converter-start"),g=t("#_bbp_converter_restart"),C=t("#bbp-converter-status"),P=t("#bbp-converter-spinner"),d=t("#bbp-converter-settings"),f=t("#_bbp_converter_db_pass"),y=t(".bbp-db-pass-toggle"),m=t("#bbp-converter-step-percentage"),x=t("#bbp-converter-total-percentage"),h=d.find("table:first-of-type input, table:first-of-type select");y.on("click",function(t){var e="password"===f.attr("type")?"text":"password";f.attr("type",e),y.toggleClass("password").toggleClass("text"),t.preventDefault()}),b.on("click",function(t){e(),t.preventDefault()}),t(l).on("click",function(t){r(),t.preventDefault()})});

View File

@@ -0,0 +1,17 @@
jQuery( document ).ready(function() {
jQuery( '#misc-publishing-actions' ).find( '.misc-pub-section' ).first().remove();
jQuery( '#save-action' ).remove();
var bbp_topic_id = jQuery( '#bbp_topic_id' );
bbp_topic_id.suggest(
bbp_topic_id.data( 'ajax-url' ),
{
onSelect: function() {
var value = this.value;
bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
}
}
);
} );

View File

@@ -0,0 +1,3 @@
/*! This file is automatically generated. */
jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove();var e=jQuery("#bbp_topic_id");e.suggest(e.data("ajax-url"),{onSelect:function(){var i=this.value;e.val(i.substr(0,i.indexOf(" ")))}})});

View File

@@ -0,0 +1,4 @@
jQuery( document ).ready( function() {
jQuery( '#misc-publishing-actions' ).find( '.misc-pub-section' ).first().remove();
jQuery( '#save-action' ).remove();
} );

View File

@@ -0,0 +1,3 @@
/*! This file is automatically generated. */
jQuery(document).ready(function(){jQuery("#misc-publishing-actions").find(".misc-pub-section").first().remove(),jQuery("#save-action").remove()});