Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d400bc3
First steps towards building an API harvester
matt-bernhardt Aug 23, 2016
362a73b
Sets up initialization and first call to load posts
matt-bernhardt Aug 25, 2016
ccd2dbf
More detail in simple loader, improved calling from base script
matt-bernhardt Aug 29, 2016
e48e48c
Starts to flesh out a renderer inside success action
matt-bernhardt Aug 29, 2016
4281588
Adds jshint step to Grunt for testing
matt-bernhardt Aug 29, 2016
9cedcd5
Add render function, postcontent getter/setter, and other details
matt-bernhardt Aug 30, 2016
488bc55
Add jshint review to additional-posts.js and myScripts.js
matt-bernhardt Aug 30, 2016
caf07bf
Clean myScripts.js, update for new syntaxes
matt-bernhardt Aug 30, 2016
bbe1393
Implement markup on author page for demonstration.
matt-bernhardt Aug 30, 2016
aeff833
Empty author template in preparation
matt-bernhardt Aug 30, 2016
9d8c792
More fleshing out additional-posts.js
matt-bernhardt Aug 30, 2016
099e6b5
Removes trailing commas, per CodeClimate
matt-bernhardt Aug 31, 2016
8b75545
Adds detail to card rendering, including jQueryUI Datepicker
matt-bernhardt Aug 31, 2016
076b5e9
Render card excerpt HTML correctly.
matt-bernhardt Aug 31, 2016
078f83f
Adds image and event support to card rendering
matt-bernhardt Aug 31, 2016
f9513ec
Cause 'show more' button to change when end of list is reached
matt-bernhardt Sep 1, 2016
90a17ba
Changes 'show more' button to just disappear at the end
matt-bernhardt Sep 1, 2016
12c2492
Adds uglify step to grunt build, renames a few properties
matt-bernhardt Sep 1, 2016
66a4cbd
Adds LazyLoad to the NPM build process
matt-bernhardt Sep 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"curly" : true,
"eqeqeq" : true,
"immed" : true,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"sub" : true,
"undef" : true,
"boss" : true,
"eqnull" : true,
"node" : true,
"es5" : false,
"globals" : {
"it" : false,
"xit" : false,
"describe" : false,
"xdescribe" : false,
"beforeEach" : false,
"afterEach" : false,
"expect" : false,
"spyOn" : false
}
}
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

// There are basically three phases of building the production theme:
// 0) Testing / linting
grunt.registerTask('test', ['jshint']);
// 1) Javascript preparation (concatenating and uglifying scripts)
// (coming soon)
grunt.registerTask('javascript', ['uglify']);
// 2) Stylesheet preparation (SASS, autoprefixing, and minification)
// (coming soon)
// 3) Appending the most recent git commit to the theme version
grunt.registerTask('release', ['gitinfo', 'replace']);
// The default task performs all three phases.
grunt.registerTask('default', ['release']);
grunt.registerTask('default', ['test', 'javascript', 'release']);

};
126 changes: 13 additions & 113 deletions author.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
* @since Twenty Twelve 1.0
*/

get_header(); ?>
get_header();

<?php get_template_part( 'inc/sub-header' ); ?>
get_template_part( 'inc/sub-header' );
?>

<div id="content" role="main">

<div id="content" role="main">
<?php if ( have_posts() ) : ?>

<?php if ( have_posts() ) : ?>
<div class="container">
<div class="row">
<div class="container">
<div class="row">

<?php

Expand All @@ -33,117 +34,16 @@
<h1 class="lib-header"><?php printf( 'Author: ' . '<strong>' . get_the_author( '', false ) . '</strong>' ); ?></h1>
</header><!-- .archive-header -->

<?php

/*
Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>

<?php twentytwelve_content_nav( 'nav-above' ); ?>

<?php
<div class="row" id="mitlibnews-container" data-postcontent="author" data-postauthor="<?php the_author_id(); ?>"></div>

/*
If a user has filled out their description, show a bio on their entries.

if ( get_the_author_meta( 'description' ) ) : ?>
<div class="author-info">
<div class="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 60 ) ); ?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>

<?php /* Start the Loop
*/
?>
<div class="row">
</div>
</div>





<?php
$i = -1;
while ( have_posts() ) : the_post();
$i ++;
?>

