Can't fix parsing error for new dropdown menu - parsing

I got this error when I wanted to add another menu to my drop-down menu.
I am not sure why this error came up.
I added dropdown.avatar. because that what other menus also had. But it didn't work. What could I be missing here?
circle CI said it's a 33:41 error Parsing error: Unexpected token
31 | <Link route="/stats">
32 | <a>
> 33 | <Icon type="profile" /> {{t("dropdown.avatar.viewMoreStats")}}
| ^
34 | </a>
35 | </Link>
36 | </li>

Related

How to to add a menu separator for a menuitem in firefox's context menu

I am trying to add a menu separator before and after my menuitem in firefox's contextmenu .
This is my expected output...
| |
| |
|Select All |
|---------------------|
|Show Meaning |
|---------------------|
| |
My code...
<popup id="contentAreaContextMenu">
<menuseparator />
<menuitem id="diction-show-meaning" label="Show meaning" oncommand="" insertafter="context-selectall"/>
<menuseparator />
</popup>
However the menu separators are appearing at the END of the context menu!
How does one enclose a menuitem for contentAreaContextMenu?
I don't prefer to do it dynamically through java script. But let me know if that's the only way possible...
Try
<popup id="contentAreaContextMenu">
<menuitem id="diction-show-meaning" label="Show meaning" oncommand="" insertafter="context-sep-selectall"/>
<menuseparator />
</popup>

Responsive design with two pages in one on JQuery Mobile

I'm trying to create a mobile application with JQuery Mobile that is responsive design.
In other words, I want, in smartphone, that "page1.html" and "page2.html" are loaded in separed pages like that :
_________ __________
|Page1 | |Page2 |
|.html | on click |.html |
| | <--------- | |
| | |go to |
|go to | on click |page1 btn|
|page2 btn| ----------> | |
|_________| |_________|
And, in tablets, I want that page1.html and page2.html are loaded in the same page like that :
-----------------------------
|Page1.html | Page2.html |
| |
| |
| |
| |
| |
|----------------------------
How to do that with JQueryMobile ? I have try to $.mobile.loadpage(url) and $.mobile.changepage(url) but the problem is that the page is replaced and I need to have two pages in a single view for tablets.
Thanks per advance for your help.
Its simple enough, like #Omar said, first of all use a single page template like this with 'data-role=page' denoting each page.
<body>
<div data-role="page" data-theme="d" id="pageOne">
<---header---->
<--- content --->
<---footer---->
</div>
<div data-role="page" data-theme="d" id="pageTwo">
<---header---->
<--- content --->
<---footer---->
</div>
Now, Jquery mobile will automatically show 'pageOne' on first load and hide 'pageTwo' and on navigating to 'pagetwo' will hide 'pageOne'.
After this you can write a css media query similar to this:
#media all and (min-width: 450px) {
#pageOne{
display:block;
float: left;
width:50%;
postion:relative;
}
#pagetwo{
display:inline-block;
float:right;
width:50%;
padding-left: 2em;
postion:relative;
}
}
So if any with width greater than the mentioned width(450px) will have both the pages displayed side by side. Hope this helps. Here is a simple working sample I made.
http://jsfiddle.net/uwZpM/

Exception in commented line O_o

I have this:
<!-- <div class="fieldcontain ${hasErrors(bean: azafataInstance, field: 'localidad', 'error')} required" style="margin-left: 10px">-->
<!--<label for="localidad">Localidad</label> -->
<!--<g:if test="${params?.localidad }">-->
<!--<g:select id="localidad" title="${g.message(code: 'infoPersonal.localidad')}" name="localidad" value="${params?.localidad}" from="${[' ',params.localidad]}" noSelection="${['':message(code:'localidadSelect')]}" onClick="this.style.color='black'" onFocus="this.style.color='black'" style="max-width:168px" />-->
<!--</g:if>-->
<!--<g:else>-->
<!--<g:select id="localidad" title="${g.message(code: 'infoPersonal.localidad')}" name="localidad" value="${params?.localidad}" from="${['']}" noSelection="${['':message(code:'localidadSelect')]}" onClick="this.style.color='black'" onFocus="this.style.color='black'" style="max-width:168px" />-->
<!--</g:else>-->
<!--</div>-->
As you can see... lines are commented. I run the project and i got this:
URI
/com.publidirecta.azafatas/azafataCertificada/registro_page
Class
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException
Message
Tag [else] cannot have non-whitespace characters directly preceding it.
Around line 95 of grails-app/views/azafataCertificada/registro.gsp
92:<!--<g:if test="${params?.localidad }">-->
93:<!--<g:select id="localidad" title="${g.message(code: 'infoPersonal.localidad')}" name="localidad" value="${params?.localidad}" from="${[' ',params.localidad]}" noSelection="${['':message(code:'localidadSelect')]}" onClick="this.style.color='black'" onFocus="this.style.color='black'" style="max-width:168px" />-->
94: <!--</g:if>-->
95: <!--<g:else>-->
96: <!--<g:select id="localidad" title="${g.message(code: 'infoPersonal.localidad')}" name="localidad" value="${params?.localidad}" from="${['']}" noSelection="${['':message(code:'localidadSelect')]}" onClick="this.style.color='black'" onFocus="this.style.color='black'" style="max-width:168px" />-->
97:<!--</g:else>-->
98:<!--</div>-->
Trace
Line | Method
->> 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 908 | run in ''
^ 680 | run . . in java.lang.Thread
Caused by GrailsTagException: Tag [else] cannot have non-whitespace characters directly preceding it.
->> 95 | runTask in /grails-app/views/azafataCertificada/registro.gsp
The question is, obviously...
How is it possible, in a decent framework, can a commented line throw an exception!!!
Because <!-- isn't a comment in GSP.
As you have discovered, the GSP parser treats HTML-style comments as normal content, to make it possible to generate output that contains HTML comments such as within script tags
<script type="text/javascript><!--
js goes here;
//--></script>
or IE conditional comments
<!--[if IE 6]>
<script type="text/javascript" src="${resource(dir:'css', file:'ie6-fixup.js')}"></script>
<![endif]-->
The syntax for GSP comments is
<%-- this is commented out --%>
the GSP parser will ignore anything inside this sort of comment.

