Coder Social home page Coder Social logo

tapquo / lungo.js Goto Github PK

View Code? Open in Web Editor NEW
2.4K 163.0 566.0 11.01 MB

A framework for developers who want to design, build and share cross device applications.

Home Page: http://lungo.tapquo.com

License: Other

CoffeeScript 37.51% JavaScript 2.85% CSS 59.63%

lungo.js's Introduction

LungoJS

A HTML5 framework for developers who want to design, build and share cross device applications.

  • HTML5 Optimized Apps: Supports open web standards, such as HTML5, CSS3 and JavaScript. It brings a consistent browser environment across mobiles, TVs and desktop devices.

  • Open Source Project: Each new line of code in Lungo is welcome, we hope that Developers and restless minds will help us to improve day by day this humble project.

  • Powerful JavaScript API: here are many ways to develop apps, not all of them are optimized. Lungo offers you a robust API so you can have complete control of everything that happens in your App.

  • Cross-Device full support: It's known that creating apps for each platform is expensive, this situation is increased by the arrival of tablets and SmartTVs. Lungo will suit all of them creating a unique and amazing UX.

Current version: 2.2.0

Getting Started

The idea of Lungo arose in year 2010 when the craftman Javi Jiménez Villar (soyjavi) saw that hot existing Mobile Frameworks at that time were not powerful and not using the features of HTML5.

Community

If this documentation is not enough for you, you can subscribe to the Lungo open community to share your experiences and knowledge. You can do it in English or Spanish, you decide.

GitHub

This is opensource, so feel free to fork this project to help us create a better framework. All source code is developed with CoffeeScript and Stylus, but don't worry we worship clean-code so you can quickly get to make your own modifications in it.

https://github.com/tapquo/lungo.js

Licensing

Lungo is licensed under GPLv3 licensed and a Commercial License for OEM uses. See LICENSE for more information.

Help us on being better

Please, don't have any doubt in contacting us if you think you can do a better API. If you think that we have to support a new feature or if you have found a bug, use GitHub issues. Make a fork of this documentation and send us your pull requests with your improvements.

To talk with us or with other developers about the Lungo API, suscribe to our mailing list.

EASY PROTOTYPE

The main premise is to create a semantic structure in the whole project, starting from the markup language HTML, through a well organized CSS and ending with the JavaScript API. Lungo offers a great facility when prototyping applications, and will not be needed to enter any lines of code (JavaScript) to visualize how our application will behave. In this doc we will learn which are Lungo semantic elements as relate to each and how you can create applications with HTML only. It's really exciting! let's begin.

Structure

Here you have the dependencies of your Lungo application's body. It must contain at least:

<link rel="stylesheet" href="components/lungo.brownie/lungo.css">
<link rel="stylesheet" href="components/lungo.icon/lungo.icon.css">
<link rel="stylesheet" href="components/lungo.brownie/lungo.theme.css">
<script src="components/quojs/quo.js"></script>
<script src="components/lungo/lungo.js"></script>

<section> it's the main container of your UI Components in your App and <article> it must be placed inside your section and must have…. Each section and article must contain an unique ID.

<section id="main">
    <article id="main-article">
        Your content
    </article>
</section>

The JavaScript function that initializes Lungo it's:

Lungo.init({});

Load Sync resources on init

To make easier to create and modify your app you can create the sections in separate html files and load the synchonously, making your main file smaller and having your code organized better.

//Load resource on app init
Lungo.init({
    name: 'example',
    resources: ['section_to_load.html']
});

Load async resources by link

There is other way to load resources asynchronously, just add to the <a> tag element the attribute data-async with the link to the section.

<section id="loader" data-transition="">
    <article id="art1" class="active">
        <a href="#main" data-router="section" data-async="section_to_load.html">
            Go to section
        </a>
    </article>
</section>

Basic Elements

Lungo uses the semantic language markup introduced with HTML5, so you can add this elements using the new semantic tags.

Section & Article

A <section> is a view of our application where content will be displayed and where there may be subelements as <header>, <footer> and <article>.

<section id="main">
    <article id="main-article" class="active">
        {{CONTENT}}
    </article>
</section>

The content a particular <section> is structured by <article>. Within a section may be as many <article> as you like. The article of the section that will be shown first must have th class="active" attribute set.

<section id="main_section">
    <header data-title="example"></header>
    <article id="main-article" class="active">
        {{CONTENT}}
    </article>
</section>

Header

Each <section> can contain a <header> where the tittle of the section will be shown. Optionally you can add navigation buttons, to go to another section, go back to a previous one, go to another article or just open the aside menu.

<section id="main_section">
    <header data-title="example"></header>
    <article id="main-article" class="active">
        {{CONTENT}}
    </article>
</section>

Footer

Each <section> can contain a <footer>. There you can add buttons to navigate through articles, sections and even asides.

<section id="main_section">
    <article id="main" class="active">
        {{CONTENT}}
    </article>
    <footer>
        <nav>
            <a href="#" data-icon="menu" class="active"></a>
            <a href="#" data-icon="share"></a>
            <a href="#" data-icon="user"></a>
            <a href="#" data-icon="users"></a>
        </nav>
    </footer>
</section>

Aside

The <aside> element gives us a lateral area which will appear depending on the device (tablet) or hidden (mobile). Its structure is very similar to the section one's. We can create a link that references a <aside> with a particular id using the navigation system of Lungo. We will use the attribute data-router (which will be discussed in subsequent chapters). We can also define the positioning of it, using style classes. The default position is left.

<aside id="features">
    <header data-title="Options"></header>
    <article class="active">
        {{CONTENT}}
    </article>
</aside>

In your section if you want view aside automaticaly in Tablet-Apps you need link your aside with data-aside attribute, and you can display/hide with attribute data-view-aside:

<section id="main_section" data-aside="features">
    <header data-title="Aside">
        <nav>
            <button data-view-aside="features" data-icon="menu"></button>
        </nav>
    </header>
    <article id="main-article" class="active indented">
        {{CONTENT}}
    </article>
</section>

Navigation

The navigation in Lungo is entirely semantic, and you will use the element <a> or <button> and his data attribute "view-*" to tell the system which <section>, <article> or <aside> you want to go to.

Data-View attribute

The data-view-* attribute is set in the <a> or <button> element to set the type of element we are going to navigate to (<section>, <article> or <aside>) and in the href attribute the hashbang plus the id of the element has to be set. Lungo uses this href to generate the bread crumbs.

<section id="main">
    <article id="article_1" class="active">
        <button class="button" data-view-article="article_2" data-icon="forward">To article_2</button>
    </article>
    <article id="article_2">
        <button class="button" data-view-article="article_1" data-icon="home" data-label="To article_1"></button>
    </article>
</section>

Data-back attribute

