Different href for links to open inline v/s new tab - href

I have a single page application (MySPA). The MySPA is loaded as a stand alone application or as part of another iframe based SPA where MySPA is loaded in an iframe.
When loaded as stand alone, the url looks like http://..../mySPA#home
When loaded as part of another SPA, the url looks like http://..../foo/mySPA#home
The challenge I am facing is ...
The links inside MySPA have their href="#dashboard" or href="#listView". When I click on these links, they do the right thing in both the environments.
But when user right-clicks and "Open in New Tab" or Command+Click, a new tab is opened and the iframe context is lost and MySPA goes in a stand alone mode.
I was wondering if there are any patterns around this and what is the cleanest way to solve this problem.
The BASE HREF solution does not work because the links have to be dynamic in this case (different href for opening inline and a different href for open in new tab).

Related

URL link defined in a column, APEX 18.2 IG

I have an interactive grid where one of the columns is a url link to a picture.
Now I want some way to click on that link and open up that link.
Except the URL links in APEX demand a static link. Also, they open up over the open window, instead of another window or another tab.
I have gone through my options, googled for a couple hours, tried to perhaps find a solution that used a DA after clicking on the field and then a JS to redirect to the URL. But my google-fu is apparently not strong enough, and so I turn to you, good people of Stackoverflow.
What I want is a link inside an interactive grid which when clicked, redirects to a URL that it gets from a column in the IG.
Set you link column like this.
"ENAME" is a column.
Example: https://apex.oracle.com/pls/apex/f?p=150297:30:::NO:::

Display template for content search webpart issue for datatable and Tabs

I have developed display template and using it in Content search web part.
For displaying result on page i am using JQuery datatable/JQuery Tabs in display template.
Everything works fine, but sometime while loading page i am getting error like ("Object doesn't support property or method 'dataTable' (OnPostRender: )" and for tabs error is "Object doesn't support property or method 'tabs' (OnPostRender: )").
And if i refresh page many times then error will go and result is display as code.
I have register JQuery, JS and CSS using $includeScript.
I have also tried with RegisterSod for JQuery and JS file but still issue is same.
Thanks in Advance.
Can be:
This error usually occurs when an html element id has the same id as some variable in the javascript function, try change the name.
If you put the code I'll be able to help you better.
test = button.attr('test'); // Object doesnt support this method
$test= button.attr('test'); // works fine
Or debbug your code with and discover your problem. Enable script debugging IE:
In Internet Explorer, choose Internet Options from the Tools menu.
In the Internet Options dialog box, click the Advanced tab.
On the Advanced tab, under Browsing, clear Disable Script Debugging.
Click OK.
If you have IE 8+ click here
Tutorial Using jQuery dataTables: link here

Webview Swipe issue - Appcelerator Titanium

Right now I am using one webview to show data from my aplicationDatadirectory, here everything is working fine, I get content when user click next back respectively. Now what I am doing is in onload of webview I register "touchevent" and "touchmove" in webview's html like this :-
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
on the basis of this I find swipe event. I get correct html in webview(I can see images). But I am unable to get touchstart and move call. I dont know what is the problem here. I set data in webview using url here.
Now when I set data in webview using html(I used data of my html file(given below) in one var) now I am unable to see images it just shows me one black border(empty) but here my touchstart and touchmove events are firing also my swipe is also working as expected. I am checking this functionality in iPhone.
Can any one find the issue what is going wrong here? Thanks.
I think that this depends on the time when you apply
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
If you use the html property data is loaded immediately and you can use the code exactly after setting html content. If you use the url (even if it is located locally, which might be difficult for android) then you need to wait a short time until the page is loaded. There is also an event listener for that (web view-event load) but i can't say if that works for local resources but i don't think so.
In this case you should apply your javascript snippet into your html resources (if they are locally) instead of manually adding it using evalJS.
Please note that there is an issue on android that you can't use local images (resources folder) in your webview when you provide the content via html property.
I made it swipe working in iOS(in android it was working).
I did not expect this thing to be a reason but I do not know logic behind it. I was accessing .xhtml files from application data directory and it was working without any issue in android but in iOS it was not.
I just change(rename in my code) .xhtml file to .html and now it is working. :)
Hope this can help someone who is looking for the same.(or just for his interest)
Thanks.

Wampserver2 + kohana 3.2 links issue

I am developing my first page in Kohana 3.2 framework and I have a big problem. I have about 3 controllers:
default extends Template Controller,
home extends Default,
list extends Default.
Every controller has its own actions. I log in with home/login and redirect to list controller which opens action index to show some things in content of the template. The opened content has links to manage diffirent contents (like reprinting table with diffirent things in it). I want links to work like this controller/action but if one link is pressed, lets say, list/show, and i press again list/show (cause the menu is being shown all the time), it tries to enter list/show/list/show instead of just reopening the list/show. To sum up, it just adds pressed link to previous one, creating a mess. Does somebody know why is this happening? Apache's rewrite module is turned on.
Always being href's with a slash and specify the path to the controller from the web root. In other words the link should be:
<a href="/list/show">

default text in mediawiki new pages

Does anyone know how to make mediawiki automatically populate a new page with some text when the edit button is clicked for the 1st time? I have tried the MediaWiki:Newarticletext page but this only affects the text that is displayed when a user visits a page that doesn't exist. I would like to provide my users the option of a pre-built template type page that doesn't require them to type in a lot of text that will be very similar on many new pages.
I don't think mediawiki templates are the way to go as they just imclude the text when the page is rendered and they don't provide the text for the user to customise.
thanks
Have you tried MultiBoilerplate? You can se this to load default pages - and you can create multiple default. The only problem is that it won't load when you create the page but just after (you need to press Load).