Skip to content

stereoket/titanium-appcelerator-mini-browser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

This is a mini-browser module to use in Titanium Appcelerator

It works on android and iOS, the android creates a set of menu options instead of showing a share button in the toolbar.

How to use it?

You have just to instance the MiniBrowser to a variable, and create it. It will return a Window, and you can do what you want. See these examples:

Parameters

  • url: (STRING) This parameter is the URL to open in the browser
  • barColor: (STRING) The color of navigationBar and toolbar of the browser (example: #000)
  • modal: (BOOL) If you wanna open the browser in a modal window, set it as true. Default is false.
  • showToolbar: (BOOL) If you wanna hide the toolbar of the browser, set it as false. Default is true.
  • <li><b>backgroundColor:</b> (HEX) Set the colour for the window background. Default is white '#fff'.</li>
    <li><b>modalStyle:</b> (Ti OBJ) A <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.iPhone.AnimationStyle-object">Titanium.UI.iPhone.AnimationStyle</a> Object you want to apply to the modal window transition.</li>
    
    <li><b>windowTitle:</b> (STRING) Customise the title in the nav bar. Default is <em>URL title</em>.</li>
    <li><b>activityMessage:</b> (STRING) Android Activity Indicator has space for a text message. Default is set to <em>'Loading'</em>. Disabled for iOS currently</li>
       Experimental (not fully tested properties)
    	<ul>
    	<li><b>html:</b> (BOOL) If you wanna parse custom HTML you can use this. Default is true.</li>
    	<li><b>scaleToFit:</b> (BOOL) toggle the webview scaleToFit property.</li>
    	<li><b>showActivity:</b> (BOOL) Disable the activity Indicator.</li>
    	<li><b>windowRef:</b> (OBJ) Pass through your own window object reference.</li>
    	<li><b>activityStyle:</b> (Ti OBJ) A Ti activity indicator style object.</li>
    	</ul>
    

Methods

openBrowser: This method will open your browser (modal or not) in your application.

returnBrowser: This method will return the window of your browser, to open with an TabGroup or customize the Window

Internationalization

The default strings language in this browser is in English. If you wanna translate the strings, you can use the following ids:

  • copy_link
  • open_browser
  • send_by_email
  • cancel
  • close

If you don't know how to internationalize your application, please read this (Wiki - Internationalization)

Examples

Modal Window

var modalBrowser = new MiniBrowser({
	url:"http://www.google.com/",
    barColor:"#000",
    modal:true,
	activityMessage: 'Loading Page'
});

modalBrowser.openBrowser();

TabGroup

var broser = new MiniBrowser({
	url:"http://www.google.com/",
    barColor:"#000"
});

Ti.UI.currentTab.open(browser.returnBrowser());

Images

Issues

Android menu options don't show when the window is not modal, HTML and some other experimental features not fully tested.

Customise Activity Indicator placement

About

A mini-browser to Titanium Appcelerator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%