As it has been said before, Lungo's navigation is based on the bread crumbs pattern, so navigation backwards between sections is done using the data-back functionality. You can set a button in your header using the data-back attribute or use in <a> or button tags data-router="section" with href="#back"

<section id="main">
	<article id="main_1" class="active">{{CONTENT}}</article>
    <article id="main_2">{{CONTENT}}</article>
</section>
<section id="second">
    <header data-back="home"></header>
    <article id="second_1" class="active">
        Same as header:
        <button data-view-section="back" data-icon="left" data-label="Return to previous section"></button>
    </article>
</section>

Nav

To create simple structures of navigation buttons within a footer or header the nav element has to be used. In the header, the nav element's position will depend on the class applied to it. left to the left and right to the right.

<section id="main">
    <header data-title="<nav> example">
        <nav class="on-left">
            <button data-view-article="article_1" data-label="Home"></button>
        </nav>
        <nav class="on-right">
            <button data-view-section="second" data-label="Section"></button>
        </nav>
    </header>

    <article id="article_1" class="active">{{CONTENT}}</article>
    <article id="article_2">{{OTHER_CONTENT}}</article>

    <footer>
        <nav>
            <a href="#" data-view-article="article_1" data-icon="home"></a>
            <a href="#" data-view-article="article_2" data-icon="user"></a>
            <a href="#" data-view-section="second" data-icon="right"></a>
        </nav>
    </footer>
</section>

<section id="second">
    <header data-back="home" data-title="example"></header>
    <article id="second_1">{{CONTENT}}</article>
</section>

Groupbar

Lungo gives you the capability to have a special menu at the top of your UI. To do this you have to extend the header element using class="extended" and create inside of it a nav element with class="groupbar"

<section id="main">
    <header data-title="groupbar" class="extended"></header>

    <nav data-control="groupbar">
        <a href="#" data-view-article="article_1" class="active">Art-1</a>
        <a href="#" data-view-article="article_2">Art-2</a>
    </nav>

    <article id="article_1" class="active">{{CONTENT}}</article>
    <article id="article_2">{{OTHER_CONTENT}}</article>
</section>

Menu

Besides <nav> elements and groupbar there is another way to make the user select new view in your application. Since Brownie (v2.2) implements menu Control and it is called with the attribute data-view-menu:

<section id="menu" data-transition="slide">
    <header data-title="data-control=menu">
        <nav>
            <a href="#" data-view-menu="options" data-icon="menu"></a>
        </nav>
        <nav class="on-right">
            <a href="#" data-view-menu="options-icons" data-icon="grid"></a>
        </nav>
    </header>  
    <nav id="options" data-control="menu">
	    <a href="#" data-view-article="home-menu" data-icon="menu">Home</a>
	    <a href="#" data-view-article="explore-menu" data-icon="globe">Explore</a>
	    <a href="#" data-view-article="activity-menu" data-icon="comments">Activity</a>
	    <a href="#" data-view-article="profile-menu" data-icon="user">Profile</a>
	</nav>
</section>

In case you want to give it a priority to icons only have to apply the icons class.

<nav id="options-icons" data-control="menu" class="icons"></nav>

Bindings

Title Binding

To update the title of a section through the navigation, just use the attribute data-title in your navigation element.

<section id="main">
    <header data-title="Default title"></header>
    <article id="first" class="active">
        <button data-view-article="second" data-title="Second Article"></button>
    </article>
    <article id="second">
        <button data-view-article="first" data-title="First Article"></button>
    </article>
</section>

Element binding

You can show nav elements when a particular article is visible with data-article attribute.

<section id="main">
    <header data-title="Title of section">
        <nav class="on-right">
            <button data-article="second" data-view-article="first" data-icon="left"></button>
            <button data-article="first" data-view-article="second" data-icon="right"></button>
        </nav>
    </header>
    <article id="first" class="active">{{CONTENT}}</article>
    <article id="second">{{OTHER_CONTENT}}</article>
</section>

Forms

We know that forms have always been somewhat tedious to handle in web projects, Lungo makes easy create a uniform base and unique experience among all browsers. All controls from the input (in any of its variants) to the button are perfectly adapted for use with touch devices. You only have to use the form or class form:

<div class="form">
	<fieldset>
	    <label>Input</label>
	    <input type="text" placeholder="value">
	    <label>Input styled</label>
	    <input type="text" placeholder="value on right" class="text align_right error">
	    <label>Select</label>
	    <label class="select">
	        <select>
	            <option value="1">HTML5</option>
	            <option value="2">CSS3</option>
	            <option value="3">JavaScript</option>
	        </select>
	    </label>
	    <label>Input date</label>
	    <input type="date" class="align_right" placeholder="Select finish" value="10/04/1980"/>
        <label class="anchor">Example of touch checkbox</label>
        <input type="checkbox" class="inline right" />
	</fieldset>
</div>

Lists

Can you imagine an App without lists? we can't conceive of such a thing, so in Lungo offers you an multiple components to make lists tailored to your needs. Always keeping in mind that everything starts with a <ul> and continous with a <li>:

<article id="example" class="list">
   <ul>
		<li>
			<strong>Title</strong>
			<small>Description</small>			
		</li>
		...
   </ul>
</article>

Our <li> element can be filled by multiple ways and how complex it all you want, check out a list item much more complete:

<li class="thumb big">
    <img src="http://cdn.tapquo.com/lungo/icon-144.png" />
    <div>
        <div class="on-right text tiny">lorem ipsum</div>
        <strong>Title</strong>
        <span class="text tiny opacity">lorem ipsum</span>
        <small>
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque, aliquam, nisi commodi blanditiis.
        </small>
    </div>
</li>

If you want to know more about the possible styles of the lists have to study the examples in our wonderful Kitchen-Sink.

JavaScript API

Core

Lungo has several methods that are used inside its engine. Here you have them if you need to include some of their functionality in your application.

log()

Console system to display messages when you are in debug mode. Parameters

number:     Severity based in (1)Log, (2)Warn, (>2)Error
string:     Message to show in the console

Example

Lungo.Core.log(1, "Launched event");
Lungo.Core.log(2, "Warning!!");
Lungo.Core.log(3, "Error!!!!");

execute()

Executes callbacks based on the parameters received. Parameters

function:   callback to execute

Example

var myFunc = function(){
    //Do something
};
var myFunc2 = function(){
    //Do something
};
Lungo.Core.execute(myFunc, myFunc2);

bind()

Creates a new function that, when called, itself calls this function in the context of the provided this value, with a given sequence of arguments preceding any provided when the new function was called. Parameters

object:     object that 'this' can refer in the new function.
function:   A function object.

This method return the function which will do the action on the object.

Example

