Skip to content

Commit f2c8cf2

Browse files
committed
Initial commit.
0 parents  commit f2c8cf2

4 files changed

Lines changed: 83 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GlotPress Single Click Edit
2+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that allows you to single click a translation row to open the editor.
3+

readme.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=== GP Single Click Edit ===
2+
Contributors: gregross
3+
Donate link: http://toolstack.com/donate
4+
Plugin URI: http://glot-o-matic.com/gp-single-click-edit
5+
Author URI: http://toolstack.com
6+
Tags: translation, glotpress
7+
Requires at least: 4.4
8+
Tested up to: 4.4
9+
Stable tag: 0.5
10+
License: GPLv2
11+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12+
13+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that allows you to single click a translation row to open the editor.
14+
15+
== Description ==
16+
17+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that allows you to single click a translation row to open the editor.
18+
19+
== Installation ==
20+
21+
Install from the WordPress plugin directory.
22+
23+
== Frequently Asked Questions ==
24+
25+
= TBD =
26+
27+
TBD
28+
29+
== Changelog ==
30+
31+
= 1.0 =
32+
* Release Date: TBD
33+
* Initial release.
34+
35+
== Upgrade Notice ==
36+
37+
= 1.0 =
38+
39+
Initial release, no upgrade notes at this time.
40+

single-click-edit.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
jQuery(document).ready( function() {
2+
jQuery($gp.editor.table).on('click', 'tr.preview td', $gp.editor.hooks.show);
3+
});

single-click-edit.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/*
3+
Plugin Name: GlotPress Single Click Edit
4+
Plugin URI: http://glot-o-matic.com/gp-single-click-edit
5+
Description: Enable editing of a translation with a single click as well as a double click in GlotPress.
6+
Version: 0.5
7+
Author: gregross
8+
Author URI: http://toolstack.com
9+
Tags: glotpress, glotpress plugin
10+
License: GPLv2
11+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12+
*/
13+
14+
class GP_Single_Click_Edit {
15+
public $id = 'single-click-edit';
16+
17+
public function __construct() {
18+
wp_register_script( 'single-click-edit', plugins_url( 'single-click-edit.js', __FILE__ ), array( 'jquery', 'gp-common', 'gp-editor', 'gp-translations-page' ) );
19+
20+
add_action( 'gp_pre_tmpl_load', array( $this, 'gp_pre_tmpl_load' ), 10, 2 );
21+
}
22+
23+
public function gp_pre_tmpl_load( $template, $args ) {
24+
gp_enqueue_script( 'single-click-edit' );
25+
}
26+
27+
}
28+
29+
// Add an action to WordPress's init hook to setup the plugin. Don't just setup the plugin here as the GlotPress plugin may not have loaded yet.
30+
add_action( 'gp_init', 'gp_single_click_edit_init' );
31+
32+
// This function creates the plugin.
33+
function gp_single_click_edit_init() {
34+
GLOBAL $gp_single_click_edit;
35+
36+
$gp_single_click_edit = new GP_Single_Click_Edit;
37+
}

0 commit comments

Comments
 (0)