Skip to content

Commit

Permalink
Merge branch '1.5.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Mar 2, 2014
2 parents 3168b6c + 6382f90 commit 61d9d35
Show file tree
Hide file tree
Showing 13 changed files with 385 additions and 265 deletions.
40 changes: 20 additions & 20 deletions includes/addon-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,37 +430,37 @@ public function filter_type( $types ) {
function filter_markup() {
$existing_terms = $this->get_item_terms();

// No need to show the filter if there are no terms to show
if ( empty( $existing_terms ) )
return;

$tag_filter = ! empty( $_GET['bpd_tag'] );

?>

<div id="docs-filter-section-tags" class="docs-filter-section<?php if ( $tag_filter ) : ?> docs-filter-section-open<?php endif ?>">
<ul id="tags-list">
<?php foreach( $existing_terms as $term => $posts ) : ?>
<?php $term_count = is_int( $posts ) ? $posts : count( $posts ) ?>
<li>
<a href="<?php echo bp_docs_get_tag_link( array( 'tag' => $term, 'type' => 'url' ) ) ?>" title="<?php echo esc_html( $term ) ?>"><?php echo esc_html( $term ) ?> <?php printf( __( '(%d)', 'bp-docs' ), $term_count ) ?></a>
<?php if ( !empty( $existing_terms ) ) : ?>
<?php foreach( $existing_terms as $term => $posts ) : ?>
<?php $term_count = is_int( $posts ) ? $posts : count( $posts ) ?>
<li>
<a href="<?php echo bp_docs_get_tag_link( array( 'tag' => $term, 'type' => 'url' ) ) ?>" title="<?php echo esc_html( $term ) ?>"><?php echo esc_html( $term ) ?> <?php printf( __( '(%d)', 'bp-docs' ), $term_count ) ?></a>

<?php /* Going with tag cloud type fix for now */ ?>
<?php /*
<?php /* Going with tag cloud type fix for now */ ?>
<?php /*
<?php
<?php
$checked = empty( $this->current_filters ) || ( !empty( $this->current_filters['tags'] ) && in_array( $term, $this->current_filters['tags'] ) ) ? true : false;
$checked = empty( $this->current_filters ) || ( !empty( $this->current_filters['tags'] ) && in_array( $term, $this->current_filters['tags'] ) ) ? true : false;
?>
<label for="filter_terms[<?php echo esc_attr( $term ) ?>]">
<input type="checkbox" value="1" name="filter_terms[<?php echo esc_attr( $term ) ?>]" <?php checked( $checked ) ?>/>
<?php echo esc_html( $term ) ?> <?php printf( __( '(%d)', 'bp-docs' ), count( $posts ) ) ?>
</label>
*/ ?>
</li>
?>
<label for="filter_terms[<?php echo esc_attr( $term ) ?>]">
<input type="checkbox" value="1" name="filter_terms[<?php echo esc_attr( $term ) ?>]" <?php checked( $checked ) ?>/>
<?php echo esc_html( $term ) ?> <?php printf( __( '(%d)', 'bp-docs' ), count( $posts ) ) ?>
</label>
*/ ?>
</li>

<?php endforeach ?>
<?php endforeach ?>
<?php else: ?>
<li><?php _e( 'No tags to show.', 'bp-docs' ) ?></li>
<?php endif; ?>
</ul>
</div>

Expand Down
8 changes: 6 additions & 2 deletions includes/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,11 @@ function body_class( $classes ) {
$classes[] = 'trashed-doc';
}

return $classes;
if ( wp_is_mobile() ) {
$classes[] = 'mobile';
}

return array_unique( $classes );
}

/**
Expand Down Expand Up @@ -1053,7 +1057,7 @@ public function get_item_terms( $terms ) {
$terms_array[ $t->slug ] = $t->count;
}

unset( $items, $terms );
unset( $item_ids, $terms );

return $terms_array;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/css/screen.css

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions includes/integration-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ function get_user_terms( $terms = array() ) {
* @param array $terms The terms to be saved to usermeta
*/
function save_user_terms( $terms ) {
if ( bp_is_user() ) {
update_user_meta( bp_displayed_user_id(), 'bp_docs_terms', $terms );

// bp_is_user isn't true at doc edit. (So neither is bp_displayed_user)
if ( bp_docs_is_docs_component() ) {
update_user_meta( bp_loggedin_user_id(), 'bp_docs_terms', $terms );
}
}

Expand Down
55 changes: 27 additions & 28 deletions includes/js/attachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,12 @@ window.wp = window.wp || {};

event.preventDefault();

// If the media frame already exists, reopen it.
if ( file_frame ) {
file_frame.open();
return;
}

BP_Docs_MediaFrame = wp.media.view.MediaFrame.Select.extend({
browseRouter: function( view ) {
view.set({
upload: {
text: wp.media.view.l10n.uploadFilesTitle,
priority: 20
}
});
}
});

file_frame = new BP_Docs_MediaFrame({
title: bp_docs.upload_title,
button: {
text: bp_docs.upload_button,
},
multiple: false
});

file_frame.open();

// Change to upload mode
Library = file_frame.states.get('library');
Library.frame.content.mode('upload');

// Open the dialog
file_frame.open();

return;
});