var example = "This is ";
var addText = function(textToAdd){
    text = this;
    for(var i = 0, len = textToAdd.length; i < len; i++){
        text += " " + textToAdd[i];
    }
    return text;
};
var text = ["an", "example"];
var finalText = Lungo.Core.bind(example, addText)(text);
//Result: "This is an example"

mix()

Copy from any number of objects and mix them all into a new object. The implementation is simple; just loop through arguments and copy every property of every object passed to the function.

Parameters

object:     arguments to mix them all into a new object.
object:     arguments to mix them all into a new object.

This method return an object with the mix done.

Example

var CONFIG_BASE = {
    name: 'lungo_db',
    version: '1.0'
};

var CONFIG = {
    version: '1.1';
}

var finalConfig = lng.Core.mix(CONFIG_BASE, CONFIG);

/*
Result:
{
    name: 'lungo_db',
    version: '1.1'
}
*/

isOwnProperty()

Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object.

Parameters

object:     object to test for a property's existence inside itself.
string:     property the name of the property to test.

This method return boolean indicating if property exists.

Example

var car = {wheels:4,doors:true};
Lungo.Core.isOwnProperty(car,"wheels"); //Result: true
Lungo.Core.isOwnProperty(car,"wings");      //Result: false

toType()

Determine the internal JavaScript [[Class]] of an object.

Parameters

object:     object to get the real type of itself.

This method return a string with the internal JavaScript [[Class]]

Example

var name = "Lungo";
Lungo.Core.toType(name);    //Result: "string"

toArray()

Convert an array-like object into a true JavaScript array.

Parameters

object:     Any object to turn into a native Array.

This method return the object in a plain array.

Example

var execute = function() {
    var args = lng.Core.toArray(arguments);
}

isMobile()

Determine if the current environment is a mobile environment. This method return An object with the mix done. Example

Lungo.Core.isMobile();

environment()

Returns information of execute environment. Example

Lungo.Core.environment();

orderByProperty()

Orders a number of objects by a given parameter.

Parameters

list:       List of objects.
string:     Name of the property.
string:     Type of order: asc or desc.

This method return an ordered list of objects by a property.

Example

var list = [
    {name: 'Lungo', twitter: 'lungojs'},
    {name: 'Quojs', twitter: 'quojs'},
];

var ordered_list = lng.Core.orderByProperty(list, 'name', 'asc');

findByProperty()

Finds a object with an specific property if exists in a list of Objects.

Parameters

list:       The list with objects.
string:     Name of the property.

This method return An instance of the object found, null if not found.

Example

var list = [
    {name: 'Lungo', twitter: 'lungojs'},
    {name: 'Quojs', twitter: 'quojs'},
];

var user = lng.Core.findByProperty(list, 'name', 'Lungo');

Cache

Lungo implements its own cache type. This cache will store the value until the webapp is closed

set()

Sets in the LungoJS cache system a new key/value pair.

Parameters

string:     Key for the new value.
string:     [OPTIONAL] Subkey in LungoJS Cache System.
object:     Value asigned to the key.

Example

var framework = {name: "Lungo", twitter: "lungojs"};
Lungo.Cache.set("lungoFramework", framework);

get()

Returns the cached value of a given key.

Parameters

string:      Key in LungoJS Cache System.
string:     [OPTIONAL] Subkey in LungoJS Cache System.

This method return an object containing the value.

Example

var cachedFramework = Lungo.Cache.get("lungoFramework");
//Result: {name: "Lungo", twitter: "lungojs"}

remove()

Removes the instance of a given key in LungoJs Cache System.

Parameters

string:     Key in LungoJS Cache System.
string:     [OPTIONAL] Subkey in LungoJS Cache System.

Example

Lungo.Cache.remove("lungoFramework");

exists()

Checks if the given key is stored in the cache.

Parameters

string Key in LungoJS Cache System.

This method return a boolean value which is true if the key is found

Example

Lungo.Cache.exists("lungoFramework");

DOM

Lungo uses the famous library QuoJS to handle the DOM of your application. QuoJS is a micro, modular, Object-Oriented and concise JavaScript Library that simplifies HTML document traversing, event handling, and Ajax interactions for rapid mobile web development. It allows you to write powerful, flexible and cross-browser code with its elegant, well documented, and micro coherent API.

Manipulation

Using QuoJs, you can chain functions to execute several commands in one row. For more info about Quo's API please go here.

Example

<section id="main"">
    <header data-title="Dom Manipulation"></header>

    <article id="main-article" class="active">
        <ul>
            <li class="dark">
                Tap here to change the color
            </li>
        </ul>
    </article>
</section>

Subscribe to a tap event with a callback

Lungo.dom('#main-article li').tap(function(event) {
    Lungo.dom(this).toggleClass('light').toggleClass('dark');
});

Triggers

When sections or articles are switched an event is launched. The target section/article will launch an load event and the current section/article will launch the unload one. We can bind to this events using QuoJs. Example

<section id="section1">
    <article id="article1">
        <button data-view-section="section2" data-label="2nd Section"></button>
    </article>
</section>
<section id="section2">
    <article id="article2">{{CONTENT}}</article>
</section>
Lungo.dom('#section1').on('unload', function(event) {
    alert("Unloaded section 1");
});

Lungo.dom('#section2').on('load', function(event){
    alert("Loaded section 2");
});

.Element

.Carousel

Lungo has a carousel element where content can be published and the user can navigate through it using the caroussel controls.

Parameters

string:     Element query selector.
function:   Function to execute when switching slide.

Example

<section id="carousel" data-transition="slide">
    <header>
        <div class="centered title">Photo: <span>1</span></div>
    </header>
    <article id="art" class="active block" data-control="carousel">
        <div>
            <div align="center">
                <img src="http://lorempixel.com/320/418/food/">
            </div>
            <div align="center">
                <img src="http://lorempixel.com/320/418/sports/">
            </div>
        </div>
    </article>
</section>
var el = Lungo.Dom('[data-control=carousel]').first();

var example = Lungo.Element.Carousel(el, function(index, element) {
    Lungo.dom("section#carousel .title span").html(index + 1);
});

Carousel.prev()

Show the previous slide. Example

var example = Lungo.Element.Carousel(el);
Lungo.dom('[data-direction=left]').tap(example.prev);

Carousel.next()

Show the next slide. Example

var example = Lungo.Element.Carousel(el);
Lungo.dom('[data-direction=left]').tap(example.next);

Carousel.position()

Returns the actual index. Example

var example = Lungo.Element.Carousel(el);
example.next();
alert(example.position());

.count

As it has been shown in the prototyping chapter, you can add a counter to elements using the data-count attribute. You can also add this counter using javascript.

JavaScript method

Set a counter to the element:

Parameters

string:     Element query selector.
number:     Value of the counter.

Example

Lungo.Element.count("#messages", 5);

HTML method

