cufon fonts do not work on all my pages - ruby-on-rails-4

I have a problem with my page: on start page cufon-yui is loaded fine, but when I go to another page, it doesn't load. But when I refresh, it looks fine. I use turbolinks.

Turbolinks works by replacing the page content instead of navigating to a new page. If you're calling cufon-yui on document.ready, then it will NOT be called when you navigate to a new page. Your code should then look like:
$(document).on 'ready page:load', function(event)
{
Cufon.replace("whatever you're replacing");
// And whatever other Cufon code you're using is.
}
This way, it'll be called both when the document is ready, as well as when page:load is called by Turbolinks upon the completion of the page loading process.

Related

CEFsharp load url is holding on to the previously navigated url

We have a C++ application (using Owl UI framework) which calls a CEFsharp Chromiumbrowser control inside an owl dialog. It is working perfectly the first time and the chromium embedded control shows the page properly. It is important to mention here that the first url which is say "http//www.someurl" navigates internally to "http://www.anotherurl/opensomething" each time. When we close the Owl MDI window and then try to open it again, the CEFSharp browser control tries to go straight to "http://www.anotherurl/opensomething" instead of going to "http//www.someurl" which it is being specifically asked to navigate to. We are using Chromiumbrowser load method to load the url but just cannot make it to load the first url from the second time onward. Our CEFsharp version is 63.03 . However if we open the chromium browser control in its own window and not embed it inside the MDI dialog it works perfectly everytime. Can't figure out so far as to why this is not loading the url properly from the second time around. Thanks for any help in advance.

Any probable cause why my slider is being covered from other blocks (content,sidebar) even it's working behind them?

I recently add HiSlider im my website.
I am using it at the front page an on 95% page loads the slider is being covered by the blocks of the page (which are supposed to be below,after, the slider).Sometimes on page load everything is working correctly.(I have the slider in an other page too link to a menu.By clicking the menu the slider in this page is working)
Any ideas?
have a look at the CSS z-index property.
#your-hi-slider-id{
z-index: 99;
}
Edit: I see this is not the problem you're having,
Because the page sometimes works, I believe the javascript may be excecuted before the page is ready
function init(){
//initialize your slider here
}
<body onload="init()">

Access content property in the debugger

how can i access the content property of a controller within the chrome debugger.
I really try to find a way to debug my application. So far i can't find a way to do that.
Thank you
Alex
add the statement
debugger;
in the method you want to debug,
Open Google Chrome, CTRL+SHIFT+i
Hit the URL of your application, navigate to the state where you think the code would run
Google Chrome automatically stops at the debugger; statement and focuses you to the sources/scripts tab as you can see in the picture
Inside the Watch expression tab click on the "+" too evaluate code in your case it would be
this.get("content");
As long as you have this breakpoint you can switch to the console panel and execute the code in that context, whenever you are done you can either close the panel by clicking CTRL+SHIFT+I or the close button down there, you can add breakpoints manually by clicking on the line number as well , Hope this helps
For more info
I'm using Ember Extentions which is not ready yet but certainly usable.
There are 2 possibilities
Use the Ember Inspector Tool for Chrome: It is not officially released yet, but from what i have heard it seems usable. I had no time to try it myself yet, but here is an article telling you how to install and use it.
Get access to your controller in the console of your browser. And then examine it as you like. Here is the code to get access to your controller.I use it myself in my app for debugging:
// i assume that your Ember.Application is stored in the global var App
var App = Ember.Application.create({
getController : function(name){
return this.__container__.lookup("controller:" + name);
}
});
// now you can use it like this. To get the users controller (App.UsersController) just use this in the console:
App.getController("users")

"Like button" don't work for application page

I want to create like button inside application for its profile page.
Button renders, but gives error when clicked:
The page at
http://www.facebook.com/apps/application.php?id=151273804972407 could
not be reached.
Strange, because this page exists. The same situation is, when I'm using this link in plugin's code generator ( https://developers.facebook.com/docs/reference/plugins/like/ )
It seems to work with other applications (other application id).
Please advice!
The only solution I found was to create new application. For the new one - with exactly the same settings - "like button" works fine. Strange, isn't it?

Is there a way to make WatiN click a link before the page finishes loading

We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?
Here's the code we found to work:
IE browser = new IE(....);
browser.Button("SlowPageLoadingButton").ClickNoWait();
Link continueLink = browser.Link(Find.ByText("linktext"));
continueLink.WaitUntilExists();
continueLink.Click();
You should be able to leave out the call to WaitUntilExists() since WatiN does this internally when you call a method or property on an element (like the link.Click() in you rexample).
HTH,
Jeroen van Menen
Lead dev WatiN