use feedback api instead of app=

pull/1/head
ansuz 8 years ago
parent 86c37bfa37
commit df4a250359

@ -733,6 +733,7 @@ define([
var second = function (CM) { var second = function (CM) {
Cryptpad.ready(function (err, env) { Cryptpad.ready(function (err, env) {
andThen(CM); andThen(CM);
Cryptpad.reportAppUsage();
}); });
Cryptpad.onError(function (info) { Cryptpad.onError(function (info) {
if (info && info.type === "store") { if (info && info.type === "store") {

@ -1,11 +1,10 @@
define([ define([
'/api/config', '/api/config',
'/customize/messages.js?app=' + window.location.pathname.split('/').filter(function (x) { return x; }).join('.'), '/customize/messages.js',
'/common/fsStore.js', '/common/fsStore.js',
'/common/common-util.js', '/common/common-util.js',
'/common/hash.js', '/common/hash.js',
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
'/bower_components/alertifyjs/dist/js/alertify.js', '/bower_components/alertifyjs/dist/js/alertify.js',
'/common/clipboard.js', '/common/clipboard.js',
'/common/pinpad.js', /* TODO '/common/pinpad.js', /* TODO
@ -13,7 +12,7 @@ load pinpad dynamically only after you know that it will be needed */
'/customize/application_config.js', '/customize/application_config.js',
'/bower_components/jquery/dist/jquery.min.js', '/bower_components/jquery/dist/jquery.min.js',
], function (Config, Messages, Store, Util, Hash, Crypto, Alertify, Clipboard, Pinpad, AppConfig) { ], function (Config, Messages, Store, Util, Hash, Alertify, Clipboard, Pinpad, AppConfig) {
/* This file exposes functionality which is specific to Cryptpad, but not to /* This file exposes functionality which is specific to Cryptpad, but not to
any particular pad type. This includes functions for committing metadata any particular pad type. This includes functions for committing metadata
about pads to your local storage for future use and improved usability. about pads to your local storage for future use and improved usability.
@ -28,6 +27,25 @@ load pinpad dynamically only after you know that it will be needed */
Clipboard: Clipboard Clipboard: Clipboard
}; };
var feedback = common.feedback = function (action) {
if (!action) { return; }
try {
if (!getStore().getProxy().proxy.allowUserFeedback) { return; }
} catch (e) { return void console.error(e); }
var href = '/common/feedback.html?' + action + '=' + (+new Date());
$.ajax({
type: "HEAD",
url: href,
});
};
var reportAppUsage = common.reportAppUsage = function () {
var pattern = window.location.pathname.split('/')
.filter(function (x) { return x; }).join('.');
feedback(pattern);
};
// constants // constants
var userHashKey = common.userHashKey = 'User_hash'; var userHashKey = common.userHashKey = 'User_hash';
var userNameKey = common.userNameKey = 'User_name'; var userNameKey = common.userNameKey = 'User_name';
@ -104,17 +122,6 @@ load pinpad dynamically only after you know that it will be needed */
return; return;
}; };
common.feedback = function (action) {
if (!action) { return; }
try {
if (!getStore().getProxy().proxy.allowUserFeedback) { return; }
} catch (e) { return void console.error(e); }
$.ajax({
type: "HEAD",
url: '/common/feedback.html?' + action + '=' + (+new Date()),
});
};
var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) {
realtime.sync(); realtime.sync();
window.setTimeout(function () { window.setTimeout(function () {

@ -2243,6 +2243,7 @@ define([
// don't initialize until the store is ready. // don't initialize until the store is ready.
Cryptpad.ready(function () { Cryptpad.ready(function () {
Cryptpad.reportAppUsage();
APP.$bar = $iframe.find('#toolbar'); APP.$bar = $iframe.find('#toolbar');
var storeObj = Cryptpad.getStore().getProxy && Cryptpad.getStore().getProxy().proxy ? Cryptpad.getStore().getProxy() : undefined; var storeObj = Cryptpad.getStore().getProxy && Cryptpad.getStore().getProxy().proxy ? Cryptpad.getStore().getProxy() : undefined;

@ -810,6 +810,7 @@ define([
var second = function (Ckeditor) { var second = function (Ckeditor) {
Cryptpad.ready(function (err, env) { Cryptpad.ready(function (err, env) {
andThen(Ckeditor); andThen(Ckeditor);
Cryptpad.reportAppUsage();
}); });
Cryptpad.onError(function (info) { Cryptpad.onError(function (info) {
if (info && info.type === "store") { if (info && info.type === "store") {

@ -782,6 +782,7 @@ define([
// don't initialize until the store is ready. // don't initialize until the store is ready.
Cryptpad.ready(function () { Cryptpad.ready(function () {
Cryptpad.reportAppUsage();
var config = { var config = {
websocketURL: Cryptpad.getWebsocketURL(), websocketURL: Cryptpad.getWebsocketURL(),
channel: secret.channel, channel: secret.channel,

@ -929,6 +929,7 @@ define([
var second = function (CM) { var second = function (CM) {
Cryptpad.ready(function (err, env) { Cryptpad.ready(function (err, env) {
andThen(CM); andThen(CM);
Cryptpad.reportAppUsage();
}); });
Cryptpad.onError(function (info) { Cryptpad.onError(function (info) {
if (info && info.type === "store") { if (info && info.type === "store") {

@ -618,6 +618,7 @@ window.canvas = canvas;
Cryptpad.ready(function (err, env) { Cryptpad.ready(function (err, env) {
andThen(); andThen();
Cryptpad.reportAppUsage();
}); });
Cryptpad.onError(function (info) { Cryptpad.onError(function (info) {
if (info) { if (info) {

Loading…
Cancel
Save