<div id="theBox" class="<?php if ( 0 == $i % 3 ) { echo 'third '; } ?>no-padding-left-mobile col-xs-12 col-xs-B-6 col-sm-4 col-md-4 col-lg-4">
<div class="flex-item blueTop eventsBox <?php if ( get_field( 'listImg' ) ) { echo 'has-image';
} else { echo 'no-image'; } ?>" onClick='location.href="<?php if ( ( '' != get_field( 'external_link' ) ) && 'spotlights' == $post->post_type ) { the_field( 'external_link' );
} else { echo get_post_permalink();} ?>"'>


<?php get_template_part( 'inc/spotlights' ); ?>

<?php
if ( get_field( 'listImg' ) != '' ) { ?>
<img data-original="<?php the_field( 'listImg' ) ?>" width="100%" height="111" class="img-responsive" alt="<?php the_title();?>"/>
<?php } ?>


<?php if ( 'spotlights' == $post->post_type ) { ?>
<h2 class="entry-title title-post spotlights">
<a href="<?php the_field( 'external_link' ); ?>"><?php the_title();?></a>
</h2>
<?php } else { ?>
<h2 class="entry-title title-post">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
</h2>
<?php } ?>


<?php get_template_part( 'inc/events' ); ?>

<?php get_template_part( 'inc/entry' ); ?>
<?php endif; ?>

<!--final **** else-->
<?php { ?>
<!--EVENT -->
<?php } ?>
<div class="category-post <?php if ( get_post_type( get_the_ID() ) == 'bibliotech' ) { echo 'Bibliotech';} ?>">
<?php
if ( get_post_type( get_the_ID() ) == 'bibliotech' ) {
echo "<div class='bilbioImg bilbioTechIcon'>
</div>";
echo "<div class='biblioPadding'>&nbsp;<a href='/news/bibliotech/' title='Bibliotech'>Bibliotech</a>";
} else {
$category = get_the_category();
$rCat = count( $category );
$r = rand( 0, $rCat -1 );
echo '<a title="' . $category[ $r ]->cat_name . '" title="' . $category[ $r ]->cat_name . '" href="' . get_category_link( $category[ $r ]->term_id ) . '">' . $category[ $r ]->cat_name . '</a>';
} ?>
<span class="mitDate">
<time class="updated" datetime="<?php echo get_the_date(); ?>">&nbsp;&nbsp;<?php echo get_the_date(); ?></time>
</span> </div>
</div><!--last-->
</div>
<?php if ( get_post_type( get_the_ID() ) == 'bibliotech' ) { ?>
</div><!--this div closes the open div in biblio padding-->
<?php } ?>





<?php endwhile; ?>
</div>
<?php get_template_part( 'inc/more-posts' ); ?>

<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div>
</div>
</div><!-- #content -->
</div><!-- #content -->

<div class="container">
<?php get_footer(); ?>
7 changes: 4 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ function add_styles() {
add_action( 'wp_enqueue_scripts', 'add_styles' );

/**
* Add LazyLoad and MyScripts for all users
* Add LazyLoad and MITLibNews for all users
*/
function add_scripts() {
wp_enqueue_script( 'lazyload', get_stylesheet_directory_uri() . '/js/lazyload.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'myScripts', get_stylesheet_directory_uri() . '/js/myScripts.js', array( 'lazyload' ), '', true );
wp_enqueue_script( 'lazyload', get_stylesheet_directory_uri() . '/js/build/jquery.lazyload.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'mitlibnews-more', get_stylesheet_directory_uri() . '/js/build/mitlibnews-more.min.js', array( 'jquery', 'jquery-ui-datepicker' ), '', true );
wp_enqueue_script( 'mitlibnews', get_stylesheet_directory_uri() . '/js/build/mitlibnews.min.js', array( 'lazyload', 'mitlibnews-more' ), '', true );
}
add_action( 'wp_enqueue_scripts', 'add_scripts' );

Expand Down
5 changes: 2 additions & 3 deletions inc/more-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

<div class="container">
<div id="postContainer" class="row" style="display:none">... loading ...</div>
<div class="col-xs-11 col-xs-B-4 col-sm-3 col-md-3 col-lg-3 readMorePosts col-centered">
<button id="another"> Show more </button>
<div id="anotherDiv" style="display:none">Sorry no more posts to display</div>
<div class="col-xs-11 col-xs-B-4 col-sm-3 col-md-3 col-lg-3 readMorePosts col-centered">
<button id="mitlibnews-another">Show more</button>
</div>
</div>
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<div class="container container-fluid">

<!-- OPEN ROW FOR REGULAR CARD LAYOUT -->
<div class="row">
<div class="row" id="mitlibnews">

<?php
$args = array(
Expand Down
15 changes: 0 additions & 15 deletions js/lazyload.js

This file was deleted.

Loading