Hirse / brackets-ungit

Brackets Extension to view Ungit directly in Brackets
MIT License
22 stars 5 forks source link

Promise is not defined #4

Closed Wikunia closed 9 years ago

Wikunia commented 9 years ago

Hi Jan,

the finished is better now but maybe just close the window to show that it is installed? :/ Unfortunately there is a bug in your new version: Uncaught ReferenceError: Promise is not defined main.js:61

Hirse commented 9 years ago

I am using the native JS Promise API and on my Brackets that works. I was not aware, that there were multiple environments to support.

Wikunia commented 9 years ago

Hmmm when I use promises I always use the jQuery Deferred ones

Wikunia commented 9 years ago

Looks like an ECMA 6 feature which maybe isn't support on my version of Brackets (no idea why) https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise

Hirse commented 9 years ago

Yes, I use the jQuery ones for other web development where I have to care for different browsers and versions.

But I was under the impression that if it runs in my Brackets it would run in any. I am using version 1.4 and Promises are defined.

Wikunia commented 9 years ago

I am using 1.5.0 (9acc39753) so a very new version.

Wikunia commented 9 years ago

The problem is that I am using Linux. I've chatted with Marcel Gerber and he said that Linux is running an old version of Chrome which doesn't support ECMA 6, yet.

Hirse commented 9 years ago

I have added a polyfill for Promise in e9273268d0f8c6e798178912bd3b7da6b79f8b04. Can you check if it works now on Linux please?

Wikunia commented 9 years ago

Unfortunately I am getting this error now:

[Extension] failed to load /home/ole/.config/Brackets/extensions/user/hirse.ungit - ReferenceError: Promise is not defined ErrorNotification.js:125
ReferenceError: Promise is not defined
    at Object.<anonymous> (file:///home/ole/.config/Brackets/extensions/user/hirse.ungit/main.js:18:25)
    at Object.context.execCb (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:1658:33)
    at Object.Module.check (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:869:55)
    at Object.<anonymous> (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:1121:34)
    at file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:132:23
    at file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:1164:21
    at each (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:57:31)
    at Object.Module.emit (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:1163:17)
    at Object.Module.check (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:925:30)
    at Object.<anonymous> (file:///opt/brackets/dev/src/thirdparty/requirejs/require.js:1121:34) 
Wikunia commented 9 years ago

Ah I see you forgot a var then it works ;) Thanks! Btw is it possible to scroll to the top when clicking on the menu button?

Hirse commented 9 years ago

About scrolling: The idea was that the viewer keeps the state it had when you closed it. (You can still jump to the top with the Home-key as in other websites)

Wikunia commented 9 years ago

Yes it's fine but the standard should be scroll to top ;)