Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

AJAX improvements #11

Merged
merged 1 commit into from May 26, 2011
Merged

AJAX improvements #11

merged 1 commit into from May 26, 2011

Conversation

realityking
Copy link
Contributor

Small library modification to make it easier to use AJAX or other JS functionality with the Joomla framework.

…age-container"></div>. This makes it possible to render messages via JavaScript.

Added Joomla.renderMessages() to core.js. This functions enabled rendering messages via JavaScript.
LouisLandry added a commit that referenced this pull request May 26, 2011
@LouisLandry LouisLandry merged commit 166b1ce into joomla:master May 26, 2011
LouisLandry added a commit that referenced this pull request Jul 23, 2011
@piotr-cz
Copy link
Contributor

There's a problem when rendering messages in language other than English using Joomla.renderMessage().

The DT element classname and content is being set to message type (ie. 'warning'). While it's fine for the class, message header is then forced to be a lowercase English text.

On the orher hand when message type is supplied in document language just like message body, then it won't match relevant class defined in system.css, this is not a solution.

One way how to go around it is to switch DT content from type to Joomla.JText.(type, type)_. Developer will have to add appriopriate JText strings in JS.

An other would be to change the parameters for renderMessage function, so it would be called

Joomla.renderMessages({
    'error': ['Błąd', ['Nieznany błąd']]
});

instead of

Joomla.renderMessages({
    'error'     ['Nieznany błąd']
});

@realityking
Copy link
Contributor Author

I just checked again and I'm pretty sure my JS implementation matches the PHP implementation in JDocumentRendererMessage. (which was the set goal)

@piotr-cz
Copy link
Contributor

realityking:
there's one difference I'm talking about:
libraries/joomla/document/html/renderer/message.php @l 58 should match media/system/js/core-uncompressed.js @l 100 so in in core-uncompressed.js (function Joomla.renderMessages)

html: type

should be

html: Joomla.JText.(type, type)_

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants