Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2018-04-12 16:39:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Testers needed: flat development (4.7+ only)

etc wrote #310936:

Not sure why we need to append .txp extension, though.

Perhaps we should only append the .txp extension if the name doesn’t already have one? That would depend if the system ignores other files. I think the regex does that.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#38 2018-04-12 16:40:56

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Testers needed: flat development (4.7+ only)

colak wrote #310934:

You did say something here which could actually make sense for future txp versions.

This future could be very near, in fact. Few hours of coding… :-)

Offline

#39 2018-04-12 16:45:16

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310938:

Perhaps we should only append the .txp extension if the name doesn’t already have one? That would depend if the system ignores other files. I think the regex does that.

If we are going to squat Styles pane (renamed to Assets?), we can leave forms as is, I guess.

Offline

#40 2018-04-12 16:50:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Testers needed: flat development (4.7+ only)

etc wrote #310939:

This future could be very near, in fact. Few hours of coding… :-)

Tease :-)

do it: you know you want to! that’s what branches are for

etc wrote #310940:

If we are going to squat Styles pane (renamed to Assets?), we can leave forms as is, I guess.

True dat.

EDIT: We’ve referred to Forms, Styles and Pages collectively as Assets in the documentation (only because that’s what they’re called in the code and I copied it). So we’d need to tweak the docs a tad, nothing major.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#41 2018-04-12 17:21:11

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Testers needed: flat development (4.7+ only)

etc wrote #310939:

Few hours of coding… :-)

does not mean by me! Stef, if you know what to change to avoid the auto .css extension, please do. I can tweak <txp:css /> meanwhile, and we are all set.

Offline

#42 2018-04-12 17:42:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Testers needed: flat development (4.7+ only)

etc wrote #310943:

does not mean by me! Stef, if you know what to change to avoid the auto .css extension, please do.

I’ll look at it tonight.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#43 2018-04-12 18:40:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310942:

EDIT: We’ve referred to Forms, Styles and Pages collectively as Assets in the documentation (only because that’s what they’re called in the code and I copied it). So we’d need to tweak the docs a tad, nothing major.

What about if it is renamed to Types? It will in the foreseeable future deal with discrete, text mime types, right?

Edit> Yet again json is left out there with its application/json mime type.

Last edited by colak (2018-04-12 18:42:30)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#44 2018-04-12 19:10:42

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Testers needed: flat development (4.7+ only)

If it helps, here is a (not exhaustive) list of possible mimetypes we could support:

[
        'txt'  => 'text/plain',
        'csv'  => 'text/csv',
        'htm'  => 'text/html',
        'html' => 'text/html',
        'css'  => 'text/css',
        'js'   => 'application/javascript',
        'json' => 'application/json',
        'xml'  => 'application/xml',
        // Images
        'svg'  => 'image/svg+xml'
]

Edit: drastically shortened, please complain if something is missing.

Offline

#45 2018-04-12 19:21:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Testers needed: flat development (4.7+ only)

etc wrote #310949:

If it helps, here is a (not exhaustive) list of possible mimetypes we could support:

whoa! That’s much more than I expected!!!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#46 2018-04-12 19:35:08

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Testers needed: flat development (4.7+ only)

colak wrote #310951:

whoa! That’s much more than I expected!!!

Well, there is probably no reason to store non-editable types in the db, so the list is likely to be shorten. Now a million dollars question: could some of txp users have named his styles with .js, .xml or some other extension? If we enable auto-guessing, this could be a problem.

Offline

#47 2018-04-12 19:38:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Testers needed: flat development (4.7+ only)

wow, way to go you two. I think the name “assets” covers a lot of the cases.


TXP Builders – finely-crafted code, design and txp

Offline

#48 2018-04-12 19:57:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Testers needed: flat development (4.7+ only)

etc wrote #310954:

Well, there is probably no reason to store non-editable types in the db, so the list is likely to be shorten.

Yeah, I’d challenge anyone to edit a .zip or .exe file in the Styles panel!

could some of txp users have named his styles with .js, .xml or some other extension?

Tough. If you rename a file extension in a desktop OS, you lose the ‘shortcut’ ability to double click it and launch the associated app. Or it loads the wrong app.

In Txp, let’s use the same approach: if you use a crappy extension for your stylesheet, you lose the ability to use the native <txp:css /> tag for that asset. If it was done on purpose, you could still use the new tag to output it by overriding the guessed mimetype.

EDIT: the only thing I would say is that if you don’t specify a file extension, should we fall back on assuming .css? In my Stylesheet names I rarely use a name with an extension. Or does this issue only affect file-based assets?

Last edited by Bloke (2018-04-12 19:59:47)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB