@@ -63,11 +63,8 @@ MainView {
6363 }
6464
6565 Component.onCompleted: function () {
66− theme.name = "" // set system theme
66+ theme.name = ""
6767 appSettings.systemTheme = theme.name.substring(theme.name.lastIndexOf(".")+1)
68−
69− //appSettings.pushAppId = 'cinny.nitanmarcel_cinny'
70− console.log("appSettings.pushAppId " + appSettings.pushAppId)
7168 }
7269 onActiveChanged: () => {appSettings.windowActive = mainView.active}
7370
@@ -97,9 +94,8 @@ MainView {
9794 id : webView
9895 anchors.fill : parent
9996 focus : true
100− url : "http://localhost:19999/" // Qt.resolvedUrl(Backend.getIndexPath())
97+ url : "http://localhost:19999/"
10198 webChannel: channel
102− //zoomFactor : 2.5
10399 settings.pluginsEnabled : true
104100 settings.javascriptEnabled : true
105101 profile : WebEngineProfile {
@@ -108,8 +104,6 @@ MainView {
108104 persistentStoragePath : "/home/phablet/.local/share/cinny.nitanmarcel/QWebEngine"
109105
110106 onDownloadRequested: function (download) {
111− console.log("Downloading")
112− console.log(download.path)
113107 download.accept()
114108 }
115109
@@ -131,19 +125,6 @@ MainView {
131125 })
132126 }
133127
134− onJavaScriptDialogRequested: function (request) {
135− request.accepted = true;
136− var popup = PopupUtils.open(jsDialogComponent, this, {"title": request.title, "message": request.message})
137− popup.dialogAccepted.connect(function () {
138− request.dialogAccept()
139− PopupUtils.close(popup)
140− })
141− popup.dialogRejected.connect(function () {
142− request.dialogReject()
143− PopupUtils.close(popup)
144− })
145− }
146−
147128 onFullScreenRequested : function (request) {
148129 request.accept()
149130 if (request.toggleOn)
@@ -154,20 +135,6 @@ MainView {
154135
155136 }
156137
157− Connections {
158− target: UriHandler
159−
160− onOpened: {
161− console.log('Open from UriHandler')
162−
163− if (uris.length > 0) {
164− if (uris[0].match(/^cinny:\/\/sso\/\?loginToken=.*/)) {
165− webView.url = "http://localhost:19999/" + uris[0].replace("cinny://sso/", "");
166− }
167− }
168− }
169− }
170−
171138 WebChannel {
172139 id: channel
173140 registeredObjects: [webChannelObject]
@@ -192,36 +159,6 @@ MainView {
192159 setCurrentTheme(themeName)
193160 }
194161 }
195−
196− Component {
197− id: jsDialogComponent
198−
199− Dialog {
200−
201− id: jsDialog
202−
203− title: i18n.tr("Javascript Dialog")
204− property var message
205−
206− signal dialogAccepted()
207− signal dialogRejected()
208−
209− Label {
210− wrapMode: Text.WordWrap
211− text: jsDialog.message
212− }
213−
214− Button {
215− text: i18n.tr("Yes")
216− color: UbuntuColors.green
217− onClicked: () => dialogAccepted()
218− }
219− Button {
220− text: i18n.tr("Cancel")
221− onClicked: () => dialogRejected()
222− }
223− }
224− }
225162 }
226163 }
227164
@@ -233,36 +170,5 @@ MainView {
233170 appSettings.pushToken = token
234171 webChannelObject.matrixPushTokenChanged();
235172 }
236−
237− function sendPushNotification(icon, title, body) {
238− var req = new XMLHttpRequest();
239− req.open("post", "https://push.ubports.com/notify", true);
240− req.setRequestHeader("Content-type", "application/json");
241− req.onreadystatechange = function() {
242− if ( req.readyState === XMLHttpRequest.DONE ) {
243− console.log("✍ Answer:", req.responseText);
244− }
245− }
246− var approxExpire = new Date ();
247− approxExpire.setUTCMinutes(approxExpire.getUTCMinutes()+10);
248− req.send(JSON.stringify({
249− "appid" : "cinny.nitanmarcel_cinny",
250− "expire_on": approxExpire.toISOString(),
251− "token": appSettings.pushToken,
252− "data": {
253− "notification": {
254− "card": {
255− "icon": icon,
256− "summary": title,
257− "body": body,
258− "popup": true,
259− "persist": true
260− },
261− "vibrate": true,
262− "sound": true
263− }
264− }
265− }));
266− }
267173 }
268174}