ARIA role='checkbox' reads 'selected' instead of 'checked' - wai-aria

Here's my DOM
<ul class="fsm-checkbox-list fsm-things-you-love-to-do" role="group">
<li class="fsm-checkbox" role="checkbox" name="LOVE_TRAVEL" aria-checked="false">
<span tabindex="4">Travel</span>
</li>
<li class="fsm-checkbox" role="checkbox" name="LOVE_SPORTS" aria-checked="false">
<span tabindex="4">Play/watch sports</span>
</li>
<li class="fsm-checkbox" role="checkbox" name="LOVE_SHOP" aria-checked="false">
<span tabindex="4">Shop</span>
</li>
<li class="fsm-checkbox" role="checkbox" name="LOVE_DANCE" aria-checked="false">
<span tabindex="4">Read</span>
</li>
</ul>
'li' have a role of checkbox. onClick, aria-checked attribute is toggled between true and false. However sometimes when i click, Voiceover on IPAD reads 'selected' instead of 'checked' or 'unchecked'. Could someone please explain why this behaviour occurs and how can i solve this.

Related

How to extract the value of an neighbour attribute node via XPath?

I have two different web pages and I want to extract some value using XPath.
What request can extract 2386028 from the first page and at the same time can extract 4019606 from the second page? I need one request that can universally extract that values.
First page fragment:
<ul class="g-ul b-properties">
<li class="b-properties__header">General</li>
<li class="b-properties__item">
<span class="b-properties__label">
<span>VendorCode</span>
</span>
<span class="b-properties__value">2386028</span>
</li>
<li class="b-properties__item">...</li>
<li class="b-properties__item">...</li>
<li class="b-properties__item">...</li>
and second page fragment:
<div class="b-properties-holder" id="tab_3">
<ul class="g-ul b-properties">
<li class="b-properties__header">General</li>
<li class="b-properties__item">
<span class="b-properties__label">
<span>Trademark</span>
</span>
<span class="b-properties__value">
<a class="link b-properties-link" href="/trademark/moist-diane/?sort=-date&currency=USD">Moist Diane</a>
</span>
</li>
<li class="b-properties__item">
<span class="b-properties__label">
<span>VendorCode</span>
</span>
<span class="b-properties__value">4019606</span>
</li>
<li class="b-properties__item">...</li>
<li class="b-properties__item">...</li>
You can select the <li> element, which has <span class="b-properties__label">element that contains <span> with value VendorCode, and then get value of <span class="b-properties__value"> under that <li> element.
For example:
//li[span[#class="b-properties__label"]/span="VendorCode"]/span[#class="b-properties__value"]/text()
Alternatively, you can select the <span class="b-properties__label">element , which has <span> with value VendorCode, and get its following sibling.
//span[#class="b-properties__label" and span="VendorCode"]/following-sibling::span/text()

Laravel HREF techniques for multiple pages

<!-- BEGIN HEADER MENU -->
<div class="nav-collapse collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li class="dropdown dropdown-fw dropdown-fw-disabled active open selected">
<i class="icon-home"></i> Home
<ul class="dropdown-menu dropdown-menu-fw">
<li>
<i class="icon-bar-chart"></i> View Photo
</li>
<li class="active">
<i class="icon-bulb"></i> About
</li>
<li>
<i class="icon-graph"></i> Contact
</li>
</ul>
</li>
<li class="dropdown dropdown-fw dropdown-fw-disabled">
<i class="icon-home"></i> Upload
<ul class="dropdown-menu dropdown-menu-fw">
<li>
<i class="icon-bar-chart"></i> Upload Photo
</li>
<li>
<i class="icon-bulb"></i> View Photo List
</li>
</ul>
</li>
</ul>
</div>
I am still new to this but basically, I have 5 pages (View Photo, About, Contact, Upload Photo, View Photo List). Currently, I want to show this HTML in all 5 pages so that it will be standardized. If I change the "picture/about" in one page to "photograph/about" for example, the 5 pages will need to reflect this change. This gets more complex as the number of pages increases.
Is there any way or technique in Laravel to solve this issue? Thanks.
Create a template file like Laravel provides app.blade.php in resources/template/ directory, use extends, sections etc for designing, please read Laravel Documentation for Templates
You can use partials for this.
If your issue is adding the active class to the correct link then you can just use request()->is() to check the current url:
<li class="{{ request()->is('picture/externalphotoviewer') ? 'active' : '' }}">
<a href="{{ url('picture/externalphotoviewer') }}">
<i class="icon-bar-chart"></i> View Photo </a>
</li>
<li class="{{ request()->is('picture/about') ? 'active' : '' }}">
<a href="{{ url('picture/about') }}">
<i class="icon-bulb"></i> About </a>
</li>
<li class="{{ request()->is('picture/contact') ? 'active' : '' }}">
<a href="{{ url('picture/contact') }}">
<i class="icon-graph"></i> Contact </a>
</li>
Simply create a blade file inside your resources/views directory and then use #include e.g.
reasources/views/partials/header.blade.php:
<div class="nav-collapse collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li class="dropdown dropdown-fw dropdown-fw-disabled active open selected">
<a href="javascript:;" class="text-uppercase">
<i class="icon-home"></i> Home </a>
<ul class="dropdown-menu dropdown-menu-fw">
<li class="{{ request()->is('picture/externalphotoviewer') ? 'active' : '' }}">
<a href="{{ url('picture/externalphotoviewer') }}">
<i class="icon-bar-chart"></i> View Photo </a>
</li>
<li class="{{ request()->is('picture/about') ? 'active' : '' }}">
<a href="{{ url('picture/about') }}">
<i class="icon-bulb"></i> About </a>
</li>
<li class="{{ request()->is('picture/contact') ? 'active' : '' }}">
<a href="{{ url('picture/contact') }}">
<i class="icon-graph"></i> Contact </a>
</li>
</ul>
</li>
<li class="dropdown dropdown-fw dropdown-fw-disabled">
<a href="javascript:;" class="text-uppercase">
<i class="icon-home"></i> Upload </a>
<ul class="dropdown-menu dropdown-menu-fw">
<li>
<a href="{{ url('photo/create') }}">
<i class="icon-bar-chart"></i> Upload Photo </a>
</li>
<li>
<a href="{{ url('photo') }}">
<i class="icon-bulb"></i> View Photo List </a>
</li>
</ul>
</li>
</ul>
</div>
Then replace the header code in your other blade files with:
#include('partials.header')
NB
If you change the location of the header you will need to update the #include's as well e.g.
e.g. resources/views/layouts/main/header.blade.php would be #include('layouts.main.header')
Hope this helps!

