Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. diff --git a/client/settings.js b/client/settings.js
  2. index 90c0a4c..f2ec581 100644
  3. --- a/client/settings.js
  4. +++ b/client/settings.js
  5. @@ -8,7 +8,8 @@ Meteor.settings.public = {
  6. "http://127.0.0.1:8080"
  7. ],
  8. "snapMaxFileSizeKB": 1024,
  9. - "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"]
  10. + "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
  11. + "localhost": false
  12. },
  13. "app": "dtube/0.7",
  14. "beneficiary": "dtube",
  15. @@ -46,4 +47,4 @@ Meteor.settings.public = {
  16. // Meteor.settings.public = json
  17. // Session.set('remoteSettings', Meteor.settings.public.remote)
  18. // }
  19. -// })
  20. \ No newline at end of file
  21. +// })
  22. diff --git a/client/views/pages/upload/upload.js b/client/views/pages/upload/upload.js
  23. index 039856d..0750fdf 100644
  24. --- a/client/views/pages/upload/upload.js
  25. +++ b/client/views/pages/upload/upload.js
  26. @@ -79,7 +79,9 @@ Template.upload.setBestUploadEndpoint = function (cb) {
  27. }
  28.  
  29. var getUploaderStatus = function (upldr) {
  30. - var url = 'https://'+upldr+'.d.tube/getStatus'
  31. + var url = (Session.get('remoteSettings').localhost == true)
  32. + ? 'https://localhost:5000/getStatus'
  33. + : 'https://'+upldr+'.d.tube/getStatus'
  34. return new Promise(function (resolve, reject) {
  35. var req = new XMLHttpRequest();
  36. req.open('get', url, true);
  37. @@ -110,7 +112,9 @@ Template.upload.genBody = function (author, permlink, title, snaphash, videohash
  38. }
  39.  
  40. Template.upload.uploadVideo = function (file, progressid, cb) {
  41. - var postUrl = 'https://'+Session.get('upldr')+'.d.tube/uploadVideo?videoEncodingFormats=240p,480p,720p&sprite=true'
  42. + var postUrl = (Session.get('remoteSettings').localhost == true)
  43. + ? 'http://localhost:5000/uploadVideo?videoEncodingFormats=240p,480p,720p&sprite=true'
  44. + : 'https://'+Session.get('upldr')+'.d.tube/uploadVideo?videoEncodingFormats=240p,480p,720p&sprite=true'
  45. var formData = new FormData();
  46. formData.append('files', file);
  47. $(progressid).progress({ value: 0, total: 1 })
  48. @@ -163,7 +167,9 @@ Template.upload.uploadImage = function (file, progressid, cb) {
  49. $('#uploadSnap > i').removeClass('cloud upload red')
  50. $('#uploadSnap > i').addClass('asterisk loading')
  51. $('#uploadSnap > i').css('background', 'transparent')
  52. - var postUrl = 'https://snap1.d.tube/uploadImage'
  53. + var postUrl = (Session.get('remoteSettings').localhost == true)
  54. + ? 'https://localhost:5000/uploadImage'
  55. + : 'https://snap1.d.tube/uploadImage'
  56. var formData = new FormData();
  57. formData.append('files', file);
  58. $(progressid).progress({ value: 0, total: 1 })
  59. diff --git a/client/views/pages/upload/uploadvideoprogress/uploadvideoprogress.js b/client/views/pages/upload/uploadvideoprogress/uploadvideoprogress.js
  60. index c5627bf..2d23d58 100644
  61. --- a/client/views/pages/upload/uploadvideoprogress/uploadvideoprogress.js
  62. +++ b/client/views/pages/upload/uploadvideoprogress/uploadvideoprogress.js
  63. @@ -9,7 +9,9 @@ Template.uploadvideoprogress.rendered = function() {
  64. }
  65. Template.uploadvideoprogress.update = function() {
  66. var token = Session.get('uploadToken')
  67. - var url = 'https://'+Session.get('upldr')+'.d.tube/getProgressByToken/'+token
  68. + var url = (Session.get('remoteSettings').localhost == true)
  69. + ? 'https://localhost:5000/getProgressByToken/'+token
  70. + : 'https://'+Session.get('upldr')+'.d.tube/getProgressByToken/'+token
  71. var credentials = Session.get('upldr') == 'cluster' ? true : false
  72. $.ajax({
  73. cache: false,
  74. @@ -86,4 +88,4 @@ Template.uploadvideoprogress.update = function() {
  75.  
  76. // }
  77. // })
  78. -}
  79. \ No newline at end of file
  80. +}
  81. diff --git a/public/DTube_files/settings.json b/public/DTube_files/settings.json
  82. index eb6b9c3..6115561 100644
  83. --- a/public/DTube_files/settings.json
  84. +++ b/public/DTube_files/settings.json
  85. @@ -9,7 +9,8 @@
  86. // "http://127.0.0.1:8080"
  87. ],
  88. "snapMaxFileSizeKB": 1024,
  89. - "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"]
  90. + "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
  91. + "localhost": false
  92. },
  93. "app": "dtube/0.7",
  94. "beneficiary": "dtube",
  95. @@ -39,4 +40,4 @@
  96. "tr": {"name": "Türkçe", "path": "tr/tr-TR.json"}
  97. }
  98. }
  99. -
  100. \ No newline at end of file
  101. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement