Carrooi / Node-ModalDialog

[ABANDONED] Window modal dialogs for browser
MIT License
3 stars 0 forks source link

Error when running. #1

Closed m4a1fox closed 10 years ago

m4a1fox commented 10 years ago

Hello. I try use you module, but got an error: /node_modules/modal-dialog/node_modules/overlay/lib/Overlay.js:7 $ = window.jQuery || require('jquery'); ^ ReferenceError: window is not defined at Object. (node_modules/modal-dialog/node_modules/overlay/lib/Overlay.js:7:7) at Object. (node_modules/modal-dialog/node_modules/overlay/lib/Overlay.js:138:4) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/node_modules/modal-dialog/lib/Dialog.js:9:13) at Object. (node_modules/modal-dialog/lib/Dialog.js:436:4) 27 May 11:16:10 - [nodemon] app crashed - waiting for file changes before starting...

Can you help me with this?

davidkudera commented 10 years ago

Hello, you are probably trying to use this package in node environment, but it can be used only with browser. Also if you want to use some modal dialogs, you should consider some other package. There are better modal dialogs than this one, so I'm planning to drop support in near future.

m4a1fox commented 10 years ago

Other one? For example?

P.S. Really pity that you drop support. The idea is great.

P.S.S. In your opinion what is the better way to create the popup modal in nodejs + express?

davidkudera commented 10 years ago

Actually I like this idea too, but time is limited you know. But when I'm thinking about it, I'll maybe leave that and just add some "renderers". Like renderer for bootstrap modals and others.

Also node runs on server but modal dialog needs to be opened on browser environment. What exactly do you want to do?

m4a1fox commented 10 years ago

Well, you see, I think about functionally, which allow me implement some needed for me actions and their answers (content) in modal popup. At this moment, I'm trying create one-enter-point for all my future popups in my project.

P.S. Sorry for my English. I'm from Crimea btw.

davidkudera commented 10 years ago

I see, you will really have to use some modal popups for browser. You can find some for example with searching "javascript modal window" in google. Some of them are really nice and easy to use.

Than you can for example create route in express which will return simple page with answers etc. and display them in modal window in browser javascript.

P.S. Well than I should also apologize for my English. I'm from Czech republic, some of my colleague are from Ukraine or Russia.

m4a1fox commented 10 years ago

From Czech - nice to meet you ) Well, I think I would use jQueryUI dialog. What you think about this?

P.S. I was really surprised that you answered quickly.

davidkudera commented 10 years ago

me too ;-)

Well personally I don't like them to much because of their design and standard usage which si described on their site. I don't like the idea of having some HTML in my templates for all possible modal dialogs. Thats why I created this package which can create modal dialog just with plain javascript. But maybe there is some other way.

But all of that depends on website you are building. If you already using jquery, than it would be simplest solution. Same applies if you are using for example bootstrap or other libraries. For example for our company website we bought this one http://codecanyon.net/item/flavr-flat-jquery-popup-dialog/7021021

m4a1fox commented 10 years ago

Well, I'm choosing between jQuery modal and bootstrap modal, and stop my choose on jQuery - because of mode triggers actions.

davidkudera commented 10 years ago

Sure thing and good luck with your project ;-)