Skip to content

Commit

Permalink
Merge pull request #21 from flymke/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
flymke committed Apr 22, 2014
2 parents e2b4df9 + 654277d commit 74d3ad3
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 104 deletions.
20 changes: 17 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
### OSX ###
.DS_Store
.DS_Store?
.AppleDouble
.LSOverride

# Thumbnails
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Icon must end with two \r.
Icon


### Komodo IDE ###
*.komodotools
*.komodoproject

### PhpStorm IDE ###
*.idea
16 changes: 14 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: mark, mark posts, highlight, highlight posts, status, post status, overview, post overview, featured, custom posts, featured posts, post, posts
Requires at least: 3.7
Tested up to: 3.9
Stable tag: 1.0.3
Stable tag: 1.0.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -16,7 +16,7 @@ Mark Posts plugin provides an easy way to mark and highlight posts, pages and po

= Features =

* Set up maker categories and colors
* Set up marker categories and colors
* Assign marker categories to posts/pages/cpt
* View them within the posts/pages/cpt overview lists
* Quick edit, bulk edit and edit all markers
Expand Down Expand Up @@ -56,6 +56,14 @@ If you find an issue, please [raise an issue](https://github.com/flymke/mark-pos

== Frequently Asked Questions ==

= Can I set specific user roles for specific markers? =

Check the [Custom Marker Limits](https://github.com/flymke/mark-posts/wiki/Custom-Marker-Limits) wiki page for further information

= Can I export/import markers? =

Check the [Export & Import](https://github.com/flymke/mark-posts/wiki/Export-&-Import) wiki page for further information

= I'm having issues getting the plugin to work what should I do? =

See [Mark Posts on Github](https://github.com/flymke/mark-posts) for detailed rundown of common issues
Expand All @@ -75,6 +83,10 @@ Visit [Mark Posts on Github](https://github.com/flymke/mark-posts)

== Changelog ==

= 1.0.4 =
* Add `mark_posts_marker_limit` filter for custom marker user roles
* Provide custom color palettes for markers

= 1.0.3 =
* Code refactoring

Expand Down
85 changes: 47 additions & 38 deletions admin/assets/css/admin.css
Original file line number Diff line number Diff line change
@@ -1,66 +1,75 @@
/* This stylesheet is used to style the admin option form of the plugin. */

/* Mark Posts Admin Styles */
.new-markers {
height: 20px;
height: 20px;
padding: 10px 0 5px 0;
}

.new-markers
.js-new-markers-intro {
display: none;
}

.new-marker,
.mark-posts-marker {
background: rgba(255,255,255); /* for IE */
background: rgba(255,255,255,.65);
color: #444;
line-height: 27px; /* in case of multiple lines for markers*/
padding: 0 5px;
margin: 0 0 0 3px;
background: rgba(255, 255, 255); /* for IE */
background: rgba(255, 255, 255, .65);
color: #444;
line-height: 27px; /* in case of multiple lines for markers*/
padding: 0 5px;
margin: 0 0 0 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
display: inline-block;
font-weight:bold;
-moz-border-radius: 3px;
border-radius: 3px;
display: inline-block;
font-weight: bold;
}

.mark-posts-marker {
margin-top:6px;
margin-top: 6px;
}

span.mark-posts-color {
position:absolute;
top:-41px;
right:30px;
width:20px;
height:20px;
display:block;
margin-left:10px;
position: absolute;
top: -41px;
right: 30px;
width: 20px;
height: 20px;
display: block;
margin-left: 10px;
}

span.mark-posts-color,
#mark_posts_options h3.hndle {
-webkit-transition: 100ms linear; /* Chrome 1-25, Safari 3.2+ */
-moz-transition: 100ms linear; /* Firefox 4-15 */
-o-transition: 100ms linear; /* Opera 10.50–12.00 */
transition: 100ms linear; /* Chrome 26, Firefox 16+, IE 10+, Opera 12.10+ */
-webkit-transition: 100ms linear; /* Chrome 1-25, Safari 3.2+ */
-moz-transition: 100ms linear; /* Firefox 4-15 */
-o-transition: 100ms linear; /* Opera 10.50–12.00 */
transition: 100ms linear; /* Chrome 26, Firefox 16+, IE 10+, Opera 12.10+ */
}

.mark_posts_pre {
position:absolute;
width:5px;
height:100%;
top:0;
left:0;
position: absolute;
width: 5px;
height: 100%;
top: 0;
left: 0;
}

a.mark-posts-initial {
display:inline-block;
margin-left:25px;
display: inline-block;
margin-left: 25px;
}

.mark-posts-copy {
margin-top:25px;
padding-top:25px;
margin-top: 25px;
padding-top: 25px;
}

#wpbody-content .quick-edit-row-page .inline-edit-col-right.mark-posts-quickedit {
margin-top:0;
width:50%;
float:right;
margin-top: 0;
width: 50%;
float: right;
}

.mark-posts-donate {
margin-top:15px;
margin-top: 15px;
}
45 changes: 24 additions & 21 deletions admin/assets/css/dashboard.css
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
/* dashboard widget styles */
/* Mark Posts Dashboard Widget Styles */
#markers_right_now {
overflow: hidden;
padding: 0px;
margin: 0;
overflow: hidden;
padding: 0px;
margin: 0;
}

#markers_right_now li {
width: 50%;
float: left;
margin-bottom: 10px;
width: 50%;
float: left;
margin-bottom: 10px;
}

#markers_right_now li span {
line-height: 1.4em;
font-size: 13px;
line-height: 1.4em;
font-size: 13px;
}

