fixed form preview issues
This commit is contained in:
parent
18cde5213d
commit
3f20bcf712
|
@ -174,7 +174,7 @@ exports.uploadTemp = function(req, res) {
|
||||||
*/
|
*/
|
||||||
exports.readForRender = function(req, res) {
|
exports.readForRender = function(req, res) {
|
||||||
var newForm = req.form.toJSON();
|
var newForm = req.form.toJSON();
|
||||||
|
console.log(req.user);
|
||||||
if (!newForm.isLive && !req.user) {
|
if (!newForm.isLive && !req.user) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
message: 'Form Does Not Exist'
|
message: 'Form Does Not Exist'
|
||||||
|
|
5
config/env/all.js
vendored
5
config/env/all.js
vendored
|
@ -28,6 +28,7 @@ module.exports = {
|
||||||
reCAPTCHA_Key: process.env.reCAPTCHA_KEY || '',
|
reCAPTCHA_Key: process.env.reCAPTCHA_KEY || '',
|
||||||
|
|
||||||
signupDisabled: (process.env.SIGNUP_DISABLED === "TRUE"),
|
signupDisabled: (process.env.SIGNUP_DISABLED === "TRUE"),
|
||||||
|
disableClusterMode: (process.env.DISABLE_CLUSTER_MODE === "TRUE"),
|
||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
tempUserCollection: 'temporary_users',
|
tempUserCollection: 'temporary_users',
|
||||||
|
|
||||||
|
@ -57,10 +58,10 @@ module.exports = {
|
||||||
secure: false,
|
secure: false,
|
||||||
// Only set the maxAge to null if the cookie shouldn't be expired
|
// Only set the maxAge to null if the cookie shouldn't be expired
|
||||||
// at all. The cookie will expunge when the browser is closed.
|
// at all. The cookie will expunge when the browser is closed.
|
||||||
maxAge: null
|
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||||
// To set the cookie in a specific domain uncomment the following
|
// To set the cookie in a specific domain uncomment the following
|
||||||
// setting:
|
// setting:
|
||||||
// domain: 'tellform.com'
|
//domain: process.env.COOKIE_SESSION_URL || process.env.BASE_URL || '.tellform.com'
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
4
config/env/development.js
vendored
4
config/env/development.js
vendored
|
@ -19,9 +19,7 @@ module.exports = {
|
||||||
// stream: 'access.log'
|
// stream: 'access.log'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sessionCookie: {
|
|
||||||
//domain: process.env.BASE_URL || 'http://localhost:3000'
|
|
||||||
},
|
|
||||||
facebook: {
|
facebook: {
|
||||||
clientID: process.env.FACEBOOK_ID || 'APP_ID',
|
clientID: process.env.FACEBOOK_ID || 'APP_ID',
|
||||||
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
|
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
|
||||||
|
|
4
config/env/production.js
vendored
4
config/env/production.js
vendored
|
@ -18,7 +18,9 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sessionCookie: {
|
sessionCookie: {
|
||||||
//domain: process.env.BASE_URL || 'tellform.com'
|
secure: false,
|
||||||
|
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||||
|
domain: process.env.BASE_URL || '.tellform.com'
|
||||||
},
|
},
|
||||||
assets: {
|
assets: {
|
||||||
bower_js: 'public/dist/vendor.min.js',
|
bower_js: 'public/dist/vendor.min.js',
|
||||||
|
|
|
@ -16,7 +16,7 @@ module.exports = function (app, db) {
|
||||||
io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
|
io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
|
||||||
}
|
}
|
||||||
|
|
||||||
if(process.env.DISABLE_CLUSTER_MODE !== "TRUE"){
|
if(config.disableClusterMode){
|
||||||
var redis = require('socket.io-redis');
|
var redis = require('socket.io-redis');
|
||||||
io.adapter(redis( process.env.REDIS_URL || { host: process.env.REDIS_DB_PORT_6379_TCP_ADDR || '127.0.0.1' , port: process.env.REDIS_DB_PORT_6379_TCP_PORT || 6379 }));
|
io.adapter(redis( process.env.REDIS_URL || { host: process.env.REDIS_DB_PORT_6379_TCP_ADDR || '127.0.0.1' , port: process.env.REDIS_DB_PORT_6379_TCP_PORT || 6379 }));
|
||||||
}
|
}
|
||||||
|
|
31
public/dist/application.js
vendored
31
public/dist/application.js
vendored
|
@ -2231,7 +2231,7 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
|
||||||
angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', '$sce',
|
angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', '$sce',
|
||||||
function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter, $sce) {
|
function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter, $sce) {
|
||||||
|
|
||||||
$scope.trustSrc = function(src) {
|
$scope.trustSrc = function (src) {
|
||||||
return $sce.trustAsResourceUrl(src);
|
return $sce.trustAsResourceUrl(src);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2239,29 +2239,34 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
||||||
$scope.activePill = 0;
|
$scope.activePill = 0;
|
||||||
|
|
||||||
$scope.copied = false;
|
$scope.copied = false;
|
||||||
$scope.onCopySuccess = function(e) {
|
$scope.onCopySuccess = function (e) {
|
||||||
$scope.copied = true;
|
$scope.copied = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope = $rootScope;
|
$scope = $rootScope;
|
||||||
$scope.animationsEnabled = true;
|
$scope.animationsEnabled = true;
|
||||||
$scope.myform = myForm;
|
$scope.myform = myForm;
|
||||||
$rootScope.saveInProgress = false;
|
$rootScope.saveInProgress = false;
|
||||||
|
|
||||||
CurrentForm.setForm($scope.myform);
|
CurrentForm.setForm($scope.myform);
|
||||||
|
|
||||||
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
||||||
|
|
||||||
if($window.subdomainsDisabled == true){
|
if ($scope.myform.isLive) {
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
if ($window.subdomainsDisabled == true) {
|
||||||
} else {
|
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
||||||
if(window.location.host.split('.').length < 3){
|
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + $scope.formURL;
|
|
||||||
} else {
|
} else {
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1,3).join('.') + $scope.formURL;
|
if (window.location.host.split('.').length < 3) {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + $scope.formURL;
|
||||||
|
} else {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1, 3).join('.') + $scope.formURL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + $scope.formURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var refreshFrame = $scope.refreshFrame = function(){
|
var refreshFrame = $scope.refreshFrame = function(){
|
||||||
if(document.getElementById('iframe')) {
|
if(document.getElementById('iframe')) {
|
||||||
document.getElementById('iframe').contentWindow.location.reload();
|
document.getElementById('iframe').contentWindow.location.reload();
|
||||||
|
|
4
public/dist/application.min.js
vendored
4
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', '$sce',
|
angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', '$sce',
|
||||||
function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter, $sce) {
|
function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter, $sce) {
|
||||||
|
|
||||||
$scope.trustSrc = function(src) {
|
$scope.trustSrc = function (src) {
|
||||||
return $sce.trustAsResourceUrl(src);
|
return $sce.trustAsResourceUrl(src);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,29 +12,34 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo
|
||||||
$scope.activePill = 0;
|
$scope.activePill = 0;
|
||||||
|
|
||||||
$scope.copied = false;
|
$scope.copied = false;
|
||||||
$scope.onCopySuccess = function(e) {
|
$scope.onCopySuccess = function (e) {
|
||||||
$scope.copied = true;
|
$scope.copied = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope = $rootScope;
|
$scope = $rootScope;
|
||||||
$scope.animationsEnabled = true;
|
$scope.animationsEnabled = true;
|
||||||
$scope.myform = myForm;
|
$scope.myform = myForm;
|
||||||
$rootScope.saveInProgress = false;
|
$rootScope.saveInProgress = false;
|
||||||
|
|
||||||
CurrentForm.setForm($scope.myform);
|
CurrentForm.setForm($scope.myform);
|
||||||
|
|
||||||
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
$scope.formURL = "/#!/forms/" + $scope.myform._id;
|
||||||
|
|
||||||
if($window.subdomainsDisabled == true){
|
if ($scope.myform.isLive) {
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
if ($window.subdomainsDisabled == true) {
|
||||||
} else {
|
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + '/view' + $scope.formURL;
|
||||||
if(window.location.host.split('.').length < 3){
|
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + $scope.formURL;
|
|
||||||
} else {
|
} else {
|
||||||
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1,3).join('.') + $scope.formURL;
|
if (window.location.host.split('.').length < 3) {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host + $scope.formURL;
|
||||||
|
} else {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + $scope.myform.admin.username + '.' + window.location.host.split('.').slice(1, 3).join('.') + $scope.formURL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$scope.actualFormURL = window.location.protocol + '//' + window.location.host + $scope.formURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var refreshFrame = $scope.refreshFrame = function(){
|
var refreshFrame = $scope.refreshFrame = function(){
|
||||||
if(document.getElementById('iframe')) {
|
if(document.getElementById('iframe')) {
|
||||||
document.getElementById('iframe').contentWindow.location.reload();
|
document.getElementById('iframe').contentWindow.location.reload();
|
||||||
|
|
Loading…
Reference in a new issue