Version Description
- New: If the search box contains (only) a numeric value it is interpreted as a search by attachment ID. You can search for a numeric value in the text fields, e.g., title, by putting quotes around the value.
- Fix: The edit taxonomy screen "Attachments" column is now computed correctly when adding new terms, avoiding fatal errors and other odd results.
- Fix: Adopted new WordPress standard for JavaScript files, i.e., use ".min.js" for minified (production) files.
Download this release
Release Info
Developer | dglingren |
Plugin | Media Library Assistant |
Version | 1.11 |
Comparing to | |
See all releases |
Code changes from version 1.10 to 1.11
- includes/class-mla-data.php +7 -0
- includes/class-mla-main.php +2 -2
- includes/class-mla-objects.php +30 -11
- index.php +2 -2
- js/mla-inline-edit-scripts.dev.js +0 -256
- js/mla-inline-edit-scripts.js +256 -1
- js/mla-inline-edit-scripts.min.js +1 -0
- js/mla-single-edit-scripts.dev.js +0 -274
- js/mla-single-edit-scripts.js +274 -1
- js/mla-single-edit-scripts.min.js +1 -0
- readme.txt +20 -101
- tpls/help-for-media_page_mla-menu.tpl +1 -0
includes/class-mla-data.php
CHANGED
@@ -595,6 +595,13 @@ class MLAData {
|
|
595 |
*/
|
596 |
$search_clause = '';
|
597 |
if ( isset( self::$query_parameters['s'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
if ( self::$query_parameters['sentence'] ) {
|
599 |
$search_terms = array( self::$query_parameters['s'] );
|
600 |
} else {
|
595 |
*/
|
596 |
$search_clause = '';
|
597 |
if ( isset( self::$query_parameters['s'] ) ) {
|
598 |
+
/*
|
599 |
+
* Interpret a numeric value as the ID of a specific attactment
|
600 |
+
*/
|
601 |
+
if(is_numeric( self::$query_parameters['s'] )) {
|
602 |
+
return ' AND ( ' . $wpdb->posts . '.ID = ' . absint( self::$query_parameters['s'] ) . ' ) ';
|
603 |
+
}
|
604 |
+
|
605 |
if ( self::$query_parameters['sentence'] ) {
|
606 |
$search_terms = array( self::$query_parameters['s'] );
|
607 |
} else {
|
includes/class-mla-main.php
CHANGED
@@ -38,7 +38,7 @@ class MLA {
|
|
38 |
*
|
39 |
* @var string
|
40 |
*/
|
41 |
-
const CURRENT_MLA_VERSION = '1.
|
42 |
|
43 |
/**
|
44 |
* Minimum version of PHP required for this plugin
|
@@ -272,7 +272,7 @@ class MLA {
|
|
272 |
wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-style.css', false, self::CURRENT_MLA_VERSION );
|
273 |
wp_enqueue_style( self::STYLESHEET_SLUG );
|
274 |
|
275 |
-
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '
|
276 |
|
277 |
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) ) {
|
278 |
wp_enqueue_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-single-edit-scripts{$suffix}.js",
|
38 |
*
|
39 |
* @var string
|
40 |
*/
|
41 |
+
const CURRENT_MLA_VERSION = '1.11';
|
42 |
|
43 |
/**
|
44 |
* Minimum version of PHP required for this plugin
|
272 |
wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-style.css', false, self::CURRENT_MLA_VERSION );
|
273 |
wp_enqueue_style( self::STYLESHEET_SLUG );
|
274 |
|
275 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
276 |
|
277 |
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) ) {
|
278 |
wp_enqueue_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-single-edit-scripts{$suffix}.js",
|
includes/class-mla-objects.php
CHANGED
@@ -110,9 +110,18 @@ class MLAObjects {
|
|
110 |
* @return array updated column definitions for the edit taxonomy list table
|
111 |
*/
|
112 |
public static function mla_taxonomy_get_columns_filter( $columns ) {
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
if ( isset ( $columns[ 'posts' ] ) )
|
117 |
unset( $columns[ 'posts' ] );
|
118 |
|
@@ -136,13 +145,21 @@ class MLAObjects {
|
|
136 |
* and alink to retrieve a list of them
|
137 |
*/
|
138 |
public static function mla_taxonomy_column_filter( $place_holder, $column_name, $term_id ) {
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
if ( is_wp_error( $term ) ) {
|
145 |
-
error_log( "ERROR: mla_taxonomy_column_filter( {$
|
146 |
return 0;
|
147 |
}
|
148 |
|
@@ -151,7 +168,7 @@ class MLAObjects {
|
|
151 |
'post_status' => 'inherit',
|
152 |
'tax_query' => array(
|
153 |
array(
|
154 |
-
'taxonomy' => $
|
155 |
'field' => 'slug',
|
156 |
'terms' => $term->slug,
|
157 |
'include_children' => false
|
@@ -160,12 +177,14 @@ class MLAObjects {
|
|
160 |
|
161 |
$results = new WP_Query( $request );
|
162 |
if ( ! empty( $results->error ) ){
|
163 |
-
error_log( "ERROR: mla_taxonomy_column_filter( {$
|
164 |
return 0;
|
165 |
}
|
166 |
|
|
|
|
|
167 |
return sprintf( '<a href="%s">%d</a>', esc_url( add_query_arg(
|
168 |
-
array( 'page' => 'mla-menu', 'mla-tax' => $
|
169 |
}
|
170 |
} //Class MLAObjects
|
171 |
?>
|
110 |
* @return array updated column definitions for the edit taxonomy list table
|
111 |
*/
|
112 |
public static function mla_taxonomy_get_columns_filter( $columns ) {
|
113 |
+
/*
|
114 |
+
* Adding a tag is done with AJAX, and there's no current screen object
|
115 |
+
*/
|
116 |
+
if ( isset( $_POST['action'] ) && ( 'add-tag' == $_POST['action'] ) ) {
|
117 |
+
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
$screen = get_current_screen();
|
121 |
+
$post_type = !empty( $screen->post_type ) ? $screen->post_type : 'post';
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( 'attachment' == $post_type ) {
|
125 |
if ( isset ( $columns[ 'posts' ] ) )
|
126 |
unset( $columns[ 'posts' ] );
|
127 |
|
145 |
* and alink to retrieve a list of them
|
146 |
*/
|
147 |
public static function mla_taxonomy_column_filter( $place_holder, $column_name, $term_id ) {
|
148 |
+
/*
|
149 |
+
* Adding a tag is done with AJAX, and there's no current screen object
|
150 |
+
*/
|
151 |
+
if ( isset( $_POST['action'] ) && ( 'add-tag' == $_POST['action'] ) ) {
|
152 |
+
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
$screen = get_current_screen();
|
156 |
+
$taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
|
157 |
+
}
|
158 |
+
|
159 |
+
$term = get_term( $term_id, $taxonomy );
|
160 |
|
161 |
if ( is_wp_error( $term ) ) {
|
162 |
+
error_log( "ERROR: mla_taxonomy_column_filter( {$taxonomy} ) - get_term " . $term->get_error_message(), 0 );
|
163 |
return 0;
|
164 |
}
|
165 |
|
168 |
'post_status' => 'inherit',
|
169 |
'tax_query' => array(
|
170 |
array(
|
171 |
+
'taxonomy' => $taxonomy,
|
172 |
'field' => 'slug',
|
173 |
'terms' => $term->slug,
|
174 |
'include_children' => false
|
177 |
|
178 |
$results = new WP_Query( $request );
|
179 |
if ( ! empty( $results->error ) ){
|
180 |
+
error_log( "ERROR: mla_taxonomy_column_filter( {$taxonomy} ) - WP_Query " . $results->error, 0 );
|
181 |
return 0;
|
182 |
}
|
183 |
|
184 |
+
$tax_object = get_taxonomy($taxonomy);
|
185 |
+
|
186 |
return sprintf( '<a href="%s">%d</a>', esc_url( add_query_arg(
|
187 |
+
array( 'page' => 'mla-menu', 'mla-tax' => $taxonomy, 'mla-term' => $term->slug, 'heading_suffix' => urlencode( $tax_object->label . ':' . $term->name ) ), 'upload.php' ) ), $results->post_count );
|
188 |
}
|
189 |
} //Class MLAObjects
|
190 |
?>
|
index.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* will the rest of the plugin be loaded and run.
|
7 |
*
|
8 |
* @package Media Library Assistant
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/*
|
@@ -14,7 +14,7 @@ Plugin Name: Media Library Assistant
|
|
14 |
Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
|
15 |
Description: Enhances the Media Library; powerful[mla_gallery], taxonomy support, IPTC/EXIF processing, bulk & quick edit actions and where-used reporting.
|
16 |
Author: David Lingren
|
17 |
-
Version: 1.
|
18 |
Author URI: http://fairtradejudaica.org/our-story/staff/
|
19 |
*/
|
20 |
|
6 |
* will the rest of the plugin be loaded and run.
|
7 |
*
|
8 |
* @package Media Library Assistant
|
9 |
+
* @version 1.11
|
10 |
*/
|
11 |
|
12 |
/*
|
14 |
Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
|
15 |
Description: Enhances the Media Library; powerful[mla_gallery], taxonomy support, IPTC/EXIF processing, bulk & quick edit actions and where-used reporting.
|
16 |
Author: David Lingren
|
17 |
+
Version: 1.11
|
18 |
Author URI: http://fairtradejudaica.org/our-story/staff/
|
19 |
*/
|
20 |
|
js/mla-inline-edit-scripts.dev.js
DELETED
@@ -1,256 +0,0 @@
|
|
1 |
-
// These functions are adapted from wp-admin/js/inline-edit-post.js
|
2 |
-
(function($) {
|
3 |
-
inlineEditAttachment = {
|
4 |
-
|
5 |
-
init : function(){
|
6 |
-
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
|
7 |
-
|
8 |
-
t.type = 'attachment';
|
9 |
-
t.what = '#attachment-';
|
10 |
-
|
11 |
-
// prepare the edit rows
|
12 |
-
qeRow.keyup(function(e){
|
13 |
-
if (e.which == 27)
|
14 |
-
return inlineEditAttachment.revert();
|
15 |
-
});
|
16 |
-
bulkRow.keyup(function(e){
|
17 |
-
if (e.which == 27)
|
18 |
-
return inlineEditAttachment.revert();
|
19 |
-
});
|
20 |
-
|
21 |
-
$('a.cancel', qeRow).click(function(){
|
22 |
-
return inlineEditAttachment.revert();
|
23 |
-
});
|
24 |
-
$('a.save', qeRow).click(function(){
|
25 |
-
return inlineEditAttachment.save(this);
|
26 |
-
});
|
27 |
-
$('td', qeRow).keydown(function(e){
|
28 |
-
if ( e.which == 13 )
|
29 |
-
return inlineEditAttachment.save(this);
|
30 |
-
});
|
31 |
-
|
32 |
-
$('a.cancel', bulkRow).click(function(){
|
33 |
-
return inlineEditAttachment.revert();
|
34 |
-
});
|
35 |
-
|
36 |
-
// add events
|
37 |
-
$('a.editinline').live('click', function(){
|
38 |
-
inlineEditAttachment.edit(this);
|
39 |
-
return false;
|
40 |
-
});
|
41 |
-
|
42 |
-
// hiearchical taxonomies expandable?
|
43 |
-
$('span.catshow').click(function(){
|
44 |
-
$(this).hide().next().show().parent().next().addClass("cat-hover");
|
45 |
-
});
|
46 |
-
|
47 |
-
$('span.cathide').click(function(){
|
48 |
-
$(this).hide().prev().show().parent().next().removeClass("cat-hover");
|
49 |
-
});
|
50 |
-
|
51 |
-
$('select[name="_status"] option[value="future"]', bulkRow).remove();
|
52 |
-
|
53 |
-
$('#doaction, #doaction2').click(function(e){
|
54 |
-
var n = $(this).attr('id').substr(2);
|
55 |
-
|
56 |
-
if ( $('select[name="'+n+'"]').val() == 'edit' ) {
|
57 |
-
e.preventDefault();
|
58 |
-
t.setBulk();
|
59 |
-
} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
|
60 |
-
t.revert();
|
61 |
-
}
|
62 |
-
});
|
63 |
-
|
64 |
-
// Filter button (dates, categories) in top nav bar
|
65 |
-
$('#post-query-submit').mousedown(function(e){
|
66 |
-
t.revert();
|
67 |
-
$('select[name^="action"]').val('-1');
|
68 |
-
});
|
69 |
-
},
|
70 |
-
|
71 |
-
toggle : function(el){
|
72 |
-
var t = this;
|
73 |
-
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
74 |
-
},
|
75 |
-
|
76 |
-
setBulk : function(){
|
77 |
-
var te = '', c = true;
|
78 |
-
this.revert();
|
79 |
-
|
80 |
-
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
|
81 |
-
$('table.widefat tbody').prepend( $('#bulk-edit') );
|
82 |
-
$('#bulk-edit').addClass('inline-editor').show();
|
83 |
-
|
84 |
-
$('tbody th.check-column input[type="checkbox"]').each(function(i){
|
85 |
-
if ( $(this).prop('checked') ) {
|
86 |
-
c = false;
|
87 |
-
var id = $(this).val(), theTitle;
|
88 |
-
theTitle = $('#inline_'+id+' .post_title').text() || mla_inline_edit_vars.notitle;
|
89 |
-
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+mla_inline_edit_vars.ntdeltitle+'">X</a>'+theTitle+'</div>';
|
90 |
-
}
|
91 |
-
});
|
92 |
-
|
93 |
-
if ( c )
|
94 |
-
return this.revert();
|
95 |
-
|
96 |
-
$('#bulk-titles').html(te);
|
97 |
-
$('#bulk-titles a').click(function(){
|
98 |
-
var id = $(this).attr('id').substr(1);
|
99 |
-
|
100 |
-
$('table.widefat input[value="' + id + '"]').prop('checked', false);
|
101 |
-
$('#ttle'+id).remove();
|
102 |
-
});
|
103 |
-
|
104 |
-
// support multi taxonomies?
|
105 |
-
// tax = 'post_tag';
|
106 |
-
// $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
107 |
-
|
108 |
-
//flat taxonomies
|
109 |
-
$('textarea.mla_tags').each(function(){
|
110 |
-
var taxname = $(this).attr('name').replace(']', '').replace('tax_input[', '');
|
111 |
-
|
112 |
-
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
113 |
-
});
|
114 |
-
|
115 |
-
$('html, body').animate( { scrollTop: 0 }, 'fast' );
|
116 |
-
},
|
117 |
-
|
118 |
-
edit : function(id) {
|
119 |
-
var t = this, fields, editRow, rowData, fIndex;
|
120 |
-
t.revert();
|
121 |
-
|
122 |
-
if ( typeof(id) == 'object' )
|
123 |
-
id = t.getId(id);
|
124 |
-
|
125 |
-
fields = ['post_title', 'post_name', 'post_excerpt', 'image_alt', 'post_parent', 'menu_order', 'post_author'];
|
126 |
-
|
127 |
-
// add the new blank row
|
128 |
-
editRow = $('#inline-edit').clone(true);
|
129 |
-
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
130 |
-
|
131 |
-
if ( $(t.what+id).hasClass('alternate') )
|
132 |
-
$(editRow).addClass('alternate');
|
133 |
-
$(t.what+id).hide().after(editRow);
|
134 |
-
|
135 |
-
// populate the data
|
136 |
-
rowData = $('#inline_'+id);
|
137 |
-
if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
|
138 |
-
// author no longer has edit caps, so we need to add them to the list of authors
|
139 |
-
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
|
140 |
-
}
|
141 |
-
|
142 |
-
if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
|
143 |
-
$('label.inline-edit-author', editRow).hide();
|
144 |
-
}
|
145 |
-
|
146 |
-
for ( fIndex = 0; fIndex < fields.length; fIndex++ ) {
|
147 |
-
$(':input[name="' + fields[fIndex] + '"]', editRow).val( $('.'+fields[fIndex], rowData).text() );
|
148 |
-
}
|
149 |
-
|
150 |
-
if ( $('.image_alt', rowData).length == 0) {
|
151 |
-
$('label.inline-edit-image-alt', editRow).hide();
|
152 |
-
}
|
153 |
-
|
154 |
-
// hierarchical taxonomies
|
155 |
-
$('.mla_category', rowData).each(function(){
|
156 |
-
var term_ids = $(this).text();
|
157 |
-
|
158 |
-
if ( term_ids ) {
|
159 |
-
taxname = $(this).attr('id').replace('_'+id, '');
|
160 |
-
$('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
|
161 |
-
}
|
162 |
-
});
|
163 |
-
|
164 |
-
//flat taxonomies
|
165 |
-
$('.mla_tags', rowData).each(function(){
|
166 |
-
var terms = $(this).text(),
|
167 |
-
taxname = $(this).attr('id').replace('_' + id, ''),
|
168 |
-
textarea = $('textarea.tax_input_' + taxname, editRow),
|
169 |
-
comma = mla_inline_edit_vars.comma;
|
170 |
-
|
171 |
-
if ( terms ) {
|
172 |
-
if ( ',' !== comma )
|
173 |
-
terms = terms.replace(/,/g, comma);
|
174 |
-
textarea.val(terms);
|
175 |
-
}
|
176 |
-
|
177 |
-
textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
178 |
-
});
|
179 |
-
|
180 |
-
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
181 |
-
$('.ptitle', editRow).focus();
|
182 |
-
|
183 |
-
return false;
|
184 |
-
},
|
185 |
-
|
186 |
-
save : function(id) {
|
187 |
-
var params, fields, page = $('.post_status_page').val() || '';
|
188 |
-
|
189 |
-
if ( typeof(id) == 'object' )
|
190 |
-
id = this.getId(id);
|
191 |
-
|
192 |
-
$('table.widefat .inline-edit-save .waiting').show();
|
193 |
-
|
194 |
-
params = {
|
195 |
-
action: mla_inline_edit_vars.ajax_action,
|
196 |
-
nonce: mla_inline_edit_vars.ajax_nonce,
|
197 |
-
post_type: typenow,
|
198 |
-
post_ID: id,
|
199 |
-
edit_date: 'true',
|
200 |
-
post_status: page
|
201 |
-
};
|
202 |
-
|
203 |
-
fields = $('#edit-'+id+' :input').serialize();
|
204 |
-
params = fields + '&' + $.param(params);
|
205 |
-
|
206 |
-
// make ajax request
|
207 |
-
$.post( ajaxurl, params,
|
208 |
-
function(r) {
|
209 |
-
$('table.widefat .inline-edit-save .waiting').hide();
|
210 |
-
|
211 |
-
if (r) {
|
212 |
-
if ( -1 != r.indexOf('<tr') ) {
|
213 |
-
$(inlineEditAttachment.what+id).remove();
|
214 |
-
$('#edit-'+id).before(r).remove();
|
215 |
-
$(inlineEditAttachment.what+id).hide().fadeIn();
|
216 |
-
} else {
|
217 |
-
r = r.replace( /<.[^<>]*?>/g, '' );
|
218 |
-
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
219 |
-
}
|
220 |
-
} else {
|
221 |
-
$('#edit-'+id+' .inline-edit-save .error').html(mla_inline_edit_vars.error).show();
|
222 |
-
}
|
223 |
-
}
|
224 |
-
, 'html');
|
225 |
-
return false;
|
226 |
-
},
|
227 |
-
|
228 |
-
revert : function(){
|
229 |
-
var id = $('table.widefat tr.inline-editor').attr('id');
|
230 |
-
|
231 |
-
if ( id ) {
|
232 |
-
$('table.widefat .inline-edit-save .waiting').hide();
|
233 |
-
|
234 |
-
if ( 'bulk-edit' == id ) {
|
235 |
-
$('table.widefat #bulk-edit').removeClass('inline-editor').hide();
|
236 |
-
$('#bulk-titles').html('');
|
237 |
-
$('#inlineedit').append( $('#bulk-edit') );
|
238 |
-
} else {
|
239 |
-
$('#'+id).remove();
|
240 |
-
id = id.substr( id.lastIndexOf('-') + 1 );
|
241 |
-
$(this.what+id).show();
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
return false;
|
246 |
-
},
|
247 |
-
|
248 |
-
getId : function(o) {
|
249 |
-
var id = $(o).closest('tr').attr('id'),
|
250 |
-
parts = id.split('-');
|
251 |
-
return parts[parts.length - 1];
|
252 |
-
}
|
253 |
-
};
|
254 |
-
|
255 |
-
$(document).ready(function(){inlineEditAttachment.init();});
|
256 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/mla-inline-edit-scripts.js
CHANGED
@@ -1 +1,256 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// These functions are adapted from wp-admin/js/inline-edit-post.js
|
2 |
+
(function($) {
|
3 |
+
inlineEditAttachment = {
|
4 |
+
|
5 |
+
init : function(){
|
6 |
+
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
|
7 |
+
|
8 |
+
t.type = 'attachment';
|
9 |
+
t.what = '#attachment-';
|
10 |
+
|
11 |
+
// prepare the edit rows
|
12 |
+
qeRow.keyup(function(e){
|
13 |
+
if (e.which == 27)
|
14 |
+
return inlineEditAttachment.revert();
|
15 |
+
});
|
16 |
+
bulkRow.keyup(function(e){
|
17 |
+
if (e.which == 27)
|
18 |
+
return inlineEditAttachment.revert();
|
19 |
+
});
|
20 |
+
|
21 |
+
$('a.cancel', qeRow).click(function(){
|
22 |
+
return inlineEditAttachment.revert();
|
23 |
+
});
|
24 |
+
$('a.save', qeRow).click(function(){
|
25 |
+
return inlineEditAttachment.save(this);
|
26 |
+
});
|
27 |
+
$('td', qeRow).keydown(function(e){
|
28 |
+
if ( e.which == 13 )
|
29 |
+
return inlineEditAttachment.save(this);
|
30 |
+
});
|
31 |
+
|
32 |
+
$('a.cancel', bulkRow).click(function(){
|
33 |
+
return inlineEditAttachment.revert();
|
34 |
+
});
|
35 |
+
|
36 |
+
// add events
|
37 |
+
$('a.editinline').live('click', function(){
|
38 |
+
inlineEditAttachment.edit(this);
|
39 |
+
return false;
|
40 |
+
});
|
41 |
+
|
42 |
+
// hiearchical taxonomies expandable?
|
43 |
+
$('span.catshow').click(function(){
|
44 |
+
$(this).hide().next().show().parent().next().addClass("cat-hover");
|
45 |
+
});
|
46 |
+
|
47 |
+
$('span.cathide').click(function(){
|
48 |
+
$(this).hide().prev().show().parent().next().removeClass("cat-hover");
|
49 |
+
});
|
50 |
+
|
51 |
+
$('select[name="_status"] option[value="future"]', bulkRow).remove();
|
52 |
+
|
53 |
+
$('#doaction, #doaction2').click(function(e){
|
54 |
+
var n = $(this).attr('id').substr(2);
|
55 |
+
|
56 |
+
if ( $('select[name="'+n+'"]').val() == 'edit' ) {
|
57 |
+
e.preventDefault();
|
58 |
+
t.setBulk();
|
59 |
+
} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
|
60 |
+
t.revert();
|
61 |
+
}
|
62 |
+
});
|
63 |
+
|
64 |
+
// Filter button (dates, categories) in top nav bar
|
65 |
+
$('#post-query-submit').mousedown(function(e){
|
66 |
+
t.revert();
|
67 |
+
$('select[name^="action"]').val('-1');
|
68 |
+
});
|
69 |
+
},
|
70 |
+
|
71 |
+
toggle : function(el){
|
72 |
+
var t = this;
|
73 |
+
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
74 |
+
},
|
75 |
+
|
76 |
+
setBulk : function(){
|
77 |
+
var te = '', c = true;
|
78 |
+
this.revert();
|
79 |
+
|
80 |
+
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
|
81 |
+
$('table.widefat tbody').prepend( $('#bulk-edit') );
|
82 |
+
$('#bulk-edit').addClass('inline-editor').show();
|
83 |
+
|
84 |
+
$('tbody th.check-column input[type="checkbox"]').each(function(i){
|
85 |
+
if ( $(this).prop('checked') ) {
|
86 |
+
c = false;
|
87 |
+
var id = $(this).val(), theTitle;
|
88 |
+
theTitle = $('#inline_'+id+' .post_title').text() || mla_inline_edit_vars.notitle;
|
89 |
+
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+mla_inline_edit_vars.ntdeltitle+'">X</a>'+theTitle+'</div>';
|
90 |
+
}
|
91 |
+
});
|
92 |
+
|
93 |
+
if ( c )
|
94 |
+
return this.revert();
|
95 |
+
|
96 |
+
$('#bulk-titles').html(te);
|
97 |
+
$('#bulk-titles a').click(function(){
|
98 |
+
var id = $(this).attr('id').substr(1);
|
99 |
+
|
100 |
+
$('table.widefat input[value="' + id + '"]').prop('checked', false);
|
101 |
+
$('#ttle'+id).remove();
|
102 |
+
});
|
103 |
+
|
104 |
+
// support multi taxonomies?
|
105 |
+
// tax = 'post_tag';
|
106 |
+
// $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
107 |
+
|
108 |
+
//flat taxonomies
|
109 |
+
$('textarea.mla_tags').each(function(){
|
110 |
+
var taxname = $(this).attr('name').replace(']', '').replace('tax_input[', '');
|
111 |
+
|
112 |
+
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
113 |
+
});
|
114 |
+
|
115 |
+
$('html, body').animate( { scrollTop: 0 }, 'fast' );
|
116 |
+
},
|
117 |
+
|
118 |
+
edit : function(id) {
|
119 |
+
var t = this, fields, editRow, rowData, fIndex;
|
120 |
+
t.revert();
|
121 |
+
|
122 |
+
if ( typeof(id) == 'object' )
|
123 |
+
id = t.getId(id);
|
124 |
+
|
125 |
+
fields = ['post_title', 'post_name', 'post_excerpt', 'image_alt', 'post_parent', 'menu_order', 'post_author'];
|
126 |
+
|
127 |
+
// add the new blank row
|
128 |
+
editRow = $('#inline-edit').clone(true);
|
129 |
+
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
130 |
+
|
131 |
+
if ( $(t.what+id).hasClass('alternate') )
|
132 |
+
$(editRow).addClass('alternate');
|
133 |
+
$(t.what+id).hide().after(editRow);
|
134 |
+
|
135 |
+
// populate the data
|
136 |
+
rowData = $('#inline_'+id);
|
137 |
+
if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
|
138 |
+
// author no longer has edit caps, so we need to add them to the list of authors
|
139 |
+
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
|
143 |
+
$('label.inline-edit-author', editRow).hide();
|
144 |
+
}
|
145 |
+
|
146 |
+
for ( fIndex = 0; fIndex < fields.length; fIndex++ ) {
|
147 |
+
$(':input[name="' + fields[fIndex] + '"]', editRow).val( $('.'+fields[fIndex], rowData).text() );
|
148 |
+
}
|
149 |
+
|
150 |
+
if ( $('.image_alt', rowData).length == 0) {
|
151 |
+
$('label.inline-edit-image-alt', editRow).hide();
|
152 |
+
}
|
153 |
+
|
154 |
+
// hierarchical taxonomies
|
155 |
+
$('.mla_category', rowData).each(function(){
|
156 |
+
var term_ids = $(this).text();
|
157 |
+
|
158 |
+
if ( term_ids ) {
|
159 |
+
taxname = $(this).attr('id').replace('_'+id, '');
|
160 |
+
$('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
|
161 |
+
}
|
162 |
+
});
|
163 |
+
|
164 |
+
//flat taxonomies
|
165 |
+
$('.mla_tags', rowData).each(function(){
|
166 |
+
var terms = $(this).text(),
|
167 |
+
taxname = $(this).attr('id').replace('_' + id, ''),
|
168 |
+
textarea = $('textarea.tax_input_' + taxname, editRow),
|
169 |
+
comma = mla_inline_edit_vars.comma;
|
170 |
+
|
171 |
+
if ( terms ) {
|
172 |
+
if ( ',' !== comma )
|
173 |
+
terms = terms.replace(/,/g, comma);
|
174 |
+
textarea.val(terms);
|
175 |
+
}
|
176 |
+
|
177 |
+
textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
178 |
+
});
|
179 |
+
|
180 |
+
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
181 |
+
$('.ptitle', editRow).focus();
|
182 |
+
|
183 |
+
return false;
|
184 |
+
},
|
185 |
+
|
186 |
+
save : function(id) {
|
187 |
+
var params, fields, page = $('.post_status_page').val() || '';
|
188 |
+
|
189 |
+
if ( typeof(id) == 'object' )
|
190 |
+
id = this.getId(id);
|
191 |
+
|
192 |
+
$('table.widefat .inline-edit-save .waiting').show();
|
193 |
+
|
194 |
+
params = {
|
195 |
+
action: mla_inline_edit_vars.ajax_action,
|
196 |
+
nonce: mla_inline_edit_vars.ajax_nonce,
|
197 |
+
post_type: typenow,
|
198 |
+
post_ID: id,
|
199 |
+
edit_date: 'true',
|
200 |
+
post_status: page
|
201 |
+
};
|
202 |
+
|
203 |
+
fields = $('#edit-'+id+' :input').serialize();
|
204 |
+
params = fields + '&' + $.param(params);
|
205 |
+
|
206 |
+
// make ajax request
|
207 |
+
$.post( ajaxurl, params,
|
208 |
+
function(r) {
|
209 |
+
$('table.widefat .inline-edit-save .waiting').hide();
|
210 |
+
|
211 |
+
if (r) {
|
212 |
+
if ( -1 != r.indexOf('<tr') ) {
|
213 |
+
$(inlineEditAttachment.what+id).remove();
|
214 |
+
$('#edit-'+id).before(r).remove();
|
215 |
+
$(inlineEditAttachment.what+id).hide().fadeIn();
|
216 |
+
} else {
|
217 |
+
r = r.replace( /<.[^<>]*?>/g, '' );
|
218 |
+
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
219 |
+
}
|
220 |
+
} else {
|
221 |
+
$('#edit-'+id+' .inline-edit-save .error').html(mla_inline_edit_vars.error).show();
|
222 |
+
}
|
223 |
+
}
|
224 |
+
, 'html');
|
225 |
+
return false;
|
226 |
+
},
|
227 |
+
|
228 |
+
revert : function(){
|
229 |
+
var id = $('table.widefat tr.inline-editor').attr('id');
|
230 |
+
|
231 |
+
if ( id ) {
|
232 |
+
$('table.widefat .inline-edit-save .waiting').hide();
|
233 |
+
|
234 |
+
if ( 'bulk-edit' == id ) {
|
235 |
+
$('table.widefat #bulk-edit').removeClass('inline-editor').hide();
|
236 |
+
$('#bulk-titles').html('');
|
237 |
+
$('#inlineedit').append( $('#bulk-edit') );
|
238 |
+
} else {
|
239 |
+
$('#'+id).remove();
|
240 |
+
id = id.substr( id.lastIndexOf('-') + 1 );
|
241 |
+
$(this.what+id).show();
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
return false;
|
246 |
+
},
|
247 |
+
|
248 |
+
getId : function(o) {
|
249 |
+
var id = $(o).closest('tr').attr('id'),
|
250 |
+
parts = id.split('-');
|
251 |
+
return parts[parts.length - 1];
|
252 |
+
}
|
253 |
+
};
|
254 |
+
|
255 |
+
$(document).ready(function(){inlineEditAttachment.init();});
|
256 |
+
})(jQuery);
|
js/mla-inline-edit-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){inlineEditAttachment={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type="attachment";c.what="#attachment-";d.keyup(function(f){if(f.which==27){return inlineEditAttachment.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditAttachment.revert()}});a("a.cancel",d).click(function(){return inlineEditAttachment.revert()});a("a.save",d).click(function(){return inlineEditAttachment.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditAttachment.save(this)}});a("a.cancel",b).click(function(){return inlineEditAttachment.revert()});a("a.editinline").live("click",function(){inlineEditAttachment.edit(this);return false});a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").mousedown(function(f){c.revert();a('select[name^="action"]').val("-1")})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var b="",d=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(e){if(a(this).prop("checked")){d=false;var f=a(this).val(),c;c=a("#inline_"+f+" .post_title").text()||mla_inline_edit_vars.notitle;b+='<div id="ttle'+f+'"><a id="_'+f+'" class="ntdelbutton" title="'+mla_inline_edit_vars.ntdeltitle+'">X</a>'+c+"</div>"}});if(d){return this.revert()}a("#bulk-titles").html(b);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').prop("checked",false);a("#ttle"+c).remove()});a("textarea.mla_tags").each(function(){var c=a(this).attr("name").replace("]","").replace("tax_input[","");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+c,{delay:500,minchars:2,multiple:true,multipleSep:mla_inline_edit_vars.comma+" "})});a("html, body").animate({scrollTop:0},"fast")},edit:function(g){var d=this,b,c,e,f;d.revert();if(typeof(g)=="object"){g=d.getId(g)}b=["post_title","post_name","post_excerpt","image_alt","post_parent","menu_order","post_author"];c=a("#inline-edit").clone(true);a("td",c).attr("colspan",a(".widefat:first thead th:visible").length);if(a(d.what+g).hasClass("alternate")){a(c).addClass("alternate")}a(d.what+g).hide().after(c);e=a("#inline_"+g);if(!a(':input[name="post_author"] option[value="'+a(".post_author",e).text()+'"]',c).val()){a(':input[name="post_author"]',c).prepend('<option value="'+a(".post_author",e).text()+'">'+a("#"+d.type+"-"+g+" .author").text()+"</option>")}if(a(':input[name="post_author"] option',c).length==1){a("label.inline-edit-author",c).hide()}for(f=0;f<b.length;f++){a(':input[name="'+b[f]+'"]',c).val(a("."+b[f],e).text())}if(a(".image_alt",e).length==0){a("label.inline-edit-image-alt",c).hide()}a(".mla_category",e).each(function(){var h=a(this).text();if(h){taxname=a(this).attr("id").replace("_"+g,"");a("ul."+taxname+"-checklist :checkbox",c).val(h.split(","))}});a(".mla_tags",e).each(function(){var j=a(this).text(),k=a(this).attr("id").replace("_"+g,""),i=a("textarea.tax_input_"+k,c),h=mla_inline_edit_vars.comma;if(j){if(","!==h){j=j.replace(/,/g,h)}i.val(j)}i.suggest(ajaxurl+"?action=ajax-tag-search&tax="+k,{delay:500,minchars:2,multiple:true,multipleSep:mla_inline_edit_vars.comma+" "})});a(c).attr("id","edit-"+g).addClass("inline-editor").show();a(".ptitle",c).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:mla_inline_edit_vars.ajax_action,nonce:mla_inline_edit_vars.ajax_nonce,post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("<tr")){a(inlineEditAttachment.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditAttachment.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save .error").html(f).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(mla_inline_edit_vars.error).show()}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditAttachment.init()})})(jQuery);
|
js/mla-single-edit-scripts.dev.js
DELETED
@@ -1,274 +0,0 @@
|
|
1 |
-
// These functions are adapted from wp-admin/js/post.js
|
2 |
-
|
3 |
-
var tagBox;
|
4 |
-
|
5 |
-
// return an array with any duplicate, whitespace or values removed
|
6 |
-
function array_unique_noempty(a) {
|
7 |
-
var out = [];
|
8 |
-
jQuery.each( a, function(key, val) {
|
9 |
-
val = jQuery.trim(val);
|
10 |
-
if ( val && jQuery.inArray(val, out) == -1 )
|
11 |
-
out.push(val);
|
12 |
-
} );
|
13 |
-
return out;
|
14 |
-
}
|
15 |
-
|
16 |
-
(function($){
|
17 |
-
|
18 |
-
tagBox = {
|
19 |
-
clean : function(tags) {
|
20 |
-
var comma = mla_single_edit_vars.comma;
|
21 |
-
if ( ',' !== comma )
|
22 |
-
tags = tags.replace(new RegExp(comma, 'g'), ',');
|
23 |
-
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
|
24 |
-
if ( ',' !== comma )
|
25 |
-
tags = tags.replace(/,/g, comma);
|
26 |
-
return tags;
|
27 |
-
},
|
28 |
-
|
29 |
-
parseTags : function(el) {
|
30 |
-
var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
|
31 |
-
thetags = taxbox.find('.the-tags'), comma = mla_single_edit_vars.comma,
|
32 |
-
current_tags = thetags.val().split(comma), new_tags = [];
|
33 |
-
delete current_tags[num];
|
34 |
-
|
35 |
-
$.each( current_tags, function(key, val) {
|
36 |
-
val = $.trim(val);
|
37 |
-
if ( val ) {
|
38 |
-
new_tags.push(val);
|
39 |
-
}
|
40 |
-
});
|
41 |
-
|
42 |
-
thetags.val( this.clean( new_tags.join(comma) ) );
|
43 |
-
|
44 |
-
this.quickClicks(taxbox);
|
45 |
-
return false;
|
46 |
-
},
|
47 |
-
|
48 |
-
quickClicks : function(el) {
|
49 |
-
var thetags = $('.the-tags', el),
|
50 |
-
tagchecklist = $('.tagchecklist', el),
|
51 |
-
id = $(el).attr('id'),
|
52 |
-
current_tags, disabled;
|
53 |
-
|
54 |
-
if ( !thetags.length )
|
55 |
-
return;
|
56 |
-
|
57 |
-
disabled = thetags.prop('disabled');
|
58 |
-
|
59 |
-
current_tags = thetags.val().split(mla_single_edit_vars.comma);
|
60 |
-
tagchecklist.empty();
|
61 |
-
|
62 |
-
$.each( current_tags, function( key, val ) {
|
63 |
-
var span, xbutton;
|
64 |
-
|
65 |
-
val = $.trim( val );
|
66 |
-
|
67 |
-
if ( ! val )
|
68 |
-
return;
|
69 |
-
|
70 |
-
// Create a new span, and ensure the text is properly escaped.
|
71 |
-
span = $('<span />').text( val );
|
72 |
-
|
73 |
-
// If tags editing isn't disabled, create the X button.
|
74 |
-
if ( ! disabled ) {
|
75 |
-
xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
|
76 |
-
xbutton.click( function(){ tagBox.parseTags(this); });
|
77 |
-
span.prepend(' ').prepend( xbutton );
|
78 |
-
}
|
79 |
-
|
80 |
-
// Append the span to the tag list.
|
81 |
-
tagchecklist.append( span );
|
82 |
-
});
|
83 |
-
},
|
84 |
-
|
85 |
-
flushTags : function(el, a, f) {
|
86 |
-
a = a || false;
|
87 |
-
var tags = $('.the-tags', el),
|
88 |
-
newtag = $('input.newtag', el),
|
89 |
-
comma = mla_single_edit_vars.comma,
|
90 |
-
newtags, text;
|
91 |
-
|
92 |
-
text = a ? $(a).text() : newtag.val();
|
93 |
-
tagsval = tags.val();
|
94 |
-
newtags = tagsval ? tagsval + comma + text : text;
|
95 |
-
|
96 |
-
newtags = this.clean( newtags );
|
97 |
-
newtags = array_unique_noempty( newtags.split(comma) ).join(comma);
|
98 |
-
tags.val(newtags);
|
99 |
-
this.quickClicks(el);
|
100 |
-
|
101 |
-
if ( !a )
|
102 |
-
newtag.val('');
|
103 |
-
if ( 'undefined' == typeof(f) )
|
104 |
-
newtag.focus();
|
105 |
-
|
106 |
-
return false;
|
107 |
-
},
|
108 |
-
|
109 |
-
get : function(id) {
|
110 |
-
var tax = id.substr(id.indexOf('-')+1);
|
111 |
-
|
112 |
-
$.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {
|
113 |
-
if ( 0 == r || 'success' != stat )
|
114 |
-
r = wpAjax.broken;
|
115 |
-
|
116 |
-
r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
|
117 |
-
$('a', r).click(function(){
|
118 |
-
tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
|
119 |
-
return false;
|
120 |
-
});
|
121 |
-
|
122 |
-
$('#'+id).after(r);
|
123 |
-
});
|
124 |
-
},
|
125 |
-
|
126 |
-
init : function() {
|
127 |
-
var t = this, ajaxtag = $('div.ajaxtag');
|
128 |
-
|
129 |
-
$('.tagsdiv').each( function() {
|
130 |
-
tagBox.quickClicks(this);
|
131 |
-
});
|
132 |
-
|
133 |
-
$('input.tagadd', ajaxtag).click(function(){
|
134 |
-
t.flushTags( $(this).closest('.tagsdiv') );
|
135 |
-
});
|
136 |
-
|
137 |
-
$('div.taghint', ajaxtag).click(function(){
|
138 |
-
$(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();
|
139 |
-
});
|
140 |
-
|
141 |
-
$('input.newtag', ajaxtag).blur(function() {
|
142 |
-
if ( this.value == '' )
|
143 |
-
$(this).parent().siblings('.taghint').css('visibility', '');
|
144 |
-
}).focus(function(){
|
145 |
-
$(this).parent().siblings('.taghint').css('visibility', 'hidden');
|
146 |
-
}).keyup(function(e){
|
147 |
-
if ( 13 == e.which ) {
|
148 |
-
tagBox.flushTags( $(this).closest('.tagsdiv') );
|
149 |
-
return false;
|
150 |
-
}
|
151 |
-
}).keypress(function(e){
|
152 |
-
if ( 13 == e.which ) {
|
153 |
-
e.preventDefault();
|
154 |
-
return false;
|
155 |
-
}
|
156 |
-
}).each(function(){
|
157 |
-
var tax = $(this).closest('div.tagsdiv').attr('id');
|
158 |
-
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_single_edit_vars.comma + ' ' } );
|
159 |
-
});
|
160 |
-
|
161 |
-
// save tags on post save/publish
|
162 |
-
$('#post').submit(function(){
|
163 |
-
$('div.tagsdiv').each( function() {
|
164 |
-
tagBox.flushTags(this, false, 1);
|
165 |
-
});
|
166 |
-
});
|
167 |
-
|
168 |
-
// tag cloud
|
169 |
-
$('a.tagcloud-link').click(function(){
|
170 |
-
tagBox.get( $(this).attr('id') );
|
171 |
-
$(this).unbind().click(function(){
|
172 |
-
$(this).siblings('.the-tagcloud').toggle();
|
173 |
-
return false;
|
174 |
-
});
|
175 |
-
return false;
|
176 |
-
});
|
177 |
-
}
|
178 |
-
};
|
179 |
-
|
180 |
-
})(jQuery);
|
181 |
-
|
182 |
-
jQuery(document).ready( function($) {
|
183 |
-
// alert('jQuery(document).ready(function($)');
|
184 |
-
// console.log('jQuery(document).ready(function($)');
|
185 |
-
|
186 |
-
// multi-taxonomies
|
187 |
-
$('#side-info-column').children('div.postbox').each(function(){
|
188 |
-
if ( this.id.indexOf('tagsdiv-') === 0 ) {
|
189 |
-
tagBox.init();
|
190 |
-
return false;
|
191 |
-
}
|
192 |
-
});
|
193 |
-
|
194 |
-
// categories
|
195 |
-
$('.categorydiv').each( function(){
|
196 |
-
var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName;
|
197 |
-
|
198 |
-
taxonomyParts = this_id.split('-');
|
199 |
-
taxonomyParts.shift();
|
200 |
-
taxonomy = taxonomyParts.join('-');
|
201 |
-
settingName = taxonomy + '_tab';
|
202 |
-
// if ( taxonomy == 'category' )
|
203 |
-
// settingName = 'cats';
|
204 |
-
|
205 |
-
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
|
206 |
-
$('a', '#' + taxonomy + '-tabs').click( function(){
|
207 |
-
var t = $(this).attr('href');
|
208 |
-
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
209 |
-
$('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
|
210 |
-
$(t).show();
|
211 |
-
if ( '#' + taxonomy + '-all' == t )
|
212 |
-
deleteUserSetting(settingName);
|
213 |
-
else
|
214 |
-
setUserSetting(settingName, 'pop');
|
215 |
-
return false;
|
216 |
-
});
|
217 |
-
|
218 |
-
if ( getUserSetting(settingName) )
|
219 |
-
$('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
|
220 |
-
|
221 |
-
// Ajax Cat
|
222 |
-
$('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
223 |
-
$('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
|
224 |
-
|
225 |
-
syncChecks = function() {
|
226 |
-
if ( noSyncChecks )
|
227 |
-
return;
|
228 |
-
noSyncChecks = true;
|
229 |
-
var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
|
230 |
-
$('#in-' + taxonomy + '-' + id + ', #in-' + taxonomy + '-category-' + id).prop( 'checked', c );
|
231 |
-
noSyncChecks = false;
|
232 |
-
};
|
233 |
-
|
234 |
-
catAddBefore = function( s ) {
|
235 |
-
if ( !$('#new'+taxonomy).val() )
|
236 |
-
return false;
|
237 |
-
s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
|
238 |
-
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
|
239 |
-
return s;
|
240 |
-
};
|
241 |
-
|
242 |
-
catAddAfter = function( r, s ) {
|
243 |
-
var sup, drop = $('#new'+taxonomy+'_parent');
|
244 |
-
|
245 |
-
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
|
246 |
-
if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
|
247 |
-
drop.before(sup);
|
248 |
-
drop.remove();
|
249 |
-
}
|
250 |
-
};
|
251 |
-
|
252 |
-
$('#' + taxonomy + 'checklist').wpList({
|
253 |
-
alt: '',
|
254 |
-
response: taxonomy + '-ajax-response',
|
255 |
-
addBefore: catAddBefore,
|
256 |
-
addAfter: catAddAfter
|
257 |
-
});
|
258 |
-
|
259 |
-
$('#' + taxonomy + '-add-toggle').click( function() {
|
260 |
-
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
|
261 |
-
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
|
262 |
-
$('#new'+taxonomy).focus();
|
263 |
-
return false;
|
264 |
-
});
|
265 |
-
|
266 |
-
$('#' + taxonomy + 'checklist li.popular-category :checkbox, #' + taxonomy + 'checklist-pop :checkbox').live( 'click', function(){
|
267 |
-
var t = $(this), c = t.is(':checked'), id = t.val();
|
268 |
-
if ( id && t.parents('#taxonomy-'+taxonomy).length )
|
269 |
-
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
|
270 |
-
});
|
271 |
-
|
272 |
-
}); // end cats
|
273 |
-
|
274 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/mla-single-edit-scripts.js
CHANGED
@@ -1 +1,274 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// These functions are adapted from wp-admin/js/post.js
|
2 |
+
|
3 |
+
var tagBox;
|
4 |
+
|
5 |
+
// return an array with any duplicate, whitespace or values removed
|
6 |
+
function array_unique_noempty(a) {
|
7 |
+
var out = [];
|
8 |
+
jQuery.each( a, function(key, val) {
|
9 |
+
val = jQuery.trim(val);
|
10 |
+
if ( val && jQuery.inArray(val, out) == -1 )
|
11 |
+
out.push(val);
|
12 |
+
} );
|
13 |
+
return out;
|
14 |
+
}
|
15 |
+
|
16 |
+
(function($){
|
17 |
+
|
18 |
+
tagBox = {
|
19 |
+
clean : function(tags) {
|
20 |
+
var comma = mla_single_edit_vars.comma;
|
21 |
+
if ( ',' !== comma )
|
22 |
+
tags = tags.replace(new RegExp(comma, 'g'), ',');
|
23 |
+
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
|
24 |
+
if ( ',' !== comma )
|
25 |
+
tags = tags.replace(/,/g, comma);
|
26 |
+
return tags;
|
27 |
+
},
|
28 |
+
|
29 |
+
parseTags : function(el) {
|
30 |
+
var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
|
31 |
+
thetags = taxbox.find('.the-tags'), comma = mla_single_edit_vars.comma,
|
32 |
+
current_tags = thetags.val().split(comma), new_tags = [];
|
33 |
+
delete current_tags[num];
|
34 |
+
|
35 |
+
$.each( current_tags, function(key, val) {
|
36 |
+
val = $.trim(val);
|
37 |
+
if ( val ) {
|
38 |
+
new_tags.push(val);
|
39 |
+
}
|
40 |
+
});
|
41 |
+
|
42 |
+
thetags.val( this.clean( new_tags.join(comma) ) );
|
43 |
+
|
44 |
+
this.quickClicks(taxbox);
|
45 |
+
return false;
|
46 |
+
},
|
47 |
+
|
48 |
+
quickClicks : function(el) {
|
49 |
+
var thetags = $('.the-tags', el),
|
50 |
+
tagchecklist = $('.tagchecklist', el),
|
51 |
+
id = $(el).attr('id'),
|
52 |
+
current_tags, disabled;
|
53 |
+
|
54 |
+
if ( !thetags.length )
|
55 |
+
return;
|
56 |
+
|
57 |
+
disabled = thetags.prop('disabled');
|
58 |
+
|
59 |
+
current_tags = thetags.val().split(mla_single_edit_vars.comma);
|
60 |
+
tagchecklist.empty();
|
61 |
+
|
62 |
+
$.each( current_tags, function( key, val ) {
|
63 |
+
var span, xbutton;
|
64 |
+
|
65 |
+
val = $.trim( val );
|
66 |
+
|
67 |
+
if ( ! val )
|
68 |
+
return;
|
69 |
+
|
70 |
+
// Create a new span, and ensure the text is properly escaped.
|
71 |
+
span = $('<span />').text( val );
|
72 |
+
|
73 |
+
// If tags editing isn't disabled, create the X button.
|
74 |
+
if ( ! disabled ) {
|
75 |
+
xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
|
76 |
+
xbutton.click( function(){ tagBox.parseTags(this); });
|
77 |
+
span.prepend(' ').prepend( xbutton );
|
78 |
+
}
|
79 |
+
|
80 |
+
// Append the span to the tag list.
|
81 |
+
tagchecklist.append( span );
|
82 |
+
});
|
83 |
+
},
|
84 |
+
|
85 |
+
flushTags : function(el, a, f) {
|
86 |
+
a = a || false;
|
87 |
+
var tags = $('.the-tags', el),
|
88 |
+
newtag = $('input.newtag', el),
|
89 |
+
comma = mla_single_edit_vars.comma,
|
90 |
+
newtags, text;
|
91 |
+
|
92 |
+
text = a ? $(a).text() : newtag.val();
|
93 |
+
tagsval = tags.val();
|
94 |
+
newtags = tagsval ? tagsval + comma + text : text;
|
95 |
+
|
96 |
+
newtags = this.clean( newtags );
|
97 |
+
newtags = array_unique_noempty( newtags.split(comma) ).join(comma);
|
98 |
+
tags.val(newtags);
|
99 |
+
this.quickClicks(el);
|
100 |
+
|
101 |
+
if ( !a )
|
102 |
+
newtag.val('');
|
103 |
+
if ( 'undefined' == typeof(f) )
|
104 |
+
newtag.focus();
|
105 |
+
|
106 |
+
return false;
|
107 |
+
},
|
108 |
+
|
109 |
+
get : function(id) {
|
110 |
+
var tax = id.substr(id.indexOf('-')+1);
|
111 |
+
|
112 |
+
$.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {
|
113 |
+
if ( 0 == r || 'success' != stat )
|
114 |
+
r = wpAjax.broken;
|
115 |
+
|
116 |
+
r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
|
117 |
+
$('a', r).click(function(){
|
118 |
+
tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
|
119 |
+
return false;
|
120 |
+
});
|
121 |
+
|
122 |
+
$('#'+id).after(r);
|
123 |
+
});
|
124 |
+
},
|
125 |
+
|
126 |
+
init : function() {
|
127 |
+
var t = this, ajaxtag = $('div.ajaxtag');
|
128 |
+
|
129 |
+
$('.tagsdiv').each( function() {
|
130 |
+
tagBox.quickClicks(this);
|
131 |
+
});
|
132 |
+
|
133 |
+
$('input.tagadd', ajaxtag).click(function(){
|
134 |
+
t.flushTags( $(this).closest('.tagsdiv') );
|
135 |
+
});
|
136 |
+
|
137 |
+
$('div.taghint', ajaxtag).click(function(){
|
138 |
+
$(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();
|
139 |
+
});
|
140 |
+
|
141 |
+
$('input.newtag', ajaxtag).blur(function() {
|
142 |
+
if ( this.value == '' )
|
143 |
+
$(this).parent().siblings('.taghint').css('visibility', '');
|
144 |
+
}).focus(function(){
|
145 |
+
$(this).parent().siblings('.taghint').css('visibility', 'hidden');
|
146 |
+
}).keyup(function(e){
|
147 |
+
if ( 13 == e.which ) {
|
148 |
+
tagBox.flushTags( $(this).closest('.tagsdiv') );
|
149 |
+
return false;
|
150 |
+
}
|
151 |
+
}).keypress(function(e){
|
152 |
+
if ( 13 == e.which ) {
|
153 |
+
e.preventDefault();
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
}).each(function(){
|
157 |
+
var tax = $(this).closest('div.tagsdiv').attr('id');
|
158 |
+
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_single_edit_vars.comma + ' ' } );
|
159 |
+
});
|
160 |
+
|
161 |
+
// save tags on post save/publish
|
162 |
+
$('#post').submit(function(){
|
163 |
+
$('div.tagsdiv').each( function() {
|
164 |
+
tagBox.flushTags(this, false, 1);
|
165 |
+
});
|
166 |
+
});
|
167 |
+
|
168 |
+
// tag cloud
|
169 |
+
$('a.tagcloud-link').click(function(){
|
170 |
+
tagBox.get( $(this).attr('id') );
|
171 |
+
$(this).unbind().click(function(){
|
172 |
+
$(this).siblings('.the-tagcloud').toggle();
|
173 |
+
return false;
|
174 |
+
});
|
175 |
+
return false;
|
176 |
+
});
|
177 |
+
}
|
178 |
+
};
|
179 |
+
|
180 |
+
})(jQuery);
|
181 |
+
|
182 |
+
jQuery(document).ready( function($) {
|
183 |
+
// alert('jQuery(document).ready(function($)');
|
184 |
+
// console.log('jQuery(document).ready(function($)');
|
185 |
+
|
186 |
+
// multi-taxonomies
|
187 |
+
$('#side-info-column').children('div.postbox').each(function(){
|
188 |
+
if ( this.id.indexOf('tagsdiv-') === 0 ) {
|
189 |
+
tagBox.init();
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
});
|
193 |
+
|
194 |
+
// categories
|
195 |
+
$('.categorydiv').each( function(){
|
196 |
+
var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName;
|
197 |
+
|
198 |
+
taxonomyParts = this_id.split('-');
|
199 |
+
taxonomyParts.shift();
|
200 |
+
taxonomy = taxonomyParts.join('-');
|
201 |
+
settingName = taxonomy + '_tab';
|
202 |
+
// if ( taxonomy == 'category' )
|
203 |
+
// settingName = 'cats';
|
204 |
+
|
205 |
+
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
|
206 |
+
$('a', '#' + taxonomy + '-tabs').click( function(){
|
207 |
+
var t = $(this).attr('href');
|
208 |
+
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
209 |
+
$('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
|
210 |
+
$(t).show();
|
211 |
+
if ( '#' + taxonomy + '-all' == t )
|
212 |
+
deleteUserSetting(settingName);
|
213 |
+
else
|
214 |
+
setUserSetting(settingName, 'pop');
|
215 |
+
return false;
|
216 |
+
});
|
217 |
+
|
218 |
+
if ( getUserSetting(settingName) )
|
219 |
+
$('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
|
220 |
+
|
221 |
+
// Ajax Cat
|
222 |
+
$('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
223 |
+
$('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
|
224 |
+
|
225 |
+
syncChecks = function() {
|
226 |
+
if ( noSyncChecks )
|
227 |
+
return;
|
228 |
+
noSyncChecks = true;
|
229 |
+
var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
|
230 |
+
$('#in-' + taxonomy + '-' + id + ', #in-' + taxonomy + '-category-' + id).prop( 'checked', c );
|
231 |
+
noSyncChecks = false;
|
232 |
+
};
|
233 |
+
|
234 |
+
catAddBefore = function( s ) {
|
235 |
+
if ( !$('#new'+taxonomy).val() )
|
236 |
+
return false;
|
237 |
+
s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
|
238 |
+
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
|
239 |
+
return s;
|
240 |
+
};
|
241 |
+
|
242 |
+
catAddAfter = function( r, s ) {
|
243 |
+
var sup, drop = $('#new'+taxonomy+'_parent');
|
244 |
+
|
245 |
+
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
|
246 |
+
if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
|
247 |
+
drop.before(sup);
|
248 |
+
drop.remove();
|
249 |
+
}
|
250 |
+
};
|
251 |
+
|
252 |
+
$('#' + taxonomy + 'checklist').wpList({
|
253 |
+
alt: '',
|
254 |
+
response: taxonomy + '-ajax-response',
|
255 |
+
addBefore: catAddBefore,
|
256 |
+
addAfter: catAddAfter
|
257 |
+
});
|
258 |
+
|
259 |
+
$('#' + taxonomy + '-add-toggle').click( function() {
|
260 |
+
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
|
261 |
+
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
|
262 |
+
$('#new'+taxonomy).focus();
|
263 |
+
return false;
|
264 |
+
});
|
265 |
+
|
266 |
+
$('#' + taxonomy + 'checklist li.popular-category :checkbox, #' + taxonomy + 'checklist-pop :checkbox').live( 'click', function(){
|
267 |
+
var t = $(this), c = t.is(':checked'), id = t.val();
|
268 |
+
if ( id && t.parents('#taxonomy-'+taxonomy).length )
|
269 |
+
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
|
270 |
+
});
|
271 |
+
|
272 |
+
}); // end cats
|
273 |
+
|
274 |
+
});
|
js/mla-single-edit-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var tagBox;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(c){var b=mla_single_edit_vars.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(f){var i=f.id,c=i.split("-check-num-")[1],e=a(f).closest(".tagsdiv"),h=e.find(".the-tags"),b=mla_single_edit_vars.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.clean(g.join(b)));this.quickClicks(e);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(mla_single_edit_vars.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend(" ").prepend(h)}e.append(j)})},flushTags:function(g,c,h){c=c||false;var d=a(".the-tags",g),j=a("input.newtag",g),b=mla_single_edit_vars.comma,e,i;i=c?a(c).text():j.val();tagsval=d.val();e=tagsval?tagsval+b+i:i;e=this.clean(e);e=array_unique_noempty(e.split(b)).join(b);d.val(e);this.quickClicks(g);if(!c){j.val("")}if("undefined"==typeof(h)){j.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:mla_single_edit_vars.comma+" "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}}})(jQuery);jQuery(document).ready(function(a){a("#side-info-column").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}});a(".categorydiv").each(function(){var g=a(this).attr("id"),c=false,f,h,e,b,d;e=g.split("-");e.shift();b=e.join("-");d=b+"_tab";a("a","#"+b+"-tabs").click(function(){var i=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs");a("#"+b+"-tabs").siblings(".tabs-panel").hide();a(i).show();if("#"+b+"-all"==i){deleteUserSetting(d)}else{setUserSetting(d,"pop")}return false});if(getUserSetting(d)){a('a[href="#'+b+'-pop"]',"#"+b+"-tabs").click()}a("#new"+b).one("focus",function(){a(this).val("").removeClass("form-input-tip")});a("#"+b+"-add-submit").click(function(){a("#new"+b).focus()});f=function(){if(c){return}c=true;var i=jQuery(this),k=i.is(":checked"),j=i.val().toString();a("#in-"+b+"-"+j+", #in-"+b+"-category-"+j).prop("checked",k);c=false};catAddBefore=function(i){if(!a("#new"+b).val()){return false}i.data+="&"+a(":checked","#"+b+"checklist").serialize();a("#"+b+"-add-submit").prop("disabled",true);return i};h=function(l,k){var j,i=a("#new"+b+"_parent");a("#"+b+"-add-submit").prop("disabled",false);if("undefined"!=k.parsed.responses[0]&&(j=k.parsed.responses[0].supplemental.newcat_parent)){i.before(j);i.remove()}};a("#"+b+"checklist").wpList({alt:"",response:b+"-ajax-response",addBefore:catAddBefore,addAfter:h});a("#"+b+"-add-toggle").click(function(){a("#"+b+"-adder").toggleClass("wp-hidden-children");a('a[href="#'+b+'-all"]',"#"+b+"-tabs").click();a("#new"+b).focus();return false});a("#"+b+"checklist li.popular-category :checkbox, #"+b+"checklist-pop :checkbox").live("click",function(){var i=a(this),k=i.is(":checked"),j=i.val();if(j&&i.parents("#taxonomy-"+b).length){a("#in-"+b+"-"+j+", #in-popular-"+b+"-"+j).prop("checked",k)}})})});
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://fairtradejudaica.org/make-a-difference/donate/
|
|
4 |
Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.5
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -22,7 +22,7 @@ The Media Library Assistant provides several enhancements for managing the Media
|
|
22 |
|
23 |
* **IPTC** and **EXIF** metadata can be assigned to standard WordPress fields, taxonomy terms and custom fields. You can update all existing attachments from the Settings page IPTC/EXIF tab, groups of existing attachments with a Bulk Action or one existing attachment from the Edit Media/Edit Single Item screen. Display **IPTC** and **EXIF** metadata with `[mla_gallery]` custom templates.
|
24 |
|
25 |
-
* **Enhanced Search Media box**. Search can be extended to the name/slug, ALT text and caption fields. The connector between search terms can be "and" or "or".
|
26 |
|
27 |
* **Where-used reporting** shows which posts use a media item as the "featured image", an inserted image or link, an entry in a `[gallery]` and/or an entry in an `[mla_gallery]`.
|
28 |
|
@@ -117,6 +117,11 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
|
|
117 |
|
118 |
== Changelog ==
|
119 |
|
|
|
|
|
|
|
|
|
|
|
120 |
= 1.10 =
|
121 |
* New: Attachment metadata such as file size, dimensions and where-used status can be assigned to WordPress custom fields. These custom fields can be added to the Media/Assistant submenu table as sortable columns and displayed in `[mla_gallery]` shortcode output.
|
122 |
* New: Integrates with Photonic Gallery (plugin), so you can add slideshows, thumbnail strips and special effects to your `[mla_gallery]` galleries.
|
@@ -233,6 +238,9 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
|
|
233 |
|
234 |
== Upgrade Notice ==
|
235 |
|
|
|
|
|
|
|
236 |
= 1.10 =
|
237 |
Map attachment metadata to custom fields; add them to [mla_gallery] display and as sortable columns on the Media/Assistant submenu table. Get Photonic Gallery (plugin) integration and six other fixes.
|
238 |
|
@@ -452,72 +460,17 @@ The MLA Gallery tab on the Settings page lets you add, change and delete custom
|
|
452 |
In a template, substitution parameters are surrounded by opening ('[+') and closing ('+]') tags to separate them from the template text; see the default templates for many examples.
|
453 |
|
454 |
<h4>Substitution parameters for style templates</h4>
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
* `id`: post_ID of the post/page in which the gallery appears
|
459 |
-
* `itemtag`: shortcode parameter, default = 'dl'
|
460 |
-
* `icontag`: shortcode parameter, default = 'dt'
|
461 |
-
* `captiontag`: shortcode parameter, default = 'dd'
|
462 |
-
* `columns`: shortcode parameter, default = '3'
|
463 |
-
* `itemwidth`: shortcode parameter, default = '97' if 'columns' is zero, or 97/columns, e.g., '32' if columns is '3'
|
464 |
-
* `margin`: shortcode parameter, default = '1.5' (percent)
|
465 |
-
* `float`: 'right' if current locale is RTL, 'left' if not
|
466 |
-
* `selector`: "mla_gallery-{$instance}", e.g., mla_gallery-1
|
467 |
-
* `size_class`: shortcode 'size' parameter, default = 'thumbnail'</td>
|
468 |
<h4>Substitution parameters for markup templates</h4>
|
469 |
-
|
470 |
-
|
471 |
-
* `instance`: starts at '1', incremented for each additional shortcode in the post/page
|
472 |
-
* `id`: post_ID of the post/page in which the gallery appears
|
473 |
-
* `itemtag`: shortcode parameter, default = 'dl'
|
474 |
-
* `icontag`: shortcode parameter, default = 'dt'
|
475 |
-
* `captiontag`: shortcode parameter, default = 'dd'
|
476 |
-
* `columns`: shortcode parameter, default = '3'
|
477 |
-
* `itemwidth`: shortcode parameter, default = '97' if 'columns' is zero, or 97/columns, e.g., '32' if columns is '3'
|
478 |
-
* `margin`: shortcode parameter, default = '1.5' (percent)
|
479 |
-
* `float`: 'right' if current locale is RTL, 'left' if not
|
480 |
-
* `selector`: "mla_gallery-{$instance}", e.g., mla_gallery-1
|
481 |
-
* `size_class`: shortcode 'size' parameter, default = 'thumbnail'. If this parameter contains "none" or an empty string (size="") the attachment title will be displayed instead of the image/icon.
|
482 |
-
* `base_url`: absolute URL to the upload directory, without trailing slash
|
483 |
-
* `base_dir`: full path to the upload directory, without trailing slash
|
484 |
|
485 |
<h4>Attachment-specific substitution parameters for markup templates</h4>
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
* `attachment_ID`: attachment post_ID
|
490 |
-
* `mime_type`: attachment post_mime_type
|
491 |
-
* `menu_order`: attachment menu_order
|
492 |
-
* `date`: attachment post_date
|
493 |
-
* `modified`: attachment post_modified
|
494 |
-
* `parent`: attachment post_parent (ID)
|
495 |
-
* `parent_title`: post_title of the parent, or '(unattached)'
|
496 |
-
* `parent_type`: 'post', 'page' or custom post type of the parent
|
497 |
-
* `parent_date`: upload date of the parent
|
498 |
-
* `title`: attachment post_title
|
499 |
-
* `slug`: attachment post_name
|
500 |
-
* `width`: width in pixels, for image types
|
501 |
-
* `height`: height in pixels, for image types
|
502 |
-
* `image_meta`: image metadata, for image types
|
503 |
-
* `image_alt`: ALT text, for image types
|
504 |
-
* `base_file`: path and file name relative to uploads directory
|
505 |
-
* `path`: path portion of base_file
|
506 |
-
* `file`: file name portion of base_file
|
507 |
-
* `description`: attachment post_content
|
508 |
-
* `file_url`: attachment guid
|
509 |
-
* `author_id`: attachment post_author
|
510 |
-
* `author`: author display_name, or 'unknown'
|
511 |
-
* `link`: hyperlink to the attachment page (default) or file (shortcode 'link' parameter = "file")
|
512 |
-
* `pagelink`: always contains a hyperlink to the attachment page
|
513 |
-
* `filelink`: always contains a hyperlink to the attachment file
|
514 |
-
* `link_url`: the URL portion of `link`
|
515 |
-
* `pagelink_url`: the URL portion of `pagelink`
|
516 |
-
* `filelink_url`: the URL portion of `filelink`
|
517 |
-
* `thumbnail_content`: complete content of the gallery item link. This will either be an image (img) tag or a text string for non-image items.
|
518 |
-
* `thumbnail_width`: for image/icon items, width of the gallery image/icon
|
519 |
-
* `thumbnail_height`: for image/icon items, height of the gallery image/icon
|
520 |
-
* `thumbnail_url`: for image/icon items, URL of the gallery image/icon
|
521 |
<h3>Field-level Markup Substitution Parameters</h3>
|
522 |
|
523 |
Field-level substitution parameters let you access custom fields, taxonomy terms, IPTC metadata and EXIF metadata for display in an MLA gallery. For these parameters, the value you code within the surrounding the ('[+') and ('+]') delimiters has three parts; the prefix, the field name and the optional ",single" indicator.
|
@@ -622,42 +575,7 @@ Several of the data elements are sourced from the WordPress "image_meta" array.
|
|
622 |
|
623 |
<strong>NOTE:</strong> Sorting by custom fields in the Media/Assistant submenu is by string values. For numeric data this can cause odd-looking results, e.g., dimensions of "1200x768" will sort before "640x480". The "file_size", "pixels", "width" and "height" data sources are converted to srtings and padded on the left with spaces if you use the "commas" format. This padding makes them sort more sensibly.
|
624 |
|
625 |
-
|
626 |
-
* `file_name`: file name portion of the base_file value, e.g., image.jpg
|
627 |
-
* `extension`: extension portion of the base_file value, e.g., jpg
|
628 |
-
* `file_size`: file size in bytes
|
629 |
-
* `dimensions`: for image types, width x height, e.g., 1024x768
|
630 |
-
* `pixels`: for image types, size in pixels, e.g., 307200 for a 640x480 image
|
631 |
-
* `width`: for image types, width in pixels
|
632 |
-
* `height`: for image types, height in pixels
|
633 |
-
* `hwstring_small`: HTML dimensions of a "small" image, i.e., 128 or less width, 96 or less height. Not computed for images uploaded in WordPress 3.5 and later.
|
634 |
-
* `size_keys`: image size names for thumbnail versions of the image, e.g., "thumbnail, medium, large"
|
635 |
-
* `size_names`: image file names for thumbnail versions of the image, e.g., "image-150x150.jpg, image-300x225.jpg, image-600x288.jpg"
|
636 |
-
* `size_bytes`: file size in bytes for thumbnail versions of the image, e.g., "5127, 11829, 33968"
|
637 |
-
* `size_pixels`: image size in pixels for thumbnail versions of the image, e.g., "22500, 67500, 172800"
|
638 |
-
* `size_dimensions`: image dimensions for thumbnail versions of the image, e.g., "150x150, 300x225, 600x288"
|
639 |
-
<td style="padding-right: 10px; vertical-align: top; font-weight:bold">size_name[size]`: image file name for a specific thumbnail version, e.g., size_name[medium] = image-300x225.jpg; set to empty string if the specified size does not exist. There will be a [size] choice for every thumbnail version registered with WordPress for the site.
|
640 |
-
* `size_bytes[size]`: file size in bytes for a specific thumbnail version, e.g., size_bytes[medium] = "11829"
|
641 |
-
* `size_pixels[size]`: image size in pixels for a specific thumbnail version, e.g., size_pixels[medium] = "67500"
|
642 |
-
<tr>
|
643 |
-
<tr>
|
644 |
-
<td style="width: 12em; padding-right: 10px; vertical-align: top; font-weight:bold">size_dimensions[size]`: image dimensions for a specific thumbnail version, e.g., size_dimensions[medium] = 300x225; set to empty string if the specified size does not exist. There will be a [size] choice for every thumbnail version registered with WordPress for the site.
|
645 |
-
* `parent_type`: for "attached" (post_parent not zero) objects, post type of the parent object
|
646 |
-
<tr>
|
647 |
-
* `parent_name`: for "attached" (post_parent not zero) objects, post title of the parent object
|
648 |
-
<tr>
|
649 |
-
* `parent_issues`: summary of parent status (only) "issues", e.g., bad parent, invalid parent, unattached
|
650 |
-
* `reference_issues`: summary of all reference and parent status "issues", e.g., orphan, bad parent, invalid parent, unattached
|
651 |
-
* `aperture`: for image types, the value stored in WordPress "image_meta" array
|
652 |
-
* `credit`: for image types, the value stored in WordPress "image_meta" array
|
653 |
-
* `camera`: for image types, the value stored in WordPress "image_meta" array
|
654 |
-
* `caption`: for image types, the value stored in WordPress "image_meta" array
|
655 |
-
* `created_timestamp`: for image types, the value stored in WordPress "image_meta" array
|
656 |
-
* `copyright`: for image types, the value stored in WordPress "image_meta" array
|
657 |
-
* `focal_length`: for image types, the value stored in WordPress "image_meta" array
|
658 |
-
* `iso`: for image types, the value stored in WordPress "image_meta" array
|
659 |
-
* `shutter_speed`: for image types, the value stored in WordPress "image_meta" array
|
660 |
-
* `title`: for image types, the value stored in WordPress "image_meta" array
|
661 |
|
662 |
==IPTC & EXIF Processing Options==
|
663 |
|
@@ -746,6 +664,7 @@ The priority order for mapping the post_content value from non-blank IPTC/EXIF m
|
|
746 |
<h4>Search Media</h4>
|
747 |
<p>The “Search Media” box supports a keyword search of several attachment fields; enter words and/or phrases in the box, separated by spaces. Click the Search Media button for a case-insensitive "SQL LIKE" search. Each keyword in the search phrase is matched independently, so the order of search words does not have to match the order in the text. For example, searching on "friend" and "best" will match "Best Friend". If you put quotes around a search phrase then word order is required for a match (and spaces between words must match as well). You can also match on partial words, e.g., "rien" will match "friend".</p>
|
748 |
<p>Once you’ve entered the terms you want, use the options below the box to tailor your search. You can pick the connector used between search terms; "or" means any of the terms will match, "and" means all of the terms must match. Use the checkboxes to extend your search to more fields in the database.</p>
|
|
|
749 |
<h4>Bulk Actions</h4>
|
750 |
<p>The “Bulk Actions” dropdown list works with the check box column to let you make changes to many items at once. Click the check box in the column title row to select all items on the page, or click the check box in a row to select items individually.</p>
|
751 |
<p>Once you’ve selected the items you want, pick an action from the dropdown list and click Apply to perform the action on the selected items. The available actions will vary depending on the file type/status view you have picked.</p>
|
4 |
Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.5
|
7 |
+
Stable tag: 1.11
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
22 |
|
23 |
* **IPTC** and **EXIF** metadata can be assigned to standard WordPress fields, taxonomy terms and custom fields. You can update all existing attachments from the Settings page IPTC/EXIF tab, groups of existing attachments with a Bulk Action or one existing attachment from the Edit Media/Edit Single Item screen. Display **IPTC** and **EXIF** metadata with `[mla_gallery]` custom templates.
|
24 |
|
25 |
+
* **Enhanced Search Media box**. Search can be extended to the name/slug, ALT text and caption fields. The connector between search terms can be "and" or "or". Search by attachment ID is supported.
|
26 |
|
27 |
* **Where-used reporting** shows which posts use a media item as the "featured image", an inserted image or link, an entry in a `[gallery]` and/or an entry in an `[mla_gallery]`.
|
28 |
|
117 |
|
118 |
== Changelog ==
|
119 |
|
120 |
+
= 1.11 =
|
121 |
+
* New: If the search box contains (only) a numeric value it is interpreted as a search by attachment ID. You can search for a numeric value in the text fields, e.g., title, by putting quotes around the value.
|
122 |
+
* Fix: The edit taxonomy screen "Attachments" column is now computed correctly when adding new terms, avoiding fatal errors and other odd results.
|
123 |
+
* Fix: Adopted new WordPress standard for JavaScript files, i.e., use ".min.js" for minified (production) files.
|
124 |
+
|
125 |
= 1.10 =
|
126 |
* New: Attachment metadata such as file size, dimensions and where-used status can be assigned to WordPress custom fields. These custom fields can be added to the Media/Assistant submenu table as sortable columns and displayed in `[mla_gallery]` shortcode output.
|
127 |
* New: Integrates with Photonic Gallery (plugin), so you can add slideshows, thumbnail strips and special effects to your `[mla_gallery]` galleries.
|
238 |
|
239 |
== Upgrade Notice ==
|
240 |
|
241 |
+
= 1.11 =
|
242 |
+
Search by attachment ID, avoid fatal errors and other odd results when adding taxonomy terms. One other fix.
|
243 |
+
|
244 |
= 1.10 =
|
245 |
Map attachment metadata to custom fields; add them to [mla_gallery] display and as sortable columns on the Media/Assistant submenu table. Get Photonic Gallery (plugin) integration and six other fixes.
|
246 |
|
460 |
In a template, substitution parameters are surrounded by opening ('[+') and closing ('+]') tags to separate them from the template text; see the default templates for many examples.
|
461 |
|
462 |
<h4>Substitution parameters for style templates</h4>
|
463 |
+
|
464 |
+
A complete list of the <strong>13 style substitution parameters</strong> is on the plugin's Settings page.
|
465 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
<h4>Substitution parameters for markup templates</h4>
|
467 |
+
|
468 |
+
A complete list of the <strong>15 markup substitution parameters</strong> is on the plugin's Settings page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
|
470 |
<h4>Attachment-specific substitution parameters for markup templates</h4>
|
471 |
+
|
472 |
+
A complete list of the <strong>35 attachment-specific substitution parameters</strong> is on the plugin's Settings page.
|
473 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
<h3>Field-level Markup Substitution Parameters</h3>
|
475 |
|
476 |
Field-level substitution parameters let you access custom fields, taxonomy terms, IPTC metadata and EXIF metadata for display in an MLA gallery. For these parameters, the value you code within the surrounding the ('[+') and ('+]') delimiters has three parts; the prefix, the field name and the optional ",single" indicator.
|
575 |
|
576 |
<strong>NOTE:</strong> Sorting by custom fields in the Media/Assistant submenu is by string values. For numeric data this can cause odd-looking results, e.g., dimensions of "1200x768" will sort before "640x480". The "file_size", "pixels", "width" and "height" data sources are converted to srtings and padded on the left with spaces if you use the "commas" format. This padding makes them sort more sensibly.
|
577 |
|
578 |
+
A complete list of the <strong>32 data source elements</strong> is on the plugin's Settings page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
|
580 |
==IPTC & EXIF Processing Options==
|
581 |
|
664 |
<h4>Search Media</h4>
|
665 |
<p>The “Search Media” box supports a keyword search of several attachment fields; enter words and/or phrases in the box, separated by spaces. Click the Search Media button for a case-insensitive "SQL LIKE" search. Each keyword in the search phrase is matched independently, so the order of search words does not have to match the order in the text. For example, searching on "friend" and "best" will match "Best Friend". If you put quotes around a search phrase then word order is required for a match (and spaces between words must match as well). You can also match on partial words, e.g., "rien" will match "friend".</p>
|
666 |
<p>Once you’ve entered the terms you want, use the options below the box to tailor your search. You can pick the connector used between search terms; "or" means any of the terms will match, "and" means all of the terms must match. Use the checkboxes to extend your search to more fields in the database.</p>
|
667 |
+
<p>If you enter a numeric value (only) in the search box, it is interpreted as a search by attachment ID. You can search for a numeric value in the text fields, e.g., title, by putting quotes around the value.</p>
|
668 |
<h4>Bulk Actions</h4>
|
669 |
<p>The “Bulk Actions” dropdown list works with the check box column to let you make changes to many items at once. Click the check box in the column title row to select all items on the page, or click the check box in a row to select items individually.</p>
|
670 |
<p>Once you’ve selected the items you want, pick an action from the dropdown list and click Apply to perform the action on the selected items. The available actions will vary depending on the file type/status view you have picked.</p>
|
tpls/help-for-media_page_mla-menu.tpl
CHANGED
@@ -28,6 +28,7 @@
|
|
28 |
<!-- title="Search Media" order="6" -->
|
29 |
<p>The “Search Media” box supports a keyword search of several attachment fields; enter words and/or phrases in the box, separated by spaces. Click the Search Media button for a case-insensitive "SQL LIKE" search. Each keyword in the search phrase is matched independently, so the order of search words does not have to match the order in the text. For example, searching on "friend" and "best" will match "Best Friend". If you put quotes around a search phrase then word order is required for a match (and spaces between words must match as well). You can also match on partial words, e.g., "rien" will match "friend".</p>
|
30 |
<p>Once you’ve entered the terms you want, use the options below the box to tailor your search. You can pick the connector used between search terms; "or" means any of the terms will match, "and" means all of the terms must match. Use the checkboxes to extend your search to more fields in the database.</p>
|
|
|
31 |
<!-- template="mla-bulk-actions" -->
|
32 |
<!-- title="Bulk Actions" order="7" -->
|
33 |
<p>The “Bulk Actions” dropdown list works with the check box column to let you make changes to many items at once. Click the check box in the column title row to select all items on the page, or click the check box in a row to select items individually.</p>
|
28 |
<!-- title="Search Media" order="6" -->
|
29 |
<p>The “Search Media” box supports a keyword search of several attachment fields; enter words and/or phrases in the box, separated by spaces. Click the Search Media button for a case-insensitive "SQL LIKE" search. Each keyword in the search phrase is matched independently, so the order of search words does not have to match the order in the text. For example, searching on "friend" and "best" will match "Best Friend". If you put quotes around a search phrase then word order is required for a match (and spaces between words must match as well). You can also match on partial words, e.g., "rien" will match "friend".</p>
|
30 |
<p>Once you’ve entered the terms you want, use the options below the box to tailor your search. You can pick the connector used between search terms; "or" means any of the terms will match, "and" means all of the terms must match. Use the checkboxes to extend your search to more fields in the database.</p>
|
31 |
+
<p>If you enter a numeric value (only) in the search box, it is interpreted as a search by attachment ID. You can search for a numeric value in the text fields, e.g., title, by putting quotes around the value.</p>
|
32 |
<!-- template="mla-bulk-actions" -->
|
33 |
<!-- title="Bulk Actions" order="7" -->
|
34 |
<p>The “Bulk Actions” dropdown list works with the check box column to let you make changes to many items at once. Click the check box in the column title row to select all items on the page, or click the check box in a row to select items individually.</p>
|