#markers_right_now li span:before {
font: 400 20px/1 dashicons;
content: '\f159';
speak: none;
display: block;
float: left;
margin: 0 5px 0 0;
padding: 0;
text-indent: 0;
text-align: center;
position: relative;
-webkit-font-smoothing: antialiased;
text-decoration: none!important;
font: 400 20px/1 dashicons;
content: '\f159';
speak: none;
display: block;
float: left;
margin: 0 5px 0 0;
padding: 0;
text-indent: 0;
text-align: center;
position: relative;
-webkit-font-smoothing: antialiased;
text-decoration: none !important;
}
4 changes: 3 additions & 1 deletion admin/assets/js/markposts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
// color picket setup
$(function () {
$('.my-color-field').wpColorPicker({
defaultColor: false
defaultColor: false,
palettes: ['#96D754', '#FFFA74', '#FF7150', '#9ABADC', '#FFA74C', '#158A61']
});
});

Expand Down Expand Up @@ -56,6 +57,7 @@
var color = $('select#mark_posts_term_id option:selected').data('color');
if (color)
$('#mark_posts_options h3.hndle').css('background-color', convertHex(color,25));
$('span.mark-posts-color').css('background-color', color);
$('select#mark_posts_term_id').on('change', function() {
var color = $('select#mark_posts_term_id option:selected').data('color');
$('#mark_posts_options h3.hndle').css('background-color', convertHex(color,25));
Expand Down
49 changes: 14 additions & 35 deletions admin/class-mark-posts-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,38 +276,19 @@ public function mark_posts_add_meta_box() {
*/
public function mark_posts_inner_meta_box( $post ) {

// Add an nonce field so we can check for it later.
// Add an nonce field so we can check for it later
wp_nonce_field( 'mark_posts_inner_meta_box', 'mark_posts_inner_meta_box_nonce' );

// Use get_post_meta to retrieve an existing value from the database.
$value = get_post_meta( $post->ID, 'mark_posts_term_id', true );

// Display the form, using the current value.
$content = '<p>' . __( 'Mark this post as:', 'mark-posts' ) . '</p>';

// Get Marker terms from DB
$markers_terms = get_terms( 'marker', 'hide_empty=0' );
$content .= '<select id="mark_posts_term_id" name="mark_posts_term_id">';
$content .= '<option value="">---</option>';
foreach ( $markers_terms as $marker_term ) {
if ( ISSET( $value ) && $marker_term->term_id == $value ) {
$content .= '<option value="' . $marker_term->term_id . '" data-color="' . $marker_term->description . '" selected="selected">' . $marker_term->name . '</option>';
$color_selected = $marker_term->description;
} else {
$content .= '<option value="' . $marker_term->term_id . '" data-color="' . $marker_term->description . '">' . $marker_term->name . '</option>';
}
}
$content .= '</select>';
echo '<p>' . __( 'Mark this post as:', 'mark-posts' ) . '</p>';

if ( ISSET( $color_selected ) ) {
$content .= '<span class="mark-posts-color" style="background:' . $color_selected . '"></span>';
} else {
$content .= '<span class="mark-posts-color"></span>';
}
// Get available markers as select dropdown
$markers = new Mark_Posts_Marker();
echo $markers->mark_posts_select( $post->ID );

$content .= '<p>' . sprintf( __( 'Click <a href="%s">here</a> to manage Marker categories.', 'mark-posts' ), esc_url( 'options-general.php?page=mark-posts' ) ) . '</p>';
echo '<span class="mark-posts-color"></span>';

echo '<p>' . sprintf( __( 'Click <a href="%s">here</a> to manage Marker categories.', 'mark-posts' ), esc_url( 'options-general.php?page=mark-posts' ) ) . '</p>';

echo $content;
}

/**
Expand Down Expand Up @@ -376,6 +357,7 @@ public function mark_posts_save( $post_id ) {
* @since 1.0.0
*
* @param $column_name Custom column name e.g. 'mark_posts_term_id'
* @param $post_id
*/
public function mark_posts_display_quickedit_box( $column_name ) {

Expand All @@ -388,14 +370,11 @@ public function mark_posts_display_quickedit_box( $column_name ) {
<label class="inline-edit-status alignleft">
<span class="title"><?php _e( 'Marker', 'mark-posts' ); ?></span>
<?php
$markers_terms = get_terms( 'marker', 'hide_empty=0' );
$content = '<select name="mark_posts_term_id">';
$content .= '<option value="">---</option>';
foreach ( $markers_terms as $marker_term ) {
$content .= '<option value="' . $marker_term->term_id . '" data-color="' . $marker_term->description . '">' . $marker_term->name . '</option>';
}
$content .= '</select>';
echo $content;

// Get available markers as select dropdown
$markers = new Mark_Posts_Marker();
echo $markers->mark_posts_select();

?>
</label>
</div>
Expand Down
Loading

0 comments on commit 74d3ad3

Please sign in to comment.