Commit fa4717ea by Romain Duminil

Suppression edit-flow

parent 9d6ea14f
# Want to contribute?
So you’ve taken a liking to Edit Flow and decided you want to give back. That's awesome! We'd love to have you help.
Bug Reports
------
Find a bug in Edit Flow? Let us know about it by creating a [new issue](https://github.com/Automattic/Edit-Flow/issues). Some recommendations for filing great bug reports below.
###### Great Bug Reports
**1. Is it really a bug?**
Before filing a bug report, make sure you're running the latest versions of Edit Flow and WordPress.
Turn off all other plugins and switch to the default WordPress theme. If you still encounter the issue then you might have found a bug.
If the issue dissaepars, it was probably a conflict with one of your plugins or themes. Try activating only Edit flow and that theme or plugin to eliminate other variables. When the issue reappears, you've found the guilty party.
**2. Has the issue already been reported?**
To check if a bug has already been reported, try:
* Checking the current [list of opened issued](https://github.com/Automattic/Edit-Flow/issues?q=is%3Aopen)
* Looking through the [Edit Flow Support Forums](https://wordpress.org/support/plugin/edit-flow)
Not mentioned in either of those places? Doesn't appear to be caused by a conflict with another plugin or theme? You've found a bug!
**3. It's all in the details**
The more specific you can be, the easier it will be for someone to tackle the bug.
When creating a new issue a concise summary and clear description are key. If it's been mentioned by someone else, like on the [Edit Flow Support Forums](https://wordpress.org/support/plugin/edit-flow), include a link.
Here's a sample of what a great summary looks like:
Summary of the issue: The Edit Flow Calendar module is stuck on February 2
Steps to reproduce:
1. *Activate the Calendar module*
2. *Click the "Calendar" link in the sidebar*
Expected behavior: *The calendar should highlight today's date*
Actual behavior: *The calendar higlights February 2 as today's date*
Screenshots: *screenshot of behavior/error goes here*
Creating and submitting Patches
------
###### Creating the patch
If you’re fixing a bug, start by forking [Edit Flow's repository](https://github.com/Automattic/Edit-Flow/i) and clone that new fork of Edit Flow to your computer.
When writing your patch, make sure your code conforms to the [WordPress coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/#language-specific-standards). This guide will be used when reviewing your patch.
Also, make sure that your patch is documented correctly. Please follow the [WordPress inline documentation standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/#language-specific-standards) when documenting the code in your patch.
###### Submitting the patch
To share the changes you’ve made, you’ll need to push your changes to your repository on GitHub, and submit a pull request.
Keep the first line of your commit message brief. A quick explanation of your changes should do nicely. Go into more details on the following lines.
Not sure what to include your commit message? Take a look at the ["Description" section of the WordPress commit message documentation](https://make.wordpress.org/core/handbook/best-practices/commit-messages/#description). TThere is great advice for what should be included in when writing a clear, concise and relevant commit message.
After you've commited, push to your fork and create a Pull Request on Github.
Extending Edit Flow
------
Not sure you're ready to write a patch? Why not try extending Edit Flow? Take a look [here](http://editflow.org/extend/) for some ideas on how to extend current Edit Flow functionality.
The [Edit Flow Support Forums](https://wordpress.org/support/plugin/edit-flow) often have requests to add functionality to Edit Flow. Try and see if you can create this functionality by extending Edit Flow without modifying Edit Flow core.
It's a great way to add functionality to existing Edit Flow installations without having to go through the process of patching Edit Flow core.
(Props to Jetpack. These contributing guidelines were based on the [Contribute](https://jetpack.com/contribute/#contribute) section on the Jetpack website and the [Contributing](https://github.com/Automattic/jetpack/blob/master/.github/CONTRIBUTING.md) section in the [Jetpack Github repository](https://github.com/Automattic/jetpack/))
\ No newline at end of file
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
DB_HOST=${4-localhost}
WP_VERSION=${5-latest}
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/}
download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
fi
}
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
WP_TESTS_TAG="tags/$WP_VERSION"
else
# http serves a single offer, whereas https serves multiple. we only want one
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
if [[ -z "$LATEST_VERSION" ]]; then
echo "Latest WordPress version could not be found"
exit 1
fi
WP_TESTS_TAG="tags/$LATEST_VERSION"
fi
set -ex
install_wp() {
if [ -d $WP_CORE_DIR ]; then
return;
fi
mkdir -p $WP_CORE_DIR
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
fi
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}
install_test_suite() {
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i .bak'
else
local ioption='-i'
fi
# set up testing suite if it doesn't yet exist
if [ ! -d $WP_TESTS_DIR ]; then
# set up testing suite
mkdir -p $WP_TESTS_DIR
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
fi
cd $WP_TESTS_DIR
if [ ! -f wp-tests-config.php ]; then
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
fi
}
install_db() {
# parse DB_HOST for port or socket references
local PARTS=(${DB_HOST//\:/ })
local DB_HOSTNAME=${PARTS[0]};
local DB_SOCK_OR_PORT=${PARTS[1]};
local EXTRA=""
if ! [ -z $DB_HOSTNAME ] ; then
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
EXTRA=" --socket=$DB_SOCK_OR_PORT"
elif ! [ -z $DB_HOSTNAME ] ; then
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
fi
fi
# create database
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}
install_wp
install_test_suite
install_db
/* Admin menu icon size */
#adminmenu .toplevel_page_ef-settings .wp-menu-image img {
width: 16px;
height: 16px;
}
#ui-datepicker-div {
margin-top: 30px;
}
\ No newline at end of file
.list-filterizer-tools {
overflow: hidden;
}
.list-filterizer-tabs {
list-style: none;
padding: 0;
margin: 0;
float: right;
overflow: hidden;
}
.list-filterizer-tabs li {
color: #21759B;
border: 1px solid transparent;
cursor: pointer;
float: left;
padding: 2px 4px;
margin-right: 4px;
}
.list-filterizer-tabs li.active,
.list-filterizer-tabs li:hover {
background: #21759B;
border: 1px solid #21759B;
-webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px;
color: #fff;
}
.list-filterizer-tools .input-placeholder {
color: #999;
}
\ No newline at end of file
/*
* jQuery UI Datepicker 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
/* CSS for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; }
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
\ No newline at end of file
jQuery(document).ready(function($) {
$('.date-time-pick')
.datetimepicker({
dateFormat: 'M dd yy',
firstDay: ef_week_first_day,
alwaysSetTime: false,
controlType: 'select',
});
$('.date-pick')
.datepicker({
dateFormat: 'M dd yy',
firstDay: ef_week_first_day
});
});
/*
* ListFilterizer - jQuery plugin to easily add search and filtering options to lists
*
* Copyright (c) 2010 Mohammad Jangda (http://digitalize.ca)
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
*/
;(function($) {
// Console buster
if(typeof(console) === undefined) console = { log: function() {} }
// We need :contains to be case insensitive so lets redefine it as containsi (i for case insensitive)
// http://stackoverflow.com/questions/187537/is-there-a-case-insensitive-jquery-contains-selector
jQuery.expr[':'].containsi = function(a, i, m){
return (a.textContent || a.innerText || '').toLowerCase().indexOf(m[3].toLowerCase()) >= 0;
};
$.fn.listFilterizer = function(options) {
var options = $.extend({}, $.fn.listFilterizer.defaults, options)
, inputElem = document.createElement('input')
, filtersEnabled = options.filters.length > 0
;
return this.each(function() {
var $list, $tabs, $input, $tools, $container;
function init(list) {
$list = $(list);
$container = $('<' + options.containerTag + '/>')
.attr(options.containerAttrs)
;
$tools = $('<' + options.toolsTag + '/>')
.attr(options.toolsAttrs)
.addClass(options.toolsClass)
;
if(filtersEnabled) {
$tabs = $('<ul/>')
.addClass(options.tabsClass)
;
for(var i = 0; i < options.filters.length; i++) {
var filter = options.filters[i];
var $filterTab = $('<li/>')
.text(filter.label)
.attr(options._filterIdAttr, i)
.bind('click', _filterTabEvent)
;
$tabs.append($filterTab);
}
$tools.append($tabs)
}
// IE freaks out if you try to set the input type as search
var inputType = supportsSearch() ? 'search' : 'text';
$input = $('<input/>')
.attr('type', inputType)
.attr(options.inputAttrs)
.addClass(options.inputClass)
.bind('search', _filterInputSearch)
.bind('keydown', _filterInputKeydown)
.bind('keyup', _filterInputKeyup)
.attr('placeholder', options.inputPlaceholder)
;
// Fallback for browsers that don't support placeholders
if(!supportsPlaceholder()) {
$input
.addClass(options.inputPlaceholderClass)
.val(options.inputPlaceholder)
.focus(function() {
var $this = $(this);
if($this.val() == options.inputPlaceholder) {
$this
.val('')
.removeClass(options.inputPlaceholderClass)
;
}
})
.blur(function() {
var $this = $(this);
if(!$.trim($this.val())) {
$this
.val(options.inputPlaceholder)
.addClass(options.inputPlaceholderClass)
;
}
})
;
}
$tools.append($input);
// Wrap list in new container
$container
.append($tools)
.insertBefore($list)
.append($list)
;
// Filter to first
if(filtersEnabled) selectTab($tabs.children().first());
}
function _filterInputSearch(e) {
filterList();
return false;
}
function _filterInputKeydown(e) {
// Prevent enter key
switch(e.keyCode) {
case 13:
e.preventDefault();
break;
case 27:
e.target.setAttribute('value', '');
break;
default:
break;
}
}
function _filterInputKeyup(e) {
filterList();
}
function _filterTabEvent(e) {
e.preventDefault();
selectTab($(this));
}
function selectTab($tab) {
$tab
.siblings()
.removeClass(options.activeTabClass)
.end()
.addClass(options.activeTabClass)
;
filterList();
}
function filterList() {
var activeSearch = getActiveSearch();
var activeTab = getActiveTab();
var $filtered = $listItems = getListItems();
// Get visible items based on selected tab
if(activeTab) {
var filter = getFilter(activeTab);
$filtered = $filtered.filter(filter.selector) // TODO: should this be filtered from listitems?
}
// Filter based on search term
if(activeSearch) {
$filtered = $filtered.filter(':containsi('+ activeSearch +')');
}
$listItems.hide();
$filtered.show();
}
function getListItems() {
return $list.find(options.elementSelector);
}
function getFilter(filterId) {
return options.filters[filterId]
}
function getActiveSearch() {
var search = $input.val() || '';
search = (search == options.inputPlaceholder) ? '' : search;
return search;
}
function getActiveTab() {
if(filtersEnabled)
return $tabs.find('.'+options.activeTabClass).attr(options._filterIdAttr) || -1;
}
// Do the init thing!
init(this);
});
// Borrowed graciously from Modernizr: https://github.com/Modernizr/Modernizr
function supportsSearch() {
inputElem.setAttribute('type', 'search');
return inputElem.type !== 'text';
}
function supportsPlaceholder() {
return !!('placeholder' in inputElem);
}
}
$.fn.listFilterizer.defaults = {
filters: [
{
label: 'All'
, selector: '*'
}
,
{
label: 'Selected'
, selector: ':has(input:checked)' // TODO: pass in function as a filter selector
}
]
, showCounts: true // TODO: implement this
, selectedClass: 'selected'
, elementSelector: 'li'
, containerTag: 'div'
, containerAttrs: {}
, toolsTag: 'div'
, toolsClass: 'list-filterizer-tools'
, toolsAttrs: {}
, tabsClass: 'list-filterizer-tabs'
, tabsAttrs: {}
, activeTabClass: 'active'