Các bài đăng được tạo bởi Urs Hunkler

Hình của Core developers

Fred, I thought to use a filter when the renderer change in the theme is not convenient. But with Tim's proposal it is quite convenient to use centrally handled renderer overrides with several themes. 

In Moodle the media_renderers are implemented not as filters so it looks more straightforward to me to just clone the code of an existing media renderer, put it in a new class and adopt it to the special needs.

Hình của Core developers

I had big issues to get the classes in "local/sharedrenderers" registered.

Following the description in the docs closely and several times the classes did not register.

http://docs.moodle.org/dev/Automatic_class_loading#Performance_and_developer_mode

Finally I ran "admin/cron.php" in addition to the other steps and the classes got registered properly. 

"dbsessions" was in the default state = off. I also tried to turn "dbsessions" on - and the steps in the docs worked. I guess. 

After trying to register the new classes a lot in different ways in the beginning without success after the first cron run all steps worked as expected. 

Hmm. Has somebody experienced similar issues? Does the docu need to be extended to inform about the influence the session handling setting has?



Hình của Core developers

Following the docu I created a new media_renderer class - It's an autoloading class in a folder in "local".  And I have overridden the core_media_renderer in the theme to add the media renderer in the get_players_raw() method as described in the docu.

http://docs.moodle.org/dev/Media_embedding#Changing_media_embedding_behaviour

The implementation works as expected.


I would prefer to add the media renderer without the need to change the theme renderer.php. Is there another way to generally add new media renderers?

Trung bình điểm đánh giá: -
Hình của Core developers

Two main aspects with images and the variable browser-window/screen width are the file size and the size the image is shown. The file size must fit the displayed size as close as possible. If there is only one files size and the image is scaled in the browser users need to download certain amounts of unnecessary KB/MB.

To be more variable with the terminology I would propose image size presets like

  • small
  • medium
  • large
  • xlarge/original size (optional)

 

How might that work?

  • The image sizes should be generated by default on the server when the user adds an image with the editor. The image should be set "responsive" by default with Moodle CSS.
  • The user may get the option to add a class "fixed-size" in the editor to stop the image form scaling. (opt-out)
  • Users should have an option to create and upload the 3/4 image sizes themselves because several images need to be not only scaled but also cropped to the most important image area to be able to work in different sizes. Several images get meaningless when they become too small.

 

Picturefill "A Responsive Images approach that you can use today that mimics the proposed picture element using span's, for safety sake." works pretty well and the author is actively working on version 2 "A Polyfill for the HTML Picture Element that you can use today." https://github.com/scottjehl/picturefill

So the functionality only needs to be implemented, everything is there nháy mắt

Trung bình điểm đánh giá:Useful (1)