Skip to content

Commit

Permalink
Install plugin: bogo.
Browse files Browse the repository at this point in the history
Name: Bogo
Version: 3.7

See #3263.
  • Loading branch information
boonebgorges committed Oct 19, 2023
1 parent 82f5fc3 commit 61ce970
Show file tree
Hide file tree
Showing 39 changed files with 7,585 additions and 0 deletions.
528 changes: 528 additions & 0 deletions wp-content/plugins/bogo/admin/admin.php

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions wp-content/plugins/bogo/admin/includes/css/admin-rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* Language Packs */

#bogo-language-packs td:first-child {
border-right: 0;
padding-right: 16px;
}

#bogo-language-packs tr.active td:first-child {
border-right: 4px solid #00a0d2;
padding-right: 12px;
}

#bogo-language-packs td.status li.post-count,
#bogo-language-packs td.status li.page-count {
float: right;
margin: 6px 0 0 16px;
}

#bogo-language-packs td.status li.post-count a::before,
#bogo-language-packs td.status li.page-count a::before {
padding-left: 4px;
}

/* Terms Translation */

#bogo-terms-translation .large-text {
padding-right: 0;
margin-right: 0;
}

#bogo-terms-translation .large-text:hover {
padding-right: 5px;
margin-right: 1px;
}

#bogo-terms-translation .large-text:focus {
padding-right: 5px;
margin-right: 1px;
}

/* Post */

ul#bogo-translations li {
margin-right: 1.4em;
}

#bogo-add-translation-actions span.spinner,
#bogo-add-translation-actions button {
float: right;
}
144 changes: 144 additions & 0 deletions wp-content/plugins/bogo/admin/includes/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
fieldset.bogo-locale-options {
margin: 0px 12px 10px 0;
padding: 4px 4px 8px 8px;
border: 1px solid #dfdfdf;
}

#your-profile fieldset.bogo-locale-options {
margin: 0;
padding: 4px 0 0;
border: none;
}

.widget-content fieldset.bogo-locale-options {
margin-right: 0;
}

fieldset.bogo-locale-options legend {
font-style: italic;
color: #666666;
}

fieldset.bogo-locale-options label.bogo-locale-option {
display: inline-block;
white-space: nowrap;
margin: 6px 0.4em 0 0;
border: 1px solid #a7a7a7;
border-radius: 4px;
padding: 1px 4px 1px 2px;
background: #f1f1f1;
}

fieldset.bogo-locale-options label.bogo-locale-option.checked {
border: 1px solid #0074a2;
background: #d4eefe;
}

fieldset.bogo-locale-options label.bogo-locale-option input[type="checkbox"] {
width: 16px;
}

/* Language Packs */

#bogo-language-packs td {
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
padding: 10px;
}

#bogo-language-packs td:first-child {
border-left: 0;
padding-left: 16px;
}

#bogo-language-packs tr.active td {
background-color: #f7fcfe;
}

#bogo-language-packs tr.active td:first-child {
border-left: 4px solid #00a0d2;
padding-left: 12px;
}

#bogo-language-packs td.status ul {
margin: 0;
}

#bogo-language-packs td.status li.post-count,
#bogo-language-packs td.status li.page-count {
float: left;
margin: 6px 16px 0 0;
}

#bogo-language-packs td.status li.post-count a::before,
#bogo-language-packs td.status li.page-count a::before {
font: normal 20px/1 dashicons;
color: #82878c;
content: '\f159';
display: inline-block;
vertical-align: top;
padding-right: 4px;
text-decoration: none;
}

#bogo-language-packs td.status li.post-count a::before {
content: '\f109';
}

#bogo-language-packs td.status li.page-count a::before {
content: '\f105';
}

/* Terms Translation */

#bogo-terms-translation .large-text {
background: transparent;
color: #555;
font-size: 13px;
border: none;
box-shadow: none;
padding-left: 0;
margin-left: 0;
}

#bogo-terms-translation .large-text:hover {
background: #fff;
color: #32373c;
font-size: 14px;
border: 1px solid #ddd;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
padding-left: 5px;
margin-left: 1px;
}

