Pārlūkot izejas kodu

Free load resources :)

soyjavi 13 gadi atpakaļ
vecāks
revīzija
af58fcfba5

examples/kitchen-sink/app/resources/asides/features.html → examples/kitchen-sink/app/asides/features.html


examples/kitchen-sink/app/resources/asides/left.html → examples/kitchen-sink/app/asides/left.html


examples/kitchen-sink/app/resources/asides/right.html → examples/kitchen-sink/app/asides/right.html


+ 0 - 1
examples/kitchen-sink/app/resources/templates/list-home.html

@@ -1 +0,0 @@
-<li id={{id}} data-icon="home">{{name}}</li>

examples/kitchen-sink/app/resources/sections/aside.html → examples/kitchen-sink/app/sections/aside.html


examples/kitchen-sink/app/resources/sections/color.html → examples/kitchen-sink/app/sections/color.html


examples/kitchen-sink/app/resources/sections/data-attribute.html → examples/kitchen-sink/app/sections/data-attribute.html


examples/kitchen-sink/app/resources/sections/form.html → examples/kitchen-sink/app/sections/form.html


examples/kitchen-sink/app/resources/sections/grid.html → examples/kitchen-sink/app/sections/grid.html


examples/kitchen-sink/app/resources/sections/icon.html → examples/kitchen-sink/app/sections/icon.html


examples/kitchen-sink/app/resources/sections/layout.html → examples/kitchen-sink/app/sections/layout.html


examples/kitchen-sink/app/resources/sections/list.html → examples/kitchen-sink/app/sections/list.html


examples/kitchen-sink/app/resources/sections/notification.html → examples/kitchen-sink/app/sections/notification.html


examples/kitchen-sink/app/resources/sections/scroll.html → examples/kitchen-sink/app/sections/scroll.html


examples/kitchen-sink/app/resources/sections/splash.html → examples/kitchen-sink/app/sections/splash.html


examples/kitchen-sink/app/resources/sections/touchevents.html → examples/kitchen-sink/app/sections/touchevents.html


+ 18 - 14
examples/kitchen-sink/index.html

@@ -48,20 +48,6 @@
 </head>
 
 <body class="app">
-    <section id="a">
-        <header data-title="a"></header>
-        <article>
-            <a href="#b" data-router="section" class="button red big" data-label="kakaka"></a>
-        </article>
-    </section>
-
-    <section id="b">
-        <header data-title="b" data-back="home"></header>
-        <article id="b_1">b_1</article>
-        <article id="b_2">b_2</article>
-
-    </section>
-
     <section id="main" data-transition="slide">
         <header  class="">
             <nav class="left button">
@@ -148,10 +134,28 @@
             name: 'Kitchen Sink',
             version: '2.0',
             sugars: ['map', 'pull'],
