How to Disable `back` and `forward` button of the browser window - ember.js

In my applicaiton, I requried couple of things to be added.
No forward/Back Browser button should work for reach a hash.
Instead of brower back forward, there should be a back and forward button has to added in the applicaiton itself.
how to achive this both?
I am looking for a component to use globally for both 2 requriements.
Thanks in advance.

Disabling the native back/forward buttons of the browser in Ember.js is quite unusual but could possibly be achieved by using the NoneLocation class. To enable that open the config/environment.js file of your app and change the locationType property to none.
If you want to display back/forward buttons in your app you can use the History API and specifically window.history.back() and window.history.forward()

Related

How to create generic popup for across the app?

I am trying to create a popup which is available and controlled by across application.
so I keep the html assets in app template. and the I would like to show and hide the popup any page from the app.
I understand that, It can achivable by service. but I don't have much idea to implement this. any one suggest me the right way?
Required is : show popup from any page, close pupup on click of close button in the popup.
here is my Twiddle
In case of angular it can be achieved from factory object.
I would probably do this:
create a component for the popup
create a service for the popup that that exposes methods for setting a property called "isOpen" to true/false. Other parts of the app can use the methods for opening and closing the popup.
Inject the popup service into the application controller
Add it to the application template in an {{if popupService.isOpen}} block
Good luck, remember to write lots of tests, make sure each part is working before you go to the next step, and remember to consult the guides often ;-)

¿How to use routes inside a Modal in Emberjs?

sorry for my English. I will try to explain better I can.
I have an application in EmberJS, this application have its routes. Also, when I click in a button, I should show a Modal Window and change the route. That problem was resolved. The problem is. This modal window must to be a kindly of wizard, so when the user click on next, I should to change the route and show inside the modal the correct content, when the user click in next again, the route must to change again but the new content should be showed into the modal too.
The problem seems to be, ember takes my application outlet and show the new content inside that outlet, not inside of the outlet defined into the modal.
How I achieve this?

Sitecore menu items not working - javascript errors

So I'm just starting to work in sitecore and for some reason none of menu options are working in Page Editor mode for the site that I'm working on. We pretty much have the sitecore website and add some extra page content (MVC app files) to it. I'm getting a variety of javascript errors.
In content Editor, if I click the Sitecore logo and click on Properties I get
TypeError: contentIframe.dialog is not a function
In page editor if I click on the blue components button I get:
TypeError: i.widget is not a function
I'm guessing maybe it's a conflict between jquery that we're using for this website and whatever Sitecore is using. I think it's 7 - but I can't see it via the menu option :)
That guess could be wrong - it could in fact be a browser issue, but I've ensured Firefox is not blocking popups. It doesn't work in Firefox, IE or Chrome though.
The weird thing is that no one else on the project is having this issue it's only on my computer.
Edit - I've also just tried re-installing (7.2) without any local code changes I still can't click on a page and go to Presentation, Details (Layout) - I get a TypeError: contentIframe.dialog is not a function
Edit 2 - I've noticed that I can use sitecore in the QA environment and the dialogs work fine there. So it's something specific to my local build of the site we have (sitting on top of sitecore). But the dialogs just throw jquery errors when I do stuff locally. I was hoping it would be a browser setting but doesn't look like it.
Edit 3 - What I've tried this morning.
Same thing happens in all browsers (FF, IE, Chrome) and I’ve cleared
my browser cache I can access the QA site and the dialog appears as
expected
Copied across the QA site files, pointed my local Digital
site in IIS to the new folder – dialogs don’t work
Team member tried accessing the site from his machine (pointing to my IP address) and
dialogs work for him
I tried seeing if another local sitecore site dialogs were working – but the menu items for that are opening as new windows (so I’m guessing it’s a sitecore 7.2 feature that they appear as jquery dialogs??)
So after googling for rejected-by-urlscan it turns out there's a program called UrlScan from microsoft that was blocking my dialogs. Uninstalled that and I now have dialogs appearing for sitecore. Very exciting :)
I guess it is a problem with some browsers plugin. Sitecore is sensitive to scripts that are used(different versions of jquery or prototype.js). Plugins can inject scripts to HTML source of pages and it can cause errors.
Try to switch off all plugins at least at one browser and check the results.

Reload googlemaps after user clicks a link in Django

I am doing a project in Django and i want to have some google maps displayed in my site. So, i installed django-easy-maps and successfully used it in a sample template. So, i am ready with my maps.
The interface i want to implement is this
http://i49.tinypic.com/sowm74.png
I want to display the maps where the Hellow World! container is and with different links on the sidebar i want to refresh the map being displayed on user click without reloading the page.
I did some researching and it seems Ajax is the solution...
Can anybody tell me how i might achieve this (with or without Ajax ) ?
Sorry for sounding like a noob but i am fairly new to this.
The basic steps are:
Create a view for the Google Maps section to the right. This view does not return a full HTML page but only the HTML for that section (which contains your Google Maps map).
When the user clicks on a link on the left, use JavaScript to perform an ajax call to request that page. In short this means: attach an event handler to the onclick event of those links and in code you can perform an ajax call .Many people use a JavaScript library for this purpose, such as jQuery (which has $.ajax()).
You can then use JavaScript to put the received HTML inside the container on the right (using $.html()).

Sharing to social pages with django

In my django application I have different content across the site. Now I would like to add "Share this to... (Facebook,Twitter,Buzz)" link on each page. But instead of redirecting to a social app page I would like to open popup with (if needed) logging/adding possibility. How to get started ? What steps/operations I need to perform and what ready made applications can I use ? I have already created a twitter app and facebook app and have all the keys.
I mean something like links here http://mashable.com/awards/ (left-side).
Sharethis: http://sharethis.com/ works well in every instance I've used it.
If you want only specific 'share buttons' or with default style justy type " social_name 'share button' " and you will get the js to include on your site (here are the 3 you mentioned in post):
http://www.facebook.com/share/
http://twitter.com/goodies/tweetbutton
http://www.google.com/buzz/api/admin/configPostWidget
If you already have the app written to behave like mashable, one approach is to put the login dialog (if it's needed) in a jQuery dialog. http://jqueryui.com/demos/dialog/