#bogo-terms-translation .large-text:focus {
background: #fff;
color: #32373c;
font-size: 14px;
border: 1px solid #5b9dd9;
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
padding-left: 5px;
margin-left: 1px;
}

/* Post */

ul#bogo-translations li {
list-style-type: disc;
margin-left: 1.4em;
}

#bogo-translations-to-add {
width: 100%;
}

#bogo-add-translation-actions span.spinner,
#bogo-add-translation-actions button {
float: left;
}

/* Admin Bar */

#wpadminbar #wp-admin-bar-bogo-user-locale .ab-icon::before {
content: "\f326";
top: 2px;
}
114 changes: 114 additions & 0 deletions wp-content/plugins/bogo/admin/includes/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
( function( $ ) {

'use strict';

if ( typeof bogo === 'undefined' || bogo === null ) {
return;
}

bogo.langName = function( locale ) {
if ( bogo.availableLanguages[ locale ] ) {
return bogo.availableLanguages[ locale ].name;
} else {
return '';
}
};

$( function() {
$( 'body.options-general-php select#WPLANG' ).each( function() {
$( this ).find( 'option[selected="selected"]' ).removeAttr( 'selected' ).prop( 'selected', false );
var val = bogo.defaultLocale || 'en_US';
val = ( 'en_US' == val ? '' : val );
$( this ).find( 'option[value="' + val + '"]' ).first().attr( 'selected', 'selected' ).prop( 'selected', true );
} );
} );

$( function() {
$( '#bogo-add-translation' ).click( function() {
if ( ! bogo.currentPost.postId ) {
return;
}

var locale = $( '#bogo-translations-to-add' ).val();
var rest_url = bogo.apiSettings.getRoute(
'/posts/' + bogo.currentPost.postId + '/translations/' + locale );
$( '#bogo-add-translation' ).next( '.spinner' )
.css( 'visibility', 'visible' );

$.ajax( {
type: 'POST',
url: rest_url,
beforeSend: function( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', bogo.apiSettings.nonce );
}
} ).done( function( response ) {
var post = response[ locale ];

if ( ! post ) {
return;
}

var $added = $( '<a></a>' ).attr( {
href: post.edit_link,
target: '_blank',
rel: 'noopener noreferrer'
} ).html( function() {
var output = post.title.rendered;
output += ' <span class="screen-reader-text">'
+ bogo.l10n.targetBlank + '</span>';
return output;
} );

$added = $( '<li></li>' ).append( $added ).append(
' [' + bogo.langName( locale ) + ']' );
$( '#bogo-translations' ).append( $added );

$( '#bogo-translations-to-add option[value="' + locale + '"]' ).detach();

if ( $( '#bogo-translations-to-add option' ).length < 1 ) {
$( '#bogo-add-translation-actions' ).detach();
}
} ).always( function() {
$( '#bogo-add-translation' ).next( '.spinner' ).css( 'visibility', 'hidden' );
} );
} );
} );

$( function() {
if ( 'bogo-texts' == bogo.pagenow ) {
$( window ).on( 'beforeunload', function( event ) {
var changed = false;

$( '#bogo-terms-translation :text' ).each( function() {
if ( this.defaultValue != $( this ).val() ) {
changed = true;
}
} );

if ( changed ) {
event.returnValue = bogo.l10n.saveAlert;
return bogo.l10n.saveAlert;
}
} );

$( '#bogo-terms-translation' ).submit( function() {
$( window ).off( 'beforeunload' );
} );

$( '#select-locale' ).change( function() {
location = 'admin.php?page=bogo-texts&locale=' + $( this ).val();
} );
}
} );

bogo.apiSettings.getRoute = function( path ) {
var url = bogo.apiSettings.root;

url = url.replace(
bogo.apiSettings.namespace,
bogo.apiSettings.namespace + path );

return url;
};

} )( jQuery );
Loading

0 comments on commit 61ce970

Please sign in to comment.