From 7230c780a1d93d20d12eeb033f10058e1138655c Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 2 Oct 2017 15:06:01 +0300 Subject: [PATCH] Get rid of last usages of cryptpad-common in pad/inner --- www/pad/inner.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/www/pad/inner.js b/www/pad/inner.js index 3127bb15d..4012977ab 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -28,7 +28,8 @@ define([ '/bower_components/nthen/index.js', '/common/media-tag.js', '/api/config', - '/common/cryptpad-common.js', + '/common/common-hash.js', + '/common/common-util.js', '/bower_components/diff-dom/diffDOM.js', @@ -46,7 +47,8 @@ define([ nThen, MediaTag, ApiConfig, - Cryptpad) + Hash, + Util) { var DiffDom = window.diffDOM; @@ -406,11 +408,7 @@ define([ // apply patches, and try not to lose the cursor in the process! framework.onContentUpdate(function (hjson) { - if (!Array.isArray(hjson)) { - var errorText = Messages.typeError; - Cryptpad.errorLoadingScreen(errorText); - throw new Error(errorText); - } + if (!Array.isArray(hjson)) { throw new Error(Messages.typeError); } var userDocStateDom = hjsonToDom(hjson); userDocStateDom.setAttribute("contenteditable", @@ -458,8 +456,8 @@ define([ ckeditor: editor, body: $('body'), onUploaded: function (ev, data) { - var parsed = Cryptpad.parsePadUrl(data.url); - var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel); + var parsed = Hash.parsePadUrl(data.url); + var hexFileName = Util.base64ToHex(parsed.hashData.channel); var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName; var mt = ''; editor.insertElement(window.CKEDITOR.dom.element.createFromHtml(mt));