Skip to content

Commit 0cb5fbb

Browse files
author
Igor Khomenko
committed
Merge pull request #71 from QuickBlox/develop.jasminejs_review
redid the tests for location spec
2 parents 32e8777 + c679dca commit 0cb5fbb

File tree

15 files changed

+558
-453
lines changed

15 files changed

+558
-453
lines changed

js/modules/qbData.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
var config = require('../qbConfig'),
99
Utils = require('../qbUtils');
1010

11+
// For server-side applications through using npm package 'quickblox' you should include the following lines
12+
var isBrowser = typeof window !== 'undefined';
13+
1114
function DataProxy(service){
1215
this.service = service;
1316
}
@@ -60,9 +63,17 @@ DataProxy.prototype = {
6063
Utils.QBLog('[DataProxy]', 'uploadFile', className, params);
6164

6265
var formData;
63-
formData = new FormData();
64-
formData.append('field_name', params.field_name);
65-
formData.append('file', params.file);
66+
67+
if(isBrowser){
68+
formData = new FormData();
69+
formData.append('field_name', params.field_name);
70+
formData.append('file', params.file);
71+
}else{
72+
formData = {};
73+
formData['field_name'] = params.field_name;
74+
formData['file'] = params.file;
75+
}
76+
6677
this.service.ajax({url: Utils.getUrl(config.urls.data, className + '/' + params.id + '/file'), data: formData,
6778
contentType: false, processData: false, type:'POST'}, function(err, result){
6879
if (err) { callback(err, null);}

js/modules/qbPushNotifications.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ EventsProxy.prototype = {
6767
this.service.ajax({url: Utils.getUrl(config.urls.events), type: 'POST', data: message}, callback);
6868
},
6969

70-
list: function(callback) {
71-
Utils.QBLog('[EventsProxy]', 'list');
72-
73-
this.service.ajax({url: Utils.getUrl(config.urls.events)}, callback);
70+
list: function(params, callback) {
71+
if (typeof params === 'function' && typeof callback ==='undefined') {
72+
callback = params;
73+
params = null;
74+
}
75+
76+
Utils.QBLog('[EventsProxy]', 'list', params);
77+
78+
this.service.ajax({url: Utils.getUrl(config.urls.events), data: params}, callback);
7479
},
7580

7681
get: function(id, callback) {
@@ -85,13 +90,6 @@ EventsProxy.prototype = {
8590
this.service.ajax({url: Utils.getUrl(config.urls.events, id + '/status')}, callback);
8691
},
8792

88-
update: function(params, callback) {
89-
Utils.QBLog('[EventsProxy]', 'update', params);
90-
91-
var message = {event: params};
92-
this.service.ajax({url: Utils.getUrl(config.urls.events, params.id), type: 'PUT', data: message}, callback);
93-
},
94-
9593
delete: function(id, callback) {
9694
Utils.QBLog('[EventsProxy]', 'delete', id);
9795

quickblox.min.js

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/chat/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>QuickBlox JavaScript Chat code sample</title>
7-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
7+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
88
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
99
<link rel="stylesheet" href="css/style.css">
1010
</head>
@@ -17,7 +17,7 @@
1717
<span class="sr-only">Toggle navigation</span>
1818
<span class="glyphicon glyphicon-cog"></span>
1919
</button>
20-
<a href="http://quickblox.com/developers/Chat"><img src="images/logo-quickblox.png" id="logo"></a>
20+
<a href="https://quickblox.com/developers/Chat"><img src="images/logo-quickblox.png" id="logo"></a>
2121
</div>
2222
<div class="collapse navbar-collapse">
2323
<ul class="nav navbar-nav">

samples/chat/js/config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ var QBApp = {
55
};
66

77
var config = {
8-
debug: true
8+
chatProtocol: {
9+
active: 2
10+
},
11+
debug: {
12+
mode: 0,
13+
file: null
14+
}
915
};
1016

1117
var QBUser1 = {

samples/content/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>QuickBlox JavaScript content sample</title>
88
<link href="css/style.css" rel="stylesheet">
9-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
9+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
1010
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
1111
</head>
1212

1313
<body>
1414
<div class="container">
1515
<div class="row site-head">
1616
<div id="logo" class="">
17-
<a href="http://quickblox.com/"><img class="logo" src="images/logo-quickblox.png" alt="QuickBlox Samples"></a>
17+
<a href="https://quickblox.com/"><img class="logo" src="images/logo-quickblox.png" alt="QuickBlox Samples"></a>
1818
<a href="https://github.com/QuickBlox/quickblox-javascript-sdk/tree/master/samples/content"
1919
style="position:absolute;top:20px;right:7%;font-size:0.85em;color:grey;">View source on GitHub</a>
2020
</div>

samples/customobjects/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>QuickBlox Sample Web Blog</title>
8-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
8+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
99
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
1010
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap-theme.min.css">
1111
<link rel="stylesheet" href="css/style.css">
@@ -22,7 +22,7 @@
2222
<span class="icon-bar"></span>
2323
<span class="icon-bar"></span>
2424
</button>
25-
<a class="navbar-brand" href="http://quickblox.com/developers/Custom_Objects">
25+
<a class="navbar-brand" href="https://quickblox.com/developers/Custom_Objects">
2626
<img class="logo" src="images/logo-quickblox.png" alt="QuickBlox Samples" class="img-responsive"></a>
2727
</div>
2828
<div class="collapse navbar-collapse">

samples/roster/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>QuickBlox JavaScript Roster code sample</title>
7-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
7+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
88
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
99
</head>
1010
<body>

samples/users/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>QuickBlox JavaScript Users code sample</title>
7-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
7+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
88
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
99
</head>
1010
<body>

samples/webrtc/peer-to-peer/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>QuickBlox JavaScript WebRTC sample</title>
7-
<link rel="shortcut icon" href="http://quickblox.com/favicon.ico">
7+
<link rel="shortcut icon" href="https://quickblox.com/favicon.ico">
88
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
99
<link rel="stylesheet" href="main.css">
1010
</head>
@@ -13,7 +13,7 @@
1313
<header class="header">
1414
<div class="center">
1515
<h1 class="title">
16-
<a href="http://quickblox.com/"><img class="logo" src="images/logo-quickblox.png" alt="QuickBlox Samples"></a>
16+
<a href="https://quickblox.com/"><img class="logo" src="images/logo-quickblox.png" alt="QuickBlox Samples"></a>
1717
JavaScript WebRTC Sample <small>(Peer-to-Peer)</small>
1818
</h1>
1919
</div>

0 commit comments

Comments
 (0)