ng-contextmenu

I published a first (beta) version of my angularjs module ng-contextmenu, yesterday. This module uses the bootstrap‘s dropdown menu’s to add angular.js powered contextmenus to arbitary HTML Elements.

See in in action:

JS Bin

It’s really easy to use. Just add the angular module and the css file to your page and load the module into your angular app like this:

1
2
3
var app = angular.module('app', [
  'io.dennis.contextmenu'
]);

Then use the directives contextmenu, contextmenu-container and contextmenu-item in your templates:

1
2
3
4
5
6
7
8
9
10
11
<!-- contextmenu -->
<div contextmenu="meta.contextmenu" class="dropdown contextmenu">
  <ul class="dropdown-menu" role="menu">
    <li ng-bind="meta.contextmenu.$item.foo"></li>
    <li>
      <a href ng-click="do( meta.contextmenu.$item )">
        do!
      </a>
    </li>
  </ul>
</div>
1
2
3
4
5
6
7
8
9
10
<table class="table" contextmenu-container="meta.contextmenu">
  <tr>
    <th>Col1</th>
    <th>Col2</th>
  </tr>
  <tr ng-repeat="row in list" contextmenu-item="row">
    <td></td>
    <td></td>
  </tr>
</table>

No extra JS code required at all. ng-contextmenu only uses directives to link items to actions defined in your controller. None of the directives use isolated scopes what makes them really leightweight and fast.

github-card with polymer

I created my first polymer element today. Yeah ;) I wanted to dive into polymer for weeks and now finally found a bit time to do it. The plan was to add some kind of github repo info to this blog. I did things like that before with wordpress and octopress, this time I wanted to create something portable, not coupled to the blog in any way.

I remembered stumbling over a great github-card webcomponent a few days ago by Guille Paz. I looked at the code and tried to get it to work, but without really knowing how webcomponents work I had no success. Tough I decided to port that whole thing to polymer - good opportunity to learn something about google’s webcomponent framework You can see the result on the sidebar. Currently it’s just a ripoff port of Guille’s work, but I going to add some more features to it soon.

Of course the whole thing is on github. Clone it, use it, send me pull requests if you like!

welcome, hexo

Yeah, well, a new blog engine again ;) It seems I definitly like it more to install and configure blog engines than acutally write blog posts. Well, doesn’t matter as long as I’am having fun, right?

This time it’s hexo. Hexo is a static site generator like octopress, but instead of ruby it uses node.js <3

I found this simple theme based on bootstrap very nice. It’s a fork of a fork by Philipp Keller. I improved a few things and created my own fork (love opensource <3).

My new-blog-engine-resolutions:

  • write more blog posts ;)
  • write everything in vim. I’m still a big fan of Submlime Text, but improving my vim skills is very desirable.