You can define via HTML a default value for a count element. Example

<section><footer>
        <nav>
            <a href="#" data-icon="user" data-count="12"></a>
            <a href="#" data-icon="globe"></a>
            <a href="#" data-icon="cog"></a>
        </nav>
    </footer>
</section>

.loading

As it has been shown in the prototyping chapter, you can create a loading animation using the data-loading attribute. You can also add this animation using javascript:

Parameters

string:     Element query selector.
string:     [OPTIONAL] Stylesheet.

This method returns an instance of the object founded.

Example

<section id="main" data-transition="">
    <header data-title="loading"></header>
    <article id="main-article"></article>
</section>
Lungo.Element.loading("#main-article", 1);

.progress

As it has been shown in the prototyping chapter, you can create a progress bar using the data-progress attribute. You can also add this bar using javascript.

Parameters

string:     Element query selector.
number:     The percentage value.
boolean:    Boolean to show the percentage label.

Example

<section id="main" data-transition="">
    <article id="main-article" class="active list indented scroll">
        <form>
            <div id="prg-example" class="progress">
                <span class="bar">
                    <span class="value"></span>
                </span>
            </div>
        </form>
    </article>
</section>
Lungo.Element.progress("#prg-example", 65, true);

.Pull

As it has been shown in the prototyping chapter, you can create a pull and refresh element addind data-pull and some javascript code.

Parameters

string:     Element query selector.
object:     Object with the configuration.

Example

<section id="main" data-pull="normal">
    <header data-title="Pull & Refresh"></header>
    <article id="main-article">
        <ul>
             <li class="dark" data-icon="help">
                    <strong>
                    Test this featury only drag down.
                </strong>
                <small>This element has an associated event</small>
            </li>
        </ul>
    </article>
</section>
var pull_example = new Lungo.Element.Pull('#main-article', {
    onPull: "Pull down to refresh",      //Text on pulling
    onRelease: "Release to get new data",//Text on releasing
    onRefresh: "Refreshing...",          //Text on refreshing
    callback: function() {               //Action on refresh
        alert("Pull & Refresh completed!");
        pull_example.hide();
    }
});

###.Menu Manages visual behavior <data-control-menu>

Show

Displays the with a determinate Id

Parameters

string:     <data-control-menu> Id

Example

Lungo.Element.menu.show("options")

Hide

Hides the with a determinate Id

Parameters

string:     <data-control-menu> Id

Example

Lungo.Element.menu.hide("options")

Toggle

Toggles the with a determinate Id

Parameters

string:     <data-control-menu> Id

Example

Lungo.Element.menu.toggle("options")

.Notification

To display notifications, many times people tend to use the javascript alert() function. The notification it shows looks different depending on the browser. Lungo has a notification system that shows pretty and responsive notifications styled in the same way in all the browsers, making your app look the same no matter the browser you use.

show()

Shows a customized notification.

Parameters

string:     The icon, null for no icon.
string:     Notification's title.
number:     Seconds to show the notification, 0 for unlimited.
function:   A function to execute when hiding the notification.

If you call to the show function without parameters it will show a loading screen

Example

var afterNotification = function(){
    //Do something
};
Lungo.Notification.show(
    "check",                //Icon
    "Success",              //Title
    3,                      //Seconds
    afterNotification       //Callback function
);
//Show loading screen
Lungo.Notification.show();

hide()

Hides the current notification. Example

Lungo.Notification.hide();

success()

Shows success notification.

Parameters

string:     Notification's title.
string:     Notification's description.
string:     The icon, null for no icon.
number:     The time to show the notification, 0 for unlimited.
function:   A function to execute when hiding the notification.

Example

var afterNotification = function(){
    //Do something
};
Lungo.Notification.success(
    "Success",                  //Title
    "Successful operation",     //Description
    "check",                    //Icon
    7,                          //Time on screen
    afterNotification           //Callback function
);

error()

Shows an error notification.

Parameters

string:     Notification's title.
string:     Notification's description.
string:     The icon, null for no icon.
number:     The time to show the notification, 0 for unlimited.
function:   A function to execute when hiding the notification.

Example

var afterNotification = function(){
    //Do something
};
Lungo.Notification.error(
    "Error",                      //Title
    "Unsuccessful operation",     //Description
    "cancel",                     //Icon
    7,                            //Time on screen
    afterNotification             //Callback function
);

confirm()

Shows a confirmation notification.

Parameters

object:     An object with the notification's config.

Example

Lungo.Notification.confirm({
    icon: 'user',
    title: 'Title of confirm.',
    description: 'Description of confirm.',
    accept: {
        icon: 'checkmark',
        label: 'Accept',
        callback: function(){ alert("Yes!"); }
    },
    cancel: {
        icon: 'close',
        label: 'Cancel',
        callback: function(){ alert("No!"); }
    }
});

html()

Creates a notification using your own html code.

Parameters

string:     The html code for the notification.
string:     The closing button text.
string:     Specific style for notification
number:     The time to show the notification, 0 for unlimited.

Example

Lungo.Notification.html('<h1>Hello World</h1>', "Close");

push()

Creates a non-obstructive notification

Parameters

string:		Notification's title.
string:		The icon, null for no icon.
string:		Specific style for notification

Example

Lungo.Notification.html('<h1>Hello World</h1>', "Close");

.Router

Lungo.Router provides the user with the neccesary functions to manage the navigation through javascript. The following functions allow developers to work with the navigation through sections, articles and also asides.

section()

This function allows the navigation from a section to another one. It is done to navigate forward to a section, if you want to go back to a previous one you have to use the back function which will be explained later.

Parameters

string:     The section's id.

Example

Lungo.Router.section("features");

article()

Displays the <article> in a particular <section>.

Parameters

string:		The section id
string:     The article's id.

Example

Lungo.Router.article("my-section", "my-article");

back()

Lungo uses the bread crumb pattern, so to return to a previous section you have to use the Lungo.Router.back function.

Example

Lungo.Router.back();

. aside

The <aside> element has a different behavior to article and section since its display is combined with them. For that reason Lungo offers specific methods:

show()

Display an aside element

Parameters

string:		<aside> id

Example

Lungo.Aside.show("my-aside");

hide()

Hide current aside element Example

Lungo.Aside.hide();

toggle()

Toggle an aside element

Parameters

string:		<aside> id

Example

Lungo.Aside.toggle("my-aside")

.Article

Since version 2.2 (Brownie) Lungo has a new namespace to control <article> element.

clean()

Clean the content of a particular article with a specific markup

Parameters

string:		<article> ID
string:		Icon
string:		Title
string:		Description [OPTIONAL]
string:		Button label [OPTIONAL]

Example

Lungo.Article.clean("my-article", "user", "Title", "Description", "Refresh")

.Service

Lungo can also make ajax requests to web services.

