Textpattern Forum

You are not logged in. Register | Login | Help

#61 2010-01-27 01:52:58

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote:

I hope I have shed some light on the matter …

Many thanks for taking the time to explain this. I understand the logic, and your explanation was very clear. Much appreciated :)


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#62 2010-01-27 21:54:41

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 810
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

Great plugin redbot – I somehow missed this one and have just used it for the first time… blown away, just what I was after.

Thanks

Online

#63 2010-01-28 10:51:36

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 372
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

This is really cool redbot. I don’t know if this is already possible: The option to register an expand/collapse label that would toggle a grouping. The grouping would also have to be registered. Like: Toggle1 (custom_1, custom_23, article_image, etc).

Eh?

Gerhard looks as though he’ll implement this sort of functionality in glz_custom_fields and because I am using that and your plugin extensively right now it occurred that the two should continue to jive together and do great things together.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#64 2010-01-28 12:16:47

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,399

Re: bot_write_tab_customize: rearrange and style items in the write tab

whaleen wrote:

… The option to register an expand/collapse label that would toggle a grouping….

Hi Josh,
this feature is not provided by default but you can achieve what you want adding some lines of jquery in the “additional js code” field.
I can’t help you now but a similar – though simpler – request has already been answered here.
The principle should be the same: first add the same class to items you want to expand/collapse together (for example .toggle1 for cf1 +cf2 and .toggle 2 for cf3+cf4) and then – through jquery – add somewhere in your “write” tab one or more texts or links or buttons which trigger the expand/collapse behaviour.

Last edited by redbot (2010-01-28 12:17:01)

Offline

#65 2010-01-29 01:20:53

mlarino
Member
Registered: 2007-06-29
Posts: 364

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote:

For the collapsible excerpt write this rules in the js box, after you have attached a “collapse” class to the excerpt:

<script type="text/javascript"> $(document).ready(function() { $(".collapse label").click(function(){ $(this).parent().find("textarea").slideToggle(); }); }); </script>

I am having problems inserting JS in the plugin, I am getting this warning:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text/javascript"> $(document).ready(function() { $(".collapse").click' at line 1 update txp_prefs set val= "", html="textarea" where name = "bot_wtc_script" in /home/sites/mlarino.com/public_html/asesoria/textpattern/lib/txplib_db.php on line 113

Last edited by mlarino (2010-01-29 01:35:35)

Offline

#66 2010-01-29 14:37:03

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,399

Re: bot_write_tab_customize: rearrange and style items in the write tab

mlarino wrote:

I am having problems inserting JS in the plugin, I am getting this warning:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text/javascript"> $(document).ready(function() { $(".collapse").click' at line 1 update txp_prefs set val= "", html="textarea" where name = "bot_wtc_script" in /home/sites/mlarino.com/public_html/asesoria/textpattern/lib/txplib_db.php on line 113

mlarino,
this is strange I never had such an issue and it was never reported before.
Just to be sure: you have pasted the code in the js box and got this error after pressing “submit”?
Of course I have tried it myself but all works correctly… it looks like an escaping problem
A couple of questions:
1) are you using the latest version of the plugin?
2) which version of txp are you using?

Has anybody else experienced this problem?

Offline

#67 2010-01-29 15:06:32

mlarino
Member
Registered: 2007-06-29
Posts: 364

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote:

A couple of questions:
1) are you using the latest version of the plugin?
2) which version of txp are you using?
Has anybody else experienced this problem?

It happens as you say, I paste the code in the JS box and get the message when I hit the “submit” button.

I have Textpattern 4.2.0 and
bot_write_tab_customize 0.5.2

The rest of the plugins I have installed are:
gbp_admin_library
glz_custom_fields
l10n
lam_image_uploader
rah_replace
smd_admin_themes
wet_haystack
zem_contact_lang-mlp

Last edited by mlarino (2010-01-29 15:07:06)

Offline

#68 2010-01-29 15:28:57

mlarino
Member
Registered: 2007-06-29
Posts: 364

Re: bot_write_tab_customize: rearrange and style items in the write tab

Ok, testing and testing I found out that instead of using " if I use ' in all the sintax, the plugin lets me save the javascript.

instead of this:

<script type="text/javascript">  $(document).ready(function() { $("toggle").click(function(){ $(this).parent().find("textarea").slideToggle(); }); }); </script>

I have to use this:

<script type='text/javascript'>  $(document).ready(function() { $('toggle').click(function(){ $(this).parent().find('textarea').slideToggle(); }); }); </script>

Why do you think this hapends?

-Either way, the javascript is not doing anything to the custom field at all.

Last edited by mlarino (2010-01-29 15:29:46)

Offline

#69 2010-01-29 16:28:13

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,399

Re: bot_write_tab_customize: rearrange and style items in the write tab

mlarino,
so if you use this code (escaping double quotes with “\”):

<script type=\"text/javascript\">  $(document).ready(function() { $(\".collapse label\").click(function(){ $(this).parent().find(\"textarea\").slideToggle(); }); }); </script>

it should also give no errors.

Anyway I’ll try to understand why it works for me and not for you…

-Either way, the javascript is not doing anything to the custom field at all.

What you mean? This code was an answer to this request (expland/collapse the escerpt box) while you are talking about custom fields…

Offline

#70 2010-01-29 16:31:47

mlarino
Member
Registered: 2007-06-29
Posts: 364

Re: bot_write_tab_customize: rearrange and style items in the write tab

mmm
yes, I guess you are right….
I just thought that adding the collampse calss to de cutom field, at least it would wrap that custom field… maybe I was wrong.
I will keep testing and trying and see if I can figure it out .
Thanks!

Offline

Board footer

Powered by FluxBB