Ionic 2 - Open external pdf inside my app - ionic2

I have some pdf file links on my app, and I wanna the user be able to open/read then inside my app. Is it possible? Is there any easy way to do that? Thanks!
EDIT:
Until now, I'm using regular link, like this:
<a href="{{conta.link_conta}}" *ngIf="conta.link_conta">
But in that case, it opens on the external browser (chrome for android, in my test). I would like to open it inside my own app, kinda like facebook, instagram, twitter and some other apps do

Didn't try it, but can't you use InAppBrowser plugin
https://github.com/apache/cordova-plugin-inappbrowser
Set the target as '_self',

Related

How can I upload new webpages to a django app?

I am quite new to django so I am sorry if I have overlooked something simple.
This is my current website: https://www.michealnestor.com
I am trying to remake it using react and django, and a lot of it is different, however I want to keep the functionality of being able to run my js apps from the website: https://www.michealnestor.com/projects EXAMPLE: https://www.michealnestor.com/projects/sortingalgorithms/ .
I want to be able to upload project folders, with html, css and js in them from the admin page, and then be able to open these projects from my website. I am not sure how to do this though.
I have tried manually placing such a folder in a templates folder in my app, and I have managed to use a view to load the html file, but this file can't seem to find the css and js.
Maybe I am going about this the wrong way, in any case I would appreciate some guidance!

Open link using system browser using InAppBrowser

I am using Ionic 2 and want to open a PDF file from a remote server using the device's default browser. I have a couple of problems:
First, I am unable to run this on the browser. I get this error:
Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.
The ionic docs seem to indicate support for all devices and browsers. Am I doing something wrong or the docs are wrong?
Secondly, when I run the app, the PDF file does not open in the system's default browser but within the app. I am using Ionic View to do the testing. Here is my code:
import { InAppBrowser } from '#ionic-native/in-app-browser';
constructor(public appGlobal: AppGlobal, private iab: InAppBrowser) {
const browser = this.iab.create('www.google.com', '_system');
browser.show();
Also, if I change the URL to my php script that generates and returns a PDF file, it does not work at all.
To use the device's default browser, you don't need to use the IAB. You just need to open a new window with _system. Your device will do the rest.
window.open(url, '_system');
You can also do what you're doing if you want to keep the IPB, just omit the open function.
Adding the _system target means you don't need to do this anymore as it crashes the app.
uninstall inappbrowser plugin and simply try this:
window.open(pdf_url, '_system', 'location=yes');
When you use _system browser, it's not necessary use browser.show()
this.iab.create('www.google.com, '_system');

Create a web page in odoo 8

I create a web page in odoo 8,
I created a template in /mymodule/views/my_template.xml
<template id="dms_web_client.webclient_bootstrap1" name="FTP server Webclient">
<t t-call="website.layout">
<a id="create_new_directory" href="#" data-action="new_dir">New Directory</a>
</t>
</template>
When I click on a link New Directory I need to open up a pop up with a text box and file browse and save & cancel button. Like create a new page in website module.
I don't know what to do next. Please help.
If you need to interact with other models within your module (or even Odoo in general), you're probably going to want to create a controller, which can contain python code and allow your web page to interact with models. On a simple level, a controller can go in your main folder (ie /mymodule/my_template_controller.py) and be declared in your init.py file (import my_template_controller). You can then set a route that matches your template id and create forms that post to the controller, allowing python code to be run and models to be interacted with. That can allow you to have your file browse and save and cancel button.
As far as the front end, you can use html, css, and Javascript like any normal website and they can be declared via normal links in the page header.
Odoo does have some documentation, but it is pretty poor, unfortunately. It took me a long time to decipher how to fully build a web application within it. However, it works great once you figure it out and it generally follows the guidelines of any other model/controller/view application.
http://www.odoo.com/documentation/9.0/howtos/website.html
https://www.odoo.com/documentation/9.0/reference/http.html

Opencart filemanager doesn't work

Opencart 2.0.1.1
Standart Image Manager isn't working.
When I choose some picture, it just opens in the browser, in console I have no errors. Any suggestions?(other functions don't work either, for example reload open image manager without css)
Please someone help)
My js in .tpl doesn't work because my hosting turned on some plugin pagespeed that off scripts in views -_-
Solution:
Add this pagespeed_no_defer="" to script and it will work.

How to link to an .ipa file (over the air ios app installation) using django and STATIC_URL?

I have a django server set up in development. It is basically the simplest "app store" you can imagine. I can now finally serve up static images using STATIC_URL as the prefix.
I however have failed to be able to enable over the air installation of my .ipa file.
When I click on my link on my iPhone or iPad, I get a 404 error, which leads me to think that the path to my .ipa is incorrect. Except that I think that my path is correct :>
Can anyone please point me to what the magic path needs to be?
Thank you!
Inside my django template, all I do is provide a link to the app like so:
Neither of the following work:
Cool Runner
Cool Runner
Cool Runner
So the third try, links to my plist and it IS found, but when I click on it in mobile Safari on my iPHone it just displays the contents of the pList. I am supposed to link to the pList and not the .ipa, right?
Cool Runner
The fourth try (directly above where I link to the ipa) prompts me to download the ipa, and then mobile Safari offers to let me open the link in Evernote, or a few other apps. Not exactly what I want.
In the exact same template, for sanity checks, I provide a link to an mp3 and an iphone configuration profile, which both DO work (clicking on the iphone configuration profile link does launch the iPhone's settings app and asks me to install the config profile correctly)
cool song
<a href="{{STATIC_URL}}binaries/coolRunner.mobileconfig>Cool Runner Configuration Profile</a>
Could there be a problem with my actual ipa file, as in, maybe it is not provisioned right? I used XCode 4.5 and archived it, and followed the dead simple wizard, distributed it for enterprise/ad-hoc deployment, code-signed it with my identity (I have all the privileges except that I am not the Team Agent, but I am an admin), and filled out the form that requires an App URL (which I said to be http://192.168.1.109:8000/appstore/static/binaries/coolRunner.plist)
Well the one thing I neglected, is the way to do it:
Cool Runner
That works. For others who may come after me, let me explain that when you have STATIC_URL defined at the default /static/ in django's development server, you locate your static files right off the domain name and port number: (e.g., http://192.168.1.109:8000/static/captain_obvious.png)
Please also note that I did NOT have to add a type="application/octet-stream" nor a type="text/xml" either on the development server nor in my tag. I'd seen some posts that said that you need it, although those posts may have been referring to production.