Continued WPG2 support on github

suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-09-23 14:40

I'm assuming support role for WPG2 and have put up the current repo on github.

Testing/Experimenting here.

-s
All New jQuery Minislideshow for G2/G3

 
arirea

Joined: 2008-03-09
Posts: 20
Posted: Sun, 2012-10-28 04:02

Thank you for this.

The only reason that prevents me from migrating my gallery2 site to gallery3 is this plugin - I make extensive use of <wpg2> tags in blog posts.

Is there any hope that this plugin will be ported to gallery3 (and the <wpg2> still maintained)? or... do you recommend an alternate strategy/plugin that would make a migration to gallery3 possible?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-10-28 04:25

Why?
G2 is not dead.
G3 is not better.
G3 has no external API

I just released a "display only" G3 plugin for WP <- No user mapping/logging, no user/admin functionality <- No external embed API

I also created a ckeditor plugin out of G2Image ;)

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
arirea

Joined: 2008-03-09
Posts: 20
Posted: Sun, 2012-10-28 04:50

Cool :)
That means I can stick with my G2 / WP3 combo for a while. I thought it was no longer supported (in the G2/WPG2 side of things).

Question (for the future, that is): will the new plugin support the same <wpg2> tag in blog posts?

I also saw your post RE ckeditor/G2Image - I can't say I understand what that means, but I can ask :) : new version of wpg2 coming? or preparation for porting to g3?
cheers!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-10-28 05:00
Quote:
Question (for the future, that is): will the new plugin support the same <wpg2> tag in blog posts?

I have no plans to change anything major.
There are a few API calls that are depreciated and in need of updating.
And I'd like to lose the dependency on the image frame module.
Also G2Image no longer functions w/ the default WYSIWYG editor in WP, so i updated it to work w/ ckeditor
I need to make a tut on how to install that and probably release the actual plugin ;)

Quote:
but I can ask :) : new version of wpg2 coming? or preparation for porting to g3?

There may be a WPG2 update, only to address those 2 concerns listed above - but there will be no porting to G3 as G3 is a totally different application w/ nothing in common w/ G2 && G3 has no external API.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
bladerelic

Joined: 2012-11-11
Posts: 2
Posted: Tue, 2012-11-13 00:18

how can we get our hands on the experimental template you are using?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-11-13 00:45
bladerelic wrote:
how can we get our hands on the experimental template you are using?

Are you referring to the G2 theme on my demo?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
bladerelic

Joined: 2012-11-11
Posts: 2
Posted: Tue, 2012-11-13 02:21

yes sir. i love the way it looks

 
pgxperetz
pgxperetz's picture

Joined: 2012-11-13
Posts: 3
Posted: Tue, 2012-11-13 03:55
Quote:
Also G2Image no longer functions w/ the default WYSIWYG editor in WP, so i updated it to work w/ ckeditor
I need to make a tut on how to install that and probably release the actual plugin ;)

Please do!

I have the CKEditor plugin working and it's wonderful to have a working visual editor again (I banged my head against a wall for 2-3 hours before finding the text quoted above), but I would love to have G2Image working and the "insert image" button in the visual editor working again.

You've already helped so much just by keeping this plugin alive, but please forgive my greed when I ask: How can I get G2Image working with CKEditor and WPG2?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-11-13 20:40

G2Image for CKEditor In WP
http://wp.suprsidr.com/g2image-for-ckeditor-in-wp

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
pgxperetz
pgxperetz's picture

Joined: 2012-11-13
Posts: 3
Posted: Thu, 2012-11-15 05:01

Your post and the comment underneath it gave me the info (and files) I needed to get it working. Thank you SO much! :)

 
pgxperetz
pgxperetz's picture

Joined: 2012-11-13
Posts: 3
Posted: Fri, 2012-12-21 05:16
suprsidr wrote:
G2Image for CKEditor In WP
http://wp.suprsidr.com/g2image-for-ckeditor-in-wp

CKEditor 4.0 changed how plugins are added to the WordPress toolbar. I was able to get the G2Image icon shortcut back into the toolbar, but when I click it, the image selector is stuck in a small frame (so I have to scroll down to see even the second row of images).

EDIT: And, more importantly, the Insert button has disappeared. :(

Have you gotten G2Image to play nice with CKEditor 4.0 yet?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-21 05:20

I just upgraded to 4.0 last night and did not find it difficult to configure.
Oh, I see what you mean, the popup is large, but the iframe is small... k lemme see what's up.

BTW adding G2Image:

    // G2Image plugin
    config.extraPlugins += (config.extraPlugins ? ',G2Image' : 'G2Image' );
    CKEDITOR.plugins.addExternal('G2Image', ckeditorSettings.pluginPath + 'plugins/G2Image/');

in the toolbargroup

{ name: 'insert', items: ['G2Image'] },

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-21 05:59

turns out its on their end.

<div style="width: 100%;" class="cke_dialog_ui_vbox cke_dialog_page_contents" id="cke_85_uiElement" role="tabpanel" aria-labelledby="cke_iframe_86" name="iframe" aria-hidden="false"></div>

this element has no height.
Add this to the end of /wp-admin/css/wp-admin.min.css:

.cke_dialog_page_contents {
    height: 100% !important;
}

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Hardtana
Hardtana's picture

Joined: 2007-05-16
Posts: 45
Posted: Tue, 2012-12-25 16:06

Seeing this topic is a huge relief - thank you for having decided this. :)