How to pass a variable without Controller in Laravel 5.4?

I have a application with extends a view with name "notification". How you can see in the picture.
That fragment is just a list, don't extends anything, How I pass a variable to that list? Something fixed. Any suggestion?
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="livicon" data-name="bell" data-loop="true" data-color="#e9573f"
data-hovercolor="#e9573f" data-size="28"></i>
<span class="label label-warning">7</span>
</a>
<ul class=" notifications dropdown-menu drop_notify">
<li class="dropdown-title">Você tem novas notificações</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
#foreach($notificacao as $value)
<li>
<i class="livicon default" data-n="asterisk" data-s="20" data-c="white"
data-hc="white"></i>
Você tem novas perguntas
<small class="pull-right">
<span class="livicon paddingright_10" data-n="timer" data-s="10"></span>
{{$value->created_at->diffForHumans()}}
</small>
</li>
#endforeach
</ul>
</li>
<li class="footer">
View all
</li>
</ul>
</li>

Top-bar Drowndown Links Not Working

I have the top-bar nav all setup and the dropdowns are displaying as expected. However, when I click on a dropdown link, the dropdown just disappears. The page does not advance to the URI as expected.
I'm stumped...
<section class="top-bar-section second-row">
<ul>
<li class="active"><i class="fa fa-exclamation-triangle"></i><span> Alert Central</span></li>
<li class="has-dropdown">
<i class="fa fa-bar-chart"></i><span> Analytics</span>
<ul class="dropdown">
<li>System Status</li>
<li>My Use</li>
<li>My User's Use</li>
<li>Account Information</li>
</ul>
</li>
<li class="has-dropdown">
<i class="fa fa-magic"></i><span> Filter Management</span>
<ul class="dropdown">
<li>Keywords</li>
<li>Categories</li>
<li>Locations</li>
</ul>
</li>
<li class="has-dropdown">
<i class="fa fa-users"></i><span> User Management</span>
<ul class="dropdown">
<li>Users</li>
<li>Roles</li>
</ul>
</li>
</ul>
</section>
Did you try to add data-topbar in <section> tag ?
<section data-topbar class="top-bar-section second-row">

Laravel 4 base/master view

I've recently gotten some problems. There is an model from which I pull some data and things. There is a menu link that I want to be on every page I enter, so I've put it into the base/master view. But the problem is, I need to enter ->with blabla thing on every public function in every controller. How could I not do that? I mean is there anyway around it? I don't want to do that with thingy on every controller method/function. Here's my code:
#if ( Auth::guest() )
<li style="float: right;padding-right: 0">
<ul class="nav">
<li>
<a href="{{ URL::to('register') }}">
<i class="icon-black icon-plus">
</i>
<strong>
Register
</strong>
</a>
</li>
<li>
<a href="{{ URL::to('login') }}">
<i class="icon-black icon-lock">
</i>
<strong>
Log in
</strong>
</a>
</li>
</li>
</li>
</ul>
#else
<li class="divider-vertical">
</li>
<li style="float: right;padding-right: 0">
<div class="btn-group">
<div class="btn btn-primary">
<i class="icon-user">
</i>
{{ (Auth::user()->name) }}
</div>
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
<span class="icon-caret-down">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a href="{{ URL::to('account/managment') }}">
<i class="icon-user">
</i>
Account Managment
</a>
</li>
<li>
<a href="{{ URL::to('account/managment/change_credentials') }}">
<i class="icon-lock">
</i>
Change Password
</a>
</li>
<li class="divider">
</li>
<li>
<a href="{{ URL::to('account/logout') }}">
<i class="icon-off">
</i>
Log out
</a>
</li>
</ul>
</div>
#endif
You can define a View Composer :
View::composer(array('your.first.view','your.second.view'), function($view)
{
$view->with('count', User::count());
});
Everytime you call your view, a user count will be bound to it automatically.
Edit:
About where to use it, it's up to you and it depends on your app, but you might use pp/start/global.php if you don't have a better place to put it. It just have to be executed before your those views.
#Antonio's answer is a good way to do this. You can also use View::share(); to accomplish this with a shorter code.
View::share(array(
'foo' => 'bar'
));

Resources