New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template Style Dialog Plugin #1163
Conversation
I'm not too hapy with it
1: The doc page https://www.dokuwiki.org/plugin:styler is about another plugin called styler (2007). 2: "Template Style Settings" popover appears to me empty and partly off-screen, and jumps down when I try to resize it. Firefox 31. |
Ah I guess we have to find a different name then. Are you sure you're running a fresh cache? Try touching conf/local.php. Can you provide any error messages? |
It seems the problem is here: Because DOKU_BASE = '/' |
Yes, removing first slash from '/lib/exe/ajax.php' helps.
|
good catches. I fixed them. Regarding the positioning. That's weird. It's supposed to be in the lower left corner. What template do you use and what browsers? |
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
Standard template, Firefox 31.
I use zooming FF plugins such as NoSquint, but maybe the problem is somewhere else. |
Scrutinizer Auto-Fixes
@@ -47,6 +47,7 @@ | |||
!/lib/plugins/popularity | |||
!/lib/plugins/revert | |||
!/lib/plugins/safefnrecode | |||
!/lib/plugins/styler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to swap the name here as well.
I personally don't like either "styler" or "styling". Those names are far too generic and sound like they would do something else. What was wrong with its original name "templatestyler"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is in spirit with "config" and "extension". There was never a "original name". I started with styler which was taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With "original name" I mean the one I gave the prototype which you based this on. The folder was called "templatestyler".
The problem I have with calling it "styling" is that it's not clear what it is styling. And it is not even "styling" a lot. It is changing existing styles based on a handful of variables.
It is not the same as "config" or "extension".
@selfthinker @chang-zhao can you have a look at this again? I completely removed the jQuery UI dialog in favor of a real popup (new browser window). This simplifies the whole handling a lot and has the advantage that we can display the popup with a sane style even if a user (temporarily) breaks the styles. I reintroduced the preview button because preview is relatively slow. A simple loading screen takes care of informing the user that something is happeing. Since I no longer use the cookie, a user needs to press "preview" whenever she browses to a different page. Is that okay or should I reintroduce the cookie? |
If there is a reason to not use cookie, then it's OK. We just give a user warning about that, and (s)he presses "Preview" each time. Shouldn't be a big problem IMHO. There is still that thing with Color pickers: if you focus on a numeric input field, located near the bottom of a viewport, then a picker panel can appear (in most part) below the bottom of the window. Then choosing a color by arrow keys etc can happen in the invisible part.
Yes, generally, OK. |
Sorry, I couldn't find the time to look at those changes yet. I will have time at the end of next week at the latest. |
if (!$styling_plugin.hasClass('ispopup')) { | ||
var $hl = $styling_plugin.find('h1').first(); | ||
var $btn = jQuery('<button class="btn">' + LANG.plugins.styling.popup + '</button>'); | ||
$hl.append($btn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the button part of the h1?
I think it would make more sense after the intro paragraph (or before the form as that is easier to hook into).
* improved spacing of popup * made primary buttons clearer * xhtml and validity fixes * improved some lang strings * moved 'open as popup' after intro * fixed page reload after clicking 'open as popup' button
I have fixed a few minor things. I have tested this but not extensively. From my point of view this is good to go. 👍 Re: cookie and preview. I would prefer to have the cookie back and be able to browse the wiki with a persistent preview style. But that is not a must-have and can be done in a separate PR. |
The icon does not match the others because the NuvolaX icon theme seems to have vanished from the Internet. Ideally all those admin icons could use a replacement. But that should be a different PR I guess.
I readded the cookie and moved the plugin to the bundled plugins. The icon sucks but is the best I could come up with right now. @selfthinker good to merge? |
Further testing... I just opened my test wiki in IE 11, am not logged in and can see the changes plus the preview message with every reload. I can even see those when the other browser has closed the admin section and the styling popup. Testing the plugin itself in IE 11 shows that the popup is not working at all (no CSS is loading and when you navigate to a different page and "preview changes" the CSS is gone again). But there are JS errors:
That is Quickly tested in IE 8, that seems to have very similar issues. From playing around in Chrome and Firefox, I only found that the caching should be improved. When one browser saves the settings (or reverts to template's default), the other only sees them after a hard refresh. |
IE doesn't like it when you create a DOM element in one window and try to insert it in another window.
Okay IE problem should be fixed. I also added the style.ini to the things that makes the browser recheck for fresh css. |
This is still not working for me in IE11. When I open the popup, the page in the background doesn't load the CSS and is only showing the "Preview is loading" message which doesn't go away. But I don't get an error message this time. And master needs to be merged into this branch. |
Merged master into this and fixed the merge conflict. |
hopefully doesn't break in the other browsers
The inspection completed: 1 new issues, 18 updated code elements |
Tested in IE11, 10, 9 and 8 and all working fine now. :) |
Template Style Dialog Plugin
This plugin allows administrators to adjust the style.ini settings. Works fine for me but should be tested by others for usability.