First try on DoneJS - Chat Demo not working - donejs

I'm beggining to try DoneJS, starting with de Chat Demo. After copying the instructions, "home" page shows correctly, but the "Start Chat" button is not working. After some digging, i found this messages on Console: can-log.js:98 16: Unable to find helper "routeUrl".
When I oppend the source-page, the <a> tag that should link to the other page is like "<a class="btn btn-primary btn-block btn-lg" href>Start chat</a>, without the href clause completed.
Probably I have missed something when I copied. Coincidentally, on VSCode, exactly the import route from 'can-route' on app.js is showing a ... symbol and saying that it was not possible to find some declaration module for can-route.
Here is my declaration:
Start chat

Sorry about that, my mistake. I missed <can-import from="can-stache-route-helpers" /> command. Now it is ok.

Related

How to close sign post content using directive *clrIfOpen

I am using clarity signpost, I am using this signpost for showing multiple applications, how to close this sign post when i am click on the application.
For example I am adding three buttons in this sign post, if I click on the button this need to be close. Please check my stackblitz
To keep track of whether the signpost is open or not, and then be able to dynamically close it, you should use the de-sugarized syntax of clrIfOpen to utilize two-way binding:
<ng-template [(clrIfOpen)]="signPost">
<clr-signpost-content>
<button class="btn btn-outline" (click)="close()">Hr</button>
...
</clr-signpost-content>
</ng-template>
Here is your example with this change, working fine: https://stackblitz.com/edit/signpost-dynamic-close?file=src/app/app.component.html

Angular ui-select needs clicking twice to enter the input

Am fairly new to angular and I have an ui-select which fetches the data from remote service upon typing anything shows the related items in dropdown. It is a single select dropdown.
The problem is the input field requires two clicks to open. On first click the field gets focused and upon second click the cursor is present for typing.
Not able to get what is causing the issue.
<ui-select ng-model="page.model.form.relatedItem"  theme="bootstrap">
<ui-select-match placeholder="Search ...">
<span ng-if="$select.selected.name" nbind="$select.selected.name"></span>
<span ng-if="!$select.selected.name" ng-bind="page.model.form.relatedItem.name"></span>
</ui-select-match>
<ui-select-choices refresh="page.getRelatedItemList($select.search)" refresh-delay="0" group-by="'group'"  repeat="item in page.itemArray | filter: $select.search">
<span ng-bind-html="item.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
Thanks for any help.
This is a known issue with the ui-select library for angularJs.
The problem is related to ngAnimate and the ui-select component. If ngAnimate is removed from the app, the problem will disappear. There are also a couple of workarounds if removing ngAnimate is not an option for you.
One workaround is to add a prevent-animations directive to the ui-select elements. Simplified code example follows:
<ui-select prevent-animations>
<ui-select-match prevent-animations>{{$item.title}}</ui-select-match>
<ui-select-choices prevent-animations>
...
</ui-select-choices>
Another suggested workaround in is to use a delay to add focus to the search field after component activation. Although the github issue referenced has been marked as closed, there are other open issues citing the same problem, and unfortunately this project is is now marked as archived, so don't wait for any fixes to appear there!

How to press a button on asp.net web site using python+mechanize

There is a web site I need to scrape. I can fill in the necessary data. The problem is that I don't understand how to press the button to get the page with results.
The button has the following code:
<input type="button" value="Search!" onclick="SearchSmth();" id="btSearch">
So because the type is not 'submit' attempts to use Browser.submit() fail. I tried using something like this:
resp = b.click(type="button", id="btSearch")
but it also failed:
ClientForm.ControlNotFoundError: no control matching type 'button', kind 'clickable', id 'btSearch'
What should I do to get this button pressed?
Have you used zope.testbrowser? This is wrapper over mechanize module of python. You can use getControl browser.getControl(name='text-value') method of zope.testbrowser. You can see more examples here

Selenuim webdriver trying to automate a click linkbutton?

I am using Selennium Webdriver to automate a click of a PDF download button. I used various ways to click the button, but it seems to throw a Jscript error:
Message: Unexpected call to method or property access.
Line: 17
Char: 29094
Code: 0
URI: http://uat.mysite.com/Scripts/jquery-1.6.2.min.js
My click code (tried these both):
driver.findElement(By.xpath("//div/a[contains(text(), 'Download PDF')]")).click();
or
driver.findElement(By.xpath("//div[#class='paginationWrap']/a[#class='redBlock']")).click();
The html:
<div class='articleFoot'>
<div class='paginationWrap'>
<a class='redBlock' target="_blank" href='/DownloadMedia.aspx?media={625B459D-C085-48C5-931C-71BE03786236}'>
Download PDF
<span class='icon pdf'></span>
</a>
</div>
</div>
Both of these xpath expressions are ok.
If the exception is really not from the jquery script (is it not?), then it's most likely that Selenium can't really download files. Yet.
Still, besides the HtmlUnitDriver (whose behaviour I don't know), the browser should offer you a download dialog. Try another Driver, then look for errors elsewhere.
You can do some tricks to achieve a file download alternatively, my personal favourite is this downloader, but there are a few more ways like getting and setting up Download Statusbar into Firefox, some Robot moves and so on. But do you really need to?
This might help you:
WebElement state = driver.findElement(By.xpath("//div/a[contains(text(), 'Download PDF')]"));
Actions builder1 = new Actions(driver);
builder1.moveToElement(state).click().perform();

"Send" popout showing, "Like" isn't

I've installed a Like button on my blog, as well as the Facebook send button.
When I click "Send", the popout comes out and appears nicely with a prompt on who to send the post to.
But, when you click "Like", no popout comes. It's not the "overflow:visible" problem, because the Send popout works. Very confusing and odd, I think...
This is the code I'm using:
<div style="overflow:visible;" class="fb-like" data-href="http://liamgetreu.com" data-send="true" data-width="450" data-show-faces="true" data-font="lucida grande"></div>
Any ideas? Thanks.
I checked out your blog and it looks like there is an iframe being generated for the pop-out, but that pop-out is not being filled in by Facebook. There is a javascript error that is the probably cause of the issue.
uncaught exception: Error: Permission denied for <http://www.facebook.com>
to get property Proxy.InstallTrigger
https://plus.google.com/_/apps-static/_/js/widget/gcm_ppb,
googleapis_client,plusone/rt=j/ver=VRKLmt4S1dg.en_US./sv=1
/am=!itqi7GDL5S6I4GqN1g/d=1/ Line 116
To find out what javascript is colliding with that Facebook one to cause the error. I would suggest striping everything off that page one thing at a time until the Facebook script can run without error. This will tell you what item (or combination of items) was interfering.
Happy troubleshooting! Let us know what you find.

Resources