Settings

Object containing the ajax configuration.

Example

Lungo.Service.Settings.async = true;
Lungo.Service.Settings.error = function(type, xhr){
    //Do something
};
Lungo.Service.Settings.headers["Content-Type"] = "application/json";
Lungo.Service.Settings.crossDomain = false;
Lungo.Service.Settings.timeout = 10;

get()

Load data from the server using a HTTP GET request.

Parameters

string:     The URL to which the request is sent.
object:     A map or string to to the server.
function:   [OPTIONAL] Callback function. (Asynchronous)
string:     [OPTIONAL] Mime-Type: json, xml, html, or text.

Example

var url = "http://localhost:8080/myService";
var data = {id: 25, length: 50};
var parseResponse = function(result){
    //Do something
};
Lungo.Service.get(url, data, parseResponse, "json");
//Another example
var result = Lungo.Service.get(url, "id=25&len=50", null, "json");

post()

Load data from the server using a HTTP POST request.

Parameters

string:     The URL to which the request is sent.
object:     A map or string to send to the server.
function:   [OPTIONAL] Callback function. (Asynchronous)
string:     [OPTIONAL] Mime-Type: json, xml, html, or text.

Example

var url = "http://localhost:8080/myService";
var data = {id: 25, length: 50};
var parseResponse = function(result){
    //Do something
};
Lungo.Service.post(url, data, parseResponse, "json");
//Another example
var result = Lungo.Service.post(url, "id=25&len=50", null, "json");

json()

Load data from the server using a HTTP GET request and mime-type JSON.

Parameters

string:     The URL to which the request is sent.
object:     A map or string to send to the server.
function:   [OPTIONAL] Callback function. (Asynchronous)

Example

var url = "http://localhost:8080/myService";
var data = {id: 25, length: 50};
var parseResponse = function(result){
    //Do something
};
Lungo.Service.json(url, data, parseResponse);
//Another example
var result = Lungo.Service.json(url, "id=25&len=50");

cache()

Auto-caching system with date pattern for HTTP GET requests.

Parameters

string:     The URL to which the request is sent.
object:     A map or string to send to the server.
string:     Date pattern (example: 15 minutes, 1 hour, 3 days).
function:   [OPTIONAL] Callback function. (Asynchronous)
string:     [OPTIONAL] Mime-Type: json, xml, html, or text.

Example

var url = "http://localhost:8080/myService";
var data = {id: 25, length: 50};
var parseResponse = function(result){
    //Do something
};

Lungo.Service.cache(url, data, "2 hours", parseResponse, "json");

//Another example
var result = Lungo.Service.cache(
    url,
    "id=25&len=50",
    "2 hours",
    null,
    "json"
);

lungo.js's People

Contributors

soyjavi avatar pinaypunto avatar jorgecasar avatar daithiw44 avatar 1m4n0l avatar zodman avatar radare avatar mbonano avatar martinciu avatar johnmclear avatar jacen avatar abossard avatar germandz avatar nickel avatar kylesuss avatar rwillmer avatar abstractcoder avatar alcedo avatar imyelo avatar

Stargazers

Monir Saikat avatar Sirawit avatar Frank WMM avatar  avatar Asher avatar  avatar Jonathan avatar iBNu Maksum avatar dà fǎ shī avatar  avatar Keri Lynn avatar Seth avatar pedoc avatar Jamie Sparks avatar Yasin ATEŞ avatar  avatar  avatar Lamhot Simamora avatar Gilles Bandza avatar Igor Zollim Silveira avatar 种千煅 avatar Francisco Olvera avatar  avatar Matthew Malone avatar Cat  avatar Jeroen Peters avatar Sanjay avatar vulcangz avatar Carl V. Lewis avatar Elevated Media Design Group avatar Esteban avatar Malte Schlünz avatar U.M Andrew avatar JamesLinus avatar Ravi Varma Polakonda avatar Lucas zapico avatar coffeant avatar Sir Duderick Longfellow MacDudington avatar Efrem Ropelato avatar aqing avatar Jeffrey Xavier avatar zhangzheng avatar Javier Diaz avatar  avatar Luis Morales avatar gasolier avatar R. Allen Snider avatar Alex Crocker avatar jarzzzi avatar  avatar  avatar hotuta avatar Yılmaz Demir avatar Nadeem Jabbar Qureshi avatar Josh Brown avatar  avatar Robert ten Wolde avatar Xiaonan Cui avatar Ben John avatar  avatar BigFaceMaster avatar azcraze avatar Nikola Jankovic avatar Vas Kaloidis avatar Alexandre Nicastro avatar  avatar Alireza Jahanshahlou avatar ecomarine avatar  avatar Oleh Pshenychnyi avatar Brooklyn Embassy avatar 信鸽相知 avatar DAGE avatar Gustavo guga avatar César D. Rodas avatar Summers avatar sai avatar Alex Nolasco avatar  avatar Lars Hampe avatar Jack Wang avatar Taka avatar Max Grom avatar Vinayak Kulkarni avatar chenyh2 avatar 咕噜丹 avatar Damien Galan avatar westinyang avatar  avatar Fay avatar 封厂长 avatar 轩辕小熊 avatar Jesús Rafael Zúñiga Castro avatar  avatar Suchan An avatar  avatar Rob B. avatar Hai avatar Lengxu avatar  avatar

Watchers

[0] avatar arden avatar Jash Sayani avatar zbage avatar jimxl avatar Jose Fortes avatar murat kgirgin avatar Yubo avatar sharper avatar  avatar Eusthace Corin avatar  avatar tom zhou avatar  avatar Andre Cassal avatar Fadzril Muhamad avatar Ahmed Abu Eldahab avatar Richard Hess avatar Alfredo Llanos avatar roadlabs avatar  avatar Deian avatar Vladimir Minkin avatar Nico Sap avatar ABMS avatar Carlos Eugenio Torres avatar Neallin avatar alwayrun avatar  avatar  avatar Emmanuel Ay avatar Jose Vicente avatar Michal Kechner avatar  avatar Ika Wu avatar Julen Garcia Leunda avatar gustavo ascencio avatar noel avatar Juan Pastor avatar Kesymaru avatar Boudy de Geer avatar Andrew Cargill avatar iBNu Maksum avatar  avatar Goutam Dey avatar James Cloos avatar Jedidiah Hurt avatar Hudson Antonio avatar Danilo Strazzullo avatar Zhao avatar hunslater avatar vincent guo avatar Dejian Xu avatar  avatar Vian avatar Liangdi avatar Selim Özergün avatar WangJunKai avatar Mauricio  padilla avatar Kossi Selom Banybah avatar purwandi avatar  avatar Fabio Fumis avatar  avatar Ranjit Thakur avatar Jose López Gonzálvez avatar Víctor Téllez avatar Bruse Johnas avatar noyzilla avatar  avatar Kares avatar  avatar  avatar Mike Yan avatar David Zapatería Besteiro avatar Andrea Greco avatar Moisés Cruz avatar 陈达 avatar  avatar zhaozhiguang avatar kcloze avatar Denis Stoyanov avatar Michael Anthony avatar  avatar  avatar  avatar wang weixiong avatar  avatar  avatar  avatar Miguel Ceballos avatar 栀子花,香... avatar  avatar Acemir Sousa Mendes avatar zxlong avatar Fapes avatar Pandiyaraja Ramamoorthy avatar yongchao avatar Tony avatar Yifu Guo avatar

