Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-07-17 07:05:53

jpdupont
Member
Registered: 2004-10-01
Posts: 752

$prefs or jquery question

I would like to adapt the petri ikonen plugins (kuo) to the new textfilters layout of 4.7 dev
The jquery code to target the options (textile, etc.) is currently:

$("select#markup-body option[value=0]").attr("selected","selected");
$("select#markup-excerpt option[value=0]").attr("selected","selected");

The markup-body id no longer exists. The select code is now quite different … how to target and force the textfilter?

I also tried this in the plugin body, with an unexpected effect: set_prefs ('use_textile', '0');

Thank you for your help !

Last edited by jpdupont (2017-07-17 07:45:12)

Offline

#2 2017-07-17 09:16:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,194
Website

Re: $prefs or jquery question

Untested:

$(".body select.jquery-ui-selectmenu")
$(".excerpt select.jquery-ui-selectmenu")

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2017-07-26 15:26:20

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: $prefs or jquery question

$(".body select.jquery-ui-selectmenu option[value=0]").attr("selected","selected");
$(".excerpt select.jquery-ui-selectmenu option[value=0]").attr("selected","selected");

Don’t work … This is not an ordinary select and I can not do it despite multiple attempts :-((

Last attemp :

$(".body .textfilter-value").attr("value","0");
$(".excerpt .textfilter-value").attr("value","1");

Works when article saved. Value “0” for whysiwyg editor and “1” for textile use (Codemirror editor).
Before save, the display is wrong. So I must hide this setting to force the textfilter.

Last edited by jpdupont (2017-07-26 15:58:53)

Offline

Board footer

Powered by FluxBB