Skip to content

Commit 9453993

Browse files
New Release (#239)
* Support float for pixel calculation * Fix border:none * Fix stretching images inside image buttons * Fixing tableview inset bug * Allow video inline play + auto play * allow autoplay + inline play video for background html container * Proper dimension handling for all * Authenticated image fix for preloading * Local variable should be set even before making a change to a form component * Do not pre-render header and footer (Causes crash in some cases) * Fixing header/footer render timing issue * Bugfix for SDWebImageDownloader SDWebImage/SDWebImage#1209 * Fixing tabor extended layout problem * Readme update * Fix bottom padding on tab bar icons * Render even if data is an empty object * Fixing chat input glitch * Fix for when hiding bottom input field * Bottom tab bar should only load with white background when opening modal * Cancel all currently running actions when transitioning away to a different tab * Allow user interaction even when “loading: true” is set * Null fix * Local file support for buttons, images, menus This allows users to use file:// prefix on what used to be all remote files for images within the Jasonette framework so that images files don’t have to be downloaded in cases where it’s static content for the mobile app. * Use UIAlertController instead of a 3rd party library * Use only “title” (not “description”) * Return error values for $network.request * Change NSMutableDictionary to NSDictionary * Local JSON read refactor => moved to helper * local $require support * Local image support for body.style.background + layers.image * Local image support for footer.input * $global * Annotation * $audio.record fix * Added data_uri * $util.share expects NSURL, not NSString * Proper stringified file_url for $media.camera and $media.picker * Fix animated gifs in image components * Animated GIF support for layers, buttons, and background * Tinted image fix * $env * Revert tint to original approach * Fix tinted image memory issue * Added $env.device.language * search bar fix * error.json + loading.json support * Handling cases where the key is a template expression * Default loading:NO => use loading.json instead * Fixing onLoad for loading offline JSON * Exception handling for when $get, $params are not set. * Clear stack&register before $back - see #228 * Tabbar should stick around during loading.json * Remove tab switching delay * Bugfix: loadViewByFile has two types: final and intermediate. * Fix loading issue with header/footer + Diff-based Optimization * Updated policy for $show and $load * Trigger only if an action is not empty * If coming back from a view with no tabs, force-reconstruct tabs * Throw an error to the Jason client on bad URL Any urls that contain bad variable names or other errors just crash the app right now. This would throw error message to the log and error handler. * Handle empty string error for $network.request * JASONResponseSerializer * It’s not final until the view completely finishes loading * Require should end with the same URL it started with * Make sure network actions end with the same url as it started
1 parent 733ea1e commit 9453993

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6369
-6571
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ Create your own native iOS app with nothing but JSON. Then send it over the Inte
1111

1212
Looking for an Android version? [See here](https://www.github.com/Jasonette/JASONETTE-Android)
1313

14-
##★ Jasonette fetches this JSON markup from a server:
14+
## ★ Jasonette fetches this JSON markup from a server:
1515

1616
![json](https://raw.githubusercontent.com/gliechtenstein/images/master/json.png)
1717

18-
##★ And self-constructs into the following native app, in realtime:
18+
## ★ And self-constructs into the following native app, in realtime:
1919

2020
![instagram](https://github.com/Jasonette/Instagram-UI-example/blob/master/images/instagram.gif)
2121

2222
<br>
2323

24-
#Cool things about Jasonette
24+
# Cool things about Jasonette
2525

2626
- **100% NATIVE**: Jasonette maps JSON into native components and native function calls. There is no gimmick. There is no magic.
2727
- **App loads over HTTP**: Your app exists 100% as JSON, and loads from the cloud. No more hard-coding.
@@ -51,7 +51,7 @@ Try playing these on Jasonette and watch them turn into native apps in front of
5151

5252
# Technical Highlights
5353

54-
##1. One JSON to rule them all
54+
## 1. One JSON to rule them all
5555

5656
Jasonette simplifies the entire app building process down to nothing more than:
5757

@@ -69,7 +69,7 @@ This is possible because Jasonette came up with a way to **fit an entire app wor
6969

7070
<br>
7171

72-
##2. App-over-HTTP
72+
## 2. App-over-HTTP
7373
Until now, the only thing JSON could send over the Internet was raw data. Normally apps would fetch remote data from the server for a connected experience, but the actual app logic would be hard-coded on the client side. This makes it hard to update and extend apps.
7474

7575
But what happens when you can express an entire app logic as JSON?
@@ -80,13 +80,13 @@ But what happens when you can express an entire app logic as JSON?
8080

8181
<br>
8282

83-
##3. Designed to be extended or integrated
83+
## 3. Designed to be extended or integrated
8484
Currently Jasonette covers all the essential native APIs and components, which means you can build pretty much any app you can imagine. But Jasonette is very flexible.
8585

86-
###A. Extensible
86+
### A. Extensible
8787
If you don't see a feature you want, you can simply [extend Jasonette](https://jasonette.github.io/documentation/advanced/#extension-vs-integration). If it's useful for the general public, we can even merge it into the core.
8888

89-
###B. Integrate existing code
89+
### B. Integrate existing code
9090
You can even [integrate Jasonette with your existing iOS project](https://jasonette.github.io/documentation/advanced/#extension-vs-integration) if you want. This way you can use Jasonette for just a small part of your app without having to completely switch to a new way of programming.
9191

9292
<br>

app/Jasonette.xcodeproj/project.pbxproj

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
/* Begin PBXBuildFile section */
1010
042852531E984B890081F742 /* NoPaddingButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 042852521E984B890081F742 /* NoPaddingButton.m */; };
11+
043814161EF7455800CC4706 /* JasonGlobalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 043814151EF7455800CC4706 /* JasonGlobalAction.m */; };
12+
045C77E91F0278EA00F06598 /* loading.json in Resources */ = {isa = PBXBuildFile; fileRef = 045C77E81F0278EA00F06598 /* loading.json */; };
13+
045C77EB1F02791D00F06598 /* error.json in Resources */ = {isa = PBXBuildFile; fileRef = 045C77EA1F02791D00F06598 /* error.json */; };
14+
045C77F11F029BEC00F06598 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 045C77F01F029BEC00F06598 /* parser.js */; };
1115
045E5F3D1E3661060088D5E6 /* JasonReturnAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */; };
12-
0489E5CF1E7B3EF40046FFA5 /* parser.js in Resources */ = {isa = PBXBuildFile; fileRef = 0489E5CE1E7B3EF40046FFA5 /* parser.js */; };
13-
04EEDCFE1E02F5180023114F /* demo.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFC1E02F5180023114F /* demo.json */; };
14-
04EEDCFF1E02F5180023114F /* hello.json in Resources */ = {isa = PBXBuildFile; fileRef = 04EEDCFD1E02F5180023114F /* hello.json */; };
16+
04D947EB1F16ACF50063CC65 /* JASONResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */; };
1517
5E09562D1DA33515007ADC78 /* JasonLabelComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E09562C1DA33514007ADC78 /* JasonLabelComponent.m */; };
1618
5E0956301DA34D70007ADC78 /* JasonImageComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E09562F1DA34D6F007ADC78 /* JasonImageComponent.m */; };
1719
5E0956331DA34EEA007ADC78 /* JasonButtonComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E0956321DA34EEA007ADC78 /* JasonButtonComponent.m */; };
@@ -78,11 +80,15 @@
7880
/* Begin PBXFileReference section */
7981
042852511E984B890081F742 /* NoPaddingButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoPaddingButton.h; sourceTree = "<group>"; };
8082
042852521E984B890081F742 /* NoPaddingButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoPaddingButton.m; sourceTree = "<group>"; };
83+
043814141EF7455800CC4706 /* JasonGlobalAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JasonGlobalAction.h; sourceTree = "<group>"; };
84+
043814151EF7455800CC4706 /* JasonGlobalAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JasonGlobalAction.m; sourceTree = "<group>"; };
85+
045C77E81F0278EA00F06598 /* loading.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = loading.json; sourceTree = "<group>"; };
86+
045C77EA1F02791D00F06598 /* error.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = error.json; sourceTree = "<group>"; };
87+
045C77F01F029BEC00F06598 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
8188
045E5F3B1E3661060088D5E6 /* JasonReturnAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JasonReturnAction.h; sourceTree = "<group>"; };
8289
045E5F3C1E3661060088D5E6 /* JasonReturnAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JasonReturnAction.m; sourceTree = "<group>"; };
83-
0489E5CE1E7B3EF40046FFA5 /* parser.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = parser.js; sourceTree = "<group>"; };
84-
04EEDCFC1E02F5180023114F /* demo.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = demo.json; sourceTree = "<group>"; };
85-
04EEDCFD1E02F5180023114F /* hello.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = hello.json; sourceTree = "<group>"; };
90+
04D947E91F16ACF50063CC65 /* JASONResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JASONResponseSerializer.h; sourceTree = "<group>"; };
91+
04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JASONResponseSerializer.m; sourceTree = "<group>"; };
8692
1BD8E8486EE7AF4E4934685E /* Pods-Jasonette.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Jasonette.release.xcconfig"; path = "Pods/Target Support Files/Pods-Jasonette/Pods-Jasonette.release.xcconfig"; sourceTree = "<group>"; };
8793
2F0FCC971E030AF932E421D4 /* Pods_Jasonette.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Jasonette.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8894
5E025B471DE017EB0016786A /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
@@ -217,6 +223,15 @@
217223
name = Pods;
218224
sourceTree = "<group>";
219225
};
226+
043814171EF7455E00CC4706 /* $global */ = {
227+
isa = PBXGroup;
228+
children = (
229+
043814141EF7455800CC4706 /* JasonGlobalAction.h */,
230+
043814151EF7455800CC4706 /* JasonGlobalAction.m */,
231+
);
232+
name = $global;
233+
sourceTree = "<group>";
234+
};
220235
045E5F3E1E36610B0088D5E6 /* $return */ = {
221236
isa = PBXGroup;
222237
children = (
@@ -347,6 +362,7 @@
347362
045E5F3E1E36610B0088D5E6 /* $return */,
348363
5E3177AB1D1F297400D87778 /* $timer */,
349364
5E3177AA1D1F296300D87778 /* $util */,
365+
043814171EF7455E00CC4706 /* $global */,
350366
);
351367
name = Action;
352368
sourceTree = "<group>";
@@ -404,7 +420,7 @@
404420
isa = PBXGroup;
405421
children = (
406422
5E31769B1D1E411E00D87778 /* csv.js */,
407-
0489E5CE1E7B3EF40046FFA5 /* parser.js */,
423+
045C77F01F029BEC00F06598 /* parser.js */,
408424
5E3176F41D1E411E00D87778 /* rss.js */,
409425
);
410426
name = Lib;
@@ -444,6 +460,8 @@
444460
children = (
445461
5E3176D11D1E411E00D87778 /* JasonNetworkAction.h */,
446462
5E3176D21D1E411E00D87778 /* JasonNetworkAction.m */,
463+
04D947E91F16ACF50063CC65 /* JASONResponseSerializer.h */,
464+
04D947EA1F16ACF50063CC65 /* JASONResponseSerializer.m */,
447465
);
448466
name = $network;
449467
sourceTree = "<group>";
@@ -506,9 +524,9 @@
506524
5E3177AC1D1F2A8200D87778 /* file:// */ = {
507525
isa = PBXGroup;
508526
children = (
509-
04EEDCFC1E02F5180023114F /* demo.json */,
510-
04EEDCFD1E02F5180023114F /* hello.json */,
511527
5E31777B1D1F199D00D87778 /* Images */,
528+
045C77E81F0278EA00F06598 /* loading.json */,
529+
045C77EA1F02791D00F06598 /* error.json */,
512530
);
513531
name = "file://";
514532
sourceTree = "<group>";
@@ -727,17 +745,17 @@
727745
5E3177781D1E414C00D87778 /* Media.xcassets in Resources */,
728746
5E3840751D3A3D2200D1C421 /* [email protected] in Resources */,
729747
5E3177291D1E411F00D87778 /* csv.js in Resources */,
730-
04EEDCFE1E02F5180023114F /* demo.json in Resources */,
731748
5E31771E1D1E411F00D87778 /* JasonVerticalSectionItem.xib in Resources */,
732749
5E31777A1D1E4A8E00D87778 /* settings.plist in Resources */,
733-
0489E5CF1E7B3EF40046FFA5 /* parser.js in Resources */,
750+
045C77F11F029BEC00F06598 /* parser.js in Resources */,
734751
5E3177251D1E411F00D87778 /* JasonHorizontalSectionItem.xib in Resources */,
735752
5E3177371D1E411F00D87778 /* icon-info.png in Resources */,
736-
04EEDCFF1E02F5180023114F /* hello.json in Resources */,
737753
5E3177531D1E411F00D87778 /* [email protected] in Resources */,
738754
5E31773A1D1E411F00D87778 /* [email protected] in Resources */,
739755
5E3177671D1E411F00D87778 /* rss.js in Resources */,
740756
5E3177481D1E411F00D87778 /* LaunchScreen.storyboard in Resources */,
757+
045C77E91F0278EA00F06598 /* loading.json in Resources */,
758+
045C77EB1F02791D00F06598 /* error.json in Resources */,
741759
5E3177361D1E411F00D87778 /* [email protected] in Resources */,
742760
5E31775F1D1E411F00D87778 /* [email protected] in Resources */,
743761
5E3177391D1E411F00D87778 /* icon-success.png in Resources */,
@@ -761,7 +779,7 @@
761779
);
762780
runOnlyForDeploymentPostprocessing = 0;
763781
shellPath = /bin/sh;
764-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
782+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
765783
showEnvVarsInLog = 0;
766784
};
767785
4838282BA327C039BDB24767 /* [CP] Copy Pods Resources */ = {
@@ -833,6 +851,7 @@
833851
5E0956421DA34F4D007ADC78 /* JasonSpaceComponent.m in Sources */,
834852
5E3177701D1E411F00D87778 /* UIBarButtonItem+Badge.m in Sources */,
835853
5E0956361DA34EFC007ADC78 /* JasonTextareaComponent.m in Sources */,
854+
043814161EF7455800CC4706 /* JasonGlobalAction.m in Sources */,
836855
5EF904361DD10F7000C8A94E /* JasonLogAction.m in Sources */,
837856
5E3177A31D1F28C100D87778 /* JasonCacheAction.m in Sources */,
838857
045E5F3D1E3661060088D5E6 /* JasonReturnAction.m in Sources */,
@@ -842,6 +861,7 @@
842861
5E31774C1D1E411F00D87778 /* JasonMediaAction.m in Sources */,
843862
5E3177241D1E411F00D87778 /* JasonHorizontalSectionItem.m in Sources */,
844863
5E3177221D1E411F00D87778 /* JasonHorizontalSection.m in Sources */,
864+
04D947EB1F16ACF50063CC65 /* JASONResponseSerializer.m in Sources */,
845865
5E3177301D1E411F00D87778 /* JasonGeoAction.m in Sources */,
846866
5E3177591D1E411F00D87778 /* JasonOauthAction.m in Sources */,
847867
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// JASONResponseSerializer.h
3+
// Jasonette
4+
//
5+
// Created by e on 7/12/17.
6+
// Copyright © 2017 Jasonette. All rights reserved.
7+
//
8+
9+
#import <AFNetworking/AFNetworking.h>
10+
11+
@interface JASONResponseSerializer : AFJSONResponseSerializer
12+
13+
@end
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// JASONResponseSerializer.m
3+
// Jasonette
4+
//
5+
// Created by e on 7/12/17.
6+
// Copyright © 2017 Jasonette. All rights reserved.
7+
//
8+
9+
#import "JASONResponseSerializer.h"
10+
11+
@implementation JASONResponseSerializer
12+
- (id)responseObjectForResponse:(NSURLResponse *)response
13+
data:(NSData *)data
14+
error:(NSError *__autoreleasing *)errorPointer
15+
{
16+
id responseObject = [super responseObjectForResponse:response data:data error:errorPointer];
17+
if (*errorPointer) {
18+
NSError *error = *errorPointer;
19+
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
20+
userInfo[@"responseObject"] = responseObject;
21+
*errorPointer = [NSError errorWithDomain:error.domain code:error.code userInfo:[userInfo copy]];
22+
}
23+
return responseObject;
24+
}
25+
26+
@end

app/Jasonette/Jason.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
@property (strong, nonatomic) NSDictionary *data;
2929
@property (strong, nonatomic) NSDictionary *options;
3030
@property (strong, nonatomic) NSDictionary *rendered;
31+
@property (strong, nonatomic) NSDictionary *global;
3132
@property (strong, nonatomic) NSMutableArray *playing;
3233
@property (nonatomic, assign) BOOL touching;
3334
@property (nonatomic, assign) BOOL searchMode;
@@ -42,9 +43,12 @@
4243
- (void)ok;
4344
- (void)ok:(NSDictionary *)result;
4445
- (void)finish;
46+
47+
- (void)error:(id)result withOriginalUrl:(NSString*)url;
4548
- (void)error:(id)result;
4649
- (void)error;
4750

51+
- (void)success:(id)result withOriginalUrl:(NSString*)url;
4852
- (void)success:(id)result;
4953
- (void)success;
5054

@@ -64,6 +68,6 @@
6468
- (void)onRemoteNotification: (NSDictionary *)payload;
6569
- (void)onRemoteNotificationDeviceRegistered: (NSString *)device_token;
6670

67-
- (void)loadViewByFile: (NSString *)url;
71+
- (void)loadViewByFile: (NSString *)url asFinal: (BOOL)final;
6872
- (NSDictionary *)variables;
6973
@end

0 commit comments

Comments
 (0)