+            resources: ['app/sections/layouts.html',
+                        'app/sections/notification.html',
+                        'app/sections/list.html',
+                        'app/sections/icon.html',
+                        'app/sections/grid.html',
+                        'app/sections/form.html',
+                        'app/sections/aside.html',
+                        'app/sections/touchevents.html',
+                        'app/sections/splash.html',
+                        'app/sections/data-attribute.html',
+                        'app/sections/scroll.html',
+                        'app/sections/color.html',
+                        'app/asides/features.html',
+                        'app/asides/left.html',
+                        'app/asides/right.html']
+            /*
+            ,
             resources: {
                 sections: [ 'layout.html', 'notification.html', 'list.html', 'icon.html', 'grid.html', 'form.html', 'aside.html', 'touchevents.html', 'splash.html', 'data-attribute.html', 'scroll.html', 'color.html'],
                 asides: ['features.html', 'left.html', 'right.html']
             }
+            */
         });
 
         Lungo.ready(function() {

+ 4 - 15
src/boot/Lungo.Boot.Resources.js

@@ -24,26 +24,16 @@ Lungo.Boot.Resources = (function(lng, $$, undefined) {
      *
      */
     var init = function(resources) {
-        for (resource_key in resources) {
-            _loadResources(resource_key, resources[resource_key]);
-        }
-    };
-
-    var _loadResources = function(resource_key, resources, callback) {
-        for (index in resources) {
-            var url = _parseUrl(resources[index], resource_key);
-
+        for (var i=0, len=resources.length; i < len; i++) {
+            resource = resources[i];
             try {
-                var response = _loadSyncResource(url);
+                var response = _loadSyncResource(resource);
                 _pushResourceInBody(response);
             } catch(error) {
                 lng.Core.log(3, error.message);
             }
-        }
-    };
 
-    var _parseUrl = function(section_url, folder) {
-        return (/http/.test(section_url)) ? section_url : 'app/resources/' + folder + '/' + section_url;
+        }
     };
 
     var _loadSyncResource = function(url) {
@@ -53,7 +43,6 @@ Lungo.Boot.Resources = (function(lng, $$, undefined) {
             dataType: 'html',
             error: function() {
                 console.error(ERROR.LOADING_RESOURCE + url);
-                // throw new Error(ERROR.LOADING_RESOURCE + url);
             }
         });
     };

+ 138 - 0
src/stylesheets/Lungo.layout.nav.css

@@ -0,0 +1,138 @@
+/**
+ * Stylesheet
+ *
+ * @namespace Lungo.Layout
+ * @class Nav
+ *
+ * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
+ */
+/* DIMENSIONS */
+/* COLORS */
+header nav,
+footer nav {
+  height: auto;
+  text-align: center;
+}
+header nav a,
+footer nav a {
+  padding: 0 6px;
+  min-width: 28px;
+  z-index: 1000;
+  float: left;
+  height: 44px;
+}
+header nav a .icon,
+footer nav a .icon {
+  font-size: 1.7em;
+}
+header nav a img,
+footer nav a img {
+  width: 16px;
+  height: 16px;
+  top: -1px !important;
+}
+header nav a abbr,
+footer nav a abbr {
+  font-weight: bold;
+}
+header nav a .bubble,
+footer nav a .bubble {
+  position: relative;
+  top: -12px;
+  left: -12px;
+  margin-right: -20px;
+}
+header nav.groupbar,
+footer nav.groupbar {
+  position: absolute;
+  top: 44px;
+  height: 30px;
+  display: block;
+  width: 100%;
+  z-index: 2;
+  line-height: 30px;
+}
+header nav.groupbar a,
+footer nav.groupbar a {
+  padding: 0px;
+  margin: 0px;
+  font-weight: bold;
+  height: 30px;
+}
+header nav.groupbar a .icon,
+footer nav.groupbar a .icon {
+  font-size: 1.0em;
+}
+header nav.groupbar a .bubble,
+footer nav.groupbar a .bubble {
+  top: -6px;
+  left: 0px;
+}
+header nav.button a {
+  margin: 5px 5px 5px 0;
+  height: 32px;
+  line-height: 32px;
+}
+header nav.button a .icon {
+  line-height: 33px;
+}
+header nav.button a:first-child {
+  margin: 5px;
+}
+header nav .icon ~ abbr {
+  margin-left: 4px;
+  float: right;
+}
+header nav .loading {
+  margin-top: .5em;
+  font-size: 1.6em;
+}
+header nav .loading  + .icon {
+  display: none;
+}
+footer nav a {
+  display: block;
+  padding: 0;
+  height: 44px;
+}
+footer nav .icon {
+  display: block;
+  top: 0px;
+  font-size: 2.0em !important;
+  line-height: 44px;
+}
+footer nav .bubble {
+  top: -42px;
+  left: 4px;
+}
+footer nav .bubble .loading {
+  top: 0;
+  font-size: 1.4em;
+}
+footer nav abbr {
+  display: none;
+}
+footer nav .loading {
+  top: .1em;
+  font-size: 2.3em;
+}
+footer nav.with-labels .icon {
+  line-height: 36px;
+}
+footer nav.with-labels .bubble {
+  top: -34px;
+}
+footer nav.with-labels abbr {
+  display: block !important;
+  position: absolute;
+  top: 30px;
+  width: inherit;
+  height: 14px;
+  margin-left: 0px;
+  display: block !important;
+  font-size: 11px;
+  line-height: 14px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}

+ 1 - 1
src/stylesheets/Lungo.layout.nav.less

@@ -10,7 +10,7 @@
 @import "constants.less";
 @import "mixins.less";
 
-nav {
+header nav, footer nav {
     height: auto;
     text-align: center;