Comments (10)
Status update:
entryproperties
is done- I can't test
karma
properly in my test installation. The part that I can test is done, but the backend doesn't display any entries, so this needs more work. - Almost done with
statistics
, but it should get equal heights. I'm not sure how to reference the JS plugin properly here – need to discuss this with @onli at some point.
from serendipity.
Alright. Quite a lot of commits!
from serendipity.
Yup. I have an “off day”, e.g. spare time.
The more I think about it, the more I think we should get rid of the need to reference JS plugins in template files altogether and have some kind of centralized, JS-based loading mechanism for them. Sort of lazy-load them in serendipity_editor.js.tpl
or something.
from serendipity.
Sounds good. Though with the current setup, it's quite easy to have those files available in other templates. I don't have a straight plan on how to build such a centralized system, do you have a specific implementation in mind?
from serendipity.
I see two “issues” with including them in templates:
- I’m not 100% sure about it, but I think even if you reference JS plugins at the end of the
.tpl
file, they're not always going to end up before the</body>
element. I'd really like to avoid havingscript
elements all over the content area. - In serendipity_event_statistics' case, there is no
.tpl
file (which is fine by me, I have gotten used to working in the PHP code directly, I even think I simplified some of it – which isn't that hard given its age). But in that case, I'd have to reference e.g. syncHeight from 2k11's admin template directory to make it work, which means I'd have to hard code it into the plugin's.php
file. First of all, I don't think that's a good idea. Second, I wouldn't know how to do that properly. I mean, how do I even get the correct path to the.js
file from there?
I see two approaches for this:
- We could just include all the plugins in
serendipity_editor.js.tpl
. That's probably not too smart since it would become HUGE (probably even minified/gzipped), and the plugins are not needed in every part of the backend. Then again, it would be cached and we wouldn't have any cases of “Oh, the plugin isn't loaded here, we need to include it first”. - We could lazy-load the plugins with “poor man's AJAX”. This can even be combined with Modernizr's JS object to only load the plugins on specific screen resolutions. I used to have code for this in an older version of my HTML project boilerplate. However, I'm not sure about side effects here.
Open to comments or other suggestions, of course.
from serendipity.
I mean, how do I even get the correct path to the .js file from there?
Normally, that is not too complicated. We know exactly where it is located, so we can get the path from the template-functions, like it would be done in smarty. Like in https://github.com/s9y/Serendipity/blob/master/include/admin/plugins.inc.php#L558:
echo '<script src="' . serendipity_getTemplateFile('dragdrop.js') . '" type="text/javascript"></script>';
I'd really like to avoid having script elements all over the content area.
Alright, especially since the load-order is important. The lazy-load-option you linked doesn't seem too bad to me. But still: That would go into the serendipity_editor.js.tpl? This would make it even harder for another admin template to replace that file, if backend plugins rely on specific js-scripts being loaded there…
Another option is to use the new js-hook and emit the javascript there, but only if on the specific page. Or I could just convert it into a .tpl and we could solve it like in the normal backend, manually.
from serendipity.
I think this is something we should discuss later and more in detail. All “solutions” have their pros, cons and caveats. I like the idea of a new js hook. I really don't want to anyone else write/convert more .tpl
files, it's fine for this way.
I guess I'll just use the code you posted above (thanks) and we'll discuss the js hook or other solutions later. It's not something we would have to have in an alpha test.
from serendipity.
Fine with me (just as a note: the hook already exists in 2.0), let's discuss this later.
from serendipity.
Funny thing: I just tried the equal heights things – doesn't work at all (visually) here. :D
The things with equal heights is that it works pretty well if the height of all boxes is approximately equal anyway, but that's not the case here. Some of the statistics boxes can get pretty high while others only have little content.
But it's still good we discussed all this because I think we really need the JS hook in the long run.
from serendipity.
Forgot the reference in the commit: serendipity_event_karma solved in c1c71b3. Karma plugin not emitting anything in the backend was solved previously/something which needed to be explicitly turned on in the plugin's config.
from serendipity.
Related Issues (20)
- [serendipity_event_twitter] feature request: support fediverse HOT 1
- Translation
- Translation HOT 1
- Uncaught ArgumentCountError: 4 arguments are required, 2 given in [path]/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php:1070 HOT 3
- Much stronger defenses needed against aggressive persistent comment-spamming HOT 6
- Serendipity 2.4.0 version does not work on PHP 7.0 HOT 2
- Quicksearch vanishes HOT 4
- s9y current master: language constants already defined HOT 15
- PHP 8.1/8.2 warnings and errors HOT 2
- serendipity_event_multilingual: not compatible with PHP 8 HOT 9
- Javascript-Library broken? HOT 9
- New directory of sub-directory is not getting showed HOT 2
- Net_DNS2 from 2.4.0 is not compatible with PHP8 HOT 5
- fatal error for strftime with comments HOT 2
- SQL error (s9y 2.4.0, php8.2) HOT 5
- POPFetch Docs HOT 1
- Release for better support with PHP 8.x HOT 6
- Deprecation warnings from smarty HOT 9
- Warning about passing NULL to PDO->quote() HOT 4
- database error when p is set to invalid value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serendipity.