User tests: Successful: Unsuccessful:
Pull Request for Issue # .
HTML 5 allows for data-* attribute to be assigned to html form elements. Even ASP.NET MVC core form elements allows for the definition of data-* attributes.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Can you a bit more specific what the purpose of this change would be? And how it could be tested?
@Bakual
Sometimes could be useful pass the object from html element to the javascript code
$array = ['id' => 12345, 'title' => 'Some title', 'someMore' => '...'];
<input type="..." data-some-object="<?php echo htmlspecialchars(json_encode($array), ENT_QUOTES, 'UTF-8'); ?>" />
var data = $('#element-id').data('some-object');
console.log(data.someMore);
This change looks like you would specify that object data in the form XML file. I don't see yet the global need for that. I think it's simpler to just extend the formfield and add your specific requirements into it.
Having a preg_match running on each list element attribute when it's used only in a few very specific cases looks wrong to me.
I think this better do in the field layout override, if you need it .. in J 3.5 it should be even more easy
Category | ⇒ | Libraries |
@dbclkclk please can you fix the code style errors
FOUND 17 ERROR(S) AFFECTING 9 LINE(S)
47 | ERROR | Functions and classes must not contain multiple empty lines in a
| | row; found 2 empty lines
49 | ERROR | Tabs must be used to indent lines; spaces are not allowed
50 | ERROR | Tabs must be used to indent lines; spaces are not allowed
51 | ERROR | Tabs must be used to indent lines; spaces are not allowed
51 | ERROR | Expected "if (...)\n...{...}\n...else\n"; found
| | "if(...)\n...{...}\n...else\n"
52 | ERROR | Tabs must be used to indent lines; spaces are not allowed
53 | ERROR | Tabs must be used to indent lines; spaces are not allowed
53 | ERROR | Concat operator must be followed by one space
53 | ERROR | Concat operator must be preceeded by one space
53 | ERROR | Concat operator must be followed by one space
53 | ERROR | Concat operator must be preceeded by one space
53 | ERROR | Concat operator must be followed by one space
53 | ERROR | Concat operator must be preceeded by one space
54 | ERROR | Tabs must be used to indent lines; spaces are not allowed
55 | ERROR | Tabs must be used to indent lines; spaces are not allowed
55 | ERROR | Closing brace indented incorrectly; expected 3 spaces, found 16
56 | ERROR | Functions and classes must not contain multiple empty lines in a
| | row; found 2 empty lines
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9463.
Status | Pending | ⇒ | Information Required |
This PR will be closed in a few weeks if the code style issues are not resoled
This is nice to have, there are many uses of data-* attributes
if (preg_match('(data-[a-zA-Z\-]+)', $a))
why would not trust the developer has created a proper names in the XML file ?
1 . So i think better just use:
if (preg_match('(data-)', $a))
2 . Also this is 2x faster
if ( strpos($a, 'data-') === 0 )
Example for 500,000 calls aka 500,000 list fields (<select>)
0,15ms versus 0,30ms on same processor
I am closing this at this time as it cannot be merged in its current state and there has been no response to the request to update the code. It can always b reopened if that is done.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-06-07 09:56:50 |
Closed_By | ⇒ | brianteeman |
Note that this allows for integration with KnockoutJS, Angularjs, etc.