I was wondering if it would be possible to work with you on templates at any point, to make everything a tiny bit more simple or responsive? I would gladly volunteer for this, after almost six years of using the plugin. My website is now responsive and this is the only part of it that does not function in such fashion. I figured out that many people would be interested.

As for the person who wondered about the BBCode - it still works, it's just that you have to grab your album's ID manually. If you still need it, I can guide you through it or make a tutorial with pictures.

http://invisible-movement.net <-- gallery powered by Gallery2 and WPG2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-12-25 16:16

When you refer to templates are you referring to G2 theme templates?
My photog theme is responsive as is this one(mostly not finished)

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Hardtana
Hardtana's picture

Joined: 2007-05-16
Posts: 45
Posted: Tue, 2012-12-25 21:25

The general integration of G2 and WordPress, via WPG2. If I knew what to do, I would definitely want to contribute something.

http://invisible-movement.net <-- gallery powered by Gallery2 and WPG2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2012-12-26 12:30

You'd have to be more specific.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
genbian

Joined: 2009-02-05
Posts: 14
Posted: Sun, 2012-12-30 20:05

Great, I just updated an installation and ran into some things that needed taking care of some source code.
1. there is one line (line 431) in wpg2functions.inc ($newrules[$wpg2rewriterule] = preg_replace($wpDirectory,'',$rule['substitution']);) which should be replaced by three lines

if( substr( $rule['substitution'], 0, strlen( $wpDirectory ) ) == $wpDirectory )
	$newrules[$wpg2rewriterule] = substr( $rule['substitution'], strlen( $wpDirectory ) );
else
	$newrules[$wpg2rewriterule] = $rule['substitution'];

to get some cases of url-rewrite working: see http://gallery.menalto.com/node/80236

2. In some(perhaps all) non English Wordpress Versions newer then 2.? (at least Wordpress 3.5 German) the standard visual editor of Wordpress (TinyMCE) does not show the wpg2-photo-button. And furthermore it shows, in the editor windows, instead of the <wpg>-tags with numbers only the numbers without the surrounding <wpg2>464</wpg2>-tags.
I changed in file WPG2/G2IMAGE/LANGS/de.js:
tinyMCE.addToLang to tinyMCE.addI18n and it worked.

See: http://codex.gallery2.org/Integration_talk:WPG2
I guess this needs to be done for all other languages too.

genbian

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-12-30 20:16

Thanks for the update.
I've never seen the G2Image button in TinyMCE - I thought WP had moved away from that editor and I instead wrote a CKeditor plugin for it. CKeditor rocks!

I'll make the suggested changes and commit. I have some other depreciated WP functions to update as well.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
genbian

Joined: 2009-02-05
Posts: 14
Posted: Sun, 2012-12-30 21:36

Unfortunately I have to revoke that the g2image button is there with wpg 3.0.7 and a German WP 3.5 using the stock editor.
Earlier today, with 3.0.5 and WP 3.5 I have seen and used it...
And assumed, well then it will be there if I patch the de.js file of wpg2 3.0.7.

But that was not enough.

Now I'm not sure in what state my wpg2 installation is... I edited so many files...
And found another iteration of the de.js of g2image at http://www.pflaeging.net/blog/archives/265
which uses

tinyMCE.addI18n({en:{
g2image:{

I installed the Wordpress plugin "TinyMCE Advanced 3.5.8"... perhaps I'll figure out how they integrate additional buttons to the visual editor. I read that tinyMCE changed some methods (like addToLang vs addI18n) perhaps there are other ones too.
If this fails, I'll have to go for the CKeditor and your plugin.

genbian

 
genbian

Joined: 2009-02-05
Posts: 14
Posted: Mon, 2012-12-31 01:17

Well,
s.th. must be wrong with my installation.
Now I installed "CKEditor for WordPress" 4.0 and your CKeditor plugin "G2Image" 3.0.2.
But I still only have numbers in the editor window, when editing an existing post with embedded gallery content.
Also the G2-Button in the CKeditor is missing, though Firebug tells me that a script plugin.js from wp-content/plugins/ckeditor-for-wordpress/plugins/G2Image/ was loaded...
So the changes in ckeditor.config.js must have been correct. On the other Hand G2Image is not listed under Dashboard -> CKEditor -> Advanced Options -> Plugins. But I guess that's okay.

Let's see what tomorrow brings. (Perhaps a reinstall?)

bye
genbian
P.S.: I looked into the editor_plugin.js from wpg2 3.0.7 which is the plugin for TinyMCE/the standard editor of WP and consulted a Howto migrate a plugin from TinyMCE 2.x to 3.x. To me it looks like that nearly a complete rewrite of this plugin is necessary to update it for the TinyMCE 3.x API. I tried something (copy/paste mainly), but without any JavaScript and TinyMCE knowledge..., well it just wouldn't work and I also don't know how to debug that JS stuff.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-12-31 02:32
Quote:
"CKEditor for WordPress" 4.0

was a little different - I just upgraded to it the other day
CKEditor config:

/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

/**
 * Documentation:
 * http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
 */

CKEDITOR.editorConfig = function(config) {
	// The minimum editor width, in pixels, when resizing it with the resize handle.
	config.resize_minWidth = 450;

	// Protect PHP code tags (<?...?>) so CKEditor will not break them when
	// switching from Source to WYSIWYG.
	config.protectedSource.push(/<\?[\s\S]*?\?>/g);

	// Define toolbars, you can remove or add buttons.
	// List of all buttons is here: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.toolbar_Full

	// WordPress basic toolbar
	config.toolbar_WordpressBasic = [
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] },
		{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight'] },
		{ name: 'links', items: [ 'Link', 'Unlink' ] },
		{ name: 'insert', items: [ 'Image','G2Image', 'SpecialChar' ] }
	];

	// The equivalent of "WordpressFull" toolbar, defined in a way that makes adding buttons from plugins easier.
	config.toolbarGroups = [
		{ name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
		{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
		{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
		// { name: 'forms' },
		'/',
		{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align' ] },
		{ name: 'links' },
		{ name: 'insert', items: ['G2Image'] },
		{ name: 'wordpress' },
		'/',
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
		{ name: 'styles' },
		{ name: 'colors' },
		{ name: 'tools' },
		{ name: 'about' }
	];

	// Remove buttons in "WordpressFull" toolbar
	config.WordpressFull_removeButtons = 'Save,NewPage,Preview,Print,Templates,CreateDiv,PageBreak,Subscript,Superscript,Styles';

	//IE: remove border of image when is as a link
	config.extraCss = "a img { border: 0px\\9; }";

	// mediaembed plugin
	// config.extraPlugins += (config.extraPlugins ? ',mediaembed' : 'mediaembed' );
	// CKEDITOR.plugins.addExternal('mediaembed', ckeditorSettings.pluginPath + 'plugins/mediaembed/');

	// G2Image plugin
	config.extraPlugins += (config.extraPlugins ? ',G2Image' : 'G2Image' );
	CKEDITOR.plugins.addExternal('G2Image', ckeditorSettings.pluginPath + 'plugins/G2Image/');
};

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-12-31 02:33

Oh, and I don't care about TinyMCE

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
genbian

Joined: 2009-02-05
Posts: 14
Posted: Mon, 2012-12-31 15:31

Many thanks for your awesome help suprsidr!
Now I've got CKeditor for Wordpress 4.0 working with your G2Image-Plugin for CKeditor.

I'll describe my setup here for the next time I (or s.o. else) set s.th. up like this:
Wordpress 3.5 (German)
Gallery2 2.3.2

Plugins for Wordpress:
WPG2 3.0.7
"CKEditor for WordPress" 4.0
WP Sentry 0.8c

Plugins for "CKEditor for WordPress":
"g2image-for-ckeditor-in-wp" (can't determine a real Version number right now, but i downloaded it there on 2012-12-30. Setup instructions are there, and some in this thread e.g. getting the size of the Gallery2 image chooser corrected: posted Fri, 2012-12-21 00:59 by suprsidr, and the changes for Version 4.0 of ckeditor, Posted: Sun, 2012-12-30 21:32 )

I'm using WP Sentry for a private blog, so only people logged into the blog can view (certain/most) posts. Because of that I only want those people to see the pictures in my gallery installation, so WPG2 is used to embed the gallery into the blog and to authenticate the users.
Because those wpg2 authentication cookies are only good for the embedded gallery and not for the standalone url of the gallery
both: "$g2ic_gallery2_uri" and $g2ic_embed_uri point to the embedded gallery page. Otherwise no pictures will show up neither in the selector, nor in the postings.
As my gallery is neither in the root directory, nor in the standard path I also had to edit "$g2ic_gallery2_path" in the afore mentioned config.php of the G2image plugin for ckeditor.

Yours
genbian

P.S.: the size of the gallery2 image chooser can also be fixed in the /wp-content/plugins/ckeditor-for-wordpress/ckeditor/ckeditor.js
line 427
old:
style:a.style||"width: 100%;"},b),b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");var
new:
style:a.style||"width: 100%; height: 100%"},b),b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");var
Not sure if this breaks s.th. else somewhere else... But works for me.
Not sure what will last longer: css or or the javascript code...