Expand All @@ -60,6 +35,18 @@ window.wp = window.wp || {};
} );
};

// Extension of the WP media view for our use
BP_Docs_MediaFrame = wp.media.view.MediaFrame.Select.extend({
browseRouter: function( view ) {
view.set({
upload: {
text: wp.media.view.l10n.uploadFilesTitle,
priority: 20
}
});
}
});

doc_id = wp.media.model.settings.post.id;

if ( 0 == doc_id ) {
Expand All @@ -72,4 +59,16 @@ window.wp = window.wp || {};
};
wp.media.ajax( 'bp_docs_create_dummy_doc', options );
}

$(document).ready(function(){
file_frame = new BP_Docs_MediaFrame({
title: bp_docs.upload_title,
button: {
text: bp_docs.upload_button,
},
multiple: false
});

Library = file_frame.states.get('library');
});
})(jQuery);
23 changes: 18 additions & 5 deletions includes/scss/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ body.bp-docs div.page ul {
padding: 2px 0 0;
}

body.mobile .row-actions {
visibility: visible;
}

.row-actions a {
color: #999;
font-size: 11px;
Expand Down Expand Up @@ -519,14 +523,13 @@ a.docs-filter-title.current {

#docs-filter-section-tags a.tags-action-button,
#docs-filter-section-tags a.tags-action-button:visited {
display: block; // Let the button span the entire box
display: inline;
line-height: 3em;
text-decoration: none;
text-align: center;
background: #fff;
background-opacity: .5;
padding: 5px 10px;
border-radius: 3px;
margin-bottom: 1em;
}

body.js .docs-filter-section {
Expand Down Expand Up @@ -833,13 +836,23 @@ table#post-revisions {
margin-top: 20px;
}

//Media query for larger screens
//Media query for most screens, unseen by IE 7 or 8
@media screen and (min-width:4em) {
#docs-filter-section-tags a.tags-action-button,
#docs-filter-section-tags a.tags-action-button:visited {
display: block; // Let the button span the entire box
margin-bottom: 1em;
padding: 0;
text-align: center;
}
}
//Media query for larger screens, like tablet
@media screen and (min-width:50em) {
.entry-content ul#tags-list {
@include multi-columns(4, 5%);
}
}
//Media query for larger screens
//Media query for larger screens, like desktop
@media screen and (min-width:71em) {
.entry-content ul#tags-list {
@include multi-columns(5, 5%);
Expand Down
5 changes: 4 additions & 1 deletion includes/theme-bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function bp_docs_template_include( $template = '' ) {
*
* @return bool
*/
function bp_docs_do_theme_compat() {
function bp_docs_do_theme_compat( $template = false ) {
return class_exists( 'BP_Theme_Compat' ) && apply_filters( 'bp_docs_do_theme_compat', true, $template );
}

Expand Down Expand Up @@ -131,6 +131,9 @@ public function is_docs() {
} else {
$this->single_content_template = 'docs/single/index';
add_filter( 'bp_docs_allow_comment_section', '__return_false' );

// Necessary as of BP 1.9.2
remove_action( 'bp_replace_the_content', 'bp_theme_compat_toggle_is_page', 9999 );
}

add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
Expand Down
Binary file modified languages/bp-docs-fr_FR.mo
Binary file not shown.
Binary file modified languages/bp-docs-ru_RU.mo
Binary file not shown.
Loading

0 comments on commit 61d9d35

Please sign in to comment.