lungo.js's Issues

Blackberry icons problem

Al visualizar el primer ejemplo de los vídeos tutoriales de Vimeo desde una Blackberry 9300 (versión 6.0) no carga los iconos correctamente:

  • data-icon="cloudup"
  • data-icon="user"
  • data-icon="config"

En vez de esos iconos muestras letras Y, C, L.

Un saludo.

Scroll Android

I almost finish my first mobile site with Lungo. It is awesome.

I am having a problem with the scroll in Android (2.2), it is only on the native browser, on Firefox it works. It is working perfect in iPhone 4S, iOS 5.

This is my code:

I add elements to this scroll using Javascript.

Uncaught TypeError: Cannot call method 'trigger' of undefined

Hi, i'm just downloaded and unzipped 1.1.2 version.

I've uncomment app info at app.js and load index.html with Chrome (or iPhone Simulator) and doing a longTap i've this error:

Using packet versión:

lungo-1.1.2.packed.js:51 Uncaught TypeError: Cannot call method 'trigger' of undefined

Using development version:

QuoJS.js:1102 Uncaught TypeError: Cannot call method 'trigger' of undefined

If a text is long enough you cannot see the whole text in a <li>

I have been doing some apps with your framework and I have one thing to say to you: awesome!

I have found a problem which I don't know if I could solve on my own, I think I couldn't do it well. Well, the problem is that if you have a list item element with a long text, you would not be able to see the whole text.

For example:
http://imageshack.us/photo/my-images/855/screenshot5ci.png/

This example is not that bad, but, when I test the app in an iphone, as the screen is smaller, there's always a lot of text out of the screen.

I don't know why this problem happens and don't know how it could be solved, but I'm trying it.

Thanks

Checkboxes

I'm pulling my hairs trying to use some checkboxes on a list but it's not working.
Do you guys have any ideas or is it just a bug?

Thanks in advance!

Scroll para datos externos ajax

tengo un pregunta tengo una sección donde los datos son llamados atreves de ajax, pero cuando los datos son demasiados largos este hace scroll, si no que simplemente corta hasta donde alcance la pantalla, cual es el procedimiento para darle scroll a un articulo que inicia vació pero después de una llamada se le insertan datos?

asynchronically loaded lists

I load some data with lng.Service.get from a JSON file and then generate an HTML list with common javascript.
There's my code:

lng.Service.get(url, '', function(response) {
            for (i in response.apartment){
                name=response.apartment[i]['@attributes']['name'];
                liStr += '<li data-icon="home">\n';
                liStr += '  \t<strong>'+name+'</strong>\n';
                liStr += '</li>';
            }
            liStr += '</ul>'
            document.getElementById('apart_list').innerHTML=liStr;
        });

The HTML code is generated fine, but it doesn't show the icons and doesn't scroll, I think it's because the "data-icons" are parsed only once when the app is loaded.
There is any solution or i have to add the <span class="icon home"></span> manually? Thanks!

footer tab bar hides the top header title

when you create a simple tab bar app, and you move from tab to tab, it hides the top section header (even though data-title is not empty in the links), and makes an ugly space under the tab bar.

data-search =

In an Article of class .list where data-search is set there are the following issues.

Issue 1. The LUNGO.Attributes.Data for 'search' will return the li and its not inside a <ul>

    search: {
     tag: 'search',
     selector: '.list',
     html: '<li class="search {{value}}"><input type="search" placeholder="Search..."><a href="#" class="button" data-icon="search"></a></li>'
 },

Is the intention to have this as part of the list being created or to be inside its own <ul>?

Issue 2. When build a article of class .list dynamically from a template with data-search the ul placeholder will never be build because of the following function

var _createListElement = function(article) {
// The data-search will already have created a child
if (article.children().length === 0) {
var article_id = article.attr('id');
article.append('<ul id="' + article_id + '_list"></ul>');
}
};

the article with the attribute data-search will already have children as when the page is being rendered the lng.View.Template.Binding.dataAttribute(element, attribute) will create an innerHTML for LUNGO.Attributes.Data.search and so the < ul> will never be built and so there will be no element to attached scrolling or the template to.

Suggestion.

  1. On LUNGO.Attributes.Data search.

Be good to give both the 'input box' and the 'a href' an id based on the article id so that its easy to add events to the buttons. So something like:

"<li class="search {{value}}"><input type="search" id="search_{{ article_id}}" placeholder="Search..."><a href="#" class="button" data-icon="search" id="sbtn_{{ article_id}}"></a></li>"

and also what might be the easiest way out would be to have the following

OPTION A)
A separate ul for the search

"<ul id="searchul_"{{article_id}}><li class="search {{value}}"><input type="search" id="searchtext_{{ article_id}}" placeholder="Search..."><a href="#" class="button" data-icon="search" id="searchbtn_{{ article_id}}"></a></li></ul>"

Give the template the articleid appending to a string for the ul, the input box and the a href search button. This will make attaching events to these elements easier.

ul has id = 'searchul_' + articleid
input box has id = 'searchtext_' + article_id
search button has id = 'searchbtn_' + article

handle the replace inside

var dataAttribute = function(element, attribute) {
var data = element.data(attribute.tag);
if (data) {
// handle the replace for search
if(attribute.tag === 'search'){
var regex;
regex = new RegExp(BINDING_START + 'article_id' + BINDING_END, "g");
var html_binded = attribute.html.replace(regex, element.attr('id'));
html_binded = html_binded.replace(BINDING_START + 'value' + BINDING_END, data);
}
else{
var html_binded = attribute.html.replace(BINDING_START + 'value' + BINDING_END, data);
}
element.prepend(html_binded);
}
};

Then make a change in function createListElement to check if there is 1 child we'll know the id format node type etc of the 1 child and if so create the new ul and append it to the article.

OPTION B)
The other option is to create the ul from the data-search

"<ul id="{{article_id}}list"><li class="search {{value}}"><input type="search" id="searchtext{{ article_id}}" placeholder="Search..."><a href="#" class="button" data-icon="search" id="searchbtn_{{ article_id}}"></a></li></ul>"

