Skip to content

Commit 77c28ef

Browse files
committed
First Commit
1 parent 2a5e7dc commit 77c28ef

22 files changed

+2288
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

Mac OS app/.DS_Store

6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>15G19009</string>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en</string>
9+
<key>CFBundleExecutable</key>
10+
<string>MinimalNotes</string>
11+
<key>CFBundleIconFile</key>
12+
<string>AppIcon</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>com.minimal.notes</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>Minimal Notes</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>1.0.0</string>
23+
<key>CFBundleSignature</key>
24+
<string>????</string>
25+
<key>CFBundleSupportedPlatforms</key>
26+
<array>
27+
<string>MacOSX</string>
28+
</array>
29+
<key>CFBundleVersion</key>
30+
<string>1.0.0</string>
31+
<key>DTCompiler</key>
32+
<string>com.apple.compilers.llvm.clang.1_0</string>
33+
<key>DTPlatformBuild</key>
34+
<string>8A218a</string>
35+
<key>DTPlatformVersion</key>
36+
<string>GM</string>
37+
<key>DTSDKBuild</key>
38+
<string>16A300</string>
39+
<key>DTSDKName</key>
40+
<string>macosx10.12</string>
41+
<key>DTXcode</key>
42+
<string>0800</string>
43+
<key>DTXcodeBuild</key>
44+
<string>8A218a</string>
45+
<key>LSMinimumSystemVersion</key>
46+
<string>10.9</string>
47+
<key>NSAppTransportSecurity</key>
48+
<dict>
49+
<key>NSAllowsArbitraryLoads</key>
50+
<true/>
51+
</dict>
52+
<key>NSMainNibFile</key>
53+
<string>MainViewController</string>
54+
<key>NSPrincipalClass</key>
55+
<string>NSApplication</string>
56+
<key>UIDeviceFamily</key>
57+
<array>
58+
<integer>1</integer>
59+
<integer>2</integer>
60+
</array>
61+
</dict>
62+
</plist>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APPL????
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="com.minimal.notes" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<preference name="AllowInlineMediaPlayback" value="true" />
4+
<preference name="BackupWebStorage" value="cloud" />
5+
<preference name="DisallowOverscroll" value="false" />
6+
<preference name="WindowSize" value="960x680"/>
7+
<preference name="EnableViewportScale" value="false" />
8+
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
9+
<preference name="MediaPlaybackRequiresUserAction" value="false" />
10+
<feature name="LocalStorage">
11+
<param name="osx-package" value="CDVLocalStorage" />
12+
</feature>
13+
<name>Minimal Notes</name>
14+
<description>
15+
A sample Apache Cordova application that responds to the deviceready event.
16+
</description>
17+
<author email="[email protected]" href="http://cordova.io">
18+
Apache Cordova Team
19+
</author>
20+
<content src="index.html" />
21+
<access origin="*" />
22+
<allow-intent href="http://*/*" />
23+
<allow-intent href="https://*/*" />
24+
<allow-intent href="tel:*" />
25+
<allow-intent href="sms:*" />
26+
<allow-intent href="mailto:*" />
27+
<allow-intent href="geo:*" />
28+
</widget>
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*
20+
*/
21+
22+
/**
23+
* Creates a gap bridge used to notify the native code about commands.
24+
25+
* @private
26+
*/
27+
var cordova = require('cordova'),
28+
channel = require('cordova/channel'),
29+
utils = require('cordova/utils'),
30+
base64 = require('cordova/base64');
31+
32+
33+
function massageMessageNativeToJs(message) {
34+
if (message.CDVType == 'ArrayBuffer') {
35+
var stringToArrayBuffer = function (str) {
36+
var ret = new Uint8Array(str.length);
37+
for (var i = 0; i < str.length; i++) {
38+
ret[i] = str.charCodeAt(i);
39+
}
40+
return ret.buffer;
41+
};
42+
var base64ToArrayBuffer = function (b64) {
43+
return stringToArrayBuffer(atob(b64));
44+
};
45+
message = base64ToArrayBuffer(message.data);
46+
}
47+
return message;
48+
}
49+
50+
function convertMessageToArgsNativeToJs(message) {
51+
var args = [];
52+
if (!message || !message.hasOwnProperty('CDVType')) {
53+
args.push(message);
54+
} else if (message.CDVType == 'MultiPart') {
55+
message.messages.forEach(function (e) {
56+
args.push(massageMessageNativeToJs(e));
57+
});
58+
} else {
59+
args.push(massageMessageNativeToJs(message));
60+
}
61+
return args;
62+
}
63+
64+
function massageArgsJsToNative(args) {
65+
if (!args || utils.typeName(args) != 'Array') {
66+
return args;
67+
}
68+
var ret = [];
69+
args.forEach(function (arg, i) {
70+
if (utils.typeName(arg) == 'ArrayBuffer') {
71+
ret.push({
72+
'CDVType': 'ArrayBuffer',
73+
'data': base64.fromArrayBuffer(arg)
74+
});
75+
} else {
76+
ret.push(arg);
77+
}
78+
});
79+
return ret;
80+
}
81+
82+
function OSXExec() {
83+
84+
var successCallback, failCallback, service, action, actionArgs, splitCommand;
85+
var callbackId = 'INVALID';
86+
87+
successCallback = arguments[0];
88+
failCallback = arguments[1];
89+
service = arguments[2];
90+
action = arguments[3];
91+
actionArgs = arguments[4];
92+
93+
// Register the callbacks and add the callbackId to the positional
94+
// arguments if given.
95+
if (successCallback || failCallback) {
96+
callbackId = service + cordova.callbackId++;
97+
cordova.callbacks[callbackId] =
98+
{success: successCallback, fail: failCallback};
99+
}
100+
101+
actionArgs = massageArgsJsToNative(actionArgs);
102+
103+
if (window.cordovabridge && window.cordovabridge.exec) {
104+
window.cordovabridge.exec(callbackId, service, action, actionArgs);
105+
} else {
106+
alert('window.cordovabridge binding is missing.');
107+
}
108+
}
109+
110+
111+
OSXExec.nativeCallback = function (callbackId, status, message, keepCallback) {
112+
var success = status === 0 || status === 1;
113+
var args = convertMessageToArgsNativeToJs(message);
114+
cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
115+
};
116+
117+
module.exports = OSXExec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*
20+
*/
21+
22+
module.exports = {
23+
id: "osx",
24+
bootstrap: function() {
25+
require('cordova/channel').onNativeReady.fire();
26+
}
27+
};
28+

0 commit comments

Comments
 (0)