@@ -63,11 +63,8 @@ MainView {
65 Component.onCompleted: function () {
65 Component.onCompleted: function () {
66− theme.name = "" // set system theme
66+ theme.name = ""
67 appSettings.systemTheme = theme.name.substring(theme.name.lastIndexOf(".")+1)
67 appSettings.systemTheme = theme.name.substring(theme.name.lastIndexOf(".")+1)
69− //appSettings.pushAppId = 'cinny.nitanmarcel_cinny'
70− console.log("appSettings.pushAppId " + appSettings.pushAppId)
72 onActiveChanged: () => {appSettings.windowActive = mainView.active}
69 onActiveChanged: () => {appSettings.windowActive = mainView.active}
@@ -97,9 +94,8 @@ MainView {
97 id : webView
94 id : webView
98 anchors.fill : parent
95 anchors.fill : parent
99 focus : true
96 focus : true
100− url : "http://localhost:19999/" // Qt.resolvedUrl(Backend.getIndexPath())
97+ url : "http://localhost:19999/"
101 webChannel: channel
98 webChannel: channel
103 settings.pluginsEnabled : true
99 settings.pluginsEnabled : true
104 settings.javascriptEnabled : true
100 settings.javascriptEnabled : true
105 profile : WebEngineProfile {
101 profile : WebEngineProfile {
@@ -108,8 +104,6 @@ MainView {
108 persistentStoragePath : "/home/phablet/.local/share/cinny.nitanmarcel/QWebEngine"
104 persistentStoragePath : "/home/phablet/.local/share/cinny.nitanmarcel/QWebEngine"
110 onDownloadRequested: function (download) {
106 onDownloadRequested: function (download) {
111− console.log("Downloading")
112− console.log(download.path)
113 download.accept()
107 download.accept()
@@ -131,19 +125,6 @@ MainView {
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)
141− popup.dialogRejected.connect(function () {
142− request.dialogReject()
143− PopupUtils.close(popup)
147 onFullScreenRequested : function (request) {
128 onFullScreenRequested : function (request) {
148 request.accept()
129 request.accept()
149 if (request.toggleOn)
130 if (request.toggleOn)
@@ -154,20 +135,6 @@ MainView {
161− console.log('Open from UriHandler')
163− if (uris.length > 0) {
164− if (uris[0].match(/^cinny:\/\/sso\/\?loginToken=.*/)) {
165− webView.url = "http://localhost:19999/" + uris[0].replace("cinny://sso/", "");
171 WebChannel {
138 WebChannel {
172 id: channel
139 id: channel
173 registeredObjects: [webChannelObject]
140 registeredObjects: [webChannelObject]
@@ -192,36 +159,6 @@ MainView {
192 setCurrentTheme(themeName)
159 setCurrentTheme(themeName)
197− id: jsDialogComponent
203− title: i18n.tr("Javascript Dialog")
204− property var message
206− signal dialogAccepted()
207− signal dialogRejected()
210− wrapMode: Text.WordWrap
211− text: jsDialog.message
215− text: i18n.tr("Yes")
216− color: UbuntuColors.green
217− onClicked: () => dialogAccepted()
220− text: i18n.tr("Cancel")
221− onClicked: () => dialogRejected()
@@ -233,36 +170,5 @@ MainView {
233 appSettings.pushToken = token
170 appSettings.pushToken = token
234 webChannelObject.matrixPushTokenChanged();
171 webChannelObject.matrixPushTokenChanged();
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);
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,