jt-mobile-kit 0.0.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/lib/jt-mobile-kit/version.rb +1 -1
- data/lib/jt-mobile-kit/www_rb/templates/Gemfile +2 -3
- data/lib/jt-mobile-kit/www_rb/templates/component/{custom_component.haml → .gitkeep} +0 -0
- data/lib/jt-mobile-kit/www_rb/templates/hamls/index.haml +30 -0
- data/lib/jt-mobile-kit/www_rb/templates/{js/pages.js → hamls/pages/.gitkeep} +0 -0
- data/lib/jt-mobile-kit/www_rb/templates/js/application.js +39 -10
- data/lib/jt-mobile-kit/www_rb/templates/{pages/_main_page.haml → js/controller/.gitkeep} +0 -0
- data/lib/jt-mobile-kit/www_rb/templates/js/plugins/sms.js +25 -0
- data/lib/jt-mobile-kit/www_rb/templates/js/routes.js +20 -0
- data/lib/jt-mobile-kit/www_rb/templates/lib/js/angular/angular.min.js +159 -0
- data/lib/jt-mobile-kit/www_rb/templates/lib/js/angular/mobile-nav.css +117 -0
- data/lib/jt-mobile-kit/www_rb/templates/lib/js/angular/mobile-nav.min.js +5 -0
- data/lib/jt-mobile-kit/www_rb/templates/lib/js/infrastructure/native.js +21 -0
- data/lib/jt-mobile-kit/www_rb/templates/lib/js/zepto/zepto.js +1884 -0
- data/lib/jt-mobile-kit/www_rb/templates/pages/.gitkeep +0 -0
- metadata +46 -13
- data/lib/jt-mobile-kit/www_rb/templates/_index.haml +0 -14
- data/lib/jt-mobile-kit/www_rb/templates/_pages.haml +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* angular-mobile-nav by Andy Joslin
|
|
3
|
+
* http://github.com/ajoslin/angular-mobile-nav
|
|
4
|
+
* @license MIT License http://goo.gl/Z8Nlo
|
|
5
|
+
*/angular.module("mobile-navigate",[]),angular.module("mobile-navigate").factory("$change",["$q","$rootScope",function(e,t){var n={modal:["modal",""],none:["",""]},r={prefix:"mb-"},i="in",s="out",o="reverse",u="done",a="webkitAnimationEnd";return function(f,l,c,h,p){function g(e){return e.reduce(function(e,t){return e+(t?" "+p.prefix+t:"")},"")}function E(){t.$apply(function(){d.resolve()})}p=angular.extend(p||{},r);var d=e.defer(),v,m,y=n[c]?n[c]:[c,c];f.css("z-index","-100"),f[0].offsetWidth+=0;var b=g([h?s:i,v=y[h?1:0],h&&o||""]);f.addClass(b);var w;l&&(w=g([h?i:s,m=y[h?0:1],h&&o||""]),l.addClass(w)),f.css("z-index",""),f[0].offsetWidth+=0;var S;return v&&v.length?(S=f).bind(a,E):l&&m&&m.length?(S=l).bind(a,E):d.resolve(),d.promise.then(function(){S&&S.unbind(a,E),f.removeClass(b),l&&l.removeClass(w)}),d.promise.cancel=function(){d.resolve()},d.promise}}]),angular.module("mobile-navigate").service("$navigate",["$rootScope","$location","$route",function(e,t,n){function s(e,t,n){var r=e,i=t||"slide",s=n,o;this.transition=function(){var e;return o?(e=o,o=null):e=i,e},this.path=function(){return r},this.reverse=function(){return s},this.transitionOnce=function(e){o=e}}function o(t,n,i){e.$broadcast("$pageTransitionStart",t,n,i),r.current=r.next}function u(e,n,u){r.current&&i.push(r.current),r.next=new s(t.path()),r.next.transitionOnce("none"),o(r.next),r.onRouteSuccess=null}var r=this,i=[];r.onRouteSuccess=null,e.$on("$routeChangeSuccess",function(e,t,n){t.$route&&!t.$route.redirectTo&&(r.onRouteSuccess||u)(e,t,n)}),r.go=function(n,u,a){typeof u=="boolean"&&(a=u,u=null),t.path(n),r.onRouteSuccess=function(e,t,f){r.current&&i.push(r.current),r.next=new s(n,u||t.$route.transition,a),o(r.next,r.current,!1)}},r.eraseHistory=function(){i.length=0},r.back=function(){if(i.length>0){var e=i[i.length-1];return t.path(e.path()),r.onRouteSuccess=function(){i.pop(),r.next=e,o(r.next,r.current,!0)},!0}return!1},(window.cordova||window.phonegap)&&window.device&&device.platform&&device.platform.toLowerCase()=="android"&&document.addEventListener("deviceready",function(){document.addEventListener("backbutton",function(){var e=r.back();e||navigator.app.exitApp()})})}]),angular.module("mobile-navigate").directive("mobileView",["$rootScope","$compile","$controller","$route","$change",function(e,t,n,r,i){function s(s,o,u){function a(e){var i=r.current,a=i&&i.locals;e.element=angular.element(document.createElement("div")),e.element.html(a.$template),e.element.addClass("mb-page"),e.scope=s.$new(),i.controller&&(a.$scope=e.scope,e.controller=n(i.controller,a),e.element.contents().data("$ngControllerController",e.controller)),t(e.element.contents())(e.scope),o.append(e.element),e.scope.$emit("$viewContentLoaded"),e.scope.$eval(u.onLoad)}var f;s.$on("$pageTransitionStart",function(n,s,o,u){function l(){a(s);var t=u?o.transition():s.transition();if(s.reverse()||r.current&&r.current.$route.reverse)u=!u;var n=i(s.element,o?o.element:null,t,u);return n.then(function(){o&&(e.$broadcast("$pageTransitionSuccess",s,o),o.scope.$destroy(),o.element.remove(),o=undefined)}),n}f&&f.cancel(),f=l(s,o,u)})}return{restrict:"EA",link:s}}]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function isOnDevice(){
|
|
2
|
+
return navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function NativeAccess() {
|
|
6
|
+
this.base_access = isOnDevice() ? cordova : new MockedCordova();
|
|
7
|
+
}
|
|
8
|
+
function MockedCordova()
|
|
9
|
+
{
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
NativeAccess.prototype.send_sms = function (receivers, message_content, success_callback, error_callback, context) {
|
|
13
|
+
this.base_access.exec(function (result) {
|
|
14
|
+
success_callback.call(context, result);
|
|
15
|
+
}, function (err) {
|
|
16
|
+
error_callback.call(context);
|
|
17
|
+
}, "MoodeSMS", "send_sms", [receivers, message_content]);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|