SourceKit Plugins - javascript

I've been playing with SourceKit, which is an awesome Chrome app for editing your Dropbox files using the Ajax.org Code Editor. In the release notes for version 0.5 and the readme, the author says
Arbitrary Javascript "plugins" are loaded post initialization from your Dropbox account. It is loaded from /.sourcekit/plugins/"
I've tried putting some Javascript in that directory, but can't seem to get anything to execute. Does anyone know of documentation for or examples of SourceKit plugins?
(I've submitted an issue on the GitHub project, but have gotten no response.)

SourceKit dev here. Forget about the old styled plugins that I was referring to in the old README CHANGELOG entry. I switched internally to use Dojo, Ace and Require JS. I haven't gotten to the point of adding plugin support just yet with this new rewrite...
It'll come in due time! In the meantime, if you have any ideas, I do take in pull requests via github: http://www.github.com/kenotron/sourcekit

It looks like these plugins for Bespin at Mozilla Labs should fit the bill but they don't seem to function at all at the moment. This "plugin_manager.js" file from the pilot library looks like it does just that for the SourceKit project and it was/is the same deal for Bespin/Skywriter/ACE.
I don't think at this stage there are any "downloadable" plugins for SourceKit, but the plugins in the Bespin Gallery might be worth hacking at.

Related

Is there a Prettier equivalent for Visual Studio 2017? (Or a way to set up something similar)

I recently started a job at a company who's product is built in ASP.Net. In the past I've used the Prettier extension in VS Code with my teams to keep everyone's styles uniform. I've searched for some similar extension in the VS MarketPlace but I can't find anything remotely close.
I know I can set up an editor config file but it doesn't cover nearly the same level of options as having a shared lint file that everyone uses. I know I can change the text editor options under tools but that only updates my settings.
What I really want is to be able to have a few global lint/config files in the solution that will apply styles to a file on save so everyone's formatting is consistent. If anyone has experience setting up something similar your thoughts/experience would be tremendously helpful. Thanks!
Yes! You can. It only works for JS, but you can find the installation instructions here.
(Taken from official docs)
For support with other languages, you can use this extension.

Conditionally load polyfills

I'm building a website which my target group is very general (ages 13-oo, so hello IE9, hello ancient android browser), so I need polyfills for some stuff (viewport, calc etc). Before I used Modernizr and some conditionals user agents to target IOS 6-7 etc. Then with yepnope.js I was loading the specific polyfills.
Now that modernizr 3.0 is out, I noticed that the Modernizr.load() is deprecated. Also the yepnope.js library is deprecated. As they say on their website
"There are new best practices that you should likely follow instead."
But I can't find any of them. After googling for some time everyone recommend Modernizr and Yepnope. But this issue is so fresh (the deprecation, the new version of Modernizr), and I can't find any new alternative method.
Maybe using of some module loader (like require.js) will do the job? And if yes, how?
I maintain the polyfill service at https://cdn.polyfill.io which may meet your needs. We have a library of around 800 polyfills, which are bundled selectively and served only to users that need them. You can run the service yourself or just load the polyfills from our CDN.
The most comprehensive write-up I've seen on this technique is Philip Walton's Loading Polyfills Only When Needed. It's too long to quote any parts here and should be read in its entirety so I'm not going to copy/paste sections into this answer.
I've spent my morning figuring this out myself. You can use jQuery's getScript method. I just answered a similar q here: https://stackoverflow.com/a/34518146/411436
from the yepnope repo
When it comes to loading things conditionally, we suggest that you
output a build for each combination of the things you're testing. This
might sound like it will generate a lot of files (it might), but
computers are pretty good at that. Then you can inline a script into
your page that only loads (asynchronously!) a single built script that
is tuned to the features of that user. All the performance win of
conditional loading, and none of the latency problems of loading 100
things at once.

Cordova/Phonegap OpenEars speech recognition

I am trying including the OpenEars plugin into phonegap/cordova using this plugin https://github.com/karljacuncha/OpenEarsPlugin
I followed the Readme but i ended up with an error of missing files, all these files are not found :(
Any help/suggestion on how to integrate the library?
thank you any advice appreciated!
As already mentioned on a comment, new, non-backwards compatible version (2.0) of OpenEars was released on 5th of December in 2014. This of course prevents it from working with old code such as the plugin in this case.
Basically there would be two options to get it working:
Use older version of OpenEars (last one was 1.7.1) but that doesn't seem to be possible as I wasn't able to download it from anywhere after extensive search.
Fix the code to work on newest OpenEars. It shouldn't be that hard and the code of plugin is only ~400 lines of code. Most of the changes are quite straightforward as described in the upgrade guide. Feel free to fork the project in GitHub or try to contact the original author of that plugin to make the fixes necessary.

javascript/flash library for file upload with file size limit and progress bar

Is there any "mainstream" library used for this purpose? Commonly spread, well maintained, documented etc.
I found these (using flash):
Uploadify - not many releases, latest 12/2010, no documentation (!)
SWFUpload - latest release 03/2010, documentation
fancyupload - looks buggy.
phpfileuploader - looks heavyweight, and looks commercial (?) I cannot read the licence (you can download it but are you allowed to use it forever without paying?)
plupload
New version of pure javascript (no flash) Valums' ajax upload claims to handle file size limit and progress bar, which is quite suspicious to me: these features require to guess the file size before the upload, which seems impossible in javascript (look also here). Or can it work?
Check jQuery-File-Upload. It's quite alright. (Also handles file size. Thats what you mean?)
A new contender seems to be FileAPI, it uses HTML5 APIs, with flash as a fallback:
https://github.com/mailru/FileAPI
Here is an article about it on Smashing magazine: http://coding.smashingmagazine.com/2013/10/11/we-wanted-to-build-a-file-uploader/
Plupload and Uploadify look best up to my current research point...
I tried swfupload, it looked fine at the first sight but as I tried to use it, it started to be more and more cluttered, many of the features you see in the demo are unexpectedly not standard parts of the library, you have to get the example code and hack it a lot, it's not configurable (e.g. queue timeouts) etc... Refrained from using it.

Eclipse Indigo with Aptana Studio 3 - Code hinting doesn't work when Dojo libraries are local

I've just setup Eclipse with Aptana Studio 3 and have been trying to get code completion / code hinting / autocomplete to work with mixed results.
I've followed the instructions here: http://wiki.appcelerator.org/display/tis/JavaScript+Library+Support
What I have discovered through testing is that when you install the .sdocml file and nothing else in a new project, it works fine.
As soon as I add a local copy of Dojo into the project the code hinting no longer works correctly.
I tried excluding the directory from view with a filter but that excludes it from the server so you can't use it. I've also tried removing the Dojo folder from Indexing but that changes nothing either.
If I load Dojo from a CDN, like Google, then I can use code completion.
The issue is that Eclipse picks up a parsed reference to dojo instead of the one from the sdocml file.
The problem seems, so far, to be confined to typing 'dojo.' but 'dijit.' and 'dojox.' work okay, maybe because of the parent-child relationship between those sub-libraries, if I were to guess.
I don't know if this is an Aptana bug or an Eclipse bug, but either way, it's a problem.
Does anyone know how to prioritize the code hinting sources and / or exclude certain directories from being a hinting source? Or is there another solution?
Thanks in advance,
Ken
Edit: Now that I have more code in the test project hinting does not work at all for 'dojo.' but still works fine for 'dojox.' and 'dijit.'. Only native JS methods hinting is available as a subset of 'dojo.'

Categories