Magento layout update XML change impacting all pages

I'm trying to add a static block (which is actually a text link) after my site's home page only, by using the Layout update XML box on the CMS pages interface.
--------------
| |
| Content |
| |
---------------
| Footer |
| Copyright |
---------------
| My Block |
---------------
I've tried adding the block using this code:
<reference name="footer">
<block type="cms/block" name="credits" after="-">
<action method="setBlockId"><block_id>my_block</block_id></action>
</block>
</reference>
The problem is: #1 that my block shows between the Footer and Copyright and #2: the change is visible on all the pages, whereas I only want it to show on my home page and not in the rest of the site...
Note: I'm running a Magento 1.4.0.1
In order to display it only at your home page you have to add your XML under <cms_index_index>.
To adjust positioning use <?php echo $this->getChildHtml('credits') ?> inside of your page/html/footer.phtml.

I am writing a jquery mobile app, and I want to submit a form, and have a completely different page load after submission. how?

I have just started to work with jquery mobile, and things are going swimmingly, but I have hit a wall. I have a form that I am trying to submit (post), and upon form submission, I would like the phone to behave just as a browser would behave. I want it to actually go to the page that I specify.
Here is the scenerio
I'm on the intro page. this intro page has 2 different "jquery mobile pages" on it. By "jquery mobile pages", I am talking about 2 different
<div id="some_page" data-role="page">
The first of these two pages is a teaser page. It shows some of the information that the user wants to see, but not all. The url (the div id) to the first page is: bla.com/intro.php#first
The second of these 2 pages is a simple registration page. This registration page contains a form. The url (or div id) to the second page is: bla.com/intro.php#second The form looks similar to the following:
72 <form data-ajax="false" action="#" id="signup" method="post">
73 <input type="hidden" name="leadID" id="leadID" value="<?=$_GET['id']?>" />
74 <input type="hidden" name="action" id="action" value="validate" />
75 <input type="hidden" name="blaID" id="blaID" value="<?=$propertyID?>" / >
77 <ul id="regList" style="margin: 15px 2px 17px;">
78 <li>
79 <input type="text" placeholder="First Name*" id="firstName"
80 </li>
81 </ul>
82 </form>
The form does submit, and it is a post submission, and the post data is present. I know this because I am using the chrome dev tools to inspect the post submission.
Here is the jquery mobile code that I am using to validate, and (attempt to) forward the page upon validation:
10 $('.submit').click(function(e){
11
12 var isValid;
13 isValid = validateSignupFields($(this).attr('entry'));
14
15 if( isValid === true )
16 {
17 //$('#signup').submit();
18 $.mobile.changePage(
19 {
20 url: "fullInformation.php",
21 changeHash: true,
22 reloadPage: true,
23 type: "post",
24 data: $("signup").serialize()
25 });
26 }
27
28 }); // end signupBtn click
As I said earlier, the page does submit, and the next page does load, but the url does not change. The animation occurs, and the address bar still says bla.com#second. Further, the fullInformation.php page is all jumbled up, and there is no styling. I am wondering how I can submit the page, and have it act like the browser and just go to the following url instead of staying on the same url. Thanks!
You are missing the required to argument (the first argument):
$.mobile.changePage( "fullInformation.php", {
type: "post",
data: $("signup").serialize()
});
Also, replace url with dataUrl
see docs

Resources