only problem here is when we build our li element via template we clear the contents of the ul and hence remove the search li. so there would be more work here, especially if adding and removing li elements based on the filter.

I've implemented Option A) locally and will test shortly, I'll commit it to my fork

daithiw44@740759b
if you're interested in that as a fix and see if you want it as a pull request.

Let me know what you think or if you need more information.

Daithi

Calendar icon doesn't work

The calendar class doesn't shows the calendar icon. I've tried with other icons and they work fine, but the calendar one doesn't show up.

Vector Graphics not showing on IOS

Hello,

Just found Lungo.js this morning...this looks pretty cool. Just loaded things up a started playing with it and I noticed that the vector graphics are not showing up in my application. For instance, when I set the 'data-icon' to 'home', all that displays is the letter H rather than the house graphic. I am testing on an Apple iPhone 3GS with IOS 4.x. Can you tell me what I am doing wrong?

data-icon css in header should be similar to data-back

Hi

Not sure if it's the desired behavior, but if you use data-icon in a header tag, you get the icon, but without all the 'cool' css applied so it's very small by default, unlike you (I) would expect. If you place an anchor with data-back, icon looks good.

Bug in documentation about Template#binding

Hi!

First at all, nice work! I'm really enjoying to play with your framework.

I was trying to bind a template to a div but, as I see in the documentation, I should try with:

  lng.View.Template.binding('main', 'pending-tmp', data);

But I only got errors. Looking in the source code, I saw that the way is:

  lng.View.Template.Binding.create('main', 'pending-tmp', data);

Am I right?

Thank you again!

Swipe left on ios

On IOS devices it is possible to swipe left to see other sections that should not be available to the user before clicking a button. It is possible i have misunderstood something, but since there is so little documentation and no forum i'm making an issue out of it.

On android it works just fine.

How to reproduce:
Make several sections, after loading the first, swipe left.

<footer class="toolbar"> back from landscape mode

Al probar desde mi Android 2.3.5 (LG 2X) (CM7) al entrar en modo "landscape" cargando el "footer" como "toolbar" y volver al modo vertical, los iconos del ejemplo del primer video tutorial que tenéis en Vimeo mantienen la disposición de cuando se encuentran en "landscape" por lo que solo se ve el primer icono y la mitad del segundo.

Un saludo.

Excelente trabajo ;)

issues around navigation

Trying to use the JS api to navigate from the console, some problems getting going:

  • black screen

the router can find the sections i want, and the first call often works ok.
but then subsequent navigating just gives a totally black screen.
i cant really see a pattern. same section is OK sometimes, but often not.
this usually happens on 2nd/3rd api call, so its not a buried issue.

LUNGO.Router.History.current()
"#home"
LUNGO.Router.section("barracks")
undefined
LUNGO.Router.section("home")
undefined
  • targeting articles isn't working?
    using as per:

LUNGO.Router.article("barracks", "detail");

where i know these two exist, i get:

Lungo.Router ERROR: The target barracks articledetail does not exists.

Are there some other methods to navigate the DOM and see what lungo does know about?

thanks!

Injecting new Sections to DOM

Hello,

I have the following case:

I have to inject new sections to the DOM. So I do:

$('body').append('my section html');
lng.Boot();
lng.Router.section('my-section-id');

If there is no active section (at startup) everything is working good. But if there are sections and one of them is active the existing section is still visible. I have an ugly workaround for it but the transition is not very nice when doing this:

$('body').append('my section html');
lng.Boot();
lng.Router.section('my-EXISTING-section-id');
lng.Router.section('my-NEW-section-id');

Probably it would be good to add a function that extends only new elements and not the whole DOM. It is strange to call lng.Boot() when the app is still running...

Do you have an idea?

Cheers
Philipp

No changes by setting value for input-fields via script

Hi,

No changes in view when:

$('#my_input_field').attr('value', '');

or

$('#my_input_field').attr('value', 'test');

or

$('#my_input_field').removeAttr('value');

(the code was updated as expected so zepto does his job)

My Device: HTC HD 2 with Android

regards
chris

version 1.1.2 works only in the packed file

Hi, I've been using your framework for a while, I love it, but I think there are some incongruous variations between the files you uploaded. I don't think you should call "stable" a release and having only the packed version working (for a non-defined Quo object following my debug in all the other files, min included) and with a couple of bugs here and there, like at line 73 of the packed version where you find:
a.dom(c).addClass(d.SHOW);
I believe it should be:
a.dom(c).addClass(d.SHOW);a.dom(c).removeClass(d.HIDE);
Doing that you can come back to a slide you saw before.
Now I got a problem I can't fix, using "scrollable" as a class in a article my header become scrollable (???) and 134px high.
If there are some debugs in progress can I ask you which version you can call stable and I could use in production?
Hope the hint for the line 73 I posted above can help.

Thanks for the GREAT job anyhow, I love your framework but I believe should be more clear the connection with Quojs, I used its API to learn how to use Lungo, but well, all can be improved and you are 99% done for what I saw!

BTW: what's sugar? That's not clear to me
Goodbye!

Swipe events doesn't work on event listeners

If I added on my event.js a listener like:

lng.dom('article#id').on('swipeDown', function(){
   //Some code
});

The listener is never called, but the event is captured from QuoJS (it writes "Event swipeDown captured." message on console).

If I change the event type from 'swipeDown' to 'tap', the event listener is called correctly.

UPDATE:

In LungoJS 1.1.2 (QuoJS 1.0) swipe events only works in mobile environments!

Checkboxes y Radio Buttons

Hola estoy probando el framework (muy buen trabajo hasta ahora) y quise experimentar con los elementos de formulario y noté que los elementos "checkbox" y "radio" parecen no funcionar correctamente.

Al ver el código CSS ambos elementos tienen "opacity:0;"

¿Esto es correcto?¿Aún no están dando soporte a estos elementos o es un simple "bug"?

