Forge functions inside a tab - trigger.io

Is it possible to use forge functions like request.ajax() and prefs.get() inside tabs.openWithOptions() opening a local html file ?

No, the modal view that opens when using the tabs module is designed to act more like a browser window and not allow access to forge methods.
Is there a reason you want to open a local page in a modal view? You should be able to use Javascript/CSS to display a modal dialog in your app without navigating to a different page.

Related

iOS PWA standalone: how to force opening in a new window

I have a PWA saved on the home screen, this opens up standardly without search bar nor the bottom buttons (share, tabs, etc..).
So every link gets opened inside the PWA, and that is expected.
I have a problem when showing pdfs as they normally open in Safari with the "share" button and all the bottom bar, but in the PWA they open up without bottom bar and without any share button.
So my idea is to open the PDF link (http://www.mywebsite.com/download/pdf/12345) in a new safari window,.
I tried putting target="_blank" on the PDF link but this did not solve the problem.
I also tried forcing the iOS behavior by opening the app in safari with safari://http://www.mywebsite.com/download/pdf/12345 but with no luck.
How do I open a New Safari window to a link?
OK, the ONLY working solution is to tell iOS you are going onto another domain.
PWA stays in your app frame ONLY if you stay in the same domain.
To open a link within your domain in an EXTERNAL window (or inside the PWA but with Safari standard controls) you have to send it to an external/different domain.
So the PWA is on https://www.mywebsite.com/ and you want to open a PDF with all Safari control buttons, you just create a SUB domain and point the link to it, like https://media.mywebsite.com/download/pdf/12345 at this point the PWA thinks you are on a different domain and does the correct rendering! 🎉
You can try to use window.open(url).
But, remember to put it in an element with onclick event attribute.
For example,
<button class='btn' onclick='window.open("https://www.google.com", "_blank");'>Open Google search</button>
Reference: window.open(url, '_blank'); not working on iMac/Safari
EDIT
You can set a scope in manifest.json to customize where to open an external link.
You can refer https://developers.google.com/web/fundamentals/web-app-manifest on the property scope.

What is the main difference between QLPreviewController and WebView to display PDF file or any text file.?

I Searched out i can view PDF or any text file using QLPreviewController and WebView. I know both way how to display but i didn't get what is the main difference between them.
Any one Tell me the Difference between this two.?
The primary purpose of QLPreviewController is to preview local files. That's all it does. And it provides the ability to share the document.
WKWebView is for presenting web content and local files. It is a general web browser. It's primary purpose is for viewing web content. It lets you move back and forth through browsing history. It allows you to handle links.
If your app needs to allow a user to view and possibly share a local document, use QLPreviewController. If your app needs a browser, use a web view.

iOs Web view how to make static a dynamic page

I have an iOs web View App wich connect to a touch responsive website and I would like to do some tabs in the app, one for contact form, another one for "about us", something like that...
The problem is you can navigate to the main web site page from those tabs by pressing the top logo page, and I would like to invalidate that from x-code without editing the word press template. Basically I would like those tabs to be "static pages". Any one has an idea on how to do that or if it's posible to do it from x-code?
Use UIWebViewDelegate's shouldStartLoadWithRequest method to check the URL your web view is trying to load. If URL is not one of the pages you want to allow access to, return false.

How to create tabs in a ipad app that is similar a web browser tabs

I have a requirement to create a ipad app that supports tab to view content. I have created a custom splitview controller, whenever user goes to a particular section in the left section, the contents related to that will be displayed in the content view(right view). If a user selects a particular link in that content view it should open a tab and display the contents of that link in that new view. Similar to Web Browser tabs i need to handle tabs in this app. Please suggest any available open source component or any ideas to implement tabbing inside a ipad app.
You can use Three20 for your tab purpose. Also there are many open Source components available. You just need to search in google.

Same view showed twice

I would like to implement a "Module Switcher" in my application, which brings up an alt-tab like interface showing the open modules.
Right now it is structured like this
ModuleShellView
ModuleSwitcherView
Module 1 Module 2 Module 3
ModuleSwitcherView is opened as a dialog from ModuleShellView and binds to the currently open Modules.
This causes the active module in the screen behind to transition to nothing. Is there a way to keep the view open in the background, while displaying it in another dialog? The alt-tab window only needs a "view" of the view, it doesn't need to be interactive.
I have found a workaround for this. Rather than show the contentcontrol, I am grabbing the view instance, writing it to a WriteableBitmap and then using that.

Resources