Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:joshfire/joshfire-framework

  • Loading branch information...
commit 614645df78c07f1bef6f50dcf2a1f133125fc449 2 parents 12f5851 + 5a9c586
@sylvinus sylvinus authored
View
2  doc/content/gettingstarted/firstapp1.html
@@ -4,7 +4,7 @@
<p>Let's learn by example.</p>
-<p>The framework enables your to quickly build applications targeting several platforms including tablets, mobile phones, TVS, etc. Compatible devices depends on which adapters you use (and build).</p>
+<p>The framework enables you to quickly build applications targeting several platforms including tablets, mobile phones, TVS, etc. Compatible devices depends on which adapters you use (and build).</p>
<p>In this tutorial, we'll walk you through the creation of a basic application displaying a Rss feed.</p>
View
17 lib/adapters/ios/inputs/touch.js
@@ -41,16 +41,29 @@ Joshfire.define(['joshfire/input', 'joshfire/class', 'joshfire/vendor/zepto'], f
if ($(target).attr('data-josh-ui-path')) {
var elt = self.app.ui.element($(target).attr('data-josh-ui-path'));
if ((!elt.hasScroller && e.type!="click" && e.type!='touchstart') || (e.type=="click" && elt.hasScroller)) {
- self.app.ui.element($(target).attr('data-josh-ui-path')).publish('input', ['enter', $(target).attr('data-josh-grid-id'), this], true);
+ elt.publish('input', ['enter', $(target).attr('data-josh-grid-id'), this], true);
}
break;
}
}
});
+
+ //Swipe(s) only for touch devices
+ if (hasTouchEvent){
+ $(window).live('swipeLeft swipeRight swipeUp swipeDown', function (e){
+ for (var target = this; target && target != document; target = target.parentNode) {
+ if ($(target).attr('data-josh-ui-path')) {
+ var elt = self.app.ui.element($(target).attr('data-josh-ui-path'));
+ elt.publish('swipe', [e.type.replace(/swipe/,'').toLowerCase(), $(target).attr('data-josh-grid-id'), this], true);
+ break;
+ }
+ }
+ });
+
+ }
callback(null);
}
});
-
});
View
1  lib/adapters/node/uielements/panel.manager.js
@@ -13,7 +13,6 @@ Joshfire.define(['../../../uielements/panel.manager', 'joshfire/class', 'joshfir
return Class(PanelManager, {
-
route: function(route) {
var self = this;
View
14 lib/uielement.js
@@ -160,20 +160,6 @@ Joshfire.define(['joshfire/main', 'joshfire/class', 'joshfire/mixins/pubsub', 'j
});
});
}
- /*
- if (self.options.uiDataPathSync) {
- self.app.ui.fetch(self.options.uiDataPathSync,false,function() {
-
- var master = self.app.ui.element(self.options.uiDataPathSync);
- master.subscribe('state', function(ev, data) {
-
- if (data[0]=="dataPath") {
- self.setDataPath(data[1]);
- }
- });
- });
- }
- */
if (typeof self.options.dataPath == 'string') {
self.setDataPath(self.options.dataPath);
View
28 lib/uielements/form.js
@@ -0,0 +1,28 @@
+/*!
+ * Joshfire Framework 0.9.1
+ * http://framework.joshfire.com/
+ *
+ * Copyright 2011, Joshfire
+ * Dual licensed under the GPL Version 2 and a Commercial license.
+ * http://framework.joshfire.com/license
+ *
+ * Date: Wed Jul 20 20:23:43 2011
+ */
+
+Joshfire.define(['joshfire/uielement', 'joshfire/class'], function(UIElement, Class) {
+ /**
+ * @class Panel base class
+ * @name uielements_panel
+ * @augments uielement
+ */
+ return Class(UIElement,
+ /**
+ * @lends uielements_panel.prototype
+ */
+ {
+ type: 'Form',
+
+
+ }
+ );
+});
View
15 lib/uielements/forminput.js
@@ -29,6 +29,7 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
* <li>required {Boolean}: false</li>
* <li>placeholder {String}: ''</li>
* <li>autofocus {Boolean}: false</li>
+ * <li>maxlength {Number}: 0 (unlimited)</li>
* <li>value {String}: ''</li>
* </ul>
* @function
@@ -41,6 +42,7 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
'required': false,
'placeholder': '',
'autofocus': false,
+ 'maxlength': 0,
'value': ''
});
},
@@ -53,13 +55,6 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
var self = this;
self.__super();
- /* self.subscribe('input', function(ev, data){
- if (data[0]=='enter'){
- // self.focus();
- self.app.ui.setState('focus', self.path);
- }
- });*/
-
self.subscribe('afterInsert', function() {
$('#' + self.htmlId + '_input').bind('focus', function() {
self.app.ui.setState('focus', self.path);
@@ -70,7 +65,7 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
/**
* The html rendering of an input and its label. &lt;input type={this.inputType} required? value={this.value}&gt;
* @function
- * @return {String} a classic &lt;input type=text|email|url|password /&gt;.
+ * @return {String} a classic &lt;input type=text|email|url|password|textarea /&gt;.
*/
getInnerHtml: function() {
var label = '<label for="' + this.htmlId + '_input">' + this.options.label + '</label>';
@@ -82,6 +77,7 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
'id="' + this.htmlId + '_input" ' +
(this.options.required ? 'required ' : ' ') +
(this.options.autofocus ? 'autofocus ' : ' ') +
+ (this.options.maxlength ? ' onkeyup="this.value = this.value.slice(0, ' + this.options.maxlength + ')" onchange="this.value = this.value.slice(0, ' + this.options.maxlength + ')" maxlength="' + this.options.maxlength + '" ' : ' ') +
(this.options.placeholder ? 'placeholder="' + this.options.placeholder + '" ' : ' ') + ' >' +
this.options.value +
'</textarea>';
@@ -92,8 +88,9 @@ Joshfire.define(['joshfire/uielement', 'joshfire/class', 'joshfire/vendor/unders
(this.options.required ? 'required ' : ' ') +
(this.options.autofocus ? 'autofocus ' : ' ') +
(this.options.placeholder ? 'placeholder="' + this.options.placeholder + '" ' : ' ') +
+ (this.options.maxlength ? ' onkeyup="this.value = this.value.slice(0, ' + this.options.maxlength + ')" onchange="this.value = this.value.slice(0, ' + this.options.maxlength + ')" maxlength="' + this.options.maxlength + '" ' : ' ') +
'value="' + this.options.value + '" ' +
- '/>';
+ '>';
}
return this.template(label + input);
},
Please sign in to comment.
Something went wrong with that request. Please try again.