mizzao / meteor-sharejs Goto Github PK
View Code? Open in Web Editor NEWMeteor smart package for transparently adding ShareJS editors to an app
License: MIT License
Meteor smart package for transparently adding ShareJS editors to an app
License: MIT License
No idea why, but I get this error when adding sharejs on meteor 0.8.1.3
js-bson: Failed to load c++ bson extension, using pure JS version
I tried reinstall npm bson and mongodb, but no success.
Any ideas?
Typing has some issues on Android. I just tried the demo http://documents.meteor.com/ on Android 5.1.1 (Chrome and the built-in web browser), and observed the following:
I get the same behavior in my own app using meteor-sharejs with Ace editor.
At least it's functional, typing individual characters on a Samsung keyboard, but it's annoying to force users into this. Perhaps this could be fixed?
/.meteor/packages/meteor-tool/.1.0.42.1fjh99x++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150317-19:49:12.725(-6)? (STDERR) throw(ex);
W20150317-19:49:12.725(-6)? (STDERR) ^
W20150317-19:49:12.736(-6)? (STDERR) TypeError: Object [object Object] has no method '_withDb'
W20150317-19:49:12.736(-6)? (STDERR) at Package (packages/mizzao:sharejs/sharejs-server.coffee:31:16)
W20150317-19:49:12.736(-6)? (STDERR) at packages/mizzao:sharejs/sharejs-server.coffee:3:1
W20150317-19:49:12.736(-6)? (STDERR) at packages/mizzao:sharejs/sharejs-server.coffee:3:1
W20150317-19:49:12.736(-6)? (STDERR) at /home/brett/Sites/drag/.meteor/local/build/programs/server/boot.js:222:10
W20150317-19:49:12.736(-6)? (STDERR) at Array.forEach (native)
W20150317-19:49:12.737(-6)? (STDERR) at Function._.each._.forEach (/home/brett/.meteor/packages/meteor-tool/.1.0.42.1fjh99x++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150317-19:49:12.737(-6)? (STDERR) at /home/brett/Sites/drag/.meteor/local/build/programs/server/boot.js:117:5
My version file is using your package at version # 0.7.1
Also, I tried to bring it up to 0.7.3 but got the following error:
While checking for mizzao:[email protected]:
error: No compatible build found
@mizzao Nice work on this package. Clean code!
Do you have plans to add authentication using something like this?
OR
Any caveats/recommendations if a brand new node programmer tries to put it in? I know javascript/coffee well enough and have been getting my hands dirty with JS frameworks recently. Meteor is my newest love and I am trying to build a pet project based on sharejs using your smart package.
$ meteor add mizzao:sharejs-cm
$ meteor add mizzao:sharejs-ace
$ mizzao:sharejs-ace: no such package
Even when using the basic textbox, one might want to listen for when it is ready, for example, to set focus on it when it has loaded the document, so the user doesn't have to click twice.
As discussed over at josephg/ShareJS#1. This would be a pretty large undertaking :)
Instead of bundling editors, package could be split into base package + modules for each editor. Then others could create support for other editors.
Well, I'm pretty new to Meteor, but when trying to load sharejs on meteorite something goes wrong. I've tried a few times now, with different apps, and so far always the same result. Is this a bug?
Terminal:
Mallorys-MacBook-Air:reactivity-playground mallorym$ mrt add sharejs
Done installing smart packages
Stand back while Meteorite does its thing
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
=> Errors while scanning packages:
While building package sharejs
:
fs.js:654:18: ENOENT, no such file or directory 'ace-builds/src'
at Object.fs.readdirSync (fs.js:654:18)
at walk (package.js:27:28)
at getFilesFromFolder (package.js:50:16)
at Object.use (package.js:74:21)
at /Users/mallorym/.meteor/tools/858c88b520/tools/packages.js:1630:29
at Array.forEach (native)
at Function..each..forEach (/Users/mallorym/.meteor/tools/858c88b520/lib/node_modules/underscore/underscore.js:79:11)
at .extend.initFromPackageDir (/Users/mallorym/.meteor/tools/858c88b520/tools/packages.js:1434:7)
at /Users/mallorym/.meteor/tools/858c88b520/tools/library.js:254:15
at Object.enterJob (/Users/mallorym/.meteor/tools/858c88b520/tools/buildmessage.js:235:15)
at .extend.get (/Users/mallorym/.meteor/tools/858c88b520/tools/library.js:241:22)
at /Users/mallorym/.meteor/tools/858c88b520/tools/library.js:357:24
at Array.forEach (native)
at Function..each..forEach (/Users/mallorym/.meteor/tools/858c88b520/lib/node_modules/underscore/underscore.js:79:11)
at /Users/mallorym/.meteor/tools/858c88b520/tools/library.js:356:9
at Object.capture (/Users/mallorym/.meteor/tools/858c88b520/tools/buildmessage.js:191:5)
at _.extend.list (/Users/mallorym/.meteor/tools/858c88b520/tools/library.js:345:33)
at getPackages (/Users/mallorym/.meteor/tools/858c88b520/tools/commands.js:50:40)
at main.registerCommand.name (/Users/mallorym/.meteor/tools/858c88b520/tools/commands.js:550:13)
at /Users/mallorym/.meteor/tools/858c88b520/tools/main.js:949:23
/usr/local/lib/node_modules/meteorite/lib/command.js:41
throw "Command exited with " + code + "/" + signal;
^
Exception in template helper: TypeError: Cannot read property 'extend' of undefined
at Object.<anonymous> (http://localhost:3000/packages/mizzao:sharejs.js?
After the latest update the ace editor isn't loaded and I get the msg above
I've updated to Meteor 0.8.2 and the latest version of sharejs, and the browser shows the error listed in the title. I don't have any configuration, just the template and its JS file. "_id" and "callback" are working as expected. Any ideas? Thanks!
{{> sharejsAce docId=_id callback=config id="editor"}}
Template.editor.helpers({
config: function() {
return function(editor) {
editor.setShowPrintMargin(false);
editor.getSession().setUseWrapMode(true);
return editor;
};
}
});
Not working with meteor 0.8.1.1 on mint 16
yak@vm16 ~/discus $ mrt add sharejs
smart.json changed.. installing from smart.json
✓ jquery-autosize
tag: https://github.com/spendflow/meteor-jquery-autosize.git#v1.17.8r1
✓ sharejs
tag: https://github.com/mizzao/meteor-sharejs.git#v0.5.0
Done installing smart packages
Stand back while Meteorite does its thing
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
=> Errors while scanning packages:
While building package `sharejs`:
error: File not found: ace-builds/src-min/ace.js
/usr/local/lib/node_modules/meteorite/lib/command.js:35
throw "Command exited with " + code + "/" + signal;
^
Command exited with 1/null
[Error] open@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:157:27630
http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:157:27370
emit@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:157:1368
setState@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:157:26404
onopen@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:157:13628
e@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:133:52
channelOpened@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:133:216
Rb@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:123:146
nd@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:101:252
md@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:96:297
ec@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:94:485
Bc@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:93:311
yc@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:80:386
dispatchEvent@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:79:353
Rc@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:87:190
uc@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:86:402
Qb@http://localhost:3000/packages/sharejs.js?60558bce27a82a9deeefcde0e812d180e4364ab0:86:379
[native code]
e (sharejs.js, line 133)
channelOpened (sharejs.js, line 133)
Rb (sharejs.js, line 123)
nd (sharejs.js, line 101)
md (sharejs.js, line 96)
ec (sharejs.js, line 94)
Bc (sharejs.js, line 93)
yc (sharejs.js, line 80)
dispatchEvent (sharejs.js, line 79)
Rc (sharejs.js, line 87)
uc (sharejs.js, line 86)
Qb (sharejs.js, line 86)
(anonymous function)
[Error] TypeError: 'null' is not an object (evaluating 'this.zb.n')
Sb (sharejs.js, line 119)
(anonymous function)
(anonymous function) (sharejs.js, line 130)
Okay, this is a weird one. I've got this Ace editor on a web project I'm working on. Working fine on desktop web, but on iPhone Safari and Chrome (haven't tested on Android), pressing the space or return keys in the editor causes the editor to delete the character preceding the cursor, i.e. a backspace behavior. I don't implement any special behavior that should be causing it but I'd appreciate it if someone could replicate on their end just to make sure. If you want to test out the issue on my site, visit: http://www.group.codes/M25EhSW55ewiguTCa
New to Meteor, hopefully I'm missing something obvious...
Followed the basic setup in the Readme, works as expected with default options. Then I tried to set the language to JavaScript and theme to twilight:
Template.editor.config = function() {
return function(editor) {
editor.setShowPrintMargin(false);
editor.setTheme('ace/theme/twilight');
editor.getSession().setMode("ace/mode/javascript");
return editor.getSession().setUseWrapMode(true);
};
};
Console shows JavaScript errors, Ace cannot parse the requested assets. The current URL is:
/r/roomName
Ace is requesting assets at:
/r/mode-javascript.js
/r/theme-twilight.js
and these URLs return the application HTML. I'd assume it should be requesting these assets from the root URL, but I'm not sure.
I'm on Meteor 0.7.1. Here are the packages I'm using:
{
"packages": {
"bootstrap-3": {},
"spin": {},
"iron-router": {},
"accounts-ui-bootstrap-3": {},
"bootstrap-errors": {},
"streams": {},
"sharejs": {}
}
}
Hopefully this is just a routing config issue. Any ideas? Thanks!
Hi Andrew,
Any ideas on how to apply shareJS to inputs? We're working on some collaborative form contexts.
Happy to fork and do PR's – with some direction :)
this is the message I see in my JS console in Chrome
GET http://ajaxorg.github.com/ace/build/src/ace.js 503 (Connection timed out)
the request comes from:
<!-- This always gets latest version of Ace editor -->
<script src="http://ajaxorg.github.com/ace/build/src/ace.js"></script>
If I try to open the http://ajaxorg.github.com/ace/build/src/ace.js in a separate tab I get the error:
Error 503 Backend is unhealthy
onRender function runs, but the function we return from there never gets called. As a result, you cannot configure the editor (Ace in my case).
I ran into this problem while working on my own app, but I am able to reproduce it in the demo app too.
Clone from the repository and run the demo. The code editor will stay white (the default). You can see in the deployed version of the demo that it switches to black.
If you add debug lines to configAce:
configAce: ->
console.log "onRender called, returning config function …"
(ace) ->
console.log "Config function called!"
# Set some reasonable options on the editor
ace.setTheme('ace/theme/monokai')
ace.setShowPrintMargin(false)
ace.getSession().setUseWrapMode(true)
… you will see that only the fist console.log
gets executed, but the second one never does.
I found a few easy changes that need to be made in sharejs-client.coffee:
Handlebars.SafeString is now Spacebars.SafeString
Handlebars.registerHelper is now UI.registerHelper
However this still doesn't fix it. Nothing gets rendered, but there are also no errors to look at so I'm not quite sure why it silently fails :(
This isn't so much an issue as a question or enhancement request. Is there a way I can pass in additional data variables to the template helper so that I can decorate the resulting textarea with custom attributes?
The reason I ask is because I want to support some simple markdown editing using Bootstrap Markdown. All I really need to include is a data-provide="markdown" or "markdown-editable" but I can't seem to figure out a good way to pass this in.
I forked your package earlier, cloned it, and made my own shareJSMarkdown template, but I couldn't get the package to build successfully (I'll admit, I was out of my depth here). Also, even when I got it to work locally, the template didn't seem to make it across, and it's because I believe your helper needs to call the appropriate constructor and handle it in a string that gets generated and returned.
sharejs: updating npm dependencies -- share, mongodb...
npm WARN using --force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/share/0.6.2
npm http 200 https://registry.npmjs.org/share/0.6.2
npm http GET https://registry.npmjs.org/share/-/share-0.6.2.tgz
npm http 200 https://registry.npmjs.org/share/-/share-0.6.2.tgz
npm ERR! Error: shasum check failed for /var/folders/lm/f275qsjs2kq1myb10t208_ww0000gn/T/npm-6077-UgidaJ95/1402465562779-0.011807809583842754/tmp.tgz
npm ERR! Expected: cca5cff3b61b76d0e156756a962fb94db891e42a
npm ERR! Actual: c86206a0c7ee33e34b47c52a69bdb015f1d1b61d
npm ERR! From: https://registry.npmjs.org/share/-/share-0.6.2.tgz
npm ERR! at /Users/fan/.meteor/tools/5bf1690853/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream. (/Users/fan/.meteor/tools/5bf1690853/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Darwin 13.2.0
npm ERR! command "/Users/fan/.meteor/tools/5bf1690853/bin/node" "/Users/fan/.meteor/tools/5bf1690853/bin/npm" "install" "--force" "[email protected]"
npm ERR! cwd /Users/fan/.meteorite/packages/sharejs/mizzao/meteor-sharejs/1d8137b59906ce210b2f5c015b7b142735bc2f4e/.npm/package-new-1jf8yke
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/fan/.meteorite/packages/sharejs/mizzao/meteor-sharejs/1d8137b59906ce210b2f5c015b7b142735bc2f4e/.npm/package-new-1jf8yke/npm-debug.log
npm ERR! not ok code 0
=> Errors while scanning packages:
While building package sharejs
:
error: couldn't install npm package
error: File not found: .npm/package/node_modules/share/node_modules/browserchannel/dist/bcsocket.js
error: File not found: .npm/package/node_modules/share/webclient/share.js
error: File not found: .npm/package/node_modules/share/webclient/ace.js
error: File not found: .npm/package/node_modules/share/webclient/textarea.js
/usr/local/lib/node_modules/meteorite/lib/command.js:35
throw "Command exited with " + code + "/" + signal;
^
Command exited with 1/null
error on win7 x32, as well as on winServer 2012 x64, win10 x64
Below is the error message for win 7
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While processing files with stylus (for target web.browser):
~MYPATH\AppData\Local.meteor\packages\meteor-tool\1.1.9\mt-os.windows.x
86_32\tools\static-assets\server\mini-files.js:34:13:
Surprising path:
/~MYPATH/AppData/Local/.meteor/packages/stylus/2.511.0_2/plugin.compileStyl
usBatch.os/npm/compileStylusBatch/node_modules/nib/lib/nib/overflow.styl
at toDosPath
(~MYPATH\AppData\Local.meteor\packages\meteor-tool\1.1.9\mt-os.windows.
x86_32\tools\static-assets\server\mini-files.js:34:13)
at Object.convertToOSPath
(~MYPATH\AppData\Local.meteor\packages\meteor-tool\1.1.9\mt-os.windows.
x86_32\tools\static-assets\server\mini-files.js:47:12)
at Object.wrapper (C:\tools\fs\files.js:1310:25)
at importer.readFile (plugin/compile-stylus.js:119:21)
at Array.map (native)
at processSourcemap (plugin/compile-stylus.js:139:52)
at StylusCompiler.compileOneFile (plugin/compile-stylus.js:169:23)
at multi-file-caching-compiler.js:115:45
at multi-file-caching-compiler.js:144:68
at
~MYPATH\AppData\Local.meteor\packages\stylus\2.511.0_2\plugin.compileSt
ylusBatch.os\npm\caching-compiler\node_modules\async\lib\async.js:182:20
at replenish
(~MYPATH\AppData\Local.meteor\packages\stylus\2.511.0_2\plugin.compileS
tylusBatch.os\npm\caching-compiler\node_modules\async\lib\async.js:317:21)
at
~MYPATH\AppData\Local.meteor\packages\stylus\2.511.0_2\plugin.compileSt
ylusBatch.os\npm\caching-compiler\node_modules\async\lib\async.js:328:15
at Object.async.forEachLimit.async.eachLimit
(~MYPATH\AppData\Local.meteor\packages\stylus\2.511.0_2\plugin.compileS
tylusBatch.os\npm\caching-compiler\node_modules\async\lib\async.js:221:35)
at StylusCompiler.processFilesForTarget
(multi-file-caching-compiler.js:95:11)
=> Your application has errors. Waiting for file change.
Hi there,
I'm currently looking into adding sharejs 0.7.3 support to meteor-sharejs. Before I get too involved, I wanted to check to see if anyone here done this yet?
The main reason i'm looking to do this, is because from what i've been told, ShareJS 0.6 does not support multiple server instances, which was implemented in 0.7.3.
I was able to type concurrently on laptop and smartphone but it kept on thinking my delete button was the shift key. it would only delete one char at a time if i put my keyboard away and then pulled it back up.
...instead of having Npm.depends
for ourself and always having to update that.
There was a thread about this and MongoInternals
; figure out how to make that work and to do anything more advanced if appropriate.
Hi again, i'm using browser-policy to improve security against XSS. This is what appears in my client console when i loaded my meteor app with sharejs activated.
Refused to load the script 'http://ajaxorg.github.com/ace/build/src/ace.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". There are 0posts main.js?44864693a7c5e6807c732a29a1a625e0cdc22740:12 Refused to load the script 'http://ajaxorg.github.com/ace/build/src/ace.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Uncaught ReferenceError: ace is not defined
Seems like a really basic question, but I can't figure out how to programmatically get the value of the code mirror editor. Is this possible?
I'm also looking to attach a listening event to the CodeMirror editor, so whenever changes are made, I would get the content of the editor, and render it in a separate div. But to do that, I need to some how have access to the CodeMirror object I think.
Hi!
This package has binary dependencies, and we wanted to give you a heads up that Meteor 1.1, with support for Windows will be released in a few days.
Now is the time to publish your package for Windows!
It should be very straightforward -- we've added new build machines that run Windows that you can access with the meteor admin get-machine
command. This is the same as you've done before for the other architectures we support.
For complete directions on how to publish your package for Windows, visit https://github.com/meteor/meteor/wiki/Publishing-a-package-with-binary-dependencies-for-the-Windows-preview
On behalf of the Meteor team,
@stubailo, @Slava and @avital.
P.S. This is an automated message based on our database of package authors.
I'm running 1.1.0.3 and I'm just getting a disabled textarea with "Loading..." and no errors.
I'm on the latest version of Meteor and meteor-sharejs and running into a strange issue. When browsing to a document page through iron-router/push state navigation (clicking on any links or hitting the back button to land on a "room" with Ace sharejs editor) the document will always say "Loading...". If a re-render is triggered it gets updated, but otherwise remains "Loading...". You can see the issue by creating a new room on SeeMeCode.com, and by going Home then clicking the browser Back button. Refreshing the entire page works, and setting a new question or changing the programming language fixes it.
I've looked into sharejs-client.coffee, @_editor
and @data
are both undefined
in the sharejs.open
call when this happens. I haven't found a workaround yet.
Even if you have no text and you ctrl z on the editor, it will show the loading... text.
I upgraded to the latest Meteor version 1.0.2.1 and packages. I upgraded SharJS and added ShareJSAce, everything is running as expected on localhost. But after using demeteorizer to deploy to Modulus Ace never loads. The file "/packages/mizzao_sharejs/.npm/package/node_modules/share/webclient/ace.js" returns a 500 error, here's the server log:
{"line":"457","file":"webapp_server.js","message":"Error serving static file Error: ENOENT, stat '/mnt/data/2/programs/web.browser/packages/mizzao_sharejs/.npm/package/node_modules/share/webclient/ace.js'","time":{"$date":1419661767968},"level":"error"}
You can see the issue here:
https://www.seemecode.com/r/h2vaemo
Any ideas why this would be happening? Thanks!
I'm getting a build error after upgrading to the latest release of meteor-sharejs. I've tried with Meteor 0.7.1 and Meteor 0.8.0 with the same result :(
✗ meteor
[[[[[ ~/path/to/app ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While building package `sharejs`:
error: File not found: ace-builds/src-min/ace.js
=> Your application has errors. Waiting for file change.
If you do
meteor create docs
cd docs
meteor add mizzao:sharejs
and get this error:
mizzao:sharejs: INCOMPATIBLE WITH METEOR 0.9.0 OR LATER
it means you should clone this package from this github instead.
However, if you do
git clone --recursive https://github.com/mizzao/meteor-sharejs
cd meteor-sharejs/demo
meteor
and get this error:
W20140913-03:54:33.561(-4)? (STDERR) The package mizzao:sharejs at 0.6.0 is incompatible with Meteor 0.9.0 or later.
W20140913-03:54:33.897(-4)? (STDERR) If a new, compatible version of this package exists, running 'meteor update' should cause you to update.
try installing it like this instead:
git clone --recursive https://github.com/mizzao/meteor-sharejs
mv meteor-sharejs/demo docs
mkdir docs/packages
mv meteor-sharejs docs/packages/mizzao:sharejs
cd docs
meteor
and it should work.
I am running meteor 0.9.0 right now and I can not test it but will this support other editors? Namely will it support http://imperavi.com/redactor/? It not what would it take to add that support?
I am trying to get meteor-sharejs
to work in the most basic example:
export LC_ALL=C #for mongodb
curl https://install.meteor.com/ | sh
meteor create share
cd share
meteor add mizzao:sharejs
vi share.html #replace '{{> hello}}' with '{{> sharejsText docid=docid id="editor"}}'
sudo meteor --port 3333
And all I get is this lousy 'Loading':
I tried Meteor on Mac OS X and Ubuntu (in Docker with dedicated port), with Firefox, Chrome and Safari.
What should I change to get this basic example up and running correctly?
After running meteor add mizzao:sharejs
i get The package mizzao:sharejs at 0.6.0 is incompatible with Meteor 0.9.0 or later.
in my server console when running meteor and the atmosphere description also says "INCOMPATIBLE WITH METEOR 0.9.0 OR LATER"
I'm unclear as to how I can pass in, for example, the document id if it's stored in a collection via data context or programmatically.
For example:
<div>
{{> sharejsText docid="{{this.active_document._id}}" id="editor" }}
</div>
How can I have a variable holding the document ID and send it into the sharejsText helper? I tried enclosing it in triple braces to ensure it wouldn't be converted to a string literal, but that didn't assist since it was already inside of a helper.
Reviewing the codebase (I haven't learned yet to parse CoffeeScript effectively) it seems that there's a ReactiveVar that's created that's holding the document id. Should I try updating that instead?
Apologies if this is a handlebars/spacebars question rather than a sharejs question.
Help! i got the following error when i tried to launch your demo app. I'm using a windows Operating system.
The same error also appear when I loaded the package into a different project to try out.
W2035-02:08:04.259(8)? (STDERR) C:\Users\shawnlim\Documents\Websites\meteorjs\me teor-documents-demo\.meteor\local\build\programs\server\boot.js:194 W2035-02:08:04.574(8)? (STDERR) }).run(); W2035-02:08:04.575(8)? (STDERR) ^ W2035-02:08:04.576(8)? (STDERR) TypeError: Cannot read property 'type' of undefi ned W2035-02:08:04.577(8)? (STDERR) at Package (packages/sharejs\sharejs-server. coffee:13:10) W2035-02:08:04.578(8)? (STDERR) at packages/sharejs.js:94:4 W2035-02:08:04.579(8)? (STDERR) at packages/sharejs.js:103:3 W2035-02:08:04.579(8)? (STDERR) at mains (C:\Users\shawnlim\Documents\Websit es\meteorjs\meteor-documents-demo\.meteor\local\build\programs\server\boot.js:16 3:10) W2035-02:08:04.587(8)? (STDERR) at Array.forEach (native) W2035-02:08:04.588(8)? (STDERR) at Function._.each._.forEach (C:\Users\shawn lim\AppData\Local\.meteor\tools\36f9aeca0e\lib\node_modules\underscore\underscor e.js:79:11) W2035-02:08:04.589(8)? (STDERR) at C:\Users\shawnlim\Documents\Websites\mete orjs\meteor-documents-demo\.meteor\local\build\programs\server\boot.js:80:5 => Exited with code: 1 => Meteor server restarted
the errors pop by on both meteor 0.6.6 (in another app of mine) and 0.6.5 (in your demo app)
I'm using sharejs with another library, xregexp. xregexp tries to define itself if a define
function exists, but it logs some errors, because it passes some arguments that sharejs's define
doesn't expect.
Anyway, why is ace.js
being added with bare: true
, and what changes would it take to make sharejs work without the bare
flag?
It seems that in ace 1.2 some changes were made which made ace sharejs incompatible:
Here is the stacktrace:
Uncaught TypeError: Cannot read property 'range' of undefinedapplyToShareJS @ ace.js:23
window.sharejs.extendDoc.editorListener @ ace.js:78
EventEmitter._signal @ ace.js:3378
module.applyDelta @ ace.js:6476
module.insertMergedLines @ ace.js:6374
module.insert @ ace.js:6302
module.insert @ ace.js:8817
module.insert @ ace.js:11961
exports.commands.exec @ ace.js:11105
(anonymous function) @ ace.js:10441
EventEmitter._emit.EventEmitter._dispatchEvent @ ace.js:3368
module.exec @ ace.js:10469
module.onTextInput @ ace.js:4091
module.onTextInput @ ace.js:11987
sendText @ ace.js:2117
onInput @ ace.js:2126
The problem seems the following method:
applyToShareJS = function(editorDoc, delta, doc) {
var getStartOffsetPosition, pos, text;
getStartOffsetPosition = function(range) {
var i, line, lines, offset, _i, _len;
lines = editorDoc.getLines(0, range.start.row);
offset = 0;
for (i = _i = 0, _len = lines.length; _i < _len; i = ++_i) {
line = lines[i];
offset += i < range.start.row ? line.length : range.start.column;
}
return offset + range.start.row;
};
pos = getStartOffsetPosition(delta.range);
switch (delta.action) {
case 'insertText':
doc.insert(pos, delta.text);
break;
case 'removeText':
doc.del(pos, delta.text.length);
break;
case 'insertLines':
text = delta.lines.join('\n') + '\n';
doc.insert(pos, text);
break;
case 'removeLines':
text = delta.lines.join('\n') + '\n';
doc.del(pos, text.length);
break;
default:
throw new Error("unknown action: " + delta.action);
}
};
Where delta is defined different.
Examples who how to limit access only to a predefined set of users. But how could I allow everyone to see the content, but only authenticated users could edit documents?
In demo app, if you select CodeMirror editor, then select some text and try to drag it into another place, it gets automatically replicated until the browser crashes.
I'd like to try and fix that, but do you have any suggestions where to start looking for it?
Is it possible to have the editor with a rich interface for text?
Thanks
The error comes from this line: https://github.com/mizzao/meteor-sharejs/blob/master/sharejs-base/sharejs-server.coffee#L31
Meteor 1.0.4 now has a Meteor.Collection.prototype.rawDatabase()
method. I think this could be the replacement of this?!
Does this package support multiple instances?
As attempted by @robert-boulanger - however, he e-mailed me a bunch of files and I suggested he make a GitHub fork of this package instead.
Hi Andrew,
Your' right, it wasn't too hard to integrate it. I already was at this state when I wrote you yesterday. The reason it didn't work was the cm.js in the sharejs/webclient directory. It didn't work. I changed it with a different version and voila, all works now like expected.
Attached you find
cm.js -> should replace the current one in sharejs/.npm/node_modules/share/webclient
package.js, sharejs-client.coffee, sharejs-templates.html which I extended to handle CodeMirror as well
and client.coffee and index.html from your demo with CM integrated instead of ACE
It's up to you to integrate it into your current package. Packaging CodeMirror in the same way like Ace is a bit tricky, since the CM Checkout contains tons of html files meteor doesn't like. So I just integrated codemirror.js within the package and put the mode, css and keymap files into the client directory of the webapp.
However using CM instead of Ace allows you to create a collaborative texteditor also with non-monospaced fonts and allows simple formatting like we know from etherpad, which is great to write novels ;)
Thanks for your time and of course for developing sharejs-meteor in general.
Best regards
Robert
My comments on the above:
As I want to try out to implement a better undo manager. I wanted to setup the projects for development. However I always get this error:
While reading package from `/home/dsichau/meteor/packages/sharejs-ace`:
fs.js:665:18: ENOENT, no such file or directory 'ace-builds/src'
at Object.fs.readdirSync (fs.js:665:18)
at walk (package.js:19:28)
at getFilesFromFolder (package.js:47:16)
at package.js:68:21
The setup I have made was to clone the fork into $home/meteor/packages
The I run git submodule init
and git submodule update
However when I now want to add the package I get this problem.
What is the best way to setup this project for extending?
C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app [master]> meteor
[[[[[ C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While checking for mizzao:[email protected]:
error: No compatible binary build found for this package. Contact the package author and ask them to publish it
for your platform.
=> Your application has errors. Waiting for file change.
In general I seem to be able to edit but the syncronization is weirdly slow (I check with multiple open browser windows).
a lot of other users are complaining that whatever they type just disappears after a second. i'm using a bunch of other packages so it may be some conflict.
here it is live:
http://voodoohop.com/contentDetail/voodoohop-reveillon-na-natureza
oh and also weirdly sometimes when i load my page now i see a white page with the javascript content that should be interpreted by the browser. but this may be unrelated to meteor-sharejs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.