Este es el código de muestra que se encuentra en el Sitio:
`


````


Save credentials
<textarea placeholder="Textarea sample"></textarea>

One Two Three

Tap on Selectboxes not working proper

Hi,

I have a form with several input, select and button-elements.
When I try to tap on a selectbox, another will pop up or nothing happens.

It seems the clickable/tapable area is anywhere but not at the element.

Second issue:
When I select an option on a selectbox, the selectbox will not update its value.

The operating system is Android 2.2

Cheerz

Problem with select (websql)

Hi,

Im playing with WebSQL features and I have a problem, I cannot get the results...

This is my code:

var selectTask = function(data){

        var datos = [];

        lng.Data.Sql.select('tasks', {done: 0}, function(result){

            for (var i=0; i < result.length; i++) {
                datos.push({
                    id: result[i].id,
                    name: result[i].name,
                    description: result[i].description
                });
            }

            lng.Core.log(1, "Antes: " + datos.length);

        });

        lng.Core.log(1, "Despues: " + datos.length);

        return datos;
    };

All I get is:
Antes: 2
Despues: 0

Any idea ?

Thanks!

Article in template

I would like it to be easier to work with articles in templates. In my case i have a section, to which a template outputs a number of articles, and in the footer i'd like to have the navigation to these articles.

I was able to get it to almost work, but it was unnecessarily difficult, and i didn't get it to work on android at all.

Maybe somekind of LUNGO.Refresh() function, that you can call when stuff has happened in the dom that would require lungo to read it again and do its magic?

An example for this case in the documentation would also be nice, since i think its a pretty common scenario, get a bunch of stuff from remote server, swipe left to scroll through them.

lng.Dom.Event.live doesn't work on iPad

Hi! it seems lng.Dom.Event.live() does not work on iPad, i don't tested it on iPhone...
Here the code I used to test this issue:

index.html (all the content inside <body> tags)
<section id="section1"> <header data-title="Section 1"></header> <article class="list"> <ul> <li class="link_li" data-icon="home"> <strong>Content</strong> <small>Extra info</small> </li> <li class="link_li_live" data-icon="home"> <strong>LIVE</strong> <small>Extra info</small> </li> <li class="link_li" data-icon="home"> <strong>Content</strong> <small>Extra info</small> </li> <li class="link_li_live" data-icon="home"> <strong>LIVE</strong> <small>Extra info</small> </li> </ul> </article> <footer></footer> </section> <section id="section2"> <header data-title="Section 2"></header> <article> <br/> <h1>This is section 2</h1> <a href="#section1" data-target="section" class="button red big">Link to list</a> </article> <footer></footer> </section>

events.js
lng.Dom.Event.live('.link_li_live', 'TAP', function(event) { lng.Router.section('section2') }); lng.Dom.Event.bind('.link_li', 'TAP', function(event) { lng.Router.section('section2') });

Tested on Chrome 16.0.912.63 m, Android 2.2 and iPad2 Safari, It only fails on iPad

SplitView

I think that Split View may be interesting, with this little code we can see an example, try only on tablets.

section.split article {
  margin-left: 20%;
}

section.split nav {
  width: 20%;
  top: 40px;
  position: absolute;
}

section.split nav a {
  height: auto;
  width: 100%;
  text-align: left;
}
%section#welcome.split
  %header{"data-title" => "Welcome"}

  %nav
    %scroll#options_scroll
      %a.current{:href => "#"} option 1
      %a.current{:href => "#"} option 2
      %a.current{:href => "#"} option 3

  %article
    %a.section.button.big{"data-icon" => "facebook", :href => "#events"} Facebook Login
    %a.section.button.big{"data-icon" => "home", :href => "#events"} Twitter Login
    %a.section.button.big{"data-icon" => "help", :href => "#events"} About

Show or hide the menu based on the width of the device can easily be done by javascript.

But most importantly, Do you consider Lungojs should be directed to tablets?

Problema en aside lungo 1.0.4

Hola Javi, estoy experimentando problemas al usar la feature aside de lungo.
Cuando pulso el botón para que se expanda el aside izquierdo y intento hacer scrolldow o scollup, se cierra el aside de forma brusca sin dejar hacer el scroll, cómo ya te he dicho.
Lo estoy probando en el iphone físico.
Probándolo en Safari con agente de usuario iPad, funciona bien.
Por cierto, con el Kitchen Sink también me pasa... NO puedo hacer scroll en el aside... se cierra.

Data-icon on Android Browser

While testing your framework under my android tablet I stumbled across a rather odd behaviour:
all elements with a declared data-icon got and alphanumeric equivalent instead of the awaited icon.
For example: Home became the letter ''H', user 'U', refresh '0', storm 'e', trash '#'... etc.
Well, actually, any element with a class 'button', got its letter/character equivalent.

Of course, I also tested it with Firefox and Dolphin with the same results.

Thanks and keep up the good work!

Jumi

templates and Nested JSON Objects

I have pushed to my repo the following addition to allow nested variables be access from templates.

Changes here If you want

https://github.com/daithiw44/Lungo.js/blob/14a428460b923568d41bcfcc787105af8ec170bf/src/view/Lungo.View.Template.Binding.js

Allows the following for example.

lng.View.Template.create('broadcasthist','

  • @{{property[0].nestedproperty[0].value}}
  • ');

    As some object could be big it does not recursively run through the object but rather follows the path of each property and its child.

    I found the change easy to work with JSON objects and templates.

    Thanks

    Aside and search

    Cuando el Aside esta desplegado la lupa del search no se ve. Para telefonos no es problematico ya que se puede contraer el aside, pero para tables no puedes hacer click en la lupa.

    When Aside is shown the icon for search is not showed. For smartphones is not a problem becouse aside can he hidden, however for tablets you cannot click on the search icon.

    (Tested on Chrome 16.0.912.63 m by making the screen small-big)

    Focus on desktop?

    Hi, me again :P.
    When twitter bootstrap appears, I was used as a base template for a new project (backend webapp).
    I'm wondering if you're focus also in a desktop or big-tablet marketplace.

    Thanks!

    Considering a mix with Backbone.js

    Hi, I've recently met your project and I find it really awesome (thanks to the screencasts :P).

    I'm considering jQuery mobile for my next projects, but with your project, I have doubts... :)

    I'm worried about the template and server communication.

    I'm using Backbone (http://documentcloud.github.com/backbone/) a lot with a couple of projects, and I think is a MUST for some functionalities.

    I don't know if you plan to be templates and server-side data-retrieval agnostic or will implement it as the core system.

    Backbone use underscore.js, that use a system for templates, but also there's a jQuery tmpl in the place....

    What are your focus for this issues? (template system and REST services data retreival).

    PD: Backbone has a View element that use a event system, router system and so on...
    PD: Sorry if it's not the right place for this question.

    Salut! des de Barcelona.

    index icon shows info icon

    it seems strange, but reading lung-1.0.0.min.css I see this:
    icon.index:before{content:'i';}

    And it is the same than icon.info.before, so, it shows "info" icon:
    icon.info:before{content:'i';}

    But reading the TTF file, it seems that it should be an "index" icon.

    So, it seems, it should something like:
    icon.index:before{content:'l';}

    This also solves the "calendar" icon issue

    Error al mostrar datos String Solo números.

    Buenos dias Javi,
    No he tenido tiempo de revisarlo, pero el problema es que tengo una vista creada en la que muestro un codigo de un Empleado, que solo tiene números, por ejemplo 0002, Lungo automáticamente lo parsea y te muestra un 2.
    Entiendo que no debería hacerlo.

    Typo

    Small issue, but the color articblue is misspelled and should be arcticblue. :)

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.